max_stars_repo_path stringlengths 4 261 | max_stars_repo_name stringlengths 6 106 | max_stars_count int64 0 38.8k | id stringlengths 1 6 | text stringlengths 7 1.05M |
|---|---|---|---|---|
programs/oeis/039/A039208.asm | neoneye/loda | 22 | 104135 | ; A039208: Numbers whose base-11 representation has the same number of 8's and 10's.
; 0,1,2,3,4,5,6,7,9,11,12,13,14,15,16,17,18,20,22,23,24,25,26,27,28,29,31,33,34,35,36,37,38,39,40,42,44,45,46,47,48,49,50,51,53,55,56,57,58,59,60,61,62,64,66,67,68,69,70,71,72,73,75,77,78,79,80,81,82,83
mov $1,$0
mov $2,$0
add $2,2
lpb $2
add $0,$1
trn $2,2
sub $0,$2
trn $2,7
mov $1,$2
lpe
|
syscall_handler.asm | danielzy95/MIPS-Random | 0 | 101870 | <reponame>danielzy95/MIPS-Random<gh_stars>0
.text
syscall_handler:
# Prologue
addi $sp, $sp -12
sw $ra, 0($sp)
sw $s0, 4($sp)
sw $s1, 8($sp)
move $s0, $a0
addi $a0, $sp, 8
lw $a1, 12($s0)
jal get_int_from_user
slt $t0, $s1, $zero
bne $t0, $zero, else
li $t1, 17
slt $t0, $t1, $s1
bne $t0, $zero, else
la $t0, syscall_table
sll $t1, $s1, 2
add $t0, $t0, $t1
lw $t0, 0($t0)
lw $a0, 12($s0)
jalr $t0
sw $v0, 28($s0)
j epilogue
else:
jal thread_exit
epilogue:
lw $s1, 8($sp)
lw $s0, 4($sp)
lw $ra, 0($sp)
addi $sp, $sp, 12
jr $ra |
oeis/092/A092187.asm | neoneye/loda-programs | 11 | 2374 | <reponame>neoneye/loda-programs
; A092187: A092186(n)/2.
; Submitted by <NAME>
; 1,1,4,6,36,72,576,1440,14400,43200,518400,1814400,25401600,101606400,1625702400,7315660800,131681894400,658409472000,13168189440000,72425041920000,1593350922240000,9560105533440000,229442532802560000,1491376463216640000,38775788043632640000
mov $1,$0
gcd $0,2
seq $1,152875 ; Number of permutations of {1,2,...,n} (n >= 2) with all odd entries preceding all even entries or all even entries preceding all odd entries.
mul $0,$1
div $0,4
|
soundness/Syntax.agda | frelindb/agsyHOL | 17 | 6065 | <filename>soundness/Syntax.agda
module Syntax where
{-
open import Data.Nat hiding (_>_)
open import Data.Fin
open import Data.Product
open import Data.Bool
open import Relation.Binary.PropositionalEquality
-}
open import StdLibStuff
erase-subst :
(X : Set) → (Y : X → Set) →
(F : {x : X} → Y x) →
(x₁ x₂ : X) →
(eq : x₁ ≡ x₂) →
(P : Y x₂ → Set) →
P F →
P (subst Y eq F)
erase-subst X Y F .x₂ x₂ refl P h = h
-- type, ctx
data Type (n : ℕ) : Set where
$o : Type n
$i : Fin n → Type n
_>_ : Type n → Type n → Type n
data Ctx (n : ℕ) : Set where
ε : Ctx n
_∷_ : Type n → Ctx n → Ctx n
data Var : {n : ℕ} → Ctx n → Set where
this : ∀ {n t} → {Γ : Ctx n} → Var (t ∷ Γ)
next : ∀ {n t} → {Γ : Ctx n} → Var Γ → Var (t ∷ Γ)
lookup-Var : ∀ {n} → (Γ : Ctx n) → Var Γ → Type n
lookup-Var ε ()
lookup-Var (t ∷ _) this = t
lookup-Var (_ ∷ Γ) (next x) = lookup-Var Γ x
_++_ : ∀ {n} → Ctx n → Ctx n → Ctx n
ε ++ Γ = Γ
(t ∷ Γ₁) ++ Γ₂ = t ∷ (Γ₁ ++ Γ₂)
_r++_ : ∀ {n} → Ctx n → Ctx n → Ctx n
ε r++ Γ = Γ
(t ∷ Γ₁) r++ Γ₂ = Γ₁ r++ (t ∷ Γ₂)
-- stt formula
data Form : {n : ℕ} → Ctx n → Type n → Set where
var : ∀ {n} → {Γ : Ctx n} {t : Type n} → (x : Var Γ) → lookup-Var Γ x ≡ t → Form Γ t
N : ∀ {n} → {Γ : Ctx n} → Form Γ ($o > $o)
A : ∀ {n} → {Γ : Ctx n} → Form Γ ($o > ($o > $o))
Π : ∀ {n α} → {Γ : Ctx n} → Form Γ ((α > $o) > $o)
i : ∀ {n α} → {Γ : Ctx n} → Form Γ ((α > $o) > α)
app : ∀ {n α β} → {Γ : Ctx n} → Form Γ (α > β) → Form Γ α → Form Γ β
lam : ∀ {n β} → {Γ : Ctx n} → (α : _) → Form (α ∷ Γ) β → Form Γ (α > β)
-- abbreviations (TPTP-like notation)
~ : ∀ {n} → {Γ : Ctx n} → Form Γ $o → Form Γ $o
~ F = app N F
_||_ : ∀ {n} → {Γ : Ctx n} → Form Γ $o → Form Γ $o → Form Γ $o
F || G = app (app A F) G
_&_ : ∀ {n} → {Γ : Ctx n} → Form Γ $o → Form Γ $o → Form Γ $o
F & G = ~ ((~ F) || (~ G))
_=>_ : ∀ {n} → {Γ : Ctx n} → Form Γ $o → Form Γ $o → Form Γ $o
F => G = (~ F) || G
![_]_ : ∀ {n} → {Γ : Ctx n} → (α : Type n) → Form (α ∷ Γ) $o → Form Γ $o
![ α ] F = app Π (lam α F)
?[_]_ : ∀ {n} → {Γ : Ctx n} → (α : Type n) → Form (α ∷ Γ) $o → Form Γ $o
?[ α ] F = ~ (![ α ] ~ F)
ι : ∀ {n} → {Γ : Ctx n} → (α : Type n) → Form (α ∷ Γ) $o → Form Γ α
ι α F = app i (lam α F)
Q : ∀ {n} → {Γ : Ctx n} → (α : Type n) → Form Γ (α > (α > $o))
Q α = lam α (lam α (![ α > $o ] (app (var this refl) (var (next (next this)) refl) => app (var this refl) (var (next this) refl))))
_==_ : ∀ {n} → {Γ : Ctx n} → {α : Type n} → Form Γ α → Form Γ α → Form Γ $o
F == G = app (app (Q _) F) G
_<=>_ : ∀ {n} → {Γ : Ctx n} → Form Γ $o → Form Γ $o → Form Γ $o
F <=> G = (F => G) & (G => F)
$true : ∀ {n} → {Γ : Ctx n} → Form Γ $o
$true = ![ $o ] (var this refl => var this refl)
$false : ∀ {n} → {Γ : Ctx n} → Form Γ $o
$false = ![ $o ] var this refl
^[_]_ : ∀ {n Γ t₂} → (t₁ : Type n) → Form (t₁ ∷ Γ) t₂ → Form Γ (t₁ > t₂)
^[ tp ] t = lam tp t
_·_ : ∀ {n} → {Γ : Ctx n} → ∀ {t₁ t₂} → Form Γ (t₁ > t₂) → Form Γ t₁ → Form Γ t₂
t₁ · t₂ = app t₁ t₂
$ : ∀ {n Γ} → {t : Type n} (v : Var Γ) → {eq : lookup-Var Γ v ≡ t} → Form Γ t
$ v {p} = var v p
-- occurs in
eq-Var : ∀ {n} {Γ : Ctx n} → Var Γ → Var Γ → Bool
eq-Var this this = true
eq-Var this (next y) = false
eq-Var (next x) this = false
eq-Var (next x) (next y) = eq-Var x y
occurs : ∀ {n Γ} → {t : Type n} → Var Γ → Form Γ t → Bool
occurs x (var x' p) = eq-Var x x'
occurs x N = false
occurs x A = false
occurs x Π = false
occurs x i = false
occurs x (app f₁ f₂) = occurs x f₁ ∨ occurs x f₂
occurs x (lam α f) = occurs (next x) f
-- weakening and substitution
weak-var : ∀ {n} → {β : Type n} (Γ₁ Γ₂ : Ctx n) → (x : Var (Γ₁ ++ Γ₂)) → Var (Γ₁ ++ (β ∷ Γ₂))
weak-var ε Γ₂ x = next x
weak-var (t ∷ Γ₁) Γ₂ this = this
weak-var (t ∷ Γ₁) Γ₂ (next x) = next (weak-var Γ₁ Γ₂ x)
weak-var-p : ∀ {n} → {β : Type n} (Γ₁ Γ₂ : Ctx n) → (x : Var (Γ₁ ++ Γ₂)) →
lookup-Var (Γ₁ ++ (β ∷ Γ₂)) (weak-var Γ₁ Γ₂ x) ≡ lookup-Var (Γ₁ ++ Γ₂) x
weak-var-p ε Γ₂ x = refl
weak-var-p (t ∷ Γ₁) Γ₂ this = refl
weak-var-p (t ∷ Γ₁) Γ₂ (next x) = weak-var-p Γ₁ Γ₂ x
weak-i : ∀ {n} → {α β : Type n} (Γ₁ Γ₂ : Ctx n) → Form (Γ₁ ++ Γ₂) α → Form (Γ₁ ++ (β ∷ Γ₂)) α
weak-i Γ₁ Γ₂ (var x p) = var (weak-var Γ₁ Γ₂ x) (trans (weak-var-p Γ₁ Γ₂ x) p)
weak-i Γ₁ Γ₂ N = N
weak-i Γ₁ Γ₂ A = A
weak-i Γ₁ Γ₂ Π = Π
weak-i Γ₁ Γ₂ i = i
weak-i Γ₁ Γ₂ (app f₁ f₂) = app (weak-i Γ₁ Γ₂ f₁) (weak-i Γ₁ Γ₂ f₂)
weak-i Γ₁ Γ₂ (lam α f) = lam α (weak-i (α ∷ Γ₁) Γ₂ f)
weak : ∀ {n} → {Γ : Ctx n} {α β : Type n} → Form Γ α → Form (β ∷ Γ) α
weak {_} {Γ} = weak-i ε Γ
sub-var : ∀ {n} → {α β : Type n} (Γ₁ Γ₂ : Ctx n) → Form Γ₂ α → (x : Var (Γ₁ ++ (α ∷ Γ₂))) → lookup-Var (Γ₁ ++ (α ∷ Γ₂)) x ≡ β → Form (Γ₁ ++ Γ₂) β
sub-var ε Γ₂ g this p = subst (Form Γ₂) p g
sub-var ε Γ₂ g (next x) p = var x p
sub-var (t ∷ Γ₁) Γ₂ g this p = var this p
sub-var (t ∷ Γ₁) Γ₂ g (next x) p = weak (sub-var Γ₁ Γ₂ g x p)
sub-i : ∀ {n} → {α β : Type n} (Γ₁ Γ₂ : Ctx n) → Form Γ₂ α → Form (Γ₁ ++ (α ∷ Γ₂)) β → Form (Γ₁ ++ Γ₂) β
sub-i Γ₁ Γ₂ g (var x p) = sub-var Γ₁ Γ₂ g x p
sub-i Γ₁ Γ₂ g N = N
sub-i Γ₁ Γ₂ g A = A
sub-i Γ₁ Γ₂ g Π = Π
sub-i Γ₁ Γ₂ g i = i
sub-i Γ₁ Γ₂ g (app f₁ f₂) = app (sub-i Γ₁ Γ₂ g f₁) (sub-i Γ₁ Γ₂ g f₂)
sub-i Γ₁ Γ₂ g (lam α f) = lam α (sub-i (α ∷ Γ₁) Γ₂ g f)
sub : ∀ {n} → {Γ : Ctx n} {α β : Type n} → Form Γ α → Form (α ∷ Γ) β → Form Γ β
sub {_} {Γ} = sub-i ε Γ
-- properties about weak and sub
sub-weak-var-p-23-this-2 : ∀ {n} → {u v β : Type n} {Γ : Ctx n} (Γ' : Ctx n) (G : Form (v ∷ Γ) u) →
(Γ'' : Ctx n)
(h₁ : β ∷ Γ'' ≡ β ∷ (Γ' ++ (u ∷ (v ∷ Γ))))
(p'' : lookup-Var ((β ∷ Γ') ++ (u ∷ (v ∷ Γ))) (subst Var h₁ this) ≡ lookup-Var (β ∷ (Γ' ++ (v ∷ Γ))) this) →
var this refl ≡ sub-var (β ∷ Γ') (v ∷ Γ) G (subst Var h₁ this) p''
sub-weak-var-p-23-this-2 {n} {u} {v} {β} {Γ} Γ' G .(Γ' ++ (u ∷ (v ∷ Γ))) refl refl = refl
sub-weak-var-p-23-this-1 : ∀ {n} → {u v β : Type n} {Γ : Ctx n} (Γ' : Ctx n) (G : Form (v ∷ Γ) u) →
(h₁ : β ∷ ((Γ' ++ (u ∷ ε)) ++ (v ∷ Γ)) ≡ β ∷ (Γ' ++ (u ∷ (v ∷ Γ))))
(Γ'' : Ctx n)
(h₂ : β ∷ Γ'' ≡ β ∷ ((Γ' ++ (u ∷ ε)) ++ Γ))
(p'' : lookup-Var (β ∷ (Γ' ++ (u ∷ (v ∷ Γ)))) (subst Var h₁ (weak-var (β ∷ (Γ' ++ (u ∷ ε))) Γ (subst Var h₂ this))) ≡ β) →
var this refl ≡
sub-var (β ∷ Γ') (v ∷ Γ) G (subst Var h₁ (weak-var (β ∷ (Γ' ++ (u ∷ ε))) Γ (subst Var h₂ this))) p''
sub-weak-var-p-23-this-1 {n} {u} {v} {β} {Γ} Γ' G h₁ .((Γ' ++ (u ∷ ε)) ++ Γ) refl p'' = sub-weak-var-p-23-this-2 Γ' G ((Γ' ++ (u ∷ ε)) ++ (v ∷ Γ)) h₁ p''
mutual
sub-weak-var-p-23-next-2 : ∀ {n} → {u v β t : Type n} {Γ : Ctx n} (Γ' : Ctx n) (x : Var (Γ' ++ Γ)) (G : Form (v ∷ Γ) u) →
(p : lookup-Var (Γ' ++ (v ∷ Γ)) (weak-var Γ' Γ x) ≡ β)
(Γ'' : Ctx n)
(h₁₁ : t ∷ Γ'' ≡ t ∷ (Γ' ++ (u ∷ (v ∷ Γ))))
(h₁₂ : (Γ' ++ (u ∷ ε)) ++ (v ∷ Γ) ≡ Γ'')
(h₂ : Γ' ++ (u ∷ Γ) ≡ (Γ' ++ (u ∷ ε)) ++ Γ)
(p'' : lookup-Var ((t ∷ Γ') ++ (u ∷ (v ∷ Γ))) (subst Var h₁₁ (next (subst Var h₁₂ (weak-var (Γ' ++ (u ∷ ε)) Γ (subst Var h₂ (weak-var Γ' Γ x)))))) ≡ β) →
var (next (weak-var Γ' Γ x)) p ≡
sub-var (t ∷ Γ') (v ∷ Γ) G (subst Var h₁₁ (next (subst Var h₁₂ (weak-var (Γ' ++ (u ∷ ε)) Γ (subst Var h₂ (weak-var Γ' Γ x)))))) p''
sub-weak-var-p-23-next-2 {n} {u} {v} {β} {t} {Γ} Γ' x G p .(Γ' ++ (u ∷ (v ∷ Γ))) refl h₁₂ h₂ p'' = subst (λ z → var (next {_} {t} (weak-var Γ' Γ x)) p ≡ weak-i ε (Γ' ++ (v ∷ Γ)) z) {-{var (weak-var Γ' Γ x) p} {sub-var Γ' (v ∷ Γ) G (subst Var h₁₂ (weak-var (Γ' ++ (u ∷ ε)) Γ (subst Var h₂ (weak-var Γ' Γ x)))) p''}-} (sub-weak-var-p-23 {n} {u} {v} {β} {Γ} Γ' x G p h₁₂ h₂ p'') refl
sub-weak-var-p-23-next-1 : ∀ {n} → {u v β t : Type n} {Γ : Ctx n} (Γ' : Ctx n) (x : Var (Γ' ++ Γ)) (G : Form (v ∷ Γ) u) →
(p : lookup-Var (Γ' ++ (v ∷ Γ)) (weak-var Γ' Γ x) ≡ β)
(h₁ : t ∷ ((Γ' ++ (u ∷ ε)) ++ (v ∷ Γ)) ≡ t ∷ (Γ' ++ (u ∷ (v ∷ Γ))))
(Γ'' : Ctx n)
(h₂₁ : t ∷ Γ'' ≡ t ∷ ((Γ' ++ (u ∷ ε)) ++ Γ))
(h₂₂ : Γ' ++ (u ∷ Γ) ≡ Γ'')
(p'' : lookup-Var ((t ∷ Γ') ++ (u ∷ (v ∷ Γ))) (subst Var h₁ (weak-var (t ∷ (Γ' ++ (u ∷ ε))) Γ (subst Var h₂₁ (next (subst Var h₂₂ (weak-var Γ' Γ x)))))) ≡ β) →
var (next (weak-var Γ' Γ x)) p ≡
sub-var (t ∷ Γ') (v ∷ Γ) G (subst Var h₁ (weak-var (t ∷ (Γ' ++ (u ∷ ε))) Γ (subst Var h₂₁ (next (subst Var h₂₂ (weak-var Γ' Γ x)))))) p''
sub-weak-var-p-23-next-1 {n} {u} {v} {β} {t} {Γ} Γ' x G p h₁ .((Γ' ++ (u ∷ ε)) ++ Γ) refl h₂₂ p'' = sub-weak-var-p-23-next-2 Γ' x G p ((Γ' ++ (u ∷ ε)) ++ (v ∷ Γ)) h₁ refl h₂₂ p''
sub-weak-var-p-23 : ∀ {n} → {u v β : Type n} {Γ : Ctx n} (Γ' : Ctx n) (x : Var (Γ' ++ Γ)) (G : Form (v ∷ Γ) u) →
(p : lookup-Var (Γ' ++ (v ∷ Γ)) (weak-var Γ' Γ x) ≡ β) →
(h₁ : (Γ' ++ (u ∷ ε)) ++ (v ∷ Γ) ≡ Γ' ++ (u ∷ (v ∷ Γ))) →
(h₂ : Γ' ++ (u ∷ Γ) ≡ (Γ' ++ (u ∷ ε)) ++ Γ) →
(p'' : lookup-Var (Γ' ++ (u ∷ (v ∷ Γ))) (subst Var h₁ (weak-var (Γ' ++ (u ∷ ε)) Γ (subst Var h₂ (weak-var Γ' Γ x)))) ≡ β) →
var (weak-var Γ' Γ x) p ≡
sub-var Γ' (v ∷ Γ) G (subst Var h₁ (weak-var (Γ' ++ (u ∷ ε)) Γ (subst Var h₂ (weak-var Γ' Γ x)))) p''
sub-weak-var-p-23 ε x G refl refl refl refl = refl
sub-weak-var-p-23 {n} {u} {v} {β} {Γ} (.β ∷ Γ') this G refl h₁ h₂ p'' = sub-weak-var-p-23-this-1 Γ' G h₁ (Γ' ++ (u ∷ Γ)) h₂ p''
sub-weak-var-p-23 {n} {u} {v} {β} {Γ} (t ∷ Γ') (next x) G p h₁ h₂ p'' = sub-weak-var-p-23-next-1 Γ' x G p h₁ (Γ' ++ (u ∷ Γ)) h₂ refl p''
sub-weak-p-23-var-2 : ∀ {n} → {u v β : Type n} {Γ : Ctx n} (Γ' : Ctx n) (x : Var (Γ' ++ Γ)) (G : Form (v ∷ Γ) u) →
(p : lookup-Var (Γ' ++ Γ) x ≡ β) →
(Γ'' : Ctx n) →
(h₁₁ : Γ'' ≡ Γ' ++ (u ∷ (v ∷ Γ))) →
(h₁₂ : (Γ' ++ (u ∷ ε)) ++ (v ∷ Γ) ≡ Γ'') →
(h₂ : Γ' ++ (u ∷ Γ) ≡ (Γ' ++ (u ∷ ε)) ++ Γ) →
(p'' : lookup-Var Γ'' (subst Var h₁₂ (weak-var (Γ' ++ (u ∷ ε)) Γ (subst Var h₂ (weak-var Γ' Γ x)))) ≡ β) →
var (weak-var Γ' Γ x) (trans (weak-var-p Γ' Γ x) p) ≡
sub-i Γ' (v ∷ Γ) G (subst (λ z → Form z β) h₁₁ (var (subst Var h₁₂ (weak-var (Γ' ++ (u ∷ ε)) Γ (subst Var h₂ (weak-var Γ' Γ x)))) p''))
sub-weak-p-23-var-2 {n} {u} {v} {β} {Γ} Γ' x G p .(Γ' ++ (u ∷ (v ∷ Γ))) refl h₁₂ h₂ p'' = sub-weak-var-p-23 Γ' x G (trans (weak-var-p Γ' Γ x) p) h₁₂ h₂ p''
sub-weak-p-23-var-1 : ∀ {n} → {u v β : Type n} {Γ : Ctx n} (Γ' : Ctx n) (x : Var (Γ' ++ Γ)) (G : Form (v ∷ Γ) u) →
(p : lookup-Var (Γ' ++ Γ) x ≡ β) →
(h₁ : (Γ' ++ (u ∷ ε)) ++ (v ∷ Γ) ≡ Γ' ++ (u ∷ (v ∷ Γ))) →
(Γ'' : Ctx n) →
(h₂₁ : Γ'' ≡ (Γ' ++ (u ∷ ε)) ++ Γ) →
(h₂₂ : Γ' ++ (u ∷ Γ) ≡ Γ'') →
(p' : lookup-Var Γ'' (subst Var h₂₂ (weak-var Γ' Γ x)) ≡ β) →
var (weak-var Γ' Γ x) (trans (weak-var-p Γ' Γ x) p) ≡
sub-i Γ' (v ∷ Γ) G (subst (λ z → Form z β) h₁ (weak-i (Γ' ++ (u ∷ ε)) Γ (subst (λ z → Form z β) h₂₁ (var (subst Var h₂₂ (weak-var Γ' Γ x)) p'))))
sub-weak-p-23-var-1 {n} {u} {v} {β} {Γ} Γ' x G p h₁ .((Γ' ++ (u ∷ ε)) ++ Γ) refl h₂₂ p' = sub-weak-p-23-var-2 Γ' x G p ((Γ' ++ (u ∷ ε)) ++ (v ∷ Γ)) h₁ refl h₂₂ (trans (weak-var-p (Γ' ++ (u ∷ ε)) Γ (subst Var h₂₂ (weak-var Γ' Γ x))) p')
mutual
sub-weak-p-23-app-2 : ∀ {n} → {t u v w : Type n} {Γ : Ctx n} (Γ' : Ctx n) (f₁ : Form (Γ' ++ Γ) (w > t)) (f₂ : Form (Γ' ++ Γ) w) (G : Form (v ∷ Γ) u) →
(Γ'' : Ctx n) →
(h₁₁ : Γ'' ≡ Γ' ++ (u ∷ (v ∷ Γ))) →
(h₁₂ : (Γ' ++ (u ∷ ε)) ++ (v ∷ Γ) ≡ Γ'') →
(h₂ : Γ' ++ (u ∷ Γ) ≡ (Γ' ++ (u ∷ ε)) ++ Γ) →
app (weak-i Γ' Γ f₁) (weak-i Γ' Γ f₂) ≡
sub-i Γ' (v ∷ Γ) G (subst (λ z → Form z t) h₁₁ (app (subst (λ z → Form z (w > t)) h₁₂ (weak-i (Γ' ++ (u ∷ ε)) Γ (subst (λ z → Form z (w > t)) h₂ (weak-i Γ' Γ f₁)))) (subst (λ z → Form z w) h₁₂ (weak-i (Γ' ++ (u ∷ ε)) Γ (subst (λ z → Form z w) h₂ (weak-i Γ' Γ f₂))))))
sub-weak-p-23-app-2 {n} {t} {u} {v} {w} {Γ} Γ' f₁ f₂ G .(Γ' ++ (u ∷ (v ∷ Γ))) refl h₁₂ h₂ =
trans (cong (λ z → app z (weak-i Γ' Γ f₂)) (
sub-weak-p-23-i Γ' f₁ G h₁₂ h₂
))
(cong (λ z → app (sub-i Γ' (v ∷ Γ) G (subst (λ z → Form z (w > t)) h₁₂ (weak-i (Γ' ++ (u ∷ ε)) Γ (subst (λ z → Form z (w > t)) h₂ (weak-i Γ' Γ f₁))))) z) (
sub-weak-p-23-i Γ' f₂ G h₁₂ h₂
))
sub-weak-p-23-app-1 : ∀ {n} → {t u v w : Type n} {Γ : Ctx n} (Γ' : Ctx n) (f₁ : Form (Γ' ++ Γ) (w > t)) (f₂ : Form (Γ' ++ Γ) w) (G : Form (v ∷ Γ) u) →
(h₁ : (Γ' ++ (u ∷ ε)) ++ (v ∷ Γ) ≡ Γ' ++ (u ∷ (v ∷ Γ))) →
(Γ'' : Ctx n) →
(h₂₁ : Γ'' ≡ (Γ' ++ (u ∷ ε)) ++ Γ) →
(h₂₂ : Γ' ++ (u ∷ Γ) ≡ Γ'') →
app (weak-i Γ' Γ f₁) (weak-i Γ' Γ f₂) ≡
sub-i Γ' (v ∷ Γ) G (subst (λ z → Form z t) h₁ (weak-i (Γ' ++ (u ∷ ε)) Γ (subst (λ z → Form z t) h₂₁ (app (subst (λ z → Form z (w > t)) h₂₂ (weak-i Γ' Γ f₁)) (subst (λ z → Form z w) h₂₂ (weak-i Γ' Γ f₂))))))
sub-weak-p-23-app-1 {n} {t} {u} {v} {w} {Γ} Γ' f₁ f₂ G h₁ .((Γ' ++ (u ∷ ε)) ++ Γ) refl h₂₂ = sub-weak-p-23-app-2 Γ' f₁ f₂ G ((Γ' ++ (u ∷ ε)) ++ (v ∷ Γ)) h₁ refl h₂₂
sub-weak-p-23-lam-2 : ∀ {n} → {u v α β : Type n} {Γ : Ctx n} (Γ' : Ctx n) (f : Form ((α ∷ Γ') ++ Γ) β) (G : Form (v ∷ Γ) u) →
(Γ'' : Ctx n) →
(h₁₁ : Γ'' ≡ Γ' ++ (u ∷ (v ∷ Γ))) →
(h₁₂ : (Γ' ++ (u ∷ ε)) ++ (v ∷ Γ) ≡ Γ'') →
(h₂ : α ∷ (Γ' ++ (u ∷ Γ)) ≡ α ∷ ((Γ' ++ (u ∷ ε)) ++ Γ)) →
lam α (weak-i (α ∷ Γ') Γ f) ≡
sub-i Γ' (v ∷ Γ) G (subst (λ z → Form z (α > β)) h₁₁ (lam α (subst (λ z → Form z β) (cong (_∷_ α) h₁₂) (weak-i (α ∷ (Γ' ++ (u ∷ ε))) Γ (subst (λ z → Form z β) h₂ (weak-i (α ∷ Γ') Γ f))))))
sub-weak-p-23-lam-2 {n} {u} {v} {α} {β} {Γ} Γ' f G .(Γ' ++ (u ∷ (v ∷ Γ))) refl h₁₂ h₂ = cong (lam α) (
sub-weak-p-23-i (α ∷ Γ') f G (cong (_∷_ α) h₁₂) h₂)
sub-weak-p-23-lam-1 : ∀ {n} → {u v α β : Type n} {Γ : Ctx n} (Γ' : Ctx n) (f : Form ((α ∷ Γ') ++ Γ) β) (G : Form (v ∷ Γ) u) →
(h₁ : (Γ' ++ (u ∷ ε)) ++ (v ∷ Γ) ≡ Γ' ++ (u ∷ (v ∷ Γ))) →
(Γ'' : Ctx n) →
(h₂₁ : Γ'' ≡ (Γ' ++ (u ∷ ε)) ++ Γ) →
(h₂₂ : Γ' ++ (u ∷ Γ) ≡ Γ'') →
lam α (weak-i (α ∷ Γ') Γ f) ≡
sub-i Γ' (v ∷ Γ) G (subst (λ z → Form z (α > β)) h₁ (weak-i (Γ' ++ (u ∷ ε)) Γ (subst (λ z → Form z (α > β)) h₂₁ (lam α (subst (λ z → Form z β) (cong (λ z → α ∷ z) h₂₂) (weak-i (α ∷ Γ') Γ f))))))
sub-weak-p-23-lam-1 {n} {u} {v} {α} {β} {Γ} Γ' f G h₁ .((Γ' ++ (u ∷ ε)) ++ Γ) refl h₂₂ = sub-weak-p-23-lam-2 Γ' f G ((Γ' ++ (u ∷ ε)) ++ (v ∷ Γ)) h₁ refl (cong (_∷_ α) h₂₂)
sub-weak-p-23-i : ∀ {n} → {t u v : Type n} {Γ : Ctx n} (Γ' : Ctx n) (F : Form (Γ' ++ Γ) t) (G : Form (v ∷ Γ) u) →
(h₁ : (Γ' ++ (u ∷ ε)) ++ (v ∷ Γ) ≡ Γ' ++ (u ∷ (v ∷ Γ))) →
(h₂ : Γ' ++ (u ∷ Γ) ≡ (Γ' ++ (u ∷ ε)) ++ Γ) →
weak-i Γ' Γ F ≡ sub-i Γ' (v ∷ Γ) G (subst (λ z → Form z t) h₁ (weak-i (Γ' ++ (u ∷ ε)) Γ (subst (λ z → Form z t) h₂ (weak-i Γ' Γ F))))
-- sub-weak-p-23-i {_} {.(lookup-Var (Γ' ++ Γ) x)} {u} {v} {Γ} Γ' (var x) G h₁ h₂ = {!!}
sub-weak-p-23-i {_} {β} {u} {v} {Γ} Γ' (var x p) G h₁ h₂ = sub-weak-p-23-var-1 Γ' x G p h₁ (Γ' ++ (u ∷ Γ)) h₂ refl (trans (weak-var-p Γ' Γ x) p)
sub-weak-p-23-i {_} {.($o > $o)} {u} {v} {Γ} Γ' N G h₁ h₂ = erase-subst (Ctx _) (λ z → Form z ($o > $o)) N (Γ' ++ (u ∷ Γ)) ((Γ' ++ (u ∷ ε)) ++ Γ) h₂ (λ z → N ≡ sub-i Γ' (v ∷ Γ) G (subst (λ z → Form z ($o > $o)) h₁ (weak-i (Γ' ++ (u ∷ ε)) Γ z))) (erase-subst (Ctx _) (λ z → Form z ($o > $o)) N ((Γ' ++ (u ∷ ε)) ++ (v ∷ Γ)) (Γ' ++ (u ∷ (v ∷ Γ))) h₁ (λ z → N ≡ sub-i Γ' (v ∷ Γ) G z) refl) -- rewrite h₂ | h₁ = refl
sub-weak-p-23-i {_} {.($o > ($o > $o))} {u} {v} {Γ} Γ' A G h₁ h₂ = erase-subst (Ctx _) (λ z → Form z ($o > ($o > $o))) A (Γ' ++ (u ∷ Γ)) ((Γ' ++ (u ∷ ε)) ++ Γ) h₂ (λ z → A ≡ sub-i Γ' (v ∷ Γ) G (subst (λ z → Form z ($o > ($o > $o))) h₁ (weak-i (Γ' ++ (u ∷ ε)) Γ z))) (erase-subst (Ctx _) (λ z → Form z ($o > ($o > $o))) A ((Γ' ++ (u ∷ ε)) ++ (v ∷ Γ)) (Γ' ++ (u ∷ (v ∷ Γ))) h₁ (λ z → A ≡ sub-i Γ' (v ∷ Γ) G z) refl) -- rewrite h₂ | h₁ = refl
sub-weak-p-23-i {_} {((t > $o) > $o)} {u} {v} {Γ} Γ' Π G h₁ h₂ = erase-subst (Ctx _) (λ z → Form z ((t > $o) > $o)) Π (Γ' ++ (u ∷ Γ)) ((Γ' ++ (u ∷ ε)) ++ Γ) h₂ (λ z → Π ≡ sub-i Γ' (v ∷ Γ) G (subst (λ z → Form z ((t > $o) > $o)) h₁ (weak-i (Γ' ++ (u ∷ ε)) Γ z))) (erase-subst (Ctx _) (λ z → Form z ((t > $o) > $o)) Π ((Γ' ++ (u ∷ ε)) ++ (v ∷ Γ)) (Γ' ++ (u ∷ (v ∷ Γ))) h₁ (λ z → Π ≡ sub-i Γ' (v ∷ Γ) G z) refl) -- rewrite h₂ | h₁ = refl
sub-weak-p-23-i {_} {((t > $o) > .t)} {u} {v} {Γ} Γ' i G h₁ h₂ = erase-subst (Ctx _) (λ z → Form z ((t > $o) > t)) i (Γ' ++ (u ∷ Γ)) ((Γ' ++ (u ∷ ε)) ++ Γ) h₂ (λ z → i ≡ sub-i Γ' (v ∷ Γ) G (subst (λ z → Form z ((t > $o) > t)) h₁ (weak-i (Γ' ++ (u ∷ ε)) Γ z))) (erase-subst (Ctx _) (λ z → Form z ((t > $o) > t)) i ((Γ' ++ (u ∷ ε)) ++ (v ∷ Γ)) (Γ' ++ (u ∷ (v ∷ Γ))) h₁ (λ z → i ≡ sub-i Γ' (v ∷ Γ) G z) refl) -- rewrite h₂ | h₁ = refl
sub-weak-p-23-i {_} {t} {u} {v} {Γ} Γ' (app f₁ f₂) G h₁ h₂ = sub-weak-p-23-app-1 Γ' f₁ f₂ G h₁ (Γ' ++ (u ∷ Γ)) h₂ refl
sub-weak-p-23-i {_} {α > β} {u} {v} {Γ} Γ' (lam .α f) G h₁ h₂ = sub-weak-p-23-lam-1 Γ' f G h₁ (Γ' ++ (u ∷ Γ)) h₂ refl
sub-weak-var-p-1-this-2 : ∀ {n} → {u v β : Type n} {Γ : Ctx n} (Γ' : Ctx n) (G : Form Γ u) →
(Γ'' : Ctx n)
(h₁ : β ∷ Γ'' ≡ β ∷ (Γ' ++ (v ∷ Γ)))
(p' : β ≡ β) →
var this refl ≡
subst (λ z → Form z β) h₁ (var this p')
sub-weak-var-p-1-this-2 {n} {u} {v} {β} {Γ} Γ' G ._ refl refl = refl
sub-weak-var-p-1-this-1 : ∀ {n} → {u v β : Type n} {Γ : Ctx n} (Γ' : Ctx n) (G : Form Γ u) →
(h₁ : β ∷ ((Γ' ++ (v ∷ ε)) ++ Γ) ≡ β ∷ (Γ' ++ (v ∷ Γ)))
(Γ'' : Ctx n)
(h₂ : β ∷ Γ'' ≡ β ∷ ((Γ' ++ (v ∷ ε)) ++ (u ∷ Γ)))
(p' : lookup-Var ((β ∷ (Γ' ++ (v ∷ ε))) ++ (u ∷ Γ)) (subst Var h₂ this) ≡ β) →
var this refl ≡
subst (λ z → Form z β) h₁ (sub-var (β ∷ (Γ' ++ (v ∷ ε))) Γ G (subst Var h₂ this) p')
sub-weak-var-p-1-this-1 {n} {u} {v} {β} {Γ} Γ' G h₁ ._ refl p' = sub-weak-var-p-1-this-2 Γ' G _ h₁ p'
mutual
sub-weak-var-p-1-next-2 : ∀ {n} → {u v β t : Type n} {Γ : Ctx n} (Γ' : Ctx n) (x : Var (Γ' ++ Γ)) (G : Form Γ u) →
(p : lookup-Var (Γ' ++ (v ∷ Γ)) (weak-var Γ' Γ x) ≡ β)
(Γ'' : Ctx n)
(h₁₁ : t ∷ Γ'' ≡ t ∷ (Γ' ++ (v ∷ Γ)))
(h₁₂ : ((Γ' ++ (v ∷ ε)) ++ Γ) ≡ Γ'')
(h₂ : (Γ' ++ (v ∷ (u ∷ Γ))) ≡ ((Γ' ++ (v ∷ ε)) ++ (u ∷ Γ)))
(p' : lookup-Var ((Γ' ++ (v ∷ ε)) ++ (u ∷ Γ)) (subst Var h₂ (weak-var Γ' (u ∷ Γ) (weak-var Γ' Γ x))) ≡ β) →
var (next (weak-var Γ' Γ x)) p ≡
subst (λ z → Form z β) h₁₁ (weak-i ε Γ'' (subst (λ z → Form z β) h₁₂ (sub-var (Γ' ++ (v ∷ ε)) Γ G (subst Var h₂ (weak-var Γ' (u ∷ Γ) (weak-var Γ' Γ x))) p')))
sub-weak-var-p-1-next-2 {n} {u} {v} {β} {t} {Γ} Γ' x G p ._ refl h₁₂ h₂ p' =
subst (λ z → var (next {_} {t} (weak-var Γ' Γ x)) p ≡ weak-i ε (Γ' ++ (v ∷ Γ)) z)
(sub-weak-var-p-1 Γ' x G p h₁₂ h₂ p')
refl
sub-weak-var-p-1-next-1 : ∀ {n} → {u v β t : Type n} {Γ : Ctx n} (Γ' : Ctx n) (x : Var (Γ' ++ Γ)) (G : Form Γ u) →
(p : lookup-Var (Γ' ++ (v ∷ Γ)) (weak-var Γ' Γ x) ≡ β)
(h₁ : t ∷ ((Γ' ++ (v ∷ ε)) ++ Γ) ≡ t ∷ (Γ' ++ (v ∷ Γ)))
(Γ'' : Ctx n)
(h₂₁ : t ∷ Γ'' ≡ t ∷ ((Γ' ++ (v ∷ ε)) ++ (u ∷ Γ)))
(h₂₂ : (Γ' ++ (v ∷ (u ∷ Γ))) ≡ Γ'')
(p' : lookup-Var (t ∷ ((Γ' ++ (v ∷ ε)) ++ (u ∷ Γ))) (subst Var h₂₁ (next (subst Var h₂₂ (weak-var Γ' (u ∷ Γ) (weak-var Γ' Γ x))))) ≡ β) →
var (next (weak-var Γ' Γ x)) p ≡
subst (λ z → Form z β) h₁ (sub-var (t ∷ (Γ' ++ (v ∷ ε))) Γ G (subst Var h₂₁ (next (subst Var h₂₂ (weak-var Γ' (u ∷ Γ) (weak-var Γ' Γ x))))) p')
sub-weak-var-p-1-next-1 {n} {u} {v} {β} {t} {Γ} Γ' x G p h₁ ._ refl h₂₂ p' = sub-weak-var-p-1-next-2 Γ' x G p _ h₁ refl h₂₂ p'
sub-weak-var-p-1 : ∀ {n} → {u v β : Type n} {Γ : Ctx n} (Γ' : Ctx n) (x : Var (Γ' ++ Γ)) (G : Form Γ u) →
(p : lookup-Var (Γ' ++ (v ∷ Γ)) (weak-var Γ' Γ x) ≡ β) →
(h₁ : (Γ' ++ (v ∷ ε)) ++ Γ ≡ Γ' ++ (v ∷ Γ)) →
(h₂ : Γ' ++ (v ∷ (u ∷ Γ)) ≡ (Γ' ++ (v ∷ ε)) ++ (u ∷ Γ)) →
(p' : lookup-Var ((Γ' ++ (v ∷ ε)) ++ (u ∷ Γ)) (subst Var h₂ (weak-var Γ' (u ∷ Γ) (weak-var Γ' Γ x))) ≡ β) →
var (weak-var Γ' Γ x) p ≡
subst (λ z → Form z β) h₁ (sub-var (Γ' ++ (v ∷ ε)) Γ G (subst Var h₂ (weak-var Γ' (u ∷ Γ) (weak-var Γ' Γ x))) p')
sub-weak-var-p-1 ε x G refl refl refl refl = refl
sub-weak-var-p-1 {n} {u} {v} {β} {Γ} (.β ∷ Γ') this G refl h₁ h₂ p' = sub-weak-var-p-1-this-1 Γ' G h₁ _ h₂ p'
sub-weak-var-p-1 {n} {u} {v} {β} {Γ} (t ∷ Γ') (next x) G p h₁ h₂ p' = sub-weak-var-p-1-next-1 Γ' x G p h₁ _ h₂ refl p'
sub-weak-p-1-var : ∀ {n} → {u v β : Type n} {Γ : Ctx n} (Γ' : Ctx n) (x : Var (Γ' ++ Γ)) (G : Form Γ u) →
(p : lookup-Var (Γ' ++ Γ) x ≡ β)
(h₁ : (Γ' ++ (v ∷ ε)) ++ Γ ≡ Γ' ++ (v ∷ Γ))
(Γ'' : Ctx n)
(h₂₁ : Γ'' ≡ (Γ' ++ (v ∷ ε)) ++ (u ∷ Γ))
(h₂₂ : Γ' ++ (v ∷ (u ∷ Γ)) ≡ Γ'')
(p' : lookup-Var Γ'' (subst Var h₂₂ (weak-var Γ' (u ∷ Γ) (weak-var Γ' Γ x))) ≡ β) →
var (weak-var Γ' Γ x) (trans (weak-var-p Γ' Γ x) p) ≡
subst (λ z → Form z β) h₁ (sub-i (Γ' ++ (v ∷ ε)) Γ G (subst (λ z → Form z β) h₂₁ (var (subst Var h₂₂ (weak-var Γ' (u ∷ Γ) (weak-var Γ' Γ x))) p')))
sub-weak-p-1-var {n} {u} {v} {β} {Γ} Γ' x G p h₁ ._ refl h₂₂ p' = sub-weak-var-p-1 Γ' x G (trans (weak-var-p Γ' Γ x) p) h₁ h₂₂ p'
mutual
sub-weak-p-1-app-2 : ∀ {n} → {t u v w : Type n} {Γ : Ctx n} (Γ' : Ctx n) (f₁ : Form (Γ' ++ Γ) (w > t)) (f₂ : Form (Γ' ++ Γ) w) (G : Form Γ u) →
(Γ'' : Ctx n) →
(h₁₁ : Γ'' ≡ Γ' ++ (v ∷ Γ)) →
(h₁₂ : (Γ' ++ (v ∷ ε)) ++ Γ ≡ Γ'') →
(h₂ : Γ' ++ (v ∷ (u ∷ Γ)) ≡ (Γ' ++ (v ∷ ε)) ++ (u ∷ Γ)) →
app (weak-i Γ' Γ f₁) (weak-i Γ' Γ f₂) ≡
subst (λ z → Form z t) h₁₁ (app (subst (λ z → Form z (w > t)) h₁₂ (sub-i (Γ' ++ (v ∷ ε)) Γ G (subst (λ z → Form z (w > t)) h₂ (weak-i Γ' (u ∷ Γ) (weak-i Γ' Γ f₁))))) (subst (λ z → Form z w) h₁₂ (sub-i (Γ' ++ (v ∷ ε)) Γ G (subst (λ z → Form z w) h₂ (weak-i Γ' (u ∷ Γ) (weak-i Γ' Γ f₂))))))
sub-weak-p-1-app-2 {n} {t} {u} {v} {w} {Γ} Γ' f₁ f₂ G .(Γ' ++ (v ∷ Γ)) refl h₁₂ h₂ =
trans (cong (λ z → app z (weak-i Γ' Γ f₂)) (
sub-weak-p-1-i Γ' f₁ G h₁₂ h₂
))
(cong (λ z → app (subst (λ z → Form z (w > t)) h₁₂ (sub-i (Γ' ++ (v ∷ ε)) Γ G (subst (λ z → Form z (w > t)) h₂ (weak-i Γ' (u ∷ Γ) (weak-i Γ' Γ f₁))))) z) (
sub-weak-p-1-i Γ' f₂ G h₁₂ h₂
))
sub-weak-p-1-app-1 : ∀ {n} → {t u v w : Type n} {Γ : Ctx n} (Γ' : Ctx n) (f₁ : Form (Γ' ++ Γ) (w > t)) (f₂ : Form (Γ' ++ Γ) w) (G : Form Γ u) →
(h₁ : (Γ' ++ (v ∷ ε)) ++ Γ ≡ Γ' ++ (v ∷ Γ)) →
(Γ'' : Ctx n) →
(h₂₁ : Γ'' ≡ (Γ' ++ (v ∷ ε)) ++ (u ∷ Γ)) →
(h₂₂ : Γ' ++ (v ∷ (u ∷ Γ)) ≡ Γ'') →
app (weak-i Γ' Γ f₁) (weak-i Γ' Γ f₂) ≡
subst (λ z → Form z t) h₁ (sub-i (Γ' ++ (v ∷ ε)) Γ G (subst (λ z → Form z t) h₂₁ (app (subst (λ z → Form z (w > t)) h₂₂ (weak-i Γ' (u ∷ Γ) (weak-i Γ' Γ f₁))) (subst (λ z → Form z w) h₂₂ (weak-i Γ' (u ∷ Γ) (weak-i Γ' Γ f₂))))))
sub-weak-p-1-app-1 {n} {t} {u} {v} {w} {Γ} Γ' f₁ f₂ G h₁ .((Γ' ++ (v ∷ ε)) ++ (u ∷ Γ)) refl h₂₂ = sub-weak-p-1-app-2 Γ' f₁ f₂ G ((Γ' ++ (v ∷ ε)) ++ Γ) h₁ refl h₂₂
sub-weak-p-1-lam-2 : ∀ {n} → {u v α β : Type n} {Γ : Ctx n} (Γ' : Ctx n) (f : Form ((α ∷ Γ') ++ Γ) β) (G : Form Γ u) →
(Γ'' : Ctx n) →
(h₁₁ : Γ'' ≡ Γ' ++ (v ∷ Γ)) →
(h₁₂ : (Γ' ++ (v ∷ ε)) ++ Γ ≡ Γ'') →
(h₂ : Γ' ++ (v ∷ (u ∷ Γ)) ≡ (Γ' ++ (v ∷ ε)) ++ (u ∷ Γ)) →
lam α (weak-i (α ∷ Γ') Γ f) ≡
subst (λ z → Form z (α > β)) h₁₁ (lam α (subst (λ z → Form z β) (cong (_∷_ α) h₁₂) (sub-i (α ∷ (Γ' ++ (v ∷ ε))) Γ G (subst (λ z → Form z β) (cong (_∷_ α) h₂) (weak-i (α ∷ Γ') (u ∷ Γ) (weak-i (α ∷ Γ') Γ f))))))
sub-weak-p-1-lam-2 {n} {u} {v} {α} {β} {Γ} Γ' f G .(Γ' ++ (v ∷ Γ)) refl h₁₂ h₂ = cong (lam α) (
sub-weak-p-1-i (α ∷ Γ') f G (cong (_∷_ α) h₁₂) (cong (_∷_ α) h₂))
sub-weak-p-1-lam-1 : ∀ {n} → {u v α β : Type n} {Γ : Ctx n} (Γ' : Ctx n) (f : Form ((α ∷ Γ') ++ Γ) β) (G : Form Γ u) →
(h₁ : (Γ' ++ (v ∷ ε)) ++ Γ ≡ Γ' ++ (v ∷ Γ)) →
(Γ'' : Ctx n) →
(h₂₁ : Γ'' ≡ (Γ' ++ (v ∷ ε)) ++ (u ∷ Γ)) →
(h₂₂ : Γ' ++ (v ∷ (u ∷ Γ)) ≡ Γ'') →
lam α (weak-i (α ∷ Γ') Γ f) ≡
subst (λ z → Form z (α > β)) h₁ (sub-i (Γ' ++ (v ∷ ε)) Γ G (subst (λ z → Form z (α > β)) h₂₁ (lam α (subst (λ z → Form z β) (cong (λ z → α ∷ z) h₂₂) (weak-i (α ∷ Γ') (u ∷ Γ) (weak-i (α ∷ Γ') Γ f))))))
sub-weak-p-1-lam-1 {n} {u} {v} {α} {β} {Γ} Γ' f G h₁ .((Γ' ++ (v ∷ ε)) ++ (u ∷ Γ)) refl h₂₂ = sub-weak-p-1-lam-2 Γ' f G ((Γ' ++ (v ∷ ε)) ++ Γ) h₁ refl h₂₂
sub-weak-p-1-i : ∀ {n} → {t u v : Type n} {Γ : Ctx n} (Γ' : Ctx n) (F : Form (Γ' ++ Γ) t) (G : Form Γ u) →
(h₁ : (Γ' ++ (v ∷ ε)) ++ Γ ≡ Γ' ++ (v ∷ Γ)) →
(h₂ : Γ' ++ (v ∷ (u ∷ Γ)) ≡ (Γ' ++ (v ∷ ε)) ++ (u ∷ Γ)) →
weak-i Γ' Γ F ≡ subst (λ z → Form z t) h₁ (sub-i (Γ' ++ (v ∷ ε)) Γ G (subst (λ z → Form z t) h₂ (weak-i Γ' (u ∷ Γ) (weak-i Γ' Γ F))))
sub-weak-p-1-i {_} {β} {u} {v} {Γ} Γ' (var x p) G h₁ h₂ = sub-weak-p-1-var Γ' x G p h₁ _ h₂ refl (trans (weak-var-p Γ' (u ∷ Γ) (weak-var Γ' Γ x)) (trans (weak-var-p Γ' Γ x) p))
sub-weak-p-1-i {_} {$o > $o} {u} {v} {Γ} Γ' N G h₁ h₂ = erase-subst (Ctx _) (λ z → Form z ($o > $o)) N (Γ' ++ (v ∷ (u ∷ Γ))) ((Γ' ++ (v ∷ ε)) ++ (u ∷ Γ)) h₂ (λ z → N ≡ subst (λ z → Form z ($o > $o)) h₁ (sub-i (Γ' ++ (v ∷ ε)) Γ G z)) (erase-subst (Ctx _) (λ z → Form z ($o > $o)) N ((Γ' ++ (v ∷ ε)) ++ Γ) (Γ' ++ (v ∷ Γ)) h₁ (λ z → N ≡ z) refl) -- rewrite h₂ | h₁ = refl
sub-weak-p-1-i {_} {$o > ($o > $o)} {u} {v} {Γ} Γ' A G h₁ h₂ = erase-subst (Ctx _) (λ z → Form z ($o > ($o > $o))) A (Γ' ++ (v ∷ (u ∷ Γ))) ((Γ' ++ (v ∷ ε)) ++ (u ∷ Γ)) h₂ (λ z → A ≡ subst (λ z → Form z ($o > ($o > $o))) h₁ (sub-i (Γ' ++ (v ∷ ε)) Γ G z)) (erase-subst (Ctx _) (λ z → Form z ($o > ($o > $o))) A ((Γ' ++ (v ∷ ε)) ++ Γ) (Γ' ++ (v ∷ Γ)) h₁ (λ z → A ≡ z) refl) -- rewrite h₂ | h₁ = refl
sub-weak-p-1-i {_} {(t > $o) > $o} {u} {v} {Γ} Γ' Π G h₁ h₂ = erase-subst (Ctx _) (λ z → Form z ((t > $o) > $o)) Π (Γ' ++ (v ∷ (u ∷ Γ))) ((Γ' ++ (v ∷ ε)) ++ (u ∷ Γ)) h₂ (λ z → Π ≡ subst (λ z → Form z ((t > $o) > $o)) h₁ (sub-i (Γ' ++ (v ∷ ε)) Γ G z)) (erase-subst (Ctx _) (λ z → Form z ((t > $o) > $o)) Π ((Γ' ++ (v ∷ ε)) ++ Γ) (Γ' ++ (v ∷ Γ)) h₁ (λ z → Π ≡ z) refl) -- rewrite h₂ | h₁ = refl
sub-weak-p-1-i {_} {(t > $o) > .t} {u} {v} {Γ} Γ' i G h₁ h₂ = erase-subst (Ctx _) (λ z → Form z ((t > $o) > t)) i (Γ' ++ (v ∷ (u ∷ Γ))) ((Γ' ++ (v ∷ ε)) ++ (u ∷ Γ)) h₂ (λ z → i ≡ subst (λ z → Form z ((t > $o) > t)) h₁ (sub-i (Γ' ++ (v ∷ ε)) Γ G z)) (erase-subst (Ctx _) (λ z → Form z ((t > $o) > t)) i ((Γ' ++ (v ∷ ε)) ++ Γ) (Γ' ++ (v ∷ Γ)) h₁ (λ z → i ≡ z) refl) -- rewrite h₂ | h₁ = refl
sub-weak-p-1-i {_} {t} {u} {v} {Γ} Γ' (app f₁ f₂) G h₁ h₂ = sub-weak-p-1-app-1 Γ' f₁ f₂ G h₁ (Γ' ++ (v ∷ (u ∷ Γ))) h₂ refl
sub-weak-p-1-i {_} {α > β} {u} {v} {Γ} Γ' (lam .α f) G h₁ h₂ = sub-weak-p-1-lam-1 Γ' f G h₁ (Γ' ++ (v ∷ (u ∷ Γ))) h₂ refl
sub-weak-p-1'-var : ∀ {n} → {t u : Type n} {Γ : Ctx n} (Γ' : Ctx n) (x : Var (Γ' ++ Γ)) (G : Form Γ u)
(p : lookup-Var (Γ' ++ Γ) x ≡ t) →
var x p ≡ sub-var Γ' Γ G (weak-var Γ' Γ x) (trans (weak-var-p Γ' Γ x) p)
sub-weak-p-1'-var ε x G p = refl
sub-weak-p-1'-var (v ∷ Γ') this G p = refl
sub-weak-p-1'-var {_} {_} {_} {Γ} (v ∷ Γ') (next x) G p =
subst (λ z → var (next {_} {v} x) p ≡ weak-i ε (Γ' ++ Γ) z)
(sub-weak-p-1'-var Γ' x G p)
refl
sub-weak-p-1'-i : ∀ {n} → {t u : Type n} {Γ : Ctx n} (Γ' : Ctx n) (F : Form (Γ' ++ Γ) t) (G : Form Γ u) →
F ≡ sub-i Γ' Γ G (weak-i Γ' Γ F)
sub-weak-p-1'-i Γ' (var x p) G = sub-weak-p-1'-var Γ' x G p
sub-weak-p-1'-i Γ' N G = refl
sub-weak-p-1'-i Γ' A G = refl
sub-weak-p-1'-i Γ' Π G = refl
sub-weak-p-1'-i Γ' i G = refl
sub-weak-p-1'-i {_} {_} {_} {Γ} Γ' (app f₁ f₂) G = trans (cong (λ z → app z f₂) (sub-weak-p-1'-i Γ' f₁ G)) ((cong (λ z → app (sub-i Γ' Γ G (weak-i Γ' Γ f₁)) z) (sub-weak-p-1'-i Γ' f₂ G)))
sub-weak-p-1'-i Γ' (lam α f) G = cong (lam α) (sub-weak-p-1'-i (α ∷ Γ') f G)
sub-weak-p-1 : ∀ {n} → {t u v : Type n} {Γ : Ctx n} (F : Form Γ t) (G : Form Γ u) →
weak-i ε Γ F ≡ sub-i (v ∷ ε) Γ G (weak-i ε (u ∷ Γ) (weak-i ε Γ F))
sub-weak-p-1 F G = sub-weak-p-1-i ε F G refl refl
sub-weak-p-23 : ∀ {n} → {t u v : Type n} {Γ : Ctx n} (F : Form Γ t) (G : Form (v ∷ Γ) u) →
weak-i ε Γ F ≡ sub-i ε (v ∷ Γ) G (weak-i (u ∷ ε) Γ (weak-i ε Γ F))
sub-weak-p-23 F G = sub-weak-p-23-i ε F G refl refl
sub-weak-p-1' : ∀ {n} → {t u : Type n} {Γ : Ctx n} (F : Form Γ t) (G : Form Γ u) →
F ≡ sub G (weak F)
sub-weak-p-1' F G = sub-weak-p-1'-i ε F G
-- --------------------------
weak-var-irr-proof-2 : ∀ {n} {Γ : Ctx n} (t : Type n) (x : Var Γ)
(p₁ : lookup-Var Γ x ≡ t)
(p₂ : lookup-Var Γ x ≡ t) →
var x p₁ ≡ var x p₂
weak-var-irr-proof-2 {n} {Γ} .(lookup-Var Γ x) x refl refl = refl
weak-var-irr-proof : ∀ {n} {Γ : Ctx n} (t : Type n) (x₁ x₂ : Var Γ)
(p₁ : lookup-Var Γ x₁ ≡ t)
(p₂ : lookup-Var Γ x₂ ≡ t) →
x₁ ≡ x₂ →
var x₁ p₁ ≡ var x₂ p₂
weak-var-irr-proof {n} {Γ} t .x₂ x₂ p₁ p₂ refl = weak-var-irr-proof-2 t x₂ p₁ p₂ -- rewrite h = weak-var-irr-proof-2 t x₂ p₁ p₂
-- --------------------------
weak-weak-var-p-1-this : ∀ {n} Γ₁ Γ₂ → (t u v w : Type n)
(Γ'₁ Γ'₂ : Ctx n) →
(h₁ : w ∷ Γ'₁ ≡ w ∷ ((Γ₂ ++ (t ∷ ε)) ++ Γ₁))
(h₂ : w ∷ Γ'₂ ≡ w ∷ ((Γ₂ ++ (t ∷ ε)) ++ (u ∷ Γ₁))) →
weak-var (w ∷ (Γ₂ ++ (t ∷ ε))) Γ₁ (subst Var h₁ this) ≡
subst Var h₂ this
weak-weak-var-p-1-this Γ₁ Γ₂ t u v w ._ ._ refl refl = refl
mutual
weak-weak-var-p-1-next : ∀ {n} Γ₁ Γ₂ → (t u v w : Type n) (x : Var (Γ₂ ++ Γ₁))
(Γ'₁ Γ'₂ : Ctx n) →
(h₁₁ : w ∷ Γ'₁ ≡ w ∷ ((Γ₂ ++ (t ∷ ε)) ++ Γ₁))
(h₁₂ : Γ₂ ++ (t ∷ Γ₁) ≡ Γ'₁)
(h₂₁ : w ∷ Γ'₂ ≡ w ∷ ((Γ₂ ++ (t ∷ ε)) ++ (u ∷ Γ₁)))
(h₂₂ : Γ₂ ++ (t ∷ (u ∷ Γ₁)) ≡ Γ'₂) →
weak-var (w ∷ (Γ₂ ++ (t ∷ ε))) Γ₁ (subst Var h₁₁ (next (subst Var h₁₂ (weak-var Γ₂ Γ₁ x)))) ≡
subst Var h₂₁ (next (subst Var h₂₂ (weak-var Γ₂ (u ∷ Γ₁) (weak-var Γ₂ Γ₁ x))))
weak-weak-var-p-1-next Γ₁ Γ₂ t u v w x ._ ._ refl h₁₂ refl h₂₂ = cong next (weak-weak-var-p-1 Γ₁ Γ₂ t u v x h₁₂ h₂₂)
weak-weak-var-p-1 : ∀ {n} Γ₁ Γ₂ → (t u v : Type n) (x : Var (Γ₂ ++ Γ₁))
(h₁ : Γ₂ ++ (t ∷ Γ₁) ≡ (Γ₂ ++ (t ∷ ε)) ++ Γ₁)
(h₂ : Γ₂ ++ (t ∷ (u ∷ Γ₁)) ≡ (Γ₂ ++ (t ∷ ε)) ++ (u ∷ Γ₁)) →
weak-var (Γ₂ ++ (t ∷ ε)) Γ₁ (subst Var h₁ (weak-var Γ₂ Γ₁ x)) ≡
subst Var h₂ (weak-var Γ₂ (u ∷ Γ₁) (weak-var Γ₂ Γ₁ x))
weak-weak-var-p-1 Γ₂ ε t u v x refl refl = refl
weak-weak-var-p-1 Γ₁ (w ∷ Γ₂) t u v this h₁ h₂ = weak-weak-var-p-1-this Γ₁ Γ₂ t u v w _ _ h₁ h₂
weak-weak-var-p-1 Γ₁ (w ∷ Γ₂) t u v (next x) h₁ h₂ = weak-weak-var-p-1-next Γ₁ Γ₂ t u v w x _ _ h₁ refl h₂ refl
weak-weak-p-1-var : ∀ {n} Γ₁ Γ₂ → (t u v : Type n) (x : Var (Γ₂ ++ Γ₁))
(Γ'₁ Γ'₂ : Ctx n) →
(h₁₁ : Γ'₁ ≡ (Γ₂ ++ (t ∷ ε)) ++ Γ₁) →
(h₁₂ : Γ₂ ++ (t ∷ Γ₁) ≡ Γ'₁) →
(h₂₁ : Γ'₂ ≡ (Γ₂ ++ (t ∷ ε)) ++ (u ∷ Γ₁)) →
(h₂₂ : Γ₂ ++ (t ∷ (u ∷ Γ₁)) ≡ Γ'₂) →
(p₁ : lookup-Var Γ'₁ (subst Var h₁₂ (weak-var Γ₂ Γ₁ x)) ≡ v)
(p₂ : lookup-Var Γ'₂ (subst Var h₂₂ (weak-var Γ₂ (u ∷ Γ₁) (weak-var Γ₂ Γ₁ x))) ≡ v) →
weak-i (Γ₂ ++ (t ∷ ε)) Γ₁ (subst (λ z → Form z v) h₁₁ (var (subst Var h₁₂ (weak-var Γ₂ Γ₁ x)) p₁)) ≡
subst (λ z → Form z v) h₂₁ (var (subst Var h₂₂ (weak-var Γ₂ (u ∷ Γ₁) (weak-var Γ₂ Γ₁ x))) p₂)
weak-weak-p-1-var Γ₁ Γ₂ t u v x .((Γ₂ ++ (t ∷ ε)) ++ Γ₁) .((Γ₂ ++ (t ∷ ε)) ++ (u ∷ Γ₁)) refl h₁₂ refl h₂₂ p₁ p₂ = weak-var-irr-proof _ (weak-var (Γ₂ ++ (t ∷ ε)) Γ₁ (subst Var h₁₂ (weak-var Γ₂ Γ₁ x))) (subst Var h₂₂ (weak-var Γ₂ (u ∷ Γ₁) (weak-var Γ₂ Γ₁ x))) (trans (weak-var-p (Γ₂ ++ (t ∷ ε)) Γ₁ (subst Var h₁₂ (weak-var Γ₂ Γ₁ x))) p₁) p₂ (weak-weak-var-p-1 Γ₁ Γ₂ t u v x h₁₂ h₂₂)
mutual
weak-weak-p-1-app : ∀ {n} Γ₁ Γ₂ → (t u v α : Type n) (f₁ : Form (Γ₂ ++ Γ₁) (α > v)) (f₂ : Form (Γ₂ ++ Γ₁) α)
(Γ'₁ Γ'₂ : Ctx n) →
(h₁₁ : Γ'₁ ≡ (Γ₂ ++ (t ∷ ε)) ++ Γ₁) →
(h₁₂ : Γ₂ ++ (t ∷ Γ₁) ≡ Γ'₁) →
(h₂₁ : Γ'₂ ≡ (Γ₂ ++ (t ∷ ε)) ++ (u ∷ Γ₁)) →
(h₂₂ : Γ₂ ++ (t ∷ (u ∷ Γ₁)) ≡ Γ'₂) →
weak-i (Γ₂ ++ (t ∷ ε)) Γ₁ (subst (λ z → Form z v) h₁₁ (app (subst (λ z → Form z (α > v)) h₁₂ (weak-i Γ₂ Γ₁ f₁)) (subst (λ z → Form z α) h₁₂ (weak-i Γ₂ Γ₁ f₂)))) ≡
subst (λ z → Form z v) h₂₁ (app (subst (λ z → Form z (α > v)) h₂₂ (weak-i Γ₂ (u ∷ Γ₁) (weak-i Γ₂ Γ₁ f₁))) (subst (λ z → Form z α) h₂₂ (weak-i Γ₂ (u ∷ Γ₁) (weak-i Γ₂ Γ₁ f₂))))
weak-weak-p-1-app Γ₁ Γ₂ t u v α f₁ f₂ ._ ._ refl h₁₂ refl h₂₂ =
trans (cong (λ z → app z (weak-i (Γ₂ ++ (t ∷ ε)) Γ₁ (subst (λ z → Form z α) h₁₂ (weak-i Γ₂ Γ₁ f₂)))) (weak-weak-p-1-i Γ₁ Γ₂ t u (α > v) f₁ h₁₂ h₂₂)) (cong (app (subst (λ z → Form z (α > v)) h₂₂ (weak-i Γ₂ (u ∷ Γ₁) (weak-i Γ₂ Γ₁ f₁)))) (weak-weak-p-1-i Γ₁ Γ₂ t u α f₂ h₁₂ h₂₂))
weak-weak-p-1-lam : ∀ {n} Γ₁ Γ₂ → (t u α β : Type n) (X : Form (α ∷ (Γ₂ ++ Γ₁)) β)
(Γ'₁ Γ'₂ : Ctx n) →
(h₁₁ : Γ'₁ ≡ (Γ₂ ++ (t ∷ ε)) ++ Γ₁) →
(h₁₂ : Γ₂ ++ (t ∷ Γ₁) ≡ Γ'₁) →
(h₂₁ : Γ'₂ ≡ (Γ₂ ++ (t ∷ ε)) ++ (u ∷ Γ₁)) →
(h₂₂ : Γ₂ ++ (t ∷ (u ∷ Γ₁)) ≡ Γ'₂) →
weak-i (Γ₂ ++ (t ∷ ε)) Γ₁ (subst (λ z → Form z (α > β)) h₁₁ (lam α (subst (λ z → Form z β) (cong (_∷_ α) h₁₂) (weak-i (α ∷ Γ₂) Γ₁ X)))) ≡
subst (λ z → Form z (α > β)) h₂₁ (lam α (subst (λ z → Form z β) (cong (_∷_ α) h₂₂) (weak-i (α ∷ Γ₂) (u ∷ Γ₁) (weak-i (α ∷ Γ₂) Γ₁ X))))
weak-weak-p-1-lam Γ₁ Γ₂ t u α β X .((Γ₂ ++ (t ∷ ε)) ++ Γ₁) .((Γ₂ ++ (t ∷ ε)) ++ (u ∷ Γ₁)) refl h₁₂ refl h₂₂ = cong (lam α) (weak-weak-p-1-i Γ₁ (α ∷ Γ₂) t u β X (cong (_∷_ α) h₁₂) (cong (_∷_ α) h₂₂))
weak-weak-p-1-i : ∀ {n} Γ₁ Γ₂ → (t u v : Type n) (X : Form (Γ₂ ++ Γ₁) v) →
(h₁ : Γ₂ ++ (t ∷ Γ₁) ≡ (Γ₂ ++ (t ∷ ε)) ++ Γ₁) →
(h₂ : Γ₂ ++ (t ∷ (u ∷ Γ₁)) ≡ (Γ₂ ++ (t ∷ ε)) ++ (u ∷ Γ₁)) →
weak-i {n} {v} {u} (Γ₂ ++ (t ∷ ε)) Γ₁ (subst (λ z → Form z v) h₁ (weak-i {n} {v} {t} Γ₂ Γ₁ X)) ≡ subst (λ z → Form z v) h₂ (weak-i {n} {v} {t} Γ₂ (u ∷ Γ₁) (weak-i {n} {v} {u} Γ₂ Γ₁ X))
weak-weak-p-1-i Γ₁ Γ₂ t u v (var x p) h₁ h₂ = weak-weak-p-1-var Γ₁ Γ₂ t u v x _ _ h₁ refl h₂ refl (trans (weak-var-p Γ₂ Γ₁ x) p) (trans (weak-var-p Γ₂ (u ∷ Γ₁) (weak-var Γ₂ Γ₁ x)) (trans (weak-var-p Γ₂ Γ₁ x) p))
weak-weak-p-1-i Γ₁ Γ₂ t u .($o > $o) N h₁ h₂ = erase-subst (Ctx _) (λ z → Form z ($o > $o)) N (Γ₂ ++ (t ∷ (u ∷ Γ₁))) ((Γ₂ ++ (t ∷ ε)) ++ (u ∷ Γ₁)) h₂ (λ z → weak-i (Γ₂ ++ (t ∷ ε)) Γ₁ (subst (λ z → Form z ($o > $o)) h₁ N) ≡ z) (erase-subst (Ctx _) (λ z → Form z ($o > $o)) N (Γ₂ ++ (t ∷ Γ₁)) ((Γ₂ ++ (t ∷ ε)) ++ Γ₁) h₁ (λ z → weak-i {_} {_} {u} (Γ₂ ++ (t ∷ ε)) Γ₁ z ≡ N) refl) -- rewrite h₂ | h₁ = refl
weak-weak-p-1-i Γ₁ Γ₂ t u .($o > ($o > $o)) A h₁ h₂ = erase-subst (Ctx _) (λ z → Form z ($o > ($o > $o))) A (Γ₂ ++ (t ∷ (u ∷ Γ₁))) ((Γ₂ ++ (t ∷ ε)) ++ (u ∷ Γ₁)) h₂ (λ z → weak-i (Γ₂ ++ (t ∷ ε)) Γ₁ (subst (λ z → Form z ($o > ($o > $o))) h₁ A) ≡ z) (erase-subst (Ctx _) (λ z → Form z ($o > ($o > $o))) A (Γ₂ ++ (t ∷ Γ₁)) ((Γ₂ ++ (t ∷ ε)) ++ Γ₁) h₁ (λ z → weak-i {_} {_} {u} (Γ₂ ++ (t ∷ ε)) Γ₁ z ≡ A) refl) -- rewrite h₂ | h₁ = refl
weak-weak-p-1-i Γ₁ Γ₂ t u .((α > $o) > $o) (Π {._} {α}) h₁ h₂ = erase-subst (Ctx _) (λ z → Form z ((α > $o) > $o)) Π (Γ₂ ++ (t ∷ (u ∷ Γ₁))) ((Γ₂ ++ (t ∷ ε)) ++ (u ∷ Γ₁)) h₂ (λ z → weak-i (Γ₂ ++ (t ∷ ε)) Γ₁ (subst (λ z → Form z ((α > $o) > $o)) h₁ Π) ≡ z) (erase-subst (Ctx _) (λ z → Form z ((α > $o) > $o)) Π (Γ₂ ++ (t ∷ Γ₁)) ((Γ₂ ++ (t ∷ ε)) ++ Γ₁) h₁ (λ z → weak-i {_} {_} {u} (Γ₂ ++ (t ∷ ε)) Γ₁ z ≡ Π) refl) -- rewrite h₂ | h₁ = refl
weak-weak-p-1-i Γ₁ Γ₂ t u .((α > $o) > α) (i {._} {α}) h₁ h₂ = erase-subst (Ctx _) (λ z → Form z ((α > $o) > α)) i (Γ₂ ++ (t ∷ (u ∷ Γ₁))) ((Γ₂ ++ (t ∷ ε)) ++ (u ∷ Γ₁)) h₂ (λ z → weak-i (Γ₂ ++ (t ∷ ε)) Γ₁ (subst (λ z → Form z ((α > $o) > α)) h₁ i) ≡ z) (erase-subst (Ctx _) (λ z → Form z ((α > $o) > α)) i (Γ₂ ++ (t ∷ Γ₁)) ((Γ₂ ++ (t ∷ ε)) ++ Γ₁) h₁ (λ z → weak-i {_} {_} {u} (Γ₂ ++ (t ∷ ε)) Γ₁ z ≡ i) refl) -- rewrite h₂ | h₁ = refl
weak-weak-p-1-i Γ₁ Γ₂ t u v (app f₁ f₂) h₁ h₂ = weak-weak-p-1-app Γ₁ Γ₂ t u v _ f₁ f₂ _ _ h₁ refl h₂ refl
weak-weak-p-1-i Γ₁ Γ₂ t u .(α > β) (lam {._} {β} α f) h₁ h₂ = weak-weak-p-1-lam Γ₁ Γ₂ t u α β f _ _ h₁ refl h₂ refl
weak-weak-p-1 : ∀ {n} Γ → (t u v : Type n) (X : Form Γ v) →
weak-i {n} {v} {u} (t ∷ ε) Γ (weak-i {n} {v} {t} ε Γ X) ≡ weak-i {n} {v} {t} ε (u ∷ Γ) (weak-i {n} {v} {u} ε Γ X)
weak-weak-p-1 Γ t u v X = weak-weak-p-1-i Γ ε t u v X refl refl
-- -----------------------
thevar : ∀ {n Γ} → (Γ' : Ctx n) (α : Type n) → Var (Γ' ++ (α ∷ Γ))
thevar ε α = this
thevar (β ∷ Γ') α = next (thevar Γ' α)
occurs-p-2-i-var : ∀ {n} {Γ : Ctx n} {α β : Type n} (Γ' : Ctx n)
(v : Var (Γ' ++ Γ))
(p : lookup-Var (Γ' ++ Γ) v ≡ β) →
eq-Var (thevar Γ' α) (weak-var Γ' Γ v) ≡ false
occurs-p-2-i-var ε v p = refl
occurs-p-2-i-var (γ ∷ Γ') this p = refl
occurs-p-2-i-var (γ ∷ Γ') (next v) p = occurs-p-2-i-var Γ' v p
occurs-p-2-i : ∀ {n} {Γ : Ctx n} {α β : Type n} (Γ' : Ctx n) (F : Form (Γ' ++ Γ) β) →
occurs {n} {Γ' ++ (α ∷ Γ)} (thevar Γ' α) (weak-i Γ' Γ F) ≡ false
occurs-p-2-i Γ' (var v p) = occurs-p-2-i-var Γ' v p
occurs-p-2-i Γ' N = refl
occurs-p-2-i Γ' A = refl
occurs-p-2-i Γ' Π = refl
occurs-p-2-i Γ' i = refl
occurs-p-2-i {n} {Γ} {α} {β} Γ' (app f₁ f₂) = subst (λ z → z ∨ occurs (thevar Γ' α) (weak-i Γ' Γ f₂) ≡ false) (sym (occurs-p-2-i {n} {Γ} {α} {_ > β} Γ' f₁)) (occurs-p-2-i {n} {Γ} {α} Γ' f₂) -- rewrite occurs-p-2-i {n} {Γ} {α} {_ > β} Γ' f₁ | occurs-p-2-i {n} {Γ} {α} Γ' f₂ = refl
occurs-p-2-i Γ' (lam γ f) = occurs-p-2-i (γ ∷ Γ') f
occurs-p-2 : ∀ {n} {Γ : Ctx n} {α β : Type n} (F : Form Γ β) →
occurs {n} {α ∷ Γ} this (weak F) ≡ false
occurs-p-2 F = occurs-p-2-i ε F
-- -----------------------
sub-sub-weak-weak-p-3-i-var-2-this : ∀ {n} → {Γ Γ' : Ctx n} {α β γ : Type n} →
(Γ1 Γ2 : Ctx n) →
(eq1 : γ ∷ Γ1 ≡ γ ∷ (Γ' ++ (α ∷ (α ∷ Γ)))) →
(eq2 : γ ∷ Γ2 ≡ γ ∷ (Γ' ++ (α ∷ Γ))) →
(p1 : lookup-Var (γ ∷ (Γ' ++ (α ∷ (α ∷ Γ)))) (subst Var eq1 this) ≡ β) →
(p2 : lookup-Var (γ ∷ (Γ' ++ (α ∷ Γ))) (subst Var eq2 this) ≡ β) →
sub-var (γ ∷ Γ') (α ∷ Γ) (var this refl) (subst Var eq1 this) p1 ≡ var (subst Var eq2 this) p2
sub-sub-weak-weak-p-3-i-var-2-this {n} {Γ} {Γ'} {α} .(Γ' ++ (α ∷ (α ∷ Γ))) .(Γ' ++ (α ∷ Γ)) refl refl refl refl = refl
mutual
sub-sub-weak-weak-p-3-i-var-2-next : ∀ {n} → {Γ Γ' : Ctx n} {α β γ : Type n}
(x : Var ((Γ' ++ (α ∷ ε)) ++ Γ)) →
(Γ1 Γ2 : Ctx n) →
(eq1 : γ ∷ Γ1 ≡ γ ∷ (Γ' ++ (α ∷ (α ∷ Γ)))) →
(eq12 : (Γ' ++ (α ∷ ε)) ++ (α ∷ Γ) ≡ Γ1) →
(eq2 : γ ∷ Γ2 ≡ γ ∷ (Γ' ++ (α ∷ Γ))) →
(eq22 : (Γ' ++ (α ∷ ε)) ++ Γ ≡ Γ2) →
(p1 : lookup-Var ((γ ∷ Γ') ++ (lookup-Var (α ∷ Γ) this ∷ (α ∷ Γ))) (subst Var eq1 (next (subst Var eq12 (weak-var (Γ' ++ (α ∷ ε)) Γ x)))) ≡ β) →
(p2 : lookup-Var (γ ∷ (Γ' ++ (α ∷ Γ))) (subst Var eq2 (next (subst Var eq22 x))) ≡ β) →
sub-var (γ ∷ Γ') (α ∷ Γ) (var this refl) (subst Var eq1 (next (subst Var eq12 (weak-var (Γ' ++ (α ∷ ε)) Γ x)))) p1
≡ var (subst Var eq2 (next (subst Var eq22 x))) p2
sub-sub-weak-weak-p-3-i-var-2-next {n} {Γ} {Γ'} {α} x .(Γ' ++ (α ∷ (α ∷ Γ))) .(Γ' ++ (α ∷ Γ)) refl eq12 refl eq22 p1 p2 = cong (weak-i ε (Γ' ++ (α ∷ Γ))) (sub-sub-weak-weak-p-3-i-var-2 {n} {Γ} {Γ'} {α} x eq12 eq22 p1 p2)
sub-sub-weak-weak-p-3-i-var-2 : ∀ {n} → {Γ Γ' : Ctx n} {α β : Type n} (x : Var ((Γ' ++ (α ∷ ε)) ++ Γ)) →
(eq1 : (Γ' ++ (α ∷ ε)) ++ (α ∷ Γ) ≡ Γ' ++ (α ∷ (α ∷ Γ))) →
(eq2 : (Γ' ++ (α ∷ ε)) ++ Γ ≡ Γ' ++ (α ∷ Γ)) →
(p1 : lookup-Var (Γ' ++ (α ∷ (α ∷ Γ))) (subst Var eq1 (weak-var (Γ' ++ (α ∷ ε)) Γ x)) ≡ β) →
(p2 : lookup-Var (Γ' ++ (α ∷ Γ)) (subst Var eq2 x) ≡ β) →
sub-var Γ' (α ∷ Γ) (var this refl) (subst Var eq1 (weak-var (Γ' ++ (α ∷ ε)) Γ x)) p1
≡ var (subst Var eq2 x) p2
sub-sub-weak-weak-p-3-i-var-2 {n} {Γ} {ε} this refl refl refl refl = refl
sub-sub-weak-weak-p-3-i-var-2 {n} {Γ} {ε} (next x) refl refl refl refl = refl
sub-sub-weak-weak-p-3-i-var-2 {n} {Γ} {γ ∷ Γ'} this eq1 eq2 p1 p2 = sub-sub-weak-weak-p-3-i-var-2-this {n} {Γ} {Γ'} {_} {_} {γ} ((Γ' ++ (_ ∷ ε)) ++ (_ ∷ Γ)) ((Γ' ++ (_ ∷ ε)) ++ Γ) eq1 eq2 p1 p2
sub-sub-weak-weak-p-3-i-var-2 {n} {Γ} {γ ∷ Γ'} (next x) eq1 eq2 p1 p2 = sub-sub-weak-weak-p-3-i-var-2-next {n} {Γ} {Γ'} {_} {_} {γ} x ((Γ' ++ (_ ∷ ε)) ++ (_ ∷ Γ)) ((Γ' ++ (_ ∷ ε)) ++ Γ) eq1 refl eq2 refl p1 p2
sub-sub-weak-weak-p-3-i-var : ∀ {n} → {Γ Γ' : Ctx n} {α β : Type n} (x : Var ((Γ' ++ (α ∷ ε)) ++ Γ)) →
(Γ1 Γ2 : Ctx n) →
(eq11 : Γ1 ≡ Γ' ++ (α ∷ (α ∷ Γ))) →
(eq12 : (Γ' ++ (α ∷ ε)) ++ (α ∷ Γ) ≡ Γ1) →
(eq21 : Γ2 ≡ Γ' ++ (α ∷ Γ)) →
(eq22 : (Γ' ++ (α ∷ ε)) ++ Γ ≡ Γ2) →
(p1 : lookup-Var Γ1 (subst Var eq12 (weak-var (Γ' ++ (α ∷ ε)) Γ x)) ≡ β) →
(p2 : lookup-Var Γ2 (subst Var eq22 x) ≡ β) →
sub-i Γ' (α ∷ Γ) (var this refl) (subst (λ z → Form z β) eq11 (var (subst Var eq12 (weak-var (Γ' ++ (α ∷ ε)) Γ x)) p1))
≡ subst (λ z → Form z β) eq21 (var (subst Var eq22 x) p2)
sub-sub-weak-weak-p-3-i-var {n} {Γ} {Γ'} {α} x .(Γ' ++ (α ∷ (α ∷ Γ))) .(Γ' ++ (α ∷ Γ)) refl eq12 refl eq22 p1 p2 = sub-sub-weak-weak-p-3-i-var-2 {n} {Γ} {Γ'} {α} x eq12 eq22 p1 p2
mutual
sub-sub-weak-weak-p-3-i-app : ∀ {n} → {Γ Γ' : Ctx n} {α β γ : Type n}
(f₁ : Form ((Γ' ++ (α ∷ ε)) ++ Γ) (γ > β)) →
(f₂ : Form ((Γ' ++ (α ∷ ε)) ++ Γ) γ) →
(Γ1 Γ2 : Ctx n) →
(eq1 : Γ1 ≡ Γ' ++ (α ∷ (α ∷ Γ))) →
(eq12 : (Γ' ++ (α ∷ ε)) ++ (α ∷ Γ) ≡ Γ1) →
(eq2 : Γ2 ≡ Γ' ++ (α ∷ Γ)) →
(eq22 : (Γ' ++ (α ∷ ε)) ++ Γ ≡ Γ2) →
sub-i Γ' (α ∷ Γ) (var this refl) (subst (λ z → Form z β) eq1 (app (subst (λ z → Form z (γ > β)) eq12 (weak-i (Γ' ++ (α ∷ ε)) Γ f₁)) (subst (λ z → Form z γ) eq12 (weak-i (Γ' ++ (α ∷ ε)) Γ f₂))))
≡ subst (λ z → Form z β) eq2 (app (subst (λ z → Form z (γ > β)) eq22 f₁) (subst (λ z → Form z γ) eq22 f₂))
sub-sub-weak-weak-p-3-i-app {n} {Γ} {Γ'} {α} {β} {γ} f₁ f₂ .(Γ' ++ (α ∷ (α ∷ Γ))) .(Γ' ++ (α ∷ Γ)) refl eq12 refl eq22 = trans (cong (λ z → app z (sub-i Γ' (α ∷ Γ) (var this refl) (subst (λ z → Form z γ) eq12 (weak-i (Γ' ++ (α ∷ ε)) Γ f₂)))) (sub-sub-weak-weak-p-3-i {n} {Γ} {Γ'} {α} {γ > β} f₁ eq12 eq22)) (cong (app (subst (λ z → Form z (γ > β)) eq22 f₁)) (sub-sub-weak-weak-p-3-i {n} {Γ} {Γ'} {α} {γ} f₂ eq12 eq22))
sub-sub-weak-weak-p-3-i-lam : ∀ {n} → {Γ Γ' : Ctx n} {α β γ : Type n}
(f : Form (γ ∷ ((Γ' ++ (α ∷ ε)) ++ Γ)) β)
(Γ1 Γ2 : Ctx n)
(eq1 : Γ1 ≡ Γ' ++ (α ∷ (α ∷ Γ)))
(eq12 : γ ∷ ((Γ' ++ (α ∷ ε)) ++ (α ∷ Γ)) ≡ γ ∷ Γ1)
(eq2 : Γ2 ≡ Γ' ++ (α ∷ Γ))
(eq22 : γ ∷ ((Γ' ++ (α ∷ ε)) ++ Γ) ≡ γ ∷ Γ2) →
sub-i Γ' (α ∷ Γ) (var this refl) (subst (λ z → Form z (γ > β)) eq1 (lam γ (subst (λ z → Form z β) eq12 (weak-i (γ ∷ (Γ' ++ (α ∷ ε))) Γ f))))
≡ subst (λ z → Form z (γ > β)) eq2 (lam γ (subst (λ z → Form z β) eq22 f))
sub-sub-weak-weak-p-3-i-lam {n} {Γ} {Γ'} {α} {β} {γ} f .(Γ' ++ (α ∷ (α ∷ Γ))) .(Γ' ++ (α ∷ Γ)) refl eq12 refl eq22 = cong (lam γ) (sub-sub-weak-weak-p-3-i {n} {Γ} {γ ∷ Γ'} {α} {β} f eq12 eq22)
sub-sub-weak-weak-p-3-i : ∀ {n} → {Γ Γ' : Ctx n} {α β : Type n} (G : Form ((Γ' ++ (α ∷ ε)) ++ Γ) β) →
(eq1 : (Γ' ++ (α ∷ ε)) ++ (α ∷ Γ) ≡ Γ' ++ (α ∷ (α ∷ Γ))) →
(eq2 : (Γ' ++ (α ∷ ε)) ++ Γ ≡ Γ' ++ (α ∷ Γ)) →
sub-i Γ' (α ∷ Γ) (var this refl) (subst (λ z → Form z β) eq1 (weak-i (Γ' ++ (α ∷ ε)) Γ G)) ≡ subst (λ z → Form z β) eq2 G
sub-sub-weak-weak-p-3-i {n} {Γ} {Γ'} {α} {β} (var x p) eq1 eq2 = sub-sub-weak-weak-p-3-i-var {n} {Γ} {Γ'} {α} {β} x ((Γ' ++ (α ∷ ε)) ++ (α ∷ Γ)) ((Γ' ++ (α ∷ ε)) ++ Γ) eq1 refl eq2 refl (trans (weak-var-p (Γ' ++ (α ∷ ε)) Γ x) p) p
sub-sub-weak-weak-p-3-i {_} {Γ} {Γ'} {α} {$o > $o} N eq1 eq2 = erase-subst (Ctx _) (λ z → Form z ($o > $o)) N ((Γ' ++ (α ∷ ε)) ++ Γ) (Γ' ++ (α ∷ Γ)) eq2 (λ z → sub-i Γ' (α ∷ Γ) (var this refl) (subst (λ z → Form z ($o > $o)) eq1 N) ≡ z) (erase-subst (Ctx _) (λ z → Form z ($o > $o)) N ((Γ' ++ (α ∷ ε)) ++ (α ∷ Γ)) (Γ' ++ (α ∷ (α ∷ Γ))) eq1 (λ z → sub-i Γ' (α ∷ Γ) (var this refl) z ≡ N) refl) -- rewrite eq2 | eq1 = refl
sub-sub-weak-weak-p-3-i {_} {Γ} {Γ'} {α} {$o > ($o > $o)} A eq1 eq2 = erase-subst (Ctx _) (λ z → Form z ($o > ($o > $o))) A ((Γ' ++ (α ∷ ε)) ++ Γ) (Γ' ++ (α ∷ Γ)) eq2 (λ z → sub-i Γ' (α ∷ Γ) (var this refl) (subst (λ z → Form z ($o > ($o > $o))) eq1 A) ≡ z) (erase-subst (Ctx _) (λ z → Form z ($o > ($o > $o))) A ((Γ' ++ (α ∷ ε)) ++ (α ∷ Γ)) (Γ' ++ (α ∷ (α ∷ Γ))) eq1 (λ z → sub-i Γ' (α ∷ Γ) (var this refl) z ≡ A) refl) -- rewrite eq2 | eq1 = refl
sub-sub-weak-weak-p-3-i {_} {Γ} {Γ'} {α} {(β > $o) > $o} Π eq1 eq2 = erase-subst (Ctx _) (λ z → Form z ((β > $o) > $o)) Π ((Γ' ++ (α ∷ ε)) ++ Γ) (Γ' ++ (α ∷ Γ)) eq2 (λ z → sub-i Γ' (α ∷ Γ) (var this refl) (subst (λ z → Form z ((β > $o) > $o)) eq1 Π) ≡ z) (erase-subst (Ctx _) (λ z → Form z ((β > $o) > $o)) Π ((Γ' ++ (α ∷ ε)) ++ (α ∷ Γ)) (Γ' ++ (α ∷ (α ∷ Γ))) eq1 (λ z → sub-i Γ' (α ∷ Γ) (var this refl) z ≡ Π) refl) -- rewrite eq2 | eq1 = refl
sub-sub-weak-weak-p-3-i {_} {Γ} {Γ'} {α} {(β > $o) > .β} i eq1 eq2 = erase-subst (Ctx _) (λ z → Form z ((β > $o) > β)) i ((Γ' ++ (α ∷ ε)) ++ Γ) (Γ' ++ (α ∷ Γ)) eq2 (λ z → sub-i Γ' (α ∷ Γ) (var this refl) (subst (λ z → Form z ((β > $o) > β)) eq1 i) ≡ z) (erase-subst (Ctx _) (λ z → Form z ((β > $o) > β)) i ((Γ' ++ (α ∷ ε)) ++ (α ∷ Γ)) (Γ' ++ (α ∷ (α ∷ Γ))) eq1 (λ z → sub-i Γ' (α ∷ Γ) (var this refl) z ≡ i) refl) -- rewrite eq2 | eq1 = refl
sub-sub-weak-weak-p-3-i {_} {Γ} {Γ'} {α} (app f₁ f₂) eq1 eq2 = sub-sub-weak-weak-p-3-i-app {_} {Γ} {Γ'} {α} f₁ f₂ ((Γ' ++ (α ∷ ε)) ++ (α ∷ Γ)) ((Γ' ++ (α ∷ ε)) ++ Γ) eq1 refl eq2 refl
sub-sub-weak-weak-p-3-i {_} {Γ} {Γ'} {α} (lam γ f) eq1 eq2 = sub-sub-weak-weak-p-3-i-lam {_} {Γ} {Γ'} {α} f ((Γ' ++ (α ∷ ε)) ++ (α ∷ Γ)) ((Γ' ++ (α ∷ ε)) ++ Γ) eq1 refl eq2 refl
sub-sub-weak-weak-p-3 : ∀ {n} → {Γ : Ctx n} {α β : Type n} (G : Form (α ∷ Γ) β) →
sub (var this refl) (weak-i (α ∷ ε) Γ G) ≡ G
sub-sub-weak-weak-p-3 G = sub-sub-weak-weak-p-3-i {_} {_} {ε} G refl refl
sub-sub-weak-weak-p : ∀ {n} → {Γ : Ctx n} {α β : Type n} (F : Form Γ β) (G : Form (α ∷ Γ) β) →
sub (var this refl) (sub-i (α ∷ (α ∷ ε)) Γ F (weak-i (α ∷ ε) (β ∷ Γ) (weak-i (α ∷ ε) Γ G))) ≡ G
sub-sub-weak-weak-p {_} {Γ} {α} {β} F G = subst (λ z → sub (var this refl) z ≡ G) (sub-weak-p-1-i (α ∷ ε) G F refl refl) (sub-sub-weak-weak-p-3 G)
sub-sub-weak-weak-p-2 : ∀ {n} → {Γ : Ctx n} {α β : Type n} (F G : Form (α ∷ Γ) β) →
sub (var this refl) (sub-i (α ∷ (α ∷ ε)) Γ (lam α G) (weak-i (α ∷ ε) ((α > β) ∷ Γ) (weak-i (α ∷ ε) Γ F))) ≡ F
sub-sub-weak-weak-p-2 {_} {Γ} {α} {β} F G = subst (λ z → sub (var this refl) z ≡ F) (sub-weak-p-1-i (α ∷ ε) F (lam α G) refl refl) (sub-sub-weak-weak-p-3 F)
-- ----------------
mutual
headNorm : {n : ℕ} {Γ : Ctx n} {α : Type n} → ℕ → Form Γ α → Form Γ α
-- headNorm m (app (app (lam α (lam _ (app Π (lam (_ > $o) (app (app A (app N (app (var this _) (var (next (next this)) _)))) (app (var this _) (var (next this) _))))))) F) G) = ?
headNorm m (app F G) = headNorm' m (headNorm m F) G
headNorm _ F = F
headNorm' : {n : ℕ} {Γ : Ctx n} {α β : Type n} → ℕ → Form Γ (α > β) → Form Γ α → Form Γ β
headNorm' (suc m) (lam _ F) G = headNorm m (sub G F)
headNorm' 0 (lam _ F) G = app (lam _ F) G
headNorm' _ F G = app F G
-- ----------------
!'[_]_ : ∀ {n} → {Γ : Ctx n} → (α : Type n) → Form Γ (α > $o) → Form Γ $o
!'[ α ] F = app Π F
?'[_]_ : ∀ {n} → {Γ : Ctx n} → (α : Type n) → Form Γ (α > $o) → Form Γ $o
?'[ α ] F = ?[ α ] (weak F · $ this {refl})
ι' : ∀ {n} → {Γ : Ctx n} → (α : Type n) → Form Γ (α > $o) → Form Γ α
ι' α F = app i F
|
Transynther/x86/_processed/AVXALIGN/_st_zr_un_sm_/i7-7700_9_0xca.log_21829_150.asm | ljhsiun2/medusa | 9 | 91455 | <filename>Transynther/x86/_processed/AVXALIGN/_st_zr_un_sm_/i7-7700_9_0xca.log_21829_150.asm
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r14
push %r15
push %r8
push %r9
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x1998c, %rdi
nop
add %r8, %r8
movb (%rdi), %r11b
inc %r9
lea addresses_WT_ht+0x687c, %rsi
lea addresses_WT_ht+0x697c, %rdi
nop
add $40182, %r15
mov $86, %rcx
rep movsb
dec %r9
lea addresses_WT_ht+0x1060c, %rsi
nop
nop
and $2418, %rcx
vmovups (%rsi), %ymm5
vextracti128 $1, %ymm5, %xmm5
vpextrq $0, %xmm5, %r15
nop
nop
nop
xor $18189, %rcx
lea addresses_WC_ht+0x5da6, %rsi
lea addresses_WT_ht+0x52c, %rdi
nop
nop
nop
and $8755, %r14
mov $66, %rcx
rep movsl
nop
nop
nop
nop
nop
dec %rcx
lea addresses_D_ht+0x10e4c, %rsi
lea addresses_A_ht+0x384c, %rdi
nop
nop
nop
and $37026, %r11
mov $48, %rcx
rep movsw
nop
nop
nop
add %r14, %r14
lea addresses_A_ht+0x1304c, %rsi
lea addresses_WC_ht+0x1b6bc, %rdi
nop
nop
cmp %r11, %r11
mov $40, %rcx
rep movsq
nop
nop
nop
nop
nop
sub $30130, %rsi
lea addresses_UC_ht+0xb84c, %r8
xor %r9, %r9
mov (%r8), %r15
nop
nop
nop
nop
and $3962, %rcx
lea addresses_WC_ht+0xf946, %r15
nop
nop
nop
nop
xor %rdi, %rdi
movl $0x61626364, (%r15)
nop
nop
nop
nop
inc %rcx
lea addresses_WT_ht+0x13d4c, %r9
nop
nop
nop
nop
sub %r14, %r14
mov (%r9), %edi
nop
nop
nop
nop
sub %r11, %r11
lea addresses_D_ht+0x294c, %r11
nop
nop
nop
nop
and $10612, %r15
mov $0x6162636465666768, %r9
movq %r9, %xmm5
movups %xmm5, (%r11)
nop
nop
and $57180, %rsi
lea addresses_normal_ht+0x10e4c, %rdi
nop
nop
sub %rsi, %rsi
movw $0x6162, (%rdi)
nop
dec %r9
lea addresses_D_ht+0x8a4c, %rsi
lea addresses_normal_ht+0xc64c, %rdi
nop
nop
nop
dec %r15
mov $26, %rcx
rep movsw
nop
nop
nop
dec %rcx
pop %rsi
pop %rdi
pop %rcx
pop %r9
pop %r8
pop %r15
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r15
push %r9
push %rbx
push %rcx
push %rdx
push %rsi
// Store
lea addresses_WC+0x12d5e, %r13
nop
and $43697, %rsi
mov $0x5152535455565758, %r9
movq %r9, (%r13)
nop
nop
inc %rsi
// Store
lea addresses_WC+0x1224c, %rcx
and $20694, %rdx
movb $0x51, (%rcx)
and %rdx, %rdx
// Faulty Load
lea addresses_WC+0x1224c, %rbx
nop
and %r9, %r9
vmovntdqa (%rbx), %ymm0
vextracti128 $0, %ymm0, %xmm0
vpextrq $0, %xmm0, %r15
lea oracles, %rbx
and $0xff, %r15
shlq $12, %r15
mov (%rbx,%r15,1), %r15
pop %rsi
pop %rdx
pop %rcx
pop %rbx
pop %r9
pop %r15
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_WC'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_WC'}}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 1, 'NT': True, 'type': 'addresses_WC'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 32, 'NT': True, 'type': 'addresses_WC'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 5, 'AVXalign': True, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 2, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 4, 'same': False, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 0, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 5, 'same': False, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 9, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 8, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_WC_ht'}}
{'src': {'congruent': 5, 'AVXalign': False, 'same': True, 'size': 8, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_WC_ht'}}
{'src': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 8, 'AVXalign': False, 'same': True, 'size': 16, 'NT': False, 'type': 'addresses_D_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 9, 'AVXalign': False, 'same': True, 'size': 2, 'NT': False, 'type': 'addresses_normal_ht'}}
{'src': {'congruent': 10, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_normal_ht'}}
{'50': 852, '00': 20418, '51': 559}
00 00 00 00 00 00 00 00 00 50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 50 00 00 00 00 00 00 00 00 00 00 00 00 00 50 00 00 00 00 00 50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 51 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 50 00 00 00 00 00 00 00 00 00 50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 51 00 00 00 00 00 00 50 00 50 00 00 00 00 00 50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 50 00 00 00 00 00 00 51 00 00 00 00 00 00 51 00 51 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 51 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 50 00 51 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 50 00 50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 51 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 51 00 00 50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 51 00 00 50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 50 00 00 50 00 00 00 00 00 00 00 00 00 51 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 50 00 00 00 00 00 00 00 00 00 00 50 00 00 00 00 00 00 00 00 00 00 00 50 00 00 00 00 00 00 00 00 50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 51 00 00 00 00 00 00 00 00 00 00 50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 51 00 00 00 00 00 51 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 51 00 00 00 00 00 00 51 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 51 00 50 00 00 50 00 00 00 00 00 00 00 00 00 00 00 00 00 50 00 00 00 00 00 00 00 50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 50 00 00 00 00 50 00 00 00 00 00 00 50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 51 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 50 00 50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 50 00 00 00 00 00 00 00 00 00 00 00 00 50 00 00 00 00 00 00 00 00 00 00 50 00 00 00 00 00 51 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 51 00 00 00 00 00 00 00 00 00 00 00 00 00 51 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 50 00 00 00
*/
|
oeis/005/A005920.asm | neoneye/loda-programs | 11 | 21083 | ; A005920: Tricapped prism numbers.
; 1,9,33,82,165,291,469,708,1017,1405,1881,2454,3133,3927,4845,5896,7089,8433,9937,11610,13461,15499,17733,20172,22825,25701,28809,32158,35757,39615,43741,48144,52833,57817,63105,68706,74629,80883,87477,94420,101721,109389,117433,125862,134685,143911,153549,163608,174097,185025,196401,208234,220533,233307,246565,260316,274569,289333,304617,320430,336781,353679,371133,389152,407745,426921,446689,467058,488037,509635,531861,554724,578233,602397,627225,652726,678909,705783,733357,761640,790641
mov $1,$0
add $0,1
pow $1,2
mov $2,$0
mul $0,2
mul $0,$2
add $1,$0
mul $1,$2
mov $0,$1
div $0,2
|
src/test/ref/problem-negative-word-const.asm | jbrandwood/kickc | 2 | 16557 | <reponame>jbrandwood/kickc<gh_stars>1-10
// Problem with assigning negative word constant (vwuz1=vbuc1)
// Commodore 64 PRG executable file
.file [name="problem-negative-word-const.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
.label screen = $400
.segment Code
main: {
.label w = 2
ldx #0
__b1:
// word w = i
txa
sta.z w
lda #0
sta.z w+1
// i&1
txa
and #1
// if(i&1)
cmp #0
beq __b2
lda #<-1
sta.z w
sta.z w+1
__b2:
// screen[i] = w
txa
asl
tay
lda.z w
sta screen,y
lda.z w+1
sta screen+1,y
// for( byte i:0..7)
inx
cpx #8
bne __b1
// }
rts
}
|
04-cubical-type-theory/material/Everything.agda | bafain/EPIT-2020 | 1 | 5714 | <reponame>bafain/EPIT-2020
-- Import all the material (useful to check that everything typechecks)
{-# OPTIONS --cubical #-}
module Everything where
import Warmup
import Part1
import Part2
import Part3
import Part4
import ExerciseSession1
import ExerciseSession2
import ExerciseSession3
|
libsrc/_DEVELOPMENT/adt/b_vector/c/sccz80/b_vector_insert_block_callee.asm | jpoikela/z88dk | 640 | 16458 | <filename>libsrc/_DEVELOPMENT/adt/b_vector/c/sccz80/b_vector_insert_block_callee.asm<gh_stars>100-1000
; void *b_vector_insert_block(b_vector_t *v, size_t idx, size_t n)
SECTION code_clib
SECTION code_adt_b_vector
PUBLIC b_vector_insert_block_callee
EXTERN asm_b_vector_insert_block
b_vector_insert_block_callee:
pop hl
pop de
pop bc
ex (sp),hl
jp asm_b_vector_insert_block
; SDCC bridge for Classic
IF __CLASSIC
PUBLIC _b_vector_insert_block_callee
defc _b_vector_insert_block_callee = b_vector_insert_block_callee
ENDIF
|
core/src/main/resources/eu/mihosoft/vmf/vmftext/antlr/GrammarVMF2.g4 | miho/VMF-Text | 9 | 2664 | <reponame>miho/VMF-Text
grammar GrammarVMF2;
/**
interface LangElement {
}
@InterfaceOnly
interface Scope extends LangElement {
}
@InterfaceOnly
interface ControlFlowScope extends Scope {
@Contains(opposite="parentClass")
Invocation[] getInvocations();
}
interface Class extends Scope {
@Contained(opposite="enclosedClass")
Class getEnclosingClass();
@Contains(opposite="enclosingClass")
Class[] getEnclosedClasses();
}
interface Invocation extends LangElement {
@Contained(opposite="invocations")
ControlFlowScope getParentScope();
}
interface ScopeInvocation extends Invocation {
ControlFlowScope getControlFlow();
}
*/
program: classes += clazz* testElems=elem+;
elem: 'elem' name=(IDENTIFIER | INT)
|'elem' (id=INT | id2 = IDENTIFIER) // TODO collect nested alternatives for the parser^{-1} (inverse, unparser)
;
clazz: 'class' name=IDENTIFIER '{'
(classes+=clazz|methodDeclarations+=methodDeclaration)*
'}';
methodDeclaration: 'method' name=IDENTIFIER '(' ')' '{'
controlFlow=controlFlowScope
'}';
invocation:
name=IDENTIFIER '(' ')' # methodInvocation
| name=IDENTIFIER '(' ')' + '{'
controlFlow=controlFlowScope
'}' # scopeInvocation
;
controlFlowScope : (invocations+=invocation)*;
/**
mappings:
INT -> int
BOOL -> boolean
BINOP -> Operator
PREFIXUNARYOP -> Operator
POSTFIXUNARYOP -> Operator
*/
// NEWLINE : [\r\n]+ ;
INT : [0-9]+ ;
BINOP : ('*'|'/'|'+'|'-');
PREFIXUNARYOP : ('++'|'--'|'!');
POSTFIXUNARYOP : ('++'|'--');
BOOL : 'true' | 'false';
//STRING: '"' CHAR* '"';
IDENTIFIER: [a-zA-Z][a-zA-Z0-9]*;
WhiteSpace
: [ \r\n\t]+ -> skip; |
FormalAnalyzer/models/meta/cap_thermostatMode.als | Mohannadcse/IoTCOM_BehavioralRuleExtractor | 0 | 2444 |
// filename: cap_thermostatMode.als
module cap_thermostatMode
open IoTBottomUp
one sig cap_thermostatMode extends Capability {}
{
attributes = cap_thermostatMode_attr
}
abstract sig cap_thermostatMode_attr extends Attribute {}
one sig cap_thermostatMode_attr_thermostatMode extends cap_thermostatMode_attr {}
{
values = cap_thermostatMode_attr_thermostatMode_val
}
abstract sig cap_thermostatMode_attr_thermostatMode_val extends AttrValue {}
one sig cap_thermostatMode_attr_thermostatMode_val_auto extends cap_thermostatMode_attr_thermostatMode_val {}
one sig cap_thermostatMode_attr_thermostatMode_val_cool extends cap_thermostatMode_attr_thermostatMode_val {}
one sig cap_thermostatMode_attr_thermostatMode_val_eco extends cap_thermostatMode_attr_thermostatMode_val {}
one sig cap_thermostatMode_attr_thermostatMode_val_rush_hour extends cap_thermostatMode_attr_thermostatMode_val {}
one sig cap_thermostatMode_attr_thermostatMode_val_emergency_heat extends cap_thermostatMode_attr_thermostatMode_val {}
one sig cap_thermostatMode_attr_thermostatMode_val_heat extends cap_thermostatMode_attr_thermostatMode_val {}
one sig cap_thermostatMode_attr_thermostatMode_val_off extends cap_thermostatMode_attr_thermostatMode_val {}
one sig cap_thermostatMode_attr_supportedThermostatModes extends cap_thermostatMode_attr {}
{
values = cap_thermostatMode_attr_supportedThermostatModes_val
}
abstract sig cap_thermostatMode_attr_supportedThermostatModes_val extends AttrValue {}
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_256.asm | ljhsiun2/medusa | 9 | 179020 | .global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r14
push %r9
push %rbp
// Faulty Load
lea addresses_D+0xdd7b, %rbp
nop
nop
nop
inc %r12
movb (%rbp), %r9b
lea oracles, %rbp
and $0xff, %r9
shlq $12, %r9
mov (%rbp,%r9,1), %r9
pop %rbp
pop %r9
pop %r14
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_D', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_D', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
|
Sistemas_Digitales/lab01/Lab1.asm | AntiDesert5/Ingenieria-en-Computacion-UAEM | 1 | 7949 | <reponame>AntiDesert5/Ingenieria-en-Computacion-UAEM
;**********************************************************************
; This file is a basic code template for assembly code generation *
; on the PIC16F887. This file contains the basic code *
; building blocks to build upon. *
; *
; Refer to the MPASM User's Guide for additional information on *
; features of the assembler (Document DS33014). *
; *
; Refer to the respective PIC data sheet for additional *
; information on the instruction set. *
; *
;**********************************************************************
; *
; Filename: xxx.asm *
; Date: *
; File Version: *
; *
; Author: *
; Company: *
; *
; *
;**********************************************************************
; *
; Files Required: P16F887.INC *
; *
;**********************************************************************
; *
; Notes: *
; *
;**********************************************************************
list p=16f887 ; list directive to define processor
#include <p16f887.inc> ; processor specific variable definitions
; '__CONFIG' directive is used to embed configuration data within .asm file.
; The labels following the directive are located in the respective .inc file.
; See respective data sheet for additional information on configuration word.
__CONFIG _CONFIG1, _LVP_OFF & _FCMEN_ON & _IESO_OFF & _BOR_OFF & _CPD_OFF & _CP_OFF & _MCLRE_ON & _PWRTE_ON & _WDT_OFF & _INTRC_OSC_NOCLKOUT
__CONFIG _CONFIG2, _WRT_OFF & _BOR21V
;***** VARIABLE DEFINITIONS
w_temp EQU 0x7D ; variable used for context saving
status_temp EQU 0x7E ; variable used for context saving
pclath_temp EQU 0x7F ; variable used for context saving
AUX EQU 0X0C
AUX2 EQU 0X0D
AUX3 EQU 0X40
;**********************************************************************
ORG 0x000 ; processor reset vector
nop
goto main ; go to beginning of program
goto CONFIG_PTOS ;Configuracion de puertos
CONFIG_PTOS:
bsf STATUS,RP0 ;Cambio al BANk_1
movlw 0xFF ;Configurar
movwf TRISA ;puerto A como entrada
movlw 0x00 ;Configurar el
movwf TRISB ;puerto B como salida
bsf STATUS,RP1 ;Cambiar al bank_3
clrf ANSEL ;configurar el PORT A como digital
clrf ANSELH ;configurar el PORT B como digital
bcf STATUS,RP0 ;cambio al BANK_0
bcf STATUS,RP1
main
; remaining code goes here
; Write your code here
MOVLW .201
ANDLW .153
MOVWF AUX ;aqui es el resultado de 201 and 153
CLRW
MOVLW .171
XORLW .148
MOVWF AUX2
CLRW
MOVF AUX,0
IORWF AUX2,0
MOVWF AUX3
COMF AUX3,0
IORWF PORTA,0
MOVWF PORTB
goto main
END ; directive 'end of program'
|
libsrc/games/trs80/bit_close_ei.asm | meesokim/z88dk | 0 | 19851 | <reponame>meesokim/z88dk<filename>libsrc/games/trs80/bit_close_ei.asm
; $Id: bit_close_ei.asm,v 1.3 2015/01/19 01:32:45 pauloscustodio Exp $
;
; TRS-80 1 bit sound functions
;
; Close sound and restore interrupts
;
; <NAME> - 8/4/2008
;
PUBLIC bit_close_ei
EXTERN bit_irqstatus
.bit_close_ei
xor a
out ($ff),a
push hl
ld hl,(bit_irqstatus)
ex (sp),hl
pop af
ret po
ei
ret
|
hexToBin.asm | page404/x86HexToBinManual | 0 | 242981 | <reponame>page404/x86HexToBinManual
include mylib.inc
CallDos equ <int 21h>
MyData segment
;-------------键盘输入相关的格式 输入字符串
g_dbSize db 30h ;第一个字节为缓冲区的大小(缓冲区的最大长度) 如果超出范围,DOS不让输入,并发出声音
g_dbLength db 0 ;第二个字节为实际的长度 (键盘输入后,自动填写)
g_strBuffer db 30h dup (0) ;从第三个字节开始,为Buffer
;回车 换行
g_strEnter db 0dh, 0ah, '$'
g_strTip db 'please input hex string:$'
g_strError db 'Error input$'
MyData ends
MyStack segment stack ;stack 声明此处是堆栈段,老的编译器有时候需要此声明
db 80h dup (0cch) ;在g_InitStack前面给同样大小的区域,防止堆栈溢出
g_InitStack db 80h dup (0cch) ;定义80h个字节,即十进制100个字节,作为我们的栈空间,以 cc 进行填充. 汇编中的数值,只要是 a到f开头的,前缀必须给0,否则编译器分不清是变量名还是数值.
MyStack ends
MyCode segment
START:
;数据段给类型 或者说是 声明数据段
assume ds : MyData
;---------设置数据段
mov ax, MyData
mov ds, ax
;---------设置堆栈段
mov ax, MyStack
mov ss, ax
;offset 表示取 g_InitStack标号的首地址
;栈顶设置在栈的中间位置,防止堆栈溢出
mov sp, offset g_InitStack
;在屏幕上输出
mov dx, offset g_strTip
mov ah, 09h
int 21h
;-------------等待用户选择对应的菜单选项
;DS:DX=缓冲区首地址
;(DS:DX+1)=实际输入的字符数
;(DS:DX)=缓冲区最大字符数
mov dx, offset g_dbSize
mov ah, 0ah ;0ah 表示键盘输入到缓冲区
int 21h
;下面要给输入完成的字符串添加结束符$,下面的 bl 存放的是用户实际输入的字符串长度,而加$时,用的是bx,为了将bh置0,这里直接将bx置0.
xor bx,bx
;到这一步时,用户已经输入完成,g_dbLength里面已经存入了我们输入的字符串实际长度
mov bl,g_dbLength ;默认访问的是 ds 段,所以在上面要声明 ds 在哪一个段 -> assume ds : MyData,这里才可以使用
;给我们输入的字符串在末尾添加结束符$
mov si,offset g_strBuffer
mov byte ptr [si+bx],'$'
;回车 换行
mov dx, offset g_strEnter
mov ah, 09h
CallDos
xor cx, cx
mov si, offset g_strBuffer
WHILE_BEGIN:
cmp cx, bx ;当前正在处理的十六进制位置 跟 我们输入的十六进制字符串总长度 进行比较
jae WHILE_END ;当cx 大于 bx 时,说明已经转换到了最后一个字符,跳转到 WHILE_END
mov bp, cx
xor ax, ax
mov al, ds:[si + bp]
push ax
call ShowBin ;调用 ShowBin 函数 , 这里为内平栈,即在 ShowBin 函数里 ret 2
cmp ax, 0 ;此时的 ax 为 ShowBin 的返回标识, 1:表示当前处理的为正常的十六进制字符 0:表示当前处理的不为十六进制字符
jnz NEXT
;当前处理的字符如果不为十六进制字符,在屏幕上输出 Error input 并跳转到EXIT_PROC标识,结束程序
mov dx, offset g_strError
mov ah, 9
int 21h
jmp EXIT_PROC
NEXT:
inc cx
jmp WHILE_BEGIN
WHILE_END:
EXIT_PROC:
mov ax, 4c00h
int 21h
MyCode ends
end START |
src/main/java/visitor/generated/AldwychParser.g4 | afarrukh125/AldwychImplementation | 1 | 3263 | parser grammar AldwychParser;
options { tokenVocab = AldwychLexer; }
aldwychClass
: (declaration)* mainprocedure (declaration)* EOF;
declaration
: heading CURLY_OPEN body CURLY_CLOSE # ProcedureNode
;
mainprocedure
: heading CURLY_OPEN finalrule SEMICOLON CURLY_CLOSE # MainProcedureNode
;
heading
: name formals;
name
: HASH ID;
formals
: readers RIGHT_ARROW writers;
readers
: ID
| PARENT_OPEN PARENT_CLOSE
| PARENT_OPEN (ID COMMA)* ID PARENT_CLOSE;
writers
: ID
| PARENT_OPEN PARENT_CLOSE
| PARENT_OPEN (ID COMMA)* ID PARENT_CLOSE;
body
: ruleset* finalrule
;
ruleset
: (regularrule SEMICOLON)+ COLON
;
regularrule
: ask (COMMA ask)* PRED_SEPARATOR tell (COMMA tell)*;
ask
: expr # AskNode
;
tell
: expr # TellNode
;
finalrule
: PRED_SEPARATOR tell (COMMA tell)*
;
expr
: ID EQUALS SQ_OPEN ID ARRAY_SEPARATOR ID SQ_CLOSE # ExtractableArrayNode
| ID? EQUALS ID PARENT_OPEN (expr (COMMA expr)*)? PARENT_CLOSE # StructureEqNode
| STRUCTURE_ID EQUALS ID PARENT_OPEN (expr (COMMA expr)*)? PARENT_CLOSE RIGHT_ARROW ID # OutputStructureNode
| ID PARENT_OPEN ( expr (COMMA expr)*)? PARENT_CLOSE (RIGHT_ARROW (ID |
PARENT_OPEN ID (COMMA ID)* PARENT_CLOSE))? # DispatchNode
| <assoc=right> expr (MULT_OPERATOR | DIV_OPERATOR) expr # DivMultNode
| <assoc=right> expr (MINUS_OPERATOR | PLUS_OPERATOR) expr # MinusPlusNode
| expr LESS_EQ expr # LEqNode
| expr LESS_THAN expr # LTNode
| expr EQUALS expr # EqNode
| expr LEFT_ARROW expr # AssignNode
| expr EQUALS EQUALS expr # DoubleEqualsNode
| expr GREATER_EQ expr # GEqNode
| expr GREATER_THAN expr # GTNode
| expr NOT_EQUAL expr # NEqNode
| SQ_OPEN (expr (COMMA expr)*)* SQ_CLOSE # ArrayNode
| ID # IdentifierNode
| (MINUS_OPERATOR? INTEGER) # IntegerNode
| STRING_CONST # StringConstNode
; |
theorems/cohomology/WithCoefficients.agda | cmknapp/HoTT-Agda | 0 | 16576 | {-# OPTIONS --without-K #-}
open import HoTT
module cohomology.WithCoefficients where
→Ω-group-structure : ∀ {i j} (X : Ptd i) (Y : Ptd j)
→ GroupStructure (fst (X ⊙→ ⊙Ω Y))
→Ω-group-structure X Y = record {
ident = ⊙cst;
inv = λ F → ((! ∘ fst F) , ap ! (snd F));
comp = λ F G → ⊙conc ⊙∘ ⊙×-in F G;
unitl = λ G → pair= idp (unitl-lemma (snd G));
unitr = λ F → ⊙λ= (∙-unit-r ∘ fst F) (unitr-lemma (snd F));
assoc = λ F G H → ⊙λ=
(λ x → ∙-assoc (fst F x) (fst G x) (fst H x))
(assoc-lemma (snd F) (snd G) (snd H));
invl = λ F → ⊙λ= (!-inv-l ∘ fst F) (invl-lemma (snd F));
invr = λ F → ⊙λ= (!-inv-r ∘ fst F) (invr-lemma (snd F))}
where
unitl-lemma : ∀ {i} {A : Type i} {x : A} {p : x == x} (α : p == idp)
→ ap (uncurry _∙_) (ap2 _,_ idp α) ∙ idp == α
unitl-lemma idp = idp
unitr-lemma : ∀ {i} {A : Type i} {x : A} {p : x == x} (α : p == idp)
→ ap (uncurry _∙_) (ap2 _,_ α idp) ∙ idp == ∙-unit-r p ∙ α
unitr-lemma idp = idp
assoc-lemma : ∀ {i} {A : Type i} {x : A} {p q r : x == x}
(α : p == idp) (β : q == idp) (γ : r == idp)
→ ap (uncurry _∙_) (ap2 _,_ (ap (uncurry _∙_) (ap2 _,_ α β) ∙ idp) γ) ∙ idp
== ∙-assoc p q r
∙ ap (uncurry _∙_) (ap2 _,_ α (ap (uncurry _∙_) (ap2 _,_ β γ) ∙ idp)) ∙ idp
assoc-lemma idp idp idp = idp
invl-lemma : ∀ {i} {A : Type i} {x : A} {p : x == x} (α : p == idp)
→ ap (uncurry _∙_) (ap2 _,_ (ap ! α) α) ∙ idp == !-inv-l p ∙ idp
invl-lemma idp = idp
invr-lemma : ∀ {i} {A : Type i} {x : A} {p : x == x} (α : p == idp)
→ ap (uncurry _∙_) (ap2 _,_ α (ap ! α)) ∙ idp == !-inv-r p ∙ idp
invr-lemma idp = idp
→Ω-group : ∀ {i j} (X : Ptd i) (Y : Ptd j) → Group (lmax i j)
→Ω-group X Y = Trunc-group (→Ω-group-structure X Y)
{- →Ω-group is functorial in the first argument -}
→Ω-group-dom-act : ∀ {i j k} {X : Ptd i} {Y : Ptd j}
(f : fst (X ⊙→ Y)) (Z : Ptd k)
→ (→Ω-group Y Z →ᴳ →Ω-group X Z)
→Ω-group-dom-act {Y = Y} f Z =
Trunc-group-hom (λ g → g ⊙∘ f)
(λ g₁ g₂ → ⊙∘-assoc ⊙conc (⊙×-in g₁ g₂) f
∙ ap (λ w → ⊙conc ⊙∘ w) (⊙×-in-pre∘ g₁ g₂ f))
→Ω-group-dom-idf : ∀ {i j} {X : Ptd i} (Y : Ptd j)
→ →Ω-group-dom-act (⊙idf X) Y == idhom (→Ω-group X Y)
→Ω-group-dom-idf Y = hom= _ _ $ λ= $ Trunc-elim
(λ _ → =-preserves-level _ Trunc-level) (λ _ → idp)
→Ω-group-dom-∘ : ∀ {i j k l} {X : Ptd i} {Y : Ptd j} {Z : Ptd k}
(g : fst (Y ⊙→ Z)) (f : fst (X ⊙→ Y)) (W : Ptd l)
→ →Ω-group-dom-act (g ⊙∘ f) W
== →Ω-group-dom-act f W ∘ᴳ →Ω-group-dom-act g W
→Ω-group-dom-∘ g f W = hom= _ _ $ λ= $
Trunc-elim (λ _ → =-preserves-level _ Trunc-level)
(λ h → ap [_] (! (⊙∘-assoc h g f)))
{- Pointed maps out of bool -}
Bool⊙→-out : ∀ {i} {X : Ptd i}
→ fst (⊙Lift {j = i} ⊙Bool ⊙→ X) → fst X
Bool⊙→-out (h , _) = h (lift false)
Bool⊙→-equiv : ∀ {i} (X : Ptd i)
→ fst (⊙Lift {j = i} ⊙Bool ⊙→ X) ≃ fst X
Bool⊙→-equiv {i} X = equiv Bool⊙→-out g f-g g-f
where
g : fst X → fst (⊙Lift {j = i} ⊙Bool ⊙→ X)
g x = ((λ {(lift b) → if b then snd X else x}) , idp)
f-g : ∀ x → Bool⊙→-out (g x) == x
f-g x = idp
g-f : ∀ H → g (Bool⊙→-out H) == H
g-f (h , hpt) = pair=
(λ= lemma)
(↓-app=cst-in $
idp
=⟨ ! (!-inv-l hpt) ⟩
! hpt ∙ hpt
=⟨ ! (app=-β lemma (lift true)) |in-ctx (λ w → w ∙ hpt) ⟩
app= (λ= lemma) (lift true) ∙ hpt ∎)
where lemma : ∀ b → fst (g (h (lift false))) b == h b
lemma (lift true) = ! hpt
lemma (lift false) = idp
abstract
Bool⊙→-path : ∀ {i} (X : Ptd i)
→ fst (⊙Lift {j = i} ⊙Bool ⊙→ X) == fst X
Bool⊙→-path X = ua (Bool⊙→-equiv X)
abstract
Bool⊙→Ω-is-π₁ : ∀ {i} (X : Ptd i)
→ →Ω-group (⊙Lift {j = i} ⊙Bool) X == πS 0 X
Bool⊙→Ω-is-π₁ {i} X = group-ua $
Trunc-group-iso Bool⊙→-out (λ _ _ → idp) (snd (Bool⊙→-equiv (⊙Ω X)))
|
oeis/162/A162624.asm | neoneye/loda-programs | 11 | 174338 | ; A162624: Triangle read by rows in which row n lists n terms, starting with n^4 + n - 1, such that the difference between successive terms is equal to n^4 - 1 = A123865(n).
; Submitted by <NAME>
; 1,17,32,83,163,243,259,514,769,1024,629,1253,1877,2501,3125,1301,2596,3891,5186,6481,7776,2407,4807,7207,9607,12007,14407,16807,4103,8198,12293,16388,20483,24578,28673,32768,6569,13129,19689,26249,32809,39369,45929,52489,59049,10009,20008,30007,40006,50005,60004,70003,80002,90001,100000,14651,29291,43931,58571,73211,87851,102491,117131,131771,146411,161051,20747,41482,62217,82952,103687,124422,145157,165892,186627,207362,228097,248832,28573,57133,85693,114253,142813,171373,199933,228493,257053
mov $2,$0
lpb $0
add $3,1
sub $2,$3
mov $0,$2
add $1,$3
trn $1,$2
lpe
add $0,1
add $3,1
pow $3,4
mul $3,$0
add $1,$3
mov $0,$1
|
test/asset/agda-stdlib-1.0/Data/List/NonEmpty/Properties.agda | omega12345/agda-mode | 0 | 3869 | <filename>test/asset/agda-stdlib-1.0/Data/List/NonEmpty/Properties.agda
------------------------------------------------------------------------
-- The Agda standard library
--
-- Properties of non-empty lists
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Data.List.NonEmpty.Properties where
open import Category.Monad
open import Data.List as List using (List; []; _∷_; _++_)
open import Data.List.Categorical using () renaming (monad to listMonad)
open import Data.List.NonEmpty.Categorical using () renaming (monad to list⁺Monad)
open import Data.List.NonEmpty as List⁺
open import Data.List.Properties
open import Function
open import Relation.Binary.PropositionalEquality
open ≡-Reasoning
private
open module LMo {a} =
RawMonad {f = a} listMonad
using () renaming (_>>=_ to _⋆>>=_)
open module L⁺Mo {a} =
RawMonad {f = a} list⁺Monad
η : ∀ {a} {A : Set a}
(xs : List⁺ A) → head xs ∷ tail xs ≡ List⁺.toList xs
η _ = refl
toList-fromList : ∀ {a} {A : Set a} x (xs : List A) →
x ∷ xs ≡ List⁺.toList (x ∷ xs)
toList-fromList _ _ = refl
toList-⁺++ : ∀ {a} {A : Set a} (xs : List⁺ A) ys →
List⁺.toList xs ++ ys ≡
List⁺.toList (xs ⁺++ ys)
toList-⁺++ _ _ = refl
toList-⁺++⁺ : ∀ {a} {A : Set a} (xs ys : List⁺ A) →
List⁺.toList xs ++ List⁺.toList ys ≡
List⁺.toList (xs ⁺++⁺ ys)
toList-⁺++⁺ _ _ = refl
toList->>= : ∀ {ℓ} {A B : Set ℓ}
(f : A → List⁺ B) (xs : List⁺ A) →
(List⁺.toList xs ⋆>>= List⁺.toList ∘ f) ≡
(List⁺.toList (xs >>= f))
toList->>= f (x ∷ xs) = begin
List.concat (List.map (List⁺.toList ∘ f) (x ∷ xs))
≡⟨ cong List.concat $ map-compose {g = List⁺.toList} (x ∷ xs) ⟩
List.concat (List.map List⁺.toList (List.map f (x ∷ xs)))
∎
|
src/shaders/h264/ildb/load_Cur_Y_Right_Most_4x16.asm | me176c-dev/android_hardware_intel-vaapi-driver | 192 | 83017 | /*
* Copyright © <2010>, Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
* IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* This file was originally licensed under the following license
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
// Module name: load_Cur_Y_Right_Most_4x16.asm
//
// Load luma cur MB right most 4x16 into LEFT_TEMP_B
#if defined(_DEBUG)
mov (1) EntrySignatureC:w 0xDDD0:w
#endif
#if defined(_PROGRESSIVE)
// Read Y
add (1) MSGSRC.0<1>:ud ORIX_CUR:w 12:w { NoDDClr } // Block origin, move right 12 bytes
mov (1) MSGSRC.1<1>:ud ORIY_CUR:w { NoDDClr, NoDDChk } // Block origin
mov (1) MSGSRC.2<1>:ud 0x000F0003:ud { NoDDChk } // Block width and height (4x16)
send (8) LEFT_TEMP_D(0)<1> MSGHDRL MSGSRC<8;8,1>:ud DAPREAD RESP_LEN(2)+DWBRMSGDSC_RC+BI_DEST_Y
#endif
#if defined(_FIELD) || defined(_MBAFF)
// FieldModeCurrentMbFlag determines how to access left MB
and.z.f0.0 (1) null:w r[ECM_AddrReg, BitFlags]:ub FieldModeCurrentMbFlag:w
and.nz.f0.1 (1) NULLREGW BitFields:w BotFieldFlag:w // Get bottom field flag
// Read Y
add (1) MSGSRC.0<1>:ud ORIX_CUR:w 12:w { NoDDClr } // Block origin, move right 12 bytes
mov (1) MSGSRC.1<1>:ud ORIY_CUR:w { NoDDClr, NoDDChk } // Block origin
mov (1) MSGSRC.2<1>:ud 0x000F0003:ud { NoDDChk } // Block width and height (4x16)
// Set message descriptor, etc.
(f0.0) if (1) ILDB_LABEL(ELSE_Y_4x16T)
// Frame picture
mov (1) MSGDSC RESP_LEN(2)+DWBRMSGDSC_RC+BI_DEST_Y:ud // Read 2 GRFs from DEST_Y
(f0.1) add (1) MSGSRC.1:d MSGSRC.1:d 16:w // Add vertical offset 16 for bot MB in MBAFF mode
ILDB_LABEL(ELSE_Y_4x16T):
else (1) ILDB_LABEL(ENDIF_Y_4x16T)
// Field picture
(f0.1) mov (1) MSGDSC RESP_LEN(2)+DWBRMSGDSC_RC_BF+BI_DEST_Y:ud // Read 2 GRFs from DEST_Y bottom field
(-f0.1) mov (1) MSGDSC RESP_LEN(2)+DWBRMSGDSC_RC_TF+BI_DEST_Y:ud // Read 2 GRFs from DEST_Y top field
endif
ILDB_LABEL(ENDIF_Y_4x16T):
// send (8) BUF_D(0)<1> MSGHDRY MSGSRC<8;8,1>:ud MSGDSC
send (8) LEFT_TEMP_D(0)<1> MSGHDRL MSGSRC<8;8,1>:ud DAPREAD MSGDSC
#endif
// Transpose 4x16 to 16x4
// Input received from dport:
// +-----------------------+-----------------------+-----------------------+-----------------------+
// |73 72 71 70 63 62 61 60 53 52 51 50 43 42 41 40 33 32 31 30 23 22 21 20 13 12 11 10 03 02 01 00|
// +-----------------------+-----------------------+-----------------------+-----------------------+
// |f3 f2 f1 f0 e3 e2 e1 e0 d3 d2 d1 d0 c3 c2 c1 c0 b3 b2 b1 b0 a3 a2 a1 a0 93 92 91 90 83 82 81 80|
// +-----------------------+-----------------------+-----------------------+-----------------------+
// Output of transpose: <1> <= <32;8,4>
// +-----------------------+-----------------------+-----------------------+-----------------------+
// |f1 e1 d1 c1 b1 a1 91 81 71 61 51 41 31 21 11 01 f0 e0 d0 c0 b0 a0 90 80 70 60 50 40 30 20 10 00|
// +-----------------------+-----------------------+-----------------------+-----------------------+
// |f3 e3 d3 c3 b3 a3 93 83 73 63 53 43 33 23 13 03 f2 e2 d2 c2 b2 a2 92 82 72 62 52 42 32 22 12 02|
// +-----------------------+-----------------------+-----------------------+-----------------------+
/*
// Transpose the data, also occupy 2 GRFs
mov (16) PREV_MB_YB(0)<1> BUF_B(0, 0)<32;8,4> { NoDDClr }
mov (16) PREV_MB_YB(0, 16)<1> BUF_B(0, 1)<32;8,4> { NoDDChk }
mov (16) PREV_MB_YB(1)<1> BUF_B(0, 2)<32;8,4> { NoDDClr }
mov (16) PREV_MB_YB(1, 16)<1> BUF_B(0, 3)<32;8,4> { NoDDChk }
*/
// End of load_Y_4x16T
|
oeis/027/A027476.asm | neoneye/loda-programs | 11 | 161076 | ; A027476: Third column of A027467.
; Submitted by <NAME>
; 1,45,1350,33750,759375,15946875,318937500,6150937500,115330078125,2114384765625,38058925781250,674680957031250,11806916748046875,204350482177734375,3503151123046875000,59553569091796875000,1004966478424072265625,16847967432403564453125,280799457206726074218750,4655359422111511230468750,76813430464839935302734375,1261934929065227508544921875,20649844293794631958007812500,336682243920564651489257812500,5471086463709175586700439453125,88631600712088644504547119140625
add $0,2
mov $1,15
pow $1,$0
bin $0,2
mul $1,$0
mov $0,$1
div $0,225
|
programs/oeis/092/A092043.asm | karttu/loda | 0 | 11050 | ; A092043: Numerator of n!/n^2.
; 1,1,2,3,24,20,720,630,4480,36288,3628800,3326400,479001600,444787200,5811886080,81729648000,20922789888000,19760412672000,6402373705728000,6082255020441600
mov $1,$0
add $0,1
fac $1
gcd $0,$1
div $1,$0
|
libsrc/_DEVELOPMENT/adt/w_vector/c/sdcc_iy/w_vector_erase_range.asm | jpoikela/z88dk | 640 | 166185 |
; size_t w_vector_erase_range(w_vector_t *v, size_t idx_first, size_t idx_last)
SECTION code_clib
SECTION code_adt_w_vector
PUBLIC _w_vector_erase_range
EXTERN _w_array_erase_range
defc _w_vector_erase_range = _w_array_erase_range
|
specs/ada/client/tkmrpc-clients.ads | DrenfongWong/tkm-rpc | 0 | 8251 | <filename>specs/ada/client/tkmrpc-clients.ads
package Tkmrpc.Clients is
end Tkmrpc.Clients;
|
programs/oeis/022/A022099.asm | karttu/loda | 0 | 168775 | <reponame>karttu/loda
; A022099: Fibonacci sequence beginning 1, 9.
; 1,9,10,19,29,48,77,125,202,327,529,856,1385,2241,3626,5867,9493,15360,24853,40213,65066,105279,170345,275624,445969,721593,1167562,1889155,3056717,4945872,8002589,12948461,20951050,33899511,54850561,88750072,143600633,232350705
mov $1,4
mov $3,36
lpb $0,1
sub $0,1
mov $2,$1
mov $1,$3
add $3,$2
lpe
div $1,4
|
libsrc/math/mbf32/c/sccz80/ceil.asm | ahjelm/z88dk | 640 | 10839 | <reponame>ahjelm/z88dk<gh_stars>100-1000
SECTION code_fp_mbf32
PUBLIC ceil
EXTERN msbios
EXTERN ___mbf32_setup_single
EXTERN ___mbf32_return
EXTERN ___mbf32_FPADD
EXTERN ___mbf32_FPREG
EXTERN ___mbf32_discard_fraction
ceil:
call ___mbf32_setup_single
call ___mbf32_discard_fraction
ld a,(___mbf32_FPREG+2) ;sign
rlca
jp nc,___mbf32_return
; This is negative, so we have to add one
ld bc,$8100
ld de,$0000
IF __CPU_INTEL__|__CPU_GBZ80__
call ___mbf32_FPADD
ELSE
ld ix,___mbf32_FPADD
call msbios
ENDIF
jp ___mbf32_return
|
agda-stdlib-0.9/src/Relation/Binary/OrderMorphism.agda | qwe2/try-agda | 1 | 4939 | <reponame>qwe2/try-agda<gh_stars>1-10
------------------------------------------------------------------------
-- The Agda standard library
--
-- Order morphisms
------------------------------------------------------------------------
module Relation.Binary.OrderMorphism where
open import Relation.Binary
open Poset
import Function as F
open import Level
record _⇒-Poset_ {p₁ p₂ p₃ p₄ p₅ p₆}
(P₁ : Poset p₁ p₂ p₃)
(P₂ : Poset p₄ p₅ p₆) : Set (p₁ ⊔ p₃ ⊔ p₄ ⊔ p₆) where
field
fun : Carrier P₁ → Carrier P₂
monotone : _≤_ P₁ =[ fun ]⇒ _≤_ P₂
_⇒-DTO_ : ∀ {p₁ p₂ p₃ p₄ p₅ p₆} →
DecTotalOrder p₁ p₂ p₃ →
DecTotalOrder p₄ p₅ p₆ → Set _
DTO₁ ⇒-DTO DTO₂ = poset DTO₁ ⇒-Poset poset DTO₂
where open DecTotalOrder
open _⇒-Poset_
id : ∀ {p₁ p₂ p₃} {P : Poset p₁ p₂ p₃} → P ⇒-Poset P
id = record
{ fun = F.id
; monotone = F.id
}
_∘_ : ∀ {p₁ p₂ p₃ p₄ p₅ p₆ p₇ p₈ p₉}
{P₁ : Poset p₁ p₂ p₃}
{P₂ : Poset p₄ p₅ p₆}
{P₃ : Poset p₇ p₈ p₉} →
P₂ ⇒-Poset P₃ → P₁ ⇒-Poset P₂ → P₁ ⇒-Poset P₃
f ∘ g = record
{ fun = F._∘_ (fun f) (fun g)
; monotone = F._∘_ (monotone f) (monotone g)
}
const : ∀ {p₁ p₂ p₃ p₄ p₅ p₆}
{P₁ : Poset p₁ p₂ p₃}
{P₂ : Poset p₄ p₅ p₆} →
Carrier P₂ → P₁ ⇒-Poset P₂
const {P₂ = P₂} x = record
{ fun = F.const x
; monotone = F.const (refl P₂)
}
|
Lab2/Preliminary_Work/convertToDec.asm | zeynepCankara/Computer_Organization_Labs | 3 | 174977 | <gh_stars>1-10
# <NAME> -- 04/03/2019
# Course: CS223
# Section: 02
# Lab: 02
# convertToDec.asm -- Converts user input octal to decimal
#************************
# *
# text segment *
# *
#************************
.globl __start
.text
__start:
# Request the string
la $a0, promptOctal
li $v0, 4
syscall
la $a0, octalAddress
li $a1, 21 # max 21 bytes to read
li $v0, 8 # read octal number as string
sw $a0, octalAddress
syscall
# load the address
la $a0, octalAddress
# Converts user input str (octal) to dec
jal convertToDec
# print the decimal value
move $a0, $v0
li $v0, 1
syscall
li $v0, 10
syscall # Exit the programme
convertToDec:
malloc: # allocate the stack space
subi $sp, $sp, 20
sw $s0, 16($sp)
sw $s1, 12($sp)
sw $s2, 8($sp)
sw $s3, 4($sp)
sw $ra, 0($sp)
# find end of the string
# s0 contains address of the last char after stringEnd
stringEnd:
move $s0, $a0 # s0: address of the string
nextChar:
lb $s1, 0($s0) # s1: current char
blt $s1, 10, foundEnd # "enter" (ASCII : 10)"
addi $s0, $s0, 1 # goto next char
j nextChar
foundEnd:
subi $s0, $s0, 2 # excluding enter (ASCII: 10)
li $s2, 1 # go from lsd(least sig digit) to msd(most sig digit)
li $s3, 8
li $v0, 0 # will contain the result
calcDec:
# check beginning of string reached or not
blt $s0, $a0, finish
lb $s1, 0($s0) # load the octal character
bgt $s1, 56, notValidOctal # digit > 7 (not valid octal value)
blt $s1, 48, notValidOctal # digit < 0 (not valid octal value)
asciiToDec:
subi $s1, $s1, 48 # get the decimal value
mul $s1, $s2, $s1 # adjust
# add to the result
add $v0, $v0, $s1
# decrement the address go to the next char in string
subi $s0, $s0, 1
mul $s2, $s2, $s3 # 8**(digit)
j calcDec
notValidOctal:
# raise an error
li $v0, -1
finish:
# obtained the result in v0
calloc: # deallocate the stack space
lw $ra, 0($sp)
lw $s3, 4($sp)
lw $s2, 8($sp)
lw $s1, 12($sp)
lw $s0, 16($sp)
addi $sp, $sp, 20
jr $ra # return main
#************************
# *
# data segment *
# *
#************************
.data
octalAddress: .space 8
promptOctal: .asciiz "\nPlease enter the octal value(7 digits max): " |
fireeffect/src/buffer.asm | Zaalan3/TI84-CE-Graphical-Demos | 2 | 165809 | xdef _screen
xdef _buf1
_screen:
.db 40,30
_buf1:
.blkb 40*30,0
|
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c45202b.ada | best08618/asylo | 7 | 14043 | -- C45202B.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- CHECK MEMBERSHIP OPERATIONS IN THE CASE IN WHICH A USER HAS
-- REDEFINED THE ORDERING OPERATORS.
-- RJW 1/22/86
WITH REPORT; USE REPORT;
PROCEDURE C45202B IS
BEGIN
TEST( "C45202B" , "CHECK MEMBERSHIP OPERATIONS IN WHICH A USER " &
"HAS REDEFINED THE ORDERING OPERATORS" ) ;
DECLARE
TYPE T IS ( AA, BB, CC, LIT, XX, YY, ZZ );
SUBTYPE ST IS T RANGE AA .. LIT;
VAR : T := LIT ;
CON : CONSTANT T := LIT ;
FUNCTION ">" ( L, R : T ) RETURN BOOLEAN IS
BEGIN
RETURN T'POS(L) <= T'POS(R);
END;
FUNCTION ">=" ( L, R : T ) RETURN BOOLEAN IS
BEGIN
RETURN T'POS(L) < T'POS(R);
END;
FUNCTION "<" ( L, R : T ) RETURN BOOLEAN IS
BEGIN
RETURN T'POS(L) >= T'POS(R);
END;
FUNCTION "<=" ( L, R : T ) RETURN BOOLEAN IS
BEGIN
RETURN T'POS(L) > T'POS(R);
END;
BEGIN
IF LIT NOT IN ST OR
VAR NOT IN ST OR
CON NOT IN ST OR
NOT (VAR IN ST) OR
XX IN ST OR
NOT (XX NOT IN ST)
THEN
FAILED( "WRONG VALUES FOR 'IN ST'" );
END IF;
IF LIT IN AA ..CC OR
VAR NOT IN LIT..ZZ OR
CON IN ZZ ..AA OR
NOT (CC IN CC .. YY) OR
NOT (BB NOT IN CC .. YY)
THEN
FAILED( "WRONG VALUES FOR 'IN AA..CC'" );
END IF;
END;
RESULT;
END C45202B;
|
programs/asm/screens/intro/intro.asm | Zenith80/initial_emulator | 9 | 3824 | .include "keyboard.inc"
.include "data.inc"
intro:
call cls
ld hl, .strings
ld bc, 0
ld a, 7
call looped_print
.loop:
call shared@screens
cp keyb
jp z, .begin
jr .loop
.begin:
ld hl, data
inc hl
ld (hl), 1
ret
.strings: .dw string1@intro, dark_prince@shared_strings, string2@intro
.dw dark_country@shared_strings, string3@intro, shared_options, options@intro
.string1:
.db "The year is 1394. For years, the dark prince ",0
.string2:
.db " has ruled the country of ",0
.string3:
.db " with an iron fist. Now, people are starting to "
.db "fight back.\n"
.db "\n"
.db "Your job as the player is to maintain a network of informants, "
.db "plan out battles, and overthrow him.\n"
.db "\n"
.db "Unlike in most games, you don't control one character, or even a "
.db "group of characters. You alternate between many different people "
.db "with the job of coordinating them.\n"
.db "\n"
.db "However, there *are* still traditional RPG elements - exploring, "
.db "fighting, character classes, levelling up - but the characters "
.db "are premade, and each one has their own ",'"',"feel",'"',".\n"
.db "\n"
.db "Good luck.\n"
.db 0x0A,0
.options:
.db "'b' - Begin\n"
.db 0
|
src/Web/Semantic/DL/TBox/Skolemization.agda | agda/agda-web-semantic | 9 | 1452 | <reponame>agda/agda-web-semantic<filename>src/Web/Semantic/DL/TBox/Skolemization.agda
open import Data.Bool using ( Bool ; true ; false ; if_then_else_ )
open import Data.Empty using ( ⊥-elim )
open import Data.Product using ( _×_ ; _,_ )
open import Data.Sum using ( inj₁ ; inj₂ )
open import Relation.Unary using ( _∈_ ; _∉_ )
open import Web.Semantic.DL.Concept using ( neg )
open import Web.Semantic.DL.Concept.Model using ( _⟦_⟧₁ ; neg-sound )
open import Web.Semantic.DL.Concept.Skolemization using
( CSkolems ; cskolem ; cskolem-sound )
open import Web.Semantic.DL.FOL using
( Formula ; true ; false ; _∧_ ; _∈₁_ ; _∈₂_ ; _∼_ ; ∀₁ )
open import Web.Semantic.DL.FOL.Model using ( _⊨f_ )
open import Web.Semantic.DL.Role.Skolemization using
( rskolem ; rskolem⇒ ; rskolem-sound ; rskolem⇒-sound )
open import Web.Semantic.DL.Role.Model using ( _⟦_⟧₂ )
open import Web.Semantic.DL.Signature using ( Signature )
open import Web.Semantic.DL.TBox using
( TBox ; ε ; _,_ ;_⊑₁_ ; _⊑₂_ ; Dis ; Ref ; Irr ; Tra )
open import Web.Semantic.DL.TBox.Model using ( _⊨t_ )
open import Web.Semantic.Util using ( True ; tt )
module Web.Semantic.DL.TBox.Skolemization {Σ : Signature} where
TSkolems : Set → TBox Σ → Set
TSkolems Δ ε = True
TSkolems Δ (T , U) = (TSkolems Δ T) × (TSkolems Δ U)
TSkolems Δ (C ⊑₁ D) = (Δ → Bool) × (CSkolems Δ (neg C)) × (CSkolems Δ D)
TSkolems Δ (Q ⊑₂ R) = True
TSkolems Δ (Dis Q R) = True
TSkolems Δ (Ref R) = True
TSkolems Δ (Irr R) = True
TSkolems Δ (Tra R) = True
tskolem : ∀ {Δ} T → (TSkolems Δ T) → Formula Σ Δ
tskolem ε Φ = true
tskolem (T , U) (Φ , Ψ) = (tskolem T Φ) ∧ (tskolem U Ψ)
tskolem (C ⊑₁ D) (φ , Φ , Ψ) = ∀₁ λ x →
if (φ x) then (cskolem (neg C) Φ x) else (cskolem D Ψ x)
tskolem (Q ⊑₂ R) Φ = ∀₁ λ x → ∀₁ λ y →
rskolem⇒ Q x y (rskolem R x y)
tskolem (Dis Q R) Φ = ∀₁ λ x → ∀₁ λ y →
rskolem⇒ Q x y (rskolem⇒ R x y false)
tskolem (Ref R) Φ = ∀₁ λ x →
rskolem R x x
tskolem (Irr R) Φ = ∀₁ λ x →
rskolem⇒ R x x false
tskolem (Tra R) Φ = ∀₁ λ x → ∀₁ λ y → ∀₁ λ z →
rskolem⇒ R x y (rskolem⇒ R y z (rskolem R x z))
tskolem-sound : ∀ I T Φ → (I ⊨f tskolem T Φ) → (I ⊨t T)
tskolem-sound I ε Φ _ = tt
tskolem-sound I (T , U) (Φ , Ψ) (I⊨T , I⊨U) =
(tskolem-sound I T Φ I⊨T , tskolem-sound I U Ψ I⊨U)
tskolem-sound I (C ⊑₁ D) (φ , Φ , Ψ) I⊨C⊑D = lemma where
lemma : ∀ {x} → (x ∈ I ⟦ C ⟧₁) → (x ∈ I ⟦ D ⟧₁)
lemma {x} x∈⟦C⟧ with φ x | I⊨C⊑D x
lemma {x} x∈⟦C⟧ | true | x∈⟦¬C⟧ =
⊥-elim (neg-sound I C (cskolem-sound I (neg C) Φ x x∈⟦¬C⟧) x∈⟦C⟧)
lemma {x} x∈⟦C⟧ | false | x∈⟦D⟧ =
cskolem-sound I D Ψ x x∈⟦D⟧
tskolem-sound I (Q ⊑₂ R) Φ I⊨Q⊑R = lemma where
lemma : ∀ {xy} → (xy ∈ I ⟦ Q ⟧₂) → (xy ∈ I ⟦ R ⟧₂)
lemma {x , y} xy∈⟦Q⟧ =
rskolem-sound I R x y (rskolem⇒-sound I Q x y _ (I⊨Q⊑R x y) xy∈⟦Q⟧)
tskolem-sound I (Dis Q R) Φ I⊨DisQR = lemma where
lemma : ∀ {xy} → (xy ∈ I ⟦ Q ⟧₂) → (xy ∉ I ⟦ R ⟧₂)
lemma {x , y} xy∈⟦Q⟧ =
rskolem⇒-sound I R x y _ (rskolem⇒-sound I Q x y _ (I⊨DisQR x y) xy∈⟦Q⟧)
tskolem-sound I (Ref R) Φ I⊨RefR = λ x → rskolem-sound I R x x (I⊨RefR x)
tskolem-sound I (Irr R) Φ I⊨IrrR = λ x → rskolem⇒-sound I R x x _ (I⊨IrrR x)
tskolem-sound I (Tra R) Φ I⊨TraR =
λ {x} {y} {z} xy∈⟦R⟧ yz∈⟦R⟧ → rskolem-sound I R x z
(rskolem⇒-sound I R y z _ (rskolem⇒-sound I R x y _ (I⊨TraR x y z) xy∈⟦R⟧) yz∈⟦R⟧) |
agda-stdlib/src/Reflection/Argument/Information.agda | DreamLinuxer/popl21-artifact | 5 | 15666 | ------------------------------------------------------------------------
-- The Agda standard library
--
-- Argument information used in the reflection machinery
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Reflection.Argument.Information where
open import Data.Product
open import Relation.Nullary
import Relation.Nullary.Decidable as Dec
open import Relation.Nullary.Product using (_×-dec_)
open import Relation.Binary
open import Relation.Binary.PropositionalEquality
open import Reflection.Argument.Relevance as Relevance using (Relevance)
open import Reflection.Argument.Visibility as Visibility using (Visibility)
------------------------------------------------------------------------
-- Re-exporting the builtins publically
open import Agda.Builtin.Reflection public using (ArgInfo)
open ArgInfo public
------------------------------------------------------------------------
-- Operations
visibility : ArgInfo → Visibility
visibility (arg-info v _) = v
relevance : ArgInfo → Relevance
relevance (arg-info _ r) = r
------------------------------------------------------------------------
-- Decidable equality
arg-info-injective₁ : ∀ {v r v′ r′} → arg-info v r ≡ arg-info v′ r′ → v ≡ v′
arg-info-injective₁ refl = refl
arg-info-injective₂ : ∀ {v r v′ r′} → arg-info v r ≡ arg-info v′ r′ → r ≡ r′
arg-info-injective₂ refl = refl
arg-info-injective : ∀ {v r v′ r′} → arg-info v r ≡ arg-info v′ r′ → v ≡ v′ × r ≡ r′
arg-info-injective = < arg-info-injective₁ , arg-info-injective₂ >
_≟_ : DecidableEquality ArgInfo
arg-info v r ≟ arg-info v′ r′ =
Dec.map′ (uncurry (cong₂ arg-info))
arg-info-injective
(v Visibility.≟ v′ ×-dec r Relevance.≟ r′)
|
examples/outdated-and-incorrect/clowns/ChainRule.agda | asr/agda-kanso | 1 | 7325 | <gh_stars>1-10
module ChainRule where
import Sets
import Functor
import Logic.ChainReasoning.Poly as CR
import Isomorphism
import Derivative
open Derivative
open Sets
open Functor
open Semantics
open Isomorphism
module Chain = CR _==_ (\x -> refl{x = x}) (\x y z -> trans{x = x}{y}{z})
open Chain
chain-rule : (F G : U)(X : Set) -> ⟦ ∂ (F [ G ]) ⟧ X ≅ ⟦ ∂ F [ G ] × ∂ G ⟧ X
chain-rule F G X = iso (i F) (j F) (ji F) (ij F)
where
i : (F : U) -> ⟦ ∂ (F [ G ]) ⟧ X -> ⟦ ∂ F [ G ] × ∂ G ⟧ X
i (K A) ()
i Id x = < <> , x >
i (F₁ + F₂) (inl c) = (inl <×> id) (i F₁ c)
i (F₁ + F₂) (inr c) = (inr <×> id) (i F₂ c)
i (F₁ × F₂) (inl < c , f₂ >) = (inl ∘ <∙, f₂ > <×> id) (i F₁ c)
i (F₁ × F₂) (inr < f₁ , c >) = (inr ∘ < f₁ ,∙> <×> id) (i F₂ c)
j : (F : U) -> ⟦ ∂ F [ G ] × ∂ G ⟧ X -> ⟦ ∂ (F [ G ]) ⟧ X
j (K A) < () , _ >
j Id < <> , x > = x
j (F₁ + F₂) < inl x , y > = inl (j F₁ < x , y >)
j (F₁ + F₂) < inr x , y > = inr (j F₂ < x , y >)
j (F₁ × F₂) < inl < x , y > , z > = inl < j F₁ < x , z > , y >
j (F₁ × F₂) < inr < x , y > , z > = inr < x , j F₂ < y , z > >
ij : (F : U)(x : _) -> i F (j F x) == x
ij (K A) < () , _ >
ij Id < <> , x > = refl
ij (F₁ + F₂) < lx@(inl x) , y > =
subst (\ ∙ -> (inl <×> id) ∙ == < lx , y >)
(ij F₁ < x , y >) refl
ij (F₁ + F₂) < rx@(inr x) , y > =
subst (\ ∙ -> (inr <×> id) ∙ == < rx , y >)
(ij F₂ < x , y >) refl
ij (F₁ × F₂) < xy@(inl < x , y >) , z > =
subst (\ ∙ -> (inl ∘ <∙, y > <×> id) ∙ == < xy , z >)
(ij F₁ < x , z >) refl
ij (F₁ × F₂) < xy@(inr < x , y >) , z > =
subst (\ ∙ -> (inr ∘ < x ,∙> <×> id) ∙ == < xy , z >)
(ij F₂ < y , z >) refl
ji : (F : U)(y : _) -> j F (i F y) == y
ji (K A) ()
ji Id x = refl
ji (F₁ + F₂) (inl c) =
chain> j (F₁ + F₂) ((inl <×> id) (i F₁ c))
=== inl (j F₁ _) by cong (j (F₁ + F₂) ∘ (inl <×> id)) (η-[×] (i F₁ c))
=== inl (j F₁ (i F₁ c)) by cong (inl ∘ j F₁) (sym $ η-[×] (i F₁ c))
=== inl c by cong inl (ji F₁ c)
ji (F₁ + F₂) rc @ (inr c) =
subst (\ ∙ -> j (F₁ + F₂) ((inr <×> id) ∙) == rc) (η-[×] (i F₂ c))
$ subst (\ ∙ -> inr (j F₂ ∙) == rc) (sym $ η-[×] (i F₂ c))
$ subst (\ ∙ -> inr ∙ == rc) (ji F₂ c) refl
ji (F₁ × F₂) l @ (inl < c , f₂ >) =
subst (\ ∙ -> j (F₁ × F₂) ((inl ∘ <∙, f₂ > <×> id) ∙) == l) (η-[×] (i F₁ c))
$ subst (\ ∙ -> inl < j F₁ ∙ , f₂ > == l) (sym $ η-[×] (i F₁ c))
$ subst (\ ∙ -> inl < ∙ , f₂ > == l) (ji F₁ c) refl
ji (F₁ × F₂) r @ (inr < f₁ , c >) =
subst (\ ∙ -> j (F₁ × F₂) ((inr ∘ < f₁ ,∙> <×> id) ∙) == r) (η-[×] (i F₂ c))
$ subst (\ ∙ -> inr < f₁ , j F₂ ∙ > == r) (sym $ η-[×] (i F₂ c))
$ subst (\ ∙ -> inr < f₁ , ∙ > == r) (ji F₂ c) refl
|
Assembler_Unit_Test/AND.asm | hackingotter/LC3-Simulator | 0 | 17299 | .ORIG x3000
AND R0,R7,R3
AND R1,R2,#3
.end |
Task/Sort-an-array-of-composite-structures/Ada/sort-an-array-of-composite-structures-3.ada | LaudateCorpus1/RosettaCodeData | 1 | 3074 | with Ada.Text_Io;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
procedure Sort_Composite is
type Composite_Record is record
Name : Unbounded_String;
Value : Unbounded_String;
end record;
type Pairs_Array is array(Positive range <>) of Composite_Record;
procedure Swap(Left, Right : in out Composite_Record) is
Temp : Composite_Record := Left;
begin
Left := Right;
Right := Temp;
end Swap;
-- Sort_Names uses a bubble sort
procedure Sort_Name(Pairs : in out Pairs_Array) is
Swap_Performed : Boolean := True;
begin
while Swap_Performed loop
Swap_Performed := False;
for I in Pairs'First..(Pairs'Last - 1) loop
if Pairs(I).Name > Pairs(I + 1).Name then
Swap (Pairs(I), Pairs(I + 1));
Swap_Performed := True;
end if;
end loop;
end loop;
end Sort_Name;
procedure Print(Item : Pairs_Array) is
begin
for I in Item'range loop
Ada.Text_Io.Put_Line(To_String(Item(I).Name) & ", " &
to_String(Item(I).Value));
end loop;
end Print;
type Names is (Fred, Barney, Wilma, Betty, Pebbles);
type Values is (Home, Work, Cook, Eat, Bowl);
My_Pairs : Pairs_Array(1..5);
begin
for I in My_Pairs'range loop
My_Pairs(I).Name := To_Unbounded_String(Names'Image(Names'Val(Integer(I - 1))));
My_Pairs(I).Value := To_Unbounded_String(Values'Image(Values'Val(Integer(I - 1))));
end loop;
Print(My_Pairs);
Ada.Text_Io.Put_Line("=========================");
Sort_Name(My_Pairs);
Print(My_Pairs);
end Sort_Composite;
|
source/league/ucd/matreshka-internals-unicode-ucd-core_000f.ads | svn2github/matreshka | 24 | 20595 | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012-2015, <NAME> <<EMAIL>> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
pragma Restrictions (No_Elaboration_Code);
-- GNAT: enforce generation of preinitialized data section instead of
-- generation of elaboration code.
package Matreshka.Internals.Unicode.Ucd.Core_000F is
pragma Preelaborate;
Group_000F : aliased constant Core_Second_Stage
:= (16#00# => -- 0F00
(Other_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start => True,
others => False)),
16#01# .. 16#03# => -- 0F01 .. 0F03
(Other_Symbol, Neutral,
Other, Other, Other, Break_Before,
(Grapheme_Base => True,
others => False)),
16#04# => -- 0F04
(Other_Punctuation, Neutral,
Other, Other, Other, Break_Before,
(Grapheme_Base => True,
others => False)),
16#05# => -- 0F05
(Other_Punctuation, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base => True,
others => False)),
16#06# .. 16#07# => -- 0F06 .. 0F07
(Other_Punctuation, Neutral,
Other, Other, Other, Break_Before,
(Grapheme_Base => True,
others => False)),
16#08# => -- 0F08
(Other_Punctuation, Neutral,
Other, Other, Other, Glue,
(Terminal_Punctuation
| Grapheme_Base => True,
others => False)),
16#09# .. 16#0A# => -- 0F09 .. 0F0A
(Other_Punctuation, Neutral,
Other, Other, Other, Break_Before,
(Grapheme_Base => True,
others => False)),
16#0B# => -- 0F0B
(Other_Punctuation, Neutral,
Other, Other, Other, Break_After,
(Grapheme_Base => True,
others => False)),
16#0C# => -- 0F0C
(Other_Punctuation, Neutral,
Other, Other, Other, Glue,
(Grapheme_Base
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#0D# .. 16#11# => -- 0F0D .. 0F11
(Other_Punctuation, Neutral,
Other, Other, Other, Exclamation,
(Terminal_Punctuation
| Grapheme_Base => True,
others => False)),
16#12# => -- 0F12
(Other_Punctuation, Neutral,
Other, Other, Other, Glue,
(Terminal_Punctuation
| Grapheme_Base => True,
others => False)),
16#13# => -- 0F13
(Other_Symbol, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base => True,
others => False)),
16#14# => -- 0F14
(Other_Punctuation, Neutral,
Other, Other, Other, Exclamation,
(Grapheme_Base => True,
others => False)),
16#15# .. 16#17# => -- 0F15 .. 0F17
(Other_Symbol, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base => True,
others => False)),
16#18# .. 16#19# => -- 0F18 .. 0F19
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#1A# .. 16#1F# => -- 0F1A .. 0F1F
(Other_Symbol, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base => True,
others => False)),
16#20# .. 16#29# => -- 0F20 .. 0F29
(Decimal_Number, Neutral,
Other, Numeric, Numeric, Numeric,
(Grapheme_Base
| ID_Continue
| XID_Continue => True,
others => False)),
16#2A# .. 16#33# => -- 0F2A .. 0F33
(Other_Number, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base => True,
others => False)),
16#34# => -- 0F34
(Other_Symbol, Neutral,
Other, Other, Other, Break_After,
(Grapheme_Base => True,
others => False)),
16#35# => -- 0F35
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#36# => -- 0F36
(Other_Symbol, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base => True,
others => False)),
16#37# => -- 0F37
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#38# => -- 0F38
(Other_Symbol, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base => True,
others => False)),
16#39# => -- 0F39
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#3A# => -- 0F3A
(Open_Punctuation, Neutral,
Other, Other, Close, Open_Punctuation,
(Grapheme_Base => True,
others => False)),
16#3B# => -- 0F3B
(Close_Punctuation, Neutral,
Other, Other, Close, Close_Punctuation,
(Grapheme_Base => True,
others => False)),
16#3C# => -- 0F3C
(Open_Punctuation, Neutral,
Other, Other, Close, Open_Punctuation,
(Grapheme_Base => True,
others => False)),
16#3D# => -- 0F3D
(Close_Punctuation, Neutral,
Other, Other, Close, Close_Punctuation,
(Grapheme_Base => True,
others => False)),
16#3E# .. 16#3F# => -- 0F3E .. 0F3F
(Spacing_Mark, Neutral,
Spacing_Mark, Extend, Extend, Combining_Mark,
(Diacritic
| Grapheme_Base
| ID_Continue
| XID_Continue => True,
others => False)),
16#40# .. 16#42# => -- 0F40 .. 0F42
(Other_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start => True,
others => False)),
16#43# => -- 0F43
(Other_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#44# .. 16#47# => -- 0F44 .. 0F47
(Other_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start => True,
others => False)),
16#48# => -- 0F48
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#49# .. 16#4C# => -- 0F49 .. 0F4C
(Other_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start => True,
others => False)),
16#4D# => -- 0F4D
(Other_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#4E# .. 16#51# => -- 0F4E .. 0F51
(Other_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start => True,
others => False)),
16#52# => -- 0F52
(Other_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#53# .. 16#56# => -- 0F53 .. 0F56
(Other_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start => True,
others => False)),
16#57# => -- 0F57
(Other_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#58# .. 16#5B# => -- 0F58 .. 0F5B
(Other_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start => True,
others => False)),
16#5C# => -- 0F5C
(Other_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#5D# .. 16#68# => -- 0F5D .. 0F68
(Other_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start => True,
others => False)),
16#69# => -- 0F69
(Other_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#6A# .. 16#6C# => -- 0F6A .. 0F6C
(Other_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start => True,
others => False)),
16#6D# .. 16#70# => -- 0F6D .. 0F70
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#73# => -- 0F73
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#75# .. 16#76# => -- 0F75 .. 0F76
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#77# => -- 0F77
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Deprecated
| Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#78# => -- 0F78
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#79# => -- 0F79
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Deprecated
| Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#7F# => -- 0F7F
(Spacing_Mark, Neutral,
Spacing_Mark, Extend, Extend, Break_After,
(Other_Alphabetic
| Alphabetic
| Grapheme_Base
| ID_Continue
| XID_Continue => True,
others => False)),
16#81# => -- 0F81
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#82# .. 16#83# => -- 0F82 .. 0F83
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#84# => -- 0F84
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Case_Ignorable
| Grapheme_Extend
| Grapheme_Link
| ID_Continue
| XID_Continue => True,
others => False)),
16#85# => -- 0F85
(Other_Punctuation, Neutral,
Other, Other, Other, Break_After,
(Grapheme_Base => True,
others => False)),
16#86# .. 16#87# => -- 0F86 .. 0F87
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#88# .. 16#8C# => -- 0F88 .. 0F8C
(Other_Letter, Neutral,
Other, A_Letter, O_Letter, Alphabetic,
(Alphabetic
| Grapheme_Base
| ID_Continue
| ID_Start
| XID_Continue
| XID_Start => True,
others => False)),
16#93# => -- 0F93
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#98# => -- 0F98
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#9D# => -- 0F9D
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#A2# => -- 0FA2
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#A7# => -- 0FA7
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#AC# => -- 0FAC
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#B9# => -- 0FB9
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#BD# => -- 0FBD
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#BE# .. 16#BF# => -- 0FBE .. 0FBF
(Other_Symbol, Neutral,
Other, Other, Other, Break_After,
(Grapheme_Base => True,
others => False)),
16#C0# .. 16#C5# => -- 0FC0 .. 0FC5
(Other_Symbol, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base => True,
others => False)),
16#C6# => -- 0FC6
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#C7# .. 16#CC# => -- 0FC7 .. 0FCC
(Other_Symbol, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base => True,
others => False)),
16#CD# => -- 0FCD
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#CE# .. 16#CF# => -- 0FCE .. 0FCF
(Other_Symbol, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base => True,
others => False)),
16#D0# .. 16#D1# => -- 0FD0 .. 0FD1
(Other_Punctuation, Neutral,
Other, Other, Other, Break_Before,
(Grapheme_Base => True,
others => False)),
16#D2# => -- 0FD2
(Other_Punctuation, Neutral,
Other, Other, Other, Break_After,
(Grapheme_Base => True,
others => False)),
16#D3# => -- 0FD3
(Other_Punctuation, Neutral,
Other, Other, Other, Break_Before,
(Grapheme_Base => True,
others => False)),
16#D4# => -- 0FD4
(Other_Punctuation, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base => True,
others => False)),
16#D5# .. 16#D8# => -- 0FD5 .. 0FD8
(Other_Symbol, Neutral,
Other, Other, Other, Alphabetic,
(Grapheme_Base => True,
others => False)),
16#D9# .. 16#DA# => -- 0FD9 .. 0FDA
(Other_Punctuation, Neutral,
Other, Other, Other, Glue,
(Grapheme_Base => True,
others => False)),
16#DB# .. 16#FF# => -- 0FDB .. 0FFF
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
others =>
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)));
end Matreshka.Internals.Unicode.Ucd.Core_000F;
|
dos/msproc.asm | minblock/msdos | 0 | 12475 | <filename>dos/msproc.asm
; =========================================================================
; SCCSID = @(#)MSproc.asm 1.1 85/04/10
;
; Pseudo EXEC system call for DOS
;
; =========================================================================
.cref
.list
TITLE MSPROC - process maintenance
NAME MSPROC
;
; Microsoft Confidential
; Copyright (C) Microsoft Corporation 1991
; All Rights Reserved.
;
PAGE ,132
; =========================================================================
;** Process related system calls and low level routines for DOS 2.X.
; I/O specs are defined in DISPATCH.
;
; $WAIT
; $EXEC
; $Keep_process
; Stay_resident
; $EXIT
; $ABORT
; abort_inner
;
; Modification history:
;
; Created: ARR 30 March 1983
; AN000 version 4.0 jan. 1988
; A007 PTM 3957 - fake vesrion for IBMCACHE.COM
; A008 PTM 4070 - fake version for MS WINDOWS
;
; M000 added support for loading programs into UMBs 7/9/90
;
; M004 - MS PASCAL 3.2 support. Please see under tag M003 in
; dossym.inc. 7/30/90
; M005 - Support for EXE programs with out STACK segment and
; with resident size < 64K - 256 bytes. A 256 byte
; stack is provided at the end of the program. Note that
; only SP is changed.
; M020 - Fix for Rational bug for details see exepatch.asm
;
; M028 - 4b04 implementation
;
; M029 - Support for EXEs without stack rewritten. If EXE is
; in memory block >= 64K, sp = 0. If memory block
; obtained is <64K, point sp at the end of the memory
; block. For EXEs smaller than 64K, 256 bytes are still
; added for a stack segment which may be needed if it
; is loaded in low memory situations.
;
; M030 - Fixing bug in EXEPACPATCH & changing 4b04 to 4b05
;
; M040 - Bug #3052. The environment sizing code would flag a
; a bad environment if it reached 32767 bytes. Changed
; to allow 32768 bytes of environment.
;
; M047 - Release the allocated UMB when we failed to load a
; COM file high. Also ensure that if the biggest block
; into which we load the com file is less than 64K then
; we provide atleast 256 bytes of stack to the user.
;
; M050 - Made Lie table search CASE insensitive
;
; M060 - Removed special version table from the kernal and
; put it in a device drive which puts the address
; in the DOS DATA area location UU_IFS_DOS_CALL
; as a DWORD.
;
; M063 - Modified UMB support. If the HIGH_ONLY bit is set on
; entry do not try to load low if there is no space in
; UMBs.
;
; M068 - Support for copy protect apps. Call ChkCopyProt to
; set a20off_count. Set bit EXECA20BIT in DOS_FLAG. Also
; change return address to LeaveDos if AL=5.
;
; 20-Jul-1992 bens Added ifdef RESTRICTED_BUILD code that
; controls building a version of MSDOS.SYS that only
; runs programs from a fixed list (defined in the
; file RESTRICT.INC). Search for "RESTRICTED_BUILD"
; for details. This feature is used to build a
; "special" version of DOS that can be handed out to
; OEM/ISV customers as part of a "service" disk.
;
; =========================================================================
.XLIST
.XCREF
INCLUDE version.inc
INCLUDE dosseg.inc
INCLUDE DOSSYM.INC
INCLUDE DEVSYM.INC
INCLUDE exe.inc
INCLUDE sf.inc
INCLUDE curdir.inc
INCLUDE syscall.inc
INCLUDE arena.inc
INCLUDE pdb.inc
INCLUDE vector.inc
.CREF
.LIST
public retexepatch
; =========================================================================
ifdef ROMEXEC
ifndef JAPAN
BDATA segment at 70h
extrn RomStartAddr :word
BDATA ends
endif ; JAPAN
endif ; ROMEXEC
; =========================================================================
DosData SEGMENT WORD PUBLIC 'DATA'
EXTRN CreatePDB :BYTE
EXTRN DidCtrlC :BYTE
EXTRN Exit_type :BYTE
EXTRN ExtErr_Locus :BYTE ; Extended Error Locus
EXTRN InDos :BYTE
EXTRN OpenBuf :BYTE
; EXTRN OpenBuf :128
EXTRN CurrentPDB :WORD
EXTRN Exit_code :WORD
EXTRN DmaAdd :DWORD
; the following includes & i_needs are for exec.asm
; which is included in this source
; **** Fake_count to commented out
EXTRN Fake_Count :BYTE ; Fake version count
EXTRN Special_Entries :WORD ; Address of special entries
EXTRN Special_Version :WORD ; Special version number
EXTRN Temp_Var2 :WORD ; File type from $open
; following i_needs are becuse of moving these vars from
; exec.asm to ../inc/ms_data.asm
EXTRN exec_init_SP :WORD
EXTRN exec_init_SS :WORD
EXTRN exec_init_IP :WORD
EXTRN exec_init_CS :WORD
EXTRN exec_signature :WORD ; Must contain 4D5A (yay zibo!)
EXTRN exec_len_mod_512:WORD ; Low 9 bits of length
EXTRN exec_pages :WORD ; Number of 512b pages in file
EXTRN exec_rle_count :WORD ; Count of reloc entries
EXTRN exec_par_dir :WORD ; Number of paragraphs before image
EXTRN exec_min_BSS :WORD ; Minimum number of para of BSS
EXTRN exec_max_BSS :WORD ; Max number of para of BSS
EXTRN exec_SS :WORD ; Stack of image
EXTRN exec_SP :WORD ; SP of image
EXTRN exec_chksum :WORD ; Checksum of file (ignored)
EXTRN exec_IP :WORD ; IP of entry
EXTRN exec_CS :WORD ; CS of entry
EXTRN exec_rle_table :WORD ; Byte offset of reloc table
EXTRN DOS_FLAG :BYTE ; flag to indicate to redir that open
; came from exec.
EXTRN AllocMethod :BYTE ; how to alloc first(best)last
EXTRN SAVE_AX :WORD ; temp to save ax
EXTRN AllocMsave :BYTE ; M063: temp to save AllocMethod
EXTRN UU_IFS_DOS_CALL :DWORD ; M060 Ptr to version table
EXTRN A20OFF_PSP :WORD ; M068
EXTRN A20OFF_COUNT :BYTE ; M068
; =========================================================================
EXTRN Disa20_Xfer :WORD
allow_getdseg
EXTRN DriverLoad :BYTE
EXTRN BiosDataPtr :DWORD
extrn DosHasHMA :byte ; M021
extrn fixexepatch :word
extrn Rational386PatchPtr:word
extrn ChkCopyProt :word ; M068
extrn LeaveDos :word ; M068
DosData ENDS
; =========================================================================
DOSCODE SEGMENT
ASSUME SS:DOSDATA,CS:DOSCODE
EXTRN ExecReady:near
EXTRN UCase:near ; M050
SAVEXIT EQU 10
BREAK <$WAIT - return previous process error code>
; =========================================================================
; $WAIT - Return previous process error code.
;
; Assembler usage:
;
; MOV AH, WaitProcess
; INT int_command
;
; ENTRY none
; EXIT (ax) = exit code
; USES all
; =========================================================================
ASSUME DS:NOTHING,ES:NOTHING
PROCEDURE $Wait ,NEAR
xor AX,AX
xchg AX,exit_code
transfer Sys_Ret_OK
ENDPROC $Wait
ifdef RESTRICTED_BUILD
;*** IsFileOnGuestList - Check that file name is allowed to execute
;
; This function is called by $Exec just before it attempts to
; $Open the program file.
;
; Entry
; ds:dx = asciiz "guest" file name.
; Must be upper case and have no meta characters.
; CLD
;
; Exit-Success
; returns Carry CLEAR
;
; Exit-Failure
; returns Carry SET
; ax = error_access_denied
IsFileOnGuestList proc near
SaveReg <bx,cx,si,di,ds,es>
;* Compute length of guest name
push ds
pop es
mov di,dx ; es:di -> guest name
invoke StrLen ; cx = length of name including 00
mov bx,cx ; Save length for repeated use
;* Get list of allowed names
push cs
pop es
mov di,offset aszRestrict ; es:di -> allowed name list
;* Set null character and no error in one fell swoop!
xor ax,ax
;* Scan list for matching file name
;
; ax = 0 (used for repne scasb and successful return code)
; bx = length of guest name, including 00 terminator
; ds:dx -> guest name
; es:di -> next name on list
fgl10: cmp byte ptr es:[di],00 ; At end of list?
jz fgle ; YES, file not allowed, go fail
;* Compare names
mov si,dx ; ds:si -> guest name
mov cx,bx ; Length of guest name
repe cmpsb ; Do names match?
jz fglx ; YES, return success
;* Now we either ran past the end of the string in the list, or we are not
; at the end, but found a difference. We back up one character, since
; repe cmpsb advanced one character past the difference, and then scan
; the string in the list to find its end.
dec di ; es:di -> character that did not match
mov cx,-1 ; Make sure we look far enough ahead
repne scasb ; Find tail of name in list
;* Now es:[di] is first character of the next name in the list (or 00)
;
jmp fgl10 ; Go check next name
;* Name not found on list
;
fgle: mov ax,error_access_denied ; Set error code
stc ; Indicate error
fglx: RestoreReg <es,ds,di,si,cx,bx>
ret
IsFileOnGuestList endp
;** rstfile - macro to add file name to list
;
rstfile MACRO name
db name,0
endm
;** aszRestrict - list of files allowed to execute
;
aszRestrict LABEL byte
include restrict.inc ; build table
db 0 ; terminate table
endif ; RESTRICTED_BUILD
; =========================================================================
;BREAK <$exec - load/go a program>
; EXEC.ASM - EXEC System Call
;
;
; Assembler usage:
; lds DX, Name
; les BX, Blk
; mov AH, Exec
; mov AL, FUNC
; int INT_COMMAND
;
; AL Function
; -- --------
; 0 Load and execute the program.
; 1 Load, create the program header but do not
; begin execution.
; 3 Load overlay. No header created.
;
; AL = 0 -> load/execute program
;
; +---------------------------+
; | WORD segment address of |
; | environment. |
; +---------------------------+
; | DWORD pointer to ASCIZ |
; | command line at 80h |
; +---------------------------+
; | DWORD pointer to default |
; | FCB to be passed at 5Ch |
; +---------------------------+
; | DWORD pointer to default |
; | FCB to be passed at 6Ch |
; +---------------------------+
;
; AL = 1 -> load program
;
; +---------------------------+
; | WORD segment address of |
; | environment. |
; +---------------------------+
; | DWORD pointer to ASCIZ |
; | command line at 80h |
; +---------------------------+
; | DWORD pointer to default |
; | FCB to be passed at 5Ch |
; +---------------------------+
; | DWORD pointer to default |
; | FCB to be passed at 6Ch |
; +---------------------------+
; | DWORD returned value of |
; | CS:IP |
; +---------------------------+
; | DWORD returned value of |
; | SS:IP |
; +---------------------------+
;
; AL = 3 -> load overlay
;
; +---------------------------+
; | WORD segment address where|
; | file will be loaded. |
; +---------------------------+
; | WORD relocation factor to |
; | be applied to the image. |
; +---------------------------+
;
; Returns:
; AX = error_invalid_function
; = error_bad_format
; = error_bad_environment
; = error_not_enough_memory
; = error_file_not_found
; =========================================================================
;
; Revision history:
;
; A000 version 4.00 Jan. 1988
;
; =========================================================================
EXTRN Exec_Header_Len :ABS
Exec_Internal_Buffer EQU OpenBuf
Exec_Internal_Buffer_Size EQU (128+128+53+curdirLEN)
; =========================================================================
;IF1 ; warning message on buffers
;%out Please make sure that the following are contiguous and of the
;%out following sizes:
;%out
;%out OpenBuf 128
;%out RenBuf 128
;%out SearchBuf 53
;%out DummyCDS CurDirLen
;ENDIF
; =========================================================================
ifdef ROMEXEC ;SR; Externals from romfind.asm
EXTRN Check_name :NEAR
EXTRN Check_ROM :NEAR
IFDEF JAPAN ; YI 09/05/89
EXTRN ROMSTARTSEG :ABS
EXTRN ROMENDSEG :ABS
ENDIF
EXTRN BioDataSeg :WORD
endif ; ROMEXEC
; =========================================================================
;
; =========================================================================
procedure $Exec,NEAR
PUBLIC EXEC001S
EXEC001S:
LocalVar Exec_Blk ,DWORD
LocalVar Exec_Func ,BYTE
LocalVar Exec_Load_High ,BYTE
LocalVar Exec_FH ,WORD
LocalVar Exec_Rel_Fac ,WORD
LocalVar Exec_Res_Len_Para ,WORD
LocalVar Exec_Environ ,WORD
LocalVar Exec_Size ,WORD
LocalVar Exec_Load_Block ,WORD
LocalVar Exec_DMA ,WORD
LocalVar ExecNameLen ,WORD
LocalVar ExecName ,DWORD
LocalVar Exec_DMA_Save ,WORD
LocalVar Exec_NoStack ,BYTE
ifdef ROMEXEC
; Added 2 local variables to support exec from ROM
LocalVar ExecRomFound ,BYTE
LocalVar ExecRomAddr ,DWORD
endif ; ROMEXEC
; ==================================================================
; validate function
; ==================================================================
PUBLIC EXEC001E
EXEC001E:
;
; M068 - Start
;
; Reset the A20OFF_COUNT to 0. This is done as there is a
; possibility that the count may not be decremented all the way to
; 0. A typical case is if the program for which we intended to keep
; the A20 off for a sufficiently long time (A20OFF_COUNT int 21
; calls), exits pre-maturely due to error conditions.
;
mov [A20OFF_COUNT], 0
;
; If al=5 (ExecReady) we'll change the return address on the stack
; to be LeaveDos in msdisp.asm. This ensures that the EXECA20OFF
; bit set in DOS_FLAG by ExceReady is not cleared in msdisp.asm
;
cmp al, 5 ; Q: is this ExecReady call
jne @f ; N: continue
; Y: change ret addr. to LeaveDos.
pop cx ; Note CX is not input to ExecReady
mov cx, offset DOSCODE:LeaveDos
push cx
@@:
;
; M068 - End
;
Enter
cmp AL,5 ; only 0, 1, 3 or 5 are allowed ;M028
; M030
jna exec_check_2
Exec_Bad_Fun:
mov ExtErr_Locus,ErrLoc_Unk ; Extended Error Locus ;smr;SS Override
mov al,Error_Invalid_Function
Exec_Ret_Err:
Leave
transfer SYS_RET_ERR
ExecReadyJ:
call ExecReady ; M028
jmp norm_ovl ; do a Leave & xfer sysret_OK ; M028
Exec_Check_2:
cmp AL,2
jz Exec_Bad_Fun
cmp al, 4 ; 2 & 4 are not allowed
je Exec_Bad_Fun
cmp al, 5 ; M028 ; M030
je ExecReadyJ ; M028
mov Exec_BlkL,BX ; stash args
mov Exec_BlkH,ES
mov Exec_Func,AL
mov Exec_Load_high,0
mov execNameL,DX ; set up length of exec name
mov execNameH,DS
mov SI,DX ; move pointer to convenient place
invoke DStrLen
mov ExecNameLen,CX ; save length
ifdef ROMEXEC
; Check if ROM program
mov execRomFound,0 ; assume not in ROM
; Do not check for ROM if load overlay
test BYTE PTR Exec_Func,EXEC_FUNC_OVERLAY
jnz Do_Normal
; A ROM program exec should have no
; path or drive specifiers
push DX
push CX
push DS
push SI
push ES
dec CX ; length should not include NUL char
; Check if the program exists in ROM - returns address in
; dx,ax if success
call Check_name ; DS:SI points to string
jc not_rom_name
Exist_ROM:
push DS
mov DS, CS:[BioDataSeg]
IFDEF JAPAN ; YI 09/05/89
mov AX,DS:[ROMSTARTSEG]
ELSE
mov AX,DS:RomStartAddr
ENDIF
pop DS
mov ES,AX
xor AX,AX ; setup start addr for ROM scan
call Check_ROM
jc not_rom_name
mov execRomFound,1 ; flag that program is in ROM
mov execRomAddrL,AX
mov execRomAddrH,ES
pop ES
pop SI ; Skip file opening and checking -
pop DS ; check environment
pop CX
pop DX
jmp short exec_check_environ
not_rom_name:
pop ES
pop SI
pop DS
pop CX
pop DX ; restore dx
do_normal:
endif ; ROMEXEC
mov al, [AllocMethod] ; M063: save alloc method in
mov [AllocMsave], al ; M063: AllocMsave
xor AL,AL ; open for reading
push BP
or [DOS_FLAG], EXECOPEN ; this flag is set to indicate to
; the redir that this open call is
; due to an exec.
ifdef RESTRICTED_BUILD
call IsFileOnGuestList ; Should we execute this?
jc @F ; NO, skip open and fail
endif ; RESTRICTED_BUILD
invoke $OPEN ; is the file there?
ifdef RESTRICTED_BUILD
@@: ;* Come here if file name does not pass muster
endif ; RESTRICTED_BUILD
pushf
and [DOS_FLAG], not EXECOPEN; reset flag
popf
pop BP
ifdef ROMEXEC
jnc @F
jmp Exec_Ret_Err
@@:
else
jc Exec_Ret_Err
endif
mov Exec_Fh,AX
mov BX,AX
xor AL,AL
invoke $Ioctl
jc Exec_BombJ
test DL,DEVID_ISDEV
jz Exec_Check_Environ
mov AL,ERROR_FILE_NOT_FOUND
Exec_bombJ:
jmp Exec_Bomb
BadEnv:
mov AL,ERROR_BAD_ENVIRONMENT
jmp Exec_Bomb
Exec_Check_Environ:
mov Exec_Load_Block,0
mov Exec_Environ,0
; overlays... no environment
test BYTE PTR Exec_Func,EXEC_FUNC_OVERLAY
jnz Exec_Read_Header
lds SI,Exec_Blk ; get block
mov AX,[SI].Exec1_Environ ; address of environ
or AX,AX
jnz exec_scan_env
mov DS,CurrentPDB ;smr;SS Override
mov AX,DS:[PDB_environ]
;---------------------------------------------BUG 92 4/30/90-----------------
;
; Exec_environ is being correctly initialized after the environment has been
; allocated and copied form the parent's env. It must not be initialized here.
; Because if the call to $alloc below fails Exec_dealloc will deallocate the
; parent's environment.
; mov Exec_Environ,AX
;
;----------------------------------------------------------------------------
or AX,AX
jz Exec_Read_Header
Exec_Scan_Env:
mov ES,AX
xor DI,DI
mov CX,8000h ; at most 32k of environment ;M040
xor AL,AL
Exec_Get_Environ_Len:
repnz scasb ; find that nul byte
jnz BadEnv
dec CX ; Dec CX for the next nul byte test
js BadEnv ; gone beyond the end of the environment
scasb ; is there another nul byte?
jnz Exec_Get_Environ_Len ; no, scan some more
push DI
lea BX,[DI+0Fh+2]
add BX,ExecNameLen ; BX <- length of environment
; remember argv[0] length
; round up and remember argc
mov CL,4
shr BX,CL ; number of paragraphs needed
push ES
invoke $Alloc ; can we get the space?
pop DS
pop CX
jnc Exec_Save_Environ
jmp SHORT Exec_No_Mem ; nope... cry and sob
Exec_Save_Environ:
mov ES,AX
mov Exec_Environ,AX ; save him for a rainy day
xor SI,SI
mov DI,SI
rep movsb ; copy the environment
mov AX,1
stosw
lds SI,ExecName
mov CX,ExecNameLen
rep movsb
Exec_Read_Header:
ifdef ROMEXEC
; SR; For a ROM program, we skip reading the program header.
; We assume it to be a .COM program and go ahead.
cmp ExecRomFound,1
jne NoRom
jmp Exec_Com_File ;program is in ROM
NoRom:
endif ; ROMEXEC
; We read in the program header into the above data area and
; determine where in this memory the image will be located.
Context DS
mov CX,Exec_Header_Len ; header size
mov DX,OFFSET DosData:Exec_Signature
push ES
push DS
call ExecRead
pop DS
pop ES
jc Exec_Bad_File
or AX,AX
jz Exec_Bad_File
cmp AX,EXEC_HEADER_LEN ; did we read the right number?
jnz Exec_Com_Filej ; yep... continue
test Exec_Max_BSS,-1 ; indicate load high?
jnz Exec_Check_Sig
mov Exec_Load_High,-1
Exec_Check_Sig:
mov AX,Exec_Signature ; rms;NSS
cmp AX,Exe_Valid_Signature ; zibo arises!
jz Exec_Save_Start ; assume com file if no signature
cmp AX,exe_valid_Old_Signature ; zibo arises!
jz Exec_Save_Start ; assume com file if no signature
Exec_Com_Filej:
jmp Exec_Com_file
; We have the program header... determine memory requirements
Exec_Save_Start:
mov AX,Exec_Pages ; get 512-byte pages ;rms;NSS
mov CL,5 ; convert to paragraphs
shl AX,CL
sub AX,Exec_Par_Dir ; AX = size in paragraphs;rms;NSS
mov Exec_Res_Len_Para,AX
; Do we need to allocate memory?
; Yes if function is not load-overlay
test BYTE PTR exec_func,exec_func_overlay
jz exec_allocate ; allocation of space
; get load address from block
les DI,Exec_Blk
mov AX,ES:[DI].Exec3_Load_Addr
mov exec_dma,AX
mov AX,ES:[DI].Exec3_Reloc_Fac
mov Exec_Rel_Fac,AX
jmp Exec_Find_Res ; M000
Exec_No_Mem:
mov AL,Error_Not_Enough_Memory
jmp SHORT Exec_Bomb
Exec_Bad_File:
mov AL,Error_Bad_Format
Exec_Bomb:
ASSUME DS:NOTHING,ES:NOTHING
mov BX,Exec_fh
call Exec_Dealloc
LeaveCrit CritMem
save <AX,BP>
invoke $CLOSE
restore <BP,AX>
jmp Exec_Ret_Err
Exec_Chk_Mem:
; M063 - Start
mov al, [AllocMethod] ; save current alloc method in ax
mov bl, [AllocMsave]
mov [AllocMethod], bl ; restore original allocmethod
test bl, HIGH_ONLY ; Q: was the HIGH_ONLY bit already set
jnz Exec_No_Mem ; Y: no space in UMBs. Quit
; N: continue
test al, HIGH_ONLY ; Q: did we set the HIGH_ONLY bit
jz Exec_No_Mem ; N: no memory
mov ax, [save_ax] ; Y: restore ax and
jmp short Exec_Norm_Alloc ; Try again
; M063 - End
Exec_Allocate:
DOSAssume <DS>,"exec_allocate"
; M005 - START
; If there is no STACK segment for this exe file and if this
; not an overlay and the resident size is less than 64K -
; 256 bytes we shall add 256bytes bytes to the programs
; resident memory requirement and set Exec_SP to this value.
mov Exec_NoStack,0
cmp Exec_SS, 0 ; Q: is there a stack seg
jne @f ; Y: continue normal processing
cmp Exec_SP, 0 ; Q: is there a stack ptr
jne @f ; Y: continue normal processing
inc Exec_NoStack
cmp ax, 01000h-10h ; Q: is this >= 64K-256 bytes
jae @f ; Y: don't set Exec_SP
add ax, 010h ; add 10h paras to mem requirement
@@:
; M005 - END
; M000 - start
test byte ptr [AllocMethod], HIGH_FIRST
; Q: is the alloc strat high_first
jz Exec_Norm_Alloc ; N: normal allocate
; Y: set high_only bit
or byte ptr [AllocMethod], HIGH_ONLY
; M000 - end
Exec_Norm_Alloc:
mov [save_ax], ax ; M000: save ax for possible 2nd
; M000: attempt at allocating memory
; push ax ; M000
mov BX,0ffffh ; see how much room in arena
push DS
invoke $Alloc ; should have carry set and BX has max
pop DS
mov ax, [save_ax] ; M000
; pop AX ; M000
add AX,10h ; room for header
cmp BX,11h ; enough room for a header
jb Exec_Chk_Mem ; M000
; jb Exec_No_Mem ; M000
cmp AX,BX ; is there enough for bare image?
ja Exec_Chk_Mem ; M000
; ja Exec_No_Mem ; M000
test Exec_Load_High,-1 ; if load high, use max
jnz Exec_BX_Max ; use max
add AX,Exec_Min_BSS ; go for min allocation;rms;NSS
jc Exec_Chk_Mem ; M000
; jc Exec_No_Mem ; M000: oops! carry
cmp AX,BX ; enough space?
ja Exec_Chk_Mem ; M000: nope...
; ja Exec_No_Mem ; M000: nope...
sub AX,Exec_Min_BSS ; rms;NSS
add AX,Exec_Max_BSS ; go for the MAX
jc Exec_BX_Max
cmp AX,BX
jbe Exec_Got_Block
Exec_BX_Max:
mov AX,BX
Exec_Got_Block:
push DS
mov BX,AX
mov exec_size,BX
invoke $Alloc ; get the space
pop DS
ljc exec_chk_mem ; M000
mov cl, [AllocMsave] ; M063:
mov [AllocMethod], cl ; M063: restore allocmethod
;M029; Begin changes
; This code does special handling for programs with no stack segment. If so,
;check if the current block is larger than 64K. If so, we do not modify
;Exec_SP. If smaller than 64K, we make Exec_SP = top of block. In either
;case Exec_SS is not changed.
;
cmp Exec_NoStack,0
je @f
cmp bx,1000h ; Q: >= 64K memory block
jae @f ; Y: Exec_SP = 0
;
;Make Exec_SP point at the top of the memory block
;
mov cl,4
shl bx,cl ; get byte offset
sub bx,100h ; take care of PSP
mov Exec_SP,bx ; Exec_SP = top of block
@@:
;
;M029; end changes
;
mov exec_load_block,AX
add AX,10h
test exec_load_high,-1
jz exec_use_ax ; use ax for load info
add AX,exec_size ; go to end
sub AX,exec_res_len_para ; drop off header
sub AX,10h ; drop off pdb
Exec_Use_AX:
mov Exec_Rel_Fac,AX ; new segment
mov Exec_Dma,AX ; beginning of dma
; Determine the location in the file of the beginning of
; the resident
Exec_Find_Res:
mov DX, exec_dma
mov exec_dma_save, DX
mov DX,Exec_Par_Dir
push DX
mov CL,4
shl DX,CL ; low word of location
pop AX
mov CL,12
shr AX,CL ; high word of location
mov CX,AX ; CX <- high
; Read in the resident image (first, seek to it)
mov BX,Exec_FH
push DS
xor AL,AL
invoke $Lseek ; Seek to resident
pop DS
jnc exec_big_read
jmp exec_bomb
Exec_Big_Read: ; Read resident into memory
mov BX,Exec_Res_Len_Para
cmp BX,1000h ; Too many bytes to read?
jb Exec_Read_OK
mov BX,0fe0h ; Max in one chunk FE00 bytes
Exec_Read_OK:
sub Exec_Res_Len_Para,BX ; We read (soon) this many
push BX
mov CL,4
shl BX,CL ; Get count in bytes from paras
mov CX,BX ; Count in correct register
push DS
mov DS,Exec_DMA ; Set up read buffer
ASSUME DS:NOTHING
xor DX,DX
push CX ; Save our count
call ExecRead
pop CX ; Get old count to verify
pop DS
jc Exec_Bad_FileJ
DOSAssume <DS>,"exec_read_ok"
cmp CX,AX ; Did we read enough?
pop BX ; Get paragraph count back
jz ExecCheckEnd ; and do reloc if no more to read
; The read did not match the request. If we are off by 512
; bytes or more then the header lied and we have an error.
sub CX,AX
cmp CX,512
jae Exec_Bad_FileJ
; We've read in CX bytes... bump DTA location
ExecCheckEnd:
add Exec_DMA,BX ; Bump dma address
test Exec_Res_Len_Para,-1
jnz Exec_Big_Read
; The image has now been read in. We must perform relocation
; to the current location.
ifdef ROMDOS
cmp [DosHasHMA], 0 ; DOS using HMA? (M021)
je exec_do_reloc ; if not, then no patch needed.
endif
exec_do_reloc:
mov CX,Exec_Rel_Fac
mov AX,Exec_SS ; get initial SS ;rms;NSS
add AX,CX ; and relocate him
mov Exec_Init_SS,AX ; rms;NSS
mov AX,Exec_SP ; initial SP ;rms;NSS
mov Exec_Init_SP,AX ; rms;NSS
les AX,DWORD PTR exec_IP ; rms;NSS
mov Exec_Init_IP,AX ; rms;NSS
mov AX,ES ; rms;NSS
add AX,CX ; relocated...
mov Exec_Init_CS,AX ; rms;NSS
xor CX,CX
mov DX,Exec_RLE_Table ; rms;NSS
mov BX,Exec_FH
push DS
xor AX,AX
invoke $Lseek
pop DS
jnc Exec_Get_Entries
exec_bad_filej:
jmp Exec_Bad_File
exec_get_entries:
mov DX,Exec_RLE_Count ; Number of entries left ;rms;NSS
exec_read_reloc:
ASSUME DS:NOTHING
push DX
mov DX,OFFSET DOSDATA:Exec_Internal_Buffer
mov CX,((EXEC_INTERNAL_BUFFER_SIZE)/4)*4
push DS
call ExecRead
pop ES
pop DX
jc Exec_Bad_FileJ
mov CX,(EXEC_INTERNAL_BUFFER_SIZE)/4
; Pointer to byte location in header
mov DI,OFFSET DOSDATA:exec_internal_buffer
mov SI,Exec_Rel_Fac ; Relocate a single address
exec_reloc_one:
or DX,DX ; Any more entries?
je Exec_Set_PDBJ
exec_get_addr:
lds BX,DWORD PTR ES:[DI] ; Get ra/sa of entry
mov AX,DS ; Relocate address of item
;;;;;; add AX,SI
add AX, exec_dma_save
mov DS,AX
add [BX],SI
add DI,4
dec DX
loop Exec_Reloc_One ; End of internal buffer?
; We've exhausted a single buffer's worth. Read in the next
; piece of the relocation table.
push ES
pop DS
jmp Exec_Read_Reloc
Exec_Set_PDBJ:
;
; We now determine if this is a buggy exe packed file and if
; so we patch in the right code. Note that fixexepatch will
; point to a ret if dos loads low. The load segment as
; determined above will be in exec_dma_save
;
push es
push ax ; M030
push cx ; M030
mov es, exec_dma_save
mov ax, exec_init_CS ; M030
mov cx, exec_init_IP ; M030
call word ptr [fixexepatch]
call word ptr [Rational386PatchPtr]
pop cx ; M030
pop ax ; M030
pop es
jmp Exec_Set_PDB
Exec_No_Memj:
jmp Exec_No_Mem
; we have a .COM file. First, determine if we are merely
; loading an overlay.
Exec_Com_File:
test BYTE PTR Exec_Func,EXEC_FUNC_OVERLAY
jz Exec_Alloc_Com_File
lds SI,Exec_Blk ; get arg block
lodsw ; get load address
mov Exec_DMA,AX
mov AX,0ffffh
jmp SHORT Exec_Read_Block ; read it all!
Exec_Chk_Com_Mem:
; M063 - Start
mov al, [AllocMethod] ; save current alloc method in ax
mov bl, [AllocMsave]
mov [AllocMethod], bl ; restore original allocmethod
test bl, HIGH_ONLY ; Q: was the HIGH_ONLY bit already set
jnz Exec_No_Memj ; Y: no space in UMBs. Quit
; N: continue
test al, HIGH_ONLY ; Q: did we set the HIGH_ONLY bit
jz Exec_No_Memj ; N: no memory
mov ax, exec_load_block ; M047: ax = block we just allocated
xor bx, bx ; M047: bx => free arena
call ChangeOwner ; M047: free this block
jmp short Exec_Norm_Com_Alloc
; M063 - End
; We must allocate the max possible size block (ick!)
; and set up CS=DS=ES=SS=PDB pointer, IP=100, SP=max
; size of block.
Exec_Alloc_Com_File:
; M000 -start
test byte ptr [AllocMethod], HIGH_FIRST
; Q: is the alloc strat high_first
jz Exec_Norm_Com_Alloc ; N: normal allocate
; Y: set high_only bit
or byte ptr [AllocMethod], HIGH_ONLY
; M000 - end
Exec_Norm_Com_Alloc: ; M000
mov BX,0FFFFh
invoke $Alloc ; largest piece available as error
or BX,BX
jz Exec_Chk_Com_Mem ; M000
; jz Exec_No_Memj ; M000
mov Exec_Size,BX ; save size of allocation block
push BX
invoke $ALLOC ; largest piece available as error
pop BX ; get size of block...
mov Exec_Load_Block,AX
add AX,10h ; increment for header
mov Exec_DMA,AX
xor AX,AX ; presume 64K read...
cmp BX,1000h ; 64k or more in block?
jae Exec_Read_Com ; yes, read only 64k
mov AX,BX ; convert size to bytes
mov CL,4
shl AX,CL
cmp AX,200h ; enough memory for PSP and stack?
jbe Exec_Chk_Com_Mem ; M000: jump if not
; jbe Exec_No_Memj ; M000: jump if not
; M047: size of the block is < 64K
sub ax, 100h ; M047: reserve 256 bytes for stack
Exec_Read_Com:
sub AX,100h ; remember size of psp
ifdef ROMEXEC
; If ROM program, do not read in file - start building header
cmp execRomFound,1
jne Exec_Read_Block ; not found, read file
jmp exec_build_header ; skip reading of file
endif
Exec_Read_Block:
push AX ; save number to read
mov BX,Exec_FH ; of com file
xor CX,CX ; but seek to 0:0
mov DX,CX
xor AX,AX ; seek relative to beginning
invoke $Lseek ; back to beginning of file
pop CX ; number to read
mov DS,Exec_DMA
xor DX,DX
push CX
call ExecRead
pop SI ; get number of bytes to read
jnc OkRead
jmp Exec_Bad_File
OkRead:
cmp AX,SI ; did we read them all?
ljz Exec_Chk_Com_Mem ; M00: exactly the wrong number...no
; ljz Exec_No_Memj ; M00: exactly the wrong number...
mov bl, [AllocMsave] ; M063
mov [AllocMethod], bl ; M063: restore allocmethod
test BYTE PTR Exec_Func,EXEC_FUNC_OVERLAY
jnz Exec_Set_PDB ; no starto, chumo!
mov AX,Exec_DMA
sub AX,10h
mov Exec_Init_CS,AX
mov Exec_Init_IP,100h ; initial IP is 100
; SI is AT MOST FF00h. Add FE to account for PSP - word
; of 0 on stack.
add SI,0feh ; make room for stack
cmp si, 0fffeh ; M047: Q: was there >= 64K available
je Exec_St_Ok ; M047: Y: stack is fine
add si, 100h ; M047: N: add the xtra 100h for stack
Exec_St_Ok:
mov Exec_Init_SP,SI ; max value for read is also SP!;smr;SS Override
mov Exec_Init_SS,AX ;smr;SS Override
mov DS,AX
mov WORD PTR [SI],0 ; 0 for return
;
; M068
;
; We now determine if this is a Copy Protected App. If so the
; A20OFF_COUNT is set to 6. Note that ChkCopyProt will point to a
; a ret if DOS is loaded low. Also DS contains the load segment.
call word ptr [ChkCopyProt]
Exec_Set_PDB:
mov BX,Exec_FH ; we are finished with the file.
call Exec_Dealloc
push BP
invoke $Close ; release the jfn
pop BP
call Exec_Alloc
test BYTE PTR Exec_Func,EXEC_FUNC_OVERLAY
jz Exec_Build_Header
call Scan_Execname
call Scan_Special_Entries
;SR;
;The current lie strategy uses the PSP to store the lie version. However,
;device drivers are loaded as overlays and have no PSP. To handle them, we
;use the Sysinit flag provided by the BIOS as part of a structure pointed at
;by BiosDataPtr. If this flag is set, the overlay call has been issued from
;Sysinit and therefore must be a device driver load. We then get the lie
;version for this driver and put it into the Sysinit PSP. When the driver
;issues the version check, it gets the lie version until the next overlay
;call is issued.
;
cmp DriverLoad,0 ;was Sysinit processing done?
je norm_ovl ;yes, no special handling
push si
push es
les si,BiosDataPtr ;get ptr to BIOS data block
cmp byte ptr es:[si],0 ;in Sysinit?
je sysinit_done ;no, Sysinit is finished
mov es,CurrentPDB ;es = current PSP (Sysinit PSP)
push Special_Version
pop es:PDB_Version ;store lie version in Sysinit PSP
jmp short setver_done
sysinit_done:
mov DriverLoad,0 ;Sysinit done,special handling off
setver_done:
pop es
pop si
norm_ovl:
leave
transfer Sys_Ret_OK ; overlay load -> done
Exec_Build_Header:
ifdef ROMEXEC
; Set up cs:ip and ss:sp for the ROM program; ax contains
; offset of stack 100h for PSP
cmp ExecRomFound,1
jnz Not_ROM_Exec
; AX is at most FF00h. Add FE to account for PSP - word of
; 0 on stack.
add AX,0feh
mov SI,AX ;store sp value
mov Exec_Init_SP, AX
mov AX,Exec_load_block ;address of PSP
mov Exec_Init_SS, AX ;set up ss
;Set up word of 0 on stack for return
mov DS,AX ;PSP segment
mov WORD PTR [SI],0
mov AX, ExecRomAddrL ;get IP
mov Exec_init_IP, AX
mov AX,ExecRomAddrH ;get CS
mov Exec_Init_CS, AX
Not_ROM_Exec:
endif ; ROMEXEC
mov DX,Exec_Load_Block
; assign the space to the process
mov SI,Arena_Owner ; pointer to owner field
mov AX,Exec_Environ ; get environ pointer
or AX,AX
jz No_Owner ; no environment
dec AX ; point to header
mov DS,AX
mov [SI],DX ; assign ownership
No_Owner:
mov AX,Exec_Load_Block ; get load block pointer
dec AX
mov DS,AX ; point to header
mov [SI],DX ; assign ownership
push DS ;AN000;MS. make ES=DS
pop ES ;AN000;MS.
mov DI,Arena_Name ;AN000;MS. ES:DI points to destination
call Scan_Execname ;AN007;MS. parse execname
; ds:si->name, cx=name length
push CX ;AN007;;MS. save for fake version
push SI ;AN007;;MS. save for fake version
MoveName: ;AN000;
lodsb ;AN000;;MS. get char
cmp AL,'.' ;AN000;;MS. is '.' ,may be name.exe
jz Mem_Done ;AN000;;MS. no, move to header
;AN000;
stosb ;AN000;;MS. move char
; MSKK bug fix - limit length copied
cmp di,16 ; end of memory arena block?
jae mem_done ; jump if so
loop movename ;AN000;;MS. continue
Mem_Done: ;AN000;
xor AL,AL ;AN000;;MS. make ASCIIZ
cmp DI,SIZE ARENA ;AN000;MS. if not all filled
jae Fill8 ;AN000;MS.
stosb ;AN000;MS.
Fill8: ;AN000;
pop SI ;AN007;MS. ds:si -> file name
pop CX ;AN007;MS.
call Scan_Special_Entries ;AN007;MS.
push DX
mov SI,exec_size
add SI,DX
Invoke $Dup_PDB ; ES is now PDB
pop DX
push exec_environ
pop ES:[PDB_environ]
; *** Added for DOS 5.00
; version number in PSP
push [Special_Version] ; Set the DOS version number to
pop ES:[PDB_Version] ; to be used for this application
; set up proper command line stuff
lds SI,Exec_Blk ; get the block
push DS ; save its location
push SI
lds SI,[SI.EXEC0_5C_FCB] ; get the 5c fcb
; DS points to user space 5C FCB
mov CX,12 ; copy drive, name and ext
push CX
mov DI,5Ch
mov BL,[SI]
rep movsb
; DI = 5Ch + 12 = 5Ch + 0Ch = 68h
xor AX,AX ; zero extent, etc for CPM
stosw
stosw
; DI = 5Ch + 12 + 4 = 5Ch + 10h = 6Ch
pop CX
pop SI ; get block
pop DS
push DS ; save (again)
push SI
lds SI,[SI.exec0_6C_FCB] ; get 6C FCB
; DS points to user space 6C FCB
mov BH,[SI] ; do same as above
rep movsb
stosw
stosw
pop SI ; get block (last time)
pop DS
lds SI,[SI.exec0_com_line] ; command line
; DS points to user space 80 command line
or CL,80h
mov DI,CX
rep movsb ; Wham!
; Process BX into default AX (validity of drive specs on args).
; We no longer care about DS:SI.
dec CL ; get 0FFh in CL
mov AL,BH
xor BH,BH
invoke GetVisDrv
jnc Exec_BL
mov BH,CL
Exec_BL:
mov AL,BL
xor BL,BL
invoke GetVisDrv
jnc exec_Set_Return
mov BL,CL
Exec_Set_Return:
invoke get_user_stack ; get his return address
push [SI.user_CS] ; suck out the CS and IP
push [SI.user_IP]
push [SI.user_CS] ; suck out the CS and IP
push [SI.user_IP]
pop WORD PTR ES:[PDB_Exit]
pop WORD PTR ES:[PDB_Exit+2]
xor AX,AX
mov DS,AX
; save them where we can get them
; later when the child exits.
pop DS:[ADDR_INT_TERMINATE]
pop DS:[ADDR_INT_TERMINATE+2]
mov WORD PTR DMAADD,80h ; SS Override
mov DS,CurrentPDB ; SS Override
mov WORD PTR DMAADD+2,DS ; SS Override
test BYTE PTR exec_func,exec_func_no_execute
jz exec_go
lds SI,DWORD PTR Exec_Init_SP ; get stack SS Override
les DI,Exec_Blk ; and block for return
mov ES:[DI].EXEC1_SS,DS ; return SS
dec SI ; 'push' default AX
dec SI
mov [SI],BX ; save default AX reg
mov ES:[DI].Exec1_SP,SI ; return 'SP'
lds AX,DWORD PTR Exec_Init_IP ; SS Override
mov ES:[DI].Exec1_CS,DS ; initial entry stuff
mov ES:[DI].Exec1_IP,AX
leave
transfer Sys_Ret_OK
exec_go:
lds SI,DWORD PTR Exec_Init_IP ; get entry point SS Override
les DI,DWORD PTR Exec_Init_SP ; new stack SS Override
mov AX,ES
cmp [DosHasHMA], 0 ; Q: is dos in HMA (M021)
je Xfer_To_User ; N: transfer control to user
push ds ; Y: control must go to low mem stub
getdseg <ds> ; where we disable a20 and Xfer
; control to user
or [DOS_FLAG], EXECA20OFF ; M068:
; M004: Set bit to signal int 21
; ah = 25 & ah= 49. See dossym.inc
; under TAG M003 & M009 for
; explanation
mov [A20OFF_PSP], dx ; M068: set the PSP for which A20 is
; M068: going to be turned OFF.
mov ax, ds ; ax = segment of low mem stub
pop ds
assume ds:nothing
push ax ; ret far into the low mem stub
mov ax, OFFSET Disa20_Xfer
push ax
mov AX,ES ; restore ax
retf
Xfer_To_User:
; DS:SI points to entry point
; AX:DI points to initial stack
; DX has PDB pointer
; BX has initial AX value
cli
mov BYTE PTR InDos,0 ; SS Override
ASSUME SS:NOTHING
mov SS,AX ; set up user's stack
mov SP,DI ; and SP
sti
push DS ; fake long call to entry
push SI
mov ES,DX ; set up proper seg registers
mov DS,DX
mov AX,BX ; set up proper AX
retf
EndProc $Exec
; =========================================================================
;
; =========================================================================
Procedure ExecRead,NEAR
CALL exec_dealloc
MOV bx,exec_fh
PUSH BP
invoke $READ
POP BP
CALL exec_alloc
return
EndProc ExecRead
; =========================================================================
;
; =========================================================================
procedure exec_dealloc,near
push BX
.errnz arena_owner_system
sub BX,BX ; (bx) = ARENA_OWNER_SYSTEM
EnterCrit CritMEM
call ChangeOwners
pop BX
return
EndProc exec_dealloc
; =========================================================================
;
; =========================================================================
procedure exec_alloc,near
ASSUME SS:DOSDATA
push BX
mov BX,CurrentPDB ; SS Override
call ChangeOwners
LeaveCrit CritMEM
pop BX
return
EndProc exec_alloc
; =========================================================================
;
; =========================================================================
PROCEDURE ChangeOwners,NEAR
pushf
push AX
mov AX,exec_environ
call ChangeOwner
mov AX,exec_load_block
call ChangeOwner
pop AX
popf
return
ENDPROC ChangeOwners
; =========================================================================
;
; =========================================================================
PROCEDURE ChangeOwner,NEAR
or AX,AX ; is area allocated?
retz ; no, do nothing
dec AX
push DS
mov DS,AX
mov DS:[ARENA_OWNER],BX
pop DS
return
EndProc ChangeOwner
; =========================================================================
;
; =========================================================================
Procedure Scan_Execname,near
ASSUME SS:DosData
lds SI,ExecName ; DS:SI points to name
Entry Scan_Execname1 ; M028
Save_Begin: ;
mov CX,SI ; CX= starting addr
Scan0: ;
lodsb ; get char
IFDEF DBCS ; MSKK01 07/14/89
invoke TESTKANJ ; Is Character lead byte of DBCS?
jz @F ; jump if not
lodsb ; skip over DBCS character
jmp short scan0 ; do scan again
@@:
ENDIF
cmp AL,':' ; is ':' , may be A:name
jz save_begin ; yes, save si
cmp AL,'\' ; is '\', may be A:\name
jz save_begin ; yes, save si
cmp AL,0 ; is end of name
jnz scan0 ; no, continue scanning
sub SI,CX ; get name's length
xchg SI,CX ; cx= length, si= starting addr
return
EndProc Scan_Execname
; =========================================================================
;
; =========================================================================
Procedure Scan_Special_Entries,near
assume SS:DOSDATA
dec CX ; cx= name length
;M060 mov DI,[Special_Entries] ; es:di -> addr of special entries
;reset to current version
mov [Special_Version],(Minor_Version SHL 8) + Major_Version
;*** call Reset_Version
;M060 push SS
;M060 pop ES
les DI,SS:UU_IFS_DOS_CALL ;M060; ES:DI --> Table in SETVER.SYS
mov AX,ES ;M060; First do a NULL ptr check to
or AX,DI ;M060; be sure the table exists
jz End_List ;M060; If ZR then no table
GetEntries:
mov AL,ES:[DI] ; end of list
or AL,AL
jz End_List ; yes
mov [Temp_Var2],DI ; save di
cmp AL,CL ; same length ?
jnz SkipOne ; no
inc DI ; es:di -> special name
push CX ; save length and name addr
push SI
;
; M050 - BEGIN
;
push ax ; save len
sse_next_char:
lodsb
call UCase
scasb
jne Not_Matched
loop sse_next_char
;
; repz cmpsb ; same name ?
;
; jnz Not_Matched ; no
;
pop ax ; take len off the stack
;
; M050 - END
;
mov AX,ES:[DI] ; get special version
mov [Special_Version],AX ; save it
;*** mov AL,ES:[DI+2] ; get fake count
;*** mov [Fake_Count],AL ; save it
pop SI
pop CX
jmp SHORT end_list
Not_Matched:
pop ax ; get len from stack ; M050
pop SI ; restore si,cx
pop CX
SkipOne:
mov DI,[Temp_Var2] ; restore old di use SS Override
xor AH,AH ; position to next entry
add DI,AX
add DI,3 ; DI -> next entry length
;*** add DI,4 ; DI -> next entry length
jmp Getentries
End_List:
return
EndProc Scan_Special_Entries
; =========================================================================
;
; =========================================================================
;
;Procedure Reset_Version,near
; assume SS:DOSDATA
;
; cmp [Fake_Count],0ffh
; jnz @F
; mov [Special_Version],0 ;reset to current version
;@@:
; return
;
;EndProc Reset_Version,near
PAGE
; =========================================================================
;SUBTTL Terminate and stay resident handler
;
; Input: DX is an offset from CurrentPDB at which to
; truncate the current block.
;
; output: The current block is truncated (expanded) to be [DX+15]/16
; paragraphs long. An exit is simulated via resetting CurrentPDB
; and restoring the vectors.
;
; =========================================================================
PROCEDURE $Keep_process ,NEAR
ASSUME DS:NOTHING,ES:NOTHING,SS:DosData
push AX ; keep exit code around
mov BYTE PTR Exit_type,EXIT_KEEP_PROCESS
mov ES,CurrentPDB
cmp DX,6h ; keep enough space around for system
jae Keep_shrink ; info
mov DX,6h
Keep_Shrink:
mov BX,DX
push BX
push ES
invoke $SETBLOCK ; ignore return codes.
pop DS
pop BX
jc keep_done ; failed on modification
mov AX,DS
add AX,BX
mov DS:PDB_block_len,AX ;PBUGBUG
Keep_Done:
pop AX
jmp SHORT exit_inner ; and let abort take care of the rest
EndProc $Keep_process
; =========================================================================
;
; =========================================================================
PROCEDURE Stay_Resident,NEAR
ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING
mov AX,(Keep_process SHL 8) + 0 ; Lower part is return code;PBUGBUG
add DX,15
rcr DX,1
mov CL,3
shr DX,CL
transfer COMMAND
ENDPROC Stay_resident
PAGE
; =========================================================================
;SUBTTL $EXIT - return to parent process
; Assembler usage:
; MOV AL, code
; MOV AH, Exit
; INT int_command
; Error return:
; None.
;
; =========================================================================
PROCEDURE $Exit ,NEAR
ASSUME DS:NOTHING,ES:NOTHING,SS:DosData
xor AH,AH
xchg AH,BYTE PTR DidCtrlC
or AH,AH
mov BYTE PTR Exit_Type,EXIT_TERMINATE
jz exit_inner
mov BYTE PTR Exit_type,exit_ctrl_c
entry Exit_inner
invoke get_user_stack ;PBUGBUG
ASSUME DS:NOTHING
push CurrentPDB
pop [SI.User_CS] ;PBUGBUG
jmp SHORT Abort_Inner
EndProc $EXIT
BREAK <$ABORT -- Terminate a process>
; =========================================================================
; Inputs:
; user_CS:00 must point to valid program header block
; Function:
; Restore terminate and Cntrl-C addresses, flush buffers and transfer to
; the terminate address
; Returns:
; TO THE TERMINATE ADDRESS
; =========================================================================
PROCEDURE $Abort ,NEAR
ASSUME DS:NOTHING,ES:NOTHING ;PBUGBUG
xor AL,AL
mov exit_type,exit_abort
; abort_inner must have AL set as the exit code! The exit type
; is retrieved from exit_type. Also, the PDB at user_CS needs
; to be correct as the one that is terminating.
PUBLIC Abort_Inner
Abort_Inner:
mov AH,Exit_Type
mov Exit_Code,AX
invoke Get_User_Stack
ASSUME DS:NOTHING
mov DS,[SI.User_CS] ; set up old interrupts ;PBUGBUG
xor AX,AX
mov ES,AX
mov SI,SavExit
mov DI,Addr_Int_Terminate
movsw
movsw
movsw
movsw
movsw
movsw
transfer reset_environment
ENDPROC $ABORT
;==========================================================================
;
; fixexepatch will poin to this is DOS loads low.
;
;=========================================================================
retexepatch proc near
ret
retexepatch endp
; =========================================================================
DOSCODE ENDS
; =========================================================================
END
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_660.asm | ljhsiun2/medusa | 9 | 666 | <gh_stars>1-10
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r8
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x13da6, %rsi
nop
nop
nop
inc %rax
mov $0x6162636465666768, %r11
movq %r11, (%rsi)
nop
nop
nop
nop
and %rdi, %rdi
lea addresses_UC_ht+0x1b40b, %rsi
lea addresses_A_ht+0x17baa, %rdi
nop
sub %rbp, %rbp
mov $73, %rcx
rep movsl
cmp %rbp, %rbp
lea addresses_D_ht+0x120ae, %rbp
nop
nop
nop
nop
xor $41347, %r11
mov $0x6162636465666768, %rdi
movq %rdi, (%rbp)
nop
nop
nop
nop
nop
inc %rdi
lea addresses_WC_ht+0xaf66, %rdi
nop
nop
nop
xor $42422, %rsi
mov (%rdi), %rbp
nop
nop
nop
sub %rcx, %rcx
lea addresses_A_ht+0x1cf26, %rbp
nop
nop
nop
nop
sub $40188, %r8
movb (%rbp), %r11b
nop
nop
nop
nop
nop
sub %r11, %r11
lea addresses_WT_ht+0x1e596, %r8
nop
nop
nop
nop
nop
add %rsi, %rsi
mov $0x6162636465666768, %rbp
movq %rbp, (%r8)
nop
nop
sub $14131, %rsi
lea addresses_WT_ht+0x109a6, %r8
add $31199, %rbp
mov (%r8), %eax
nop
cmp $10259, %rsi
lea addresses_WT_ht+0x1afa6, %rsi
dec %rbp
movb (%rsi), %al
nop
nop
nop
nop
nop
and %rcx, %rcx
lea addresses_UC_ht+0x1648e, %rcx
nop
nop
nop
cmp $61208, %rsi
mov $0x6162636465666768, %rdi
movq %rdi, (%rcx)
nop
nop
nop
inc %rcx
lea addresses_WT_ht+0x6a36, %r11
nop
nop
dec %rsi
movb (%r11), %al
nop
and %rdi, %rdi
lea addresses_WT_ht+0x1e090, %r11
nop
cmp %rax, %rax
mov $0x6162636465666768, %rsi
movq %rsi, %xmm3
vmovups %ymm3, (%r11)
nop
nop
nop
nop
dec %r8
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r8
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r14
push %r8
push %rbp
push %rcx
push %rdx
// Load
lea addresses_RW+0xffa6, %r14
nop
nop
nop
cmp $11431, %r12
vmovups (%r14), %ymm0
vextracti128 $0, %ymm0, %xmm0
vpextrq $0, %xmm0, %r8
dec %rcx
// Store
lea addresses_WT+0x138a6, %rbp
sub $669, %r11
mov $0x5152535455565758, %r14
movq %r14, %xmm4
vmovups %ymm4, (%rbp)
nop
nop
nop
nop
cmp $43986, %r14
// Store
lea addresses_WC+0x8e06, %r8
mfence
mov $0x5152535455565758, %r14
movq %r14, %xmm4
movups %xmm4, (%r8)
and $22213, %rcx
// Load
lea addresses_D+0x18fa6, %r14
nop
nop
cmp %r8, %r8
movb (%r14), %r12b
nop
nop
nop
nop
nop
cmp $47301, %r11
// Store
lea addresses_normal+0x1d3a6, %r12
clflush (%r12)
nop
nop
nop
add %r11, %r11
movw $0x5152, (%r12)
nop
nop
nop
nop
nop
and %r14, %r14
// Faulty Load
lea addresses_RW+0xffa6, %r8
xor %r14, %r14
mov (%r8), %cx
lea oracles, %r11
and $0xff, %rcx
shlq $12, %rcx
mov (%r11,%rcx,1), %rcx
pop %rdx
pop %rcx
pop %rbp
pop %r8
pop %r14
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_RW', 'size': 2, 'AVXalign': True}, 'OP': 'LOAD'}
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_RW', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_WT', 'size': 32, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_WC', 'size': 16, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_D', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_normal', 'size': 2, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_RW', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False}}
{'src': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_D_ht', 'size': 8, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_A_ht', 'size': 1, 'AVXalign': True}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_WT_ht', 'size': 32, 'AVXalign': False}}
{'32': 21829}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
|
agda/Categories/HSets.agda | oisdk/combinatorics-paper | 0 | 519 | <gh_stars>0
{-# OPTIONS --cubical --safe --postfix-projections #-}
open import Prelude hiding (_×_)
module Categories.HSets {ℓ : Level} where
open import Categories
open import Cubical.Foundations.HLevels
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.Univalence
open import Data.Sigma.Properties
open import Categories.Product
open import Categories.Exponential
hSetPreCategory : PreCategory (ℓsuc ℓ) ℓ
hSetPreCategory .PreCategory.Ob = hSet _
hSetPreCategory .PreCategory.Hom (X , _) (Y , _) = X → Y
hSetPreCategory .PreCategory.Id = id
hSetPreCategory .PreCategory.Comp f g = f ∘ g
hSetPreCategory .PreCategory.assoc-Comp _ _ _ = refl
hSetPreCategory .PreCategory.Comp-Id _ = refl
hSetPreCategory .PreCategory.Id-Comp _ = refl
hSetPreCategory .PreCategory.Hom-Set {X} {Y} = hLevelPi 2 λ _ → Y .snd
open PreCategory hSetPreCategory
_⟨×⟩_ : isSet A → isSet B → isSet (A Prelude.× B)
xs ⟨×⟩ ys = isOfHLevelΣ 2 xs (const ys)
module _ {X Y : Ob} where
iso-iso : (X ≅ Y) ⇔ (fst X ⇔ fst Y)
iso-iso .fun (f , g , f∘g , g∘f) = iso f g (λ x i → g∘f i x) (λ x i → f∘g i x)
iso-iso .inv (iso f g g∘f f∘g) = f , g , (λ i x → f∘g x i) , (λ i x → g∘f x i)
iso-iso .rightInv _ = refl
iso-iso .leftInv _ = refl
univ⇔ : (X ≡ Y) ⇔ (X ≅ Y)
univ⇔ = equivToIso (≃ΣProp≡ (λ _ → isPropIsSet)) ⟨ trans-⇔ ⟩
equivToIso univalence ⟨ trans-⇔ ⟩
sym-⇔ (iso⇔equiv (snd X)) ⟨ trans-⇔ ⟩
sym-⇔ iso-iso
hSetCategory : Category (ℓsuc ℓ) ℓ
hSetCategory .Category.preCategory = hSetPreCategory
hSetCategory .Category.univalent = isoToEquiv univ⇔
hSetProd : HasProducts hSetCategory
hSetProd .HasProducts.product X Y .Product.obj = (X .fst Prelude.× Y .fst) , X .snd ⟨×⟩ Y .snd
hSetProd .HasProducts.product X Y .Product.proj₁ = fst
hSetProd .HasProducts.product X Y .Product.proj₂ = snd
hSetProd .HasProducts.product X Y .Product.ump f g .fst z = f z , g z
hSetProd .HasProducts.product X Y .Product.ump f g .snd .fst .fst = refl
hSetProd .HasProducts.product X Y .Product.ump f g .snd .fst .snd = refl
hSetProd .HasProducts.product X Y .Product.ump f g .snd .snd (f≡ , g≡) i x = f≡ (~ i) x , g≡ (~ i) x
hSetExp : HasExponentials hSetCategory hSetProd
hSetExp X Y .Exponential.obj = (X .fst → Y .fst) , hLevelPi 2 λ _ → Y .snd
hSetExp X Y .Exponential.eval (f , x) = f x
hSetExp X Y .Exponential.uniq X₁ f .fst = curry f
hSetExp X Y .Exponential.uniq X₁ f .snd .fst = refl
hSetExp X Y .Exponential.uniq X₁ f .snd .snd {y} x = cong curry (sym x)
open import Categories.Pullback
hSetHasPullbacks : HasPullbacks hSetCategory
hSetHasPullbacks {X = X} {Y = Y} {Z = Z} f g .Pullback.P = ∃[ ab ] (f (fst ab) ≡ g (snd ab)) , isOfHLevelΣ 2 (X .snd ⟨×⟩ Y .snd) λ xy → isProp→isSet (Z .snd (f (xy .fst)) (g (xy .snd)))
hSetHasPullbacks f g .Pullback.p₁ ((x , _) , _) = x
hSetHasPullbacks f g .Pullback.p₂ ((_ , y) , _) = y
hSetHasPullbacks f g .Pullback.commute = funExt snd
hSetHasPullbacks f g .Pullback.ump {A = A} h₁ h₂ p .fst x = (h₁ x , h₂ x) , λ i → p i x
hSetHasPullbacks f g .Pullback.ump {A = A} h₁ h₂ p .snd .fst .fst = refl
hSetHasPullbacks f g .Pullback.ump {A = A} h₁ h₂ p .snd .fst .snd = refl
hSetHasPullbacks {Z = Z} f g .Pullback.ump {A = A} h₁ h₂ p .snd .snd {i} (p₁e , p₂e) = funExt (λ x → ΣProp≡ (λ _ → Z .snd _ _) λ j → p₁e (~ j) x , p₂e (~ j) x)
hSetTerminal : Terminal
hSetTerminal .fst = Lift _ ⊤ , isProp→isSet λ _ _ → refl
hSetTerminal .snd .fst x .lower = tt
hSetTerminal .snd .snd y = funExt λ _ → refl
hSetInitial : Initial
hSetInitial .fst = Lift _ ⊥ , λ ()
hSetInitial .snd .fst ()
hSetInitial .snd .snd y i ()
open import HITs.PropositionalTruncation
open import Categories.Coequalizer
∃!′ : (A : Type a) → (A → Type b) → Type (a ℓ⊔ b)
∃!′ A P = ∥ Σ A P ∥ Prelude.× AtMostOne P
lemma23 : ∀ {p} {P : A → hProp p} → ∃!′ A (fst ∘ P) → Σ A (fst ∘ P)
lemma23 {P = P} (x , y) = rec (λ xs ys → ΣProp≡ (snd ∘ P) (y (xs .fst) (ys .fst) (xs .snd) (ys .snd))) id x
module _ {A : Type a} {P : A → Type b} (R : ∀ x → P x → hProp c) where
uniqueChoice : (Π[ x ⦂ A ] (∃!′ (P x) (λ u → R x u .fst))) →
Σ[ f ⦂ Π[ x ⦂ A ] P x ] Π[ x ⦂ A ] (R x (f x) .fst)
uniqueChoice H = fst ∘ mid , snd ∘ mid
where
mid : Π[ x ⦂ A ] Σ[ u ⦂ P x ] (R x u .fst)
mid x = lemma23 {P = R x} (H x)
open import HITs.PropositionalTruncation.Sugar
module CoeqProofs {X Y : Ob} (f : X ⟶ Y) where
KernelPair : Pullback hSetCategory {X = X} {Z = Y} {Y = X} f f
KernelPair = hSetHasPullbacks f f
Im : Ob
Im = ∃[ b ] ∥ fiber f b ∥ , isOfHLevelΣ 2 (Y .snd) λ _ → isProp→isSet squash
im : X ⟶ Im
im x = f x , ∣ x , refl ∣
open Pullback KernelPair
lem : ∀ {H : Ob} (h : X ⟶ H) → h ∘ p₁ ≡ h ∘ p₂ → Σ[ f ⦂ (Im ⟶ H) ] Π[ x ⦂ Im .fst ] (∀ y → im y ≡ x → h y ≡ f x)
lem {H = H} h eq = uniqueChoice R prf
where
R : Im .fst → H .fst → hProp _
R w x .fst = ∀ y → im y ≡ w → h y ≡ x
R w x .snd = hLevelPi 1 λ _ → hLevelPi 1 λ _ → H .snd _ _
prf : Π[ x ⦂ Im .fst ] ∃!′ (H .fst) (λ u → ∀ y → im y ≡ x → h y ≡ u)
prf (xy , p) .fst = (λ { (z , r) → h z , λ y imy≡xyp → cong (_$ ((y , z) , cong fst imy≡xyp ; sym r)) eq }) ∥$∥ p
prf (xy , p) .snd x₁ x₂ Px₁ Px₂ = rec (H .snd x₁ x₂) (λ { (z , zs) → sym (Px₁ z (ΣProp≡ (λ _ → squash) zs)) ; Px₂ z (ΣProp≡ (λ _ → squash) zs) } ) p
lem₂ : ∀ (H : Ob) (h : X ⟶ H) (i : Im ⟶ H) (x : Im .fst) (hi : h ≡ i ∘ im) (eq : h ∘ p₁ ≡ h ∘ p₂) → i x ≡ lem {H = H} h eq .fst x
lem₂ H h i x hi eq = rec (H .snd _ _) (λ { (y , ys) → (cong i (ΣProp≡ (λ _ → squash) (sym ys)) ; sym (cong (_$ y) hi)) ; lem {H = H} h eq .snd x y (ΣProp≡ (λ _ → squash) ys) }) (x .snd)
hSetCoeq : Coequalizer hSetCategory {X = P} {Y = X} p₁ p₂
hSetCoeq .Coequalizer.obj = Im
hSetCoeq .Coequalizer.arr = im
hSetCoeq .Coequalizer.equality = funExt λ x → ΣProp≡ (λ _ → squash) λ i → commute i x
hSetCoeq .Coequalizer.coequalize {H = H} {h = h} eq = lem {H = H} h eq .fst
hSetCoeq .Coequalizer.universal {H = H} {h = h} {eq = eq} = funExt λ x → lem {H = H} h eq .snd (im x) x refl
hSetCoeq .Coequalizer.unique {H = H} {h = h} {i = i} {eq = eq} prf = funExt λ x → lem₂ H h i x prf eq
open CoeqProofs using (hSetCoeq) public
module PullbackSurjProofs {X Y : Ob} (f : X ⟶ Y) (fSurj : Surjective f) where
KernelPair : Pullback hSetCategory {X = X} {Z = Y} {Y = X} f f
KernelPair = hSetHasPullbacks f f
open Pullback KernelPair
p₁surj : Surjective p₁
p₁surj y = ∣ ((y , y) , refl) , refl ∣
p₂surj : Surjective p₂
p₂surj y = ∣ ((y , y) , refl) , refl ∣
open import Relation.Binary
open import Cubical.HITs.SetQuotients
module _ {A : Type a} {R : A → A → Type b} {C : Type c}
(isSetC : isSet C)
(f : A → C)
(coh : ∀ x y → R x y → f x ≡ f y)
where
recQuot : A / R → C
recQuot [ a ] = f a
recQuot (eq/ a b r i) = coh a b r i
recQuot (squash/ xs ys x y i j) = isSetC (recQuot xs) (recQuot ys) (cong recQuot x) (cong recQuot y) i j
open import Path.Reasoning
module ExtactProofs {X : Ob} {R : X .fst → X .fst → hProp ℓ}
(symR : Symmetric (λ x y → R x y .fst))
(transR : Transitive (λ x y → R x y .fst))
(reflR : Reflexive (λ x y → R x y .fst))
where
ℛ : X .fst → X .fst → Type ℓ
ℛ x y = R x y .fst
Src : Ob
Src .fst = ∃[ x,y ] (uncurry ℛ x,y)
Src .snd = isOfHLevelΣ 2 (X .snd ⟨×⟩ X .snd) λ _ → isProp→isSet (R _ _ .snd)
pr₁ pr₂ : Src ⟶ X
pr₁ = fst ∘ fst
pr₂ = snd ∘ fst
ROb : Ob
ROb = X .fst / ℛ , squash/
CR : Coequalizer hSetCategory {X = Src} {Y = X} pr₁ pr₂
CR .Coequalizer.obj = ROb
CR .Coequalizer.arr = [_]
CR .Coequalizer.equality = funExt λ { ((x , y) , x~y) → eq/ x y x~y}
CR .Coequalizer.coequalize {H = H} {h = h} e = recQuot (H .snd) h λ x y x~y → cong (_$ ((x , y) , x~y)) e
CR .Coequalizer.universal {H = H} {h = h} {eq = e} = refl
CR .Coequalizer.unique {H = H} {h = h} {i = i} {eq = e} p = funExt (elimSetQuotientsProp (λ _ → H .snd _ _) λ x j → p (~ j) x)
|
Univalence/PiLevel1.agda | JacquesCarette/pi-dual | 14 | 16404 | <gh_stars>10-100
{-# OPTIONS --without-K #-}
module PiLevel1 where
open import Data.Unit using (⊤; tt)
open import Relation.Binary.Core using (IsEquivalence)
open import Relation.Binary.PropositionalEquality using (_≡_; refl; subst; sym; [_])
open import PiU using (U; ZERO; ONE; PLUS; TIMES)
open import PiLevel0
-- hiding triv≡ certainly; we are replacing it with _⇔_
using (_⟷_; !;
unite₊l; uniti₊l; unite₊r; uniti₊r; swap₊; assocl₊; assocr₊;
unite⋆l; uniti⋆l; unite⋆r; uniti⋆r; swap⋆; assocl⋆; assocr⋆;
absorbr; absorbl; factorzr; factorzl;
dist; factor; distl; factorl;
id⟷; _◎_; _⊕_; _⊗_)
------------------------------------------------------------------------------
-- Level 1: instead of using triv≡ to reason about equivalence of
-- combinators, we use the following 2-combinators
infix 30 _⇔_
data _⇔_ : {t₁ t₂ : U} → (t₁ ⟷ t₂) → (t₁ ⟷ t₂) → Set where
assoc◎l : {t₁ t₂ t₃ t₄ : U} {c₁ : t₁ ⟷ t₂} {c₂ : t₂ ⟷ t₃} {c₃ : t₃ ⟷ t₄} →
(c₁ ◎ (c₂ ◎ c₃)) ⇔ ((c₁ ◎ c₂) ◎ c₃)
assoc◎r : {t₁ t₂ t₃ t₄ : U} {c₁ : t₁ ⟷ t₂} {c₂ : t₂ ⟷ t₃} {c₃ : t₃ ⟷ t₄} →
((c₁ ◎ c₂) ◎ c₃) ⇔ (c₁ ◎ (c₂ ◎ c₃))
assocl⊕l : {t₁ t₂ t₃ t₄ t₅ t₆ : U}
{c₁ : t₁ ⟷ t₂} {c₂ : t₃ ⟷ t₄} {c₃ : t₅ ⟷ t₆} →
((c₁ ⊕ (c₂ ⊕ c₃)) ◎ assocl₊) ⇔ (assocl₊ ◎ ((c₁ ⊕ c₂) ⊕ c₃))
assocl⊕r : {t₁ t₂ t₃ t₄ t₅ t₆ : U}
{c₁ : t₁ ⟷ t₂} {c₂ : t₃ ⟷ t₄} {c₃ : t₅ ⟷ t₆} →
(assocl₊ ◎ ((c₁ ⊕ c₂) ⊕ c₃)) ⇔ ((c₁ ⊕ (c₂ ⊕ c₃)) ◎ assocl₊)
assocl⊗l : {t₁ t₂ t₃ t₄ t₅ t₆ : U}
{c₁ : t₁ ⟷ t₂} {c₂ : t₃ ⟷ t₄} {c₃ : t₅ ⟷ t₆} →
((c₁ ⊗ (c₂ ⊗ c₃)) ◎ assocl⋆) ⇔ (assocl⋆ ◎ ((c₁ ⊗ c₂) ⊗ c₃))
assocl⊗r : {t₁ t₂ t₃ t₄ t₅ t₆ : U}
{c₁ : t₁ ⟷ t₂} {c₂ : t₃ ⟷ t₄} {c₃ : t₅ ⟷ t₆} →
(assocl⋆ ◎ ((c₁ ⊗ c₂) ⊗ c₃)) ⇔ ((c₁ ⊗ (c₂ ⊗ c₃)) ◎ assocl⋆)
assocr⊕r : {t₁ t₂ t₃ t₄ t₅ t₆ : U}
{c₁ : t₁ ⟷ t₂} {c₂ : t₃ ⟷ t₄} {c₃ : t₅ ⟷ t₆} →
(((c₁ ⊕ c₂) ⊕ c₃) ◎ assocr₊) ⇔ (assocr₊ ◎ (c₁ ⊕ (c₂ ⊕ c₃)))
assocr⊗l : {t₁ t₂ t₃ t₄ t₅ t₆ : U}
{c₁ : t₁ ⟷ t₂} {c₂ : t₃ ⟷ t₄} {c₃ : t₅ ⟷ t₆} →
(assocr⋆ ◎ (c₁ ⊗ (c₂ ⊗ c₃))) ⇔ (((c₁ ⊗ c₂) ⊗ c₃) ◎ assocr⋆)
assocr⊗r : {t₁ t₂ t₃ t₄ t₅ t₆ : U}
{c₁ : t₁ ⟷ t₂} {c₂ : t₃ ⟷ t₄} {c₃ : t₅ ⟷ t₆} →
(((c₁ ⊗ c₂) ⊗ c₃) ◎ assocr⋆) ⇔ (assocr⋆ ◎ (c₁ ⊗ (c₂ ⊗ c₃)))
assocr⊕l : {t₁ t₂ t₃ t₄ t₅ t₆ : U}
{c₁ : t₁ ⟷ t₂} {c₂ : t₃ ⟷ t₄} {c₃ : t₅ ⟷ t₆} →
(assocr₊ ◎ (c₁ ⊕ (c₂ ⊕ c₃))) ⇔ (((c₁ ⊕ c₂) ⊕ c₃) ◎ assocr₊)
dist⇔l : {t₁ t₂ t₃ t₄ t₅ t₆ : U}
{a : t₁ ⟷ t₂} {b : t₃ ⟷ t₄} {c : t₅ ⟷ t₆} →
((a ⊕ b) ⊗ c) ◎ dist ⇔ dist ◎ ((a ⊗ c) ⊕ (b ⊗ c))
dist⇔r : {t₁ t₂ t₃ t₄ t₅ t₆ : U}
{a : t₁ ⟷ t₂} {b : t₃ ⟷ t₄} {c : t₅ ⟷ t₆} →
dist ◎ ((a ⊗ c) ⊕ (b ⊗ c)) ⇔ ((a ⊕ b) ⊗ c) ◎ dist
distl⇔l : {t₁ t₂ t₃ t₄ t₅ t₆ : U}
{a : t₁ ⟷ t₂} {b : t₃ ⟷ t₄} {c : t₅ ⟷ t₆} →
(a ⊗ (b ⊕ c)) ◎ distl ⇔ distl ◎ ((a ⊗ b) ⊕ (a ⊗ c))
distl⇔r : {t₁ t₂ t₃ t₄ t₅ t₆ : U}
{a : t₁ ⟷ t₂} {b : t₃ ⟷ t₄} {c : t₅ ⟷ t₆} →
distl ◎ ((a ⊗ b) ⊕ (a ⊗ c)) ⇔ (a ⊗ (b ⊕ c)) ◎ distl
factor⇔l : {t₁ t₂ t₃ t₄ t₅ t₆ : U}
{a : t₁ ⟷ t₂} {b : t₃ ⟷ t₄} {c : t₅ ⟷ t₆} →
((a ⊗ c) ⊕ (b ⊗ c)) ◎ factor ⇔ factor ◎ ((a ⊕ b) ⊗ c)
factor⇔r : {t₁ t₂ t₃ t₄ t₅ t₆ : U}
{a : t₁ ⟷ t₂} {b : t₃ ⟷ t₄} {c : t₅ ⟷ t₆} →
factor ◎ ((a ⊕ b) ⊗ c) ⇔ ((a ⊗ c) ⊕ (b ⊗ c)) ◎ factor
factorl⇔l : {t₁ t₂ t₃ t₄ t₅ t₆ : U}
{a : t₁ ⟷ t₂} {b : t₃ ⟷ t₄} {c : t₅ ⟷ t₆} →
((a ⊗ b) ⊕ (a ⊗ c)) ◎ factorl ⇔ factorl ◎ (a ⊗ (b ⊕ c))
factorl⇔r : {t₁ t₂ t₃ t₄ t₅ t₆ : U}
{a : t₁ ⟷ t₂} {b : t₃ ⟷ t₄} {c : t₅ ⟷ t₆} →
factorl ◎ (a ⊗ (b ⊕ c)) ⇔ ((a ⊗ b) ⊕ (a ⊗ c)) ◎ factorl
idl◎l : {t₁ t₂ : U} {c : t₁ ⟷ t₂} → (id⟷ ◎ c) ⇔ c
idl◎r : {t₁ t₂ : U} {c : t₁ ⟷ t₂} → c ⇔ id⟷ ◎ c
idr◎l : {t₁ t₂ : U} {c : t₁ ⟷ t₂} → (c ◎ id⟷) ⇔ c
idr◎r : {t₁ t₂ : U} {c : t₁ ⟷ t₂} → c ⇔ (c ◎ id⟷)
linv◎l : {t₁ t₂ : U} {c : t₁ ⟷ t₂} → (c ◎ ! c) ⇔ id⟷
linv◎r : {t₁ t₂ : U} {c : t₁ ⟷ t₂} → id⟷ ⇔ (c ◎ ! c)
rinv◎l : {t₁ t₂ : U} {c : t₁ ⟷ t₂} → (! c ◎ c) ⇔ id⟷
rinv◎r : {t₁ t₂ : U} {c : t₁ ⟷ t₂} → id⟷ ⇔ (! c ◎ c)
unite₊l⇔l : {t₁ t₂ : U} {c₁ : ZERO ⟷ ZERO} {c₂ : t₁ ⟷ t₂} →
(unite₊l ◎ c₂) ⇔ ((c₁ ⊕ c₂) ◎ unite₊l)
unite₊l⇔r : {t₁ t₂ : U} {c₁ : ZERO ⟷ ZERO} {c₂ : t₁ ⟷ t₂} →
((c₁ ⊕ c₂) ◎ unite₊l) ⇔ (unite₊l ◎ c₂)
uniti₊l⇔l : {t₁ t₂ : U} {c₁ : ZERO ⟷ ZERO} {c₂ : t₁ ⟷ t₂} →
(uniti₊l ◎ (c₁ ⊕ c₂)) ⇔ (c₂ ◎ uniti₊l)
uniti₊l⇔r : {t₁ t₂ : U} {c₁ : ZERO ⟷ ZERO} {c₂ : t₁ ⟷ t₂} →
(c₂ ◎ uniti₊l) ⇔ (uniti₊l ◎ (c₁ ⊕ c₂))
unite₊r⇔l : {t₁ t₂ : U} {c₁ : ZERO ⟷ ZERO} {c₂ : t₁ ⟷ t₂} →
(unite₊r ◎ c₂) ⇔ ((c₂ ⊕ c₁) ◎ unite₊r)
unite₊r⇔r : {t₁ t₂ : U} {c₁ : ZERO ⟷ ZERO} {c₂ : t₁ ⟷ t₂} →
((c₂ ⊕ c₁) ◎ unite₊r) ⇔ (unite₊r ◎ c₂)
uniti₊r⇔l : {t₁ t₂ : U} {c₁ : ZERO ⟷ ZERO} {c₂ : t₁ ⟷ t₂} →
(uniti₊r ◎ (c₂ ⊕ c₁)) ⇔ (c₂ ◎ uniti₊r)
uniti₊r⇔r : {t₁ t₂ : U} {c₁ : ZERO ⟷ ZERO} {c₂ : t₁ ⟷ t₂} →
(c₂ ◎ uniti₊r) ⇔ (uniti₊r ◎ (c₂ ⊕ c₁))
swapl₊⇔ : {t₁ t₂ t₃ t₄ : U} {c₁ : t₁ ⟷ t₂} {c₂ : t₃ ⟷ t₄} →
(swap₊ ◎ (c₁ ⊕ c₂)) ⇔ ((c₂ ⊕ c₁) ◎ swap₊)
swapr₊⇔ : {t₁ t₂ t₃ t₄ : U} {c₁ : t₁ ⟷ t₂} {c₂ : t₃ ⟷ t₄} →
((c₂ ⊕ c₁) ◎ swap₊) ⇔ (swap₊ ◎ (c₁ ⊕ c₂))
unitel⋆⇔l : {t₁ t₂ : U} {c₁ : ONE ⟷ ONE} {c₂ : t₁ ⟷ t₂} →
(unite⋆l ◎ c₂) ⇔ ((c₁ ⊗ c₂) ◎ unite⋆l)
uniter⋆⇔l : {t₁ t₂ : U} {c₁ : ONE ⟷ ONE} {c₂ : t₁ ⟷ t₂} →
((c₁ ⊗ c₂) ◎ unite⋆l) ⇔ (unite⋆l ◎ c₂)
unitil⋆⇔l : {t₁ t₂ : U} {c₁ : ONE ⟷ ONE} {c₂ : t₁ ⟷ t₂} →
(uniti⋆l ◎ (c₁ ⊗ c₂)) ⇔ (c₂ ◎ uniti⋆l)
unitir⋆⇔l : {t₁ t₂ : U} {c₁ : ONE ⟷ ONE} {c₂ : t₁ ⟷ t₂} →
(c₂ ◎ uniti⋆l) ⇔ (uniti⋆l ◎ (c₁ ⊗ c₂))
unitel⋆⇔r : {t₁ t₂ : U} {c₁ : ONE ⟷ ONE} {c₂ : t₁ ⟷ t₂} →
(unite⋆r ◎ c₂) ⇔ ((c₂ ⊗ c₁) ◎ unite⋆r)
uniter⋆⇔r : {t₁ t₂ : U} {c₁ : ONE ⟷ ONE} {c₂ : t₁ ⟷ t₂} →
((c₂ ⊗ c₁) ◎ unite⋆r) ⇔ (unite⋆r ◎ c₂)
unitil⋆⇔r : {t₁ t₂ : U} {c₁ : ONE ⟷ ONE} {c₂ : t₁ ⟷ t₂} →
(uniti⋆r ◎ (c₂ ⊗ c₁)) ⇔ (c₂ ◎ uniti⋆r)
unitir⋆⇔r : {t₁ t₂ : U} {c₁ : ONE ⟷ ONE} {c₂ : t₁ ⟷ t₂} →
(c₂ ◎ uniti⋆r) ⇔ (uniti⋆r ◎ (c₂ ⊗ c₁))
swapl⋆⇔ : {t₁ t₂ t₃ t₄ : U} {c₁ : t₁ ⟷ t₂} {c₂ : t₃ ⟷ t₄} →
(swap⋆ ◎ (c₁ ⊗ c₂)) ⇔ ((c₂ ⊗ c₁) ◎ swap⋆)
swapr⋆⇔ : {t₁ t₂ t₃ t₄ : U} {c₁ : t₁ ⟷ t₂} {c₂ : t₃ ⟷ t₄} →
((c₂ ⊗ c₁) ◎ swap⋆) ⇔ (swap⋆ ◎ (c₁ ⊗ c₂))
id⇔ : {t₁ t₂ : U} {c : t₁ ⟷ t₂} → c ⇔ c
trans⇔ : {t₁ t₂ : U} {c₁ c₂ c₃ : t₁ ⟷ t₂} →
(c₁ ⇔ c₂) → (c₂ ⇔ c₃) → (c₁ ⇔ c₃)
_⊡_ : {t₁ t₂ t₃ : U}
{c₁ : t₁ ⟷ t₂} {c₂ : t₂ ⟷ t₃} {c₃ : t₁ ⟷ t₂} {c₄ : t₂ ⟷ t₃} →
(c₁ ⇔ c₃) → (c₂ ⇔ c₄) → (c₁ ◎ c₂) ⇔ (c₃ ◎ c₄)
resp⊕⇔ : {t₁ t₂ t₃ t₄ : U}
{c₁ : t₁ ⟷ t₂} {c₂ : t₃ ⟷ t₄} {c₃ : t₁ ⟷ t₂} {c₄ : t₃ ⟷ t₄} →
(c₁ ⇔ c₃) → (c₂ ⇔ c₄) → (c₁ ⊕ c₂) ⇔ (c₃ ⊕ c₄)
resp⊗⇔ : {t₁ t₂ t₃ t₄ : U}
{c₁ : t₁ ⟷ t₂} {c₂ : t₃ ⟷ t₄} {c₃ : t₁ ⟷ t₂} {c₄ : t₃ ⟷ t₄} →
(c₁ ⇔ c₃) → (c₂ ⇔ c₄) → (c₁ ⊗ c₂) ⇔ (c₃ ⊗ c₄)
-- below are the combinators added for the RigCategory structure
id⟷⊕id⟷⇔ : {t₁ t₂ : U} → (id⟷ {t₁} ⊕ id⟷ {t₂}) ⇔ id⟷
split⊕-id⟷ : {t₁ t₂ : U} → (id⟷ {PLUS t₁ t₂}) ⇔ (id⟷ ⊕ id⟷)
hom⊕◎⇔ : {t₁ t₂ t₃ t₄ t₅ t₆ : U} {c₁ : t₅ ⟷ t₁} {c₂ : t₆ ⟷ t₂}
{c₃ : t₁ ⟷ t₃} {c₄ : t₂ ⟷ t₄} →
((c₁ ◎ c₃) ⊕ (c₂ ◎ c₄)) ⇔ ((c₁ ⊕ c₂) ◎ (c₃ ⊕ c₄))
hom◎⊕⇔ : {t₁ t₂ t₃ t₄ t₅ t₆ : U} {c₁ : t₅ ⟷ t₁} {c₂ : t₆ ⟷ t₂}
{c₃ : t₁ ⟷ t₃} {c₄ : t₂ ⟷ t₄} →
((c₁ ⊕ c₂) ◎ (c₃ ⊕ c₄)) ⇔ ((c₁ ◎ c₃) ⊕ (c₂ ◎ c₄))
id⟷⊗id⟷⇔ : {t₁ t₂ : U} → (id⟷ {t₁} ⊗ id⟷ {t₂}) ⇔ id⟷
split⊗-id⟷ : {t₁ t₂ : U} → (id⟷ {TIMES t₁ t₂}) ⇔ (id⟷ ⊗ id⟷)
hom⊗◎⇔ : {t₁ t₂ t₃ t₄ t₅ t₆ : U} {c₁ : t₅ ⟷ t₁} {c₂ : t₆ ⟷ t₂}
{c₃ : t₁ ⟷ t₃} {c₄ : t₂ ⟷ t₄} →
((c₁ ◎ c₃) ⊗ (c₂ ◎ c₄)) ⇔ ((c₁ ⊗ c₂) ◎ (c₃ ⊗ c₄))
hom◎⊗⇔ : {t₁ t₂ t₃ t₄ t₅ t₆ : U} {c₁ : t₅ ⟷ t₁} {c₂ : t₆ ⟷ t₂}
{c₃ : t₁ ⟷ t₃} {c₄ : t₂ ⟷ t₄} →
((c₁ ⊗ c₂) ◎ (c₃ ⊗ c₄)) ⇔ ((c₁ ◎ c₃) ⊗ (c₂ ◎ c₄))
-- associativity triangle
triangle⊕l : {t₁ t₂ : U} →
(unite₊r {t₁} ⊕ id⟷ {t₂}) ⇔ assocr₊ ◎ (id⟷ ⊕ unite₊l)
triangle⊕r : {t₁ t₂ : U} →
assocr₊ ◎ (id⟷ {t₁} ⊕ unite₊l {t₂}) ⇔ (unite₊r ⊕ id⟷)
triangle⊗l : {t₁ t₂ : U} →
((unite⋆r {t₁}) ⊗ id⟷ {t₂}) ⇔ assocr⋆ ◎ (id⟷ ⊗ unite⋆l)
triangle⊗r : {t₁ t₂ : U} →
(assocr⋆ ◎ (id⟷ {t₁} ⊗ unite⋆l {t₂})) ⇔ (unite⋆r ⊗ id⟷)
pentagon⊕l : {t₁ t₂ t₃ t₄ : U} →
assocr₊ ◎ (assocr₊ {t₁} {t₂} {PLUS t₃ t₄}) ⇔
((assocr₊ ⊕ id⟷) ◎ assocr₊) ◎ (id⟷ ⊕ assocr₊)
pentagon⊕r : {t₁ t₂ t₃ t₄ : U} →
((assocr₊ {t₁} {t₂} {t₃} ⊕ id⟷ {t₄}) ◎ assocr₊) ◎ (id⟷ ⊕ assocr₊) ⇔
assocr₊ ◎ assocr₊
pentagon⊗l : {t₁ t₂ t₃ t₄ : U} →
assocr⋆ ◎ (assocr⋆ {t₁} {t₂} {TIMES t₃ t₄}) ⇔
((assocr⋆ ⊗ id⟷) ◎ assocr⋆) ◎ (id⟷ ⊗ assocr⋆)
pentagon⊗r : {t₁ t₂ t₃ t₄ : U} →
((assocr⋆ {t₁} {t₂} {t₃} ⊗ id⟷ {t₄}) ◎ assocr⋆) ◎ (id⟷ ⊗ assocr⋆) ⇔
assocr⋆ ◎ assocr⋆
-- from the braiding
-- unit coherence
unite₊l-coh-l : {t₁ : U} → unite₊l {t₁} ⇔ swap₊ ◎ unite₊r
unite₊l-coh-r : {t₁ : U} → swap₊ ◎ unite₊r ⇔ unite₊l {t₁}
unite⋆l-coh-l : {t₁ : U} → unite⋆l {t₁} ⇔ swap⋆ ◎ unite⋆r
unite⋆l-coh-r : {t₁ : U} → swap⋆ ◎ unite⋆r ⇔ unite⋆l {t₁}
hexagonr⊕l : {t₁ t₂ t₃ : U} →
(assocr₊ ◎ swap₊) ◎ assocr₊ {t₁} {t₂} {t₃} ⇔
((swap₊ ⊕ id⟷) ◎ assocr₊) ◎ (id⟷ ⊕ swap₊)
hexagonr⊕r : {t₁ t₂ t₃ : U} →
((swap₊ ⊕ id⟷) ◎ assocr₊) ◎ (id⟷ ⊕ swap₊) ⇔
(assocr₊ ◎ swap₊) ◎ assocr₊ {t₁} {t₂} {t₃}
hexagonl⊕l : {t₁ t₂ t₃ : U} →
(assocl₊ ◎ swap₊) ◎ assocl₊ {t₁} {t₂} {t₃} ⇔
((id⟷ ⊕ swap₊) ◎ assocl₊) ◎ (swap₊ ⊕ id⟷)
hexagonl⊕r : {t₁ t₂ t₃ : U} →
((id⟷ ⊕ swap₊) ◎ assocl₊) ◎ (swap₊ ⊕ id⟷) ⇔
(assocl₊ ◎ swap₊) ◎ assocl₊ {t₁} {t₂} {t₃}
hexagonr⊗l : {t₁ t₂ t₃ : U} →
(assocr⋆ ◎ swap⋆) ◎ assocr⋆ {t₁} {t₂} {t₃} ⇔
((swap⋆ ⊗ id⟷) ◎ assocr⋆) ◎ (id⟷ ⊗ swap⋆)
hexagonr⊗r : {t₁ t₂ t₃ : U} →
((swap⋆ ⊗ id⟷) ◎ assocr⋆) ◎ (id⟷ ⊗ swap⋆) ⇔
(assocr⋆ ◎ swap⋆) ◎ assocr⋆ {t₁} {t₂} {t₃}
hexagonl⊗l : {t₁ t₂ t₃ : U} →
(assocl⋆ ◎ swap⋆) ◎ assocl⋆ {t₁} {t₂} {t₃} ⇔
((id⟷ ⊗ swap⋆) ◎ assocl⋆) ◎ (swap⋆ ⊗ id⟷)
hexagonl⊗r : {t₁ t₂ t₃ : U} →
((id⟷ ⊗ swap⋆) ◎ assocl⋆) ◎ (swap⋆ ⊗ id⟷) ⇔
(assocl⋆ ◎ swap⋆) ◎ assocl⋆ {t₁} {t₂} {t₃}
absorbl⇔l : {t₁ t₂ : U} {c₁ : t₁ ⟷ t₂} →
(c₁ ⊗ id⟷ {ZERO}) ◎ absorbl ⇔ absorbl ◎ id⟷ {ZERO}
absorbl⇔r : {t₁ t₂ : U} {c₁ : t₁ ⟷ t₂} →
absorbl ◎ id⟷ {ZERO} ⇔ (c₁ ⊗ id⟷ {ZERO}) ◎ absorbl
absorbr⇔l : {t₁ t₂ : U} {c₁ : t₁ ⟷ t₂} →
(id⟷ {ZERO} ⊗ c₁) ◎ absorbr ⇔ absorbr ◎ id⟷ {ZERO}
absorbr⇔r : {t₁ t₂ : U} {c₁ : t₁ ⟷ t₂} →
absorbr ◎ id⟷ {ZERO} ⇔ (id⟷ {ZERO} ⊗ c₁) ◎ absorbr
factorzl⇔l : {t₁ t₂ : U} {c₁ : t₁ ⟷ t₂} →
id⟷ ◎ factorzl ⇔ factorzl ◎ (id⟷ ⊗ c₁)
factorzl⇔r : {t₁ t₂ : U} {c₁ : t₁ ⟷ t₂} →
factorzl ◎ (id⟷ {ZERO} ⊗ c₁) ⇔ id⟷ {ZERO} ◎ factorzl
factorzr⇔l : {t₁ t₂ : U} {c₁ : t₁ ⟷ t₂} →
id⟷ ◎ factorzr ⇔ factorzr ◎ (c₁ ⊗ id⟷)
factorzr⇔r : {t₁ t₂ : U} {c₁ : t₁ ⟷ t₂} →
factorzr ◎ (c₁ ⊗ id⟷) ⇔ id⟷ ◎ factorzr
-- from the coherence conditions of RigCategory
swap₊distl⇔l : {t₁ t₂ t₃ : U} →
(id⟷ {t₁} ⊗ swap₊ {t₂} {t₃}) ◎ distl ⇔ distl ◎ swap₊
swap₊distl⇔r : {t₁ t₂ t₃ : U} →
distl ◎ swap₊ ⇔ (id⟷ {t₁} ⊗ swap₊ {t₂} {t₃}) ◎ distl
dist-swap⋆⇔l : {t₁ t₂ t₃ : U} →
dist {t₁} {t₂} {t₃} ◎ (swap⋆ ⊕ swap⋆) ⇔ swap⋆ ◎ distl
dist-swap⋆⇔r : {t₁ t₂ t₃ : U} →
swap⋆ ◎ distl {t₁} {t₂} {t₃} ⇔ dist ◎ (swap⋆ ⊕ swap⋆)
assocl₊-dist-dist⇔l : {t₁ t₂ t₃ t₄ : U} →
((assocl₊ {t₁} {t₂} {t₃} ⊗ id⟷ {t₄}) ◎ dist) ◎ (dist ⊕ id⟷) ⇔
(dist ◎ (id⟷ ⊕ dist)) ◎ assocl₊
assocl₊-dist-dist⇔r : {t₁ t₂ t₃ t₄ : U} →
(dist {t₁} ◎ (id⟷ ⊕ dist {t₂} {t₃} {t₄})) ◎ assocl₊ ⇔
((assocl₊ ⊗ id⟷) ◎ dist) ◎ (dist ⊕ id⟷)
assocl⋆-distl⇔l : {t₁ t₂ t₃ t₄ : U} →
assocl⋆ {t₁} {t₂} ◎ distl {TIMES t₁ t₂} {t₃} {t₄} ⇔
((id⟷ ⊗ distl) ◎ distl) ◎ (assocl⋆ ⊕ assocl⋆)
assocl⋆-distl⇔r : {t₁ t₂ t₃ t₄ : U} →
((id⟷ ⊗ distl) ◎ distl) ◎ (assocl⋆ ⊕ assocl⋆) ⇔
assocl⋆ {t₁} {t₂} ◎ distl {TIMES t₁ t₂} {t₃} {t₄}
absorbr0-absorbl0⇔ : absorbr {ZERO} ⇔ absorbl {ZERO}
absorbl0-absorbr0⇔ : absorbl {ZERO} ⇔ absorbr {ZERO}
absorbr⇔distl-absorb-unite : {t₁ t₂ : U} →
absorbr ⇔ (distl {t₂ = t₁} {t₂} ◎ (absorbr ⊕ absorbr)) ◎ unite₊l
distl-absorb-unite⇔absorbr : {t₁ t₂ : U} →
(distl {t₂ = t₁} {t₂} ◎ (absorbr ⊕ absorbr)) ◎ unite₊l ⇔ absorbr
unite⋆r0-absorbr1⇔ : unite⋆r ⇔ absorbr
absorbr1-unite⋆r-⇔ : absorbr ⇔ unite⋆r
absorbl≡swap⋆◎absorbr : {t₁ : U} → absorbl {t₁} ⇔ swap⋆ ◎ absorbr
swap⋆◎absorbr≡absorbl : {t₁ : U} → swap⋆ ◎ absorbr ⇔ absorbl {t₁}
absorbr⇔[assocl⋆◎[absorbr⊗id⟷]]◎absorbr : {t₁ t₂ : U} →
absorbr ⇔ (assocl⋆ {ZERO} {t₁} {t₂} ◎ (absorbr ⊗ id⟷)) ◎ absorbr
[assocl⋆◎[absorbr⊗id⟷]]◎absorbr⇔absorbr : {t₁ t₂ : U} →
(assocl⋆ {ZERO} {t₁} {t₂} ◎ (absorbr ⊗ id⟷)) ◎ absorbr ⇔ absorbr
[id⟷⊗absorbr]◎absorbl⇔assocl⋆◎[absorbl⊗id⟷]◎absorbr : {t₁ t₂ : U} →
(id⟷ ⊗ absorbr {t₂}) ◎ absorbl {t₁} ⇔
(assocl⋆ ◎ (absorbl ⊗ id⟷)) ◎ absorbr
assocl⋆◎[absorbl⊗id⟷]◎absorbr⇔[id⟷⊗absorbr]◎absorbl : {t₁ t₂ : U} →
(assocl⋆ ◎ (absorbl ⊗ id⟷)) ◎ absorbr ⇔
(id⟷ ⊗ absorbr {t₂}) ◎ absorbl {t₁}
elim⊥-A[0⊕B]⇔l : {t₁ t₂ : U} →
(id⟷ {t₁} ⊗ unite₊l {t₂}) ⇔
(distl ◎ (absorbl ⊕ id⟷)) ◎ unite₊l
elim⊥-A[0⊕B]⇔r : {t₁ t₂ : U} →
(distl ◎ (absorbl ⊕ id⟷)) ◎ unite₊l ⇔ (id⟷ {t₁} ⊗ unite₊l {t₂})
elim⊥-1[A⊕B]⇔l : {t₁ t₂ : U} →
unite⋆l ⇔
distl ◎ (unite⋆l {t₁} ⊕ unite⋆l {t₂})
elim⊥-1[A⊕B]⇔r : {t₁ t₂ : U} →
distl ◎ (unite⋆l {t₁} ⊕ unite⋆l {t₂}) ⇔ unite⋆l
fully-distribute⇔l : {t₁ t₂ t₃ t₄ : U} →
(distl ◎ (dist {t₁} {t₂} {t₃} ⊕ dist {t₁} {t₂} {t₄})) ◎ assocl₊ ⇔
((((dist ◎ (distl ⊕ distl)) ◎ assocl₊) ◎ (assocr₊ ⊕ id⟷)) ◎
((id⟷ ⊕ swap₊) ⊕ id⟷)) ◎ (assocl₊ ⊕ id⟷)
fully-distribute⇔r : {t₁ t₂ t₃ t₄ : U} →
((((dist ◎ (distl ⊕ distl)) ◎ assocl₊) ◎ (assocr₊ ⊕ id⟷)) ◎
((id⟷ ⊕ swap₊) ⊕ id⟷)) ◎ (assocl₊ ⊕ id⟷) ⇔
(distl ◎ (dist {t₁} {t₂} {t₃} ⊕ dist {t₁} {t₂} {t₄})) ◎ assocl₊
-- At the next level we have a trivial equivalence that equates all
-- 2-morphisms of the same type.
triv≡ : {t₁ t₂ : U} {f g : t₁ ⟷ t₂} → (α β : f ⇔ g) → Set
triv≡ _ _ = ⊤
triv≡Equiv : {t₁ t₂ : U} {f₁ f₂ : t₁ ⟷ t₂} →
IsEquivalence (triv≡ {t₁} {t₂} {f₁} {f₂})
triv≡Equiv = record
{ refl = tt
; sym = λ _ → tt
; trans = λ _ _ → tt
}
------------------------------------------------------------------------------
-- Inverses for 2paths
2! : {t₁ t₂ : U} {c₁ c₂ : t₁ ⟷ t₂} → (c₁ ⇔ c₂) → (c₂ ⇔ c₁)
2! assoc◎l = assoc◎r
2! assoc◎r = assoc◎l
2! assocl⊕l = assocl⊕r
2! assocl⊕r = assocl⊕l
2! assocl⊗l = assocl⊗r
2! assocl⊗r = assocl⊗l
2! assocr⊕r = assocr⊕l
2! assocr⊕l = assocr⊕r
2! assocr⊗r = assocr⊗l
2! assocr⊗l = assocr⊗r
2! dist⇔l = dist⇔r
2! dist⇔r = dist⇔l
2! distl⇔l = distl⇔r
2! distl⇔r = distl⇔l
2! factor⇔l = factor⇔r
2! factor⇔r = factor⇔l
2! factorl⇔l = factorl⇔r
2! factorl⇔r = factorl⇔l
2! idl◎l = idl◎r
2! idl◎r = idl◎l
2! idr◎l = idr◎r
2! idr◎r = idr◎l
2! linv◎l = linv◎r
2! linv◎r = linv◎l
2! rinv◎l = rinv◎r
2! rinv◎r = rinv◎l
2! unite₊l⇔l = unite₊l⇔r
2! unite₊l⇔r = unite₊l⇔l
2! uniti₊l⇔l = uniti₊l⇔r
2! uniti₊l⇔r = uniti₊l⇔l
2! unite₊r⇔l = unite₊r⇔r
2! unite₊r⇔r = unite₊r⇔l
2! uniti₊r⇔l = uniti₊r⇔r
2! uniti₊r⇔r = uniti₊r⇔l
2! swapl₊⇔ = swapr₊⇔
2! swapr₊⇔ = swapl₊⇔
2! unitel⋆⇔l = uniter⋆⇔l
2! uniter⋆⇔l = unitel⋆⇔l
2! unitil⋆⇔l = unitir⋆⇔l
2! unitir⋆⇔l = unitil⋆⇔l
2! unitel⋆⇔r = uniter⋆⇔r
2! uniter⋆⇔r = unitel⋆⇔r
2! unitil⋆⇔r = unitir⋆⇔r
2! unitir⋆⇔r = unitil⋆⇔r
2! swapl⋆⇔ = swapr⋆⇔
2! swapr⋆⇔ = swapl⋆⇔
2! id⇔ = id⇔
2! (α ⊡ β) = (2! α) ⊡ (2! β)
2! (trans⇔ α β) = trans⇔ (2! β) (2! α)
2! (resp⊕⇔ α β) = resp⊕⇔ (2! α) (2! β)
2! (resp⊗⇔ α β) = resp⊗⇔ (2! α) (2! β)
2! id⟷⊕id⟷⇔ = split⊕-id⟷
2! split⊕-id⟷ = id⟷⊕id⟷⇔
2! hom⊕◎⇔ = hom◎⊕⇔
2! hom◎⊕⇔ = hom⊕◎⇔
2! id⟷⊗id⟷⇔ = split⊗-id⟷
2! split⊗-id⟷ = id⟷⊗id⟷⇔
2! hom⊗◎⇔ = hom◎⊗⇔
2! hom◎⊗⇔ = hom⊗◎⇔
2! triangle⊕l = triangle⊕r
2! triangle⊕r = triangle⊕l
2! triangle⊗l = triangle⊗r
2! triangle⊗r = triangle⊗l
2! pentagon⊕l = pentagon⊕r
2! pentagon⊕r = pentagon⊕l
2! pentagon⊗l = pentagon⊗r
2! pentagon⊗r = pentagon⊗l
2! unite₊l-coh-l = unite₊l-coh-r
2! unite₊l-coh-r = unite₊l-coh-l
2! unite⋆l-coh-l = unite⋆l-coh-r
2! unite⋆l-coh-r = unite⋆l-coh-l
2! hexagonr⊕l = hexagonr⊕r
2! hexagonr⊕r = hexagonr⊕l
2! hexagonl⊕l = hexagonl⊕r
2! hexagonl⊕r = hexagonl⊕l
2! hexagonr⊗l = hexagonr⊗r
2! hexagonr⊗r = hexagonr⊗l
2! hexagonl⊗l = hexagonl⊗r
2! hexagonl⊗r = hexagonl⊗l
2! absorbl⇔l = absorbl⇔r
2! absorbl⇔r = absorbl⇔l
2! absorbr⇔l = absorbr⇔r
2! absorbr⇔r = absorbr⇔l
2! factorzl⇔l = factorzl⇔r
2! factorzl⇔r = factorzl⇔l
2! factorzr⇔l = factorzr⇔r
2! factorzr⇔r = factorzr⇔l
2! swap₊distl⇔l = swap₊distl⇔r
2! swap₊distl⇔r = swap₊distl⇔l
2! dist-swap⋆⇔l = dist-swap⋆⇔r
2! dist-swap⋆⇔r = dist-swap⋆⇔l
2! assocl₊-dist-dist⇔l = assocl₊-dist-dist⇔r
2! assocl₊-dist-dist⇔r = assocl₊-dist-dist⇔l
2! assocl⋆-distl⇔l = assocl⋆-distl⇔r
2! assocl⋆-distl⇔r = assocl⋆-distl⇔l
2! absorbr0-absorbl0⇔ = absorbl0-absorbr0⇔
2! absorbl0-absorbr0⇔ = absorbr0-absorbl0⇔
2! absorbr⇔distl-absorb-unite = distl-absorb-unite⇔absorbr
2! distl-absorb-unite⇔absorbr = absorbr⇔distl-absorb-unite
2! unite⋆r0-absorbr1⇔ = absorbr1-unite⋆r-⇔
2! absorbr1-unite⋆r-⇔ = unite⋆r0-absorbr1⇔
2! absorbl≡swap⋆◎absorbr = swap⋆◎absorbr≡absorbl
2! swap⋆◎absorbr≡absorbl = absorbl≡swap⋆◎absorbr
2! absorbr⇔[assocl⋆◎[absorbr⊗id⟷]]◎absorbr =
[assocl⋆◎[absorbr⊗id⟷]]◎absorbr⇔absorbr
2! [assocl⋆◎[absorbr⊗id⟷]]◎absorbr⇔absorbr =
absorbr⇔[assocl⋆◎[absorbr⊗id⟷]]◎absorbr
2! [id⟷⊗absorbr]◎absorbl⇔assocl⋆◎[absorbl⊗id⟷]◎absorbr =
assocl⋆◎[absorbl⊗id⟷]◎absorbr⇔[id⟷⊗absorbr]◎absorbl
2! assocl⋆◎[absorbl⊗id⟷]◎absorbr⇔[id⟷⊗absorbr]◎absorbl =
[id⟷⊗absorbr]◎absorbl⇔assocl⋆◎[absorbl⊗id⟷]◎absorbr
2! elim⊥-A[0⊕B]⇔l = elim⊥-A[0⊕B]⇔r
2! elim⊥-A[0⊕B]⇔r = elim⊥-A[0⊕B]⇔l
2! elim⊥-1[A⊕B]⇔l = elim⊥-1[A⊕B]⇔r
2! elim⊥-1[A⊕B]⇔r = elim⊥-1[A⊕B]⇔l
2! fully-distribute⇔l = fully-distribute⇔r
2! fully-distribute⇔r = fully-distribute⇔l
2!! : {t₁ t₂ : U} {f g : t₁ ⟷ t₂} {α : f ⇔ g} → triv≡ (2! (2! α)) α
2!! = tt
-- This makes _⇔_ an equivalence relation...
⇔Equiv : {t₁ t₂ : U} → IsEquivalence (_⇔_ {t₁} {t₂})
⇔Equiv = record
{ refl = id⇔
; sym = 2!
; trans = trans⇔
}
------------------------------------------------------------------------------
-- Unit coherence has two versions, but one is derivable
-- from the other. As it turns out, one of our examples
-- needs the 'flipped' version.
unite₊r-coh-r : {t₁ : U} → swap₊ ◎ unite₊l ⇔ unite₊r {t₁}
unite₊r-coh-r =
trans⇔ (id⇔ ⊡ unite₊l-coh-l) (
trans⇔ assoc◎l ((
trans⇔ (linv◎l ⊡ id⇔) idl◎l ) ) )
------------------------------------------------------------------------------
-- It is often useful to have that reversing c twice is ⇔ c rather than ≡
-- Unfortunately, it needs a 'proof', which is quite dull, though
-- it does have 3 non-trivial cases.
!!⇔id : {t₁ t₂ : U} {c : t₁ ⟷ t₂} → (! (! c)) ⇔ c
!!⇔id {c = unite₊l} = id⇔
!!⇔id {c = uniti₊l} = id⇔
!!⇔id {c = unite₊r} = id⇔
!!⇔id {c = uniti₊r} = id⇔
!!⇔id {c = swap₊} = id⇔
!!⇔id {c = assocl₊} = id⇔
!!⇔id {c = assocr₊} = id⇔
!!⇔id {c = unite⋆l} = id⇔
!!⇔id {c = uniti⋆l} = id⇔
!!⇔id {c = unite⋆r} = id⇔
!!⇔id {c = uniti⋆r} = id⇔
!!⇔id {c = swap⋆} = id⇔
!!⇔id {c = assocl⋆} = id⇔
!!⇔id {c = assocr⋆} = id⇔
!!⇔id {c = absorbr} = id⇔
!!⇔id {c = absorbl} = id⇔
!!⇔id {c = factorzr} = id⇔
!!⇔id {c = factorzl} = id⇔
!!⇔id {c = dist} = id⇔
!!⇔id {c = factor} = id⇔
!!⇔id {c = distl} = id⇔
!!⇔id {c = factorl} = id⇔
!!⇔id {c = id⟷} = id⇔
!!⇔id {c = c ◎ c₁} = !!⇔id ⊡ !!⇔id
!!⇔id {c = c ⊕ c₁} = resp⊕⇔ !!⇔id !!⇔id
!!⇔id {c = c ⊗ c₁} = resp⊗⇔ !!⇔id !!⇔id
-------------
mutual
eval₁ : {t₁ t₂ : U} {c₁ c₂ : t₁ ⟷ t₂} (ce : c₁ ⇔ c₂) → (t₁ ⟷ t₂)
eval₁ (assoc◎l {c₁ = c₁} {c₂} {c₃}) = (c₁ ◎ c₂) ◎ c₃
eval₁ (assoc◎r {c₁ = c₁} {c₂} {c₃}) = c₁ ◎ (c₂ ◎ c₃)
eval₁ (assocl⊕l {c₁ = c₁} {c₂} {c₃}) = assocl₊ ◎ ((c₁ ⊕ c₂) ⊕ c₃)
eval₁ (assocl⊕r {c₁ = c₁} {c₂} {c₃}) = (c₁ ⊕ (c₂ ⊕ c₃)) ◎ assocl₊
eval₁ (assocl⊗l {c₁ = c₁} {c₂} {c₃}) = assocl⋆ ◎ ((c₁ ⊗ c₂) ⊗ c₃)
eval₁ (assocl⊗r {c₁ = c₁} {c₂} {c₃}) = (c₁ ⊗ (c₂ ⊗ c₃)) ◎ assocl⋆
eval₁ (assocr⊕r {c₁ = c₁} {c₂} {c₃}) = assocr₊ ◎ (c₁ ⊕ (c₂ ⊕ c₃))
eval₁ (assocr⊗l {c₁ = c₁} {c₂} {c₃}) = ((c₁ ⊗ c₂) ⊗ c₃) ◎ assocr⋆
eval₁ (assocr⊗r {c₁ = c₁} {c₂} {c₃}) = assocr⋆ ◎(c₁ ⊗ (c₂ ⊗ c₃))
eval₁ (assocr⊕l {c₁ = c₁} {c₂} {c₃}) = ((c₁ ⊕ c₂) ⊕ c₃) ◎ assocr₊
eval₁ (dist⇔l {a = c₁} {c₂} {c₃}) = dist ◎ ((c₁ ⊗ c₃) ⊕ (c₂ ⊗ c₃))
eval₁ (dist⇔r {a = c₁} {c₂} {c₃}) = ((c₁ ⊕ c₂) ⊗ c₃) ◎ dist
eval₁ (distl⇔l {a = c₁} {c₂} {c₃}) = distl ◎ ((c₁ ⊗ c₂) ⊕ (c₁ ⊗ c₃))
eval₁ (distl⇔r {a = c₁} {c₂} {c₃}) = (c₁ ⊗ (c₂ ⊕ c₃)) ◎ distl
eval₁ (factor⇔l {a = c₁} {c₂} {c₃}) = factor ◎ ((c₁ ⊕ c₂) ⊗ c₃)
eval₁ (factor⇔r {a = c₁} {c₂} {c₃}) = ((c₁ ⊗ c₃) ⊕ (c₂ ⊗ c₃)) ◎ factor
eval₁ (factorl⇔l {a = c₁} {c₂} {c₃}) = factorl ◎ (c₁ ⊗ (c₂ ⊕ c₃))
eval₁ (factorl⇔r {a = c₁} {c₂} {c₃}) = ((c₁ ⊗ c₂) ⊕ (c₁ ⊗ c₃)) ◎ factorl
eval₁ (idl◎l {c = c}) = c
eval₁ (idl◎r {c = c}) = id⟷ ◎ c
eval₁ (idr◎l {c = c}) = c
eval₁ (idr◎r {c = c}) = c ◎ id⟷
eval₁ (linv◎l {c = c}) = id⟷
eval₁ (linv◎r {c = c}) = c ◎ ! c
eval₁ (rinv◎l {c = c}) = id⟷
eval₁ (rinv◎r {c = c}) = ! c ◎ c
eval₁ (unite₊l⇔l {c₁ = c₁} {c₂}) = (c₁ ⊕ c₂) ◎ unite₊l
eval₁ (unite₊l⇔r {c₁ = c₁} {c₂}) = unite₊l ◎ c₂
eval₁ (uniti₊l⇔l {c₁ = c₁} {c₂}) = c₂ ◎ uniti₊l
eval₁ (uniti₊l⇔r {c₁ = c₁} {c₂}) = uniti₊l ◎ (c₁ ⊕ c₂)
eval₁ (unite₊r⇔l {c₁ = c₁} {c₂}) = (c₂ ⊕ c₁) ◎ unite₊r
eval₁ (unite₊r⇔r {c₁ = c₁} {c₂}) = unite₊r ◎ c₂
eval₁ (uniti₊r⇔l {c₁ = c₁} {c₂}) = c₂ ◎ uniti₊r
eval₁ (uniti₊r⇔r {c₁ = c₁} {c₂}) = uniti₊r ◎ (c₂ ⊕ c₁)
eval₁ (swapl₊⇔ {c₁ = c₁} {c₂}) = (c₂ ⊕ c₁) ◎ swap₊
eval₁ (swapr₊⇔ {c₁ = c₁} {c₂}) = swap₊ ◎ (c₁ ⊕ c₂)
eval₁ (unitel⋆⇔l {c₁ = c₁} {c₂}) = (c₁ ⊗ c₂) ◎ unite⋆l
eval₁ (uniter⋆⇔l {c₁ = c₁} {c₂}) = unite⋆l ◎ c₂
eval₁ (unitil⋆⇔l {c₁ = c₁} {c₂}) = c₂ ◎ uniti⋆l
eval₁ (unitir⋆⇔l {c₁ = c₁} {c₂}) = uniti⋆l ◎ (c₁ ⊗ c₂)
eval₁ (unitel⋆⇔r {c₁ = c₁} {c₂}) = (c₂ ⊗ c₁) ◎ unite⋆r
eval₁ (uniter⋆⇔r {c₁ = c₁} {c₂}) = unite⋆r ◎ c₂
eval₁ (unitil⋆⇔r {c₁ = c₁} {c₂}) = c₂ ◎ uniti⋆r
eval₁ (unitir⋆⇔r {c₁ = c₁} {c₂}) = uniti⋆r ◎ (c₂ ⊗ c₁)
eval₁ (swapl⋆⇔ {c₁ = c₁} {c₂}) = (c₂ ⊗ c₁) ◎ swap⋆
eval₁ (swapr⋆⇔ {c₁ = c₁} {c₂}) = swap⋆ ◎ (c₁ ⊗ c₂)
eval₁ (id⇔ {c = c}) = c
eval₁ (trans⇔ {t₁} {t₂} {c₁} {c₂} {c₃} ce ce₁) with eval₁ ce | exact ce
... | cc | refl = eval₁ {c₁ = cc} {c₃} ce₁
eval₁ (_⊡_ {c₁ = c₁} {c₂} {c₃} {c₄} ce₀ ce₁) =
let r₀ = eval₁ ce₀ in
let r₁ = eval₁ ce₁ in
r₀ ◎ r₁
eval₁ (resp⊕⇔ ce₀ ce₁) =
let r₀ = eval₁ ce₀ in
let r₁ = eval₁ ce₁ in
r₀ ⊕ r₁
eval₁ (resp⊗⇔ ce₀ ce₁) =
let r₀ = eval₁ ce₀ in
let r₁ = eval₁ ce₁ in
r₀ ⊗ r₁
eval₁ id⟷⊕id⟷⇔ = id⟷
eval₁ split⊕-id⟷ = id⟷ ⊕ id⟷
eval₁ (hom⊕◎⇔ {c₁ = c₁} {c₂} {c₃} {c₄}) = (c₁ ⊕ c₂) ◎ (c₃ ⊕ c₄)
eval₁ (hom◎⊕⇔ {c₁ = c₁} {c₂} {c₃} {c₄}) = (c₁ ◎ c₃) ⊕ (c₂ ◎ c₄)
eval₁ id⟷⊗id⟷⇔ = id⟷
eval₁ split⊗-id⟷ = id⟷ ⊗ id⟷
eval₁ (hom⊗◎⇔ {c₁ = c₁} {c₂} {c₃} {c₄}) = (c₁ ⊗ c₂) ◎ (c₃ ⊗ c₄)
eval₁ (hom◎⊗⇔ {c₁ = c₁} {c₂} {c₃} {c₄}) = (c₁ ◎ c₃) ⊗ (c₂ ◎ c₄)
eval₁ triangle⊕l = assocr₊ ◎ (id⟷ ⊕ unite₊l)
eval₁ triangle⊕r = unite₊r ⊕ id⟷
eval₁ triangle⊗l = assocr⋆ ◎ (id⟷ ⊗ unite⋆l)
eval₁ triangle⊗r = unite⋆r ⊗ id⟷
eval₁ pentagon⊕l = ((assocr₊ ⊕ id⟷) ◎ assocr₊) ◎ (id⟷ ⊕ assocr₊)
eval₁ pentagon⊕r = assocr₊ ◎ assocr₊
eval₁ pentagon⊗l = ((assocr⋆ ⊗ id⟷) ◎ assocr⋆) ◎ (id⟷ ⊗ assocr⋆)
eval₁ pentagon⊗r = assocr⋆ ◎ assocr⋆
eval₁ unite₊l-coh-l = swap₊ ◎ unite₊r
eval₁ unite₊l-coh-r = unite₊l
eval₁ unite⋆l-coh-l = swap⋆ ◎ unite⋆r
eval₁ unite⋆l-coh-r = unite⋆l
eval₁ hexagonr⊕l = ((swap₊ ⊕ id⟷) ◎ assocr₊) ◎ (id⟷ ⊕ swap₊)
eval₁ hexagonr⊕r = (assocr₊ ◎ swap₊) ◎ assocr₊
eval₁ hexagonl⊕l = ((id⟷ ⊕ swap₊) ◎ assocl₊) ◎ (swap₊ ⊕ id⟷)
eval₁ hexagonl⊕r = (assocl₊ ◎ swap₊) ◎ assocl₊
eval₁ hexagonr⊗l = ((swap⋆ ⊗ id⟷) ◎ assocr⋆) ◎ (id⟷ ⊗ swap⋆)
eval₁ hexagonr⊗r = (assocr⋆ ◎ swap⋆) ◎ assocr⋆
eval₁ hexagonl⊗l = ((id⟷ ⊗ swap⋆) ◎ assocl⋆) ◎ (swap⋆ ⊗ id⟷)
eval₁ hexagonl⊗r = (assocl⋆ ◎ swap⋆) ◎ assocl⋆
eval₁ absorbl⇔l = absorbl ◎ id⟷
eval₁ (absorbl⇔r {c₁ = c₁}) = (c₁ ⊗ id⟷) ◎ absorbl
eval₁ absorbr⇔l = absorbr ◎ id⟷
eval₁ (absorbr⇔r {c₁ = c₁}) = (id⟷ ⊗ c₁) ◎ absorbr
eval₁ (factorzl⇔l {c₁ = c₁}) = factorzl ◎ (id⟷ ⊗ c₁)
eval₁ (factorzl⇔r {c₁ = c₁}) = id⟷ ◎ factorzl
eval₁ (factorzr⇔l {c₁ = c₁}) = factorzr ◎ (c₁ ⊗ id⟷)
eval₁ (factorzr⇔r {c₁ = c₁}) = id⟷ ◎ factorzr
eval₁ swap₊distl⇔l = distl ◎ swap₊
eval₁ swap₊distl⇔r = (id⟷ ⊗ swap₊) ◎ distl
eval₁ dist-swap⋆⇔l = swap⋆ ◎ distl
eval₁ dist-swap⋆⇔r = dist ◎ (swap⋆ ⊕ swap⋆)
eval₁ assocl₊-dist-dist⇔l = (dist ◎ (id⟷ ⊕ dist)) ◎ assocl₊
eval₁ assocl₊-dist-dist⇔r = ((assocl₊ ⊗ id⟷) ◎ dist) ◎ (dist ⊕ id⟷)
eval₁ assocl⋆-distl⇔l = ((id⟷ ⊗ distl) ◎ distl) ◎ (assocl⋆ ⊕ assocl⋆)
eval₁ assocl⋆-distl⇔r = assocl⋆ ◎ distl
eval₁ absorbr0-absorbl0⇔ = absorbl
eval₁ absorbl0-absorbr0⇔ = absorbr
eval₁ absorbr⇔distl-absorb-unite = (distl ◎ (absorbr ⊕ absorbr)) ◎ unite₊l
eval₁ distl-absorb-unite⇔absorbr = absorbr
eval₁ unite⋆r0-absorbr1⇔ = absorbr
eval₁ absorbr1-unite⋆r-⇔ = unite⋆r
eval₁ absorbl≡swap⋆◎absorbr = swap⋆ ◎ absorbr
eval₁ swap⋆◎absorbr≡absorbl = absorbl
eval₁ absorbr⇔[assocl⋆◎[absorbr⊗id⟷]]◎absorbr = (assocl⋆ ◎ (absorbr ⊗ id⟷)) ◎ absorbr
eval₁ [assocl⋆◎[absorbr⊗id⟷]]◎absorbr⇔absorbr = absorbr
eval₁ [id⟷⊗absorbr]◎absorbl⇔assocl⋆◎[absorbl⊗id⟷]◎absorbr = (assocl⋆ ◎ (absorbl ⊗ id⟷)) ◎ absorbr
eval₁ assocl⋆◎[absorbl⊗id⟷]◎absorbr⇔[id⟷⊗absorbr]◎absorbl = (id⟷ ⊗ absorbr) ◎ absorbl
eval₁ elim⊥-A[0⊕B]⇔l = (distl ◎ (absorbl ⊕ id⟷)) ◎ unite₊l
eval₁ elim⊥-A[0⊕B]⇔r = id⟷ ⊗ unite₊l
eval₁ elim⊥-1[A⊕B]⇔l = distl ◎ (unite⋆l ⊕ unite⋆l)
eval₁ elim⊥-1[A⊕B]⇔r = unite⋆l
eval₁ fully-distribute⇔l = ((((dist ◎ (distl ⊕ distl)) ◎ assocl₊) ◎ (assocr₊ ⊕ id⟷)) ◎
((id⟷ ⊕ swap₊) ⊕ id⟷))
◎ (assocl₊ ⊕ id⟷)
eval₁ fully-distribute⇔r = (distl ◎ (dist ⊕ dist)) ◎ assocl₊
exact : {t₁ t₂ : U} {c₁ c₂ : t₁ ⟷ t₂} (ce : c₁ ⇔ c₂) → eval₁ ce ≡ c₂
exact assoc◎l = refl
exact assoc◎r = refl
exact assocl⊕l = refl
exact assocl⊕r = refl
exact assocl⊗l = refl
exact assocl⊗r = refl
exact assocr⊕r = refl
exact assocr⊗l = refl
exact assocr⊗r = refl
exact assocr⊕l = refl
exact dist⇔l = refl
exact dist⇔r = refl
exact distl⇔l = refl
exact distl⇔r = refl
exact factor⇔l = refl
exact factor⇔r = refl
exact factorl⇔l = refl
exact factorl⇔r = refl
exact idl◎l = refl
exact idl◎r = refl
exact idr◎l = refl
exact idr◎r = refl
exact linv◎l = refl
exact linv◎r = refl
exact rinv◎l = refl
exact rinv◎r = refl
exact unite₊l⇔l = refl
exact unite₊l⇔r = refl
exact uniti₊l⇔l = refl
exact uniti₊l⇔r = refl
exact unite₊r⇔l = refl
exact unite₊r⇔r = refl
exact uniti₊r⇔l = refl
exact uniti₊r⇔r = refl
exact swapl₊⇔ = refl
exact swapr₊⇔ = refl
exact unitel⋆⇔l = refl
exact uniter⋆⇔l = refl
exact unitil⋆⇔l = refl
exact unitir⋆⇔l = refl
exact unitel⋆⇔r = refl
exact uniter⋆⇔r = refl
exact unitil⋆⇔r = refl
exact unitir⋆⇔r = refl
exact swapl⋆⇔ = refl
exact swapr⋆⇔ = refl
exact id⇔ = refl
exact (trans⇔ ce ce₁) rewrite exact ce | exact ce₁ = refl
exact (ce ⊡ ce₁) rewrite exact ce | exact ce₁ = refl
exact (resp⊕⇔ ce ce₁) rewrite exact ce | exact ce₁ = refl
exact (resp⊗⇔ ce ce₁) rewrite exact ce | exact ce₁ = refl
exact id⟷⊕id⟷⇔ = refl
exact split⊕-id⟷ = refl
exact hom⊕◎⇔ = refl
exact hom◎⊕⇔ = refl
exact id⟷⊗id⟷⇔ = refl
exact split⊗-id⟷ = refl
exact hom⊗◎⇔ = refl
exact hom◎⊗⇔ = refl
exact triangle⊕l = refl
exact triangle⊕r = refl
exact triangle⊗l = refl
exact triangle⊗r = refl
exact pentagon⊕l = refl
exact pentagon⊕r = refl
exact pentagon⊗l = refl
exact pentagon⊗r = refl
exact unite₊l-coh-l = refl
exact unite₊l-coh-r = refl
exact unite⋆l-coh-l = refl
exact unite⋆l-coh-r = refl
exact hexagonr⊕l = refl
exact hexagonr⊕r = refl
exact hexagonl⊕l = refl
exact hexagonl⊕r = refl
exact hexagonr⊗l = refl
exact hexagonr⊗r = refl
exact hexagonl⊗l = refl
exact hexagonl⊗r = refl
exact absorbl⇔l = refl
exact absorbl⇔r = refl
exact absorbr⇔l = refl
exact absorbr⇔r = refl
exact factorzl⇔l = refl
exact factorzl⇔r = refl
exact factorzr⇔l = refl
exact factorzr⇔r = refl
exact swap₊distl⇔l = refl
exact swap₊distl⇔r = refl
exact dist-swap⋆⇔l = refl
exact dist-swap⋆⇔r = refl
exact assocl₊-dist-dist⇔l = refl
exact assocl₊-dist-dist⇔r = refl
exact assocl⋆-distl⇔l = refl
exact assocl⋆-distl⇔r = refl
exact absorbr0-absorbl0⇔ = refl
exact absorbl0-absorbr0⇔ = refl
exact absorbr⇔distl-absorb-unite = refl
exact distl-absorb-unite⇔absorbr = refl
exact unite⋆r0-absorbr1⇔ = refl
exact absorbr1-unite⋆r-⇔ = refl
exact absorbl≡swap⋆◎absorbr = refl
exact swap⋆◎absorbr≡absorbl = refl
exact absorbr⇔[assocl⋆◎[absorbr⊗id⟷]]◎absorbr = refl
exact [assocl⋆◎[absorbr⊗id⟷]]◎absorbr⇔absorbr = refl
exact [id⟷⊗absorbr]◎absorbl⇔assocl⋆◎[absorbl⊗id⟷]◎absorbr = refl
exact assocl⋆◎[absorbl⊗id⟷]◎absorbr⇔[id⟷⊗absorbr]◎absorbl = refl
exact elim⊥-A[0⊕B]⇔l = refl
exact elim⊥-A[0⊕B]⇔r = refl
exact elim⊥-1[A⊕B]⇔l = refl
exact elim⊥-1[A⊕B]⇔r = refl
exact fully-distribute⇔l = refl
exact fully-distribute⇔r = refl
|
alloy4fun_models/trashltl/models/9/wbqA5TB78HXEtHYEz.als | Kaixi26/org.alloytools.alloy | 0 | 5000 | <reponame>Kaixi26/org.alloytools.alloy
open main
pred idwbqA5TB78HXEtHYEz_prop10 {
always Protected in Protected'
}
pred __repair { idwbqA5TB78HXEtHYEz_prop10 }
check __repair { idwbqA5TB78HXEtHYEz_prop10 <=> prop10o } |
programs/oeis/014/A014445.asm | neoneye/loda | 22 | 171831 | ; A014445: Even Fibonacci numbers; or, Fibonacci(3*n).
; 0,2,8,34,144,610,2584,10946,46368,196418,832040,3524578,14930352,63245986,267914296,1134903170,4807526976,20365011074,86267571272,365435296162,1548008755920,6557470319842,27777890035288,117669030460994,498454011879264,2111485077978050,8944394323791464,37889062373143906,160500643816367088,679891637638612258,2880067194370816120,12200160415121876738,51680708854858323072,218922995834555169026,927372692193078999176,3928413764606871165730,16641027750620563662096,70492524767089125814114,298611126818977066918552,1264937032042997393488322,5358359254990966640871840,22698374052006863956975682,96151855463018422468774568,407305795904080553832073954,1725375039079340637797070384,7308805952221443105020355490,30960598847965113057878492344,131151201344081895336534324866,555565404224292694404015791808,2353412818241252672952597492098,9969216677189303386214405760200,42230279526998466217810220532898,178890334785183168257455287891792,757791618667731139247631372100066,3210056809456107725247980776292056,13598018856492162040239554477268290,57602132235424755886206198685365216,244006547798191185585064349218729154
seq $0,1076 ; Denominators of continued fraction convergents to sqrt(5).
mul $0,2
|
src/json-streams.ads | Statkus/json-ada | 0 | 9762 | -- Copyright (c) 2016 onox <<EMAIL>>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
with Ada.Streams;
package JSON.Streams is
pragma Preelaborate;
package AS renames Ada.Streams;
type Stream is abstract tagged limited private;
type Stream_Ptr is not null access all Streams.Stream'Class;
procedure Read_Character (Object : in out Stream; Item : out Character) is abstract;
function Has_Buffered_Character (Object : Stream) return Boolean
with Inline;
function Read_Character (Object : in out Stream) return Character
with Post'Class => not Stream'Class (Object).Has_Buffered_Character;
function Read_Character
(Object : in out Stream;
Index : out AS.Stream_Element_Offset) return Character
with Post'Class => not Stream'Class (Object).Has_Buffered_Character;
-- Writes the offset of the read character to Index. This is needed
-- for string tokens.
procedure Write_Character (Object : in out Stream; Next : Character)
with Pre'Class => not Stream'Class (Object).Has_Buffered_Character;
function Get_String
(Object : Stream;
Offset, Length : AS.Stream_Element_Offset) return String is abstract;
function Create_Stream (Text : not null access String) return Stream'Class;
function Create_Stream
(Bytes : not null access AS.Stream_Element_Array) return Stream'Class;
private
type Stream is abstract tagged limited record
Next_Character : Character;
Index : AS.Stream_Element_Offset;
end record;
type Stream_String (Text : not null access String) is new Stream with null record;
overriding
procedure Read_Character (Object : in out Stream_String; Item : out Character);
overriding
function Get_String
(Object : Stream_String;
Offset, Length : AS.Stream_Element_Offset) return String;
type Stream_Bytes
(Bytes : not null access AS.Stream_Element_Array) is new Stream with null record;
overriding
procedure Read_Character (Object : in out Stream_Bytes; Item : out Character);
overriding
function Get_String
(Object : Stream_Bytes;
Offset, Length : AS.Stream_Element_Offset) return String;
end JSON.Streams;
|
test/succeed/ProjectingRecordMeta.agda | asr/agda-kanso | 1 | 9116 | module ProjectingRecordMeta where
data _==_ {A : Set}(a : A) : A -> Set where
refl : a == a
-- Andreas, Feb/Apr 2011
record Prod (A B : Set) : Set where
constructor _,_
field
fst : A
snd : B
open Prod public
testProj : {A B : Set}(y z : Prod A B) ->
let X : Prod A B
X = _ -- Solution: fst y , snd z
in (C : Set) -> (fst X == fst y -> snd X == snd z -> C) -> C
testProj y z C k = k refl refl
-- ok, Agda handles projections properly during unification
testProj' : {A B : Set}(y z : Prod A B) ->
let X : Prod A B
X = _ -- Solution: fst y , snd z
in Prod (fst X == fst y) (snd X == snd z)
testProj' y z = refl , refl
|
programs/oeis/191/A191107.asm | jmorken/loda | 1 | 103936 | ; A191107: Increasing sequence generated by these rules: a(1)=1, and if x is in a then 3x-2 and 3x+1 are in a.
; 1,4,10,13,28,31,37,40,82,85,91,94,109,112,118,121,244,247,253,256,271,274,280,283,325,328,334,337,352,355,361,364,730,733,739,742,757,760,766,769,811,814,820,823,838,841,847,850,973,976,982,985,1000,1003,1009,1012,1054,1057,1063,1066,1081,1084,1090,1093,2188,2191,2197,2200,2215,2218,2224,2227,2269,2272,2278,2281,2296,2299,2305,2308,2431,2434,2440,2443,2458,2461,2467,2470,2512,2515,2521,2524,2539,2542,2548,2551,2917,2920,2926,2929,2944,2947,2953,2956,2998,3001,3007,3010,3025,3028,3034,3037,3160,3163,3169,3172,3187,3190,3196,3199,3241,3244,3250,3253,3268,3271,3277,3280,6562,6565,6571,6574,6589,6592,6598,6601,6643,6646,6652,6655,6670,6673,6679,6682,6805,6808,6814,6817,6832,6835,6841,6844,6886,6889,6895,6898,6913,6916,6922,6925,7291,7294,7300,7303,7318,7321,7327,7330,7372,7375,7381,7384,7399,7402,7408,7411,7534,7537,7543,7546,7561,7564,7570,7573,7615,7618,7624,7627,7642,7645,7651,7654,8749,8752,8758,8761,8776,8779,8785,8788,8830,8833,8839,8842,8857,8860,8866,8869,8992,8995,9001,9004,9019,9022,9028,9031,9073,9076,9082,9085,9100,9103,9109,9112,9478,9481,9487,9490,9505,9508,9514,9517,9559,9562,9568,9571,9586,9589,9595,9598,9721,9724,9730,9733,9748,9751,9757,9760,9802,9805
mov $6,$0
add $6,1
lpb $6
clr $0,4
sub $6,1
sub $0,$6
lpb $0
gcd $0,262144
div $0,2
add $1,1
mul $1,3
mov $3,3
lpe
add $1,$3
mul $1,9
div $1,27
add $1,1
add $5,$1
lpe
mov $1,$5
|
Cubical/Data/NatPlusOne/MoreNats/AssocNat/Properties.agda | thomas-lamiaux/cubical | 1 | 11535 | <gh_stars>1-10
{-# OPTIONS --safe #-}
module Cubical.Data.NatPlusOne.MoreNats.AssocNat.Properties where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Function
open import Cubical.Foundations.HLevels
open import Cubical.Foundations.Isomorphism
open import Cubical.Data.Nat
open import Cubical.Data.NatPlusOne.MoreNats.AssocNat.Base
open import Cubical.Data.NatPlusOne renaming (ℕ₊₁ to Nat; one to one'; _+₁_ to _+₁'_)
Nat→ℕ₊₁ : Nat → ℕ₊₁
Nat→ℕ₊₁ one' = 1
Nat→ℕ₊₁ (2+ n) = 1 +₁ Nat→ℕ₊₁ (1+ n)
ℕ₊₁→Nat : ℕ₊₁ → Nat
ℕ₊₁→Nat one = 1
ℕ₊₁→Nat (a +₁ b) = ℕ₊₁→Nat a +₁' ℕ₊₁→Nat b
ℕ₊₁→Nat (assoc a b c i) = +₁-assoc (ℕ₊₁→Nat a) (ℕ₊₁→Nat b) (ℕ₊₁→Nat c) i
ℕ₊₁→Nat (trunc m n p q i j) =
1+ (isSetℕ _ _ (λ k → -1+ (ℕ₊₁→Nat (p k))) (λ k → -1+ (ℕ₊₁→Nat (q k))) i j)
ℕ₊₁→Nat→ℕ₊₁ : ∀ n → ℕ₊₁→Nat (Nat→ℕ₊₁ n) ≡ n
ℕ₊₁→Nat→ℕ₊₁ one' = refl
ℕ₊₁→Nat→ℕ₊₁ (2+ n) = cong (1+_ ∘ suc ∘ -1+_) (ℕ₊₁→Nat→ℕ₊₁ (1+ n))
private
Nat→ℕ₊₁-+ : ∀ a b → Nat→ℕ₊₁ (a +₁' b) ≡ Nat→ℕ₊₁ a +₁ Nat→ℕ₊₁ b
Nat→ℕ₊₁-+ one' b = refl
Nat→ℕ₊₁-+ (2+ a) b = cong (one +₁_) (Nat→ℕ₊₁-+ (1+ a) b)
∙ assoc one (Nat→ℕ₊₁ (1+ a)) (Nat→ℕ₊₁ b)
Nat→ℕ₊₁→Nat : ∀ n → Nat→ℕ₊₁ (ℕ₊₁→Nat n) ≡ n
Nat→ℕ₊₁→Nat = ElimProp.f (trunc _ _) (λ i → one)
λ {a} {b} m n → Nat→ℕ₊₁-+ (ℕ₊₁→Nat a) (ℕ₊₁→Nat b) ∙ (λ i → m i +₁ n i)
ℕ₊₁≡Nat : ℕ₊₁ ≡ Nat
ℕ₊₁≡Nat = isoToPath (iso ℕ₊₁→Nat Nat→ℕ₊₁ ℕ₊₁→Nat→ℕ₊₁ Nat→ℕ₊₁→Nat)
|
extra/ArkosTrackerPlayer_CPC_MSX.asm | sikorama/still_scrolling | 0 | 14117 | <reponame>sikorama/still_scrolling
OPTIM_SIKO EQU 1
list
;*** Start of Arkos Tracker Player
nolist
;org #1000
; Arkos Tracker Player V1.01 - CPC & MSX version.
; 21/09/09
; Code By Targhan/Arkos.
; PSG registers sendings based on Madram/Overlander's optimisation trick.
; Restoring interruption status snippet by Grim/Arkos.
; V1.01 additions
; ---------------
; - Small (but not useless !) optimisations by Grim/Arkos at the PLY_Track1_WaitCounter / PLY_Track2_WaitCounter / PLY_Track3_WaitCounter labels.
; - Optimisation of the R13 management by Grim/Arkos.
; This player can adapt to the following machines =
; Amstrad CPC and MSX.
; Output codes are specific, as well as the frequency tables.
; This player modifies all these registers = HL, DE, BC, AF, HL', DE', BC', AF', IX, IY.
; The Stack is used in conventionnal manners (Call, Ret, Push, Pop) so integration with any of your code should be seamless.
; The player does NOT modifies the Interruption state, unless you use the PLY_SystemFriendly flag, which will cut the
; interruptions at the beginning, and will restore them ONLY IF NEEDED.
; Basically, there are three kind of players.
; ASM
; ---
; Used in your Asm productions. You call the Player by yourself, you don't care if all the registers are modified.
; Set PLY_SystemFriendly and PLY_UseFirmwareInterruptions to 0.
; In Assembler =
; ld de,MusicAddress
; call Player / PLY_Init to initialise the player with your song.
; then
; call Player + 3 / PLY_Play whenever you want to play/continue the song.
; call Player + 6 / PLY_Stop to stop the song.
; BASIC
; -----
; Used in Basic (on CPC), or under the helm of any OS. Interruptions will be cut by the player, but restored ONLY IF NECESSARY.
; Also, some registers are saved (AF', BC', IX and IY), as they are used by the CPC Firmware.
; If you need to add/remove more registers, take care to do it at PLY_Play, but also at PLY_Stop.
; Registers are restored at PLY_PSGREG13_RecoverSystemRegisters.
; Set PLY_SystemFriendly to 1 and PLY_UseFirmwareInterruptions to 0.
; The Calls in Assembler are the same as above.
; In Basic =
; call Player, MusicAddress to initialise the player with your song.
; then
; call Player + 3 whenever you want to play/continue the song.
; call Player + 6 to stop the song.
; INTERRUPTIONS
; -------------
; CPC Only ! Uses the Firmware Interruptions to put the Player on interruption. Very useful in Basic.
; Set PLY_SystemFriendly and PLY_UseFirmwareInterruptions to 1.
; In Assembler =
; ld de,MusicAddress
; call Player / PLY_InterruptionOn to play the song from start.
; call Player + 3 / PLY_InterruptionOff to stop the song.
; call Player + 6 / PLY_InterruptionContinue to continue the song once it's been stopped.
; In Basic=
; call Player, MusicAddress to play the song from start.
; call Player + 3 to stop the song.
; call Player + 6 to continue the song once it's been stopped.
; FADES IN/OUT
; ------------
; The player allows the volume to be modified. It provides the interface, but you'll have to set the volume by yourself.
; Set PLY_UseFades to 1.
; In Assembler =
; ld e,Volume (0=full volume, 16 or more=no volume)
; call PLY_SetFadeValue
; In Basic =
; call Player + 9 (or + 18, see just below), Volume (0=full volume, 16 or more=no volume)
; WARNING ! You must call Player + 18 if PLY_UseBasicSoundEffectInterface is set to 1.
; SOUND EFFECTS
; -------------
; The player manages Sound Effects. They must be defined in another song, generated as a "SFX Music" in the Arkos Tracker.
; Set the PLY_UseSoundEffects to 1. If you want to use sound effects in Basic, set PLY_UseBasicSoundEffectInterface to 1.
; In Assembler =
; ld de,SFXMusicAddress
; call PLY_SFX_Init to initialise the SFX Song.
; Then initialise and play the "music" song normally.
; To play a sound effect =
; A = No Channel (0,1,2)
; L = SFX Number (>0)
; H = Volume (0...F)
; E = Note (0...143)
; D = Speed (0 = As original, 1...255 = new Speed (1 is the fastest))
; BC = Inverted Pitch (-#FFFF -> FFFF). 0 is no pitch. The higher the pitch, the lower the sound.
; call PLY_SFX_Play
; To stop a sound effect =
; ld e,No Channel (0,1,2)
; call PLY_SFX_Stop
; To stop the sound effects on all the channels =
; call PLY_SFX_StopAll
; In Basic =
; call Player + 9, SFXMusicAddress to initialise the SFX Song.
; To play a sound effect =
; call Player + 12, No Channel, SFX Number, Volume, Note, Speed, Inverted Pitch. No parameter should be ommited !
; To stop a sound effect =
; call Player + 15, No Channel (0,1,2)
; For more information, check the manual.
; Any question, complaint, a need to reward ? Write to <EMAIL>
PLY_UseCPCMachine equ 1 ;Indicates what frequency table and output code to use. 1 to use it.
PLY_UseMSXMachine equ 0
PLY_UseSoundEffects equ 0 ;Set to 1 if you want to use Sound Effects in your player. Both CPU and memory consuming.
PLY_UseFades equ 0 ;Set to 1 to allow fades in/out. A little CPU and memory consuming.
;PLY_SetFadeValue becomes available.
PLY_SystemFriendly equ 0 ;Set to 1 if you want to save the Registers used by AMSDOS (AF', BC', IX, IY)
;(which allows you to call this player in BASIC)
;As this option is system-friendly, it cuts the interruption, and restore them ONLY IF NECESSARY.
PLY_UseFirmwareInterruptions equ 0 ;Set to 1 to use a Player under interruption. Only works on CPC, as it uses the CPC Firmware.
;WARNING, PLY_SystemFriendly must be set to 1 if you use the Player under interruption !
;SECOND WARNING, make sure the player is above #3fff, else it won't be played (system limitation).
PLY_UseBasicSoundEffectInterface equ 0 ;Set to 1 if you want a little interface to be added if you are a BASIC programmer who wants
;to use sound effects. Of course, you must also set PLY_UseSoundEffects to 1.
PLY_RetrigValue equ #fe ;Value used to trigger the Retrig of Register 13. #FE corresponds to CP xx. Do not change it !
Player
if PLY_UseFirmwareInterruptions
;******* Interruption Player ********
;You can remove these JPs if using the sub-routines directly.
jp PLY_InterruptionOn ;Call Player = Start Music.
jp PLY_InterruptionOff ;Call Player + 3 = Stop Music.
jp PLY_InterruptionContinue ;Call Player + 6 = Continue (after stopping).
if PLY_UseBasicSoundEffectInterface
jp PLY_SFX_Init ;Call Player + 9 to initialise the sound effect music.
jp PLY_BasicSoundEffectInterface_PlaySound ;Call Player + 12 to add sound effect in BASIC.
jp PLY_SFX_Stop ;Call Player + 15 to stop a sound effect.
endif
if PLY_UseFades
jp PLY_SetFadeValue ;Call Player + 9 or + 18 to set Fades values.
endif
PLY_InterruptionOn call PLY_Init
ld hl,PLY_Interruption_Convert
PLY_ReplayFrequency ld de,0
ld a,d
ld (PLY_Interruption_Cpt + 1),a
add hl,de
ld a,(hl) ;Chope nbinter wait
ld (PLY_Interruption_Value + 1),a
PLY_InterruptionContinue
ld hl,PLY_Interruption_ControlBloc
ld bc,%10000001*256+0
ld de,PLY_Interruption_Play
jp #bce0
PLY_InterruptionOff ld hl,PLY_Interruption_ControlBloc
call #bce6
jp PLY_Stop
PLY_Interruption_ControlBloc defs 10,0 ;Buffer used by the OS.
;Code run by the OS on each interruption.
PLY_Interruption_Play di
PLY_Interruption_Cpt ld a,0 ;Run the player only if it has to, according to the music frequency.
PLY_Interruption_Value cp 5
jr z,PLY_Interruption_NoWait
inc a
ld (PLY_Interruption_Cpt + 1),a
ret
PLY_Interruption_NoWait xor a
ld (PLY_Interruption_Cpt + 1),a
jp PLY_Play
;Table to convert PLY_ReplayFrequency into a Frequency value for the AMSDOS.
PLY_Interruption_Convert defb 17, 11, 5, 2, 1, 0
else
;***** Normal Player *****
;To be called when you want.
;You can remove these following JPs if using the sub-routines directly.
jp PLY_Init ;Call Player = Initialise song (DE = Song address).
jp PLY_Play ;Call Player + 3 = Play song.
jp PLY_Stop ;Call Player + 6 = Stop song.
endif
if PLY_UseBasicSoundEffectInterface
jp PLY_SFX_Init ;Call Player + 9 to initialise the sound effect music.
jp PLY_BasicSoundEffectInterface_PlaySound ;Call Player + 12 to add sound effect in BASIC.
jp PLY_SFX_Stop ;Call Player + 15 to stop a sound effect.
endif
if PLY_UseFades
jp PLY_SetFadeValue ;Call Player + 9 or + 18 to set Fades values.
endif
PLY_Digidrum db 0 ;Read here to know if a Digidrum has been played (0=no).
PLY_Play
if PLY_SystemFriendly
call PLY_DisableInterruptions
ex af,af'
exx
push af
push bc
push ix
push iy
endif
xor a
ld (PLY_Digidrum),a ;Reset the Digidrum flag.
;Manage Speed. If Speed counter is over, we have to read the Pattern further.
PLY_SpeedCpt ld a,1
dec a
jp nz,PLY_SpeedEnd
;Moving forward in the Pattern. Test if it is not over.
PLY_HeightCpt ld a,1
dec a
jr nz,PLY_HeightEnd
;Pattern Over. We have to read the Linker.
;Get the Transpositions, if they have changed, or detect the Song Ending !
PLY_Linker_PT ld hl,0
ld a,(hl)
inc hl
rra
jr nc,PLY_SongNotOver
;Song over ! We read the address of the Loop point.
ld a,(hl)
inc hl
ld h,(hl)
ld l,a
ld a,(hl) ;We know the Song won't restart now, so we can skip the first bit.
inc hl
rra
PLY_SongNotOver
rra
jr nc,PLY_NoNewTransposition1
ld de,PLY_Transposition1 + 1
ldi
PLY_NoNewTransposition1
rra
jr nc,PLY_NoNewTransposition2
ld de,PLY_Transposition2 + 1
ldi
PLY_NoNewTransposition2
rra
jr nc,PLY_NoNewTransposition3
ld de,PLY_Transposition3 + 1
ldi
PLY_NoNewTransposition3
;Get the Tracks addresses.
ld de,PLY_Track1_PT + 1
ldi
ldi
ld de,PLY_Track2_PT + 1
ldi
ldi
ld de,PLY_Track3_PT + 1
ldi
ldi
;Get the Special Track address, if it has changed.
rra
jr nc,PLY_NoNewHeight
ld de,PLY_Height + 1
ldi
PLY_NoNewHeight
rra
jr nc,PLY_NoNewSpecialTrack
PLY_NewSpecialTrack
ld e,(hl)
inc hl
ld d,(hl)
inc hl
ld (PLY_SaveSpecialTrack + 1),de
PLY_NoNewSpecialTrack
ld (PLY_Linker_PT + 1),hl
PLY_SaveSpecialTrack ld hl,0
ld (PLY_SpecialTrack_PT + 1),hl
;Reset the SpecialTrack/Tracks line counter.
;We can't rely on the song data, because the Pattern Height is not related to the Tracks Height.
ld a,1
ld (PLY_SpecialTrack_WaitCounter + 1),a
ld (PLY_Track1_WaitCounter + 1),a
ld (PLY_Track2_WaitCounter + 1),a
ld (PLY_Track3_WaitCounter + 1),a
PLY_Height ld a,1
PLY_HeightEnd
ld (PLY_HeightCpt + 1),a
;Read the Special Track/Tracks.
;------------------------------
;Read the Special Track.
PLY_SpecialTrack_WaitCounter ld a,1
dec a
jr nz,PLY_SpecialTrack_Wait
PLY_SpecialTrack_PT ld hl,0
ld a,(hl)
inc hl
srl a ;Data (1) or Wait (0) ?
jr nc,PLY_SpecialTrack_NewWait ;If Wait, A contains the Wait value.
if OPTIM_SIKO==0
;Data. Effect Type ?
srl a ;Speed (0) or Digidrum (1) ?
;First, we don't test the Effect Type, but only the Escape Code (=0)
jr nz,PLY_SpecialTrack_NoEscapeCode
ld a,(hl)
inc hl
PLY_SpecialTrack_NoEscapeCode
;Now, we test the Effect type, since the Carry didn't change.
jr nc,PLY_SpecialTrack_Speed
ld (PLY_Digidrum),a
jr PLY_PT_SpecialTrack_EndData
endif
PLY_SpecialTrack_Speed
ld (PLY_Speed + 1),a
PLY_PT_SpecialTrack_EndData
ld a,1
PLY_SpecialTrack_NewWait
ld (PLY_SpecialTrack_PT + 1),hl
PLY_SpecialTrack_Wait
ld (PLY_SpecialTrack_WaitCounter + 1),a
;Read the Track 1.
;-----------------
;Store the parameters, because the player below is called every frame, but the Read Track isn't.
PLY_Track1_WaitCounter ld a,1
dec a
jr nz,PLY_Track1_NewInstrument_SetWait
PLY_Track1_PT ld hl,0
call PLY_ReadTrack
ld (PLY_Track1_PT + 1),hl
jr c,PLY_Track1_NewInstrument_SetWait
;No Wait command. Can be a Note and/or Effects.
ld a,d ;Make a copy of the flags+Volume in A, not to temper with the original.
rra ;Volume ? If bit 4 was 1, then volume exists on b3-b0
jr nc,PLY_Track1_SameVolume
and %1111
ld (PLY_Track1_Volume),a
PLY_Track1_SameVolume
rl d ;New Pitch ?
jr nc,PLY_Track1_NoNewPitch
ld (PLY_Track1_PitchAdd + 1),ix
PLY_Track1_NoNewPitch
rl d ;Note ? If no Note, we don't have to test if a new Instrument is here.
jr nc,PLY_Track1_NoNoteGiven
ld a,e
PLY_Transposition1 add a,0 ;Transpose Note according to the Transposition in the Linker.
ld (PLY_Track1_Note),a
ld hl,0 ;Reset the TrackPitch.
ld (PLY_Track1_Pitch + 1),hl
rl d ;New Instrument ?
jr c,PLY_Track1_NewInstrument
PLY_Track1_SavePTInstrument ld hl,0 ;Same Instrument. We recover its address to restart it.
ld a,(PLY_Track1_InstrumentSpeed + 1) ;Reset the Instrument Speed Counter. Never seemed useful...
ld (PLY_Track1_InstrumentSpeedCpt + 1),a
jr PLY_Track1_InstrumentResetPT
PLY_Track1_NewInstrument ;New Instrument. We have to get its new address, and Speed.
ld l,b ;H is already set to 0 before.
add hl,hl
PLY_Track1_InstrumentsTablePT ld bc,0
add hl,bc
ld a,(hl) ;Get Instrument address.
inc hl
ld h,(hl)
ld l,a
ld a,(hl) ;Get Instrument speed.
inc hl
ld (PLY_Track1_InstrumentSpeed + 1),a
ld (PLY_Track1_InstrumentSpeedCpt + 1),a
ld a,(hl)
or a ;Get IsRetrig?. Code it only if different to 0, else next Instruments are going to overwrite it.
jr z,$+5
ld (PLY_PSGReg13_Retrig + 1),a
inc hl
ld (PLY_Track1_SavePTInstrument + 1),hl ;When using the Instrument again, no need to give the Speed, it is skipped.
PLY_Track1_InstrumentResetPT
ld (PLY_Track1_Instrument + 1),hl
PLY_Track1_NoNoteGiven
ld a,1
PLY_Track1_NewInstrument_SetWait
ld (PLY_Track1_WaitCounter + 1),a
;Read the Track 2.
;-----------------
;Store the parameters, because the player below is called every frame, but the Read Track isn't.
PLY_Track2_WaitCounter ld a,1
dec a
jr nz,PLY_Track2_NewInstrument_SetWait
PLY_Track2_PT ld hl,0
call PLY_ReadTrack
ld (PLY_Track2_PT + 1),hl
jr c,PLY_Track2_NewInstrument_SetWait
;No Wait command. Can be a Note and/or Effects.
ld a,d ;Make a copy of the flags+Volume in A, not to temper with the original.
rra ;Volume ? If bit 4 was 1, then volume exists on b3-b0
jr nc,PLY_Track2_SameVolume
and %1111
ld (PLY_Track2_Volume),a
PLY_Track2_SameVolume
rl d ;New Pitch ?
jr nc,PLY_Track2_NoNewPitch
ld (PLY_Track2_PitchAdd + 1),ix
PLY_Track2_NoNewPitch
rl d ;Note ? If no Note, we don't have to test if a new Instrument is here.
jr nc,PLY_Track2_NoNoteGiven
ld a,e
PLY_Transposition2 add a,0 ;Transpose Note according to the Transposition in the Linker.
ld (PLY_Track2_Note),a
ld hl,0 ;Reset the TrackPitch.
ld (PLY_Track2_Pitch + 1),hl
rl d ;New Instrument ?
jr c,PLY_Track2_NewInstrument
PLY_Track2_SavePTInstrument ld hl,0 ;Same Instrument. We recover its address to restart it.
ld a,(PLY_Track2_InstrumentSpeed + 1) ;Reset the Instrument Speed Counter. Never seemed useful...
ld (PLY_Track2_InstrumentSpeedCpt + 1),a
jr PLY_Track2_InstrumentResetPT
PLY_Track2_NewInstrument ;New Instrument. We have to get its new address, and Speed.
ld l,b ;H is already set to 0 before.
add hl,hl
PLY_Track2_InstrumentsTablePT ld bc,0
add hl,bc
ld a,(hl) ;Get Instrument address.
inc hl
ld h,(hl)
ld l,a
ld a,(hl) ;Get Instrument speed.
inc hl
ld (PLY_Track2_InstrumentSpeed + 1),a
ld (PLY_Track2_InstrumentSpeedCpt + 1),a
ld a,(hl)
or a ;Get IsRetrig?. Code it only if different to 0, else next Instruments are going to overwrite it.
jr z,$+5
ld (PLY_PSGReg13_Retrig + 1),a
inc hl
ld (PLY_Track2_SavePTInstrument + 1),hl ;When using the Instrument again, no need to give the Speed, it is skipped.
PLY_Track2_InstrumentResetPT
ld (PLY_Track2_Instrument + 1),hl
PLY_Track2_NoNoteGiven
ld a,1
PLY_Track2_NewInstrument_SetWait
ld (PLY_Track2_WaitCounter + 1),a
;Read the Track 3.
;-----------------
;Store the parameters, because the player below is called every frame, but the Read Track isn't.
PLY_Track3_WaitCounter ld a,1
dec a
jr nz,PLY_Track3_NewInstrument_SetWait
PLY_Track3_PT ld hl,0
call PLY_ReadTrack
ld (PLY_Track3_PT + 1),hl
jr c,PLY_Track3_NewInstrument_SetWait
;No Wait command. Can be a Note and/or Effects.
ld a,d ;Make a copy of the flags+Volume in A, not to temper with the original.
rra ;Volume ? If bit 4 was 1, then volume exists on b3-b0
jr nc,PLY_Track3_SameVolume
and %1111
ld (PLY_Track3_Volume),a
PLY_Track3_SameVolume
rl d ;New Pitch ?
jr nc,PLY_Track3_NoNewPitch
ld (PLY_Track3_PitchAdd + 1),ix
PLY_Track3_NoNewPitch
rl d ;Note ? If no Note, we don't have to test if a new Instrument is here.
jr nc,PLY_Track3_NoNoteGiven
ld a,e
PLY_Transposition3 add a,0 ;Transpose Note according to the Transposition in the Linker.
ld (PLY_Track3_Note),a
ld hl,0 ;Reset the TrackPitch.
ld (PLY_Track3_Pitch + 1),hl
rl d ;New Instrument ?
jr c,PLY_Track3_NewInstrument
PLY_Track3_SavePTInstrument ld hl,0 ;Same Instrument. We recover its address to restart it.
ld a,(PLY_Track3_InstrumentSpeed + 1) ;Reset the Instrument Speed Counter. Never seemed useful...
ld (PLY_Track3_InstrumentSpeedCpt + 1),a
jr PLY_Track3_InstrumentResetPT
PLY_Track3_NewInstrument ;New Instrument. We have to get its new address, and Speed.
ld l,b ;H is already set to 0 before.
add hl,hl
PLY_Track3_InstrumentsTablePT ld bc,0
add hl,bc
ld a,(hl) ;Get Instrument address.
inc hl
ld h,(hl)
ld l,a
ld a,(hl) ;Get Instrument speed.
inc hl
ld (PLY_Track3_InstrumentSpeed + 1),a
ld (PLY_Track3_InstrumentSpeedCpt + 1),a
ld a,(hl)
or a ;Get IsRetrig?. Code it only if different to 0, else next Instruments are going to overwrite it.
jr z,$+5
ld (PLY_PSGReg13_Retrig + 1),a
inc hl
ld (PLY_Track3_SavePTInstrument + 1),hl ;When using the Instrument again, no need to give the Speed, it is skipped.
PLY_Track3_InstrumentResetPT
ld (PLY_Track3_Instrument + 1),hl
PLY_Track3_NoNoteGiven
ld a,1
PLY_Track3_NewInstrument_SetWait
ld (PLY_Track3_WaitCounter + 1),a
PLY_Speed ld a,1
PLY_SpeedEnd
ld (PLY_SpeedCpt + 1),a
;Play the Sound on Track 3
;-------------------------
;Plays the sound on each frame, but only save the forwarded Instrument pointer when Instrument Speed is reached.
;This is needed because TrackPitch is involved in the Software Frequency/Hardware Frequency calculation, and is calculated every frame.
ld iy,PLY_PSGRegistersArray + 4
PLY_Track3_Pitch ld hl,0
PLY_Track3_PitchAdd ld de,0
add hl,de
ld (PLY_Track3_Pitch + 1),hl
sra h ;Shift the Pitch to slow its speed.
rr l
sra h
rr l
ex de,hl
exx
PLY_Track3_Volume equ $+2
PLY_Track3_Note equ $+1
ld de,0 ;D=Inverted Volume E=Note
PLY_Track3_Instrument ld hl,0
call PLY_PlaySound
PLY_Track3_InstrumentSpeedCpt ld a,1
dec a
jr nz,PLY_Track3_PlayNoForward
ld (PLY_Track3_Instrument + 1),hl
PLY_Track3_InstrumentSpeed ld a,6
PLY_Track3_PlayNoForward
ld (PLY_Track3_InstrumentSpeedCpt + 1),a
;***************************************
;Play Sound Effects on Track 3 (only assembled used if PLY_UseSoundEffects is set to one)
;***************************************
if PLY_UseSoundEffects
PLY_SFX_Track3_Pitch ld de,0
exx
PLY_SFX_Track3_Volume equ $+2
PLY_SFX_Track3_Note equ $+1
ld de,0 ;D=Inverted Volume E=Note
PLY_SFX_Track3_Instrument ld hl,0 ;If 0, no sound effect.
ld a,l
or h
jr z,PLY_SFX_Track3_End
ld a,1
ld (PLY_PS_EndSound_SFX + 1),a
call PLY_PlaySound
xor a
ld (PLY_PS_EndSound_SFX + 1),a
ld a,l ;If the new address is 0, the instrument is over. Speed is set in the process, we don't care.
or h
jr z,PLY_SFX_Track3_Instrument_SetAddress
PLY_SFX_Track3_InstrumentSpeedCpt ld a,1
dec a
jr nz,PLY_SFX_Track3_PlayNoForward
PLY_SFX_Track3_Instrument_SetAddress
ld (PLY_SFX_Track3_Instrument + 1),hl
PLY_SFX_Track3_InstrumentSpeed ld a,6
PLY_SFX_Track3_PlayNoForward
ld (PLY_SFX_Track3_InstrumentSpeedCpt + 1),a
PLY_SFX_Track3_End
endif
;******************************************
ld a,ixl ;Save the Register 7 of the Track 3.
ex af,af'
;Play the Sound on Track 2
;-------------------------
ld iy,PLY_PSGRegistersArray + 2
PLY_Track2_Pitch ld hl,0
PLY_Track2_PitchAdd ld de,0
add hl,de
ld (PLY_Track2_Pitch + 1),hl
sra h ;Shift the Pitch to slow its speed.
rr l
sra h
rr l
ex de,hl
exx
PLY_Track2_Volume equ $+2
PLY_Track2_Note equ $+1
ld de,0 ;D=Inverted Volume E=Note
PLY_Track2_Instrument ld hl,0
call PLY_PlaySound
PLY_Track2_InstrumentSpeedCpt ld a,1
dec a
jr nz,PLY_Track2_PlayNoForward
ld (PLY_Track2_Instrument + 1),hl
PLY_Track2_InstrumentSpeed ld a,6
PLY_Track2_PlayNoForward
ld (PLY_Track2_InstrumentSpeedCpt + 1),a
;***************************************
;Play Sound Effects on Track 2 (only assembled used if PLY_UseSoundEffects is set to one)
;***************************************
if PLY_UseSoundEffects
PLY_SFX_Track2_Pitch ld de,0
exx
PLY_SFX_Track2_Volume equ $+2
PLY_SFX_Track2_Note equ $+1
ld de,0 ;D=Inverted Volume E=Note
PLY_SFX_Track2_Instrument ld hl,0 ;If 0, no sound effect.
ld a,l
or h
jr z,PLY_SFX_Track2_End
ld a,1
ld (PLY_PS_EndSound_SFX + 1),a
call PLY_PlaySound
xor a
ld (PLY_PS_EndSound_SFX + 1),a
ld a,l ;If the new address is 0, the instrument is over. Speed is set in the process, we don't care.
or h
jr z,PLY_SFX_Track2_Instrument_SetAddress
PLY_SFX_Track2_InstrumentSpeedCpt ld a,1
dec a
jr nz,PLY_SFX_Track2_PlayNoForward
PLY_SFX_Track2_Instrument_SetAddress
ld (PLY_SFX_Track2_Instrument + 1),hl
PLY_SFX_Track2_InstrumentSpeed ld a,6
PLY_SFX_Track2_PlayNoForward
ld (PLY_SFX_Track2_InstrumentSpeedCpt + 1),a
PLY_SFX_Track2_End
endif
;******************************************
ex af,af'
add a,a ;Mix Reg7 from Track2 with Track3, making room first.
or ixl
rla
ex af,af'
;Play the Sound on Track 1
;-------------------------
ld iy,PLY_PSGRegistersArray
PLY_Track1_Pitch ld hl,0
PLY_Track1_PitchAdd ld de,0
add hl,de
ld (PLY_Track1_Pitch + 1),hl
sra h ;Shift the Pitch to slow its speed.
rr l
sra h
rr l
ex de,hl
exx
PLY_Track1_Volume equ $+2
PLY_Track1_Note equ $+1
ld de,0 ;D=Inverted Volume E=Note
PLY_Track1_Instrument ld hl,0
call PLY_PlaySound
PLY_Track1_InstrumentSpeedCpt ld a,1
dec a
jr nz,PLY_Track1_PlayNoForward
ld (PLY_Track1_Instrument + 1),hl
PLY_Track1_InstrumentSpeed ld a,6
PLY_Track1_PlayNoForward
ld (PLY_Track1_InstrumentSpeedCpt + 1),a
;***************************************
;Play Sound Effects on Track 1 (only assembled used if PLY_UseSoundEffects is set to one)
;***************************************
if PLY_UseSoundEffects
PLY_SFX_Track1_Pitch ld de,0
exx
PLY_SFX_Track1_Volume equ $+2
PLY_SFX_Track1_Note equ $+1
ld de,0 ;D=Inverted Volume E=Note
PLY_SFX_Track1_Instrument ld hl,0 ;If 0, no sound effect.
ld a,l
or h
jr z,PLY_SFX_Track1_End
ld a,1
ld (PLY_PS_EndSound_SFX + 1),a
call PLY_PlaySound
xor a
ld (PLY_PS_EndSound_SFX + 1),a
ld a,l ;If the new address is 0, the instrument is over. Speed is set in the process, we don't care.
or h
jr z,PLY_SFX_Track1_Instrument_SetAddress
PLY_SFX_Track1_InstrumentSpeedCpt ld a,1
dec a
jr nz,PLY_SFX_Track1_PlayNoForward
PLY_SFX_Track1_Instrument_SetAddress
ld (PLY_SFX_Track1_Instrument + 1),hl
PLY_SFX_Track1_InstrumentSpeed ld a,6
PLY_SFX_Track1_PlayNoForward
ld (PLY_SFX_Track1_InstrumentSpeedCpt + 1),a
PLY_SFX_Track1_End
endif
;***********************************
ex af,af'
or ixl ;Mix Reg7 from Track3 with Track2+1.
;Send the registers to PSG. Various codes according to the machine used.
PLY_SendRegisters
;A=Register 7
if PLY_UseMSXMachine
ld b,a
ld hl,PLY_PSGRegistersArray
;Register 0
xor a
out (#a0),a
ld a,(hl)
out (#a1),a
inc hl
;Register 1
ld a,1
out (#a0),a
ld a,(hl)
out (#a1),a
inc hl
;Register 2
ld a,2
out (#a0),a
ld a,(hl)
out (#a1),a
inc hl
;Register 3
ld a,3
out (#a0),a
ld a,(hl)
out (#a1),a
inc hl
;Register 4
ld a,4
out (#a0),a
ld a,(hl)
out (#a1),a
inc hl
;Register 5
ld a,5
out (#a0),a
ld a,(hl)
out (#a1),a
inc hl
;Register 6
ld a,6
out (#a0),a
ld a,(hl)
out (#a1),a
inc hl
;Register 7
ld a,7
out (#a0),a
ld a,b ;Use the stored Register 7.
out (#a1),a
;Register 8
ld a,8
out (#a0),a
ld a,(hl)
if PLY_UseFades
PLY_Channel1_FadeValue sub 0 ;Set a value from 0 (full volume) to 16 or more (volume to 0).
jr nc,$+3
xor a
endif
out (#a1),a
inc hl
inc hl ;Skip unused byte.
;Register 9
ld a,9
out (#a0),a
ld a,(hl)
if PLY_UseFades
PLY_Channel2_FadeValue sub 0 ;Set a value from 0 (full volume) to 16 or more (volume to 0).
jr nc,$+3
xor a
endif
out (#a1),a
inc hl
inc hl ;Skip unused byte.
;Register 10
ld a,10
out (#a0),a
ld a,(hl)
if PLY_UseFades
PLY_Channel3_FadeValue sub 0 ;Set a value from 0 (full volume) to 16 or more (volume to 0).
jr nc,$+3
xor a
endif
out (#a1),a
inc hl
;Register 11
ld a,11
out (#a0),a
ld a,(hl)
out (#a1),a
inc hl
;Register 12
ld a,12
out (#a0),a
ld a,(hl)
out (#a1),a
inc hl
;Register 13
if PLY_SystemFriendly
call PLY_PSGReg13_Code
PLY_PSGREG13_RecoverSystemRegisters
pop iy
pop ix
pop bc
pop af
exx
ex af,af'
;Restore Interrupt status
PLY_RestoreInterruption nop ;Will be automodified to an DI/EI.
ret
endif
PLY_PSGReg13_Code
ld a,13
out (#a0),a
ld a,(hl)
PLY_PSGReg13_Retrig cp 255 ;If IsRetrig?, force the R13 to be triggered.
ret z
out (#a1),a
ld (PLY_PSGReg13_Retrig + 1),a
ret
endif
if PLY_UseCPCMachine
ld de,#c080
ld b,#f6
out (c),d ;#f6c0
exx
ld hl,PLY_PSGRegistersArray
ld e,#f6
ld bc,#f401
;Register 0
defb #ed,#71 ;#f400+Register
ld b,e
defb #ed,#71 ;#f600
dec b
outi ;#f400+value
exx
out (c),e ;#f680
out (c),d ;#f6c0
exx
;Register 1
out (c),c
ld b,e
defb #ed,#71
dec b
outi
exx
out (c),e
out (c),d
exx
inc c
;Register 2
out (c),c
ld b,e
defb #ed,#71
dec b
outi
exx
out (c),e
out (c),d
exx
inc c
;Register 3
out (c),c
ld b,e
defb #ed,#71
dec b
outi
exx
out (c),e
out (c),d
exx
inc c
;Register 4
out (c),c
ld b,e
defb #ed,#71
dec b
outi
exx
out (c),e
out (c),d
exx
inc c
;Register 5
out (c),c
ld b,e
defb #ed,#71
dec b
outi
exx
out (c),e
out (c),d
exx
inc c
;Register 6
out (c),c
ld b,e
defb #ed,#71
dec b
outi
exx
out (c),e
out (c),d
exx
inc c
;Register 7
out (c),c
ld b,e
defb #ed,#71
dec b
dec b
out (c),a ;Read A register instead of the list.
exx
out (c),e
out (c),d
exx
inc c
;Register 8
out (c),c
ld b,e
defb #ed,#71
dec b
if PLY_UseFades
dec b
ld a,(hl)
PLY_Channel1_FadeValue sub 0 ;Set a value from 0 (full volume) to 16 or more (volume to 0).
jr nc,$+6
defb #ed,#71
jr $+4
out (c),a
inc hl
else
outi
endif
exx
out (c),e
out (c),d
exx
inc c
inc hl ;Skip unused byte.
;Register 9
out (c),c
ld b,e
defb #ed,#71
dec b
if PLY_UseFades ;If PLY_UseFades is set to 1, we manage the volume fade.
dec b
ld a,(hl)
PLY_Channel2_FadeValue sub 0 ;Set a value from 0 (full volume) to 16 or more (volume to 0).
jr nc,$+6
defb #ed,#71
jr $+4
out (c),a
inc hl
else
outi
endif
exx
out (c),e
out (c),d
exx
inc c
inc hl ;Skip unused byte.
;Register 10
out (c),c
ld b,e
defb #ed,#71
dec b
if PLY_UseFades
dec b
ld a,(hl)
PLY_Channel3_FadeValue sub 0 ;Set a value from 0 (full volume) to 16 or more (volume to 0).
jr nc,$+6
defb #ed,#71
jr $+4
out (c),a
inc hl
else
outi
endif
exx
out (c),e
out (c),d
exx
inc c
;Register 11
out (c),c
ld b,e
defb #ed,#71
dec b
outi
exx
out (c),e
out (c),d
exx
inc c
;Register 12
out (c),c
ld b,e
defb #ed,#71
dec b
outi
exx
out (c),e
out (c),d
exx
inc c
;Register 13
if PLY_SystemFriendly
call PLY_PSGReg13_Code
PLY_PSGREG13_RecoverSystemRegisters
pop iy
pop ix
pop bc
pop af
exx
ex af,af'
;Restore Interrupt status
PLY_RestoreInterruption nop ;Will be automodified to an DI/EI.
ret
endif
PLY_PSGReg13_Code
ld a,(hl)
PLY_PSGReg13_Retrig cp 255 ;If IsRetrig?, force the R13 to be triggered.
ret z
ld (PLY_PSGReg13_Retrig + 1),a
out (c),c
ld b,e
defb #ed,#71
dec b
outi
exx
out (c),e
out (c),d
ret
endif
;There are two holes in the list, because the Volume registers are set relatively to the Frequency of the same Channel (+7, always).
;Also, the Reg7 is passed as a register, so is not kept in the memory.
PLY_PSGRegistersArray
PLY_PSGReg0 db 0
PLY_PSGReg1 db 0
PLY_PSGReg2 db 0
PLY_PSGReg3 db 0
PLY_PSGReg4 db 0
PLY_PSGReg5 db 0
PLY_PSGReg6 db 0
PLY_PSGReg8 db 0 ;+7
db 0
PLY_PSGReg9 db 0 ;+9
db 0
PLY_PSGReg10 db 0 ;+11
PLY_PSGReg11 db 0
PLY_PSGReg12 db 0
PLY_PSGReg13 db 0
PLY_PSGRegistersArray_End
;Plays a sound stream.
;HL=Pointer on Instrument Data
;IY=Pointer on Register code (volume, frequency).
;E=Note
;D=Inverted Volume
;DE'=TrackPitch
;RET=
;HL=New Instrument pointer.
;IXL=Reg7 mask (x00x)
;Also used inside =
;B,C=read byte/second byte.
;IXH=Save original Note (only used for Independant mode).
PLY_PlaySound
ld b,(hl)
inc hl
rr b
jp c,PLY_PS_Hard
;**************
;Software Sound
;**************
;Second Byte needed ?
rr b
jr c,PLY_PS_S_SecondByteNeeded
;No second byte needed. We need to check if Volume is null or not.
ld a,b
and %1111
jr nz,PLY_PS_S_SoundOn
;Null Volume. It means no Sound. We stop the Sound, the Noise, and it's over.
ld (iy + 7),a ;We have to make the volume to 0, because if a bass Hard was activated before, we have to stop it.
ld ixl,%1001
ret
PLY_PS_S_SoundOn
;Volume is here, no Second Byte needed. It means we have a simple Software sound (Sound = On, Noise = Off)
;We have to test Arpeggio and Pitch, however.
ld ixl,%1000
sub d ;Code Volume.
jr nc,$+3
xor a
ld (iy + 7),a
rr b ;Needed for the subroutine to get the good flags.
call PLY_PS_CalculateFrequency
ld (iy + 0),l ;Code Frequency.
ld (iy + 1),h
exx
ret
PLY_PS_S_SecondByteNeeded
ld ixl,%1000 ;By defaut, No Noise, Sound.
;Second Byte needed.
ld c,(hl)
inc hl
;Noise ?
ld a,c
and %11111
jr z,PLY_PS_S_SBN_NoNoise
ld (PLY_PSGReg6),a
ld ixl,%0000 ;Open Noise Channel.
PLY_PS_S_SBN_NoNoise
;Here we have either Volume and/or Sound. So first we need to read the Volume.
ld a,b
and %1111
sub d ;Code Volume.
jr nc,$+3
xor a
ld (iy + 7),a
;Sound ?
bit 5,c
jr nz,PLY_PS_S_SBN_Sound
;No Sound. Stop here.
inc ixl ;Set Sound bit to stop the Sound.
ret
PLY_PS_S_SBN_Sound
;Manual Frequency ?
rr b ;Needed for the subroutine to get the good flags.
bit 6,c
call PLY_PS_CalculateFrequency_TestManualFrequency
ld (iy + 0),l ;Code Frequency.
ld (iy + 1),h
exx
ret
;**********
;Hard Sound
;**********
PLY_PS_Hard
;We don't set the Volume to 16 now because we may have reached the end of the sound !
rr b ;Test Retrig here, it is common to every Hard sounds.
jr nc,PLY_PS_Hard_NoRetrig
ld a,(PLY_Track1_InstrumentSpeedCpt + 1) ;Retrig only if it is the first step in this line of Instrument !
ld c,a
ld a,(PLY_Track1_InstrumentSpeed + 1)
cp c
jr nz,PLY_PS_Hard_NoRetrig
ld a,PLY_RetrigValue
ld (PLY_PSGReg13_Retrig + 1),a
PLY_PS_Hard_NoRetrig
;Independant/Loop or Software/Hardware Dependent ?
bit 1,b ;We don't shift the bits, so that we can use the same code (Frequency calculation) several times.
jp nz,PLY_PS_Hard_LoopOrIndependent
;Hardware Sound.
ld (iy + 7),16 ;Set Volume
ld ixl,%1000 ;Sound is always On here (only Independence mode can switch it off).
;This code is common to both Software and Hardware Dependent.
ld c,(hl) ;Get Second Byte.
inc hl
ld a,c ;Get the Hardware Envelope waveform.
and %1111 ;We don't care about the bit 7-4, but we have to clear them, else the waveform might be reset.
ld (PLY_PSGReg13),a
if OPTIM_SIKO==0
bit 0,b
jr z,PLY_PS_HardwareDependent
endif
;******************
;Software Dependent
;******************
;Calculate the Software frequency
bit 4-2,b ;Manual Frequency ? -2 Because the byte has been shifted previously.
call PLY_PS_CalculateFrequency_TestManualFrequency
ld (iy + 0),l ;Code Software Frequency.
ld (iy + 1),h
exx
;Shift the Frequency.
ld a,c
rra
rra ;Shift=Shift*4. The shift is inverted in memory (7 - Editor Shift).
and %11100
ld (PLY_PS_SD_Shift + 1),a
ld a,b ;Used to get the HardwarePitch flag within the second registers set.
exx
PLY_PS_SD_Shift jr $+2
srl h
rr l
srl h
rr l
srl h
rr l
srl h
rr l
srl h
rr l
srl h
rr l
srl h
rr l
jr nc,$+3
inc hl
;Hardware Pitch ?
bit 7-2,a
jr z,PLY_PS_SD_NoHardwarePitch
if OPTIM_SIKO==0
exx ;Get Pitch and add it to the just calculated Hardware Frequency.
ld a,(hl)
inc hl
exx
add a,l ;Slow. Can be optimised ? Probably never used anyway.....
ld l,a
exx
ld a,(hl)
inc hl
exx
adc a,h
ld h,a
endif
PLY_PS_SD_NoHardwarePitch
ld (PLY_PSGReg11),hl
exx
;This code is also used by Hardware Dependent.
PLY_PS_SD_Noise
;Noise ?
if OPTIM_SIKO==0
bit 7,c
ret z
ld a,(hl)
inc hl
ld (PLY_PSGReg6),a
ld ixl,%0000
endif
ret
if OPTIM_SIKO==0
;******************
;Hardware Dependent
;******************
PLY_PS_HardwareDependent
;Calculate the Hardware frequency
bit 4-2,b ;Manual Hardware Frequency ? -2 Because the byte has been shifted previously.
call PLY_PS_CalculateFrequency_TestManualFrequency
ld (PLY_PSGReg11),hl ;Code Hardware Frequency.
exx
;Shift the Hardware Frequency.
ld a,c
rra
rra ;Shift=Shift*4. The shift is inverted in memory (7 - Editor Shift).
and %11100
ld (PLY_PS_HD_Shift + 1),a
ld a,b ;Used to get the Software flag within the second registers set.
exx
PLY_PS_HD_Shift jr $+2
sla l
rl h
sla l
rl h
sla l
rl h
sla l
rl h
sla l
rl h
sla l
rl h
sla l
rl h
;Software Pitch ?
bit 7-2,a
jr z,PLY_PS_HD_NoSoftwarePitch
exx ;Get Pitch and add it to the just calculated Software Frequency.
ld a,(hl)
inc hl
exx
add a,l
ld l,a ;Slow. Can be optimised ? Probably never used anyway.....
exx
ld a,(hl)
inc hl
exx
adc a,h
ld h,a
PLY_PS_HD_NoSoftwarePitch
ld (iy + 0),l ;Code Frequency.
ld (iy + 1),h
exx
;Go to manage Noise, common to Software Dependent.
jr PLY_PS_SD_Noise
endif
PLY_PS_Hard_LoopOrIndependent
bit 0,b ;We mustn't shift it to get the result in the Carry, as it would be mess the structure
jr z,PLY_PS_Independent ;of the flags, making it uncompatible with the common code.
;The sound has ended.
;If Sound Effects activated, we mark the "end of sound" by returning a 0 as an address.
if PLY_UseSoundEffects
PLY_PS_EndSound_SFX ld a,0 ;Is the sound played is a SFX (1) or a normal sound (0) ?
or a
jr z,PLY_PS_EndSound_NotASFX
ld hl,0
ret
PLY_PS_EndSound_NotASFX
endif
;The sound has ended. Read the new pointer and restart instrument.
ld a,(hl)
inc hl
ld h,(hl)
ld l,a
jp PLY_PlaySound
;***********
;Independent
;***********
PLY_PS_Independent
ld (iy + 7),16 ;Set Volume
;Sound ?
bit 7-2,b ;-2 Because the byte has been shifted previously.
jr nz,PLY_PS_I_SoundOn
;No Sound ! It means we don't care about the software frequency (manual frequency, arpeggio, pitch).
ld ixl,%1001
jr PLY_PS_I_SkipSoftwareFrequencyCalculation
PLY_PS_I_SoundOn
ld ixl,%1000 ;Sound is on.
ld ixh,e ;Save the original note for the Hardware frequency, because a Software Arpeggio will modify it.
;Calculate the Software frequency
bit 4-2,b ;Manual Frequency ? -2 Because the byte has been shifted previously.
call PLY_PS_CalculateFrequency_TestManualFrequency
ld (iy + 0),l ;Code Software Frequency.
ld (iy + 1),h
exx
ld e,ixh
PLY_PS_I_SkipSoftwareFrequencyCalculation
ld b,(hl) ;Get Second Byte.
inc hl
ld a,b ;Get the Hardware Envelope waveform.
and %1111 ;We don't care about the bit 7-4, but we have to clear them, else the waveform might be reset.
ld (PLY_PSGReg13),a
;Calculate the Hardware frequency
rr b ;Must shift it to match the expected data of the subroutine.
rr b
bit 4-2,b ;Manual Hardware Frequency ? -2 Because the byte has been shifted previously.
call PLY_PS_CalculateFrequency_TestManualFrequency
ld (PLY_PSGReg11),hl ;Code Hardware Frequency.
exx
;Noise ? We can't use the previous common code, because the setting of the Noise is different, since Independent can have no Sound.
bit 7-2,b
ret z
ld a,(hl)
inc hl
ld (PLY_PSGReg6),a
ld a,ixl ;Set the Noise bit.
res 3,a
ld ixl,a
ret
;Subroutine that =
;If Manual Frequency? (Flag Z off), read frequency (Word) and adds the TrackPitch (DE').
;Else, Auto Frequency.
; if Arpeggio? = 1 (bit 3 from B), read it (Byte).
; if Pitch? = 1 (bit 4 from B), read it (Word).
; Calculate the frequency according to the Note (E) + Arpeggio + TrackPitch (DE').
;HL = Pointer on Instrument data.
;DE'= TrackPitch.
;RET=
;HL = Pointer on Instrument moved forward.
;HL'= Frequency
; RETURN IN AUXILIARY REGISTERS
PLY_PS_CalculateFrequency_TestManualFrequency
jr z,PLY_PS_CalculateFrequency
;Manual Frequency. We read it, no need to read Pitch and Arpeggio.
;However, we add TrackPitch to the read Frequency, and that's all.
ld a,(hl)
inc hl
exx
add a,e ;Add TrackPitch LSB.
ld l,a
exx
ld a,(hl)
inc hl
exx
adc a,d ;Add TrackPitch HSB.
ld h,a
ret
PLY_PS_CalculateFrequency
;Pitch ?
bit 5-1,b
jr z,PLY_PS_S_SoundOn_NoPitch
ld a,(hl)
inc hl
exx
add a,e ;If Pitch found, add it directly to the TrackPitch.
ld e,a
exx
ld a,(hl)
inc hl
exx
adc a,d
ld d,a
exx
PLY_PS_S_SoundOn_NoPitch
;Arpeggio ?
ld a,e
bit 4-1,b
jr z,PLY_PS_S_SoundOn_ArpeggioEnd
add a,(hl) ;Add Arpeggio to Note.
inc hl
cp 144
jr c,$+4
ld a,143
PLY_PS_S_SoundOn_ArpeggioEnd
;Frequency calculation.
exx
ld l,a
ld h,0
add hl,hl
ld bc,PLY_FrequencyTable
add hl,bc
ld a,(hl)
inc hl
ld h,(hl)
ld l,a
add hl,de ;Add TrackPitch + InstrumentPitch (if any).
ret
;Read one Track.
;HL=Track Pointer.
;Ret =
;HL=New Track Pointer.
;Carry = 1 = Wait A lines. Carry=0=Line not empty.
;A=Wait (0(=256)-127), if Carry.
;D=Parameters + Volume.
;E=Note
;B=Instrument. 0=RST
;IX=PitchAdd. Only used if Pitch? = 1.
PLY_ReadTrack
ld a,(hl)
inc hl
srl a ;Full Optimisation ? If yes = Note only, no Pitch, no Volume, Same Instrument.
jr c,PLY_ReadTrack_FullOptimisation
sub 32 ;0-31 = Wait.
jr c,PLY_ReadTrack_Wait
jr z,PLY_ReadTrack_NoOptimisation_EscapeCode
dec a ;0 (32-32) = Escape Code for more Notes (parameters will be read)
;Note. Parameters are present. But the note is only present if Note? flag is 1.
ld e,a ;Save Note.
;Read Parameters
PLY_ReadTrack_ReadParameters
ld a,(hl)
ld d,a ;Save Parameters.
inc hl
rla ;Pitch ?
jr nc,PLY_ReadTrack_Pitch_End
ld b,(hl) ;Get PitchAdd
ld ixl,b
inc hl
ld b,(hl)
ld ixh,b
inc hl
PLY_ReadTrack_Pitch_End
rla ;Skip IsNote? flag.
rla ;New Instrument ?
ret nc
ld b,(hl)
inc hl
or a ;Remove Carry, as the player interpret it as a Wait command.
ret
;Escape code, read the Note and returns to read the Parameters.
PLY_ReadTrack_NoOptimisation_EscapeCode
ld e,(hl)
inc hl
jr PLY_ReadTrack_ReadParameters
PLY_ReadTrack_FullOptimisation
;Note only, no Pitch, no Volume, Same Instrument.
ld d,%01000000 ;Note only.
sub 1
ld e,a
ret nc
ld e,(hl) ;Escape Code found (0). Read Note.
inc hl
or a
ret
PLY_ReadTrack_Wait
add a,32
ret
PLY_FrequencyTable
if PLY_UseCPCMachine
dw 3822,3608,3405,3214,3034,2863,2703,2551,2408,2273,2145,2025
dw 1911,1804,1703,1607,1517,1432,1351,1276,1204,1136,1073,1012
dw 956,902,851,804,758,716,676,638,602,568,536,506
dw 478,451,426,402,379,358,338,319,301,284,268,253
dw 239,225,213,201,190,179,169,159,150,142,134,127
dw 119,113,106,100,95,89,84,80,75,71,67,63
dw 60,56,53,50,47,45,42,40,38,36,34,32
dw 30,28,27,25,24,22,21,20,19,18,17,16
dw 15,14,13,13,12,11,11,10,9,9,8,8
dw 7,7,7,6,6,6,5,5,5,4,4,4
dw 4,4,3,3,3,3,3,2,2,2,2,2
dw 2,2,2,2,1,1,1,1,1,1,1,1
endif
if PLY_UseMSXMachine
dw 4095,4095,4095,4095,4095,4095,4095,4095,4095,4030,3804,3591
dw 3389,3199,3019,2850,2690,2539,2397,2262,2135,2015,1902,1795
dw 1695,1599,1510,1425,1345,1270,1198,1131,1068,1008,951,898
dw 847,800,755,712,673,635,599,566,534,504,476,449
dw 424,400,377,356,336,317,300,283,267,252,238,224
dw 212,200,189,178,168,159,150,141,133,126,119,112
dw 106,100,94,89,84,79,75,71,67,63,59,56
dw 53,50,47,45,42,40,37,35,33,31,30,28
dw 26,25,24,22,21,20,19,18,17,16,15,14
dw 13,12,12,11,11,10,9,9,8,8,7,7
dw 7,6,6,6,5,5,5,4,4,4,4,4
dw 3,3,3,3,3,2,2,2,2,2,2,2
endif
;DE = Music
PLY_Init
if PLY_UseFirmwareInterruptions
ld hl,8 ;Skip Header, SampleChannel, YM Clock (DB*3). The Replay Frequency is used in Interruption mode.
add hl,de
ld de,PLY_ReplayFrequency + 1
ldi
else
ld hl,9 ;Skip Header, SampleChannel, YM Clock (DB*3), and Replay Frequency.
add hl,de
endif
ld de,PLY_Speed + 1
ldi ;Copy Speed.
ld c,(hl) ;Get Instruments chunk size.
inc hl
ld b,(hl)
inc hl
ld (PLY_Track1_InstrumentsTablePT + 1),hl
ld (PLY_Track2_InstrumentsTablePT + 1),hl
ld (PLY_Track3_InstrumentsTablePT + 1),hl
add hl,bc ;Skip Instruments to go to the Linker address.
;Get the pre-Linker information of the first pattern.
ld de,PLY_Height + 1
ldi
ld de,PLY_Transposition1 + 1
ldi
ld de,PLY_Transposition2 + 1
ldi
ld de,PLY_Transposition3 + 1
ldi
ld de,PLY_SaveSpecialTrack + 1
ldi
ldi
ld (PLY_Linker_PT + 1),hl ;Get the Linker address.
ld a,1
ld (PLY_SpeedCpt + 1),a
ld (PLY_HeightCpt + 1),a
ld a,#ff
ld (PLY_PSGReg13),a
;Set the Instruments pointers to Instrument 0 data (Header has to be skipped).
ld hl,(PLY_Track1_InstrumentsTablePT + 1)
ld e,(hl)
inc hl
ld d,(hl)
ex de,hl
inc hl ;Skip Instrument 0 Header.
inc hl
ld (PLY_Track1_Instrument + 1),hl
ld (PLY_Track2_Instrument + 1),hl
ld (PLY_Track3_Instrument + 1),hl
ret
;Stop the music, cut the channels.
PLY_Stop
; Pas besoin de stop si on fait un rst 0!
if OPTIM_SIKO==0
if PLY_SystemFriendly
call PLY_DisableInterruptions
ex af,af'
exx
push af
push bc
push ix
push iy
endif
ld hl,PLY_PSGReg8
ld bc,#0300
ld (hl),c
inc hl
djnz $-2
ld a,%00111111
jp PLY_SendRegisters
endif
if PLY_UseSoundEffects
;Initialize the Sound Effects.
;DE = SFX Music.
PLY_SFX_Init
;Find the Instrument Table.
ld hl,12
add hl,de
ld (PLY_SFX_Play_InstrumentTable + 1),hl
;Clear the three channels of any sound effect.
PLY_SFX_StopAll
ld hl,0
ld (PLY_SFX_Track1_Instrument + 1),hl
ld (PLY_SFX_Track2_Instrument + 1),hl
ld (PLY_SFX_Track3_Instrument + 1),hl
ret
PLY_SFX_OffsetPitch equ 0
PLY_SFX_OffsetVolume equ PLY_SFX_Track1_Volume - PLY_SFX_Track1_Pitch
PLY_SFX_OffsetNote equ PLY_SFX_Track1_Note - PLY_SFX_Track1_Pitch
PLY_SFX_OffsetInstrument equ PLY_SFX_Track1_Instrument - PLY_SFX_Track1_Pitch
PLY_SFX_OffsetSpeed equ PLY_SFX_Track1_InstrumentSpeed - PLY_SFX_Track1_Pitch
PLY_SFX_OffsetSpeedCpt equ PLY_SFX_Track1_InstrumentSpeedCpt - PLY_SFX_Track1_Pitch
;Plays a Sound Effects along with the music.
;A = No Channel (0,1,2)
;L = SFX Number (>0)
;H = Volume (0...F)
;E = Note (0...143)
;D = Speed (0 = As original, 1...255 = new Speed (1 is fastest))
;BC = Inverted Pitch (-#FFFF -> FFFF). 0 is no pitch. The higher the pitch, the lower the sound.
PLY_SFX_Play
ld ix,PLY_SFX_Track1_Pitch
or a
jr z,PLY_SFX_Play_Selected
ld ix,PLY_SFX_Track2_Pitch
dec a
jr z,PLY_SFX_Play_Selected
ld ix,PLY_SFX_Track3_Pitch
PLY_SFX_Play_Selected
ld (ix + PLY_SFX_OffsetPitch + 1),c ;Set Pitch
ld (ix + PLY_SFX_OffsetPitch + 2),b
ld a,e ;Set Note
ld (ix + PLY_SFX_OffsetNote),a
ld a,15 ;Set Volume
sub h
ld (ix + PLY_SFX_OffsetVolume),a
ld h,0 ;Set Instrument Address
add hl,hl
PLY_SFX_Play_InstrumentTable ld bc,0
add hl,bc
ld a,(hl)
inc hl
ld h,(hl)
ld l,a
ld a,d ;Read Speed or use the user's one ?
or a
jr nz,PLY_SFX_Play_UserSpeed
ld a,(hl) ;Get Speed
PLY_SFX_Play_UserSpeed
ld (ix + PLY_SFX_OffsetSpeed + 1),a
ld (ix + PLY_SFX_OffsetSpeedCpt + 1),a
inc hl ;Skip Retrig
inc hl
ld (ix + PLY_SFX_OffsetInstrument + 1),l
ld (ix + PLY_SFX_OffsetInstrument + 2),h
ret
;Stops a sound effect on the selected channel
;E = No Channel (0,1,2)
;I used the E register instead of A so that Basic users can call this code in a straightforward way (call player+15, value).
PLY_SFX_Stop
ld a,e
ld hl,PLY_SFX_Track1_Instrument + 1
or a
jr z,PLY_SFX_Stop_ChannelFound
ld hl,PLY_SFX_Track2_Instrument + 1
dec a
jr z,PLY_SFX_Stop_ChannelFound
ld hl,PLY_SFX_Track3_Instrument + 1
dec a
PLY_SFX_Stop_ChannelFound
ld (hl),a
inc hl
ld (hl),a
ret
endif
if PLY_UseFades
;Sets the Fade value.
;E = Fade value (0 = full volume, 16 or more = no volume).
;I used the E register instead of A so that Basic users can call this code in a straightforward way (call player+9/+18, value).
PLY_SetFadeValue
ld a,e
ld (PLY_Channel1_FadeValue + 1),a
ld (PLY_Channel2_FadeValue + 1),a
ld (PLY_Channel3_FadeValue + 1),a
ret
endif
if PLY_SystemFriendly
;Save Interrupt status and Disable Interruptions
PLY_DisableInterruptions
ld a,i
di
;IFF in P/V flag.
;Prepare opcode for DI.
ld a,#f3
jp po,PLY_DisableInterruptions_Set_Opcode
;Opcode for EI.
ld a,#fb
PLY_DisableInterruptions_Set_Opcode
ld (PLY_RestoreInterruption),a
ret
endif
;A little convient interface for BASIC user, to allow them to use Sound Effects in Basic.
if PLY_UseBasicSoundEffectInterface
PLY_BasicSoundEffectInterface_PlaySound
ld c,(ix+0) ;Get Pitch
ld b,(ix+1)
ld d,(ix+2) ;Get Speed
ld e,(ix+4) ;Get Note
ld h,(ix+6) ;Get Volume
ld l,(ix+8) ;Get SFX number
ld a,(ix+10) ;Get Channel
jp PLY_SFX_Play
endif
list
;*** End of Arkos Tracker Player
nolist
|
src/histogramgenerator.adb | sebsgit/textproc | 0 | 18039 | <filename>src/histogramgenerator.adb
with PixelArray;
with Ada.Text_IO;
use PixelArray;
package body HistogramGenerator is
function verticalProjection(image: PixelArray.ImagePlane; r: ImageRegions.Rect) return Histogram.Data is
result: Histogram.Data(r.height);
begin
for h in 0 .. r.height - 1 loop
declare
total: Float := 0.0;
begin
for w in 0 .. r.width - 1 loop
if image.get(r.x + w, r.y + h) /= PixelArray.Background then
total := total + 1.0;
end if;
end loop;
result.set(h, total);
end;
end loop;
return result;
end verticalProjection;
function horizontalProjection(image:PixelArray.ImagePlane; r: ImageRegions.Rect) return Histogram.Data is
result: Histogram.Data(r.width);
begin
for h in 0 .. r.height - 1 loop
for w in 0 .. r.width - 1 loop
if image.get(r.x + w, r.y + h) /= PixelArray.Background then
result.set(w, result.get(w) + 1.0);
end if;
end loop;
end loop;
return result;
end horizontalProjection;
end HistogramGenerator;
|
Validation/pyFrame3DD-master/gcc-master/gcc/ada/sem_warn.ads | djamal2727/Main-Bearing-Analytical-Model | 0 | 2376 | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S E M _ W A R N --
-- --
-- S p e c --
-- --
-- Copyright (C) 1999-2020, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING3. If not, go to --
-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains the routines used to deal with issuing warnings
-- about uses of uninitialized variables and unused with's. It also has
-- some unrelated routines related to the generation of warnings.
with Alloc;
with Table;
with Types; use Types;
package Sem_Warn is
------------------------
-- Warnings Off Table --
------------------------
type Warnings_Off_Entry is record
N : Node_Id;
-- A pragma Warnings (Off, ent [,Reason]) node
E : Entity_Id;
-- The entity involved
R : String_Id;
-- Warning reason if present, or null if not (not currently used)
end record;
-- An entry is made in the following table for any valid Pragma Warnings
-- (Off, entity) encountered while Opt.Warn_On_Warnings_Off is True. It
-- is used to generate warnings on any of these pragmas that turn out not
-- to be needed, or that could be replaced by Unmodified/Unreferenced.
package Warnings_Off_Pragmas is new Table.Table (
Table_Component_Type => Warnings_Off_Entry,
Table_Index_Type => Int,
Table_Low_Bound => 0,
Table_Initial => Alloc.Warnings_Off_Pragmas_Initial,
Table_Increment => Alloc.Warnings_Off_Pragmas_Increment,
Table_Name => "Name_Warnings_Off_Pragmas");
--------------------
-- Initialization --
--------------------
procedure Initialize;
-- Initialize this package for new compilation
------------------------------------------
-- Routines to Handle Unused References --
------------------------------------------
procedure Check_References (E : Entity_Id; Anod : Node_Id := Empty);
-- Called at the end of processing a declarative region. The entity E
-- is the entity for the scope. All entities declared in the region,
-- as indicated by First_Entity and the entity chain, are checked to
-- see if they are variables for which warnings need to be posted for
-- either no assignments, or a use before an assignment or no references
-- at all. The Anod node is present for the case of an accept statement,
-- and references the accept statement. This is used to place the warning
-- messages in the right place.
procedure Check_Unset_Reference (N : Node_Id);
-- N is the node for an expression which occurs in a reference position,
-- e.g. as the right side of an assignment. This procedure checks to see
-- if the node is a reference to a variable entity where the entity has
-- Not_Assigned set. If so, the Unset_Reference field is set if it is not
-- the first occurrence. No warning is posted, instead warnings will be
-- posted later by Check_References. The reason we do things that
-- way is that if there are no assignments anywhere, we prefer to flag
-- the entity, rather than a reference to it. Note that for the purposes
-- of this routine, a type conversion or qualified expression whose
-- expression is an entity is also processed. The reason that we do not
-- process these at the point of occurrence is that both these constructs
-- can occur in non-reference positions (e.g. as out parameters).
procedure Check_Unused_Withs (Spec_Unit : Unit_Number_Type := No_Unit);
-- This routine performs two kinds of checks. It checks that all with'ed
-- units are referenced, and that at least one entity of each with'ed
-- unit is referenced (the latter check catches units that are only
-- referenced in a use or package renaming statement). Appropriate
-- warning messages are generated if either of these situations is
-- detected.
--
-- A special case arises when a package body or a subprogram body with
-- a separate spec is being compiled. In this case, a with may appear
-- on the spec, but be needed only by the body. This still generates
-- a warning, but the text is different (the with is not redundant,
-- it is misplaced).
--
-- This special case is implemented by making an initial call to this
-- procedure with Spec_Unit set to the unit number of the separate spec.
-- This call does not generate any warning messages, but instead may
-- result in flags being set in the N_With_Clause node that record that
-- there was no use in the spec.
--
-- The main call (made after all units have been analyzed, with Spec_Unit
-- set to the default value of No_Unit) generates the required warnings
-- using the flags set by the initial call where appropriate to specialize
-- the text of the warning messages.
---------------------
-- Output Routines --
---------------------
procedure Output_Non_Modified_In_Out_Warnings;
-- Warnings about IN OUT parameters that could be IN are collected till
-- the end of the compilation process (see body of this routine for a
-- discussion of why this is done). This procedure outputs the warnings.
-- Note: this should be called before Output_Unreferenced_Messages, since
-- if we have an IN OUT warning, that's the one we want to see.
procedure Output_Obsolescent_Entity_Warnings (N : Node_Id; E : Entity_Id);
-- N is a reference to obsolescent entity E, for which appropriate warning
-- messages are to be generated (caller has already checked that warnings
-- are active and appropriate for this entity).
procedure Output_Unreferenced_Messages;
-- Warnings about unreferenced entities are collected till the end of
-- the compilation process (see Check_Unset_Reference for further
-- details). This procedure outputs waiting warnings, if any.
procedure Output_Unused_Warnings_Off_Warnings;
-- Warnings about pragma Warnings (Off, ent) statements that are unused,
-- or could be replaced by Unmodified/Unreferenced pragmas, are collected
-- till the end of the compilation process. This procedure outputs waiting
-- warnings if any.
----------------------------
-- Other Warning Routines --
----------------------------
procedure Check_Code_Statement (N : Node_Id);
-- Perform warning checks on a code statement node
procedure Check_Infinite_Loop_Warning (Loop_Statement : Node_Id);
-- N is the node for a loop statement. This procedure checks if a warning
-- for a possible infinite loop should be given for a suspicious WHILE or
-- EXIT WHEN condition.
procedure Check_Low_Bound_Tested (Expr : Node_Id);
-- Expr is the node for a comparison operation. This procedure checks if
-- the comparison is a source comparison of P'First with some other value
-- and if so, sets the Low_Bound_Tested flag on entity P to suppress
-- warnings about improper low bound assumptions (we assume that if the
-- code has a test that explicitly checks P'First, then it is not operating
-- in blind assumption mode).
procedure Warn_On_Constant_Valid_Condition (Op : Node_Id);
-- Determine the outcome of evaluating conditional or relational operator
-- Op assuming that its scalar operands are valid. Emit a warning when the
-- result of the evaluation is True or False.
procedure Warn_On_Known_Condition (C : Node_Id);
-- C is a node for a boolean expression resulting from a relational
-- or membership operation. If the expression has a compile time known
-- value, then a warning is output if all the following conditions hold:
--
-- 1. Original expression comes from source. We don't want to generate
-- warnings for internally generated conditionals.
--
-- 2. As noted above, the expression is a relational or membership
-- test, we don't want to generate warnings for boolean variables
-- since this is typical of conditional compilation in Ada.
--
-- 3. The expression appears in a statement, rather than a declaration.
-- In practice, most occurrences in declarations are legitimate
-- conditionalizations, but occurrences in statements are often
-- errors for which the warning is useful.
--
-- 4. The expression does not occur within an instantiation. A non-
-- static expression in a generic may become constant because of
-- the attributes of the actuals, and we do not want to warn on
-- these legitimate constant foldings.
--
-- If all these conditions are met, the warning is issued noting that
-- the result of the test is always false or always true as appropriate.
function Warn_On_Modified_As_Out_Parameter (E : Entity_Id) return Boolean;
-- Returns True if we should activate warnings for entity E being modified
-- as an out parameter. True if either Warn_On_Modified_Unread is set for
-- an only OUT parameter, or if Warn_On_All_Unread_Out_Parameters is set.
procedure Warn_On_Overlapping_Actuals (Subp : Entity_Id; N : Node_Id);
-- Called on a subprogram call. Checks whether an IN OUT actual that is
-- not by-copy may overlap with another actual, thus leading to aliasing
-- in the body of the called subprogram. This is indeed a warning in Ada
-- versions prior to Ada 2012, but, unless Opt.Error_To_Warning is set by
-- use of debug flag -gnatd.E, this is illegal and generates an error.
procedure Warn_On_Suspicious_Index (Name : Entity_Id; X : Node_Id);
-- This is called after resolving an indexed component or a slice. Name
-- is the entity for the name of the indexed array, and X is the subscript
-- for the indexed component case, or one of the bounds in the slice case.
-- If Name is an unconstrained parameter of a standard string type, and
-- the index is of the form of a literal or Name'Length [- literal], then
-- a warning is generated that the subscripting operation is possibly
-- incorrectly assuming a lower bound of 1.
procedure Warn_On_Suspicious_Update (N : Node_Id);
-- N is a semantically analyzed attribute reference Prefix'Update. Issue
-- a warning if Warn_On_Suspicious_Contract is set, and N is the left-hand
-- side or right-hand side of an equality or inequality of the form:
-- Prefix = Prefix'Update(...)
-- or
-- Prefix'Update(...) = Prefix
procedure Warn_On_Unassigned_Out_Parameter
(Return_Node : Node_Id;
Scope_Id : Entity_Id);
-- Called when processing a return statement given by Return_Node. Scope_Id
-- is the Entity_Id for the procedure in which the return statement lives.
-- A check is made for the case of a procedure with out parameters that
-- have not yet been assigned, and appropriate warnings are given.
procedure Warn_On_Useless_Assignment
(Ent : Entity_Id;
N : Node_Id := Empty);
-- Called to check if we have a case of a useless assignment to the given
-- entity Ent, as indicated by a non-empty Last_Assignment field. This call
-- should only be made if at least one of the flags Warn_On_Modified_Unread
-- or Warn_On_All_Unread_Out_Parameters is True, and if Ent is in the
-- extended main source unit. N is Empty for the end of block call
-- (warning message says value unreferenced), or it is the node for
-- an overwriting assignment (warning message points to this assignment).
procedure Warn_On_Useless_Assignments (E : Entity_Id);
pragma Inline (Warn_On_Useless_Assignments);
-- Called at the end of a block or subprogram. Scans the entities of the
-- block or subprogram to see if there are any variables for which useless
-- assignments were made (assignments whose values were never read).
----------------------
-- Utility Routines --
----------------------
function Has_Junk_Name (E : Entity_Id) return Boolean;
-- Return True if the entity name contains any of the following substrings:
-- discard
-- dummy
-- ignore
-- junk
-- unused
-- Used to suppress warnings on names matching these patterns. The contents
-- of Name_Buffer and Name_Len are destroyed by this call.
end Sem_Warn;
|
src/aco-protocols-network_management-masters.adb | jonashaggstrom/ada-canopen | 6 | 20627 | <filename>src/aco-protocols-network_management-masters.adb
package body ACO.Protocols.Network_Management.Masters is
procedure Request_State
(This : in out Master;
State : in ACO.States.State)
is
Cmd : NMT_Commands.NMT_Command;
begin
This.Set (State);
Cmd := (As_Raw => False,
Command_Specifier => NMT_Commands.To_CMD_Spec (State),
Node_Id => This.Id);
This.Handler.Put (NMT_Commands.To_Msg (Cmd));
end Request_State;
procedure Set_Heartbeat_Timeout
(This : in out Master;
Timeout : in Natural)
is
begin
This.Timeout_Ms := Timeout;
This.T_Heartbeat_Update := Ada.Real_Time.Time_Last;
end Set_Heartbeat_Timeout;
procedure Periodic_Actions
(This : in out Master;
T_Now : in Ada.Real_Time.Time)
is
use Ada.Real_Time;
use ACO.States;
begin
case This.Get is
when Initializing | Pre_Operational | Operational | Stopped =>
if This.Timeout_Ms > 0 and then
T_Now >= This.T_Heartbeat_Update + Milliseconds (This.Timeout_Ms)
then
This.Set (Unknown_State);
This.Od.Events.Node_Events.Put
((Event => ACO.Events.Heartbeat_Timed_Out,
Node_Id => This.Id));
end if;
when Unknown_State =>
null;
end case;
end Periodic_Actions;
overriding
procedure On_Event
(This : in out Heartbeat_Subscriber;
Data : in ACO.Events.Event_Data)
is
begin
-- TODO: Should really use timestamp of CAN message instead since this
-- event probably is delayed from the time of reception.
This.Ref.T_Heartbeat_Update := This.Ref.Handler.Current_Time;
This.Ref.Set (Data.Received_Heartbeat.State);
end On_Event;
overriding
procedure Initialize
(This : in out Master)
is
begin
NMT (This).Initialize;
This.Od.Events.Node_Events.Attach
(This.Heartbeat_Update'Unchecked_Access);
end Initialize;
overriding
procedure Finalize
(This : in out Master)
is
begin
NMT (This).Finalize;
This.Od.Events.Node_Events.Detach
(This.Heartbeat_Update'Unchecked_Access);
end Finalize;
end ACO.Protocols.Network_Management.Masters;
|
joern-cli/frontends/ghidra2cpg/src/test/testbinaries/cfg.asm | zu1kbackup/joern | 415 | 169667 | ;; Built with `nasm -felf64 cfg.asm -g` and `gcc cfg.o -o cfg.bin`
global main
section .text
main:
push rbp
mov rbp, rsp
mov rcx, 10
xor rax, rax
.loop:
cmp rcx, 0
jle .end
add rax, 2
sub rcx, 1
jmp .loop
.end:
mov rsp, rbp
pop rbp
ret
|
oeis/100/A100179.asm | neoneye/loda-programs | 11 | 179215 | <reponame>neoneye/loda-programs
; A100179: Structured heptagonal diamond numbers (vertex structure 5).
; Submitted by <NAME>
; 1,9,34,86,175,311,504,764,1101,1525,2046,2674,3419,4291,5300,6456,7769,9249,10906,12750,14791,17039,19504,22196,25125,28301,31734,35434,39411,43675,48236,53104,58289,63801,69650,75846,82399,89319,96616,104300,112381,120869,129774,139106,148875,159091,169764,180904,192521,204625,217226,230334,243959,258111,272800,288036,303829,320189,337126,354650,372771,391499,410844,430816,451425,472681,494594,517174,540431,564375,589016,614364,640429,667221,694750,723026,752059,781859,812436,843800,875961
mul $0,10
mov $1,$0
add $0,8
bin $0,3
mul $1,4
add $1,$0
mov $0,$1
div $0,100
add $0,1
|
alloy4fun_models/trashltl/models/11/rWjvRZBER5MKFt6or.als | Kaixi26/org.alloytools.alloy | 0 | 5265 | open main
pred idrWjvRZBER5MKFt6or_prop12 {
some f: File | eventually always f in Trash
}
pred __repair { idrWjvRZBER5MKFt6or_prop12 }
check __repair { idrWjvRZBER5MKFt6or_prop12 <=> prop12o } |
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_2845.asm | ljhsiun2/medusa | 9 | 89469 | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r14
push %r9
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x4537, %rax
cmp %rbx, %rbx
mov (%rax), %r11
add %r11, %r11
lea addresses_UC_ht+0xbe37, %rsi
lea addresses_D_ht+0xc929, %rdi
nop
inc %r11
mov $122, %rcx
rep movsb
nop
xor $39786, %rcx
lea addresses_WT_ht+0x1c0b7, %rsi
lea addresses_normal_ht+0x59a3, %rdi
clflush (%rdi)
nop
nop
and $1755, %r14
mov $55, %rcx
rep movsl
nop
nop
dec %r11
lea addresses_WT_ht+0x1d4b7, %rsi
lea addresses_WT_ht+0x7c27, %rdi
nop
nop
nop
cmp %r9, %r9
mov $85, %rcx
rep movsq
nop
nop
add %rbx, %rbx
lea addresses_D_ht+0x1ff7, %rsi
lea addresses_WT_ht+0xe1cf, %rdi
nop
nop
nop
nop
inc %r9
mov $49, %rcx
rep movsb
nop
nop
nop
nop
and %rax, %rax
lea addresses_D_ht+0x9c6f, %r9
nop
add %rsi, %rsi
movb $0x61, (%r9)
nop
nop
nop
nop
nop
sub $25659, %rax
lea addresses_D_ht+0x15037, %rsi
lea addresses_WC_ht+0x14437, %rdi
nop
nop
nop
cmp $34479, %r14
mov $45, %rcx
rep movsw
add %r9, %r9
lea addresses_WT_ht+0xf1f7, %rbx
nop
nop
xor $18181, %rdi
mov $0x6162636465666768, %rcx
movq %rcx, %xmm4
vmovups %ymm4, (%rbx)
nop
xor %rax, %rax
lea addresses_WT_ht+0x1c837, %rsi
nop
nop
nop
nop
inc %r11
mov $0x6162636465666768, %r14
movq %r14, (%rsi)
nop
nop
nop
and $40710, %rax
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r9
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r14
push %r8
push %rax
push %rbx
push %rdx
push %rsi
// Load
lea addresses_RW+0x10037, %rdx
clflush (%rdx)
nop
nop
add $5449, %rbx
mov (%rdx), %r14
nop
nop
sub %rax, %rax
// Load
lea addresses_D+0x4b37, %rbx
nop
nop
nop
nop
sub %r8, %r8
mov (%rbx), %r13
nop
nop
xor $53194, %rsi
// Faulty Load
lea addresses_RW+0x10037, %rdx
nop
nop
nop
and %rsi, %rsi
movb (%rdx), %bl
lea oracles, %rdx
and $0xff, %rbx
shlq $12, %rbx
mov (%rdx,%rbx,1), %rbx
pop %rsi
pop %rdx
pop %rbx
pop %rax
pop %r8
pop %r14
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_RW', 'same': False, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_RW', 'same': True, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D', 'same': False, 'size': 8, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_RW', 'same': True, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 8, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': True}, 'OP': 'REPM'}
{'src': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_D_ht', 'same': True, 'size': 1, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 32, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 8, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'32': 21829}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
|
oeis/067/A067966.asm | neoneye/loda-programs | 11 | 84698 | <filename>oeis/067/A067966.asm
; A067966: Number of binary arrangements without adjacent 1's on n X n array connected n-s.
; Submitted by <NAME>(s2)
; 1,2,9,125,4096,371293,85766121,52523350144,83733937890625,350356403707485209,3833759992447475122176,109879109551310452512114617,8243206936713178643875538610721,1619152874321527556575810000000000000,832607152514397063149538100851561865157289,1120917738905293103870369860777283473635634507093,3950755461735245132350392996482751013931926172798550016,36455482308690457606087225357663511909366224608063303977277461,880684629690569481596187331136280276631030002296374602848052978515625
mov $1,$0
add $0,1
seq $0,187107 ; Number of nontrivial compositions of differential operations and directional derivative of the n-th order on the space R^9.
sub $0,7
pow $0,$1
|
source/a-except.adb | ytomino/drake | 33 | 7067 | <reponame>ytomino/drake
with Ada.Unchecked_Conversion;
with System.Unwind.Occurrences;
with System.UTF_Conversions.From_8_To_16;
with System.UTF_Conversions.From_8_To_32;
package body Ada.Exceptions is
pragma Suppress (All_Checks);
use type System.Unwind.Exception_Data_Access;
-- for Exception_Information
type Information_Context_Type is record
Item : String (
1 ..
256
+ System.Unwind.Exception_Msg_Max_Length
+ System.Unwind.Max_Tracebacks
* (3 + (Standard'Address_Size + 3) / 4));
Last : Natural;
end record;
pragma Suppress_Initialization (Information_Context_Type);
procedure Put (S : String; Params : System.Address);
procedure Put (S : String; Params : System.Address) is
Context : Information_Context_Type;
for Context'Address use Params;
First : constant Positive := Context.Last + 1;
begin
Context.Last := Context.Last + S'Length;
Context.Item (First .. Context.Last) := S;
end Put;
procedure New_Line (Params : System.Address);
procedure New_Line (Params : System.Address) is
Context : Information_Context_Type;
for Context'Address use Params;
begin
Context.Last := Context.Last + 1;
Context.Item (Context.Last) := Character'Val (10);
end New_Line;
-- implementation
function Wide_Exception_Name (Id : Exception_Id) return Wide_String is
begin
return System.UTF_Conversions.From_8_To_16.Convert (Exception_Name (Id));
end Wide_Exception_Name;
function Wide_Wide_Exception_Name (Id : Exception_Id)
return Wide_Wide_String is
begin
return System.UTF_Conversions.From_8_To_32.Convert (Exception_Name (Id));
end Wide_Wide_Exception_Name;
function Exception_Message (X : Exception_Occurrence) return String is
begin
if X.Id = null then
raise Constraint_Error;
else
return X.Msg (1 .. X.Msg_Length);
end if;
end Exception_Message;
procedure Reraise_Occurrence (X : Exception_Occurrence) is
begin
if X.Id /= null then
Reraise_Occurrence_Always (X);
end if;
end Reraise_Occurrence;
function Exception_Identity (X : Exception_Occurrence)
return Exception_Id
is
function To_Exception_Id is
new Unchecked_Conversion (
System.Unwind.Exception_Data_Access,
Exception_Id);
begin
return Exception_Id (To_Exception_Id (X.Id));
end Exception_Identity;
function Exception_Name (X : Exception_Occurrence) return String is
begin
return Exception_Name (Exception_Identity (X));
end Exception_Name;
function Wide_Exception_Name (X : Exception_Occurrence)
return Wide_String is
begin
return Wide_Exception_Name (Exception_Identity (X));
end Wide_Exception_Name;
function Wide_Wide_Exception_Name (X : Exception_Occurrence)
return Wide_Wide_String is
begin
return Wide_Wide_Exception_Name (Exception_Identity (X));
end Wide_Wide_Exception_Name;
function Exception_Information (X : Exception_Occurrence) return String is
begin
if X.Id = null then
raise Constraint_Error;
else
declare
Context : aliased Information_Context_Type;
begin
Context.Last := 0;
System.Unwind.Occurrences.Exception_Information (
System.Unwind.Exception_Occurrence (X),
Context'Address,
Put => Put'Access,
New_Line => New_Line'Access);
return Context.Item (1 .. Context.Last);
end;
end if;
end Exception_Information;
function Save_Occurrence (
Source : Exception_Occurrence)
return Exception_Occurrence_Access
is
Result : constant Exception_Occurrence_Access :=
new Exception_Occurrence;
begin
Save_Occurrence (Result.all, Source);
return Result;
end Save_Occurrence;
end Ada.Exceptions;
|
oeis/037/A037615.asm | neoneye/loda-programs | 11 | 97296 | <filename>oeis/037/A037615.asm
; A037615: Base 8 digits are, in order, the first n terms of the periodic sequence with initial period 1,3,2.
; Submitted by <NAME>(s4)
; 1,11,90,721,5771,46170,369361,2954891,23639130,189113041,1512904331,12103234650,96825877201,774607017611,6196856140890,49574849127121,396598793016971,3172790344135770,25382322753086161,203058582024689291,1624468656197514330
seq $0,33135 ; Base 8 digits are, in order, the first n terms of the periodic sequence with initial period 1,1,0.
mul $0,20
div $0,16
|
orka/src/gl/implementation/gl-toggles.adb | onox/orka | 52 | 4064 | -- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2012 <NAME> <<EMAIL>>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
with GL.API;
package body GL.Toggles is
procedure Enable (Subject : Toggle) is
begin
API.Enable.Ref (Subject);
end Enable;
procedure Disable (Subject : Toggle) is
begin
API.Disable.Ref (Subject);
end Disable;
procedure Set (Subject : Toggle; Value : Toggle_State) is
begin
if Value = Enabled then
API.Enable.Ref (Subject);
else
API.Disable.Ref (Subject);
end if;
end Set;
function State (Subject : Toggle) return Toggle_State is
((if API.Is_Enabled.Ref (Subject) then Enabled else Disabled));
procedure Enable (Subject : Toggle_Indexed; Index : Types.UInt) is
begin
API.Enable_I.Ref (Subject, Index);
end Enable;
procedure Disable (Subject : Toggle_Indexed; Index : Types.UInt) is
begin
API.Disable_I.Ref (Subject, Index);
end Disable;
procedure Set (Subject : Toggle_Indexed; Index : Types.UInt; Value : Toggle_State) is
begin
if Value = Enabled then
API.Enable_I.Ref (Subject, Index);
else
API.Disable_I.Ref (Subject, Index);
end if;
end Set;
function State (Subject : Toggle_Indexed; Index : Types.UInt) return Toggle_State is
((if API.Is_Enabled_I.Ref (Subject, Index) then Enabled else Disabled));
end GL.Toggles;
|
P6/data_P6_2/cal_R_test43.asm | alxzzhou/BUAA_CO_2020 | 1 | 171330 | lui $1,22532
ori $1,$1,824
lui $2,29430
ori $2,$2,59989
lui $3,22499
ori $3,$3,47106
lui $4,46360
ori $4,$4,17521
lui $5,10391
ori $5,$5,57654
lui $6,56475
ori $6,$6,13684
mthi $1
mtlo $2
sec0:
nop
nop
nop
sltu $3,$6,$2
sec1:
nop
nop
nor $2,$2,$3
sltu $1,$6,$2
sec2:
nop
nop
andi $2,$3,62563
sltu $4,$6,$2
sec3:
nop
nop
mflo $2
sltu $3,$6,$2
sec4:
nop
nop
lh $2,12($0)
sltu $5,$6,$2
sec5:
nop
subu $6,$2,$6
nop
sltu $2,$6,$2
sec6:
nop
xor $6,$4,$5
addu $2,$4,$3
sltu $3,$6,$2
sec7:
nop
xor $6,$3,$4
slti $2,$6,3279
sltu $3,$6,$2
sec8:
nop
sltu $6,$0,$1
mfhi $2
sltu $1,$6,$2
sec9:
nop
or $6,$0,$2
lw $2,12($0)
sltu $3,$6,$2
sec10:
nop
addiu $6,$5,16926
nop
sltu $4,$6,$2
sec11:
nop
sltiu $6,$2,-13639
xor $2,$5,$2
sltu $3,$6,$2
sec12:
nop
sltiu $6,$2,14254
sltiu $2,$0,12856
sltu $1,$6,$2
sec13:
nop
slti $6,$3,-9728
mflo $2
sltu $5,$6,$2
sec14:
nop
lui $6,11396
lw $2,4($0)
sltu $2,$6,$2
sec15:
nop
mflo $6
nop
sltu $3,$6,$2
sec16:
nop
mfhi $6
sltu $2,$2,$0
sltu $4,$6,$2
sec17:
nop
mflo $6
addiu $2,$6,-2875
sltu $4,$6,$2
sec18:
nop
mfhi $6
mfhi $2
sltu $3,$6,$2
sec19:
nop
mfhi $6
lh $2,0($0)
sltu $1,$6,$2
sec20:
nop
lbu $6,9($0)
nop
sltu $3,$6,$2
sec21:
nop
lw $6,0($0)
addu $2,$0,$1
sltu $2,$6,$2
sec22:
nop
lw $6,4($0)
sltiu $2,$3,12580
sltu $5,$6,$2
sec23:
nop
lb $6,8($0)
mfhi $2
sltu $2,$6,$2
sec24:
nop
lbu $6,14($0)
lh $2,2($0)
sltu $4,$6,$2
sec25:
subu $2,$4,$4
nop
nop
sltu $1,$6,$2
sec26:
subu $2,$4,$4
nop
subu $2,$3,$2
sltu $2,$6,$2
sec27:
or $2,$2,$3
nop
addiu $2,$3,24654
sltu $3,$6,$2
sec28:
sltu $2,$2,$0
nop
mfhi $2
sltu $5,$6,$2
sec29:
and $2,$1,$5
nop
lhu $2,4($0)
sltu $2,$6,$2
sec30:
or $2,$3,$4
addu $6,$1,$2
nop
sltu $5,$6,$2
sec31:
subu $2,$4,$5
subu $6,$4,$3
addu $2,$4,$4
sltu $4,$6,$2
sec32:
sltu $2,$4,$3
and $6,$0,$2
ori $2,$4,23906
sltu $4,$6,$2
sec33:
sltu $2,$4,$0
sltu $6,$5,$3
mflo $2
sltu $1,$6,$2
sec34:
subu $2,$4,$5
sltu $6,$2,$2
lbu $2,9($0)
sltu $1,$6,$2
sec35:
subu $2,$3,$3
andi $6,$0,24337
nop
sltu $3,$6,$2
sec36:
nor $2,$2,$3
ori $6,$2,5763
addu $2,$4,$4
sltu $3,$6,$2
sec37:
or $2,$4,$4
ori $6,$5,52052
ori $2,$0,63901
sltu $2,$6,$2
sec38:
or $2,$4,$4
ori $6,$4,4721
mfhi $2
sltu $1,$6,$2
sec39:
and $2,$4,$6
addiu $6,$2,-25118
lw $2,16($0)
sltu $3,$6,$2
sec40:
addu $2,$4,$2
mflo $6
nop
sltu $4,$6,$2
sec41:
sltu $2,$2,$3
mfhi $6
addu $2,$1,$3
sltu $5,$6,$2
sec42:
slt $2,$2,$3
mfhi $6
ori $2,$4,2517
sltu $3,$6,$2
sec43:
subu $2,$3,$5
mfhi $6
mfhi $2
sltu $1,$6,$2
sec44:
addu $2,$4,$2
mfhi $6
lb $2,15($0)
sltu $1,$6,$2
sec45:
and $2,$5,$3
lhu $6,14($0)
nop
sltu $3,$6,$2
sec46:
and $2,$2,$3
lh $6,14($0)
subu $2,$6,$3
sltu $4,$6,$2
sec47:
sltu $2,$2,$3
lhu $6,10($0)
xori $2,$3,35328
sltu $4,$6,$2
sec48:
or $2,$2,$4
lb $6,4($0)
mflo $2
sltu $3,$6,$2
sec49:
nor $2,$4,$3
lb $6,16($0)
lhu $2,16($0)
sltu $2,$6,$2
sec50:
ori $2,$4,26713
nop
nop
sltu $1,$6,$2
sec51:
andi $2,$3,34896
nop
addu $2,$2,$2
sltu $3,$6,$2
sec52:
lui $2,40008
nop
slti $2,$3,-10632
sltu $3,$6,$2
sec53:
ori $2,$6,2411
nop
mfhi $2
sltu $4,$6,$2
sec54:
slti $2,$3,14015
nop
lb $2,0($0)
sltu $1,$6,$2
sec55:
ori $2,$1,56548
slt $6,$1,$4
nop
sltu $4,$6,$2
sec56:
addiu $2,$3,-4192
nor $6,$6,$3
or $2,$4,$1
sltu $3,$6,$2
sec57:
addiu $2,$0,-7122
slt $6,$3,$5
slti $2,$2,7370
sltu $3,$6,$2
sec58:
xori $2,$4,63043
sltu $6,$3,$2
mfhi $2
sltu $2,$6,$2
sec59:
lui $2,11613
slt $6,$4,$3
lh $2,6($0)
sltu $3,$6,$2
sec60:
sltiu $2,$5,12834
andi $6,$3,3400
nop
sltu $0,$6,$2
sec61:
xori $2,$1,12415
lui $6,5256
slt $2,$2,$5
sltu $6,$6,$2
sec62:
xori $2,$4,4592
lui $6,7358
addiu $2,$3,-11863
sltu $1,$6,$2
sec63:
slti $2,$5,-13751
slti $6,$3,28852
mflo $2
sltu $4,$6,$2
sec64:
addiu $2,$3,-18373
addiu $6,$2,25091
lhu $2,0($0)
sltu $3,$6,$2
sec65:
andi $2,$3,56922
mfhi $6
nop
sltu $2,$6,$2
sec66:
andi $2,$4,40188
mflo $6
slt $2,$5,$2
sltu $2,$6,$2
sec67:
andi $2,$3,58237
mflo $6
sltiu $2,$6,25522
sltu $2,$6,$2
sec68:
slti $2,$4,29009
mflo $6
mflo $2
sltu $4,$6,$2
sec69:
sltiu $2,$5,-18794
mfhi $6
lw $2,4($0)
sltu $2,$6,$2
sec70:
xori $2,$3,47249
lbu $6,13($0)
nop
sltu $2,$6,$2
sec71:
addiu $2,$6,585
lhu $6,8($0)
subu $2,$2,$2
sltu $0,$6,$2
sec72:
addiu $2,$6,11568
lh $6,8($0)
addiu $2,$5,17022
sltu $3,$6,$2
sec73:
xori $2,$5,3477
lb $6,6($0)
mfhi $2
sltu $0,$6,$2
sec74:
addiu $2,$6,11745
lw $6,16($0)
lhu $2,6($0)
sltu $4,$6,$2
sec75:
mflo $2
nop
nop
sltu $3,$6,$2
sec76:
mflo $2
nop
xor $2,$4,$2
sltu $4,$6,$2
sec77:
mflo $2
nop
xori $2,$4,46550
sltu $4,$6,$2
sec78:
mflo $2
nop
mfhi $2
sltu $5,$6,$2
sec79:
mflo $2
nop
lh $2,6($0)
sltu $1,$6,$2
sec80:
mflo $2
nor $6,$3,$3
nop
sltu $2,$6,$2
sec81:
mflo $2
xor $6,$2,$2
slt $2,$2,$5
sltu $0,$6,$2
sec82:
mflo $2
xor $6,$2,$4
ori $2,$3,32433
sltu $2,$6,$2
sec83:
mflo $2
nor $6,$2,$3
mflo $2
sltu $4,$6,$2
sec84:
mflo $2
or $6,$4,$3
lhu $2,6($0)
sltu $3,$6,$2
sec85:
mfhi $2
xori $6,$2,14352
nop
sltu $2,$6,$2
sec86:
mflo $2
andi $6,$3,56141
or $2,$2,$1
sltu $3,$6,$2
sec87:
mfhi $2
ori $6,$6,21786
andi $2,$6,6010
sltu $1,$6,$2
sec88:
mfhi $2
sltiu $6,$2,25760
mfhi $2
sltu $5,$6,$2
sec89:
mfhi $2
addiu $6,$2,6142
lh $2,12($0)
sltu $3,$6,$2
sec90:
mflo $2
mflo $6
nop
sltu $5,$6,$2
sec91:
mfhi $2
mflo $6
subu $2,$1,$4
sltu $5,$6,$2
sec92:
mfhi $2
mfhi $6
addiu $2,$1,3790
sltu $2,$6,$2
sec93:
mflo $2
mflo $6
mflo $2
sltu $3,$6,$2
sec94:
mflo $2
mflo $6
lw $2,12($0)
sltu $4,$6,$2
sec95:
mflo $2
lh $6,2($0)
nop
sltu $4,$6,$2
sec96:
mflo $2
lb $6,4($0)
addu $2,$0,$4
sltu $0,$6,$2
sec97:
mfhi $2
lbu $6,10($0)
slti $2,$6,28996
sltu $6,$6,$2
sec98:
mfhi $2
lh $6,2($0)
mflo $2
sltu $0,$6,$2
sec99:
mfhi $2
lbu $6,12($0)
lb $2,5($0)
sltu $5,$6,$2
sec100:
lb $2,2($0)
nop
nop
sltu $3,$6,$2
sec101:
lw $2,16($0)
nop
nor $2,$1,$0
sltu $1,$6,$2
sec102:
lw $2,8($0)
nop
xori $2,$2,38566
sltu $0,$6,$2
sec103:
lbu $2,1($0)
nop
mflo $2
sltu $4,$6,$2
sec104:
lhu $2,8($0)
nop
lw $2,16($0)
sltu $4,$6,$2
sec105:
lh $2,0($0)
or $6,$3,$1
nop
sltu $1,$6,$2
sec106:
lb $2,13($0)
and $6,$4,$4
or $2,$3,$4
sltu $3,$6,$2
sec107:
lb $2,0($0)
xor $6,$4,$3
ori $2,$4,60075
sltu $2,$6,$2
sec108:
lw $2,8($0)
xor $6,$0,$3
mflo $2
sltu $4,$6,$2
sec109:
lb $2,14($0)
or $6,$6,$3
lw $2,4($0)
sltu $3,$6,$2
sec110:
lh $2,10($0)
ori $6,$4,38756
nop
sltu $2,$6,$2
sec111:
lbu $2,10($0)
xori $6,$3,31596
xor $2,$1,$2
sltu $3,$6,$2
sec112:
lb $2,13($0)
sltiu $6,$3,14533
sltiu $2,$3,15815
sltu $3,$6,$2
sec113:
lb $2,5($0)
slti $6,$1,9095
mflo $2
sltu $0,$6,$2
sec114:
lbu $2,7($0)
addiu $6,$5,-3229
lw $2,12($0)
sltu $3,$6,$2
sec115:
lhu $2,16($0)
mflo $6
nop
sltu $4,$6,$2
sec116:
lhu $2,14($0)
mflo $6
and $2,$2,$5
sltu $2,$6,$2
sec117:
lh $2,12($0)
mflo $6
sltiu $2,$4,20318
sltu $5,$6,$2
sec118:
lbu $2,12($0)
mflo $6
mfhi $2
sltu $5,$6,$2
sec119:
lhu $2,14($0)
mfhi $6
lh $2,6($0)
sltu $2,$6,$2
sec120:
lb $2,6($0)
lb $6,9($0)
nop
sltu $1,$6,$2
sec121:
lb $2,10($0)
lb $6,2($0)
and $2,$1,$5
sltu $4,$6,$2
sec122:
lbu $2,7($0)
lw $6,0($0)
sltiu $2,$1,22095
sltu $5,$6,$2
sec123:
lh $2,16($0)
lbu $6,9($0)
mfhi $2
sltu $5,$6,$2
sec124:
lh $2,14($0)
lbu $6,7($0)
lbu $2,10($0)
sltu $0,$6,$2
|
oeis/203/A203153.asm | neoneye/loda-programs | 11 | 96428 | <filename>oeis/203/A203153.asm
; A203153: (n-1)-st elementary symmetric function of {2, 2, 3, 3, 4, 4, 5, 5, ..., floor((n+3)/2)}.
; Submitted by <NAME>
; 1,4,16,60,276,1248,6816,36960,236160,1503360,11041920,80922240,672779520,5585448960,51894743040,481684008960,4948521984000,50802038784000,571990616064000,6436746860544000,78834313248768000,965131970052096000,12776158143479808000,169072808791670784000,2405795111127023616000,34223992588389187584000,520959943282389811200000,7928399966084127129600000,128564411710070233497600000,2084390783404710926745600000,35872406454577480807219200000,617272883051672889615974400000,11237425441435659183272755200000
add $0,1
mov $1,1
mov $2,1
lpb $0
sub $0,1
add $2,1
mul $3,$2
add $3,$1
mul $1,$2
min $2,$0
lpe
mov $0,$3
|
ioq3/build/release-js-js/missionpack/cgame/cg_event.asm | RawTechnique/quake-port | 1 | 27389 | bss
align 1
LABELV $72
skip 64
export CG_PlaceString
code
proc CG_PlaceString 12 20
ADDRFP4 0
ADDRFP4 0
INDIRI4
ASGNI4
ADDRFP4 0
INDIRI4
CNSTI4 16384
BANDI4
CNSTI4 0
EQI4 $73
ADDRFP4 0
ADDRFP4 0
INDIRI4
CNSTI4 -16385
BANDI4
ASGNI4
ADDRLP4 4
ADDRGP4 $75
ASGNP4
ADDRGP4 $74
JUMPV
LABELV $73
ADDRLP4 4
ADDRGP4 $76
ASGNP4
LABELV $74
ADDRFP4 0
INDIRI4
CNSTI4 1
NEI4 $77
ADDRLP4 0
ADDRGP4 $79
ASGNP4
ADDRGP4 $78
JUMPV
LABELV $77
ADDRFP4 0
INDIRI4
CNSTI4 2
NEI4 $80
ADDRLP4 0
ADDRGP4 $82
ASGNP4
ADDRGP4 $81
JUMPV
LABELV $80
ADDRFP4 0
INDIRI4
CNSTI4 3
NEI4 $83
ADDRLP4 0
ADDRGP4 $85
ASGNP4
ADDRGP4 $84
JUMPV
LABELV $83
ADDRFP4 0
INDIRI4
CNSTI4 11
NEI4 $86
ADDRLP4 0
ADDRGP4 $88
ASGNP4
ADDRGP4 $87
JUMPV
LABELV $86
ADDRFP4 0
INDIRI4
CNSTI4 12
NEI4 $89
ADDRLP4 0
ADDRGP4 $91
ASGNP4
ADDRGP4 $90
JUMPV
LABELV $89
ADDRFP4 0
INDIRI4
CNSTI4 13
NEI4 $92
ADDRLP4 0
ADDRGP4 $94
ASGNP4
ADDRGP4 $93
JUMPV
LABELV $92
ADDRFP4 0
INDIRI4
CNSTI4 10
MODI4
CNSTI4 1
NEI4 $95
ADDRGP4 $97
ARGP4
ADDRFP4 0
INDIRI4
ARGI4
ADDRLP4 8
ADDRGP4 va
CALLP4
ASGNP4
ADDRLP4 0
ADDRLP4 8
INDIRP4
ASGNP4
ADDRGP4 $96
JUMPV
LABELV $95
ADDRFP4 0
INDIRI4
CNSTI4 10
MODI4
CNSTI4 2
NEI4 $98
ADDRGP4 $100
ARGP4
ADDRFP4 0
INDIRI4
ARGI4
ADDRLP4 8
ADDRGP4 va
CALLP4
ASGNP4
ADDRLP4 0
ADDRLP4 8
INDIRP4
ASGNP4
ADDRGP4 $99
JUMPV
LABELV $98
ADDRFP4 0
INDIRI4
CNSTI4 10
MODI4
CNSTI4 3
NEI4 $101
ADDRGP4 $103
ARGP4
ADDRFP4 0
INDIRI4
ARGI4
ADDRLP4 8
ADDRGP4 va
CALLP4
ASGNP4
ADDRLP4 0
ADDRLP4 8
INDIRP4
ASGNP4
ADDRGP4 $102
JUMPV
LABELV $101
ADDRGP4 $104
ARGP4
ADDRFP4 0
INDIRI4
ARGI4
ADDRLP4 8
ADDRGP4 va
CALLP4
ASGNP4
ADDRLP4 0
ADDRLP4 8
INDIRP4
ASGNP4
LABELV $102
LABELV $99
LABELV $96
LABELV $93
LABELV $90
LABELV $87
LABELV $84
LABELV $81
LABELV $78
ADDRGP4 $72
ARGP4
CNSTI4 64
ARGI4
ADDRGP4 $105
ARGP4
ADDRLP4 4
INDIRP4
ARGP4
ADDRLP4 0
INDIRP4
ARGP4
ADDRGP4 Com_sprintf
CALLI4
pop
ADDRGP4 $72
RETP4
LABELV $71
endproc CG_PlaceString 12 20
proc CG_Obituary 140 20
ADDRFP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 4
ADDRFP4 0
INDIRP4
CNSTI4 140
ADDP4
INDIRI4
ASGNI4
ADDRLP4 0
ADDRFP4 0
INDIRP4
CNSTI4 144
ADDP4
INDIRI4
ASGNI4
ADDRLP4 44
ADDRFP4 0
INDIRP4
CNSTI4 184
ADDP4
INDIRI4
ASGNI4
ADDRLP4 4
INDIRI4
CNSTI4 0
LTI4 $109
ADDRLP4 4
INDIRI4
CNSTI4 64
LTI4 $107
LABELV $109
ADDRGP4 $110
ARGP4
ADDRGP4 CG_Error
CALLV
pop
LABELV $107
ADDRLP4 92
CNSTI4 1716
ADDRLP4 4
INDIRI4
MULI4
ADDRGP4 cgs+40972
ADDP4
ASGNP4
ADDRLP4 0
INDIRI4
CNSTI4 0
LTI4 $114
ADDRLP4 0
INDIRI4
CNSTI4 64
LTI4 $112
LABELV $114
ADDRLP4 0
CNSTI4 1022
ASGNI4
ADDRLP4 52
CNSTP4 0
ASGNP4
ADDRGP4 $113
JUMPV
LABELV $112
ADDRLP4 0
INDIRI4
CNSTI4 544
ADDI4
ARGI4
ADDRLP4 112
ADDRGP4 CG_ConfigString
CALLP4
ASGNP4
ADDRLP4 52
ADDRLP4 112
INDIRP4
ASGNP4
LABELV $113
ADDRLP4 4
INDIRI4
CNSTI4 544
ADDI4
ARGI4
ADDRLP4 112
ADDRGP4 CG_ConfigString
CALLP4
ASGNP4
ADDRLP4 48
ADDRLP4 112
INDIRP4
ASGNP4
ADDRLP4 48
INDIRP4
CVPU4 4
CNSTU4 0
NEU4 $115
ADDRGP4 $106
JUMPV
LABELV $115
ADDRLP4 48
INDIRP4
ARGP4
ADDRGP4 $117
ARGP4
ADDRLP4 116
ADDRGP4 Info_ValueForKey
CALLP4
ASGNP4
ADDRLP4 8
ARGP4
ADDRLP4 116
INDIRP4
ARGP4
CNSTI4 30
ARGI4
ADDRGP4 Q_strncpyz
CALLV
pop
ADDRLP4 8
ARGP4
ADDRGP4 $118
ARGP4
ADDRGP4 qk_strcat
CALLP4
pop
ADDRLP4 88
ADDRGP4 $76
ASGNP4
ADDRLP4 44
INDIRI4
CNSTI4 14
LTI4 $119
ADDRLP4 44
INDIRI4
CNSTI4 22
GTI4 $119
ADDRLP4 44
INDIRI4
CNSTI4 2
LSHI4
ADDRGP4 $137-56
ADDP4
INDIRP4
JUMPV
lit
align 4
LABELV $137
address $127
address $129
address $131
address $125
address $119
address $123
address $121
address $133
address $135
code
LABELV $121
ADDRLP4 40
ADDRGP4 $122
ASGNP4
ADDRGP4 $120
JUMPV
LABELV $123
ADDRLP4 40
ADDRGP4 $124
ASGNP4
ADDRGP4 $120
JUMPV
LABELV $125
ADDRLP4 40
ADDRGP4 $126
ASGNP4
ADDRGP4 $120
JUMPV
LABELV $127
ADDRLP4 40
ADDRGP4 $128
ASGNP4
ADDRGP4 $120
JUMPV
LABELV $129
ADDRLP4 40
ADDRGP4 $130
ASGNP4
ADDRGP4 $120
JUMPV
LABELV $131
ADDRLP4 40
ADDRGP4 $132
ASGNP4
ADDRGP4 $120
JUMPV
LABELV $133
ADDRLP4 40
ADDRGP4 $134
ASGNP4
ADDRGP4 $120
JUMPV
LABELV $135
ADDRLP4 40
ADDRGP4 $136
ASGNP4
ADDRGP4 $120
JUMPV
LABELV $119
ADDRLP4 40
CNSTP4 0
ASGNP4
LABELV $120
ADDRLP4 0
INDIRI4
ADDRLP4 4
INDIRI4
NEI4 $139
ADDRLP4 96
ADDRLP4 92
INDIRP4
CNSTI4 520
ADDP4
INDIRI4
ASGNI4
ADDRLP4 128
CNSTI4 13
ASGNI4
ADDRLP4 44
INDIRI4
ADDRLP4 128
INDIRI4
EQI4 $169
ADDRLP4 44
INDIRI4
ADDRLP4 128
INDIRI4
GTI4 $187
LABELV $186
ADDRLP4 44
INDIRI4
CNSTI4 5
EQI4 $145
ADDRLP4 44
INDIRI4
CNSTI4 7
EQI4 $153
ADDRLP4 44
INDIRI4
CNSTI4 9
EQI4 $161
ADDRGP4 $141
JUMPV
LABELV $187
ADDRLP4 44
INDIRI4
CNSTI4 25
EQI4 $171
ADDRLP4 44
INDIRI4
CNSTI4 26
EQI4 $143
ADDRGP4 $141
JUMPV
LABELV $143
ADDRLP4 40
ADDRGP4 $144
ASGNP4
ADDRGP4 $142
JUMPV
LABELV $145
ADDRLP4 96
INDIRI4
CNSTI4 1
NEI4 $146
ADDRLP4 40
ADDRGP4 $148
ASGNP4
ADDRGP4 $142
JUMPV
LABELV $146
ADDRLP4 96
INDIRI4
CNSTI4 2
NEI4 $149
ADDRLP4 40
ADDRGP4 $151
ASGNP4
ADDRGP4 $142
JUMPV
LABELV $149
ADDRLP4 40
ADDRGP4 $152
ASGNP4
ADDRGP4 $142
JUMPV
LABELV $153
ADDRLP4 96
INDIRI4
CNSTI4 1
NEI4 $154
ADDRLP4 40
ADDRGP4 $156
ASGNP4
ADDRGP4 $142
JUMPV
LABELV $154
ADDRLP4 96
INDIRI4
CNSTI4 2
NEI4 $157
ADDRLP4 40
ADDRGP4 $159
ASGNP4
ADDRGP4 $142
JUMPV
LABELV $157
ADDRLP4 40
ADDRGP4 $160
ASGNP4
ADDRGP4 $142
JUMPV
LABELV $161
ADDRLP4 96
INDIRI4
CNSTI4 1
NEI4 $162
ADDRLP4 40
ADDRGP4 $164
ASGNP4
ADDRGP4 $142
JUMPV
LABELV $162
ADDRLP4 96
INDIRI4
CNSTI4 2
NEI4 $165
ADDRLP4 40
ADDRGP4 $167
ASGNP4
ADDRGP4 $142
JUMPV
LABELV $165
ADDRLP4 40
ADDRGP4 $168
ASGNP4
ADDRGP4 $142
JUMPV
LABELV $169
ADDRLP4 40
ADDRGP4 $170
ASGNP4
ADDRGP4 $142
JUMPV
LABELV $171
ADDRLP4 96
INDIRI4
CNSTI4 1
NEI4 $172
ADDRLP4 40
ADDRGP4 $174
ASGNP4
ADDRGP4 $142
JUMPV
LABELV $172
ADDRLP4 96
INDIRI4
CNSTI4 2
NEI4 $175
ADDRLP4 40
ADDRGP4 $177
ASGNP4
ADDRGP4 $142
JUMPV
LABELV $175
ADDRLP4 40
ADDRGP4 $178
ASGNP4
ADDRGP4 $142
JUMPV
LABELV $141
ADDRLP4 96
INDIRI4
CNSTI4 1
NEI4 $179
ADDRLP4 40
ADDRGP4 $181
ASGNP4
ADDRGP4 $142
JUMPV
LABELV $179
ADDRLP4 96
INDIRI4
CNSTI4 2
NEI4 $182
ADDRLP4 40
ADDRGP4 $184
ASGNP4
ADDRGP4 $142
JUMPV
LABELV $182
ADDRLP4 40
ADDRGP4 $185
ASGNP4
LABELV $142
LABELV $139
ADDRLP4 40
INDIRP4
CVPU4 4
CNSTU4 0
EQU4 $188
ADDRGP4 $190
ARGP4
ADDRLP4 8
ARGP4
ADDRLP4 40
INDIRP4
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
ADDRGP4 $106
JUMPV
LABELV $188
ADDRLP4 0
INDIRI4
ADDRGP4 cg+36
INDIRP4
CNSTI4 184
ADDP4
INDIRI4
NEI4 $191
ADDRGP4 cgs+31456
INDIRI4
CNSTI4 3
GEI4 $194
ADDRGP4 cg+36
INDIRP4
CNSTI4 300
ADDP4
INDIRI4
CNSTI4 1
ADDI4
ARGI4
ADDRLP4 128
ADDRGP4 CG_PlaceString
CALLP4
ASGNP4
ADDRGP4 $197
ARGP4
ADDRLP4 8
ARGP4
ADDRLP4 128
INDIRP4
ARGP4
ADDRGP4 cg+36
INDIRP4
CNSTI4 292
ADDP4
INDIRI4
ARGI4
ADDRLP4 132
ADDRGP4 va
CALLP4
ASGNP4
ADDRLP4 124
ADDRLP4 132
INDIRP4
ASGNP4
ADDRGP4 $195
JUMPV
LABELV $194
ADDRGP4 $200
ARGP4
ADDRLP4 8
ARGP4
ADDRLP4 128
ADDRGP4 va
CALLP4
ASGNP4
ADDRLP4 124
ADDRLP4 128
INDIRP4
ASGNP4
LABELV $195
ADDRLP4 128
CNSTI4 0
ASGNI4
ADDRGP4 cg_singlePlayerActive+12
INDIRI4
ADDRLP4 128
INDIRI4
EQI4 $205
ADDRGP4 cg_cameraOrbit+12
INDIRI4
ADDRLP4 128
INDIRI4
NEI4 $201
LABELV $205
ADDRLP4 124
INDIRP4
ARGP4
CNSTI4 144
ARGI4
CNSTI4 16
ARGI4
ADDRGP4 CG_CenterPrint
CALLV
pop
LABELV $201
LABELV $191
ADDRLP4 52
INDIRP4
CVPU4 4
CNSTU4 0
NEU4 $206
ADDRLP4 0
CNSTI4 1022
ASGNI4
ADDRLP4 56
ARGP4
ADDRGP4 $208
ARGP4
ADDRGP4 qk_strcpy
CALLP4
pop
ADDRGP4 $207
JUMPV
LABELV $206
ADDRLP4 52
INDIRP4
ARGP4
ADDRGP4 $117
ARGP4
ADDRLP4 124
ADDRGP4 Info_ValueForKey
CALLP4
ASGNP4
ADDRLP4 56
ARGP4
ADDRLP4 124
INDIRP4
ARGP4
CNSTI4 30
ARGI4
ADDRGP4 Q_strncpyz
CALLV
pop
ADDRLP4 56
ARGP4
ADDRGP4 $118
ARGP4
ADDRGP4 qk_strcat
CALLP4
pop
ADDRLP4 4
INDIRI4
ADDRGP4 cg+36
INDIRP4
CNSTI4 184
ADDP4
INDIRI4
NEI4 $209
ADDRGP4 cg+114320
ARGP4
ADDRLP4 56
ARGP4
CNSTI4 32
ARGI4
ADDRGP4 Q_strncpyz
CALLV
pop
LABELV $209
LABELV $207
ADDRLP4 0
INDIRI4
CNSTI4 1022
EQI4 $214
ADDRLP4 44
INDIRI4
CNSTI4 1
LTI4 $216
ADDRLP4 44
INDIRI4
CNSTI4 28
GTI4 $216
ADDRLP4 44
INDIRI4
CNSTI4 2
LSHI4
ADDRGP4 $264-4
ADDP4
INDIRP4
JUMPV
lit
align 4
LABELV $264
address $224
address $220
address $222
address $226
address $229
address $232
address $234
address $236
address $239
address $240
address $242
address $244
address $244
address $216
address $216
address $216
address $216
address $260
address $216
address $216
address $216
address $216
address $247
address $249
address $252
address $255
address $258
address $218
code
LABELV $218
ADDRLP4 40
ADDRGP4 $219
ASGNP4
ADDRGP4 $217
JUMPV
LABELV $220
ADDRLP4 40
ADDRGP4 $221
ASGNP4
ADDRGP4 $217
JUMPV
LABELV $222
ADDRLP4 40
ADDRGP4 $223
ASGNP4
ADDRGP4 $217
JUMPV
LABELV $224
ADDRLP4 40
ADDRGP4 $225
ASGNP4
ADDRGP4 $217
JUMPV
LABELV $226
ADDRLP4 40
ADDRGP4 $227
ASGNP4
ADDRLP4 88
ADDRGP4 $228
ASGNP4
ADDRGP4 $217
JUMPV
LABELV $229
ADDRLP4 40
ADDRGP4 $230
ASGNP4
ADDRLP4 88
ADDRGP4 $231
ASGNP4
ADDRGP4 $217
JUMPV
LABELV $232
ADDRLP4 40
ADDRGP4 $227
ASGNP4
ADDRLP4 88
ADDRGP4 $233
ASGNP4
ADDRGP4 $217
JUMPV
LABELV $234
ADDRLP4 40
ADDRGP4 $235
ASGNP4
ADDRLP4 88
ADDRGP4 $233
ASGNP4
ADDRGP4 $217
JUMPV
LABELV $236
ADDRLP4 40
ADDRGP4 $237
ASGNP4
ADDRLP4 88
ADDRGP4 $238
ASGNP4
ADDRGP4 $217
JUMPV
LABELV $239
ADDRLP4 40
ADDRGP4 $237
ASGNP4
ADDRLP4 88
ADDRGP4 $238
ASGNP4
ADDRGP4 $217
JUMPV
LABELV $240
ADDRLP4 40
ADDRGP4 $241
ASGNP4
ADDRGP4 $217
JUMPV
LABELV $242
ADDRLP4 40
ADDRGP4 $243
ASGNP4
ADDRGP4 $217
JUMPV
LABELV $244
ADDRLP4 40
ADDRGP4 $245
ASGNP4
ADDRLP4 88
ADDRGP4 $246
ASGNP4
ADDRGP4 $217
JUMPV
LABELV $247
ADDRLP4 40
ADDRGP4 $248
ASGNP4
ADDRGP4 $217
JUMPV
LABELV $249
ADDRLP4 40
ADDRGP4 $250
ASGNP4
ADDRLP4 88
ADDRGP4 $251
ASGNP4
ADDRGP4 $217
JUMPV
LABELV $252
ADDRLP4 40
ADDRGP4 $253
ASGNP4
ADDRLP4 88
ADDRGP4 $254
ASGNP4
ADDRGP4 $217
JUMPV
LABELV $255
ADDRLP4 40
ADDRGP4 $256
ASGNP4
ADDRLP4 88
ADDRGP4 $257
ASGNP4
ADDRGP4 $217
JUMPV
LABELV $258
ADDRLP4 40
ADDRGP4 $259
ASGNP4
ADDRGP4 $217
JUMPV
LABELV $260
ADDRLP4 40
ADDRGP4 $261
ASGNP4
ADDRLP4 88
ADDRGP4 $262
ASGNP4
ADDRGP4 $217
JUMPV
LABELV $216
ADDRLP4 40
ADDRGP4 $263
ASGNP4
LABELV $217
ADDRLP4 40
INDIRP4
CVPU4 4
CNSTU4 0
EQU4 $266
ADDRGP4 $268
ARGP4
ADDRLP4 8
ARGP4
ADDRLP4 40
INDIRP4
ARGP4
ADDRLP4 56
ARGP4
ADDRLP4 88
INDIRP4
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
ADDRGP4 $106
JUMPV
LABELV $266
LABELV $214
ADDRGP4 $269
ARGP4
ADDRLP4 8
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $106
endproc CG_Obituary 140 20
proc CG_UseItem 32 16
ADDRLP4 4
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 0
ADDRLP4 4
INDIRP4
CNSTI4 180
ADDP4
INDIRI4
CNSTI4 -769
BANDI4
CNSTI4 24
SUBI4
ASGNI4
ADDRLP4 0
INDIRI4
CNSTI4 0
LTI4 $273
ADDRLP4 0
INDIRI4
CNSTI4 6
LEI4 $271
LABELV $273
ADDRLP4 0
CNSTI4 0
ASGNI4
LABELV $271
ADDRLP4 4
INDIRP4
INDIRI4
ADDRGP4 cg+36
INDIRP4
CNSTI4 184
ADDP4
INDIRI4
NEI4 $274
ADDRLP4 0
INDIRI4
CNSTI4 0
NEI4 $277
ADDRGP4 $279
ARGP4
CNSTI4 144
ARGI4
CNSTI4 16
ARGI4
ADDRGP4 CG_CenterPrint
CALLV
pop
ADDRGP4 $278
JUMPV
LABELV $277
ADDRLP4 0
INDIRI4
ARGI4
ADDRLP4 24
ADDRGP4 BG_FindItemForHoldable
CALLP4
ASGNP4
ADDRLP4 8
ADDRLP4 24
INDIRP4
ASGNP4
ADDRGP4 $280
ARGP4
ADDRLP4 8
INDIRP4
CNSTI4 28
ADDP4
INDIRP4
ARGP4
ADDRLP4 28
ADDRGP4 va
CALLP4
ASGNP4
ADDRLP4 28
INDIRP4
ARGP4
CNSTI4 144
ARGI4
CNSTI4 16
ARGI4
ADDRGP4 CG_CenterPrint
CALLV
pop
LABELV $278
LABELV $274
ADDRLP4 0
INDIRI4
CNSTI4 0
LTI4 $281
ADDRLP4 0
INDIRI4
CNSTI4 5
GTI4 $281
ADDRLP4 0
INDIRI4
CNSTI4 2
LSHI4
ADDRGP4 $299
ADDP4
INDIRP4
JUMPV
lit
align 4
LABELV $299
address $283
address $282
address $287
address $282
address $282
address $296
code
LABELV $281
LABELV $283
CNSTP4 0
ARGP4
ADDRLP4 4
INDIRP4
INDIRI4
ARGI4
CNSTI4 5
ARGI4
ADDRGP4 cgs+152852+632
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $282
JUMPV
LABELV $287
ADDRLP4 12
ADDRFP4 0
INDIRP4
CNSTI4 168
ADDP4
INDIRI4
ASGNI4
ADDRLP4 28
ADDRLP4 12
INDIRI4
ASGNI4
ADDRLP4 28
INDIRI4
CNSTI4 0
LTI4 $288
ADDRLP4 28
INDIRI4
CNSTI4 64
GEI4 $288
ADDRLP4 16
CNSTI4 1716
ADDRLP4 12
INDIRI4
MULI4
ADDRGP4 cgs+40972
ADDP4
ASGNP4
ADDRLP4 16
INDIRP4
CNSTI4 152
ADDP4
ADDRGP4 cg+107604
INDIRI4
ASGNI4
LABELV $288
CNSTP4 0
ARGP4
ADDRLP4 4
INDIRP4
INDIRI4
ARGI4
CNSTI4 5
ARGI4
ADDRGP4 cgs+152852+1032
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $282
JUMPV
LABELV $296
CNSTP4 0
ARGP4
ADDRLP4 4
INDIRP4
INDIRI4
ARGI4
CNSTI4 5
ARGI4
ADDRGP4 cgs+152852+824
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
LABELV $282
LABELV $270
endproc CG_UseItem 32 16
proc CG_ItemPickup 0 0
ADDRGP4 cg+124648
ADDRFP4 0
INDIRI4
ASGNI4
ADDRGP4 cg+124652
ADDRGP4 cg+107604
INDIRI4
ASGNI4
ADDRGP4 cg+124656
ADDRGP4 cg+107604
INDIRI4
ASGNI4
CNSTI4 52
ADDRFP4 0
INDIRI4
MULI4
ADDRGP4 bg_itemlist+36
ADDP4
INDIRI4
CNSTI4 1
NEI4 $306
ADDRGP4 cg_autoswitch+12
INDIRI4
CNSTI4 0
EQI4 $309
CNSTI4 52
ADDRFP4 0
INDIRI4
MULI4
ADDRGP4 bg_itemlist+40
ADDP4
INDIRI4
CNSTI4 2
EQI4 $309
ADDRGP4 cg+124660
ADDRGP4 cg+107604
INDIRI4
ASGNI4
ADDRGP4 cg+108932
CNSTI4 52
ADDRFP4 0
INDIRI4
MULI4
ADDRGP4 bg_itemlist+40
ADDP4
INDIRI4
ASGNI4
LABELV $309
LABELV $306
LABELV $300
endproc CG_ItemPickup 0 0
export CG_WaterLevel
proc CG_WaterLevel 52 8
ADDRLP4 20
CNSTI4 0
ASGNI4
ADDRLP4 0
ADDRFP4 0
INDIRP4
CNSTI4 692
ADDP4
INDIRB
ASGNB 12
ADDRLP4 0+8
ADDRLP4 0+8
INDIRF4
CNSTF4 3250061312
ADDF4
ASGNF4
ADDRLP4 16
ADDRFP4 0
INDIRP4
CNSTI4 196
ADDP4
INDIRI4
CNSTI4 -129
BANDI4
ASGNI4
ADDRLP4 16
INDIRI4
CNSTI4 13
EQI4 $321
ADDRLP4 16
INDIRI4
CNSTI4 23
NEI4 $319
LABELV $321
ADDRLP4 0+8
ADDRLP4 0+8
INDIRF4
CNSTF4 1094713344
ADDF4
ASGNF4
ADDRGP4 $320
JUMPV
LABELV $319
ADDRLP4 0+8
ADDRLP4 0+8
INDIRF4
CNSTF4 1104150528
ADDF4
ASGNF4
LABELV $320
ADDRLP4 0
ARGP4
CNSTI4 -1
ARGI4
ADDRLP4 36
ADDRGP4 CG_PointContents
CALLI4
ASGNI4
ADDRLP4 12
ADDRLP4 36
INDIRI4
ASGNI4
ADDRLP4 12
INDIRI4
CNSTI4 56
BANDI4
CNSTI4 0
EQI4 $324
ADDRLP4 40
CNSTF4 3250585600
ASGNF4
ADDRLP4 24
ADDRLP4 0+8
INDIRF4
ADDRLP4 40
INDIRF4
SUBF4
CVFI4 4
ASGNI4
ADDRLP4 28
ADDRLP4 24
INDIRI4
CNSTI4 2
DIVI4
ASGNI4
ADDRLP4 20
CNSTI4 1
ASGNI4
ADDRLP4 0+8
ADDRFP4 0
INDIRP4
CNSTI4 700
ADDP4
INDIRF4
ADDRLP4 40
INDIRF4
ADDF4
ADDRLP4 28
INDIRI4
CVIF4 4
ADDF4
ASGNF4
ADDRLP4 0
ARGP4
CNSTI4 -1
ARGI4
ADDRLP4 44
ADDRGP4 CG_PointContents
CALLI4
ASGNI4
ADDRLP4 12
ADDRLP4 44
INDIRI4
ASGNI4
ADDRLP4 12
INDIRI4
CNSTI4 56
BANDI4
CNSTI4 0
EQI4 $328
ADDRLP4 20
CNSTI4 2
ASGNI4
ADDRLP4 0+8
ADDRFP4 0
INDIRP4
CNSTI4 700
ADDP4
INDIRF4
CNSTF4 3250585600
ADDF4
ADDRLP4 24
INDIRI4
CVIF4 4
ADDF4
ASGNF4
ADDRLP4 0
ARGP4
CNSTI4 -1
ARGI4
ADDRLP4 48
ADDRGP4 CG_PointContents
CALLI4
ASGNI4
ADDRLP4 12
ADDRLP4 48
INDIRI4
ASGNI4
ADDRLP4 12
INDIRI4
CNSTI4 56
BANDI4
CNSTI4 0
EQI4 $331
ADDRLP4 20
CNSTI4 3
ASGNI4
LABELV $331
LABELV $328
LABELV $324
ADDRLP4 20
INDIRI4
RETI4
LABELV $317
endproc CG_WaterLevel 52 8
export CG_PainEvent
proc CG_PainEvent 16 16
ADDRFP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRGP4 cg+107604
INDIRI4
ADDRFP4 0
INDIRP4
CNSTI4 596
ADDP4
INDIRI4
SUBI4
CNSTI4 500
GEI4 $334
ADDRGP4 $333
JUMPV
LABELV $334
ADDRFP4 4
INDIRI4
CNSTI4 25
GEI4 $337
ADDRLP4 0
ADDRGP4 $339
ASGNP4
ADDRGP4 $338
JUMPV
LABELV $337
ADDRFP4 4
INDIRI4
CNSTI4 50
GEI4 $340
ADDRLP4 0
ADDRGP4 $342
ASGNP4
ADDRGP4 $341
JUMPV
LABELV $340
ADDRFP4 4
INDIRI4
CNSTI4 75
GEI4 $343
ADDRLP4 0
ADDRGP4 $345
ASGNP4
ADDRGP4 $344
JUMPV
LABELV $343
ADDRLP4 0
ADDRGP4 $346
ASGNP4
LABELV $344
LABELV $341
LABELV $338
ADDRFP4 0
INDIRP4
ARGP4
ADDRLP4 4
ADDRGP4 CG_WaterLevel
CALLI4
ASGNI4
ADDRLP4 4
INDIRI4
CNSTI4 1
LTI4 $347
ADDRLP4 8
ADDRGP4 qk_rand
CALLI4
ASGNI4
ADDRLP4 8
INDIRI4
CNSTI4 1
BANDI4
CNSTI4 0
EQI4 $349
ADDRFP4 0
INDIRP4
INDIRI4
ARGI4
ADDRGP4 $351
ARGP4
ADDRLP4 12
ADDRGP4 CG_CustomSound
CALLI4
ASGNI4
CNSTP4 0
ARGP4
ADDRFP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 3
ARGI4
ADDRLP4 12
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $348
JUMPV
LABELV $349
ADDRFP4 0
INDIRP4
INDIRI4
ARGI4
ADDRGP4 $352
ARGP4
ADDRLP4 12
ADDRGP4 CG_CustomSound
CALLI4
ASGNI4
CNSTP4 0
ARGP4
ADDRFP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 3
ARGI4
ADDRLP4 12
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $348
JUMPV
LABELV $347
ADDRFP4 0
INDIRP4
INDIRI4
ARGI4
ADDRLP4 0
INDIRP4
ARGP4
ADDRLP4 8
ADDRGP4 CG_CustomSound
CALLI4
ASGNI4
CNSTP4 0
ARGP4
ADDRFP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 3
ARGI4
ADDRLP4 8
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
LABELV $348
ADDRFP4 0
INDIRP4
CNSTI4 596
ADDP4
ADDRGP4 cg+107604
INDIRI4
ASGNI4
ADDRLP4 8
ADDRFP4 0
INDIRP4
CNSTI4 600
ADDP4
ASGNP4
ADDRLP4 8
INDIRP4
ADDRLP4 8
INDIRP4
INDIRI4
CNSTI4 1
BXORI4
ASGNI4
LABELV $333
endproc CG_PainEvent 16 16
lit
align 4
LABELV $500
byte 4 0
byte 4 0
byte 4 1065353216
export CG_EntityEvent
code
proc CG_EntityEvent 116 48
ADDRFP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 8
ADDRLP4 0
INDIRP4
CNSTI4 180
ADDP4
INDIRI4
CNSTI4 -769
BANDI4
ASGNI4
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $355
ADDRGP4 $358
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
ADDRLP4 8
INDIRI4
ARGI4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $355
ADDRLP4 8
INDIRI4
CNSTI4 0
NEI4 $359
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $354
ADDRGP4 $364
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
ADDRGP4 $354
JUMPV
LABELV $359
ADDRLP4 4
ADDRLP4 0
INDIRP4
CNSTI4 168
ADDP4
INDIRI4
ASGNI4
ADDRLP4 4
INDIRI4
CNSTI4 0
LTI4 $367
ADDRLP4 4
INDIRI4
CNSTI4 64
LTI4 $365
LABELV $367
ADDRLP4 4
CNSTI4 0
ASGNI4
LABELV $365
ADDRLP4 12
CNSTI4 1716
ADDRLP4 4
INDIRI4
MULI4
ADDRGP4 cgs+40972
ADDP4
ASGNP4
ADDRLP4 8
INDIRI4
CNSTI4 1
LTI4 $369
ADDRLP4 8
INDIRI4
CNSTI4 82
GTI4 $369
ADDRLP4 8
INDIRI4
CNSTI4 2
LSHI4
ADDRGP4 $1123-4
ADDP4
INDIRP4
JUMPV
lit
align 4
LABELV $1123
address $371
address $381
address $392
address $403
address $414
address $465
address $465
address $465
address $465
address $425
address $439
address $451
address $495
address $507
address $554
address $561
address $568
address $575
address $581
address $616
address $630
address $638
address $645
address $650
address $655
address $660
address $665
address $670
address $675
address $680
address $685
address $690
address $695
address $700
address $705
address $710
address $715
address $720
address $369
address $746
address $739
address $725
address $732
address $754
address $891
address $900
address $911
address $881
address $876
address $822
address $827
address $832
address $837
address $886
address $369
address $1038
address $1046
address $1046
address $1046
address $1055
address $1060
address $1073
address $1086
address $1099
address $817
address $765
address $780
address $787
address $792
address $797
address $802
address $807
address $812
address $1113
address $1108
address $512
address $518
address $524
address $530
address $536
address $542
address $548
code
LABELV $371
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $372
ADDRGP4 $375
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $372
ADDRGP4 cg_footsteps+12
INDIRI4
CNSTI4 0
EQI4 $370
ADDRLP4 40
ADDRGP4 qk_rand
CALLI4
ASGNI4
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 5
ARGI4
ADDRLP4 40
INDIRI4
CNSTI4 3
BANDI4
CNSTI4 2
LSHI4
ADDRLP4 12
INDIRP4
CNSTI4 516
ADDP4
INDIRI4
CNSTI4 4
LSHI4
ADDRGP4 cgs+152852+640
ADDP4
ADDP4
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $381
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $382
ADDRGP4 $385
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $382
ADDRGP4 cg_footsteps+12
INDIRI4
CNSTI4 0
EQI4 $370
ADDRLP4 40
ADDRGP4 qk_rand
CALLI4
ASGNI4
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 5
ARGI4
ADDRLP4 40
INDIRI4
CNSTI4 3
BANDI4
CNSTI4 2
LSHI4
ADDRGP4 cgs+152852+640+80
ADDP4
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $392
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $393
ADDRGP4 $396
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $393
ADDRGP4 cg_footsteps+12
INDIRI4
CNSTI4 0
EQI4 $370
ADDRLP4 40
ADDRGP4 qk_rand
CALLI4
ASGNI4
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 5
ARGI4
ADDRLP4 40
INDIRI4
CNSTI4 3
BANDI4
CNSTI4 2
LSHI4
ADDRGP4 cgs+152852+640+96
ADDP4
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $403
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $404
ADDRGP4 $407
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $404
ADDRGP4 cg_footsteps+12
INDIRI4
CNSTI4 0
EQI4 $370
ADDRLP4 40
ADDRGP4 qk_rand
CALLI4
ASGNI4
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 5
ARGI4
ADDRLP4 40
INDIRI4
CNSTI4 3
BANDI4
CNSTI4 2
LSHI4
ADDRGP4 cgs+152852+640+96
ADDP4
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $414
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $415
ADDRGP4 $418
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $415
ADDRGP4 cg_footsteps+12
INDIRI4
CNSTI4 0
EQI4 $370
ADDRLP4 40
ADDRGP4 qk_rand
CALLI4
ASGNI4
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 5
ARGI4
ADDRLP4 40
INDIRI4
CNSTI4 3
BANDI4
CNSTI4 2
LSHI4
ADDRGP4 cgs+152852+640+96
ADDP4
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $425
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $426
ADDRGP4 $429
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $426
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 0
ARGI4
ADDRGP4 cgs+152852+904
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRLP4 4
INDIRI4
ADDRGP4 cg+107636+140
INDIRI4
NEI4 $370
ADDRGP4 cg+108924
CNSTF4 3238002688
ASGNF4
ADDRGP4 cg+108928
ADDRGP4 cg+107604
INDIRI4
ASGNI4
ADDRGP4 $370
JUMPV
LABELV $439
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $440
ADDRGP4 $443
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $440
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
ADDRGP4 $346
ARGP4
ADDRLP4 40
ADDRGP4 CG_CustomSound
CALLI4
ASGNI4
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 3
ARGI4
ADDRLP4 40
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRLP4 4
INDIRI4
ADDRGP4 cg+107636+140
INDIRI4
NEI4 $370
ADDRGP4 cg+108924
CNSTF4 3246391296
ASGNF4
ADDRGP4 cg+108928
ADDRGP4 cg+107604
INDIRI4
ASGNI4
ADDRGP4 $370
JUMPV
LABELV $451
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $452
ADDRGP4 $455
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $452
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
ADDRGP4 $456
ARGP4
ADDRLP4 44
ADDRGP4 CG_CustomSound
CALLI4
ASGNI4
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 0
ARGI4
ADDRLP4 44
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRFP4 0
INDIRP4
CNSTI4 596
ADDP4
ADDRGP4 cg+107604
INDIRI4
ASGNI4
ADDRLP4 4
INDIRI4
ADDRGP4 cg+107636+140
INDIRI4
NEI4 $370
ADDRGP4 cg+108924
CNSTF4 3250585600
ASGNF4
ADDRGP4 cg+108928
ADDRGP4 cg+107604
INDIRI4
ASGNI4
ADDRGP4 $370
JUMPV
LABELV $465
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $466
ADDRGP4 $469
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $466
ADDRLP4 4
INDIRI4
ADDRGP4 cg+107636+140
INDIRI4
EQI4 $470
ADDRGP4 $370
JUMPV
LABELV $470
ADDRLP4 60
CNSTI4 0
ASGNI4
ADDRGP4 cg+8
INDIRI4
ADDRLP4 60
INDIRI4
NEI4 $482
ADDRGP4 cg+36
INDIRP4
CNSTI4 56
ADDP4
INDIRI4
CNSTI4 4096
BANDI4
ADDRLP4 60
INDIRI4
NEI4 $482
ADDRGP4 cg_nopredict+12
INDIRI4
ADDRLP4 60
INDIRI4
NEI4 $482
ADDRGP4 cg_synchronousClients+12
INDIRI4
ADDRLP4 60
INDIRI4
EQI4 $474
LABELV $482
ADDRGP4 $370
JUMPV
LABELV $474
ADDRLP4 48
ADDRGP4 cg+107604
INDIRI4
ADDRGP4 cg+108912
INDIRI4
SUBI4
ASGNI4
ADDRLP4 48
INDIRI4
CNSTI4 200
GEI4 $485
ADDRLP4 52
ADDRGP4 cg+108908
INDIRF4
CNSTI4 200
ADDRLP4 48
INDIRI4
SUBI4
CVIF4 4
MULF4
CNSTF4 1128792064
DIVF4
ASGNF4
ADDRGP4 $486
JUMPV
LABELV $485
ADDRLP4 52
CNSTF4 0
ASGNF4
LABELV $486
ADDRLP4 56
ADDRLP4 8
INDIRI4
CNSTI4 2
LSHI4
CNSTI4 24
SUBI4
CNSTI4 4
ADDI4
ASGNI4
ADDRGP4 cg+108908
ADDRLP4 52
INDIRF4
ADDRLP4 56
INDIRI4
CVIF4 4
ADDF4
ASGNF4
ADDRGP4 cg+108908
INDIRF4
CNSTF4 1107296256
LEF4 $489
ADDRGP4 cg+108908
CNSTF4 1107296256
ASGNF4
LABELV $489
ADDRGP4 cg+108912
ADDRGP4 cg+107604
INDIRI4
ASGNI4
ADDRGP4 $370
JUMPV
LABELV $495
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $496
ADDRGP4 $499
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $496
ADDRLP4 48
ADDRGP4 $500
INDIRB
ASGNB 12
ADDRFP4 0
INDIRP4
CNSTI4 692
ADDP4
ARGP4
ADDRLP4 48
ARGP4
CNSTF4 1107296256
ARGF4
ADDRLP4 60
CNSTF4 1065353216
ASGNF4
ADDRLP4 60
INDIRF4
ARGF4
ADDRLP4 60
INDIRF4
ARGF4
ADDRLP4 60
INDIRF4
ARGF4
CNSTF4 1051260355
ARGF4
CNSTF4 1148846080
ARGF4
ADDRGP4 cg+107604
INDIRI4
ARGI4
CNSTI4 0
ARGI4
CNSTI4 1
ARGI4
ADDRGP4 cgs+152852+308
INDIRI4
ARGI4
ADDRGP4 CG_SmokePuff
CALLP4
pop
ADDRFP4 0
INDIRP4
CNSTI4 692
ADDP4
ARGP4
CNSTI4 -1
ARGI4
CNSTI4 3
ARGI4
ADDRGP4 cgs+152852+912
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
ADDRGP4 $506
ARGP4
ADDRLP4 48
ADDRGP4 CG_CustomSound
CALLI4
ASGNI4
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 3
ARGI4
ADDRLP4 48
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $507
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $508
ADDRGP4 $511
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $508
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
ADDRGP4 $506
ARGP4
ADDRLP4 52
ADDRGP4 CG_CustomSound
CALLI4
ASGNI4
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 3
ARGI4
ADDRLP4 52
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $512
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $513
ADDRGP4 $516
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $513
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
ADDRGP4 $517
ARGP4
ADDRLP4 56
ADDRGP4 CG_CustomSound
CALLI4
ASGNI4
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 3
ARGI4
ADDRLP4 56
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $518
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $519
ADDRGP4 $522
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $519
CNSTI4 1
ARGI4
CNSTI4 0
ARGI4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 53
ARGI4
ADDRGP4 $523
ARGP4
ADDRGP4 CG_VoiceChatLocal
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $524
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $525
ADDRGP4 $528
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $525
CNSTI4 1
ARGI4
CNSTI4 0
ARGI4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 53
ARGI4
ADDRGP4 $529
ARGP4
ADDRGP4 CG_VoiceChatLocal
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $530
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $531
ADDRGP4 $534
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $531
CNSTI4 1
ARGI4
CNSTI4 0
ARGI4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 53
ARGI4
ADDRGP4 $535
ARGP4
ADDRGP4 CG_VoiceChatLocal
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $536
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $537
ADDRGP4 $540
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $537
CNSTI4 1
ARGI4
CNSTI4 0
ARGI4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 53
ARGI4
ADDRGP4 $541
ARGP4
ADDRGP4 CG_VoiceChatLocal
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $542
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $543
ADDRGP4 $546
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $543
CNSTI4 1
ARGI4
CNSTI4 0
ARGI4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 53
ARGI4
ADDRGP4 $547
ARGP4
ADDRGP4 CG_VoiceChatLocal
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $548
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $549
ADDRGP4 $552
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $549
CNSTI4 1
ARGI4
CNSTI4 0
ARGI4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 53
ARGI4
ADDRGP4 $553
ARGP4
ADDRGP4 CG_VoiceChatLocal
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $554
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $555
ADDRGP4 $558
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $555
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 0
ARGI4
ADDRGP4 cgs+152852+1016
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $561
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $562
ADDRGP4 $565
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $562
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 0
ARGI4
ADDRGP4 cgs+152852+1020
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $568
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $569
ADDRGP4 $572
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $569
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 0
ARGI4
ADDRGP4 cgs+152852+1024
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $575
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $576
ADDRGP4 $579
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $576
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
ADDRGP4 $580
ARGP4
ADDRLP4 60
ADDRGP4 CG_CustomSound
CALLI4
ASGNI4
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 0
ARGI4
ADDRLP4 60
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $581
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $582
ADDRGP4 $585
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $582
ADDRLP4 64
ADDRLP4 0
INDIRP4
CNSTI4 184
ADDP4
INDIRI4
ASGNI4
ADDRLP4 72
ADDRLP4 64
INDIRI4
ASGNI4
ADDRLP4 72
INDIRI4
CNSTI4 1
LTI4 $588
ADDRLP4 72
INDIRI4
ADDRGP4 bg_numItems
INDIRI4
LTI4 $586
LABELV $588
ADDRGP4 $370
JUMPV
LABELV $586
ADDRLP4 68
CNSTI4 52
ADDRLP4 64
INDIRI4
MULI4
ADDRGP4 bg_itemlist
ADDP4
ASGNP4
ADDRLP4 76
ADDRLP4 68
INDIRP4
CNSTI4 36
ADDP4
INDIRI4
ASGNI4
ADDRLP4 76
INDIRI4
CNSTI4 5
EQI4 $591
ADDRLP4 76
INDIRI4
CNSTI4 8
NEI4 $589
LABELV $591
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 0
ARGI4
ADDRGP4 cgs+152852+1232
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $590
JUMPV
LABELV $589
ADDRLP4 68
INDIRP4
CNSTI4 36
ADDP4
INDIRI4
CNSTI4 7
NEI4 $594
ADDRLP4 80
ADDRLP4 68
INDIRP4
CNSTI4 40
ADDP4
INDIRI4
ASGNI4
ADDRLP4 80
INDIRI4
CNSTI4 10
LTI4 $595
ADDRLP4 80
INDIRI4
CNSTI4 13
GTI4 $595
ADDRLP4 80
INDIRI4
CNSTI4 2
LSHI4
ADDRGP4 $611-40
ADDP4
INDIRP4
JUMPV
lit
align 4
LABELV $611
address $599
address $602
address $605
address $608
code
LABELV $599
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 0
ARGI4
ADDRGP4 cgs+152852+1208
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $595
JUMPV
LABELV $602
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 0
ARGI4
ADDRGP4 cgs+152852+1204
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $595
JUMPV
LABELV $605
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 0
ARGI4
ADDRGP4 cgs+152852+1200
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $595
JUMPV
LABELV $608
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 0
ARGI4
ADDRGP4 cgs+152852+1196
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $595
JUMPV
LABELV $594
ADDRLP4 68
INDIRP4
CNSTI4 4
ADDP4
INDIRP4
ARGP4
CNSTI4 0
ARGI4
ADDRLP4 80
ADDRGP4 trap_S_RegisterSound
CALLI4
ASGNI4
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 0
ARGI4
ADDRLP4 80
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
LABELV $595
LABELV $590
ADDRLP4 0
INDIRP4
INDIRI4
ADDRGP4 cg+36
INDIRP4
CNSTI4 184
ADDP4
INDIRI4
NEI4 $370
ADDRLP4 64
INDIRI4
ARGI4
ADDRGP4 CG_ItemPickup
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $616
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $617
ADDRGP4 $620
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $617
ADDRLP4 64
ADDRLP4 0
INDIRP4
CNSTI4 184
ADDP4
INDIRI4
ASGNI4
ADDRLP4 72
ADDRLP4 64
INDIRI4
ASGNI4
ADDRLP4 72
INDIRI4
CNSTI4 1
LTI4 $623
ADDRLP4 72
INDIRI4
ADDRGP4 bg_numItems
INDIRI4
LTI4 $621
LABELV $623
ADDRGP4 $370
JUMPV
LABELV $621
ADDRLP4 68
CNSTI4 52
ADDRLP4 64
INDIRI4
MULI4
ADDRGP4 bg_itemlist
ADDP4
ASGNP4
ADDRLP4 68
INDIRP4
CNSTI4 4
ADDP4
INDIRP4
CVPU4 4
CNSTU4 0
EQU4 $624
ADDRLP4 68
INDIRP4
CNSTI4 4
ADDP4
INDIRP4
ARGP4
CNSTI4 0
ARGI4
ADDRLP4 76
ADDRGP4 trap_S_RegisterSound
CALLI4
ASGNI4
CNSTP4 0
ARGP4
ADDRGP4 cg+36
INDIRP4
CNSTI4 184
ADDP4
INDIRI4
ARGI4
CNSTI4 0
ARGI4
ADDRLP4 76
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
LABELV $624
ADDRLP4 0
INDIRP4
INDIRI4
ADDRGP4 cg+36
INDIRP4
CNSTI4 184
ADDP4
INDIRI4
NEI4 $370
ADDRLP4 64
INDIRI4
ARGI4
ADDRGP4 CG_ItemPickup
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $630
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $631
ADDRGP4 $634
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $631
ADDRLP4 0
INDIRP4
INDIRI4
ADDRGP4 cg+36
INDIRP4
CNSTI4 184
ADDP4
INDIRI4
NEI4 $370
ADDRGP4 CG_OutOfAmmoChange
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $638
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $639
ADDRGP4 $642
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $639
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 0
ARGI4
ADDRGP4 cgs+152852+628
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $645
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $646
ADDRGP4 $649
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $646
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 CG_FireWeapon
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $650
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $651
ADDRGP4 $654
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $651
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 CG_UseItem
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $655
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $656
ADDRGP4 $659
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $656
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 CG_UseItem
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $660
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $661
ADDRGP4 $664
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $661
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 CG_UseItem
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $665
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $666
ADDRGP4 $669
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $666
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 CG_UseItem
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $670
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $671
ADDRGP4 $674
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $671
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 CG_UseItem
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $675
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $676
ADDRGP4 $679
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $676
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 CG_UseItem
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $680
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $681
ADDRGP4 $684
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $681
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 CG_UseItem
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $685
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $686
ADDRGP4 $689
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $686
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 CG_UseItem
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $690
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $691
ADDRGP4 $694
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $691
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 CG_UseItem
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $695
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $696
ADDRGP4 $699
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $696
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 CG_UseItem
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $700
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $701
ADDRGP4 $704
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $701
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 CG_UseItem
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $705
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $706
ADDRGP4 $709
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $706
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 CG_UseItem
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $710
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $711
ADDRGP4 $714
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $711
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 CG_UseItem
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $715
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $716
ADDRGP4 $719
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $716
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 CG_UseItem
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $720
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $721
ADDRGP4 $724
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $721
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 CG_UseItem
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $725
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $726
ADDRGP4 $729
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $726
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 0
ARGI4
ADDRGP4 cgs+152852+884
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRFP4 4
INDIRP4
ARGP4
ADDRGP4 CG_SpawnEffect
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $732
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $733
ADDRGP4 $736
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $733
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 0
ARGI4
ADDRGP4 cgs+152852+888
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRFP4 4
INDIRP4
ARGP4
ADDRGP4 CG_SpawnEffect
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $739
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $740
ADDRGP4 $743
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $740
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 0
ARGI4
ADDRGP4 cgs+152852+896
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $746
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $747
ADDRGP4 $750
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $747
ADDRFP4 0
INDIRP4
CNSTI4 444
ADDP4
ADDRGP4 cg+107604
INDIRI4
ASGNI4
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 0
ARGI4
ADDRGP4 cgs+152852+896
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $754
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $755
ADDRGP4 $758
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $755
ADDRLP4 64
ADDRGP4 qk_rand
CALLI4
ASGNI4
ADDRLP4 64
INDIRI4
CNSTI4 1
BANDI4
CNSTI4 0
EQI4 $759
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 0
ARGI4
ADDRGP4 cgs+152852+1236
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $759
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 0
ARGI4
ADDRGP4 cgs+152852+1240
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $765
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $766
ADDRGP4 $769
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $766
ADDRLP4 0
INDIRP4
CNSTI4 184
ADDP4
INDIRI4
CNSTI4 64
BANDI4
CNSTI4 0
EQI4 $770
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 0
ARGI4
ADDRGP4 cgs+152852+1244
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $770
ADDRLP4 0
INDIRP4
CNSTI4 184
ADDP4
INDIRI4
CNSTI4 4096
BANDI4
CNSTI4 0
EQI4 $774
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 0
ARGI4
ADDRGP4 cgs+152852+1248
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $774
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 0
ARGI4
ADDRGP4 cgs+152852+1252
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $780
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $781
ADDRGP4 $784
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $781
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 0
ARGI4
ADDRGP4 cgs+152852+1256
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $787
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $788
ADDRGP4 $791
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $788
ADDRFP4 0
INDIRP4
CNSTI4 692
ADDP4
ARGP4
ADDRGP4 CG_KamikazeEffect
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $792
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $793
ADDRGP4 $796
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $793
ADDRFP4 0
INDIRP4
CNSTI4 692
ADDP4
ARGP4
ADDRLP4 0
INDIRP4
CNSTI4 184
ADDP4
INDIRI4
ARGI4
ADDRGP4 CG_ObeliskExplode
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $797
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $798
ADDRGP4 $801
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $798
ADDRFP4 0
INDIRP4
CNSTI4 692
ADDP4
ARGP4
ADDRGP4 CG_ObeliskPain
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $802
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $803
ADDRGP4 $806
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $803
ADDRFP4 0
INDIRP4
CNSTI4 692
ADDP4
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 116
ADDP4
ARGP4
ADDRGP4 CG_InvulnerabilityImpact
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $807
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $808
ADDRGP4 $811
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $808
ADDRFP4 0
INDIRP4
CNSTI4 692
ADDP4
ARGP4
ADDRGP4 CG_InvulnerabilityJuiced
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $812
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $813
ADDRGP4 $816
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $813
ADDRLP4 0
INDIRP4
CNSTI4 104
ADDP4
ARGP4
ADDRLP4 0
INDIRP4
CNSTI4 24
ADDP4
ARGP4
ADDRGP4 CG_LightningBoltBeam
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $817
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $818
ADDRGP4 $821
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $818
ADDRFP4 0
INDIRP4
CNSTI4 140
ADDP4
INDIRI4
ARGI4
ADDRFP4 0
INDIRP4
CNSTI4 692
ADDP4
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 84
ADDP4
INDIRI4
ARGI4
ADDRGP4 CG_ScorePlum
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $822
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $823
ADDRGP4 $826
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $823
ADDRLP4 0
INDIRP4
CNSTI4 184
ADDP4
INDIRI4
ARGI4
ADDRLP4 16
ARGP4
ADDRGP4 ByteToDir
CALLV
pop
ADDRLP4 0
INDIRP4
CNSTI4 192
ADDP4
INDIRI4
ARGI4
ADDRFP4 4
INDIRP4
ARGP4
ADDRLP4 16
ARGP4
ADDRLP4 0
INDIRP4
CNSTI4 140
ADDP4
INDIRI4
ARGI4
ADDRGP4 CG_MissileHitPlayer
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $827
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $828
ADDRGP4 $831
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $828
ADDRLP4 0
INDIRP4
CNSTI4 184
ADDP4
INDIRI4
ARGI4
ADDRLP4 16
ARGP4
ADDRGP4 ByteToDir
CALLV
pop
ADDRLP4 0
INDIRP4
CNSTI4 192
ADDP4
INDIRI4
ARGI4
ADDRLP4 84
CNSTI4 0
ASGNI4
ADDRLP4 84
INDIRI4
ARGI4
ADDRFP4 4
INDIRP4
ARGP4
ADDRLP4 16
ARGP4
ADDRLP4 84
INDIRI4
ARGI4
ADDRGP4 CG_MissileHitWall
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $832
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $833
ADDRGP4 $836
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $833
ADDRLP4 0
INDIRP4
CNSTI4 184
ADDP4
INDIRI4
ARGI4
ADDRLP4 16
ARGP4
ADDRGP4 ByteToDir
CALLV
pop
ADDRLP4 0
INDIRP4
CNSTI4 192
ADDP4
INDIRI4
ARGI4
CNSTI4 0
ARGI4
ADDRFP4 4
INDIRP4
ARGP4
ADDRLP4 16
ARGP4
CNSTI4 1
ARGI4
ADDRGP4 CG_MissileHitWall
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $837
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $838
ADDRGP4 $841
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $838
ADDRFP4 0
INDIRP4
CNSTI4 192
ADDP4
CNSTI4 7
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 168
ADDP4
INDIRI4
ADDRGP4 cg+36
INDIRP4
CNSTI4 184
ADDP4
INDIRI4
NEI4 $842
ADDRGP4 cg+107628
INDIRI4
CNSTI4 0
NEI4 $842
ADDRGP4 cg_drawGun+12
INDIRI4
CNSTI4 2
NEI4 $846
ADDRLP4 88
ADDRLP4 0
INDIRP4
CNSTI4 104
ADDP4
ASGNP4
ADDRLP4 88
INDIRP4
ADDRLP4 88
INDIRP4
INDIRF4
CNSTF4 1090519040
ADDRGP4 cg+109032+36+12
INDIRF4
MULF4
ADDF4
ASGNF4
ADDRLP4 92
ADDRLP4 0
INDIRP4
CNSTI4 108
ADDP4
ASGNP4
ADDRLP4 92
INDIRP4
ADDRLP4 92
INDIRP4
INDIRF4
CNSTF4 1090519040
ADDRGP4 cg+109032+36+12+4
INDIRF4
MULF4
ADDF4
ASGNF4
ADDRLP4 96
ADDRLP4 0
INDIRP4
CNSTI4 112
ADDP4
ASGNP4
ADDRLP4 96
INDIRP4
ADDRLP4 96
INDIRP4
INDIRF4
CNSTF4 1090519040
ADDRGP4 cg+109032+36+12+8
INDIRF4
MULF4
ADDF4
ASGNF4
ADDRGP4 $847
JUMPV
LABELV $846
ADDRGP4 cg_drawGun+12
INDIRI4
CNSTI4 3
NEI4 $860
ADDRLP4 100
ADDRLP4 0
INDIRP4
CNSTI4 104
ADDP4
ASGNP4
ADDRLP4 100
INDIRP4
ADDRLP4 100
INDIRP4
INDIRF4
CNSTF4 1082130432
ADDRGP4 cg+109032+36+12
INDIRF4
MULF4
ADDF4
ASGNF4
ADDRLP4 104
ADDRLP4 0
INDIRP4
CNSTI4 108
ADDP4
ASGNP4
ADDRLP4 104
INDIRP4
ADDRLP4 104
INDIRP4
INDIRF4
CNSTF4 1082130432
ADDRGP4 cg+109032+36+12+4
INDIRF4
MULF4
ADDF4
ASGNF4
ADDRLP4 108
ADDRLP4 0
INDIRP4
CNSTI4 112
ADDP4
ASGNP4
ADDRLP4 108
INDIRP4
ADDRLP4 108
INDIRP4
INDIRF4
CNSTF4 1082130432
ADDRGP4 cg+109032+36+12+8
INDIRF4
MULF4
ADDF4
ASGNF4
LABELV $860
LABELV $847
LABELV $842
ADDRLP4 12
INDIRP4
ARGP4
ADDRLP4 0
INDIRP4
CNSTI4 104
ADDP4
ARGP4
ADDRLP4 0
INDIRP4
CNSTI4 24
ADDP4
ARGP4
ADDRGP4 CG_RailTrail
CALLV
pop
ADDRLP4 0
INDIRP4
CNSTI4 184
ADDP4
INDIRI4
CNSTI4 255
EQI4 $370
ADDRLP4 0
INDIRP4
CNSTI4 184
ADDP4
INDIRI4
ARGI4
ADDRLP4 16
ARGP4
ADDRGP4 ByteToDir
CALLV
pop
ADDRLP4 0
INDIRP4
CNSTI4 192
ADDP4
INDIRI4
ARGI4
ADDRLP4 0
INDIRP4
CNSTI4 168
ADDP4
INDIRI4
ARGI4
ADDRFP4 4
INDIRP4
ARGP4
ADDRLP4 16
ARGP4
CNSTI4 0
ARGI4
ADDRGP4 CG_MissileHitWall
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $876
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $877
ADDRGP4 $880
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $877
ADDRLP4 0
INDIRP4
CNSTI4 184
ADDP4
INDIRI4
ARGI4
ADDRLP4 16
ARGP4
ADDRGP4 ByteToDir
CALLV
pop
ADDRLP4 0
INDIRP4
CNSTI4 24
ADDP4
ARGP4
ADDRLP4 0
INDIRP4
CNSTI4 140
ADDP4
INDIRI4
ARGI4
ADDRLP4 16
ARGP4
CNSTI4 0
ARGI4
CNSTI4 1022
ARGI4
ADDRGP4 CG_Bullet
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $881
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $882
ADDRGP4 $885
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $882
ADDRLP4 0
INDIRP4
CNSTI4 24
ADDP4
ARGP4
ADDRLP4 0
INDIRP4
CNSTI4 140
ADDP4
INDIRI4
ARGI4
ADDRLP4 16
ARGP4
CNSTI4 1
ARGI4
ADDRLP4 0
INDIRP4
CNSTI4 184
ADDP4
INDIRI4
ARGI4
ADDRGP4 CG_Bullet
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $886
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $887
ADDRGP4 $890
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $887
ADDRLP4 0
INDIRP4
ARGP4
ADDRGP4 CG_ShotgunFire
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $891
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $892
ADDRGP4 $895
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $892
ADDRLP4 0
INDIRP4
CNSTI4 184
ADDP4
INDIRI4
CNSTI4 2
LSHI4
ADDRGP4 cgs+35848
ADDP4
INDIRI4
CNSTI4 0
EQI4 $896
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 3
ARGI4
ADDRLP4 0
INDIRP4
CNSTI4 184
ADDP4
INDIRI4
CNSTI4 2
LSHI4
ADDRGP4 cgs+35848
ADDP4
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $896
ADDRLP4 0
INDIRP4
CNSTI4 184
ADDP4
INDIRI4
CNSTI4 288
ADDI4
ARGI4
ADDRLP4 100
ADDRGP4 CG_ConfigString
CALLP4
ASGNP4
ADDRLP4 28
ADDRLP4 100
INDIRP4
ASGNP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
ADDRLP4 28
INDIRP4
ARGP4
ADDRLP4 104
ADDRGP4 CG_CustomSound
CALLI4
ASGNI4
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 3
ARGI4
ADDRLP4 104
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $900
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $901
ADDRGP4 $904
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $901
ADDRLP4 0
INDIRP4
CNSTI4 184
ADDP4
INDIRI4
CNSTI4 2
LSHI4
ADDRGP4 cgs+35848
ADDP4
INDIRI4
CNSTI4 0
EQI4 $905
CNSTP4 0
ARGP4
ADDRLP4 100
CNSTI4 184
ASGNI4
ADDRGP4 cg+36
INDIRP4
ADDRLP4 100
INDIRI4
ADDP4
INDIRI4
ARGI4
CNSTI4 0
ARGI4
ADDRLP4 0
INDIRP4
ADDRLP4 100
INDIRI4
ADDP4
INDIRI4
CNSTI4 2
LSHI4
ADDRGP4 cgs+35848
ADDP4
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $905
ADDRLP4 0
INDIRP4
CNSTI4 184
ADDP4
INDIRI4
CNSTI4 288
ADDI4
ARGI4
ADDRLP4 100
ADDRGP4 CG_ConfigString
CALLP4
ASGNP4
ADDRLP4 28
ADDRLP4 100
INDIRP4
ASGNP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
ADDRLP4 28
INDIRP4
ARGP4
ADDRLP4 104
ADDRGP4 CG_CustomSound
CALLI4
ASGNI4
CNSTP4 0
ARGP4
ADDRGP4 cg+36
INDIRP4
CNSTI4 184
ADDP4
INDIRI4
ARGI4
CNSTI4 0
ARGI4
ADDRLP4 104
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $911
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $912
ADDRGP4 $915
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $912
ADDRLP4 100
ADDRLP4 0
INDIRP4
CNSTI4 184
ADDP4
INDIRI4
ASGNI4
ADDRLP4 100
INDIRI4
CNSTI4 0
LTI4 $370
ADDRLP4 100
INDIRI4
CNSTI4 13
GTI4 $370
ADDRLP4 100
INDIRI4
CNSTI4 2
LSHI4
ADDRGP4 $1037
ADDP4
INDIRP4
JUMPV
lit
align 4
LABELV $1037
address $919
address $927
address $935
address $945
address $955
address $981
address $1007
address $1013
address $1019
address $1022
address $1025
address $1028
address $1031
address $1034
code
LABELV $919
ADDRGP4 cg+36
INDIRP4
CNSTI4 304
ADDP4
INDIRI4
CNSTI4 1
NEI4 $920
ADDRGP4 cgs+152852+1064
INDIRI4
ARGI4
ADDRGP4 CG_AddBufferedSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $920
ADDRGP4 cgs+152852+1068
INDIRI4
ARGI4
ADDRGP4 CG_AddBufferedSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $927
ADDRGP4 cg+36
INDIRP4
CNSTI4 304
ADDP4
INDIRI4
CNSTI4 2
NEI4 $928
ADDRGP4 cgs+152852+1064
INDIRI4
ARGI4
ADDRGP4 CG_AddBufferedSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $928
ADDRGP4 cgs+152852+1068
INDIRI4
ARGI4
ADDRGP4 CG_AddBufferedSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $935
ADDRGP4 cg+36
INDIRP4
CNSTI4 304
ADDP4
INDIRI4
CNSTI4 1
NEI4 $936
ADDRGP4 cgs+152852+1072
INDIRI4
ARGI4
ADDRGP4 CG_AddBufferedSound
CALLV
pop
ADDRGP4 $937
JUMPV
LABELV $936
ADDRGP4 cgs+152852+1076
INDIRI4
ARGI4
ADDRGP4 CG_AddBufferedSound
CALLV
pop
LABELV $937
ADDRGP4 cgs+152852+1092
INDIRI4
ARGI4
ADDRGP4 CG_AddBufferedSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $945
ADDRGP4 cg+36
INDIRP4
CNSTI4 304
ADDP4
INDIRI4
CNSTI4 2
NEI4 $946
ADDRGP4 cgs+152852+1072
INDIRI4
ARGI4
ADDRGP4 CG_AddBufferedSound
CALLV
pop
ADDRGP4 $947
JUMPV
LABELV $946
ADDRGP4 cgs+152852+1076
INDIRI4
ARGI4
ADDRGP4 CG_AddBufferedSound
CALLV
pop
LABELV $947
ADDRGP4 cgs+152852+1088
INDIRI4
ARGI4
ADDRGP4 CG_AddBufferedSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $955
ADDRLP4 108
CNSTI4 0
ASGNI4
ADDRGP4 cg+36
INDIRP4
CNSTI4 388
ADDP4
INDIRI4
ADDRLP4 108
INDIRI4
NEI4 $960
ADDRGP4 cg+36
INDIRP4
CNSTI4 392
ADDP4
INDIRI4
ADDRLP4 108
INDIRI4
EQI4 $956
LABELV $960
ADDRGP4 $370
JUMPV
LABELV $956
ADDRGP4 cg+36
INDIRP4
CNSTI4 304
ADDP4
INDIRI4
CNSTI4 2
NEI4 $961
ADDRGP4 cgs+31456
INDIRI4
CNSTI4 5
NEI4 $964
ADDRGP4 cgs+152852+1116
INDIRI4
ARGI4
ADDRGP4 CG_AddBufferedSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $964
ADDRGP4 cgs+152852+1100
INDIRI4
ARGI4
ADDRGP4 CG_AddBufferedSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $961
ADDRGP4 cg+36
INDIRP4
CNSTI4 304
ADDP4
INDIRI4
CNSTI4 1
NEI4 $370
ADDRGP4 cgs+31456
INDIRI4
CNSTI4 5
NEI4 $974
ADDRGP4 cgs+152852+1112
INDIRI4
ARGI4
ADDRGP4 CG_AddBufferedSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $974
ADDRGP4 cgs+152852+1104
INDIRI4
ARGI4
ADDRGP4 CG_AddBufferedSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $981
ADDRLP4 112
CNSTI4 0
ASGNI4
ADDRGP4 cg+36
INDIRP4
CNSTI4 384
ADDP4
INDIRI4
ADDRLP4 112
INDIRI4
NEI4 $986
ADDRGP4 cg+36
INDIRP4
CNSTI4 392
ADDP4
INDIRI4
ADDRLP4 112
INDIRI4
EQI4 $982
LABELV $986
ADDRGP4 $370
JUMPV
LABELV $982
ADDRGP4 cg+36
INDIRP4
CNSTI4 304
ADDP4
INDIRI4
CNSTI4 1
NEI4 $987
ADDRGP4 cgs+31456
INDIRI4
CNSTI4 5
NEI4 $990
ADDRGP4 cgs+152852+1116
INDIRI4
ARGI4
ADDRGP4 CG_AddBufferedSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $990
ADDRGP4 cgs+152852+1100
INDIRI4
ARGI4
ADDRGP4 CG_AddBufferedSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $987
ADDRGP4 cg+36
INDIRP4
CNSTI4 304
ADDP4
INDIRI4
CNSTI4 2
NEI4 $370
ADDRGP4 cgs+31456
INDIRI4
CNSTI4 5
NEI4 $1000
ADDRGP4 cgs+152852+1112
INDIRI4
ARGI4
ADDRGP4 CG_AddBufferedSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $1000
ADDRGP4 cgs+152852+1104
INDIRI4
ARGI4
ADDRGP4 CG_AddBufferedSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $1007
ADDRGP4 cg+36
INDIRP4
CNSTI4 304
ADDP4
INDIRI4
CNSTI4 1
NEI4 $370
ADDRGP4 cgs+152852+1120
INDIRI4
ARGI4
ADDRGP4 CG_AddBufferedSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $1013
ADDRGP4 cg+36
INDIRP4
CNSTI4 304
ADDP4
INDIRI4
CNSTI4 2
NEI4 $370
ADDRGP4 cgs+152852+1120
INDIRI4
ARGI4
ADDRGP4 CG_AddBufferedSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $1019
ADDRGP4 cgs+152852+1044
INDIRI4
ARGI4
ADDRGP4 CG_AddBufferedSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $1022
ADDRGP4 cgs+152852+1048
INDIRI4
ARGI4
ADDRGP4 CG_AddBufferedSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $1025
ADDRGP4 cgs+152852+1052
INDIRI4
ARGI4
ADDRGP4 CG_AddBufferedSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $1028
ADDRGP4 cgs+152852+1056
INDIRI4
ARGI4
ADDRGP4 CG_AddBufferedSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $1031
ADDRGP4 cgs+152852+1060
INDIRI4
ARGI4
ADDRGP4 CG_AddBufferedSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $1034
ADDRGP4 cgs+152852+820
INDIRI4
ARGI4
CNSTI4 7
ARGI4
ADDRGP4 trap_S_StartLocalSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $1038
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $1039
ADDRGP4 $1042
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $1039
ADDRFP4 0
INDIRP4
INDIRI4
ADDRGP4 cg+36
INDIRP4
CNSTI4 184
ADDP4
INDIRI4
EQI4 $370
ADDRFP4 0
INDIRP4
ARGP4
ADDRLP4 0
INDIRP4
CNSTI4 184
ADDP4
INDIRI4
ARGI4
ADDRGP4 CG_PainEvent
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $1046
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $1047
ADDRGP4 $1050
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $1047
ADDRFP4 0
INDIRP4
ARGP4
ADDRLP4 100
ADDRGP4 CG_WaterLevel
CALLI4
ASGNI4
ADDRLP4 100
INDIRI4
CNSTI4 1
LTI4 $1051
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
ADDRGP4 $1053
ARGP4
ADDRLP4 104
ADDRGP4 CG_CustomSound
CALLI4
ASGNI4
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 3
ARGI4
ADDRLP4 104
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $1051
ADDRGP4 $1054
ARGP4
ADDRLP4 8
INDIRI4
CNSTI4 57
SUBI4
CNSTI4 1
ADDI4
ARGI4
ADDRLP4 104
ADDRGP4 va
CALLP4
ASGNP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
ADDRLP4 104
INDIRP4
ARGP4
ADDRLP4 108
ADDRGP4 CG_CustomSound
CALLI4
ASGNI4
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 3
ARGI4
ADDRLP4 108
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $1055
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $1056
ADDRGP4 $1059
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $1056
ADDRLP4 0
INDIRP4
ARGP4
ADDRGP4 CG_Obituary
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $1060
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $1061
ADDRGP4 $1064
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $1061
ADDRLP4 0
INDIRP4
INDIRI4
ADDRGP4 cg+36
INDIRP4
CNSTI4 184
ADDP4
INDIRI4
NEI4 $1065
ADDRGP4 cg+124392
CNSTI4 1
ASGNI4
ADDRGP4 cg+124396
ADDRGP4 cg+107604
INDIRI4
ASGNI4
LABELV $1065
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 4
ARGI4
ADDRGP4 cgs+152852+620
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $1073
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $1074
ADDRGP4 $1077
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $1074
ADDRLP4 0
INDIRP4
INDIRI4
ADDRGP4 cg+36
INDIRP4
CNSTI4 184
ADDP4
INDIRI4
NEI4 $1078
ADDRGP4 cg+124392
CNSTI4 2
ASGNI4
ADDRGP4 cg+124396
ADDRGP4 cg+107604
INDIRI4
ASGNI4
LABELV $1078
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 4
ARGI4
ADDRGP4 cgs+152852+1228
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $1086
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $1087
ADDRGP4 $1090
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $1087
ADDRLP4 0
INDIRP4
INDIRI4
ADDRGP4 cg+36
INDIRP4
CNSTI4 184
ADDP4
INDIRI4
NEI4 $1091
ADDRGP4 cg+124392
CNSTI4 5
ASGNI4
ADDRGP4 cg+124396
ADDRGP4 cg+107604
INDIRI4
ASGNI4
LABELV $1091
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 4
ARGI4
ADDRGP4 cgs+152852+1224
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $1099
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $1100
ADDRGP4 $1103
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $1100
ADDRLP4 0
INDIRP4
CNSTI4 8
ADDP4
INDIRI4
CNSTI4 512
BANDI4
CNSTI4 0
NEI4 $1104
CNSTP4 0
ARGP4
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
CNSTI4 5
ARGI4
ADDRGP4 cgs+152852+868
INDIRI4
ARGI4
ADDRGP4 trap_S_StartSound
CALLV
pop
LABELV $1104
ADDRFP4 0
INDIRP4
CNSTI4 692
ADDP4
ARGP4
ADDRGP4 CG_GibPlayer
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $1108
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $1109
ADDRGP4 $1112
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $1109
ADDRLP4 0
INDIRP4
INDIRI4
ARGI4
ADDRGP4 trap_S_StopLoopingSound
CALLV
pop
ADDRLP4 0
INDIRP4
CNSTI4 156
ADDP4
CNSTI4 0
ASGNI4
ADDRGP4 $370
JUMPV
LABELV $1113
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $1114
ADDRGP4 $1117
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $1114
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 CG_Beam
CALLV
pop
ADDRGP4 $370
JUMPV
LABELV $369
ADDRGP4 cg_debugEvents+12
INDIRI4
CNSTI4 0
EQI4 $1118
ADDRGP4 $1121
ARGP4
ADDRGP4 CG_Printf
CALLV
pop
LABELV $1118
ADDRGP4 $1122
ARGP4
ADDRLP4 8
INDIRI4
ARGI4
ADDRGP4 CG_Error
CALLV
pop
LABELV $370
LABELV $354
endproc CG_EntityEvent 116 48
export CG_CheckEvents
proc CG_CheckEvents 8 12
ADDRFP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRFP4 0
INDIRP4
CNSTI4 4
ADDP4
INDIRI4
CNSTI4 13
LEI4 $1126
ADDRFP4 0
INDIRP4
CNSTI4 428
ADDP4
INDIRI4
CNSTI4 0
EQI4 $1128
ADDRGP4 $1125
JUMPV
LABELV $1128
ADDRFP4 0
INDIRP4
CNSTI4 8
ADDP4
INDIRI4
CNSTI4 16
BANDI4
CNSTI4 0
EQI4 $1130
ADDRFP4 0
INDIRP4
ADDRFP4 0
INDIRP4
CNSTI4 140
ADDP4
INDIRI4
ASGNI4
LABELV $1130
ADDRFP4 0
INDIRP4
CNSTI4 428
ADDP4
CNSTI4 1
ASGNI4
ADDRFP4 0
INDIRP4
CNSTI4 180
ADDP4
ADDRFP4 0
INDIRP4
CNSTI4 4
ADDP4
INDIRI4
CNSTI4 13
SUBI4
ASGNI4
ADDRGP4 $1127
JUMPV
LABELV $1126
ADDRFP4 0
INDIRP4
CNSTI4 180
ADDP4
INDIRI4
ADDRFP4 0
INDIRP4
CNSTI4 428
ADDP4
INDIRI4
NEI4 $1132
ADDRGP4 $1125
JUMPV
LABELV $1132
ADDRFP4 0
INDIRP4
CNSTI4 428
ADDP4
ADDRFP4 0
INDIRP4
CNSTI4 180
ADDP4
INDIRI4
ASGNI4
ADDRFP4 0
INDIRP4
CNSTI4 180
ADDP4
INDIRI4
CNSTI4 -769
BANDI4
CNSTI4 0
NEI4 $1134
ADDRGP4 $1125
JUMPV
LABELV $1134
LABELV $1127
ADDRFP4 0
INDIRP4
CNSTI4 12
ADDP4
ARGP4
ADDRGP4 cg+36
INDIRP4
CNSTI4 8
ADDP4
INDIRI4
ARGI4
ADDRFP4 0
INDIRP4
CNSTI4 692
ADDP4
ARGP4
ADDRGP4 BG_EvaluateTrajectory
CALLV
pop
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 CG_SetEntitySoundPosition
CALLV
pop
ADDRFP4 0
INDIRP4
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 692
ADDP4
ARGP4
ADDRGP4 CG_EntityEvent
CALLV
pop
LABELV $1125
endproc CG_CheckEvents 8 12
import CG_NewParticleArea
import initparticles
import CG_ParticleExplosion
import CG_ParticleMisc
import CG_ParticleDust
import CG_ParticleSparks
import CG_ParticleBulletDebris
import CG_ParticleSnowFlurry
import CG_AddParticleShrapnel
import CG_ParticleSmoke
import CG_ParticleSnow
import CG_AddParticles
import CG_ClearParticles
import trap_GetEntityToken
import trap_getCameraInfo
import trap_startCamera
import trap_loadCamera
import trap_SnapVector
import trap_RealTime
import trap_CIN_SetExtents
import trap_CIN_DrawCinematic
import trap_CIN_RunCinematic
import trap_CIN_StopCinematic
import trap_CIN_PlayCinematic
import trap_Key_GetKey
import trap_Key_SetCatcher
import trap_Key_GetCatcher
import trap_Key_IsDown
import trap_R_RegisterFont
import trap_MemoryRemaining
import testPrintFloat
import testPrintInt
import trap_SetUserCmdValue
import trap_GetUserCmd
import trap_GetCurrentCmdNumber
import trap_GetServerCommand
import trap_GetSnapshot
import trap_GetCurrentSnapshotNumber
import trap_GetGameState
import trap_GetGlconfig
import trap_R_inPVS
import trap_R_RemapShader
import trap_R_LerpTag
import trap_R_ModelBounds
import trap_R_DrawStretchPic
import trap_R_SetColor
import trap_R_RenderScene
import trap_R_LightForPoint
import trap_R_AddAdditiveLightToScene
import trap_R_AddLightToScene
import trap_R_AddPolysToScene
import trap_R_AddPolyToScene
import trap_R_AddRefEntityToScene
import trap_R_ClearScene
import trap_R_RegisterShaderNoMip
import trap_R_RegisterShader
import trap_R_RegisterSkin
import trap_R_RegisterModel
import trap_R_LoadWorldMap
import trap_S_StopBackgroundTrack
import trap_S_StartBackgroundTrack
import trap_S_RegisterSound
import trap_S_Respatialize
import trap_S_UpdateEntityPosition
import trap_S_AddRealLoopingSound
import trap_S_AddLoopingSound
import trap_S_ClearLoopingSounds
import trap_S_StartLocalSound
import trap_S_StopLoopingSound
import trap_S_StartSound
import trap_CM_MarkFragments
import trap_CM_TransformedCapsuleTrace
import trap_CM_TransformedBoxTrace
import trap_CM_CapsuleTrace
import trap_CM_BoxTrace
import trap_CM_TransformedPointContents
import trap_CM_PointContents
import trap_CM_TempBoxModel
import trap_CM_InlineModel
import trap_CM_NumInlineModels
import trap_CM_LoadMap
import trap_UpdateScreen
import trap_SendClientCommand
import trap_RemoveCommand
import trap_AddCommand
import trap_SendConsoleCommand
import trap_FS_Seek
import trap_FS_FCloseFile
import trap_FS_Write
import trap_FS_Read
import trap_FS_FOpenFile
import trap_Args
import trap_Argv
import trap_Argc
import trap_Cvar_VariableStringBuffer
import trap_Cvar_Set
import trap_Cvar_Update
import trap_Cvar_Register
import trap_Milliseconds
import trap_Error
import trap_Print
import CG_CheckChangedPredictableEvents
import CG_TransitionPlayerState
import CG_Respawn
import CG_PlayBufferedVoiceChats
import CG_VoiceChatLocal
import CG_LoadVoiceChats
import CG_ShaderStateChanged
import CG_SetConfigValues
import CG_ParseServerinfo
import CG_ExecuteNewServerCommands
import CG_InitConsoleCommands
import CG_ConsoleCommand
import CG_DrawOldTourneyScoreboard
import CG_DrawOldScoreboard
import CG_DrawInformation
import CG_LoadingClient
import CG_LoadingItem
import CG_LoadingString
import CG_ProcessSnapshots
import CG_MakeExplosion
import CG_Bleed
import CG_BigExplode
import CG_GibPlayer
import CG_ScorePlum
import CG_LightningBoltBeam
import CG_InvulnerabilityJuiced
import CG_InvulnerabilityImpact
import CG_ObeliskPain
import CG_ObeliskExplode
import CG_KamikazeEffect
import CG_SpawnEffect
import CG_BubbleTrail
import CG_SmokePuff
import CG_AddLocalEntities
import CG_AllocLocalEntity
import CG_InitLocalEntities
import CG_ImpactMark
import CG_AddMarks
import CG_InitMarkPolys
import CG_OutOfAmmoChange
import CG_DrawWeaponSelect
import CG_AddPlayerWeapon
import CG_AddViewWeapon
import CG_GrappleTrail
import CG_RailTrail
import CG_Bullet
import CG_ShotgunFire
import CG_MissileHitPlayer
import CG_MissileHitWall
import CG_FireWeapon
import CG_RegisterItemVisuals
import CG_RegisterWeapon
import CG_Weapon_f
import CG_PrevWeapon_f
import CG_NextWeapon_f
import CG_PositionRotatedEntityOnTag
import CG_PositionEntityOnTag
import CG_AdjustPositionForMover
import CG_Beam
import CG_AddPacketEntities
import CG_SetEntitySoundPosition
import CG_LoadDeferredPlayers
import CG_PredictPlayerState
import CG_Trace
import CG_PointContents
import CG_BuildSolidList
import CG_CustomSound
import CG_NewClientInfo
import CG_AddRefEntityWithPowerups
import CG_ResetPlayerEntity
import CG_Player
import CG_StatusHandle
import CG_OtherTeamHasFlag
import CG_YourTeamHasFlag
import CG_GameTypeString
import CG_CheckOrderPending
import CG_Text_PaintChar
import CG_Draw3DModel
import CG_GetKillerText
import CG_GetGameStatusText
import CG_GetTeamColor
import CG_InitTeamChat
import CG_SetPrintString
import CG_ShowResponseHead
import CG_RunMenuScript
import CG_OwnerDrawVisible
import CG_GetValue
import CG_SelectNextPlayer
import CG_SelectPrevPlayer
import CG_Text_Height
import CG_Text_Width
import CG_Text_Paint
import CG_OwnerDraw
import CG_DrawTeamBackground
import CG_DrawFlagModel
import CG_DrawActive
import CG_DrawHead
import CG_CenterPrint
import CG_AddLagometerSnapshotInfo
import CG_AddLagometerFrameInfo
import teamChat2
import teamChat1
import systemChat
import drawTeamOverlayModificationCount
import numSortedTeamPlayers
import sortedTeamPlayers
import CG_DrawTopBottom
import CG_DrawSides
import CG_DrawRect
import UI_DrawProportionalString
import CG_GetColorForHealth
import CG_ColorForHealth
import CG_TileClear
import CG_TeamColor
import CG_FadeColor
import CG_DrawStrlen
import CG_DrawSmallStringColor
import CG_DrawSmallString
import CG_DrawBigStringColor
import CG_DrawBigString
import CG_DrawStringExt
import CG_DrawString
import CG_DrawPic
import CG_FillRect
import CG_AdjustFrom640
import CG_DrawActiveFrame
import CG_AddBufferedSound
import CG_ZoomUp_f
import CG_ZoomDown_f
import CG_TestModelPrevSkin_f
import CG_TestModelNextSkin_f
import CG_TestModelPrevFrame_f
import CG_TestModelNextFrame_f
import CG_TestGun_f
import CG_TestModel_f
import CG_BuildSpectatorString
import CG_GetSelectedScore
import CG_SetScoreSelection
import CG_RankRunFrame
import CG_EventHandling
import CG_MouseEvent
import CG_KeyEvent
import CG_LoadMenus
import CG_LastAttacker
import CG_CrosshairPlayer
import CG_UpdateCvars
import CG_StartMusic
import CG_Error
import CG_Printf
import CG_Argv
import CG_ConfigString
import cg_obeliskRespawnDelay
import cg_recordSPDemoName
import cg_recordSPDemo
import cg_singlePlayerActive
import cg_enableBreath
import cg_enableDust
import cg_singlePlayer
import cg_currentSelectedPlayerName
import cg_currentSelectedPlayer
import cg_blueTeamName
import cg_redTeamName
import cg_trueLightning
import cg_oldPlasma
import cg_oldRocket
import cg_oldRail
import cg_noProjectileTrail
import cg_noTaunt
import cg_bigFont
import cg_smallFont
import cg_cameraMode
import cg_timescale
import cg_timescaleFadeSpeed
import cg_timescaleFadeEnd
import cg_cameraOrbitDelay
import cg_cameraOrbit
import pmove_msec
import pmove_fixed
import cg_smoothClients
import cg_scorePlum
import cg_noVoiceText
import cg_noVoiceChats
import cg_teamChatsOnly
import cg_drawFriend
import cg_deferPlayers
import cg_predictItems
import cg_blood
import cg_paused
import cg_buildScript
import cg_forceModel
import cg_stats
import cg_teamChatHeight
import cg_teamChatTime
import cg_synchronousClients
import cg_drawAttacker
import cg_lagometer
import cg_thirdPerson
import cg_thirdPersonAngle
import cg_thirdPersonRange
import cg_zoomFov
import cg_fov
import cg_simpleItems
import cg_ignore
import cg_autoswitch
import cg_tracerLength
import cg_tracerWidth
import cg_tracerChance
import cg_viewsize
import cg_drawGun
import cg_gun_z
import cg_gun_y
import cg_gun_x
import cg_gun_frame
import cg_brassTime
import cg_addMarks
import cg_footsteps
import cg_showmiss
import cg_noPlayerAnims
import cg_nopredict
import cg_errorDecay
import cg_railTrailTime
import cg_debugEvents
import cg_debugPosition
import cg_debugAnim
import cg_animSpeed
import cg_draw2D
import cg_drawStatus
import cg_crosshairHealth
import cg_crosshairSize
import cg_crosshairY
import cg_crosshairX
import cg_teamOverlayUserinfo
import cg_drawTeamOverlay
import cg_drawRewards
import cg_drawCrosshairNames
import cg_drawCrosshair
import cg_drawAmmoWarning
import cg_drawIcons
import cg_draw3dIcons
import cg_drawSnapshot
import cg_drawFPS
import cg_drawTimer
import cg_gibs
import cg_shadows
import cg_swingSpeed
import cg_bobroll
import cg_bobpitch
import cg_bobup
import cg_runroll
import cg_runpitch
import cg_centertime
import cg_markPolys
import cg_items
import cg_weapons
import cg_entities
import cg
import cgs
import BG_PlayerTouchesItem
import BG_PlayerStateToEntityStateExtraPolate
import BG_PlayerStateToEntityState
import BG_TouchJumpPad
import BG_AddPredictableEventToPlayerstate
import BG_EvaluateTrajectoryDelta
import BG_EvaluateTrajectory
import BG_CanItemBeGrabbed
import BG_FindItemForHoldable
import BG_FindItemForPowerup
import BG_FindItemForWeapon
import BG_FindItem
import bg_numItems
import bg_itemlist
import Pmove
import PM_UpdateViewAngles
import Com_Printf
import Com_Error
import Info_NextPair
import Info_Validate
import Info_SetValueForKey_Big
import Info_SetValueForKey
import Info_RemoveKey_Big
import Info_RemoveKey
import Info_ValueForKey
import Com_TruncateLongString
import va
import Q_CountChar
import Q_CleanStr
import Q_PrintStrlen
import Q_strcat
import Q_strncpyz
import Q_stristr
import Q_strupr
import Q_strlwr
import Q_stricmpn
import Q_strncmp
import Q_stricmp
import Q_isintegral
import Q_isanumber
import Q_isalpha
import Q_isupper
import Q_islower
import Q_isprint
import Com_RandomBytes
import Com_SkipCharset
import Com_SkipTokens
import Com_sprintf
import Com_HexStrToInt
import Parse3DMatrix
import Parse2DMatrix
import Parse1DMatrix
import SkipRestOfLine
import SkipBracedSection
import COM_MatchToken
import COM_ParseWarning
import COM_ParseError
import COM_Compress
import COM_ParseExt
import COM_Parse
import COM_GetCurrentParseLine
import COM_BeginParseSession
import COM_DefaultExtension
import COM_CompareExtension
import COM_StripExtension
import COM_GetExtension
import COM_SkipPath
import Com_Clamp
import PerpendicularVector
import AngleVectors
import MatrixMultiply
import MakeNormalVectors
import RotateAroundDirection
import RotatePointAroundVector
import ProjectPointOnPlane
import PlaneFromPoints
import AngleDelta
import AngleNormalize180
import AngleNormalize360
import AnglesSubtract
import AngleSubtract
import LerpAngle
import AngleMod
import BoundsIntersectPoint
import BoundsIntersectSphere
import BoundsIntersect
import BoxOnPlaneSide
import SetPlaneSignbits
import AxisCopy
import AxisClear
import AnglesToAxis
import vectoangles
import Q_crandom
import Q_random
import Q_rand
import Q_acos
import Q_log2
import VectorRotate
import Vector4Scale
import VectorNormalize2
import VectorNormalize
import CrossProduct
import VectorInverse
import VectorNormalizeFast
import DistanceSquared
import Distance
import VectorLengthSquared
import VectorLength
import VectorCompare
import AddPointToBounds
import ClearBounds
import RadiusFromBounds
import NormalizeColor
import ColorBytes4
import ColorBytes3
import _VectorMA
import _VectorScale
import _VectorCopy
import _VectorAdd
import _VectorSubtract
import _DotProduct
import ByteToDir
import DirToByte
import ClampShort
import ClampChar
import Q_rsqrt
import Q_fabs
import Q_isnan
import axisDefault
import vec3_origin
import g_color_table
import colorDkGrey
import colorMdGrey
import colorLtGrey
import colorWhite
import colorCyan
import colorMagenta
import colorYellow
import colorBlue
import colorGreen
import colorRed
import colorBlack
import bytedirs
import Hunk_AllocDebug
import FloatSwap
import LongSwap
import ShortSwap
import CopyLongSwap
import CopyShortSwap
import qk_acos
import qk_fabs
import qk_abs
import qk_tan
import qk_atan2
import qk_cos
import qk_sin
import qk_sqrt
import qk_floor
import qk_ceil
import qk_memcpy
import qk_memset
import qk_memmove
import qk_sscanf
import qk_vsnprintf
import qk_strtol
import qk_atoi
import qk_strtod
import qk_atof
import qk_toupper
import qk_tolower
import qk_strncpy
import qk_strstr
import qk_strrchr
import qk_strchr
import qk_strcmp
import qk_strcpy
import qk_strcat
import qk_strlen
import qk_rand
import qk_srand
import qk_qsort
lit
align 1
LABELV $1122
byte 1 85
byte 1 110
byte 1 107
byte 1 110
byte 1 111
byte 1 119
byte 1 110
byte 1 32
byte 1 101
byte 1 118
byte 1 101
byte 1 110
byte 1 116
byte 1 58
byte 1 32
byte 1 37
byte 1 105
byte 1 0
align 1
LABELV $1121
byte 1 85
byte 1 78
byte 1 75
byte 1 78
byte 1 79
byte 1 87
byte 1 78
byte 1 10
byte 1 0
align 1
LABELV $1117
byte 1 69
byte 1 86
byte 1 95
byte 1 68
byte 1 69
byte 1 66
byte 1 85
byte 1 71
byte 1 95
byte 1 76
byte 1 73
byte 1 78
byte 1 69
byte 1 10
byte 1 0
align 1
LABELV $1112
byte 1 69
byte 1 86
byte 1 95
byte 1 83
byte 1 84
byte 1 79
byte 1 80
byte 1 76
byte 1 79
byte 1 79
byte 1 80
byte 1 73
byte 1 78
byte 1 71
byte 1 83
byte 1 79
byte 1 85
byte 1 78
byte 1 68
byte 1 10
byte 1 0
align 1
LABELV $1103
byte 1 69
byte 1 86
byte 1 95
byte 1 71
byte 1 73
byte 1 66
byte 1 95
byte 1 80
byte 1 76
byte 1 65
byte 1 89
byte 1 69
byte 1 82
byte 1 10
byte 1 0
align 1
LABELV $1090
byte 1 69
byte 1 86
byte 1 95
byte 1 80
byte 1 79
byte 1 87
byte 1 69
byte 1 82
byte 1 85
byte 1 80
byte 1 95
byte 1 82
byte 1 69
byte 1 71
byte 1 69
byte 1 78
byte 1 10
byte 1 0
align 1
LABELV $1077
byte 1 69
byte 1 86
byte 1 95
byte 1 80
byte 1 79
byte 1 87
byte 1 69
byte 1 82
byte 1 85
byte 1 80
byte 1 95
byte 1 66
byte 1 65
byte 1 84
byte 1 84
byte 1 76
byte 1 69
byte 1 83
byte 1 85
byte 1 73
byte 1 84
byte 1 10
byte 1 0
align 1
LABELV $1064
byte 1 69
byte 1 86
byte 1 95
byte 1 80
byte 1 79
byte 1 87
byte 1 69
byte 1 82
byte 1 85
byte 1 80
byte 1 95
byte 1 81
byte 1 85
byte 1 65
byte 1 68
byte 1 10
byte 1 0
align 1
LABELV $1059
byte 1 69
byte 1 86
byte 1 95
byte 1 79
byte 1 66
byte 1 73
byte 1 84
byte 1 85
byte 1 65
byte 1 82
byte 1 89
byte 1 10
byte 1 0
align 1
LABELV $1054
byte 1 42
byte 1 100
byte 1 101
byte 1 97
byte 1 116
byte 1 104
byte 1 37
byte 1 105
byte 1 46
byte 1 119
byte 1 97
byte 1 118
byte 1 0
align 1
LABELV $1053
byte 1 42
byte 1 100
byte 1 114
byte 1 111
byte 1 119
byte 1 110
byte 1 46
byte 1 119
byte 1 97
byte 1 118
byte 1 0
align 1
LABELV $1050
byte 1 69
byte 1 86
byte 1 95
byte 1 68
byte 1 69
byte 1 65
byte 1 84
byte 1 72
byte 1 120
byte 1 10
byte 1 0
align 1
LABELV $1042
byte 1 69
byte 1 86
byte 1 95
byte 1 80
byte 1 65
byte 1 73
byte 1 78
byte 1 10
byte 1 0
align 1
LABELV $915
byte 1 69
byte 1 86
byte 1 95
byte 1 71
byte 1 76
byte 1 79
byte 1 66
byte 1 65
byte 1 76
byte 1 95
byte 1 84
byte 1 69
byte 1 65
byte 1 77
byte 1 95
byte 1 83
byte 1 79
byte 1 85
byte 1 78
byte 1 68
byte 1 10
byte 1 0
align 1
LABELV $904
byte 1 69
byte 1 86
byte 1 95
byte 1 71
byte 1 76
byte 1 79
byte 1 66
byte 1 65
byte 1 76
byte 1 95
byte 1 83
byte 1 79
byte 1 85
byte 1 78
byte 1 68
byte 1 10
byte 1 0
align 1
LABELV $895
byte 1 69
byte 1 86
byte 1 95
byte 1 71
byte 1 69
byte 1 78
byte 1 69
byte 1 82
byte 1 65
byte 1 76
byte 1 95
byte 1 83
byte 1 79
byte 1 85
byte 1 78
byte 1 68
byte 1 10
byte 1 0
align 1
LABELV $890
byte 1 69
byte 1 86
byte 1 95
byte 1 83
byte 1 72
byte 1 79
byte 1 84
byte 1 71
byte 1 85
byte 1 78
byte 1 10
byte 1 0
align 1
LABELV $885
byte 1 69
byte 1 86
byte 1 95
byte 1 66
byte 1 85
byte 1 76
byte 1 76
byte 1 69
byte 1 84
byte 1 95
byte 1 72
byte 1 73
byte 1 84
byte 1 95
byte 1 70
byte 1 76
byte 1 69
byte 1 83
byte 1 72
byte 1 10
byte 1 0
align 1
LABELV $880
byte 1 69
byte 1 86
byte 1 95
byte 1 66
byte 1 85
byte 1 76
byte 1 76
byte 1 69
byte 1 84
byte 1 95
byte 1 72
byte 1 73
byte 1 84
byte 1 95
byte 1 87
byte 1 65
byte 1 76
byte 1 76
byte 1 10
byte 1 0
align 1
LABELV $841
byte 1 69
byte 1 86
byte 1 95
byte 1 82
byte 1 65
byte 1 73
byte 1 76
byte 1 84
byte 1 82
byte 1 65
byte 1 73
byte 1 76
byte 1 10
byte 1 0
align 1
LABELV $836
byte 1 69
byte 1 86
byte 1 95
byte 1 77
byte 1 73
byte 1 83
byte 1 83
byte 1 73
byte 1 76
byte 1 69
byte 1 95
byte 1 77
byte 1 73
byte 1 83
byte 1 83
byte 1 95
byte 1 77
byte 1 69
byte 1 84
byte 1 65
byte 1 76
byte 1 10
byte 1 0
align 1
LABELV $831
byte 1 69
byte 1 86
byte 1 95
byte 1 77
byte 1 73
byte 1 83
byte 1 83
byte 1 73
byte 1 76
byte 1 69
byte 1 95
byte 1 77
byte 1 73
byte 1 83
byte 1 83
byte 1 10
byte 1 0
align 1
LABELV $826
byte 1 69
byte 1 86
byte 1 95
byte 1 77
byte 1 73
byte 1 83
byte 1 83
byte 1 73
byte 1 76
byte 1 69
byte 1 95
byte 1 72
byte 1 73
byte 1 84
byte 1 10
byte 1 0
align 1
LABELV $821
byte 1 69
byte 1 86
byte 1 95
byte 1 83
byte 1 67
byte 1 79
byte 1 82
byte 1 69
byte 1 80
byte 1 76
byte 1 85
byte 1 77
byte 1 10
byte 1 0
align 1
LABELV $816
byte 1 69
byte 1 86
byte 1 95
byte 1 76
byte 1 73
byte 1 71
byte 1 72
byte 1 84
byte 1 78
byte 1 73
byte 1 78
byte 1 71
byte 1 66
byte 1 79
byte 1 76
byte 1 84
byte 1 10
byte 1 0
align 1
LABELV $811
byte 1 69
byte 1 86
byte 1 95
byte 1 74
byte 1 85
byte 1 73
byte 1 67
byte 1 69
byte 1 68
byte 1 10
byte 1 0
align 1
LABELV $806
byte 1 69
byte 1 86
byte 1 95
byte 1 73
byte 1 78
byte 1 86
byte 1 85
byte 1 76
byte 1 95
byte 1 73
byte 1 77
byte 1 80
byte 1 65
byte 1 67
byte 1 84
byte 1 10
byte 1 0
align 1
LABELV $801
byte 1 69
byte 1 86
byte 1 95
byte 1 79
byte 1 66
byte 1 69
byte 1 76
byte 1 73
byte 1 83
byte 1 75
byte 1 80
byte 1 65
byte 1 73
byte 1 78
byte 1 10
byte 1 0
align 1
LABELV $796
byte 1 69
byte 1 86
byte 1 95
byte 1 79
byte 1 66
byte 1 69
byte 1 76
byte 1 73
byte 1 83
byte 1 75
byte 1 69
byte 1 88
byte 1 80
byte 1 76
byte 1 79
byte 1 68
byte 1 69
byte 1 10
byte 1 0
align 1
LABELV $791
byte 1 69
byte 1 86
byte 1 95
byte 1 75
byte 1 65
byte 1 77
byte 1 73
byte 1 75
byte 1 65
byte 1 90
byte 1 69
byte 1 10
byte 1 0
align 1
LABELV $784
byte 1 69
byte 1 86
byte 1 95
byte 1 80
byte 1 82
byte 1 79
byte 1 88
byte 1 73
byte 1 77
byte 1 73
byte 1 84
byte 1 89
byte 1 95
byte 1 77
byte 1 73
byte 1 78
byte 1 69
byte 1 95
byte 1 84
byte 1 82
byte 1 73
byte 1 71
byte 1 71
byte 1 69
byte 1 82
byte 1 10
byte 1 0
align 1
LABELV $769
byte 1 69
byte 1 86
byte 1 95
byte 1 80
byte 1 82
byte 1 79
byte 1 88
byte 1 73
byte 1 77
byte 1 73
byte 1 84
byte 1 89
byte 1 95
byte 1 77
byte 1 73
byte 1 78
byte 1 69
byte 1 95
byte 1 83
byte 1 84
byte 1 73
byte 1 67
byte 1 75
byte 1 10
byte 1 0
align 1
LABELV $758
byte 1 69
byte 1 86
byte 1 95
byte 1 71
byte 1 82
byte 1 69
byte 1 78
byte 1 65
byte 1 68
byte 1 69
byte 1 95
byte 1 66
byte 1 79
byte 1 85
byte 1 78
byte 1 67
byte 1 69
byte 1 10
byte 1 0
align 1
LABELV $750
byte 1 69
byte 1 86
byte 1 95
byte 1 73
byte 1 84
byte 1 69
byte 1 77
byte 1 95
byte 1 82
byte 1 69
byte 1 83
byte 1 80
byte 1 65
byte 1 87
byte 1 78
byte 1 10
byte 1 0
align 1
LABELV $743
byte 1 69
byte 1 86
byte 1 95
byte 1 73
byte 1 84
byte 1 69
byte 1 77
byte 1 95
byte 1 80
byte 1 79
byte 1 80
byte 1 10
byte 1 0
align 1
LABELV $736
byte 1 69
byte 1 86
byte 1 95
byte 1 80
byte 1 76
byte 1 65
byte 1 89
byte 1 69
byte 1 82
byte 1 95
byte 1 84
byte 1 69
byte 1 76
byte 1 69
byte 1 80
byte 1 79
byte 1 82
byte 1 84
byte 1 95
byte 1 79
byte 1 85
byte 1 84
byte 1 10
byte 1 0
align 1
LABELV $729
byte 1 69
byte 1 86
byte 1 95
byte 1 80
byte 1 76
byte 1 65
byte 1 89
byte 1 69
byte 1 82
byte 1 95
byte 1 84
byte 1 69
byte 1 76
byte 1 69
byte 1 80
byte 1 79
byte 1 82
byte 1 84
byte 1 95
byte 1 73
byte 1 78
byte 1 10
byte 1 0
align 1
LABELV $724
byte 1 69
byte 1 86
byte 1 95
byte 1 85
byte 1 83
byte 1 69
byte 1 95
byte 1 73
byte 1 84
byte 1 69
byte 1 77
byte 1 49
byte 1 52
byte 1 10
byte 1 0
align 1
LABELV $719
byte 1 69
byte 1 86
byte 1 95
byte 1 85
byte 1 83
byte 1 69
byte 1 95
byte 1 73
byte 1 84
byte 1 69
byte 1 77
byte 1 49
byte 1 51
byte 1 10
byte 1 0
align 1
LABELV $714
byte 1 69
byte 1 86
byte 1 95
byte 1 85
byte 1 83
byte 1 69
byte 1 95
byte 1 73
byte 1 84
byte 1 69
byte 1 77
byte 1 49
byte 1 50
byte 1 10
byte 1 0
align 1
LABELV $709
byte 1 69
byte 1 86
byte 1 95
byte 1 85
byte 1 83
byte 1 69
byte 1 95
byte 1 73
byte 1 84
byte 1 69
byte 1 77
byte 1 49
byte 1 49
byte 1 10
byte 1 0
align 1
LABELV $704
byte 1 69
byte 1 86
byte 1 95
byte 1 85
byte 1 83
byte 1 69
byte 1 95
byte 1 73
byte 1 84
byte 1 69
byte 1 77
byte 1 49
byte 1 48
byte 1 10
byte 1 0
align 1
LABELV $699
byte 1 69
byte 1 86
byte 1 95
byte 1 85
byte 1 83
byte 1 69
byte 1 95
byte 1 73
byte 1 84
byte 1 69
byte 1 77
byte 1 57
byte 1 10
byte 1 0
align 1
LABELV $694
byte 1 69
byte 1 86
byte 1 95
byte 1 85
byte 1 83
byte 1 69
byte 1 95
byte 1 73
byte 1 84
byte 1 69
byte 1 77
byte 1 56
byte 1 10
byte 1 0
align 1
LABELV $689
byte 1 69
byte 1 86
byte 1 95
byte 1 85
byte 1 83
byte 1 69
byte 1 95
byte 1 73
byte 1 84
byte 1 69
byte 1 77
byte 1 55
byte 1 10
byte 1 0
align 1
LABELV $684
byte 1 69
byte 1 86
byte 1 95
byte 1 85
byte 1 83
byte 1 69
byte 1 95
byte 1 73
byte 1 84
byte 1 69
byte 1 77
byte 1 54
byte 1 10
byte 1 0
align 1
LABELV $679
byte 1 69
byte 1 86
byte 1 95
byte 1 85
byte 1 83
byte 1 69
byte 1 95
byte 1 73
byte 1 84
byte 1 69
byte 1 77
byte 1 53
byte 1 10
byte 1 0
align 1
LABELV $674
byte 1 69
byte 1 86
byte 1 95
byte 1 85
byte 1 83
byte 1 69
byte 1 95
byte 1 73
byte 1 84
byte 1 69
byte 1 77
byte 1 52
byte 1 10
byte 1 0
align 1
LABELV $669
byte 1 69
byte 1 86
byte 1 95
byte 1 85
byte 1 83
byte 1 69
byte 1 95
byte 1 73
byte 1 84
byte 1 69
byte 1 77
byte 1 51
byte 1 10
byte 1 0
align 1
LABELV $664
byte 1 69
byte 1 86
byte 1 95
byte 1 85
byte 1 83
byte 1 69
byte 1 95
byte 1 73
byte 1 84
byte 1 69
byte 1 77
byte 1 50
byte 1 10
byte 1 0
align 1
LABELV $659
byte 1 69
byte 1 86
byte 1 95
byte 1 85
byte 1 83
byte 1 69
byte 1 95
byte 1 73
byte 1 84
byte 1 69
byte 1 77
byte 1 49
byte 1 10
byte 1 0
align 1
LABELV $654
byte 1 69
byte 1 86
byte 1 95
byte 1 85
byte 1 83
byte 1 69
byte 1 95
byte 1 73
byte 1 84
byte 1 69
byte 1 77
byte 1 48
byte 1 10
byte 1 0
align 1
LABELV $649
byte 1 69
byte 1 86
byte 1 95
byte 1 70
byte 1 73
byte 1 82
byte 1 69
byte 1 95
byte 1 87
byte 1 69
byte 1 65
byte 1 80
byte 1 79
byte 1 78
byte 1 10
byte 1 0
align 1
LABELV $642
byte 1 69
byte 1 86
byte 1 95
byte 1 67
byte 1 72
byte 1 65
byte 1 78
byte 1 71
byte 1 69
byte 1 95
byte 1 87
byte 1 69
byte 1 65
byte 1 80
byte 1 79
byte 1 78
byte 1 10
byte 1 0
align 1
LABELV $634
byte 1 69
byte 1 86
byte 1 95
byte 1 78
byte 1 79
byte 1 65
byte 1 77
byte 1 77
byte 1 79
byte 1 10
byte 1 0
align 1
LABELV $620
byte 1 69
byte 1 86
byte 1 95
byte 1 71
byte 1 76
byte 1 79
byte 1 66
byte 1 65
byte 1 76
byte 1 95
byte 1 73
byte 1 84
byte 1 69
byte 1 77
byte 1 95
byte 1 80
byte 1 73
byte 1 67
byte 1 75
byte 1 85
byte 1 80
byte 1 10
byte 1 0
align 1
LABELV $585
byte 1 69
byte 1 86
byte 1 95
byte 1 73
byte 1 84
byte 1 69
byte 1 77
byte 1 95
byte 1 80
byte 1 73
byte 1 67
byte 1 75
byte 1 85
byte 1 80
byte 1 10
byte 1 0
align 1
LABELV $580
byte 1 42
byte 1 103
byte 1 97
byte 1 115
byte 1 112
byte 1 46
byte 1 119
byte 1 97
byte 1 118
byte 1 0
align 1
LABELV $579
byte 1 69
byte 1 86
byte 1 95
byte 1 87
byte 1 65
byte 1 84
byte 1 69
byte 1 82
byte 1 95
byte 1 67
byte 1 76
byte 1 69
byte 1 65
byte 1 82
byte 1 10
byte 1 0
align 1
LABELV $572
byte 1 69
byte 1 86
byte 1 95
byte 1 87
byte 1 65
byte 1 84
byte 1 69
byte 1 82
byte 1 95
byte 1 85
byte 1 78
byte 1 68
byte 1 69
byte 1 82
byte 1 10
byte 1 0
align 1
LABELV $565
byte 1 69
byte 1 86
byte 1 95
byte 1 87
byte 1 65
byte 1 84
byte 1 69
byte 1 82
byte 1 95
byte 1 76
byte 1 69
byte 1 65
byte 1 86
byte 1 69
byte 1 10
byte 1 0
align 1
LABELV $558
byte 1 69
byte 1 86
byte 1 95
byte 1 87
byte 1 65
byte 1 84
byte 1 69
byte 1 82
byte 1 95
byte 1 84
byte 1 79
byte 1 85
byte 1 67
byte 1 72
byte 1 10
byte 1 0
align 1
LABELV $553
byte 1 111
byte 1 110
byte 1 112
byte 1 97
byte 1 116
byte 1 114
byte 1 111
byte 1 108
byte 1 0
align 1
LABELV $552
byte 1 69
byte 1 86
byte 1 95
byte 1 84
byte 1 65
byte 1 85
byte 1 78
byte 1 84
byte 1 95
byte 1 80
byte 1 65
byte 1 84
byte 1 82
byte 1 79
byte 1 76
byte 1 10
byte 1 0
align 1
LABELV $547
byte 1 111
byte 1 110
byte 1 100
byte 1 101
byte 1 102
byte 1 101
byte 1 110
byte 1 115
byte 1 101
byte 1 0
align 1
LABELV $546
byte 1 69
byte 1 86
byte 1 95
byte 1 84
byte 1 65
byte 1 85
byte 1 78
byte 1 84
byte 1 95
byte 1 71
byte 1 85
byte 1 65
byte 1 82
byte 1 68
byte 1 66
byte 1 65
byte 1 83
byte 1 69
byte 1 10
byte 1 0
align 1
LABELV $541
byte 1 111
byte 1 110
byte 1 103
byte 1 101
byte 1 116
byte 1 102
byte 1 108
byte 1 97
byte 1 103
byte 1 0
align 1
LABELV $540
byte 1 69
byte 1 86
byte 1 95
byte 1 84
byte 1 65
byte 1 85
byte 1 78
byte 1 84
byte 1 95
byte 1 71
byte 1 69
byte 1 84
byte 1 70
byte 1 76
byte 1 65
byte 1 71
byte 1 10
byte 1 0
align 1
LABELV $535
byte 1 102
byte 1 111
byte 1 108
byte 1 108
byte 1 111
byte 1 119
byte 1 109
byte 1 101
byte 1 0
align 1
LABELV $534
byte 1 69
byte 1 86
byte 1 95
byte 1 84
byte 1 65
byte 1 85
byte 1 78
byte 1 84
byte 1 95
byte 1 70
byte 1 79
byte 1 76
byte 1 76
byte 1 79
byte 1 87
byte 1 77
byte 1 69
byte 1 10
byte 1 0
align 1
LABELV $529
byte 1 110
byte 1 111
byte 1 0
align 1
LABELV $528
byte 1 69
byte 1 86
byte 1 95
byte 1 84
byte 1 65
byte 1 85
byte 1 78
byte 1 84
byte 1 95
byte 1 78
byte 1 79
byte 1 10
byte 1 0
align 1
LABELV $523
byte 1 121
byte 1 101
byte 1 115
byte 1 0
align 1
LABELV $522
byte 1 69
byte 1 86
byte 1 95
byte 1 84
byte 1 65
byte 1 85
byte 1 78
byte 1 84
byte 1 95
byte 1 89
byte 1 69
byte 1 83
byte 1 10
byte 1 0
align 1
LABELV $517
byte 1 42
byte 1 116
byte 1 97
byte 1 117
byte 1 110
byte 1 116
byte 1 46
byte 1 119
byte 1 97
byte 1 118
byte 1 0
align 1
LABELV $516
byte 1 69
byte 1 86
byte 1 95
byte 1 84
byte 1 65
byte 1 85
byte 1 78
byte 1 84
byte 1 10
byte 1 0
align 1
LABELV $511
byte 1 69
byte 1 86
byte 1 95
byte 1 74
byte 1 85
byte 1 77
byte 1 80
byte 1 10
byte 1 0
align 1
LABELV $506
byte 1 42
byte 1 106
byte 1 117
byte 1 109
byte 1 112
byte 1 49
byte 1 46
byte 1 119
byte 1 97
byte 1 118
byte 1 0
align 1
LABELV $499
byte 1 69
byte 1 86
byte 1 95
byte 1 74
byte 1 85
byte 1 77
byte 1 80
byte 1 95
byte 1 80
byte 1 65
byte 1 68
byte 1 10
byte 1 0
align 1
LABELV $469
byte 1 69
byte 1 86
byte 1 95
byte 1 83
byte 1 84
byte 1 69
byte 1 80
byte 1 10
byte 1 0
align 1
LABELV $456
byte 1 42
byte 1 102
byte 1 97
byte 1 108
byte 1 108
byte 1 49
byte 1 46
byte 1 119
byte 1 97
byte 1 118
byte 1 0
align 1
LABELV $455
byte 1 69
byte 1 86
byte 1 95
byte 1 70
byte 1 65
byte 1 76
byte 1 76
byte 1 95
byte 1 70
byte 1 65
byte 1 82
byte 1 10
byte 1 0
align 1
LABELV $443
byte 1 69
byte 1 86
byte 1 95
byte 1 70
byte 1 65
byte 1 76
byte 1 76
byte 1 95
byte 1 77
byte 1 69
byte 1 68
byte 1 73
byte 1 85
byte 1 77
byte 1 10
byte 1 0
align 1
LABELV $429
byte 1 69
byte 1 86
byte 1 95
byte 1 70
byte 1 65
byte 1 76
byte 1 76
byte 1 95
byte 1 83
byte 1 72
byte 1 79
byte 1 82
byte 1 84
byte 1 10
byte 1 0
align 1
LABELV $418
byte 1 69
byte 1 86
byte 1 95
byte 1 83
byte 1 87
byte 1 73
byte 1 77
byte 1 10
byte 1 0
align 1
LABELV $407
byte 1 69
byte 1 86
byte 1 95
byte 1 70
byte 1 79
byte 1 79
byte 1 84
byte 1 87
byte 1 65
byte 1 68
byte 1 69
byte 1 10
byte 1 0
align 1
LABELV $396
byte 1 69
byte 1 86
byte 1 95
byte 1 70
byte 1 79
byte 1 79
byte 1 84
byte 1 83
byte 1 80
byte 1 76
byte 1 65
byte 1 83
byte 1 72
byte 1 10
byte 1 0
align 1
LABELV $385
byte 1 69
byte 1 86
byte 1 95
byte 1 70
byte 1 79
byte 1 79
byte 1 84
byte 1 83
byte 1 84
byte 1 69
byte 1 80
byte 1 95
byte 1 77
byte 1 69
byte 1 84
byte 1 65
byte 1 76
byte 1 10
byte 1 0
align 1
LABELV $375
byte 1 69
byte 1 86
byte 1 95
byte 1 70
byte 1 79
byte 1 79
byte 1 84
byte 1 83
byte 1 84
byte 1 69
byte 1 80
byte 1 10
byte 1 0
align 1
LABELV $364
byte 1 90
byte 1 69
byte 1 82
byte 1 79
byte 1 69
byte 1 86
byte 1 69
byte 1 78
byte 1 84
byte 1 10
byte 1 0
align 1
LABELV $358
byte 1 101
byte 1 110
byte 1 116
byte 1 58
byte 1 37
byte 1 51
byte 1 105
byte 1 32
byte 1 32
byte 1 101
byte 1 118
byte 1 101
byte 1 110
byte 1 116
byte 1 58
byte 1 37
byte 1 51
byte 1 105
byte 1 32
byte 1 0
align 1
LABELV $352
byte 1 115
byte 1 111
byte 1 117
byte 1 110
byte 1 100
byte 1 47
byte 1 112
byte 1 108
byte 1 97
byte 1 121
byte 1 101
byte 1 114
byte 1 47
byte 1 103
byte 1 117
byte 1 114
byte 1 112
byte 1 50
byte 1 46
byte 1 119
byte 1 97
byte 1 118
byte 1 0
align 1
LABELV $351
byte 1 115
byte 1 111
byte 1 117
byte 1 110
byte 1 100
byte 1 47
byte 1 112
byte 1 108
byte 1 97
byte 1 121
byte 1 101
byte 1 114
byte 1 47
byte 1 103
byte 1 117
byte 1 114
byte 1 112
byte 1 49
byte 1 46
byte 1 119
byte 1 97
byte 1 118
byte 1 0
align 1
LABELV $346
byte 1 42
byte 1 112
byte 1 97
byte 1 105
byte 1 110
byte 1 49
byte 1 48
byte 1 48
byte 1 95
byte 1 49
byte 1 46
byte 1 119
byte 1 97
byte 1 118
byte 1 0
align 1
LABELV $345
byte 1 42
byte 1 112
byte 1 97
byte 1 105
byte 1 110
byte 1 55
byte 1 53
byte 1 95
byte 1 49
byte 1 46
byte 1 119
byte 1 97
byte 1 118
byte 1 0
align 1
LABELV $342
byte 1 42
byte 1 112
byte 1 97
byte 1 105
byte 1 110
byte 1 53
byte 1 48
byte 1 95
byte 1 49
byte 1 46
byte 1 119
byte 1 97
byte 1 118
byte 1 0
align 1
LABELV $339
byte 1 42
byte 1 112
byte 1 97
byte 1 105
byte 1 110
byte 1 50
byte 1 53
byte 1 95
byte 1 49
byte 1 46
byte 1 119
byte 1 97
byte 1 118
byte 1 0
align 1
LABELV $280
byte 1 85
byte 1 115
byte 1 101
byte 1 32
byte 1 37
byte 1 115
byte 1 0
align 1
LABELV $279
byte 1 78
byte 1 111
byte 1 32
byte 1 105
byte 1 116
byte 1 101
byte 1 109
byte 1 32
byte 1 116
byte 1 111
byte 1 32
byte 1 117
byte 1 115
byte 1 101
byte 1 0
align 1
LABELV $269
byte 1 37
byte 1 115
byte 1 32
byte 1 100
byte 1 105
byte 1 101
byte 1 100
byte 1 46
byte 1 10
byte 1 0
align 1
LABELV $268
byte 1 37
byte 1 115
byte 1 32
byte 1 37
byte 1 115
byte 1 32
byte 1 37
byte 1 115
byte 1 37
byte 1 115
byte 1 10
byte 1 0
align 1
LABELV $263
byte 1 119
byte 1 97
byte 1 115
byte 1 32
byte 1 107
byte 1 105
byte 1 108
byte 1 108
byte 1 101
byte 1 100
byte 1 32
byte 1 98
byte 1 121
byte 1 0
align 1
LABELV $262
byte 1 39
byte 1 115
byte 1 32
byte 1 112
byte 1 101
byte 1 114
byte 1 115
byte 1 111
byte 1 110
byte 1 97
byte 1 108
byte 1 32
byte 1 115
byte 1 112
byte 1 97
byte 1 99
byte 1 101
byte 1 0
align 1
LABELV $261
byte 1 116
byte 1 114
byte 1 105
byte 1 101
byte 1 100
byte 1 32
byte 1 116
byte 1 111
byte 1 32
byte 1 105
byte 1 110
byte 1 118
byte 1 97
byte 1 100
byte 1 101
byte 1 0
align 1
LABELV $259
byte 1 119
byte 1 97
byte 1 115
byte 1 32
byte 1 106
byte 1 117
byte 1 105
byte 1 99
byte 1 101
byte 1 100
byte 1 32
byte 1 98
byte 1 121
byte 1 0
align 1
LABELV $257
byte 1 39
byte 1 115
byte 1 32
byte 1 75
byte 1 97
byte 1 109
byte 1 105
byte 1 107
byte 1 97
byte 1 122
byte 1 101
byte 1 32
byte 1 98
byte 1 108
byte 1 97
byte 1 115
byte 1 116
byte 1 0
align 1
LABELV $256
byte 1 102
byte 1 97
byte 1 108
byte 1 108
byte 1 115
byte 1 32
byte 1 116
byte 1 111
byte 1 0
align 1
LABELV $254
byte 1 39
byte 1 115
byte 1 32
byte 1 80
byte 1 114
byte 1 111
byte 1 120
byte 1 32
byte 1 77
byte 1 105
byte 1 110
byte 1 101
byte 1 0
align 1
LABELV $253
byte 1 119
byte 1 97
byte 1 115
byte 1 32
byte 1 116
byte 1 111
byte 1 111
byte 1 32
byte 1 99
byte 1 108
byte 1 111
byte 1 115
byte 1 101
byte 1 32
byte 1 116
byte 1 111
byte 1 0
align 1
LABELV $251
byte 1 39
byte 1 115
byte 1 32
byte 1 67
byte 1 104
byte 1 97
byte 1 105
byte 1 110
byte 1 103
byte 1 117
byte 1 110
byte 1 0
align 1
LABELV $250
byte 1 103
byte 1 111
byte 1 116
byte 1 32
byte 1 108
byte 1 101
byte 1 97
byte 1 100
byte 1 32
byte 1 112
byte 1 111
byte 1 105
byte 1 115
byte 1 111
byte 1 110
byte 1 105
byte 1 110
byte 1 103
byte 1 32
byte 1 102
byte 1 114
byte 1 111
byte 1 109
byte 1 0
align 1
LABELV $248
byte 1 119
byte 1 97
byte 1 115
byte 1 32
byte 1 110
byte 1 97
byte 1 105
byte 1 108
byte 1 101
byte 1 100
byte 1 32
byte 1 98
byte 1 121
byte 1 0
align 1
LABELV $246
byte 1 39
byte 1 115
byte 1 32
byte 1 66
byte 1 70
byte 1 71
byte 1 0
align 1
LABELV $245
byte 1 119
byte 1 97
byte 1 115
byte 1 32
byte 1 98
byte 1 108
byte 1 97
byte 1 115
byte 1 116
byte 1 101
byte 1 100
byte 1 32
byte 1 98
byte 1 121
byte 1 0
align 1
LABELV $243
byte 1 119
byte 1 97
byte 1 115
byte 1 32
byte 1 101
byte 1 108
byte 1 101
byte 1 99
byte 1 116
byte 1 114
byte 1 111
byte 1 99
byte 1 117
byte 1 116
byte 1 101
byte 1 100
byte 1 32
byte 1 98
byte 1 121
byte 1 0
align 1
LABELV $241
byte 1 119
byte 1 97
byte 1 115
byte 1 32
byte 1 114
byte 1 97
byte 1 105
byte 1 108
byte 1 101
byte 1 100
byte 1 32
byte 1 98
byte 1 121
byte 1 0
align 1
LABELV $238
byte 1 39
byte 1 115
byte 1 32
byte 1 112
byte 1 108
byte 1 97
byte 1 115
byte 1 109
byte 1 97
byte 1 103
byte 1 117
byte 1 110
byte 1 0
align 1
LABELV $237
byte 1 119
byte 1 97
byte 1 115
byte 1 32
byte 1 109
byte 1 101
byte 1 108
byte 1 116
byte 1 101
byte 1 100
byte 1 32
byte 1 98
byte 1 121
byte 1 0
align 1
LABELV $235
byte 1 97
byte 1 108
byte 1 109
byte 1 111
byte 1 115
byte 1 116
byte 1 32
byte 1 100
byte 1 111
byte 1 100
byte 1 103
byte 1 101
byte 1 100
byte 1 0
align 1
LABELV $233
byte 1 39
byte 1 115
byte 1 32
byte 1 114
byte 1 111
byte 1 99
byte 1 107
byte 1 101
byte 1 116
byte 1 0
align 1
LABELV $231
byte 1 39
byte 1 115
byte 1 32
byte 1 115
byte 1 104
byte 1 114
byte 1 97
byte 1 112
byte 1 110
byte 1 101
byte 1 108
byte 1 0
align 1
LABELV $230
byte 1 119
byte 1 97
byte 1 115
byte 1 32
byte 1 115
byte 1 104
byte 1 114
byte 1 101
byte 1 100
byte 1 100
byte 1 101
byte 1 100
byte 1 32
byte 1 98
byte 1 121
byte 1 0
align 1
LABELV $228
byte 1 39
byte 1 115
byte 1 32
byte 1 103
byte 1 114
byte 1 101
byte 1 110
byte 1 97
byte 1 100
byte 1 101
byte 1 0
align 1
LABELV $227
byte 1 97
byte 1 116
byte 1 101
byte 1 0
align 1
LABELV $225
byte 1 119
byte 1 97
byte 1 115
byte 1 32
byte 1 103
byte 1 117
byte 1 110
byte 1 110
byte 1 101
byte 1 100
byte 1 32
byte 1 100
byte 1 111
byte 1 119
byte 1 110
byte 1 32
byte 1 98
byte 1 121
byte 1 0
align 1
LABELV $223
byte 1 119
byte 1 97
byte 1 115
byte 1 32
byte 1 109
byte 1 97
byte 1 99
byte 1 104
byte 1 105
byte 1 110
byte 1 101
byte 1 103
byte 1 117
byte 1 110
byte 1 110
byte 1 101
byte 1 100
byte 1 32
byte 1 98
byte 1 121
byte 1 0
align 1
LABELV $221
byte 1 119
byte 1 97
byte 1 115
byte 1 32
byte 1 112
byte 1 117
byte 1 109
byte 1 109
byte 1 101
byte 1 108
byte 1 101
byte 1 100
byte 1 32
byte 1 98
byte 1 121
byte 1 0
align 1
LABELV $219
byte 1 119
byte 1 97
byte 1 115
byte 1 32
byte 1 99
byte 1 97
byte 1 117
byte 1 103
byte 1 104
byte 1 116
byte 1 32
byte 1 98
byte 1 121
byte 1 0
align 1
LABELV $208
byte 1 110
byte 1 111
byte 1 110
byte 1 97
byte 1 109
byte 1 101
byte 1 0
align 1
LABELV $200
byte 1 89
byte 1 111
byte 1 117
byte 1 32
byte 1 102
byte 1 114
byte 1 97
byte 1 103
byte 1 103
byte 1 101
byte 1 100
byte 1 32
byte 1 37
byte 1 115
byte 1 0
align 1
LABELV $197
byte 1 89
byte 1 111
byte 1 117
byte 1 32
byte 1 102
byte 1 114
byte 1 97
byte 1 103
byte 1 103
byte 1 101
byte 1 100
byte 1 32
byte 1 37
byte 1 115
byte 1 10
byte 1 37
byte 1 115
byte 1 32
byte 1 112
byte 1 108
byte 1 97
byte 1 99
byte 1 101
byte 1 32
byte 1 119
byte 1 105
byte 1 116
byte 1 104
byte 1 32
byte 1 37
byte 1 105
byte 1 0
align 1
LABELV $190
byte 1 37
byte 1 115
byte 1 32
byte 1 37
byte 1 115
byte 1 46
byte 1 10
byte 1 0
align 1
LABELV $185
byte 1 107
byte 1 105
byte 1 108
byte 1 108
byte 1 101
byte 1 100
byte 1 32
byte 1 104
byte 1 105
byte 1 109
byte 1 115
byte 1 101
byte 1 108
byte 1 102
byte 1 0
align 1
LABELV $184
byte 1 107
byte 1 105
byte 1 108
byte 1 108
byte 1 101
byte 1 100
byte 1 32
byte 1 105
byte 1 116
byte 1 115
byte 1 101
byte 1 108
byte 1 102
byte 1 0
align 1
LABELV $181
byte 1 107
byte 1 105
byte 1 108
byte 1 108
byte 1 101
byte 1 100
byte 1 32
byte 1 104
byte 1 101
byte 1 114
byte 1 115
byte 1 101
byte 1 108
byte 1 102
byte 1 0
align 1
LABELV $178
byte 1 102
byte 1 111
byte 1 117
byte 1 110
byte 1 100
byte 1 32
byte 1 104
byte 1 105
byte 1 115
byte 1 32
byte 1 112
byte 1 114
byte 1 111
byte 1 120
byte 1 32
byte 1 109
byte 1 105
byte 1 110
byte 1 101
byte 1 0
align 1
LABELV $177
byte 1 102
byte 1 111
byte 1 117
byte 1 110
byte 1 100
byte 1 32
byte 1 105
byte 1 116
byte 1 115
byte 1 32
byte 1 112
byte 1 114
byte 1 111
byte 1 120
byte 1 32
byte 1 109
byte 1 105
byte 1 110
byte 1 101
byte 1 0
align 1
LABELV $174
byte 1 102
byte 1 111
byte 1 117
byte 1 110
byte 1 100
byte 1 32
byte 1 104
byte 1 101
byte 1 114
byte 1 32
byte 1 112
byte 1 114
byte 1 111
byte 1 120
byte 1 32
byte 1 109
byte 1 105
byte 1 110
byte 1 101
byte 1 0
align 1
LABELV $170
byte 1 115
byte 1 104
byte 1 111
byte 1 117
byte 1 108
byte 1 100
byte 1 32
byte 1 104
byte 1 97
byte 1 118
byte 1 101
byte 1 32
byte 1 117
byte 1 115
byte 1 101
byte 1 100
byte 1 32
byte 1 97
byte 1 32
byte 1 115
byte 1 109
byte 1 97
byte 1 108
byte 1 108
byte 1 101
byte 1 114
byte 1 32
byte 1 103
byte 1 117
byte 1 110
byte 1 0
align 1
LABELV $168
byte 1 109
byte 1 101
byte 1 108
byte 1 116
byte 1 101
byte 1 100
byte 1 32
byte 1 104
byte 1 105
byte 1 109
byte 1 115
byte 1 101
byte 1 108
byte 1 102
byte 1 0
align 1
LABELV $167
byte 1 109
byte 1 101
byte 1 108
byte 1 116
byte 1 101
byte 1 100
byte 1 32
byte 1 105
byte 1 116
byte 1 115
byte 1 101
byte 1 108
byte 1 102
byte 1 0
align 1
LABELV $164
byte 1 109
byte 1 101
byte 1 108
byte 1 116
byte 1 101
byte 1 100
byte 1 32
byte 1 104
byte 1 101
byte 1 114
byte 1 115
byte 1 101
byte 1 108
byte 1 102
byte 1 0
align 1
LABELV $160
byte 1 98
byte 1 108
byte 1 101
byte 1 119
byte 1 32
byte 1 104
byte 1 105
byte 1 109
byte 1 115
byte 1 101
byte 1 108
byte 1 102
byte 1 32
byte 1 117
byte 1 112
byte 1 0
align 1
LABELV $159
byte 1 98
byte 1 108
byte 1 101
byte 1 119
byte 1 32
byte 1 105
byte 1 116
byte 1 115
byte 1 101
byte 1 108
byte 1 102
byte 1 32
byte 1 117
byte 1 112
byte 1 0
align 1
LABELV $156
byte 1 98
byte 1 108
byte 1 101
byte 1 119
byte 1 32
byte 1 104
byte 1 101
byte 1 114
byte 1 115
byte 1 101
byte 1 108
byte 1 102
byte 1 32
byte 1 117
byte 1 112
byte 1 0
align 1
LABELV $152
byte 1 116
byte 1 114
byte 1 105
byte 1 112
byte 1 112
byte 1 101
byte 1 100
byte 1 32
byte 1 111
byte 1 110
byte 1 32
byte 1 104
byte 1 105
byte 1 115
byte 1 32
byte 1 111
byte 1 119
byte 1 110
byte 1 32
byte 1 103
byte 1 114
byte 1 101
byte 1 110
byte 1 97
byte 1 100
byte 1 101
byte 1 0
align 1
LABELV $151
byte 1 116
byte 1 114
byte 1 105
byte 1 112
byte 1 112
byte 1 101
byte 1 100
byte 1 32
byte 1 111
byte 1 110
byte 1 32
byte 1 105
byte 1 116
byte 1 115
byte 1 32
byte 1 111
byte 1 119
byte 1 110
byte 1 32
byte 1 103
byte 1 114
byte 1 101
byte 1 110
byte 1 97
byte 1 100
byte 1 101
byte 1 0
align 1
LABELV $148
byte 1 116
byte 1 114
byte 1 105
byte 1 112
byte 1 112
byte 1 101
byte 1 100
byte 1 32
byte 1 111
byte 1 110
byte 1 32
byte 1 104
byte 1 101
byte 1 114
byte 1 32
byte 1 111
byte 1 119
byte 1 110
byte 1 32
byte 1 103
byte 1 114
byte 1 101
byte 1 110
byte 1 97
byte 1 100
byte 1 101
byte 1 0
align 1
LABELV $144
byte 1 103
byte 1 111
byte 1 101
byte 1 115
byte 1 32
byte 1 111
byte 1 117
byte 1 116
byte 1 32
byte 1 119
byte 1 105
byte 1 116
byte 1 104
byte 1 32
byte 1 97
byte 1 32
byte 1 98
byte 1 97
byte 1 110
byte 1 103
byte 1 0
align 1
LABELV $136
byte 1 119
byte 1 97
byte 1 115
byte 1 32
byte 1 105
byte 1 110
byte 1 32
byte 1 116
byte 1 104
byte 1 101
byte 1 32
byte 1 119
byte 1 114
byte 1 111
byte 1 110
byte 1 103
byte 1 32
byte 1 112
byte 1 108
byte 1 97
byte 1 99
byte 1 101
byte 1 0
align 1
LABELV $134
byte 1 115
byte 1 97
byte 1 119
byte 1 32
byte 1 116
byte 1 104
byte 1 101
byte 1 32
byte 1 108
byte 1 105
byte 1 103
byte 1 104
byte 1 116
byte 1 0
align 1
LABELV $132
byte 1 100
byte 1 111
byte 1 101
byte 1 115
byte 1 32
byte 1 97
byte 1 32
byte 1 98
byte 1 97
byte 1 99
byte 1 107
byte 1 32
byte 1 102
byte 1 108
byte 1 105
byte 1 112
byte 1 32
byte 1 105
byte 1 110
byte 1 116
byte 1 111
byte 1 32
byte 1 116
byte 1 104
byte 1 101
byte 1 32
byte 1 108
byte 1 97
byte 1 118
byte 1 97
byte 1 0
align 1
LABELV $130
byte 1 109
byte 1 101
byte 1 108
byte 1 116
byte 1 101
byte 1 100
byte 1 0
align 1
LABELV $128
byte 1 115
byte 1 97
byte 1 110
byte 1 107
byte 1 32
byte 1 108
byte 1 105
byte 1 107
byte 1 101
byte 1 32
byte 1 97
byte 1 32
byte 1 114
byte 1 111
byte 1 99
byte 1 107
byte 1 0
align 1
LABELV $126
byte 1 119
byte 1 97
byte 1 115
byte 1 32
byte 1 115
byte 1 113
byte 1 117
byte 1 105
byte 1 115
byte 1 104
byte 1 101
byte 1 100
byte 1 0
align 1
LABELV $124
byte 1 99
byte 1 114
byte 1 97
byte 1 116
byte 1 101
byte 1 114
byte 1 101
byte 1 100
byte 1 0
align 1
LABELV $122
byte 1 115
byte 1 117
byte 1 105
byte 1 99
byte 1 105
byte 1 100
byte 1 101
byte 1 115
byte 1 0
align 1
LABELV $118
byte 1 94
byte 1 55
byte 1 0
align 1
LABELV $117
byte 1 110
byte 1 0
align 1
LABELV $110
byte 1 67
byte 1 71
byte 1 95
byte 1 79
byte 1 98
byte 1 105
byte 1 116
byte 1 117
byte 1 97
byte 1 114
byte 1 121
byte 1 58
byte 1 32
byte 1 116
byte 1 97
byte 1 114
byte 1 103
byte 1 101
byte 1 116
byte 1 32
byte 1 111
byte 1 117
byte 1 116
byte 1 32
byte 1 111
byte 1 102
byte 1 32
byte 1 114
byte 1 97
byte 1 110
byte 1 103
byte 1 101
byte 1 0
align 1
LABELV $105
byte 1 37
byte 1 115
byte 1 37
byte 1 115
byte 1 0
align 1
LABELV $104
byte 1 37
byte 1 105
byte 1 116
byte 1 104
byte 1 0
align 1
LABELV $103
byte 1 37
byte 1 105
byte 1 114
byte 1 100
byte 1 0
align 1
LABELV $100
byte 1 37
byte 1 105
byte 1 110
byte 1 100
byte 1 0
align 1
LABELV $97
byte 1 37
byte 1 105
byte 1 115
byte 1 116
byte 1 0
align 1
LABELV $94
byte 1 49
byte 1 51
byte 1 116
byte 1 104
byte 1 0
align 1
LABELV $91
byte 1 49
byte 1 50
byte 1 116
byte 1 104
byte 1 0
align 1
LABELV $88
byte 1 49
byte 1 49
byte 1 116
byte 1 104
byte 1 0
align 1
LABELV $85
byte 1 94
byte 1 51
byte 1 51
byte 1 114
byte 1 100
byte 1 94
byte 1 55
byte 1 0
align 1
LABELV $82
byte 1 94
byte 1 49
byte 1 50
byte 1 110
byte 1 100
byte 1 94
byte 1 55
byte 1 0
align 1
LABELV $79
byte 1 94
byte 1 52
byte 1 49
byte 1 115
byte 1 116
byte 1 94
byte 1 55
byte 1 0
align 1
LABELV $76
byte 1 0
align 1
LABELV $75
byte 1 84
byte 1 105
byte 1 101
byte 1 100
byte 1 32
byte 1 102
byte 1 111
byte 1 114
byte 1 32
byte 1 0
|
oeis/142/A142310.asm | neoneye/loda-programs | 11 | 4609 | ; A142310: Primes congruent to 41 mod 44.
; Submitted by <NAME>
; 41,173,349,569,613,701,877,1009,1097,1229,1361,1493,1669,1801,1889,1933,2153,2417,2549,2593,2857,3121,3209,3253,3517,4001,4133,4177,4397,4441,4793,4969,5101,5189,5233,5717,5849,5981,6113,6421,6553,6949,7213,7433,7477,7741,7829,7873,8093,8269,8753,8929,9281,9413,9677,9721,9941,10337,10513,10601,10733,10909,11173,11261,11393,11437,11657,11701,11789,11833,12097,12713,12757,12889,13109,13241,13417,13681,13901,14033,14341,14561,14737,14869,14957,15661,15749,15881,16057,16189,16453,16673,16937,16981
mov $1,9
mov $2,$0
add $2,2
pow $2,2
lpb $2
add $1,31
mov $3,$1
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,13
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
sub $2,1
lpe
mov $0,$1
add $0,32
|
src/assembler.ads | docandrew/YOTROC | 4 | 6614 | -- Recursive Descent parser for YOTROC instruction set
--
-- Registers: 64 general purpose registers
-- 64 floating-point registers
-- 64-bit FLAGS register
-- 64-bit program counter
--
-- label: keep a separate "label table" with addresses of the instruction
-- immediately after. Anything that ends with a ':' is a label.
--
-- db, ds, dq : declare bytes, shorts, quads in memory
--
-- define variable value -- simple text substitution, keep separate table
--
-- Addressing Modes:
-- Immediate: DECNUM, 16#HEXNUM#, 2#BINNUM#
-- Register: R1, R2
-- Indirect: *R1, *R2, meaning use memory address in that register
-- Memory: *0dDECNUM, *0xHEXNUM, use memory address
-- Indexed: *(R1 + immediate)
with Ada.Containers.Vectors; use Ada.Containers;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Interfaces; use Interfaces;
with vm; use vm;
package assembler is
---------------------------------------------------------------------------
-- The types below look strange. Ada calls them "Variant Records", but they
-- work much like Sum types in other languages.
---------------------------------------------------------------------------
-- identifiers are just strings, but need to obey rules:
-- has to start with leading alpha char, and alphanumeric only
subtype Identifier is Unbounded_String;
type RealKind is (IntegerReal, FloatReal);
-- When storing identifiers, they need to map to some sort of
-- numeric type. We represent that here. Ada already has a Real
-- type, so make up a new one. This is only a "Real" number in
-- the sense of our lexical analysis. A YOTROCReal can store either
-- an Integer or a Floating-Point number.
type YOTROCReal (kind : RealKind := FloatReal) is
record
case kind is
when IntegerReal =>
realInt : Integer;
when FloatReal =>
realFloat : Float;
end case;
end record;
type ImmediateKind is (IdentifierImm, IntegerImm, FloatImm);
-- An immediate can either be a variable name, an integer,
-- or a floating-point value.
type Immediate (kind : ImmediateKind := FloatImm) is
record
case kind is
when IdentifierImm =>
-- will need to attempt a lookup of this identifier in
-- the identifier table and see if there's a value for it.
immID : Unbounded_String;
when IntegerImm =>
immInt : Integer;
when FloatImm =>
immFloat : Float;
end case;
end record;
type OperandKind is (ImmediateOperand, RegisterOperand, Displacement);
-- Variant Record, specify default kind so we can keep these as part of an array
type Operand (kind : OperandKind := Displacement) is
record
case kind is
when ImmediateOperand =>
imm : Immediate;
when RegisterOperand =>
regName : Register;
-- double up here for register indirect as well, since we can
-- just set offset = 0.
when Displacement =>
regBase : GeneralRegister;
offset : Integer;
end case;
end record;
--type RegisterKind is (GeneralReg, FloatingReg);
type InstructionKind is (NoOperand, OneOperand, TwoOperand, ThreeOperand);
-- Variant record with up to 3 operands for this instruction
type Instruction (kind : InstructionKind := ThreeOperand) is
record
line : Integer; -- line number this instruction was at
operator : Operators;
case kind is
when NoOperand =>
null;
when OneOperand | TwoOperand | ThreeOperand =>
op1 : Operand;
case kind is
when TwoOperand | ThreeOperand =>
op2 : Operand;
case kind is
when ThreeOperand =>
op3 : Operand;
when others =>
null;
end case;
when others =>
null;
end case;
end case;
end record;
-- output from parser
package InstructionVector is new Vectors(Natural, Instruction);
use InstructionVector;
procedure dumpIdentifiers;
function parse(source : in String;
instructions : out InstructionVector.Vector;
msg : out Unbounded_String) return Boolean;
function codeGen(instructions : in InstructionVector.Vector;
objectFile : out MachineCodeVector.Vector;
msg : out Unbounded_String) return Boolean;
end assembler;
|
libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_iy/expm1_fastcall.asm | meesokim/z88dk | 0 | 163241 |
SECTION code_fp_math48
PUBLIC _expm1_fastcall
EXTERN cm48_sdcciy_expm1_fastcall
defc _expm1_fastcall = cm48_sdcciy_expm1_fastcall
|
programs/oeis/063/A063808.asm | neoneye/loda | 22 | 22451 | ; A063808: Spherical growth series for Z as generated by {2, 3}.
; 1,4,8,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6
mul $0,2
mov $1,$0
trn $1,1
lpb $1
mov $0,2
mov $1,3
lpe
add $0,1
add $0,$1
|
tests/relocate/relocation_temporary_labels.asm | fengjixuchui/sjasmplus | 220 | 166561 | <gh_stars>100-1000
ORG $1000
; first section is not part of relocation table
1:
jr 1B ; opcode should be in relocation table
jr nz,1B
jr z,1B
jr nc,1B
jr c,1B
jp nz,1B
jp 1B ; opcode should be in relocation table
jp z,1B
jp nc,1B
jp c,1B
jp po,1B
jp pe,1B
jp p,1B
jp m,1B
call nz,1B
call z,1B
call 1B
call nc,1B
call c,1B
call po,1B
call pe,1B
call p,1B
call m,1B
jr 1F ; opcode should be in relocation table
jr nz,1F
jr z,1F
jr nc,1F
jr c,1F
jp nz,1F
jp 1F ; opcode should be in relocation table
jp z,1F
jp nc,1F
jp c,1F
jp po,1F
jp pe,1F
jp p,1F
jp m,1F
call nz,1F
call z,1F
call 1F
call nc,1F
call c,1F
call po,1F
call pe,1F
call p,1F
call m,1F
1:
; second section does test relocation
RELOCATE_START
ASSERT 2 * relocate_count == relocate_size
ASSERT 36 == relocate_count
dw relocate_count
dw relocate_size
1: ; usage of this label should trigger relocation
; relative jumps don't need relocation
jr 1B
jr nz,1B
jr z,1B
jr nc,1B
jr c,1B
; absolute jumps need relocation
jp nz,1B
jp 1B
jp z,1B
jp nc,1B
jp c,1B
jp po,1B
jp pe,1B
jp p,1B
jp m,1B
; calls need relocation
call nz,1B
call z,1B
call 1B
call nc,1B
call c,1B
call po,1B
call pe,1B
call p,1B
call m,1B
; again the same set, but this time using forward temporary label
jr 1F
jr nz,1F
jr z,1F
jr nc,1F
jr c,1F
jp nz,1F
jp 1F
jp z,1F
jp nc,1F
jp c,1F
jp po,1F
jp pe,1F
jp p,1F
jp m,1F
call nz,1F
call z,1F
call 1F
call nc,1F
call c,1F
call po,1F
call pe,1F
call p,1F
call m,1F
1: ; usage of this label should trigger relocation
;; adding missing DJNZ (from the first version of the test)
22:
djnz 22B
djnz 22F
22:
; the relocation table must be after all temporary labels, as those don't manage
; to settle down within 3 passes if there's dynamic-size table ahead, and "forward"
; labels are referenced
RELOCATE_TABLE ; should emit the 36 addresses of opcode data
RELOCATE_END
;; adding missing DJNZ outside of relocation block
22:
djnz 22B
djnz 22F
22:
|
programs/oeis/106/A106542.asm | neoneye/loda | 22 | 25911 | ; A106542: a(n) = a(n-1) - 2*a(n-2) - 3*a(n-3) - ... - (n-1)*a(1), beginning with 3.
; 3,3,-3,-18,-33,-15,84,261,333,-138,-1557,-3315,-2436,6153,24009,36390,1431,-129639,-323292,-318819,400725,2149686,3807795,1476405,-10310388,-30697599,-37588047,20103078,186854271,384871329,260548788,-769001739,-2840006499,-4153913226,200289339,15690421149,37761990300,35234443833,-51725777703,-255825571674,-438378938841,-139460513559,1261862010180,3606130720653,4230161083941,-2816446331082,-22387882971645,-44621095091643,-27556763078868,95659420278321,335519886046017,473149030588710,-66833497907313,-1895205874573455,-4405152073006380,-3873093841966491,6616067089985517,30403366333776246,50383575867468171,12366030113494317,-154013056329305412,-423102167820451479,-474509161587838743,383957241680130342,2678213197338681783,5165835060439716153,2874353677986000228,-11849687873563216515,-39589161889740218379,-53770338945432572106,12935416865276942547,228479621543513251413,513221102413289897292,423136033252857319905,-839738169220851023919,-3608452469100259876698,-5780394494690809870689,-978397477012832276415,18749875104215032770804,49580823708327639953109,53036300649882091452477,-51295466383561859866506,-319906254983440756955685,-597168831732748788629571,-294566153048166300843300,1462333189552363526706585,4665492670432424507077113,6095679757439123286011814,-2115757700740025623936953,-27494686548550844287715703,-59713911627074158171438716,-45899817539948304323611539,105880732418424189310927557,427713461700865773207962934,661937087930579764422027939,59005420124258805848124261,-2277242255878390858149841044,-5802879692395307074846088559,-5904416957545449322092811935,6746663077583405691652324902
seq $0,106540 ; a(n)= a(n-1)-2*a(n-2)-3*a(n-3)-...-(n-1)*a(1), beginning with 1.
mul $0,3
|
programs/oeis/245/A245920.asm | karttu/loda | 0 | 89713 | ; A245920: Limit-reverse of the (2,1)-version of the infinite Fibonacci word A014675 with first term as initial block.
; 2,1,2,1,2,2,1,2,1,2,2,1,2,2,1,2,1,2,2,1,2,2,1,2,1,2,2,1,2,1,2,2,1,2,2,1,2,1,2,2,1,2,1,2,2,1,2,2,1,2,1,2,2,1,2,2,1,2,1,2,2,1,2,1,2,2,1,2,2,1,2,1,2,2,1,2,2,1,2,1,2,2,1,2,1,2,2,1,2,2,1,2,1,2,2,1,2,1,2,2,1,2,2,1,2,1,2,2,1,2,2,1,2,1,2,2,1,2,1,2,2,1,2,2,1,2,1,2,2,1,2,2,1,2,1,2,2,1,2,1,2,2,1,2,2,1,2,1,2,2,1,2,1,2,2,1,2,2,1,2,1,2,2,1,2,2,1,2,1,2,2,1,2,1,2,2,1,2,2,1,2,1,2,2,1,2,1,2,2,1,2,2,1,2,1,2,2,1,2,2,1,2,1,2,2,1,2,1,2,2,1,2,2,1,2,1,2,2,1,2,2,1,2,1,2,2,1,2,1,2,2,1,2,2,1,2,1,2,2,1,2,1,2,2,1,2,2,1,2,1
add $0,11441476
cal $0,287659 ; Positions of 1 in A287657; complement of A287658.
mov $1,$0
gcd $1,-2
|
src/lab-code/select-accept/src/main.adb | hannesb0/rtpl18 | 0 | 891 | with Ada.text_io; use Ada.Text_IO;
procedure main is
task type Server_Task is
entry A;
entry B;
end Server_Task;
task body Server_Task is
begin
loop
Put_Line("Server starts next cycle");
select
accept A do
Put_Line("A start");
delay 1.5;
Put_Line("A end");
end A;
or
accept B do
Put_Line("B start");
delay 0.1;
Put_Line("B end");
end B;
end select;
delay 0.9; -- server is doing something else beyond just serving A and B
Put_Line("Server finished cycle");
end loop;
end Server_Task;
Server : Server_Task; -- create server instance
-- a task that only calls Server.A, blocking.
task type Client_A is
end Client_A;
task body Client_A is
begin
loop
Server.A;
end loop;
end Client_A;
-- a different task, that calls Server.B, but waits no more than 2 seconds.
task type Client_B;
task body Client_B is
begin
loop
select
Server.B;
or
delay 2.0;
Put_Line("timeout B");
end select;
end loop;
end Client_B;
TA : Client_A;
TB : Client_B;
begin
null;
end main;
|
awa/plugins/awa-workspaces/src/awa-workspaces-modules.ads | Letractively/ada-awa | 0 | 8416 | <filename>awa/plugins/awa-workspaces/src/awa-workspaces-modules.ads
-----------------------------------------------------------------------
-- awa-workspaces-module -- Module workspaces
-- Copyright (C) 2011, 2012 <NAME>
-- Written by <NAME> (<EMAIL>)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with ADO.Sessions;
with ASF.Applications;
with AWA.Modules;
with AWA.Services.Contexts;
with AWA.Workspaces.Models;
package AWA.Workspaces.Modules is
-- The name under which the module is registered.
NAME : constant String := "workspaces";
-- ------------------------------
-- Module workspaces
-- ------------------------------
type Workspace_Module is new AWA.Modules.Module with private;
type Workspace_Module_Access is access all Workspace_Module'Class;
-- Initialize the workspaces module.
overriding
procedure Initialize (Plugin : in out Workspace_Module;
App : in AWA.Modules.Application_Access;
Props : in ASF.Applications.Config);
-- Get the current workspace associated with the current user.
-- If the user has not workspace, create one.
procedure Get_Workspace (Session : in out ADO.Sessions.Master_Session;
Context : in AWA.Services.Contexts.Service_Context_Access;
Workspace : out AWA.Workspaces.Models.Workspace_Ref);
private
type Workspace_Module is new AWA.Modules.Module with null record;
end AWA.Workspaces.Modules;
|
books_and_notes/professional_courses/Assembly_language_and_programming/sources/汇编语言程序设计教程第四版/codes/5_11.asm | gxw1/review_the_national_post-graduate_entrance_examination | 640 | 247398 | DATA SEGMENT
BASE DW SUBP1,SUBP2,SUBP3,SUBP4
DW SUBP5,SUBP6,SUBP7,SUBP8
DISPLAY DB 'ERROR',0AH,0DH,'$'
DATA ENDS
STACK SEGMENT STACK
DW 100 DUP (?)
STACK ENDS
CODE SEGMENT
ASSUME CS:CODE,SS:STACK,DS:DATA
START: MOV AX,DATA
MOV DS,AX
INPUT: MOV AH,1
INT 21H
CMP AL,'1'
JB ERR
CMP AL,'8'
JA ERR
SUB AL,'1'
AND AX,000FH
JMP BASE[AX*2]
SUBP1: ...
...
SUBP8: ...
...
ERR: CMP AL,'E'
JZ EXIT
MOV DX,OFFSET DISPLAY
MOV AH,09H
INT 21H
JMP INPUT
EXIT: MOV AH,4CH
INT 21H
CODE ENDS
END START
|
data/mapObjects/Route11.asm | AmateurPanda92/pokemon-rby-dx | 9 | 95103 | <gh_stars>1-10
Route11_Object:
db $f ; border block
db 5 ; warps
warp 49, 8, 0, ROUTE_11_GATE_1F
warp 49, 9, 1, ROUTE_11_GATE_1F
warp 58, 8, 2, ROUTE_11_GATE_1F
warp 58, 9, 3, ROUTE_11_GATE_1F
warp 4, 5, 0, DIGLETTS_CAVE_ROUTE_11
db 1 ; signs
sign 1, 5, 11 ; Route11Text11
db 10 ; objects
object SPRITE_GAMBLER, 10, 14, STAY, DOWN, 1, OPP_GAMBLER, 1
object SPRITE_GAMBLER, 26, 9, STAY, DOWN, 2, OPP_GAMBLER, 2
object SPRITE_BUG_CATCHER, 13, 5, STAY, LEFT, 3, OPP_YOUNGSTER, 9
object SPRITE_BLACK_HAIR_BOY_2, 36, 11, STAY, DOWN, 4, OPP_ENGINEER, 2
object SPRITE_BUG_CATCHER, 22, 4, STAY, UP, 5, OPP_YOUNGSTER, 10
object SPRITE_GAMBLER, 45, 7, STAY, DOWN, 6, OPP_GAMBLER, 3
object SPRITE_GAMBLER, 33, 3, STAY, UP, 7, OPP_GAMBLER, 4
object SPRITE_BUG_CATCHER, 43, 5, STAY, RIGHT, 8, OPP_YOUNGSTER, 11
object SPRITE_BLACK_HAIR_BOY_2, 45, 16, STAY, LEFT, 9, OPP_ENGINEER, 3
object SPRITE_BUG_CATCHER, 22, 12, STAY, UP, 10, OPP_YOUNGSTER, 12
; warp-to
warp_to 49, 8, ROUTE_11_WIDTH ; ROUTE_11_GATE_1F
warp_to 49, 9, ROUTE_11_WIDTH ; ROUTE_11_GATE_1F
warp_to 58, 8, ROUTE_11_WIDTH ; ROUTE_11_GATE_1F
warp_to 58, 9, ROUTE_11_WIDTH ; ROUTE_11_GATE_1F
warp_to 4, 5, ROUTE_11_WIDTH ; DIGLETTS_CAVE_ROUTE_11
|
tools/xml2ayacc/gramar_items.adb | faelys/gela-asis | 4 | 2537 | ------------------------------------------------------------------------------
-- G E L A A S I S --
-- ASIS implementation for Gela project, a portable Ada compiler --
-- http://gela.ada-ru.org --
-- - - - - - - - - - - - - - - - --
-- Read copyright and license at the end of this file --
------------------------------------------------------------------------------
-- $Revision: 209 $ $Date: 2013-11-30 21:03:24 +0200 (Сб., 30 нояб. 2013) $
with Nodes;
with Tokens;
with Asis_Trait_Kinds;
with Gramar_Items.Code;
with Text_Streams.File;
with XML_IO.Stream_Readers;
with Ada.Characters.Handling;
with Gela.Embeded_Links.Lists;
package body Gramar_Items is
Format_Error : exception;
function Get_Trait_Kind (Name : String) return String;
-------------------
-- Sequence_Node --
-------------------
function Get_Next (Item : Item_Ptr) return Item_Ptr;
procedure Set_Next (Item, Next : Item_Ptr);
package Item_Lists is
new Gela.Embeded_Links.Lists (Item'Class, Item_Ptr);
type Sequence_Node is tagged limited record
Next : Sequence;
List : Item_Lists.List;
Parent : Rule;
Parent_Item : Item_Ptr;
Item_Index : Natural := 0;
List_Index : Natural := 0;
end record;
function Get_Next (Item : Sequence) return Sequence;
procedure Set_Next (Item, Next : Sequence);
package Sequence_Lists is
new Gela.Embeded_Links.Lists (Sequence_Node'Class, Sequence);
---------------
-- Rule_Node --
---------------
type Rule_Node is tagged limited record
List : Sequence_Lists.List;
Name : Unbounded_String;
Next : Rule;
end record;
function Get_Next (Item : Rule) return Rule;
procedure Set_Next (Item, Next : Rule);
package Rule_Lists is
new Gela.Embeded_Links.Lists (Rule_Node'Class, Rule);
-----------------
-- Gramar_Node --
-----------------
type Gramar_Node is record
List : Rule_Lists.List;
end record;
type Gramar_Ptr is access all Gramar_Node;
Gramar : Gramar_Ptr;
type Option_Node is record
List : Sequence_Lists.List;
end record;
function Compound_Name
(Item : Sequence;
Conflict : Boolean := False)
return String;
function Compound_Name (Item : Sequence; Part : Positive) return String;
function Find_Item
(Seq : Sequence;
Name : String;
Inst : Positive) return Natural;
type Reference_Ptr is access all Reference;
type Keyword_Ptr is access all Keyword;
type Delimiter_Ptr is access all Delimiter;
type List_Ptr is access all List;
type Option_Ptr is access all Option;
-----------
-- Count --
-----------
function Count (Item : Sequence) return Natural is
begin
return Natural (Item_Lists.Length (Item.List));
end Count;
-----------
-- Count --
-----------
function Count (Item : Rule) return Natural is
begin
return Natural (Sequence_Lists.Length (Item.List));
end Count;
-----------
-- Count --
-----------
function Count (Item : Option) return Natural is
begin
return Natural (Sequence_Lists.Length (Item.Node.List));
end Count;
---------------------
-- Get_Alternative --
---------------------
function Get_Alternative
(Item : Rule;
Index : Positive)
return Sequence
is
use Sequence_Lists;
Result : Sequence := First (Item.List);
begin
for J in 2 .. Index loop
Result := Next (Item.List, Result);
end loop;
return Result;
end Get_Alternative;
--------------
-- Get_Item --
--------------
function Get_Item
(Object : Sequence;
Index : Positive)
return Item_Ptr
is
use Item_Lists;
Result : Item_Ptr := First (Object.List);
begin
for J in 2 .. Index loop
Result := Next (Object.List, Result);
end loop;
return Result;
end Get_Item;
-----------
-- Index --
-----------
function Wrapper_Index (Object : Wrapper) return Natural is
begin
return Object.Index;
end Wrapper_Index;
--------------
-- Is_Token --
--------------
function Is_Token (Item : Reference) return Boolean is
begin
return Item.Is_Token;
end Is_Token;
-----------
-- Items --
-----------
function Items
(Item : Option;
Index : Positive := 1) return Sequence
is
use Sequence_Lists;
Result : Sequence := First (Item.Node.List);
begin
for J in 2 .. Index loop
Result := Next (Item.Node.List, Result);
end loop;
return Result;
end Items;
-----------
-- Items --
-----------
function Items (Item : List) return Sequence is
begin
return Item.Items;
end Items;
----------
-- Name --
----------
function Name (Item : Rule) return String is
begin
return To_String (Item.Name);
end Name;
----------
-- Name --
----------
function Name (Item : Reference) return String is
begin
return To_String (Item.Name);
end Name;
----------
-- Text --
----------
function Text (Item : Keyword) return String is
begin
return To_String (Item.Text);
end Text;
----------
-- Text --
----------
function Text (Item : Delimiter) return String is
begin
return To_String (Item.Text);
end Text;
--------------
-- Set_Next --
--------------
procedure Set_Next (Item, Next : Item_Ptr) is
begin
Item.Next := Next;
end Set_Next;
--------------
-- Set_Next --
--------------
procedure Set_Next (Item, Next : Rule) is
begin
Item.Next := Next;
end Set_Next;
--------------
-- Set_Next --
--------------
procedure Set_Next (Item, Next : Sequence) is
begin
Item.Next := Next;
end Set_Next;
--------------
-- Get_Next --
--------------
function Get_Next (Item : Item_Ptr) return Item_Ptr is
begin
return Item.Next;
end Get_Next;
--------------
-- Get_Next --
--------------
function Get_Next (Item : Sequence) return Sequence is
begin
return Item.Next;
end Get_Next;
--------------
-- Get_Next --
--------------
function Get_Next (Item : Rule) return Rule is
begin
return Item.Next;
end Get_Next;
------------------
-- Set_Sequence --
------------------
procedure Set_Sequence
(Object : in out Item;
Child : in Sequence) is
begin
raise Format_Error;
end Set_Sequence;
------------------
-- Set_Sequence --
------------------
procedure Set_Sequence
(Object : in out Option;
Child : in Sequence) is
begin
Sequence_Lists.Append (Object.Node.List, Child);
end Set_Sequence;
------------------
-- Set_Sequence --
------------------
procedure Set_Sequence
(Object : in out List;
Child : in Sequence) is
begin
Object.Items := Child;
end Set_Sequence;
---------------
-- Read_File --
---------------
procedure Read_File (Name : String) is
use XML_IO;
package R renames XML_IO.Stream_Readers;
Max_Level : constant := 8;
Stream : aliased Text_Streams.File.File_Text_Stream;
Parser : R.Reader (Stream'Access, R.Default_Buffer_Size);
Last_Rule : Rule;
Seq : array (1 .. Max_Level) of Sequence;
Last_Seq : Natural := 0;
Items : array (1 .. Max_Level) of Item_Ptr;
Last_Item : Natural := 0;
-------------------
-- Last_Sequence --
-------------------
function Last_Sequence return Sequence is
begin
return Seq (Last_Seq);
end Last_Sequence;
---------------------
-- Count_Instances --
---------------------
function Count_Instances (Name : String) return Positive is
use Item_Lists;
Instance : Positive := 1;
Item : aliased Item_Ptr;
begin
while Iterate (Last_Sequence.List, Item'Access) loop
if Name = Item_Name (Item.all) then
Instance := Instance + 1;
end if;
end loop;
return Instance;
end Count_Instances;
-------------------
-- Get_Attribute --
-------------------
function Get_Attribute (Name : String) return String is
begin
return R.Attribute_Value (Parser, Name);
end Get_Attribute;
-------------------
-- Get_Attribute --
-------------------
function Get_Attribute (Name : String) return Unbounded_String is
begin
return To_Unbounded_String (R.Attribute_Value (Parser, Name));
end Get_Attribute;
----------------
-- On_Element --
----------------
procedure On_Element is
use Item_Lists;
use Rule_Lists;
use Sequence_Lists;
Local_Name : constant String := R.Name (Parser);
begin
if Local_Name = "gramar" then
Gramar := new Gramar_Node;
elsif Local_Name = "rule" then
Last_Rule := new Rule_Node;
Last_Rule.Name := Get_Attribute ("name");
Append (Gramar.List, Last_Rule);
elsif Local_Name = "seq" then
Last_Seq := Last_Seq + 1;
Seq (Last_Seq) := new Sequence_Node;
if Last_Item > 0 then
Set_Sequence (Items (Last_Item).all, Last_Sequence);
Last_Sequence.Parent_Item := Items (Last_Item);
else
Append (Last_Rule.List, Last_Sequence);
Last_Sequence.Parent := Last_Rule;
end if;
elsif Local_Name = "ref" then
declare
Node : constant Reference_Ptr := new Reference;
Name : constant String := Get_Attribute ("name");
begin
Node.Name := To_Unbounded_String (Name);
Node.Instance := Count_Instances (Name);
Node.Parent := Last_Sequence;
if Node.Name = "identifier" or
Node.Name = "numeric_literal" or
Node.Name = "character_literal" or
Node.Name = "string_literal"
then
Node.Is_Token := True;
end if;
Append (Last_Sequence.List, Item_Ptr (Node));
end;
elsif Local_Name = "keyword" then
declare
Node : constant Keyword_Ptr := new Keyword;
Name : constant String := Get_Attribute ("text");
begin
Node.Text := To_Unbounded_String (Name);
Node.Instance := Count_Instances (Name);
Node.Parent := Last_Sequence;
Append (Last_Sequence.List, Item_Ptr (Node));
end;
elsif Local_Name = "delim" then
declare
Node : constant Delimiter_Ptr := new Delimiter;
Name : constant String := Get_Attribute ("text");
begin
Node.Text := To_Unbounded_String (Name);
Node.Parent := Last_Sequence;
Append (Last_Sequence.List, Item_Ptr (Node));
end;
elsif Local_Name = "list" then
declare
Node : constant List_Ptr := new List;
begin
Last_Item := Last_Item + 1;
Items (Last_Item) := Item_Ptr (Node);
Node.Parent := Last_Sequence;
Append (Last_Sequence.List, Item_Ptr (Node));
end;
elsif Local_Name = "opt" then
declare
Data : constant Option_Node_Ptr := new Option_Node;
Node : constant Option_Ptr := new Option;
begin
Node.Node := Data;
Last_Item := Last_Item + 1;
Items (Last_Item) := Item_Ptr (Node);
Node.Parent := Last_Sequence;
Append (Last_Sequence.List, Item_Ptr (Node));
end;
else
raise Format_Error;
end if;
end On_Element;
begin
Text_Streams.File.Open (Stream, Name);
R.Initialize (Parser);
while R.More_Pieces (Parser) loop
case R.Piece_Kind (Parser) is
when Start_Element =>
On_Element;
when End_Element =>
if R.Name (Parser) = "seq" then
Last_Seq := Last_Seq - 1;
elsif R.Name (Parser) = "opt" or R.Name (Parser) = "list" then
Last_Item := Last_Item - 1;
end if;
when others =>
null;
end case;
R.Next (Parser);
end loop;
end Read_File;
function Rule_Count return Natural is
begin
return Natural (Rule_Lists.Length (Gramar.List));
end Rule_Count;
function Get_Rule (Index : Positive) return Rule is
use Rule_Lists;
Result : Rule := First (Gramar.List);
begin
for J in 2 .. Index loop
Result := Next (Gramar.List, Result);
end loop;
return Result;
end Get_Rule;
function Pass_Through (Item : Sequence) return Boolean is
begin
return Code.Pass_Throgh (Rule_Name (Item), Item);
end Pass_Through;
function Infix (Item : Sequence) return String is
begin
return Code.Infix (Rule_Name (Item), Item);
end Infix;
function True_Node (Item : Sequence) return String is
begin
return Nodes.Get_Node_Type_Name
(Code.True_Node (Rule_Name (Item), Item));
end True_Node;
function False_Node (Item : Sequence) return String is
begin
return Nodes.Get_Node_Type_Name
(Code.False_Node (Rule_Name (Item), Item));
end False_Node;
function Node_Name (Item : Sequence) return String is
R_Name : constant String := Rule_Name (Item);
C_Name : constant String := Code.Node_Name (R_Name, Item);
begin
if Item = null then
return "";
elsif C_Name /= "" then
return Nodes.Get_Node_Type_Name (C_Name);
elsif Pass_Through (Item) then
declare
I : constant Natural := Find_First_Reference (Item);
begin
if I /= 0 then
return Node_Name (Get_Item (Item, I).all);
else
return "";
end if;
end;
-- elsif Is_Item_And_List (Item) then
-- declare
-- List_Index : constant Natural := Find_First_List (Item);
-- begin
-- return Node_Name (Get_Item (Item, List_Index));
-- end;
else
declare
Wrap_Name : constant String :=
Code.User_Wrap_Node (R_Name, Item, 1);
begin
if Wrap_Name /= "" then
return Nodes.Get_Node_Type_Name (Wrap_Name);
else
return Nodes.Get_Node_Type_Name (R_Name);
end if;
end;
end if;
end Node_Name;
function Alternative_Node_Name (Item : Option) return String is
I_Name : constant String := Item_Name (Item);
R_Name : constant String := Rule_Name (Item.Parent);
begin
return Code.Alternative_Node_Name(R_Name, Item.Parent, I_Name);
end Alternative_Node_Name;
function Trait_Name (Object : Item) return String is
I_Name : constant String := Item_Name (Item'Class (Object));
R_Name : constant String := Rule_Name (Object.Parent);
Trait : constant String := Get_Trait_Kind (I_Name);
C_Trt : constant String := Code.Trait_Name(R_Name, Object.Parent, I_Name);
begin
if C_Trt /= "" then
return Get_Trait_Kind (C_Trt);
else
return Trait;
end if;
end Trait_Name;
function Item_Name (Object : Reference) return String is
begin
return Name (Object);
end Item_Name;
function Item_Name (Object : Option) return String is
begin
if Count (Object) > 1 then
return Compound_Name (Items (Object)) & "option"
& To_String (Count (Object));
elsif Separate_Option (Object) then
declare
Name : constant String :=
Compound_Name (Items (Object)) & "option";
begin
if Code.Conflict_Name (Name) then
return Compound_Name (Items (Object), True) & "option";
else
return Name;
end if;
end;
else
return Item_Name (Get_Item (Items (Object), 1).all);
end if;
end Item_Name;
function Item_Name (Object : List) return String is
begin
return Compound_Name (Items (Object)) & "list";
end Item_Name;
function Item_Name (Object : Keyword) return String is
begin
return Text (Object);
end Item_Name;
function Item_Name (Object : Delimiter) return String is
begin
return Tokens.Delimiter_Name (Text (Object));
end Item_Name;
function Separate_Option (Item : in Option) return Boolean is
Seq : constant Sequence := Items (Item);
Child : Gramar_Items.Item'Class renames Get_Item (Seq, 1).all;
begin
if Count (Item) > 1 then
return False;
end if;
if Count (Seq) = 1 and then
(Child in Reference or
Child in Keyword or
Child in Delimiter) then
return False;
else
return True;
end if;
end Separate_Option;
function Inline_Option (Item : Option) return Boolean is
begin
return Code.Inline_Option (Item_Name (Item), Items (Item));
end Inline_Option;
function Compound_Name
(Item : Sequence;
Conflict : Boolean := False)
return String
is
Length : constant Positive := Count (Item);
begin
if Conflict then
return Compound_Name (Item, Part => 1) &
Compound_Name (Item, Part => 2) &
Compound_Name (Item, Part => Length);
elsif Length > 1 then
return Compound_Name (Item, Part => 1) &
Compound_Name (Item, Part => 2);
else
return Compound_Name (Item, Part => 1);
end if;
end Compound_Name;
function Compound_Name (Item : Sequence; Part : Positive ) return String is
Child : Gramar_Items.Item'Class renames Get_Item (Item, Part).all;
begin
if Child in Option then
return Compound_Name (Items (Option (Child)));
elsif Child in List then
return Compound_Name (Items (List (Child)));
elsif Child in Keyword then
return Text (Keyword (Child)) & "_";
elsif Child in Reference then
return Name (Reference (Child)) & "_";
elsif Child in Delimiter then
return Tokens.Delimiter_Name (Text (Delimiter (Child))) & "_";
else
return "";
end if;
end Compound_Name;
function Node_Name (Item : Rule) return String is
Result : constant String := Node_Name (Get_Alternative (Item, 1));
begin
if Result = "" then
return "";
end if;
for I in 2 .. Count (Item) loop
if Result /= Node_Name (Get_Alternative (Item, I)) then
return "";
end if;
end loop;
return Result;
end Node_Name;
function Node_Name (Object : Item) return String is
begin
return "";
end Node_Name;
function Node_Name (Object : Option) return String is
begin
return Node_Name (Items (Object));
end Node_Name;
function Node_Name (Object : List) return String is
begin
return Node_Name (Object.Items);
end Node_Name;
function Node_Name (Object : Reference) return String is
begin
if Is_Token (Object) then
return Nodes.Capitalise (Item_Name (Object) & "_Node");
end if;
return Node_Name (Get_Rule (Item_Name (Object)));
exception
when Not_Found =>
return "";
end Node_Name;
function Get_Rule (Name : String) return Rule is
use Rule_Lists;
Found : aliased Rule;
begin
while Iterate (Gramar.List, Found'Access) loop
if Found.Name = Name then
return Found;
end if;
end loop;
raise Not_Found;
end Get_Rule;
function Find_First_Reference (Item : Sequence) return Natural is
begin
for I in 1 .. Count (Item) loop
declare
Child : Gramar_Items.Item'Class renames Get_Item (Item, I).all;
begin
if Child in Reference then
return I;
end if;
end;
end loop;
return 0;
end Find_First_Reference;
function Choise_Item_Index (Item : Sequence) return Natural is
begin
for I in 1 .. Count (Item) loop
if Choise (Get_Item (Item, I).all) /= "" then
return I;
end if;
end loop;
return 0;
end Choise_Item_Index;
function Find_First_List (Item : Sequence) return Natural is
begin
for I in 1 .. Count (Item) loop
declare
Child : Gramar_Items.Item'Class renames Get_Item (Item, I).all;
begin
if Child in List then
return I;
end if;
end;
end loop;
return 0;
end Find_First_List;
function User_Attr (Object : Item) return String is
I_Name : constant String := Item_Name (Item'Class (Object));
R_Name : constant String := Rule_Name (Object.Parent);
begin
return Code.Get_Use_Attr
(R_Name, Object.Parent, I_Name, Object.Instance);
end User_Attr;
function Create_Node (Object : Item) return String is
I_Name : constant String := Item_Name (Item'Class (Object));
R_Name : constant String := Rule_Name (Object.Parent);
begin
return Nodes.Get_Node_Type_Name
(Code.Created_Node_Name (R_Name, Object.Parent, I_Name));
end Create_Node;
function Choise (Object : Item) return String is
I_Name : constant String := Item_Name (Item'Class (Object));
R_Name : constant String := Rule_Name (Object.Parent);
begin
return Code.Choise (R_Name, Object.Parent, I_Name);
end Choise;
function Value (Object : Item) return String is
I_Name : constant String := Item_Name (Item'Class (Object));
R_Name : constant String := Rule_Name (Object.Parent);
begin
return Code.Value (R_Name, Object.Parent, I_Name);
end Value;
function Rule_Name (Seq : Sequence) return String is
begin
if Seq.Parent /= null then
return Name (Seq.Parent);
elsif Seq.Parent_Item.all in Option and then
Inline_Option (Option (Seq.Parent_Item.all))
then
return Rule_Name (Seq.Parent_Item.Parent);
else
return Item_Name (Seq.Parent_Item.all);
end if;
end Rule_Name;
function Is_Item_And_List (Seq : Sequence) return Boolean is
begin
for I in 1 .. Count (Seq) loop
declare
The_List : Gramar_Items.Item'Class renames Get_Item (Seq, I).all;
begin
if The_List in List then
if List_Item_Node_Name (List (The_List)) /= "" then
for J in 1 .. Count (Seq) loop
declare
The_Ref : Gramar_Items.Item'Class renames
Get_Item (Seq, J).all;
begin
if The_Ref in Reference and then
Node_Name (The_Ref) =
List_Item_Node_Name (List (The_List)) then
Seq.List_Index := I;
Seq.Item_Index := J;
return True;
end if;
end;
end loop;
end if;
end if;
end;
end loop;
return False;
end Is_Item_And_List;
function List_Item_Node_Name (Object : List) return String is
Seq : constant Sequence := Items (Object);
Ref_Index : constant Natural := Find_First_Reference (Seq);
begin
if Ref_Index > 0 then
return Node_Name (Get_Item (Seq, Ref_Index).all);
else
return "";
end if;
end List_Item_Node_Name;
function Item_Of_List_Index (Seq : Sequence) return Natural is
begin
return Seq.Item_Index;
end Item_Of_List_Index;
function List_For_Item_Index (Seq : Sequence) return Natural is
begin
return Seq.List_Index;
end List_For_Item_Index;
function Node_Name (Object : Wrapper) return String is
begin
return To_String (Object.Node_Name);
end Node_Name;
function Parent (Object : Wrapper) return Wrapper is
begin
return Get_Wrapper (Object.Seq, Object.Parent);
end Parent;
function Item_Index (Object : Wrapper) return Natural is
begin
return Object.Item_Index;
end Item_Index;
function Object_Name (Object : Wrapper) return String is
begin
return To_String (Object.Object_Name);
end Object_Name;
function User_Attr_Name (Object : Wrapper) return String is
begin
return To_String (Object.Attr_Name);
end User_Attr_Name;
function Position (Object : Wrapper) return String is
begin
return To_String (Object.Position);
end Position;
function Wrap_Count (Item : Sequence) return Natural is
R_Name : constant String := Rule_Name (Item);
User_Wraps : constant Natural := Code.User_Wraps (R_Name, Item);
begin
if User_Wraps > 0 then
return User_Wraps;
else
if Pass_Through (Item) then
return 0;
elsif Is_Item_And_List (Item) and then Node_Name (Item) /= "" then
return 2;
else
return 1;
end if;
end if;
end Wrap_Count;
function Get_Wrapper
(Seq : Sequence;
Index : Positive) return Wrapper
is
function U (Text : String) return Unbounded_String
renames To_Unbounded_String;
R_Name : constant String := Rule_Name (Seq);
User_Wraps : constant Natural := Code.User_Wraps (R_Name, Seq);
begin
if User_Wraps > 0 then
declare
Node : constant String := Code.User_Wrap_Node (R_Name, Seq, Index);
Name : constant String := Nodes.Get_Node_Type_Name (Node);
Item : constant String := Code.Wrap_Item_Name (R_Name, Seq, Index);
Attr : constant String := Code.Wrap_Attr_Name (R_Name, Seq, Index);
Pos : constant String := Code.Wrapper_Position (R_Name, Seq, Index);
Inst : constant Positive := Code.Wrapper_Instance (R_Name, Seq, Index);
Ind : constant Natural := Find_Item (Seq, Item, Inst);
begin
return (Node_Name => U (Name),
Object_Name => U ("Wrap" & To_String (Index)),
Parent => Code.Wrapper_Index (R_Name, Seq, Index),
Attr_Name => U (Attr),
Position => U (Pos),
Item_Index => Ind,
Seq => Seq,
Index => Index);
end;
else
if Is_Item_And_List (Seq) then
declare
List_Index : constant Natural := List_For_Item_Index (Seq);
The_List : Item'Class renames Get_Item (Seq, List_Index).all;
List_Name : constant String := Node_Name (The_List);
Wrap : constant String := Node_Name (Seq);
begin
if Index = 1 then
if Wrap = "" then
return (Node_Name => U (List_Name),
Object_Name => U ("New_Node"),
Attr_Name => Null_Unbounded_String,
Position => Null_Unbounded_String,
Parent => 0,
Item_Index => List_Index,
Seq => Seq,
Index => 0);
else
return (Node_Name => U (Wrap),
Object_Name => U ("Wrap"),
Attr_Name => Null_Unbounded_String,
Position => Null_Unbounded_String,
Parent => 0,
Item_Index => 0,
Seq => Seq,
Index => 0);
end if;
else
return (Node_Name => U (List_Name),
Object_Name => U ("New_Node"),
Attr_Name => Null_Unbounded_String,
Position => Null_Unbounded_String,
Parent => 1,
Item_Index => List_Index,
Seq => Seq,
Index => 0);
end if;
end;
else
return (Node_Name => U (Node_Name (Seq)),
Object_Name => U ("New_Node"),
Attr_Name => Null_Unbounded_String,
Position => Null_Unbounded_String,
Parent => 0,
Item_Index => 0,
Seq => Seq,
Index => 0);
end if;
end if;
end Get_Wrapper;
function Parent (Object : Item) return Wrapper is
I_Name : constant String := Item_Name (Item'Class (Object));
R_Name : constant String := Rule_Name (Object.Parent);
Wrap_I : Natural :=
Code.Wrapper_Index (R_Name, Object.Parent, I_Name, Object.Instance);
begin
if Wrap_I = 0 then
Wrap_I := 1;
end if;
return Get_Wrapper (Object.Parent, Wrap_I);
end Parent;
function To_String (X : Natural) return String is
Image : constant String := Natural'Image (X);
begin
return Image (2 .. Image'Last);
end To_String;
function Find_Item
(Seq : Sequence;
Name : String;
Inst : Positive) return Natural
is
Cnt : Positive := Inst;
begin
if Name = "" then
return 0;
end if;
for I in 1 .. Count (Seq) loop
if Item_Name (Get_Item (Seq, I).all) = Name then
if Cnt = 1 then
return I;
else
Cnt := Cnt - 1;
end if;
end if;
end loop;
return 0;
end Find_Item;
function Top (Object : Wrapper) return Boolean is
begin
return Object.Parent = 0;
end Top;
function Get_Trait_Kind (Name : String) return String is
use Asis_Trait_Kinds;
use Ada.Characters.Handling;
Upper_Name1 : constant String := "A_" & To_Upper (Name) & "_TRAIT";
Upper_Name2 : constant String := "AN_" & To_Upper (Name) & "_TRAIT";
begin
for I in Trait_Kinds loop
declare
Image : constant String := Trait_Kinds'Image (I);
Upper : constant String := To_Upper (Image);
begin
if Upper = Upper_Name1 or Upper = Upper_Name2 then
return Nodes.Capitalise (Image);
end if;
end;
end loop;
return "";
end Get_Trait_Kind;
end Gramar_Items;
------------------------------------------------------------------------------
-- Copyright (c) 2006, <NAME>
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
--
-- * Redistributions of source code must retain the above copyright notice,
-- this list of conditions and the following disclaimer.
-- * Redistributions in binary form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in the
-- documentation and/or other materials provided with the distribution.
-- * Neither the name of the Maxim Reznik, IE nor the names of its
-- contributors may be used to endorse or promote products derived from
-- this software without specific prior written permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-- POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------
|
savefile/maps/098A_Underground.asm | stranck/fools2018-1 | 35 | 167688 | <filename>savefile/maps/098A_Underground.asm<gh_stars>10-100
SECTION "Map_098A", ROM0[$B800]
Map_098A_Header:
hdr_tileset 17
hdr_dimensions 5, 10
hdr_pointers_a Map_098A_Blocks, Map_098A_TextPointers
hdr_pointers_b Map_098A_Script, Map_098A_Objects
hdr_pointers_c Map_098A_InitScript, Map_098A_RAMScript
hdr_palette $06
hdr_music $ff, $02
hdr_connection NORTH, $0000, 0, 0
hdr_connection SOUTH, $0000, 0, 0
hdr_connection WEST, $0000, 0, 0
hdr_connection EAST, $0000, 0, 0
Map_098A_Objects:
hdr_border $19
hdr_warp_count 2
hdr_warp 5, 19, 3, 10, $0932
hdr_warp 4, 19, 3, 10, $0932
hdr_sign_count 0
hdr_object_count 1
hdr_object SPRITE_GIOVANNI, 5, 15, STAY, DOWN, $01
Map_098A_RAMScript:
rs_write_term $c77a
db $1a,$1a,$52,$18,$18,$ff
rs_write_term $c785
db $1a,$1a,$52,$18,$18,$ff
rs_end
Map_098A_Blocks:
db $2c,$1d,$1d,$1d,$2b
db $1a,$2c,$1d,$2b,$18
db $1a,$1a,$01,$18,$18
db $1a,$1a,$01,$18,$18
db $1a,$1a,$01,$18,$18
db $1a,$1a,$01,$18,$18
db $1a,$1a,$01,$18,$18
db $1a,$1a,$01,$18,$18
db $1a,$1a,$01,$18,$18
db $1a,$1a,$24,$18,$18
Map_098A_TextPointers:
dw Map_098A_TX1
Map_098A_InitScript:
ret
Map_098A_Script:
ret
Map_098A_TX1:
TX_ASM
ld hl, Map_098A_HelixText
call PrintTextEnhanced
ld c, EVENT_OBTAINED_HELIX
call TestEventFlag
jp c, TextScriptEnd
ld a, SFX_GET_ITEM_1
call PlaySound
call WaitForSoundToFinish
ld bc, $2a01
call GiveItem
ld bc, $C5A5
ld de, $2904
call CompleteEvent
jp TextScriptEnd
Map_098A_HelixText:
text "All hail the Helix."
done
|
projects/batfish/src/main/antlr4/org/batfish/grammar/cumulus_interfaces/CumulusInterfaces_common.g4 | zabrewer/batfish | 16 | 3548 | <filename>projects/batfish/src/main/antlr4/org/batfish/grammar/cumulus_interfaces/CumulusInterfaces_common.g4
parser grammar CumulusInterfaces_common;
options {
tokenVocab = CumulusInterfacesLexer;
}
interface_name
:
WORD
;
number
:
NUMBER
;
number_or_range
:
lo = number (DASH hi = number)?
;
prefix
:
IP_PREFIX
;
prefix6
:
IPV6_PREFIX
;
vlan_id
:
v = NUMBER
{isVlanId($v)}?
;
vrf_name
:
WORD
;
vrf_table_name
:
WORD
;
null_rest_of_line
:
~NEWLINE* NEWLINE
; |
install/lib/bios/datavers.asm | minblock/msdos | 0 | 176101 | ; ========================================================
COMMENT #
DATAVERS.ASM
Copyright (c) 1991 - Microsoft Corp.
All rights reserved.
Microsoft Confidential
johnhe - 03/03/89
END COMMENT #
;========================================================
include BIOS_IO.INC
include MODEL.INC
.CODE
; ========================================================
;
; Returns the DOS Data version from DOSDATA:04h
;
; int GetDosDataVersion( void );
;
; ========================================================
GetDosDataVersion PROC USES ES
mov AH,34h ; DOS get critical flag address
int 21h
mov BX,4 ; Put address of DATA version in BX
mov AL,ES:[BX] ; Get DATA version byte
cbw ; Convert AL to an integer
ret
GetDosDataVersion ENDP
; ========================================================
END
; ========================================================
|
_build/dispatcher/jmp_ippsGFpECMulPoint_418a8609.asm | zyktrcn/ippcp | 1 | 170283 | extern m7_ippsGFpECMulPoint:function
extern n8_ippsGFpECMulPoint:function
extern y8_ippsGFpECMulPoint:function
extern e9_ippsGFpECMulPoint:function
extern l9_ippsGFpECMulPoint:function
extern n0_ippsGFpECMulPoint:function
extern k0_ippsGFpECMulPoint:function
extern ippcpJumpIndexForMergedLibs
extern ippcpSafeInit:function
segment .data
align 8
dq .Lin_ippsGFpECMulPoint
.Larraddr_ippsGFpECMulPoint:
dq m7_ippsGFpECMulPoint
dq n8_ippsGFpECMulPoint
dq y8_ippsGFpECMulPoint
dq e9_ippsGFpECMulPoint
dq l9_ippsGFpECMulPoint
dq n0_ippsGFpECMulPoint
dq k0_ippsGFpECMulPoint
segment .text
global ippsGFpECMulPoint:function (ippsGFpECMulPoint.LEndippsGFpECMulPoint - ippsGFpECMulPoint)
.Lin_ippsGFpECMulPoint:
db 0xf3, 0x0f, 0x1e, 0xfa
call ippcpSafeInit wrt ..plt
align 16
ippsGFpECMulPoint:
db 0xf3, 0x0f, 0x1e, 0xfa
mov rax, qword [rel ippcpJumpIndexForMergedLibs wrt ..gotpc]
movsxd rax, dword [rax]
lea r11, [rel .Larraddr_ippsGFpECMulPoint]
mov r11, qword [r11+rax*8]
jmp r11
.LEndippsGFpECMulPoint:
|
.emacs.d/elpa/ada-mode-5.3.1/gps_source/case_handling.ads | caqg/linux-home | 0 | 12331 | <filename>.emacs.d/elpa/ada-mode-5.3.1/gps_source/case_handling.ads
------------------------------------------------------------------------------
-- G P S --
-- --
-- Copyright (C) 2004-2016, AdaCore --
-- --
-- This is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public --
-- License for more details. You should have received a copy of the GNU --
-- General Public License distributed with this software; see file --
-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
-- of the license. --
------------------------------------------------------------------------------
-- Case support for case insensitive languages. This package has
-- services to change the casing of a word (identifier or keyword) and
-- to handle a set of casing exceptions.
with Basic_Types; use Basic_Types;
with Ada.Containers.Indefinite_Hashed_Maps;
with Ada.Strings.Wide_Wide_Hash;
package Case_Handling is
type Casing_Policy is (Disabled, End_Of_Line, End_Of_Word, On_The_Fly);
for Casing_Policy'Size use Integer'Size;
pragma Convention (C, Casing_Policy);
-- The list of supported casing policies.
-- - Disable means that no auto-casing will be applied to the buffer
-- - End_Of_Line casing done when pressing return
-- - On_The_Fly casing is done when inserting a word separator
type Casing_Type is (Unchanged, Upper, Lower, Mixed, Smart_Mixed);
for Casing_Type'Size use Integer'Size;
pragma Convention (C, Casing_Type);
-- Casing used for identifiers and reserved words.
-- Only relevant for case insensitive languages.
-- - Mixed: Set first character of each word and characters after an
-- underscore to upper-case, all other characters are set to lower-case.
-- - Smart_Mixed: As Mixed but never force an upper-case to lower-case.
function Mixed_Case
(S : UTF8_String; Smart : Boolean := False) return UTF8_String;
-- Return S with a casing matching Ada style: upper case after an
-- underscore or a dot.
-- If smart is set, do not change upper-case letters in S
---------------------
-- Case Exceptions --
---------------------
type Casing_Exceptions is private;
-- This is the case exceptions handler, a set of exceptions to the
-- standard casing rule can be recorded into this object.
No_Casing_Exception : aliased constant Casing_Exceptions;
function Set_Case
(C : Casing_Exceptions;
Word : UTF8_String;
Casing : Casing_Type) return UTF8_String;
-- Change the case of Str as specified by Casing. This routine also
-- checks for case exceptions.
procedure Add_Exception
(C : in out Casing_Exceptions;
Word : String;
Read_Only : Boolean);
-- Add a case exception into the container. Read_Only must be set for
-- case exception that can't be removed interactively.
procedure Add_Substring_Exception
(C : in out Casing_Exceptions;
Substring : String;
Read_Only : Boolean);
-- Add a substring case exception into the container. Read_Only must be set
-- for case exception that can't be removed interactively.
procedure Remove_Exception (C : in out Casing_Exceptions; Word : String);
-- Remove a case exception from the container
procedure Remove_Substring_Exception
(C : in out Casing_Exceptions;
Substring : String);
-- Remove a substring case exception from the container
procedure Destroy (C : in out Casing_Exceptions);
-- Destroy the case exceptions handler, release all memory associated
-- with this object.
private
type W_Node (Size : Natural) is record
Read_Only : Boolean;
-- Set to True if this case exception is read only (can't be removed).
-- Such case exception comes from a global .xml files.
Word : Wide_Wide_String (1 .. Size);
end record;
package Casing_Exception_Table is new Ada.Containers.Indefinite_Hashed_Maps
(Key_Type => Wide_Wide_String,
Element_Type => W_Node,
Hash => Ada.Strings.Wide_Wide_Hash,
Equivalent_Keys => "=");
use Casing_Exception_Table;
type Exceptions_Table is access Map;
-- Exception Word handler, each exception is inserted into this hash
-- table. The key is the word in lower-case, the associated
-- value is the word with the right casing.
type Casing_Exceptions is record
E : Exceptions_Table := new Map;
S : Exceptions_Table := new Map;
end record;
No_Casing_Exception : aliased constant Casing_Exceptions :=
(E => null, S => null);
end Case_Handling;
|
Transynther/x86/_processed/NONE/_st_/i7-8650U_0xd2.log_7_170.asm | ljhsiun2/medusa | 9 | 21947 | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r15
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0x151d6, %r15
nop
nop
nop
xor $62450, %rdx
movl $0x61626364, (%r15)
nop
nop
nop
nop
nop
sub $47187, %rcx
lea addresses_UC_ht+0x1234, %rsi
lea addresses_WC_ht+0x1828f, %rdi
nop
nop
nop
xor $11397, %rbx
mov $80, %rcx
rep movsl
xor %r13, %r13
lea addresses_D_ht+0x1efc1, %r15
nop
nop
nop
nop
nop
and $45436, %rsi
movups (%r15), %xmm1
vpextrq $1, %xmm1, %rdx
nop
nop
nop
nop
sub %rbx, %rbx
lea addresses_A_ht+0x1218f, %rsi
lea addresses_D_ht+0xbc0f, %rdi
and %rbx, %rbx
mov $66, %rcx
rep movsq
nop
nop
nop
nop
nop
and $34324, %r15
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r15
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r14
push %r9
push %rbp
push %rbx
push %rcx
push %rdi
// Store
mov $0x18f, %rdi
nop
nop
nop
nop
nop
xor $30886, %r12
mov $0x5152535455565758, %r9
movq %r9, %xmm5
vmovups %ymm5, (%rdi)
nop
nop
nop
nop
nop
add $13151, %r14
// Store
lea addresses_RW+0x1398f, %rcx
nop
add %rbx, %rbx
movw $0x5152, (%rcx)
nop
add $23758, %rcx
// Store
lea addresses_A+0xa03f, %rcx
nop
nop
nop
nop
nop
add %rbp, %rbp
mov $0x5152535455565758, %r9
movq %r9, %xmm4
movups %xmm4, (%rcx)
nop
nop
nop
nop
nop
dec %rcx
// Faulty Load
lea addresses_A+0x198f, %rcx
nop
xor $31628, %rbp
movb (%rcx), %bl
lea oracles, %r12
and $0xff, %rbx
shlq $12, %rbx
mov (%r12,%rbx,1), %rbx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r9
pop %r14
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_P', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 11, 'same': True}, 'dst': {'type': 'addresses_D_ht', 'congruent': 7, 'same': True}}
{'52': 7}
52 52 52 52 52 52 52
*/
|
18_Key_States/main.asm | DebugBSD/SDLExamples | 3 | 173419 | <reponame>DebugBSD/SDLExamples
; ML64 template file
; Compile: uasm64.exe -nologo -win64 -Zd -Zi -c testUasm.asm
; Link: link /nologo /debug /subsystem:console /entry:main testUasm.obj user32.lib kernel32.lib
OPTION WIN64:8
; Include libraries
includelib SDL2.lib
includelib SDL2main.lib
includelib SDL2_image.lib
includelib SDL2_ttf.lib
; Include files
include main.inc
include SDL.inc
include SDL_image.inc
include SDL_ttf.inc
; include Code files
include LTexture.asm
include LButton.asm
Init proto
Shutdown proto
LoadMedia proto
LoadTexture proto :QWORD
.const
SCREEN_WIDTH = 640
SCREEN_HEIGHT = 480
; Values to rotate the sprite
WINDOW_TITLE BYTE "SDL Tutorial",0
FILE_ATTRS BYTE "rb"
IMAGE_PRESS BYTE "Res/press.png",0
IMAGE_UP BYTE "Res/up.png",0
IMAGE_DOWN BYTE "Res/down.png",0
IMAGE_LEFT BYTE "Res/left.png",0
IMAGE_RIGHT BYTE "Res/right.png",0
.data
quit BYTE 0
.data?
pWindow QWORD ?
eventHandler SDL_Event <>
gRenderer QWORD ?
currentTexture QWORD ?
gPressTexture LTexture <>
gUpTexture LTexture <>
gDownTexture LTexture <>
gRightTexture LTexture <>
gLeftTexture LTexture <>
.code
main proc
local i:dword
local poll:qword
; Alloc our memory for our objects, starts SDL, ...
invoke Init
.if rax==0
invoke ExitProcess, EXIT_FAILURE
.endif
invoke LoadMedia
; Gameloop
.while quit!=1
invoke SDL_PollEvent, addr eventHandler
.while rax!=0
.if eventHandler.type_ == SDL_EVENTQUIT
mov quit, 1
.endif
invoke SDL_PollEvent, addr eventHandler
.endw
; Set texture based on current keystate
invoke SDL_GetKeyboardState,0
.if BYTE PTR [rax + SDL_SCANCODE_UP]
mov rax, offset gUpTexture
mov currentTexture, rax
.elseif BYTE PTR [rax+ SDL_SCANCODE_DOWN]
mov rax, offset gDownTexture
mov currentTexture, rax
.elseif BYTE PTR [rax + SDL_SCANCODE_LEFT]
mov rax, offset gLeftTexture
mov currentTexture, rax
.elseif BYTE PTR [rax + SDL_SCANCODE_RIGHT]
mov rax, offset gRightTexture
mov currentTexture, rax
.else
mov rax, offset gPressTexture
mov currentTexture, rax
.endif
; Clear screen
invoke SDL_SetRenderDrawColor, gRenderer, 0FFh, 0FFh, 0FFh, 0FFh
invoke SDL_RenderClear, gRenderer
; Render texture
invoke renderTexture, gRenderer, currentTexture, 0, 0, 0, 0, 0, 0
; Update the window
invoke SDL_RenderPresent,gRenderer
.endw
invoke SDL_DestroyWindow, pWindow
; Clean our allocated memory, shutdown SDL, ...
invoke Shutdown
invoke ExitProcess, EXIT_SUCCESS
ret
main endp
Init proc
finit ; Starts the FPU
invoke SDL_Init, SDL_INIT_VIDEO
.if rax<0
xor rax, rax
jmp EXIT
.endif
invoke SDL_CreateWindow,
addr WINDOW_TITLE,
SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED,
SCREEN_WIDTH,
SCREEN_HEIGHT,
SDL_WINDOW_SHOWN
.if rax==0
jmp EXIT
.endif
mov pWindow, rax
; Create the renderer
invoke SDL_CreateRenderer, rax, -1, SDL_RENDERER_ACCELERATED OR SDL_RENDERER_PRESENTVSYNC
.if rax==0
jmp EXIT
.endif
mov gRenderer, rax
; Initialize renderer color
invoke SDL_SetRenderDrawColor, gRenderer, 0FFh, 0FFH, 0FFH, 0FFH
invoke IMG_Init, IMG_INIT_PNG
and rax, IMG_INIT_PNG
.if rax!=IMG_INIT_PNG
xor rax, rax
jmp EXIT
.endif
invoke TTF_Init
.if rax==-1
xor rax, rax
jmp EXIT
.endif
mov rax, 1
EXIT:
ret
Init endp
Shutdown proc
invoke freeTexture, addr gLeftTexture
invoke freeTexture, addr gRightTexture
invoke freeTexture, addr gDownTexture
invoke freeTexture, addr gUpTexture
invoke freeTexture, addr gPressTexture
invoke SDL_DestroyRenderer, gRenderer
invoke SDL_DestroyWindow, pWindow
invoke TTF_Quit
invoke IMG_Quit
invoke SDL_Quit
ret
Shutdown endp
LoadMedia PROC
LOCAL success:BYTE
mov success, 1
invoke loadTextureFromFile, gRenderer, addr gPressTexture, addr IMAGE_PRESS
.if eax==0
jmp EXIT
.endif
invoke loadTextureFromFile, gRenderer, addr gUpTexture, addr IMAGE_UP
.if eax==0
jmp EXIT
.endif
invoke loadTextureFromFile, gRenderer, addr gDownTexture, addr IMAGE_DOWN
.if eax==0
jmp EXIT
.endif
invoke loadTextureFromFile, gRenderer, addr gLeftTexture, addr IMAGE_LEFT
.if eax==0
jmp EXIT
.endif
invoke loadTextureFromFile, gRenderer, addr gRightTexture, addr IMAGE_RIGHT
.if eax==0
jmp EXIT
.endif
EXIT:
ret
LoadMedia endp
LoadTexture PROC pFile:QWORD
LOCAL loadedSurface:QWORD
LOCAL newTexture:QWORD
invoke IMG_Load, pFile
.if rax==0
jmp ERROR
.endif
mov loadedSurface, rax
invoke SDL_CreateTextureFromSurface, gRenderer, rax
.if rax==0
jmp ERROR
.endif
mov newTexture, rax
invoke SDL_FreeSurface, loadedSurface
mov rax, newTexture
ERROR:
ret
LoadTexture endp
END
; vim options: ts=2 sw=2
|
libsrc/target/tvc/tvc_kbd_status.asm | Frodevan/z88dk | 640 | 163738 | ;
; Videoton TV Computer C stub
; <NAME> - 2019
;
; Editor get character
;
SECTION code_clib
PUBLIC tvc_kbd_status
INCLUDE "target/tvc/def/tvc.def"
;
; Entry: no entry
; Return L: FF-available char, 00-no char available
.tvc_kbd_status
._tvc_kbd_status
rst $30
defb KBD_STATUS
ld l,c
ld h,0
ret
|
libsrc/target/pc88/graphics/w_pointxy.asm | ahjelm/z88dk | 640 | 82792 | <filename>libsrc/target/pc88/graphics/w_pointxy.asm
; Point pixel at (x,y)
SECTION code_driver
PUBLIC w_pointxy
defc NEEDpoint = 1
EXTERN __pc88_gfxmode
w_pointxy:
ld a,(__pc88_gfxmode)
and a
jp z,hires
INCLUDE "target/pc88/graphics/pixel_SEMI.inc"
ret
hires:
INCLUDE "target/pc88/graphics/pixel_HIRES.inc"
ret
|
impl/src/test/resources/patterns/DestCodes.asm | jeslie/hack-assembler | 1 | 89634 | // mnemonic // 111 0 000000 dst 000
D&A // 000
M=D&A // 001
D=D&A // 010
MD=D&A // 011
A=D&A // 100
AM=D&A // 101
AD=D&A // 110
AMD=D&A // 111
|
libsrc/lib3d/f2i.asm | jpoikela/z88dk | 640 | 12833 | ;
; Fixed Point functions
;
; int f2i (long v)
; fixed point to integer
;
; ------
; $Id: f2i.asm,v 1.3 2016-06-28 19:31:42 dom Exp $
;
SECTION code_clib
PUBLIC f2i
PUBLIC _f2i
.f2i
._f2i
pop bc ; RET addr.
pop hl
pop de
push de
push hl
push bc
;; DEHL holds value
;rr d
;rr e
;rr h
;rr l
;rr d
;rr e
;rr h
;rr l
ld d,l
ld l,h
ld h,e
rl d
rl l
rl h
rl d
rl l
rl h
ret
|
helloWorld.asm | hotchner/AsmStudy | 0 | 1785 | SECTION .data
msg: db "HelloWorld!", 0x0a
len: equ $-msg
SECTION .text
global _main
_main:
mov rax, 0x2000004
mov rdi, 1
mov rsi, msg
mov rdx, len
syscall
mov rax, 0x20000001
mov rdi, 0
syscall
; nasm -f macho64 helloWorld.asm -o helloWorld.o
; ld -macosx_version_min 10.7.0 -o helloWorld -e _main helloWorld.o |
projects/batfish/src/main/antlr4/org/batfish/grammar/flatjuniper/FlatJuniper_fabric.g4 | jeffkala/batfish | 0 | 4048 | parser grammar FlatJuniper_fabric;
import FlatJuniper_common;
options {
tokenVocab = FlatJuniperLexer;
}
fab_aliases
:
ALIASES
(
faba_interconnect_device
| faba_node_device
)
;
fab_resources
:
RESOURCES
(
fabr_node_group
)
;
faba_interconnect_device
:
INTERCONNECT_DEVICE name1 = junos_name name2 = junos_name
;
faba_node_device
:
NODE_DEVICE name1 = junos_name name2 = junos_name
;
fabr_node_group
:
NODE_GROUP group = junos_name
(
fabrn_network_domain
| fabrn_node_device
)
;
fabrn_network_domain
:
NETWORK_DOMAIN
;
fabrn_node_device
:
NODE_DEVICE node = junos_name
;
s_fabric
:
FABRIC
(
fab_aliases
| fab_resources
)
;
|
rp2040_elf2uf2/src/rp2040_elf2uf2.adb | NicoPy/Ada_RP2040_ELF2UF2 | 0 | 2932 | <filename>rp2040_elf2uf2/src/rp2040_elf2uf2.adb
--
-- Copyright 2022 (C) <NAME> (aka DrPi)
--
-- SPDX-License-Identifier: BSD-3-Clause
--
--
-- Converts an ELF file to a UF2 formated file.
--
-- UF2 files are accepted by RP2040 micro_controllers
-- in BOOTSEL mode for FLASH programming.
--
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Command_Line; use Ada.Command_Line;
with Ada.Streams.Stream_IO;
with elf2uf2;
with Errors;
procedure Rp2040_Elf2uf2 is
package SIO renames Ada.Streams.Stream_IO;
function usage return Exit_Status is
begin
Put_Line ("Usage: elf2uf2 (-v) <input ELF file> <output UF2 file>");
return Errors.ARGS;
end usage;
Arg : Natural := 0;
begin
if (Argument_Count < 2) or (Argument_Count > 3) then
Set_Exit_Status (Usage);
return;
end if;
if Argument_Count = 3 then
Arg := 2;
if (Argument(1) = "-v") then
elf2uf2.Set_Verbosity(1);
elsif (Argument(1) = "-vv") then
elf2uf2.Set_Verbosity(2);
else
Set_Exit_Status (Usage);
return;
end if;
else
Arg := 1;
end if;
declare
In_Filename : constant String := Argument(Arg);
Out_Filename : constant String := Argument(Arg+1);
In_File : SIO.File_Type;
Out_File : SIO.File_Type;
begin
declare
begin
SIO.Open (File => In_File, Mode => SIO.In_File, Name => In_Filename);
exception
when Name_Error =>
Put_Line ("Input File does not exist.");
Set_Exit_Status (Errors.ARGS);
return;
when others =>
Put_Line ("Error while opening input file.");
Set_Exit_Status (Errors.ARGS);
return;
end;
declare
begin
SIO.Create (File => Out_File, Mode => SIO.Out_File, Name => Out_Filename);
exception
when others =>
Put_Line ("Error while creating Output file.");
Set_Exit_Status (Errors.ARGS);
return;
end;
declare
Ret_Code : Exit_Status;
begin
Ret_Code := elf2uf2.Run(In_File, Out_File);
SIO.Close(In_File);
SIO.Close(Out_File);
if Ret_Code /= Errors.NO_ERROR then
SIO.Delete (Out_File);
end if;
Set_Exit_Status (Ret_Code);
end;
end;
end Rp2040_Elf2uf2; |
mc-sema/validator/x86/tests/F2XM1.asm | randolphwong/mcsema | 2 | 87220 | <reponame>randolphwong/mcsema<filename>mc-sema/validator/x86/tests/F2XM1.asm
BITS 32
;TEST_FILE_META_BEGIN
;TEST_TYPE=TEST_F
;TEST_IGNOREFLAGS=
;TEST_FILE_META_END
; set up st0 to be 1/2
lea edi, [esp-04]
mov dword [edi], 0x3f000000
fld dword [edi]
;TEST_BEGIN_RECORDING
f2xm1
mov edi, 0
;TEST_END_RECORDING
|
contrib/gnu/gdb/dist/gdb/testsuite/gdb.ada/mi_prot/prot.adb | TheSledgeHammer/2.11BSD | 3 | 3677 | <gh_stars>1-10
-- Copyright 2020 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
with Pkg; use Pkg;
with System;
procedure Prot is
protected type Obj_Type
(Ceiling_Priority: System.Priority := System.Priority'Last)
with Priority => Ceiling_Priority
is
procedure Set (V : Integer);
function Get return Integer;
private
Local : Integer := 0;
end Obj_Type;
protected body Obj_Type is
procedure Set (V : Integer) is
begin
Local := V; -- STOP
end Set;
function Get return Integer is
begin
return Local;
end Get;
end Obj_Type;
Obj : Obj_Type;
begin
Obj.Set (5);
Pkg.Do_Nothing(Obj'Address);
end Prot;
|
programs/oeis/119/A119580.asm | karttu/loda | 1 | 12271 | <filename>programs/oeis/119/A119580.asm
; A119580: (n^2+n^3)*(binomial(2*n,n)).
; 0,4,72,720,5600,37800,232848,1345344,7413120,39382200,203231600,1024287264,5062180032,24607819600,117942804000,558423072000,2615901857280,12139419556440,55866532906800,255192804636000
mov $1,$0
mov $2,$0
add $2,$0
bin $2,$0
mul $1,$2
mul $1,$0
mov $3,1
add $3,$0
mul $1,$3
div $1,4
mul $1,4
|
MIPS/exercise03.asm | nhutnamhcmus/code | 1 | 103600 | # @created by <NAME>
# @ vn.hcmus.fit.sv18120061.computerarchitecture.mips
# Nhap vao mot ky tu in hoa, in ra ky tu thuong
.data
msg1: .asciiz "Nhap mot ky tu: "
msg2: .asciiz "\nKy tu thuong: "
.text
.globl main
main:
# Xuat tb1
li $v0, 4
la $a0, msg1
syscall
# Nhap ky tu
addi $v0, $zero, 12
syscall
move $t0, $v0 # $t0 chua ky tu
# Xuat tb2
li $v0, 4
la $a0, msg2
syscall
addi $t1, $t0, 32
add $a0, $zero, $t1
addi $v0, $zero, 11
syscall
# exit
addi $v0, $zero, 10
syscall
|
gnutls/nettle/x86_64/ecc-25519-modp-mul.asm | rhausam/wine-crossover | 278 | 169339 | <filename>gnutls/nettle/x86_64/ecc-25519-modp-mul.asm
C x86_64/ecc-25519-modp-mul.asm
ifelse(<
Copyright (C) 2016 <NAME>
This file is part of GNU Nettle.
GNU Nettle is free software: you can redistribute it and/or
modify it under the terms of either:
* the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your
option) any later version.
or
* the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your
option) any later version.
or both in parallel, as here.
GNU Nettle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received copies of the GNU General Public License and
the GNU Lesser General Public License along with this program. If
not, see http://www.gnu.org/licenses/.
>)
.file "ecc-25519-modp-mul.asm"
C Input parameters (curve pointer in %rdi is ignored)
define(<RP>, <%rsi>)
define(<AP>, <%rdx>
define(<BP>, <%rcx>
define(<R0>, <%rbp>)
define(<R1>, <%rdi>)
define(<R2>, <%r8>)
define(<R3>, <%r9>)
define(<R4>, <%r10>)
define(<H0>, <%r11>)
define(<H1>, <%r12>)
define(<H2>, <%r13>)
define(<A3>, <%r14>)
define(<A4>, <%r15>)
define(<T>, <%rsi>) C Overlaps RP
C modp_mul (curve, rp, ap, bp)
PROLOGUE(nettle_ecc_25519_modp_mul)
W64_ENTRY(4, 0)
push %rbx
push %rbp
push %r12
push %r13
push %r14
push %r15
push RP
C Accumulate {H2, R4} = a0 b4 + a1 b3 + a2 b2 + a3 b1 + a4 b0
C {H1, R3} = a0 b3 + a1 b2 + a2 b1 + a3 b0 + 19 a4 b4
C {H0, R2} = a0 b2 + a1 b1 + a2 b0 + 19 (a3 b4 + a4 b3)
mov (AP), T
mov 32(BP), %rax
mul T
mov %rax, R4
mov %rdx, H2
mov 24(BP), %rax
mul T
mov %rax, R3,
mov %rdx, H1
mov 16(BP), %rax
mul T
mov %rax, R2
mov %rdx, H0
mov 8(AP), T
mov 24(BP), %rax
mul T
add %rax, R4
adc %rdx, H2
mov 16(BP), %rax
mul T
add %rax, R3
adc %rdx, H1
mov 8(BP), %rax
mul T
add %rax, R2
adc %rdx, H0
mov 16(AP), T
mov 16(BP), %rax
mul T
add %rax, R4
adc %rdx, H2
mov 8(BP), %rax
mul T
add %rax, R3
adc %rdx, H1
mov (BP), %rax
mul T
add %rax, R2
adc %rdx, H0
mov 24(AP), A3
mov 8(BP), %rax
mul A3
add %rax, R4
adc %rdx, H2
mov (BP), %rax
mul A3
imul $19, A3
add %rax, R3
adc %rdx, H1
mov 32(BP), %rax
mul A3
add %rax, R2
adc %rdx, H0
mov 32(AP), A4
mov (BP), %rax
mul A4
imul $19, a4
add %rax, R4
adc %rdx, H2
mov 32(BP), %rax
mul A4
add %rax, R3
adc %rdx, H1
mov 24(BP), %rax
mul A4
add %rax, R2
adc %rdx, H0
C Propagate R2, H0
mov R2, T
shr $51, T
shl $13, H0
or T, H0
add H0, R3
adc $0, H1
C Propagate R3, H1
mov R3, T
shr $51, T
shl $13, H1
or T, H1
add H1, R4
adc $0, H2
C Propagate R4, H2, and fold into R0
mov R4, R0
shr $51, R0
shl $13, H2
or H2, R0
imul $19, R0
C Accumulate {H1, R1} = a0 b1 + a1 b0 + 19 (a2 b4 + a3 b3 + a4 b2)
C {H0, R0} = a0 b0 + 19 (a1 b4 + a2 b3 + a3 b2 + a4 b1)
C + folded high part of R4
mov (AP), T
mov 8(BP), %rax
mul T
mov %rax, R1
mov %rdx, H1
mov (BP), %rax
mul T
xor H0, H0
add %rax, R0
adc %rdx, H0
mov 8(AP), T
mov (BP), %rax
mul T
imul $19, T
add %rax, R1
adc %rdx, H1
mov 32(BP), %rax
mul T
add %rax, R0
adc %rdx, H0
mov 16(AP), T
imul $19, T
mov 32(BP), %rax
mul T
add %rax, R1
adc %rdx, H1
mov 24(BP), %rax
mul T
add %rax, R0
adc %rdx, H0
mov 24(BP), %rax
mul A3
add %rax, R1
adc %rdx, H1
mov 16(BP), %rax
mul A3
add %rax, R0
adc %rdx, H0
mov 16(BP), %rax
mul A4
add %rax, R1
adc %rdx, H1
mov 8(BP), %rax
mul A4
add %rax, R0
adc %rdx, H0
C Propagate R0, H0
mov R0, T
shr $51, T
shl $13, H0
or H0, T
add T, R1
adc $0, H1
C Load mask, use H0
mov $0x7ffffffffffff, H0
C Mask out high parts of R2, R3 and R4, already propagated.
and H0, R2
and H0, R3
and H0, R4
C Propagate R1, H1
mov R1, T
shr $51, T
shl $13, H1
or H1, T
add T, R2
pop RP C Overlapped T, which is no longer used.
C H1 is a larger than 51 bits, so keep propagating.
mov R2, H2
shr $51, H2
add H2, R3
C R3 might be slightly above 51 bits.
and H0, R0
mov R0, (RP)
and H0, R1
mov R1, 8(RP)
and H0, R2
mov R2, 16(RP)
mov R3, 24(RP)
mov r4, 32(RP)
pop %r15
pop %r14
pop %r13
pop %r12
pop %rbp
pop %rbx
W64_EXIT(4, 0)
ret
EPILOGUE(nettle_ecc_25519_modp_mul)
PROLOGUE(nettle_ecc_25519_modp_sqr)
EPILOGUE(nettle_ecc_25519_modp_sqr)
|
programs/oeis/302/A302058.asm | karttu/loda | 0 | 21009 | <gh_stars>0
; A302058: Numbers that are not square pyramidal numbers.
; 2,3,4,6,7,8,9,10,11,12,13,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82
add $0,1
mov $1,$0
mov $3,1
lpb $0,1
add $1,1
add $3,1
add $2,$3
sub $0,$2
trn $0,1
add $2,$3
lpe
|
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_21829_1931.asm | ljhsiun2/medusa | 9 | 80661 | <reponame>ljhsiun2/medusa
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r13
push %r15
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x9b7e, %r15
nop
cmp %r13, %r13
movw $0x6162, (%r15)
nop
nop
nop
inc %rsi
lea addresses_A_ht+0xe3de, %rsi
lea addresses_D_ht+0x1b7e, %rdi
nop
and %r12, %r12
mov $126, %rcx
rep movsl
nop
dec %r12
lea addresses_A_ht+0x15b7e, %rdi
nop
nop
nop
nop
nop
and %rcx, %rcx
movb (%rdi), %r13b
nop
nop
nop
nop
nop
xor $23567, %r12
pop %rsi
pop %rdi
pop %rcx
pop %r15
pop %r13
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r14
push %r15
push %rbp
push %rbx
push %rsi
// Store
lea addresses_PSE+0xbb16, %rbx
nop
nop
sub %r14, %r14
movw $0x5152, (%rbx)
// Exception!!!
mov (0), %r12
nop
nop
and %r14, %r14
// Store
lea addresses_WC+0x1627e, %r11
nop
sub $52461, %r15
movw $0x5152, (%r11)
nop
and %r11, %r11
// Faulty Load
lea addresses_WT+0x1637e, %r11
inc %r15
mov (%r11), %bp
lea oracles, %r15
and $0xff, %rbp
shlq $12, %rbp
mov (%r15,%rbp,1), %rbp
pop %rsi
pop %rbx
pop %rbp
pop %r15
pop %r14
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 2, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 7, 'size': 2, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'AVXalign': True, 'congruent': 0, 'size': 2, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 11, 'size': 2, 'same': True, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 9, 'size': 1, 'same': False, 'NT': False}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
lua.ads | jhumphry/aLua | 0 | 15256 | <reponame>jhumphry/aLua
-- Lua
-- an Ada 2012 interface to Lua
-- Copyright (c) 2015, <NAME>
-- Permission is hereby granted, free of charge, to any person obtaining
-- a copy of this software and associated documentation files (the
-- "Software"), to deal in the Software without restriction, including
-- without limitation the rights to use, copy, modify, merge, publish,
-- distribute, sublicense, and/or sell copies of the Software, and to
-- permit persons to whom the Software is furnished to do so, subject to
-- the following conditions:
--
-- The above copyright notice and this permission notice shall be
-- included in all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
with Ada.Finalization;
with Ada.Streams.Stream_IO;
private with System;
private with Interfaces.C;
package Lua is
-- *
-- ** Types used by Lua
-- *
subtype Lua_Number is Long_Float;
subtype Lua_Integer is Long_Long_Integer;
type Lua_Type is (TNONE, TNIL, TBOOLEAN, TLIGHTUSERDATA, TNUMBER, TSTRING,
TTABLE, TFUNCTION, TUSERDATA, TTHREAD, TNUMTAGS);
-- *
-- ** Exceptions
-- *
-- Lua_Error is raised whenever there is a violation of a constraint
-- imposed by the semantics of the Lua interface - for example, trying to
-- retrieve a number from a non-numeric value on the stack or using a
-- reference on a different Lua_State than it was created on.
Lua_Error : exception;
-- Special stack positions and the registry
MaxStack : constant Integer
with Import, Convention => C, Link_Name => "lua_conf_luai_maxstack";
RegistryIndex : constant Integer
with Import, Convention => C, Link_Name => "lua_conf_registry_index";
RIDX_MainThread : constant Lua_Integer;
RIDX_Globals : constant Lua_Integer;
RIDX_Last : constant Lua_Integer;
function UpvalueIndex (i : in Integer) return Integer;
-- *
-- ** Basic state control
-- *
-- Lua_State encapsulates the entire state of a Lua interpreter. Almost every
-- routine requires a Lua_State to be passed as the first parameter. This
-- is a Limited_Controlled type internally so it will automatically be
-- initialised on creation and finalized properly when it goes out of Ada
-- scope. Every Lua_State contains a main thread of execution, but other
-- threads may be created with shared global environment, but separate
-- stacks - see Lua_Thread for details.
type Lua_State is tagged limited private;
type Lua_Thread;
type Thread_Status is (OK, YIELD, ERRRUN, ERRSYNTAX,
ERRMEM, ERRGCMM, ERRERR, ERRFILE);
-- Dumps the function at the top of the stack to the file with the given name
-- as a binary chunk. Does not pop the function from the stack. If Strip is
-- set some debug information removed from the generated chunk to save space.
procedure DumpFile(L : in Lua_State;
Name : in String;
Strip : in Boolean := False);
-- Dumps the function at the top of the stack to the stream given as a binary
-- chunk. Does not pop the function from the stack. If Strip is set some
-- debug information removed from the generated chunk to save space.
procedure DumpStream(L : in Lua_State;
Output_Stream : in Ada.Streams.Stream_IO.Stream_Access;
Strip : in Boolean := False);
type Lua_ChunkMode is (Binary, Text, Binary_and_Text);
-- Loads and runs a string containing code. Chunkname gives the name to the
-- chunk which can be used in error messages. Mode indicates if the file can
-- be in Binary, Text or either format. The return value indicates whether
-- the load was successful. Program_Error may be raised if C and Ada
-- conventions on this system for strings are too dissimilar to allow for
-- loading strings without copying - in this case LoadString_By_Copy can
-- be used.
-- Note: malicious binary chunks can be created that bypass the Lua sandbox.
-- If untrusted input is being loaded, ensure only Text mode is permitted.
function LoadString (L : in Lua_State;
S : aliased String;
ChunkName : in String := "";
Mode : Lua_ChunkMode := Binary_and_Text)
return Thread_Status;
-- Loads and runs a string containing code. Makes an aliased duplicate of the
-- string first, so this is more convenient for short snippets of code but
-- possibly wastes memory for larger chunks of code. If C and Ada conventions
-- for strings are different on this system, a conversion will be done rather
-- just an aliased duplicate.
-- Note: malicious binary chunks can be created that bypass the Lua sandbox.
-- This function is therefore not suitable for untrusted input.
function LoadString_By_Copy (L : in Lua_State;
S : in String)
return Thread_Status;
-- Loads and runs a file of a given Name. Chunkname gives the name to the
-- chunk which can be used in error messages. The Mode parameter allows
-- specification of whether the file can be in Binary, Text or either format.
-- Buffer_Size specifies the size of the temporary buffer used.
-- Note: malicious binary chunks can be created that bypass the Lua sandbox.
-- If untrusted input is being loaded, ensure only Text mode is permitted.
function LoadFile (L : in Lua_State;
Name : in String;
ChunkName : in String := "";
Mode : in Lua_ChunkMode := Binary_and_Text;
Buffer_Size : in Positive := 256)
return Thread_Status;
-- Loads and runs a file from a given Input_Stream. Chunkname gives the
-- name to the chunk which can be used in error messages. The Mode parameter
-- allows specification of whether the file can be in Binary, Text or either
-- format. Buffer_Size specifies the size of the temporary buffer used.
-- Note: malicious binary chunks can be created that bypass the Lua sandbox.
-- If untrusted input is being loaded, ensure only Text mode is permitted.
function LoadStream (L : in Lua_State;
Input_Stream : in Ada.Streams.Stream_IO.Stream_Access;
ChunkName : in String := "";
Mode : in Lua_ChunkMode := Binary_and_Text;
Buffer_Size : in Positive := 256)
return Thread_Status;
-- Status returns the status of a particular interpreter state or thread
-- using a custom enumeration type.
function Status (L : in Lua_State) return Thread_Status;
-- This function retrieves the version of the C Lua interpreter that the
-- program has been compiled against.
-- Returns a Long_Float value consisting of the Major version * 100 plus the
-- minor version, so version 5.3 of Lua will return 503.0.
function Version (L : in Lua_State) return Long_Float;
-- *
-- ** Calling, yielding and functions
-- *
-- Calls a function (including an anonymous block of code) on the stack. The
-- arguments should be pushed onto the stack on top of the function. The
-- arguments and function will be popped from the stack and replaced with the
-- results. If nresults is specified using the magic constant
-- MultRet_Sentinel then a variable number of results can be retrieved. Any
-- errors will cause the Lua interpreter to panic, which will end the
-- whole Ada program.
procedure Call (L : in Lua_State; nargs : in Integer; nresults : in Integer)
with Inline, Pre => IsFunction(L, -nargs-1);
-- This procedure looks up the name of a function stored in the global
-- environment and pushes it onto the stack in the correct place before
-- invoking Call.
procedure Call_Function (L : in Lua_State;
name : in String;
nargs : in Integer;
nresults : in Integer);
-- Calls a function (including an anonymous block of code) on the stack. The
-- arguments should be pushed onto the stack on top of the function. The
-- arguments and function will be popped from the stack and replaced with the
-- results. If nresults is specified using the magic constant
-- MultRet_Sentinel then a variable number of results can be retrieved. If an
-- error occurrs then an error message will be pushed to the stack and the
-- Thread_Status value returned will be an error code. If msgh is non-zero,
-- it indicates the index of a function on the stack that will be called on
-- an error which can provide additional debugging infomation.
function PCall (L : in Lua_State;
nargs : in Integer;
nresults : in Integer;
msgh : in Integer := 0)
return Thread_Status
with Inline, Pre => IsFunction(L, -nargs-1);
-- This procedure looks up the name of a function stored in the global
-- environment and pushes it onto the stack in the correct place before
-- invoking PCall.
function PCall_Function (L : in Lua_State;
name : in String;
nargs : in Integer;
nresults : in Integer;
msgh : in Integer := 0)
return Thread_Status;
-- AdaFunction is used to refer to Ada functions that are suitable for
-- use by Lua. They are given a Lua_State'Class parameter and other
-- parameters should be retrieved from the stack. The results should be
-- pushed onto the stack and the number of results returned.
-- Note that the function does NOT have to have Convention=>C set.
type AdaFunction is access function (L : Lua_State'Class) return Natural;
-- Register an Ada function f under name in the global environment.
procedure Register(L : in Lua_State; name : in String; f : in AdaFunction);
-- A magic value that indicates that multiple results may be returned
MultRet_Sentinel : constant Integer
with Import, Convention => C, Link_Name => "lua_conf_multret";
-- *
-- ** Pushing values to the stack
-- *
-- Create an Ada closure f which has n upvalues on the stack. Pop the
-- upvalues and push the Ada closure onto the stack.
procedure PushAdaClosure (L : in Lua_State;
f : in AdaFunction;
n : in Natural)
with Inline;
-- Push the Ada function f to the stack.
procedure PushAdaFunction (L : in Lua_State; f : in AdaFunction) with Inline;
-- Push the Boolean value b to the stack.
procedure PushBoolean (L : in Lua_State; b : in Boolean) with Inline;
-- Push the Integer value n to the stack.
procedure PushInteger (L : in Lua_State; n : in Lua_Integer) with Inline;
-- Push a Nil value to the stack. Nil is used to represent missing data.
procedure PushNil (L : in Lua_State) with Inline;
-- Push a Number value to the stack.
procedure PushNumber (L : in Lua_State; n : in Lua_Number) with Inline;
-- Push a String value to the stack.
procedure PushString (L : in Lua_State; s : in String) with Inline;
-- Push the thread represented by L to the stack and return a Boolean that
-- indicates whether it is the main thread of its interpreter.
function PushThread (L : in Lua_State) return Boolean with Inline;
-- Push the thread represented by L to the stack.
procedure PushThread (L : in Lua_State) with Inline;
-- Pop a value from the top of the stack and set it as the userdata value for
-- the userdata at the specified stack index.
procedure SetUserValue (L : in Lua_State; index : in Integer) with Inline;
-- If possible, convert the string s to a number following Lua conversion
-- rules and push it to the stack. Returns a Boolean to indicate if the
-- conversion was successful.
function StringToNumber (L : in Lua_State; s : in String)
return Boolean with Inline;
-- *
-- ** Pulling values from the stack
-- *
-- Return the AdaFunction value at the specified stack index. Raises
-- Lua_Error if the value does not appear to be an AdaFunction.
function ToAdaFunction (L : in Lua_State; index : in Integer)
return AdaFunction;
-- Return the value at the given stack index converted to a Boolean. All
-- values except for False and Nil return True. Use IsBoolean if you want to
-- only accept true Boolean values.
function ToBoolean (L : in Lua_State; index : in Integer)
return Boolean with Inline;
-- Convert the integer, number or string at the given index to an integer and
-- return it. Raises Lua_Error if the conversion fails.
function ToInteger (L : in Lua_State; index : in Integer) return Lua_Integer;
-- Convert the integer, number or string at the given index to an number and
-- return it. Raises Lua_Error if the conversion fails.
function ToNumber (L : in Lua_State; index : in Integer) return Lua_Number;
-- Convert the value at the given stack index to a string and return it.
-- Raises Lua_Error if the conversion fails. NOTE: this function also
-- converts the value on the stack. Use IsString before using this
-- function if you need to avoid this.
function ToString (L : in Lua_State; index : in Integer) return String;
-- Return the Lua_Thread value at the given stack index. Raises Lua_Error if
-- the conversion fails.
function ToThread (L : in Lua_State; index : in Integer)
return Lua_Thread with Inline;
-- *
-- ** Operations on values
-- *
type Arith_Op is (OPADD, OPSUB, OPMUL, OPMOD, OPPOW, OPDIV, OPIDIV, OPBAND,
OPBOR, OPBXOR, OPSHL, OPSHR, OPUNM, OPBNOT);
-- Carry out the specified arithmetical or bitwise operation on the top
-- one or two values on the stack. If the values have special metamethods
-- defined, they will be used.
procedure Arith (L : in Lua_State; op : in Arith_Op) with Inline;
type Comparison_Op is (OPEQ, OPLT, OPLE);
-- Carry out the specified comparison between the two indicated indexes on
-- the stack. If the values have special metamethods defined, they will be
-- used. Returns False if either of the indexes is invalid.
function Compare (L : in Lua_State;
index1 : in Integer;
index2 : in Integer;
op : in Comparison_Op) return Boolean with Inline;
-- Concatenate the top n values on the stack, using metamethods where
-- appropriate
procedure Concat (L : in Lua_State; n : in Integer) with Inline;
-- Push the length of the value at the given index onto the stack. Like the
-- '#' operator, this follows the Lua semantics, so will use the '__len'
-- metamethod.
procedure Len (L : in Lua_State; index : Integer) with Inline;
-- Compare the two specified indexes without considering the Lua semantics.
-- Returns False if either of the indexes is invalid.
function RawEqual (L : in Lua_State; index1, index2 : in Integer)
return Boolean with Inline;
-- Return the length of the value at the given index without considering
-- the Lua semantics. This does not give a meaningful value for Ada userdata.
function RawLen (L : in Lua_State; index : Integer)
return Integer with Inline;
-- *
-- ** Garbage Collector control
-- *
type GC_Op is (GCSTOP, GCRESTART, GCCOLLECT, GCCOUNT, GCCOUNTB, GCSTEP);
-- Instruct the garbage collector to carry out the specified operation.
procedure GC (L : in Lua_State; what : in GC_Op);
type GC_Param is (GCSETPAUSE, GCSETSTEPMUL);
-- Set a given parameter of the garbage collector and return the previous
-- value.
function GC (L : in Lua_State; what : in GC_Param; data : in Integer)
return Integer;
-- Return whether the garbage collector is currently running
-- (i.e. not stopped by a GCSTOP operation)
function GC_IsRunning (L : in Lua_State) return Boolean;
-- *
-- ** Stack manipulation and information
-- *
-- Convert an acceptable index into an equivalent absolute index
function AbsIndex (L : in Lua_State; idx : in Integer)
return Integer with Inline;
-- Returns whether the stack can be expanded by at least n extra slots. This
-- can return False if there is not enough memory or if the maximum stack
-- size would be exceeded.
function CheckStack (L : in Lua_State; n : in Integer)
return Boolean with Inline;
-- Copy the value at fromidx to toidx, overwriting anything previously at
-- fromidx.
procedure Copy (L : in Lua_State; fromidx : in Integer; toidx : in Integer)
with Inline;
-- Return the index of the top value on the stack. This will also be the
-- number of items on the stack.
function GetTop (L : in Lua_State) return Integer with Inline;
-- Move the value at the top of the stack to the (absolute) index value given
-- moving the values above that point upwards.
procedure Insert (L : in Lua_State; index : in Integer) with Inline;
-- Remove n values from the top of the stack.
procedure Pop (L : in Lua_State; n : in Integer) with Inline;
-- Push a copy of the value at the given index to the top of the stack.
procedure PushValue (L : in Lua_State; index : in Integer) with Inline;
-- Remove the value at the given (absolute) index and move values down to
-- fill the gap.
procedure Remove (L : in Lua_State; index : in Integer) with Inline;
-- Move the top value on the stack to the index position given, and then
-- pop the top value.
procedure Replace (L : in Lua_State; index : in Integer) with Inline;
-- Rotate the stack values between idx and the top of the stack by n values
-- (positive towards the top, negative towards the bottom).
procedure Rotate (L : in Lua_State; idx : in Integer; n : in Integer)
with Inline;
-- Set the top of the stack to the given index value. If index is zero, the
-- result is to empty the stack.
procedure SetTop (L : in Lua_State; index : in Integer) with Inline;
-- *
-- ** Type information
-- *
-- Indicate whether the value at the given index is an AdaFunction.
function IsAdaFunction (L : in Lua_State; index : in Integer)
return Boolean with Inline;
-- Indicate whether the value at the given index is a Boolean.
function IsBoolean (L : in Lua_State; index : in Integer)
return Boolean with Inline;
-- Indicate whether the value at the given index is a CFunction.
function IsCFunction (L : in Lua_State; index : in Integer)
return Boolean with Inline;
-- Indicate whether the value at the given index is a function of any sort
-- (Lua, C or Ada).
function IsFunction (L : in Lua_State; index : in Integer)
return Boolean with Inline;
-- Indicate whether the value at the given index is a number that can be
-- represented as an Integer.
function IsInteger (L : in Lua_State; index : in Integer)
return Boolean with Inline;
-- Indicate whether the value at the given index is a Light Userdata.
function IsLightuserdata (L : in Lua_State; index : in Integer)
return Boolean with Inline;
-- Indicate whether the value at the given index is Nil.
function IsNil (L : in Lua_State; index : in Integer)
return Boolean with Inline;
-- Indicate whether the value at the given index is None.
function IsNone (L : in Lua_State; index : in Integer)
return Boolean with Inline;
-- Indicate whether the value at the given index is None or Nil.
function IsNoneOrNil (L : in Lua_State; index : in Integer)
return Boolean with Inline;
-- Indicate whether the value at the given index is a Number or a String
-- convertible to a Number.
function IsNumber (L : in Lua_State; index : in Integer)
return Boolean with Inline;
-- Indicate whether the value at the given index is a String or a Number (as
-- all Numebers are convertible to Strings).
function IsString (L : in Lua_State; index : in Integer)
return Boolean with Inline;
-- Indicate whether the value at the given index is a Table.
function IsTable (L : in Lua_State; index : in Integer)
return Boolean with Inline;
-- Indicate whether the value at the given index is a Thread.
function IsThread (L : in Lua_State; index : in Integer)
return Boolean with Inline;
-- Indicate whether the value at the given index is a Userdata.
function IsUserdata (L : in Lua_State; index : in Integer)
return Boolean with Inline;
-- Return the Lua_Type of the value at the given index.
function TypeInfo (L : in Lua_State; index : in Integer)
return Lua_Type with Inline;
-- Return the name of the given Lua_Type .
function TypeName (L : in Lua_State; tp : in Lua_Type)
return String with Inline;
-- Return the name of the type of the value at the given index.
function TypeName (L : in Lua_State; index : in Integer)
return String with Inline;
-- Return the name of the tagged type from which the Ada Userdata at the
-- given index was created, or "" if it is not an Ada Userdata.
function Userdata_Name (L : in Lua_State; index : in Integer) return String;
-- *
-- ** Table manipulation
-- *
-- Create a new empty table and push it onto the stack. 'narr' and 'nrec'
-- are hints about the number of sequence and non-sequence elements that the
-- table is expected to have - however they are not limits and can be omitted
-- if unknown.
procedure CreateTable (L : in Lua_State;
narr : in Integer := 0;
nrec : in Integer := 0) with Inline;
-- Push a new empty table onto the stack.
procedure NewTable (L : in Lua_State) with Inline;
-- Pushes the value t[k] onto the stack, where t is the table at the index
-- specified (or a value of another type with a suitable metamethod for
-- __index defined). Returns the type of the pushed value.
function GetField (L : in Lua_State; index : in Integer; k : in String)
return Lua_Type with Inline;
-- Pushes the value t[k] onto the stack, where t is the table at the index
-- specified (or a value of another type with a suitable metamethod for
-- __index defined). Raises Lua_Error if nothing is found.
procedure GetField (L : in Lua_State; index : in Integer; k : in String)
with Inline;
-- Pushes the value t[i] onto the stack, where t is the table at the index
-- specified (or a value of another type with a suitable metamethod for
-- __index defined). Returns the type of the pushed value.
function Geti (L : in Lua_State; index : in Integer; i : in Lua_Integer)
return Lua_Type with Inline;
-- Pushes the value t[i] onto the stack, where t is the table at the index
-- specified (or a value of another type with a suitable metamethod for
-- __index defined). Raises Lua_Error if nothing is found.
procedure Geti (L : in Lua_State; index : in Integer; i : in Lua_Integer)
with Inline;
-- Pushes the value t[k] onto the stack, where t is the table at the index
-- specified (or a value of another type with a suitable metamethod for
-- __index defined) and k is the value at the top of the stack. Returns
-- the type of the pushed value.
function GetTable (L : in Lua_State; index : in Integer) return Lua_Type
with Inline;
-- Pushes the value t[k] onto the stack, where t is the table at the index
-- specified (or a value of another type with a suitable metamethod for
-- __index defined) and k is the value at the top of the stack. Raises
-- Lua_Error if nothing is found.
procedure GetTable (L : in Lua_State; index : in Integer) with Inline;
-- Pops a key from the stack and returns the next key-value pair from the
-- table at the index specified (so stack position -1 will contain the value
-- and -2 the key). The order in which key-value pairs will be returned is
-- arbitrary. When using this function to iterate over all the keys in a
-- table, it is important not to change or mutate the table or unexpected
-- behaviour can occur. Push a nil value to start the iteration and end the
-- iteration when Next returns false.
function Next (L : in Lua_State; index : in Integer)
return Boolean with Inline;
-- Pushes the value t[k] onto the stack, where t is the table at the index
-- specified (without using metamethods) and k is the value at the top of
-- the stack. Returns the type of the pushed value.
function RawGet (L : in Lua_State; index : in Integer) return Lua_Type
with Inline, Pre => IsTable(L, index);
-- Pushes the value t[k] onto the stack, where t is the table at the index
-- specified (without using metamethods) and k is the value at the top of
-- the stack. Raises Lua_Error if nothing is found.
procedure RawGet (L : in Lua_State; index : in Integer)
with Inline, Pre => IsTable(L, index);
-- Pushes the value t[i] onto the stack, where t is the table at the index
-- specified (without using metamethods). Returns the type of the pushed
-- value.
function RawGeti (L : in Lua_State; index : in Integer; i : in Lua_Integer)
return Lua_Type with Inline, Pre => IsTable(L, index);
-- Pushes the value t[i] onto the stack, where t is the table at the index
-- specified (without using metamethods). Raises Lua_Error if nothing is
-- found.
procedure RawGeti (L : in Lua_State; index : in Integer; i : in Lua_Integer)
with Inline, Pre => IsTable(L, index);
-- Set t[k]=v onto the stack, where t is the table at the index specified
-- (without using metamethods), v is the value at the top of the stack and
-- k is the value just below. Both the k and v values are popped from the
-- stack.
procedure RawSet (L : in Lua_State; index : in Integer)
with Inline, Pre => IsTable(L, index);
-- Set t[i]=v onto the stack, where t is the table at the index specified
-- (without using metamethods) and v is the value at the top of the stack.
-- The v value is popped from the stack.
procedure RawSeti (L : in Lua_State; index : in Integer; i : in Lua_Integer)
with Inline, Pre => IsTable(L, index);
-- Set t[k]=v onto the stack, where t is the table at the index specified (or
-- a value of another type with a suitable metamethod for __newindex defined)
-- and v is the value at the top of the stack. The v value is popped from the
-- stack.
procedure SetField (L : in Lua_State; index : in Integer; k : in String)
with Inline;
-- Set t[i]=v onto the stack, where t is the table at the index specified (or
-- a value of another type with a suitable metamethod for __newindex defined)
-- and v is the value at the top of the stack. The v value is popped from the
-- stack.
procedure Seti (L : in Lua_State; index : in Integer; i : in Lua_Integer)
with Inline;
-- Set t[k]=v onto the stack, where t is the table at the index specified
-- (or a value of another type with a suitable metamethod for __newindex
-- defined), v is the value at the top of the stack and k is the value
-- just below. Both the k and v values are popped from the stack.
procedure SetTable (L : in Lua_State; index : in Integer) with Inline;
-- *
-- ** Globals and metatables
-- *
-- Push the value of the global with the given name onto the stack and return
-- its type. A TNIL value is pushed if there is no global with that name.
function GetGlobal (L : in Lua_State; name : in String) return Lua_Type;
-- Push the value of the global with the given name onto the stack and return
-- its type. Raises Lua_Error if there is no global with that name.
procedure GetGlobal (L : in Lua_State; name : in String);
-- If the value at the specified index has a metatable, push it to the stack
-- and return True else return False.
function GetMetatable (L : in Lua_State; index : in Integer) return Boolean;
-- If the value at the specified index has a metatable, push it to the stack
-- and return True else raise Lua_Error.
procedure GetMetatable (L : in Lua_State; index : in Integer);
-- Push the global environment table to the stack.
procedure PushGlobalTable (L : in Lua_State);
-- Set the global with the given name to the value at the top of the stack.
procedure SetGlobal (L : in Lua_State; name : in String);
-- Pop a table from the stack and use it as the metatable for the value at
-- the given index.
procedure SetMetatable (L : in Lua_State; index : in Integer);
-- *
-- ** Threads
-- *
-- A Lua_Thread represents a context in which a coroutine can run. It shares
-- a global environment with all of the other threads in the Lua_State which
-- it shares but it has a separate stack. Threads are Lua objects so garbage
-- collected when not longer referenced by anything in the Lua_State. To
-- extend the lifetime of threads it may wise to make a reference to them
-- (see Lua_Reference).
type Lua_Thread is new Lua_State with private;
-- This constant is used in calls to Resume to indicate that no thread is
-- responsible for yielding to this one.
Null_Thread : constant Lua_Thread;
-- Returns whether a given Lua_State can yield. The main thread of a
-- Lua_State cannot yield and neither can threads that have called API
-- functions. (While the C API gives the possibility of API functions
-- yielding, this is not supported in the Ada API as the change of
-- context would not be compatible with the Ada runtime environment).
function IsYieldable (L : in Lua_State'Class) return Boolean with Inline;
-- Create and return a new Lua_Thread in a given Lua_State. The new thread
-- is also pushed onto the stack.
function NewThread (L : in Lua_State'Class) return Lua_Thread with Inline;
-- Resume the execution of a thread L with parameters. On the first execution
-- for a thread the main function is on the stack with its parameters. On
-- subsequent calls (after the thread has 'yield'ed and the host program has
-- resumed the thread's execution) the stack should contain the arguments
-- the thread will see as the result of its 'yield'. The 'from' parameter
-- contains the thread that yielded to this one, and is not essential.
function Resume(L : in Lua_State'Class;
nargs : in Integer;
from : in Lua_State'Class := Null_Thread
)
return Thread_Status with Inline;
-- Pop n values from the stack of 'from' and push them to the stack of 'to'.
procedure XMove (from, to : in Lua_Thread; n : in Integer) with Inline;
-- Yield a thread and return the specified number of results. When the thread
-- is 'Resume'd it will continue from the point at which this function was
-- called. 'nresults' gives the number of results passed to the call of
-- 'Resume' that resumed the execution of the thread.
procedure Yield (L : in Lua_State; nresults : Integer) with Inline;
-- *
-- ** References
-- *
-- Lua_Reference is a reference-counted way of referring to objects inside an
-- interpreter state.
type Lua_Reference is tagged private;
-- Create a reference to the object at the top of the stack. By default the
-- Lua side of this reference is stored in the Registry but this can be
-- changed by specifying a reference to a different table through parameter
-- t.
function Ref (L : in Lua_State'Class; t : in Integer := RegistryIndex)
return Lua_Reference;
-- Retrieve a Lua object from a reference and return the type of the object.
function Get (L : in Lua_State; R : Lua_Reference'Class) return Lua_Type;
-- Retrieve a Lua object from a reference. Raise Lua_Error if the value
-- cannot be found.
procedure Get (L : in Lua_State; R : Lua_Reference'Class);
private
-- *
-- ** Representation clauses
-- *
for Thread_Status use (OK => 0, YIELD => 1, ERRRUN => 2, ERRSYNTAX => 3,
ERRMEM => 4, ERRGCMM => 5, ERRERR => 6, ERRFILE => 7);
for Thread_Status'Size use Interfaces.C.int'Size;
for Arith_Op use (OPADD => 0, OPSUB => 1, OPMUL => 2, OPMOD => 3, OPPOW => 4,
OPDIV => 5, OPIDIV => 6, OPBAND => 7, OPBOR => 8,
OPBXOR => 9, OPSHL => 10, OPSHR => 11, OPUNM => 12,
OPBNOT => 13);
for Arith_Op'Size use Interfaces.C.int'Size;
for Comparison_Op use (OPEQ => 0, OPLT => 1, OPLE => 2);
for Comparison_Op'Size use Interfaces.C.int'Size;
for GC_Op use (GCSTOP => 0, GCRESTART => 1, GCCOLLECT => 2,
GCCOUNT => 3, GCCOUNTB => 4, GCSTEP => 5);
for GC_Op'Size use Interfaces.C.int'Size;
for GC_Param use (GCSETPAUSE => 6, GCSETSTEPMUL => 7);
for GC_Param'Size use Interfaces.C.int'Size;
GCISRUNNING : constant := 9;
for Lua_Type use (TNONE => -1, TNIL => 0, TBOOLEAN => 1, TLIGHTUSERDATA => 2,
TNUMBER => 3, TSTRING => 4, TTABLE => 5, TFUNCTION => 6,
TUSERDATA => 7, TTHREAD => 8, TNUMTAGS => 9);
for Lua_Type'Size use Interfaces.C.int'Size;
-- *
-- ** Deferred constants
-- *
RIDX_MainThread : constant Lua_Integer := 1;
RIDX_Globals : constant Lua_Integer := 2;
RIDX_Last : constant Lua_Integer := RIDX_Globals;
-- *
-- ** Main Lua_State type and derivatives
-- *
subtype void_ptr is System.Address;
type Lua_State is new Ada.Finalization.Limited_Controlled with
record
L : void_ptr;
end record;
overriding procedure Initialize (Object : in out Lua_State) with inline;
overriding procedure Finalize (Object : in out Lua_State) with inline;
-- Existing_State is a clone of State but without automatic initialization
-- It is used internally when lua_State* are returned from the Lua library
-- and we don't want to re-initialize them when turning them into the
-- State record type.
type Existing_State is new Lua_State with null record;
overriding procedure Initialize (Object : in out Existing_State) is null;
overriding procedure Finalize (Object : in out Existing_State) is null;
type Lua_Thread is new Existing_State with null record;
Null_Thread : constant Lua_Thread
:= (Ada.Finalization.Limited_Controlled with L => System.Null_Address);
-- *
-- ** References
-- *
type Lua_Reference_Value is
record
State : void_ptr;
Table : Interfaces.C.int;
Ref : Interfaces.C.int;
Count : Natural := 0;
end record;
type Lua_Reference_Value_Access is access Lua_Reference_Value;
type Lua_Reference is
new Ada.Finalization.Controlled with
record
E : Lua_Reference_Value_Access := null;
end record;
overriding procedure Initialize (Object : in out Lua_Reference) is null;
overriding procedure Adjust (Object : in out Lua_Reference);
overriding procedure Finalize (Object : in out Lua_Reference);
end Lua;
|
language/src/main/java/com/oracle/truffle/tcl/parser/Tcl.g4 | Dragicafit/graaltcl | 0 | 4738 | <filename>language/src/main/java/com/oracle/truffle/tcl/parser/Tcl.g4
/*
* The parser and lexer need to be generated using "mx create-tcl-parser".
*/
grammar Tcl;
@parser::header
{
// DO NOT MODIFY - generated from Tcl.g4 using "mx create-tcl-parser"
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.oracle.truffle.api.source.Source;
import com.oracle.truffle.api.RootCallTarget;
import com.oracle.truffle.tcl.TclLanguage;
import com.oracle.truffle.tcl.nodes.TclExpressionNode;
import com.oracle.truffle.tcl.nodes.TclRootNode;
import com.oracle.truffle.tcl.nodes.TclStatementNode;
import com.oracle.truffle.tcl.parser.TclParseError;
}
@lexer::header
{
// DO NOT MODIFY - generated from Tcl.g4 using "mx create-tcl-parser"
}
@parser::members
{
private TclNodeFactory factory;
private Source source;
private static final class BailoutErrorListener extends BaseErrorListener {
private final Source source;
BailoutErrorListener(Source source) {
this.source = source;
}
@Override
public void syntaxError(Recognizer<?, ?> recognizer, Object offendingSymbol, int line, int charPositionInLine, String msg, RecognitionException e) {
throwParseError(source, line, charPositionInLine, (Token) offendingSymbol, msg);
}
}
public void SemErr(Token token, String message) {
assert token != null;
throwParseError(source, token.getLine(), token.getCharPositionInLine(), token, message);
}
private static void throwParseError(Source source, int line, int charPositionInLine, Token token, String message) {
int col = charPositionInLine + 1;
String location = "-- line " + line + " col " + col + ": ";
int length = token == null ? 1 : Math.max(token.getStopIndex() - token.getStartIndex(), 0);
throw new TclParseError(source, line, col, length, String.format("Error(s) parsing script:%n" + location + message));
}
public static Map<String, RootCallTarget> parseTcl( TclLanguage language, Source source) {
TclLexer lexer = new TclLexer(CharStreams.fromString(source.getCharacters().toString()));
TclParser parser = new TclParser(new CommonTokenStream(lexer));
lexer.removeErrorListeners();
parser.removeErrorListeners();
BailoutErrorListener listener = new BailoutErrorListener(source);
lexer.addErrorListener(listener);
parser.addErrorListener(listener);
parser.factory = new TclNodeFactory(language, source);
parser.source = source;
parser.tcl();
return parser.factory.getAllFunctions();
}
}
// parser
tcl
:
NL*
(
function
|
command[false] { factory.addModuleStatement($command.result); }
NL+
)*
NL*
EOF { factory.finishModule(); }
;
function
:
'proc'
IDENTIFIER
s='{'
{ factory.startFunction($IDENTIFIER, $s); }
(
IDENTIFIER { factory.addFormalParameter($IDENTIFIER); }
(
IDENTIFIER { factory.addFormalParameter($IDENTIFIER); }
)*
)?
'}'
body=block[false] { factory.finishFunction($body.result); }
;
block [boolean inLoop] returns [TclStatementNode result]
: { factory.startBlock();
List<TclStatementNode> body = new ArrayList<>(); }
s='{' NL*
(
command[inLoop] { body.add($command.result); }
)?
(
NL+
command[inLoop] { body.add($command.result); }
)*
NL*
e='}'
{ $result = factory.finishBlock(body, $s.getStartIndex(), $e.getStopIndex() - $s.getStartIndex() + 1); }
NL*
;
command [boolean inLoop] returns [TclStatementNode result]
:
(
while_command { $result = $while_command.result; }
|
b='break' { if (inLoop) { $result = factory.createBreak($b); } else { SemErr($b, "break used outside of loop"); } }
|
c='continue' { if (inLoop) { $result = factory.createContinue($c); } else { SemErr($c, "continue used outside of loop"); } }
|
if_command[inLoop] { $result = $if_command.result; }
|
return_command { $result = $return_command.result; }
|
expression { $result = $expression.result; }
)
';'?
;
while_command returns [TclStatementNode result]
:
w='while'
condition=expression
body=block[true] { $result = factory.createWhile($w, $condition.result, $body.result); }
;
if_command [boolean inLoop] returns [TclStatementNode result]
:
i='if'
condition=expression
'then'?
then=block[inLoop] { TclStatementNode elsePart = null; }
(
'elseif'
condition2=expression //TODO manage elseif
'then'?
then2=block[inLoop]
)*
(
'else'?
block[inLoop] { elsePart = $block.result; }
)? { $result = factory.createIf($i, $condition.result, $then.result, elsePart); }
;
return_command returns [TclStatementNode result]
:
r='return' { TclExpressionNode value = null; }
(
expression { value = $expression.result; }
)? { $result = factory.createReturn($r, value); }
';'?
;
expression returns [TclExpressionNode result]
:
'{'
expression { $result = $expression.result; }
'}'
|
'('
expression { $result = $expression.result; }
')'
|
left=expression op='||' right=expression { $result = factory.createBinary($op, $left.result, $right.result); }
|
left=expression op='&&' right=expression { $result = factory.createBinary($op, $left.result, $right.result); }
|
left=expression
op=('<' | '<=' | '>' | '>=' | '==' | '!=' | 'eq' | 'ne' )
right=expression { $result = factory.createBinary($op, $left.result, $right.result); }
|
left=expression
op=('*' | '/' | '%')
right=expression { $result = factory.createBinary($op, $left.result, $right.result); }
|
left=expression
op=('+' | '-')
right=expression { $result = factory.createBinary($op, $left.result, $right.result); }
|
left=expression op='**' right=expression { $result = factory.createBinary($op, $left.result, $right.result); }
|
term { $result = $term.result; }
;
term returns [TclExpressionNode result]
:
(
'$' var=(IDENTIFIER|INTEGER_LITERAL) { TclExpressionNode assignmentName = factory.createStringLiteral($var, false);
$result = factory.createRead(assignmentName);
}
|
IDENTIFIER { TclExpressionNode assignmentName = factory.createStringLiteral($IDENTIFIER, false); }
(
member_expression[null, null, assignmentName] { $result = $member_expression.result; }
|
{ $result = factory.createIdentifier(assignmentName); }
)
(
command_parameters[$IDENTIFIER, assignmentName] { $result = $command_parameters.result; }
)
|
s='['
exp=expression
e=']' { $result = factory.createParentExpression($exp.result, $s.getStartIndex(), $e.getStopIndex() - $s.getStartIndex() + 1); }
|
word { $result = $word.result; }
)
;
word returns [TclExpressionNode result]
:
(
STRING_LITERAL { $result = factory.createStringLiteral($STRING_LITERAL, true); }
|
INTEGER_LITERAL { $result = factory.createIntegerLiteral($INTEGER_LITERAL); }
|
DOUBLE_LITERAL { $result = factory.createDoubleLiteral($DOUBLE_LITERAL); }
|
BOOLEAN_LITERAL { $result = factory.createBooleanLiteral($BOOLEAN_LITERAL); }
|
IDENTIFIER { $result = factory.createStringLiteral($IDENTIFIER, false); }
)
;
member_expression [TclExpressionNode r, TclExpressionNode assignmentReceiver, TclExpressionNode assignmentName] returns [TclExpressionNode result]
: { TclExpressionNode receiver = r;
TclExpressionNode nestedAssignmentName = null; }
(
'::' { if (receiver == null) {
receiver = factory.createRead(assignmentName);
} }
IDENTIFIER
{ nestedAssignmentName = factory.createStringLiteral($IDENTIFIER, false);
$result = factory.createReadProperty(receiver, nestedAssignmentName); }
(
member_expression[$result, receiver, nestedAssignmentName] { $result = $member_expression.result; }
)?
|
'(' { if (receiver == null) {
receiver = factory.createRead(assignmentName);
} }
expression
{ nestedAssignmentName = $expression.result;
$result = factory.createReadProperty(receiver, nestedAssignmentName); }
')'
)
;
command_parameters [Token start, TclExpressionNode assignmentName] returns [TclExpressionNode result]
: { TclExpressionNode nestedAssignmentName = null; }
{ List<TclExpressionNode> parameters = new ArrayList<>();
Token end = start;
TclExpressionNode receiver = factory.createRead(assignmentName);
}
(
end=expression { parameters.add($expression.result); }
)+
{ $result = factory.createCall(receiver, parameters, end); }
;
// lexer
COMMENT : '#' ~[\r\n]* -> skip ;
WS : [ \t\u000C]+ -> skip;
NL : [\r\n]+;
fragment LETTER : [A-Z] | [a-z] | '_';
fragment NON_ZERO_DIGIT : [1-9];
fragment DIGIT : [0-9];
fragment HEX_DIGIT : [0-9] | [a-f] | [A-F];
fragment OCT_DIGIT : [0-7];
fragment BINARY_DIGIT : '0' | '1';
fragment TAB : '\t';
fragment STRING_CHAR : ~('"' | '\\' | '\r' | '\n');
STRING_LITERAL : '"' STRING_CHAR* '"';
IDENTIFIER : (LETTER+ DIGIT+ | DIGIT+ LETTER+ | LETTER+)+;
INTEGER_LITERAL : DIGIT+ ;
DOUBLE_LITERAL : DIGIT+ '.' DIGIT+ ;
BOOLEAN_LITERAL : 'false' | 'no' | 'n' | 'off' | 'true' | 'yes' | 'y' | 'on';
|
alloy4fun_models/trashltl/models/11/EKxeibsivCiB9s5qT.als | Kaixi26/org.alloytools.alloy | 0 | 3700 | open main
pred idEKxeibsivCiB9s5qT_prop12 {
always all f: File | f in Trash implies always f in Trash
}
pred __repair { idEKxeibsivCiB9s5qT_prop12 }
check __repair { idEKxeibsivCiB9s5qT_prop12 <=> prop12o } |
source/entity/greywolf.asm | evanbowman/Red | 5 | 14109 | ;;; $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
;;;
;;; ASM Source code for Red GBC, by <NAME>, 2021
;;;
;;;
;;; The following licence covers the source code included in this file. The
;;; game's characters and artwork belong to <NAME>, and should not be used
;;; without permission.
;;;
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions are met:
;;;
;;; 1. Redistributions of source code must retain the above copyright notice,
;;; this list of conditions and the following disclaimer.
;;;
;;; 2. Redistributions in binary form must reproduce the above copyright notice,
;;; this list of conditions and the following disclaimer in the documentation
;;; and/or other materials provided with the distribution.
;;;
;;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
;;; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
;;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
;;; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
;;; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
;;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
;;; SUBSTITUTE GOODS OR SERVICES LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
;;; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
;;; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
;;; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
;;; POSSIBILITY OF SUCH DAMAGE.
;;;
;;; $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
GREYWOLF_VAR_COLOR_COUNTER EQU 0
GREYWOLF_VAR_COUNTER EQU 1
GREYWOLF_VAR_STAMINA EQU 2 ; \
GREYWOLF_VAR_STAMINA2 EQU 3 ; | Fixnum
GREYWOLF_VAR_STAMINA3 EQU 4 ; /
GREYWOLF_VAR_SLAB EQU 5
GREYWOLF_VAR_KNOCKBACK EQU 6
GREYWOLF_VAR_KNOCKBACK_DIR EQU 7
GREYWOLF_VAR_REPEAT_STUNS EQU 8
;;; Bytes 9 - 14 currently unused.
GREYWOLF_VAR_MAX EQU 14
;;; Make sure vars fit within available entity slack space.
STATIC_ASSERT((GREYWOLF_VAR_MAX + 1) <= (32 - ENTITY_SIZE))
;;; ----------------------------------------------------------------------------
GreywolfUpdate:
;;; bc - self
LONG_CALL r9_GreywolfUpdateIdleImpl
jp EntityUpdateLoopResume
;;; ----------------------------------------------------------------------------
GreywolfUpdateRunSeekX:
;;; bc - self
LONG_CALL r9_GreywolfUpdateRunXImpl
jp EntityUpdateLoopResume
GreywolfUpdateRunSeekY:
;;; bc - self
LONG_CALL r9_GreywolfUpdateRunYImpl
jp EntityUpdateLoopResume
;;; ----------------------------------------------------------------------------
GreywolfUpdateStunned:
;;; bc - self
LONG_CALL r9_GreywolfUpdateStunnedImpl
jp EntityUpdateLoopResume
;;; ----------------------------------------------------------------------------
GreywolfUpdateAttacking:
;;; bc - self
LONG_CALL r9_GreywolfUpdateAttackingImpl
jp EntityUpdateLoopResume
;;; ----------------------------------------------------------------------------
GreywolfUpdatePause:
;;; bc - self
ld h, b
ld l, c
ld bc, GREYWOLF_VAR_COUNTER
fcall EntityGetSlack
ld a, [bc]
dec a
ld [bc], a
cp 0
jr Z, .idle
jp EntityUpdateLoopResume
.idle:
ld de, GreywolfUpdate
fcall EntitySetUpdateFn
jp EntityUpdateLoopResume
;;; ----------------------------------------------------------------------------
GreywolfUpdateDying:
;;; bc - self
LONG_CALL r9_GreywolfUpdateDyingImpl
jp EntityUpdateLoopResume
;;; ----------------------------------------------------------------------------
GreywolfUpdateDead:
LONG_CALL r9_GreywolfUpdateDeadImpl
jp EntityUpdateLoopResume
;;; ----------------------------------------------------------------------------
|
test/interaction/Issue2751.agda | shlevy/agda | 0 | 13158 | -- Andreas, 2017-10-06, issue #2751
-- Highlighting for unsolved constraints
module _ where
open import Agda.Builtin.Size
module UnsolvedSizeConstraints where
mutual
data D (i : Size) (A : Set) : Set where
c : D′ i A → D i A
record D′ (i : Size) (A : Set) : Set where
inductive
field
size : Size< i
force : D size A
open D′
Map : (F : Set → Set) → Set₁
Map F = {A B : Set} → F A → F B
mutual
map-D : ∀ {i} → Map (D i)
map-D (c xs) = c (map-D′ xs)
map-D′ : ∀ {i} → Map (D′ i)
size (map-D′ {i} t) = foo where postulate foo : {!Size< i!}
force (map-D′ {i} t) = map-D {i = i} (force t) -- correct is i = foo
-- Produces an unsolved size constraint.
-- Problem WAS: no highlighting for unsolved constraints.
-- Now: yellow highlighting in last rhs.
-- Test also highlighting for unsolved level constraints:
module UnsolvedLevelConstraints where
mutual
l = _
data D {a} (A : Set a) : Set l where
c : A → D A -- highlighted
data E (A : Set l) : Set1 where
c : A → E A -- highlighted
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.