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/100/A100186.asm
karttu/loda
0
173080
<reponame>karttu/loda ; A100186: Structured heptagonal anti-diamond numbers (vertex structure 7). ; 1,16,67,176,365,656,1071,1632,2361,3280,4411,5776,7397,9296,11495,14016,16881,20112,23731,27760,32221,37136,42527,48416,54825,61776,69291,77392,86101,95440,105431,116096,127457,139536,152355,165936,180301,195472,211471,228320,246041,264656,284187,304656,326085,348496,371911,396352,421841,448400,476051,504816,534717,565776,598015,631456,666121,702032,739211,777680,817461,858576,901047,944896,990145,1036816,1084931,1134512,1185581,1238160,1292271,1347936,1405177,1464016,1524475,1586576,1650341,1715792,1782951,1851840,1922481,1994896,2069107,2145136,2223005,2302736,2384351,2467872,2553321,2640720,2730091,2821456,2914837,3010256,3107735,3207296,3308961,3412752,3518691,3626800,3737101,3849616,3964367,4081376,4200665,4322256,4446171,4572432,4701061,4832080,4965511,5101376,5239697,5380496,5523795,5669616,5817981,5968912,6122431,6278560,6437321,6598736,6762827,6929616,7099125,7271376,7446391,7624192,7804801,7988240,8174531,8363696,8555757,8750736,8948655,9149536,9353401,9560272,9770171,9983120,10199141,10418256,10640487,10865856,11094385,11326096,11561011,11799152,12040541,12285200,12533151,12784416,13039017,13296976,13558315,13823056,14091221,14362832,14637911,14916480,15198561,15484176,15773347,16066096,16362445,16662416,16966031,17273312,17584281,17898960,18217371,18539536,18865477,19195216,19528775,19866176,20207441,20552592,20901651,21254640,21611581,21972496,22337407,22706336,23079305,23456336,23837451,24222672,24612021,25005520,25403191,25805056,26211137,26621456,27036035,27454896,27878061,28305552,28737391,29173600,29614201,30059216,30508667,30962576,31420965,31883856,32351271,32823232,33299761,33780880,34266611,34756976,35251997,35751696,36256095,36765216,37279081,37797712,38321131,38849360,39382421,39920336,40463127,41010816,41563425,42120976,42683491,43250992,43823501,44401040,44983631,45571296,46164057,46761936,47364955,47973136,48586501,49205072,49828871,50457920,51092241,51731856,52376787,53027056,53682685,54343696,55010111,55681952,56359241,57042000 mov $5,$0 mul $0,2 mov $1,$0 mov $6,$0 lpb $0,1 trn $2,5 add $3,$0 sub $0,2 add $1,3 add $4,$3 add $4,$6 add $1,$4 add $2,$4 add $1,$2 mov $2,4 sub $3,$3 add $4,3 add $6,1 lpe add $1,5 lpb $5,1 add $1,2 sub $5,1 lpe sub $1,4
programs/oeis/101/A101909.asm
neoneye/loda
22
163466
; A101909: Number of primes between 2n and 4n. ; 1,2,2,2,4,4,3,5,4,4,6,6,6,7,7,7,8,9,9,10,10,9,10,9,10,12,12,13,14,13,12,13,14,13,15,14,13,15,15,15,16,16,16,17,17,18,18,19,19,21,20,19,20,19,18,19,19,20,21,22,23,23,24,23,24,24,24,26,25,25,27,27,27,28,27,26,27,28,28,29,29,28,29,28,29,29,29,30,31,31,30,31,31,32,33,33,32,33,32,32 mul $0,2 add $0,1 seq $0,60715 ; Number of primes between n and 2n exclusive.
data/pokemon/base_stats/turban.asm
AtmaBuster/pokeplat-gen2
6
242533
db 0 ; species ID placeholder db 80, 90, 150, 30, 80, 65 ; hp atk def spd sat sdf db WATER, POISON ; type db 60 ; catch rate db 203 ; base exp db NO_ITEM, NO_ITEM ; items db GENDER_F50 ; gender ratio db 20 ; step cycles to hatch INCBIN "gfx/pokemon/turban/front.dimensions" db GROWTH_SLOW ; growth rate dn EGG_WATER_3, EGG_WATER_3 ; egg groups db 70 ; happiness ; tm/hm learnset tmhm ; end
programs/oeis/235/A235702.asm
neoneye/loda
22
242052
; A235702: Fixed points of A001175 (Pisano periods). ; 1,24,120,600,3000,15000,75000,375000,1875000,9375000,46875000,234375000,1171875000,5859375000,29296875000,146484375000,732421875000,3662109375000,18310546875000,91552734375000,457763671875000,2288818359375000,11444091796875000 mov $1,1 mov $2,5 lpb $0 sub $0,1 add $1,$2 mov $2,$1 mul $1,4 lpe mov $0,$1
Cubical/Structures/Group.agda
borsiemir/cubical
0
7637
{-# OPTIONS --cubical --safe #-} module Cubical.Structures.Group where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Equiv open import Cubical.Foundations.Isomorphism open import Cubical.Foundations.HLevels open import Cubical.Foundations.FunExtEquiv open import Cubical.Data.Prod.Base hiding (_×_) renaming (_×Σ_ to _×_) open import Cubical.Foundations.SIP renaming (SNS-PathP to SNS) open import Cubical.Structures.Monoid private variable ℓ ℓ' : Level group-axiom : (X : Type ℓ) → monoid-structure X → Type ℓ group-axiom G ((e , _·_) , _) = ((x : G) → Σ G (λ x' → (x · x' ≡ e) × (x' · x ≡ e))) group-structure : Type ℓ → Type ℓ group-structure = add-to-structure (monoid-structure) group-axiom Groups : Type (ℓ-suc ℓ) Groups {ℓ} = TypeWithStr ℓ group-structure -- Extracting components of a group ⟨_⟩ : Groups {ℓ} → Type ℓ ⟨ (G , _) ⟩ = G id : (G : Groups {ℓ}) → ⟨ G ⟩ id (_ , ((e , _) , _) , _) = e group-operation : (G : Groups {ℓ}) → ⟨ G ⟩ → ⟨ G ⟩ → ⟨ G ⟩ group-operation (_ , ((_ , f) , _) , _) = f infixl 20 group-operation syntax group-operation G x y = x ·⟨ G ⟩ y group-is-set : (G : Groups {ℓ}) → isSet ⟨ G ⟩ group-is-set (_ , (_ , (P , _)) , _) = P group-assoc : (G : Groups {ℓ}) → (x y z : ⟨ G ⟩) → (x ·⟨ G ⟩ (y ·⟨ G ⟩ z)) ≡ ((x ·⟨ G ⟩ y) ·⟨ G ⟩ z) group-assoc (_ , (_ , (_ , P , _)) , _) = P group-runit : (G : Groups {ℓ}) → (x : ⟨ G ⟩) → x ·⟨ G ⟩ (id G) ≡ x group-runit (_ , (_ , (_ , _ , P , _)) , _) = P group-lunit : (G : Groups {ℓ}) → (x : ⟨ G ⟩) → (id G) ·⟨ G ⟩ x ≡ x group-lunit (_ , (_ , (_ , _ , _ , P)) , _) = P group-Σinv : (G : Groups {ℓ}) → (x : ⟨ G ⟩) → Σ (⟨ G ⟩) (λ x' → (x ·⟨ G ⟩ x' ≡ (id G)) × (x' ·⟨ G ⟩ x ≡ (id G))) group-Σinv (_ , _ , P) = P -- Defining the inverse function inv : (G : Groups {ℓ}) → ⟨ G ⟩ → ⟨ G ⟩ inv (_ , _ , P) x = fst (P x) group-rinv : (G : Groups {ℓ}) → (x : ⟨ G ⟩) → x ·⟨ G ⟩ (inv G x) ≡ id G group-rinv (_ , _ , P) x = fst (snd (P x)) group-linv : (G : Groups {ℓ}) → (x : ⟨ G ⟩) → (inv G x) ·⟨ G ⟩ x ≡ id G group-linv (_ , _ , P) x = snd (snd (P x)) -- Iso for groups are those for monoids group-iso : StrIso group-structure ℓ group-iso = add-to-iso monoid-structure monoid-iso group-axiom -- Auxiliary lemmas for subtypes (taken from Escardo) to-Σ-≡ : {X : Type ℓ} {A : X → Type ℓ'} {σ τ : Σ X A} → (Σ (fst σ ≡ fst τ) λ p → PathP (λ i → A (p i)) (snd σ) (snd τ)) → σ ≡ τ to-Σ-≡ (eq , p) = λ i → eq i , p i to-subtype-≡ : {X : Type ℓ} {A : X → Type ℓ'} {x y : X} {a : A x} {b : A y} → ((x : X) → isProp (A x)) → x ≡ y → Path (Σ X (λ x → A x)) (x , a) (y , b) to-subtype-≡ {x = x} {y} {a} {b} f eq = to-Σ-≡ (eq , toPathP (f y _ b)) -- TODO: this proof without toPathP? -- Group axiom isProp group-axiom-isProp : (X : Type ℓ) → (s : monoid-structure X) → isProp (group-axiom X s) group-axiom-isProp X (((e , _·_) , s@(isSet , assoc , rid , lid))) = isPropPi γ where γ : (x : X) → isProp (Σ X (λ x' → (x · x' ≡ e) × (x' · x ≡ e))) γ x (y , a , q) (z , p , b) = to-subtype-≡ u t where t : y ≡ z t = inv-lemma X e _·_ s x y z q p u : (x' : X) → isProp ((x · x' ≡ e) × (x' · x ≡ e)) u x' = isPropΣ (isSet _ _) (λ _ → isSet _ _) -- Group paths equivalent to equality group-is-SNS : SNS {ℓ} group-structure group-iso group-is-SNS = add-axioms-SNS monoid-structure monoid-iso group-axiom group-axiom-isProp monoid-is-SNS GroupPath : (M N : Groups {ℓ}) → (M ≃[ group-iso ] N) ≃ (M ≡ N) GroupPath M N = SIP group-structure group-iso group-is-SNS M N -- Trying to improve isomorphisms to only have to preserve -- _·_ group-iso' : StrIso group-structure ℓ group-iso' G S f = (x y : ⟨ G ⟩) → equivFun f (x ·⟨ G ⟩ y) ≡ equivFun f x ·⟨ S ⟩ equivFun f y -- Trying to reduce isomorphisms to simpler ones -- First we prove that both notions of group-iso are equal -- since both are props and there is are functions from -- one to the other -- Functions group-iso→group-iso' : (G S : Groups {ℓ}) (f : ⟨ G ⟩ ≃ ⟨ S ⟩) → group-iso G S f → group-iso' G S f group-iso→group-iso' G S f γ = snd γ group-iso'→group-iso : (G S : Groups {ℓ}) (f : ⟨ G ⟩ ≃ ⟨ S ⟩) → group-iso' G S f → group-iso G S f group-iso'→group-iso G S f γ = η , γ where g : ⟨ G ⟩ → ⟨ S ⟩ g = equivFun f e : ⟨ G ⟩ e = id G d : ⟨ S ⟩ d = id S δ : g e ≡ g e ·⟨ S ⟩ g e δ = g e ≡⟨ cong g (sym (group-lunit G _)) ⟩ g (e ·⟨ G ⟩ e) ≡⟨ γ e e ⟩ g e ·⟨ S ⟩ g e ∎ η : g e ≡ d η = g e ≡⟨ sym (group-runit S _) ⟩ g e ·⟨ S ⟩ d ≡⟨ cong (λ - → g e ·⟨ S ⟩ -) (sym (group-rinv S _)) ⟩ g e ·⟨ S ⟩ (g e ·⟨ S ⟩ (inv S (g e))) ≡⟨ group-assoc S _ _ _ ⟩ (g e ·⟨ S ⟩ g e) ·⟨ S ⟩ (inv S (g e)) ≡⟨ cong (λ - → group-operation S - (inv S (g e))) (sym δ) ⟩ g e ·⟨ S ⟩ (inv S (g e)) ≡⟨ group-rinv S _ ⟩ d ∎ -- Both are Props isProp-Iso : (G S : Groups {ℓ}) (f : ⟨ G ⟩ ≃ ⟨ S ⟩) → isProp (group-iso G S f) isProp-Iso G S f = isPropΣ (group-is-set S _ _) (λ _ → isPropPi (λ x → isPropPi λ y → group-is-set S _ _)) isProp-Iso' : (G S : Groups {ℓ}) (f : ⟨ G ⟩ ≃ ⟨ S ⟩) → isProp (group-iso' G S f) isProp-Iso' G S f = isPropPi (λ x → isPropPi λ y → group-is-set S _ _) -- Propositional equality to-Prop-≡ : {X Y : Type ℓ} (f : X → Y) (g : Y → X) → isProp X → isProp Y → X ≡ Y to-Prop-≡ {ℓ} {X} {Y} f g p q = isoToPath (iso f g aux₂ aux₁) where aux₁ : (x : X) → g (f x) ≡ x aux₁ x = p _ _ aux₂ : (y : Y) → f (g y) ≡ y aux₂ y = q _ _ -- Finally both are equal group-iso'≡group-iso : group-iso' {ℓ} ≡ group-iso group-iso'≡group-iso = funExt₃ γ where γ : ∀ (G S : Groups {ℓ}) (f : ⟨ G ⟩ ≃ ⟨ S ⟩) → group-iso' G S f ≡ group-iso G S f γ G S f = to-Prop-≡ (group-iso'→group-iso G S f) (group-iso→group-iso' G S f) (isProp-Iso' G S f) (isProp-Iso G S f) -- And Finally we have what we wanted group-is-SNS' : SNS {ℓ} group-structure group-iso' group-is-SNS' = transport γ group-is-SNS where γ : SNS {ℓ} group-structure group-iso ≡ SNS {ℓ} group-structure group-iso' γ = cong (SNS group-structure) (sym group-iso'≡group-iso) GroupPath' : (M N : Groups {ℓ}) → (M ≃[ group-iso' ] N) ≃ (M ≡ N) GroupPath' M N = SIP group-structure group-iso' group-is-SNS' M N --------------------------------------------------------------------- -- Abelians group (just add one axiom and prove that it is a hProp) --------------------------------------------------------------------- abelian-group-axiom : (X : Type ℓ) → group-structure X → Type ℓ abelian-group-axiom G (((_ , _·_), _), _) = (x y : G) → x · y ≡ y · x abelian-group-structure : Type ℓ → Type ℓ abelian-group-structure = add-to-structure (group-structure) abelian-group-axiom AbGroups : Type (ℓ-suc ℓ) AbGroups {ℓ} = TypeWithStr ℓ abelian-group-structure abelian-group-iso : StrIso abelian-group-structure ℓ abelian-group-iso = add-to-iso group-structure group-iso abelian-group-axiom abelian-group-axiom-isProp : (X : Type ℓ) → (s : group-structure X) → isProp (abelian-group-axiom X s) abelian-group-axiom-isProp X ((_ , (group-isSet , _)) , _) = isPropPi (λ x → isPropPi λ y → group-isSet _ _) abelian-group-is-SNS : SNS {ℓ} abelian-group-structure abelian-group-iso abelian-group-is-SNS = add-axioms-SNS group-structure group-iso abelian-group-axiom abelian-group-axiom-isProp group-is-SNS AbGroupPath : (M N : AbGroups {ℓ}) → (M ≃[ abelian-group-iso ] N) ≃ (M ≡ N) AbGroupPath M N = SIP abelian-group-structure abelian-group-iso abelian-group-is-SNS M N
adium/ASUnitTests/DeleteAccount.applescript
sin-ivan/AdiumPipeEvent
0
4209
global HandyAdiumScripts on run tell application "Adium" set newAccount to HandyAdiumScripts's makeTemporaryAccount() set c to count accounts delete newAccount if (count accounts) is not c - 1 then --it's possible that something bad happened --because I couldn't delete the account I created --however, there's nothing I can do about it. I'll --print a message to the user, though. do script "echo 'It is possible that an extra temporary account has been created by running this unit test. Please delete the account " & (get the name of newAccount) & " and fix the account creation or deletion code." error end end tell end run
programs/oeis/081/A081186.asm
karttu/loda
1
21940
<reponame>karttu/loda<gh_stars>1-10 ; A081186: 4th binomial transform of (1,0,1,0,1,...), A059841. ; 1,4,17,76,353,1684,8177,40156,198593,986404,4912337,24502636,122336033,611148724,3054149297,15265963516,76315468673,381534296644,1907542343057,9537324294796,47685459212513,238423809278164,1192108586037617,5960511549128476 mov $1,3 pow $1,$0 mov $2,5 pow $2,$0 add $1,$2 sub $1,2 div $1,2 add $1,1
tests/disasm/relative_jump.asm
arpruss/z80
46
21403
ld (hl), 0x2 ; @@ 0x11dc 36 02 .instr dec hl ; @@ 0x11de 2b cp h ; @@ 0x11df bc jr nz, 0x11dc ; @@ 0x11e0 20 fa
oeis/102/A102546.asm
neoneye/loda-programs
11
4848
; A102546: Numbers t such that t1 is prime and t is a multiple of 10. ; Submitted by <NAME> ; 10,40,60,70,120,130,160,180,190,280,300,330,370,400,420,480,510,550,570,580,610,630,670,700,790,810,850,900,960,990,1030,1050,1060,1170,1180,1210,1230,1240,1260,1300,1390,1440,1510,1540,1560,1590,1600,1630,1690,1740,1830,1840,1870,1900,1930,1950,1980,2010,2020,2100,2110,2140,2160,2170,2250,2290,2320,2380,2400,2530,2560,2580,2650,2670,2680,2770,2790,2800,2820,2890,2910,2920,2940,2950,3160,3240,3280,3330,3360,3430,3450,3520,3540,3580,3690,3720,3750,3820,3850,3930 mov $2,$0 add $2,2 pow $2,2 lpb $2 mov $3,$1 add $1,26 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 add $1,74 mov $4,$0 max $4,0 cmp $4,$0 mul $2,$4 sub $2,1 lpe mov $0,$1 div $0,100 mul $0,10
programs/oeis/130/A130485.asm
neoneye/loda
22
27760
<reponame>neoneye/loda ; A130485: a(n) = Sum_{k=0..n} (k mod 7) (Partial sums of A010876). ; 0,1,3,6,10,15,21,21,22,24,27,31,36,42,42,43,45,48,52,57,63,63,64,66,69,73,78,84,84,85,87,90,94,99,105,105,106,108,111,115,120,126,126,127,129,132,136,141,147,147,148,150,153,157,162,168,168,169,171,174,178,183,189,189,190,192,195,199,204,210,210,211,213,216,220,225,231,231,232,234,237,241,246,252,252,253,255,258,262,267,273,273,274,276,279,283,288,294,294,295 lpb $0 mov $2,$0 sub $0,1 mod $2,7 add $1,$2 lpe mov $0,$1
Driver/Video/Dumb/VidMem/Clr8/clr8Dither.asm
steakknife/pcgeos
504
166130
<gh_stars>100-1000 COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) GeoWorks 1991 -- All Rights Reserved PROJECT: PC GEOS MODULE: Video Drivers FILE: clr8Dither.asm AUTHOR: <NAME>, Oct 22, 1992 ROUTINES: Name Description ---- ----------- REVISION HISTORY: Name Date Description ---- ---- ----------- Jim 10/22/92 Initial revision DESCRIPTION: Dither tables for 8-bit driver $Id: clr8Dither.asm,v 1.1 97/04/18 11:42:59 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ; the RGB cube that is part of the standard palette ; is a 6x6x6 cube. This table is basically ; output = floor(input/(255/5)) ditherBase label byte byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 byte 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01 byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02 byte 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 byte 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 byte 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 byte 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 byte 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 byte 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02 byte 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 byte 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 byte 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 byte 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 byte 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 byte 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 byte 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04 byte 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 byte 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 byte 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 byte 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 byte 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04 byte 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05 ; this is a companion table to the one above. While ; ditherBase gives the floor (base) value, this gives ; the remainder (modulo) value. It is basically: ; output = input - floor(input/(255/5)) ditherMod label byte byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 byte 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f byte 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 byte 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f byte 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27 byte 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f byte 0x30, 0x31, 0x32, 0x00, 0x01, 0x02, 0x03, 0x04 byte 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c byte 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14 byte 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c byte 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24 byte 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c byte 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x00, 0x01 byte 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09 byte 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11 byte 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19 byte 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21 byte 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29 byte 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31 byte 0x32, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 byte 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e byte 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16 byte 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e byte 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26 byte 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e byte 0x2f, 0x30, 0x31, 0x32, 0x00, 0x01, 0x02, 0x03 byte 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b byte 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13 byte 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b byte 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23 byte 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b byte 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x00 ; When you lay out a 6x6x6 cube in a linear array, you ; have to choose which ones to fix first. The values ; in this table reflect that organization. The mapping ; from RGB value to index goes like this: ; index = (ditherRed[ditherBase[R]] + ditherGreen[ditherBase[G] ; + ditherBlue[ditherBase[B]]) ditherRed label byte byte 0, 36, 72, 108, 144, 180 ditherGreen label byte byte 0, 6, 12, 18, 24, 30 ditherBlue label byte byte 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d ; We are implementing a 4x4 matrix for dithering purposes. ; The ditherCutoff table takes the output of the ditherMod ; table and the (x,y) position of the pixel to determine ; the 16 indices that inhabit the dither matrix. So, instead ; of a single equation for the index (as shown above), we ; actually have 16 separate equations, one for each spot in ; the ditherMatrix. ditherCutoff label byte byte 0x00, 0x1a, 0x06, 0x20 byte 0x27, 0x0d, 0x2d, 0x13 byte 0x09, 0x23, 0x03, 0x1d byte 0x30, 0x16, 0x2a, 0x10
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/a-dhfina.ads
djamal2727/Main-Bearing-Analytical-Model
0
28651
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- ADA.DIRECTORIES.HIERARCHICAL_FILE_NAMES -- -- -- -- S p e c -- -- -- -- Copyright (C) 2004-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. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- In particular, you can freely distribute your programs built with the -- -- GNAT Pro compiler, including any required library run-time units, using -- -- any licensing terms of your choosing. See the AdaCore Software License -- -- for full details. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ package Ada.Directories.Hierarchical_File_Names is function Is_Simple_Name (Name : String) return Boolean; -- Returns True if Name is a simple name, and returns False otherwise. function Is_Root_Directory_Name (Name : String) return Boolean; -- Returns True if Name is syntactically a root (a directory that cannot -- be decomposed further), and returns False otherwise. function Is_Parent_Directory_Name (Name : String) return Boolean; -- Returns True if Name can be used to indicate symbolically the parent -- directory of any directory, and returns False otherwise. function Is_Current_Directory_Name (Name : String) return Boolean; -- Returns True if Name can be used to indicate symbolically the directory -- itself for any directory, and returns False otherwise. function Is_Full_Name (Name : String) return Boolean; -- Returns True if the leftmost directory part of Name is a root, and -- returns False otherwise. function Is_Relative_Name (Name : String) return Boolean; -- Returns True if Name allows the identification of an external file -- (including directories and special files) but is not a full name, and -- returns False otherwise. function Simple_Name (Name : String) return String renames Ada.Directories.Simple_Name; -- Returns the simple name portion of the file name specified by Name. The -- exception Name_Error is propagated if the string given as Name does not -- allow the identification of an external file (including directories and -- special files). function Containing_Directory (Name : String) return String renames Ada.Directories.Containing_Directory; -- Returns the name of the containing directory of the external file -- (including directories) identified by Name. If more than one directory -- can contain Name, the directory name returned is implementation-defined. -- The exception Name_Error is propagated if the string given as Name does -- not allow the identification of an external file. The exception -- Use_Error is propagated if the external file does not have a containing -- directory. function Initial_Directory (Name : String) return String; -- Returns the leftmost directory part in Name. That is, it returns a root -- directory name (for a full name), or one of a parent directory name, a -- current directory name, or a simple name (for a relative name). The -- exception Name_Error is propagated if the string given as Name does not -- allow the identification of an external file (including directories and -- special files). function Relative_Name (Name : String) return String; -- Returns the entire file name except the Initial_Directory portion. The -- exception Name_Error is propagated if the string given as Name does not -- allow the identification of an external file (including directories and -- special files), or if Name has a single part (this includes if any of -- Is_Simple_Name, Is_Root_Directory_Name, Is_Parent_Directory_Name, or -- Is_Current_Directory_Name are True). function Compose (Directory : String := ""; Relative_Name : String; Extension : String := "") return String; -- Returns the name of the external file with the specified Directory, -- Relative_Name, and Extension. The exception Name_Error is propagated if -- the string given as Directory is not the null string and does not allow -- the identification of a directory, or if Is_Relative_Name -- (Relative_Name) is False, or if the string given as Extension is not -- the null string and is not a possible extension, or if Extension is not -- the null string and Simple_Name (Relative_Name) is not a base name. -- -- The result of Compose is a full name if Is_Full_Name (Directory) is -- True; result is a relative name otherwise. end Ada.Directories.Hierarchical_File_Names;
programs/oeis/004/A004277.asm
karttu/loda
1
5113
<filename>programs/oeis/004/A004277.asm ; A004277: 1 together with positive even numbers. ; 1,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132 pow $1,$0 add $1,$0 add $1,$0
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/elim1.ads
best08618/asylo
7
6662
pragma Eliminate (p, d); package elim1 is type t is tagged null record; procedure d (a : t); end;
oeis/021/A021613.asm
neoneye/loda-programs
11
2095
; A021613: Decimal expansion of 1/609. ; Submitted by <NAME>iga ; 0,0,1,6,4,2,0,3,6,1,2,4,7,9,4,7,4,5,4,8,4,4,0,0,6,5,6,8,1,4,4,4,9,9,1,7,8,9,8,1,9,3,7,6,0,2,6,2,7,2,5,7,7,9,9,6,7,1,5,9,2,7,7,5,0,4,1,0,5,0,9,0,3,1,1,9,8,6,8,6,3,7,1,1,0,0,1,6,4,2,0,3,6,1,2,4,7,9,4 add $0,1 mov $2,10 pow $2,$0 div $2,609 mov $0,$2 mod $0,10
Altair101/asm/programs/opSphl.asm
tigerfarm/arduino
2
103130
<reponame>tigerfarm/arduino<gh_stars>1-10 ; -------------------------------------- ; Test SPHL. ; ; SPHL SP=HL ... Set SP to same value as H:L ; ; -------------------------------------- lxi sp,512 ; Set stack pointer which is used with CALL and RET. Start: call Initialize ; -------------------------------------- ; + Store SP to memory and retrieve SP from memory . call NewTest mvi h,2 ; Set address register pair H:L. mvi l,6 out 36 ; Print the register values for H:L. lxi sp,128 ; Set stack pointer to a test value. out 45 ; Print the SP register address. sphl ; Set SP to the same address value as H:L. out 45 ; Print the SP register address. ; -------------------------------------- lxi sp,512 ; Set stack pointer which is used with CALL and RET. call NewTest lxi sp,518 ; Set stack pointer to test value. ; shld byteL ; Given byteL address(hb:lb), ; Store register L to memory location of byteL (byteL address). ; Store register H to memory location of byteL + 1 (byteH address). ; -------------------------------------- call println hlt jmp Start ; ------------------------------------------ ; Subroutines ; ; ------------------- InitializeStr db '\r\n++ Initialize setting.' Initialize: lxi h,InitializeStr call PrintStr mvi a,0 ; Initialize the test counter. sta testCounter ret ; ------------------- SeparatorStr db '\r\n---' Separator: push h lxi h,SeparatorStr call PrintStr pop h ret ; ------------------- NewTestA ds 1 TestStr db '\r\n++ ' testCounter db 0 ; Initialize test counter. NewTest: push h sta NewTestA sta PrintDigitA ; Retain register A value. lxi h,TestStr call PrintStr lda testCounter ; Increment and print the counter inr a sta testCounter call PrintDigit mvi a,':' out 3 mvi a,' ' out 3 lda NewTestA pop h ret ; ------------------- PrintDigitA db 0 ; A variable for storing register A's value. PrintDigit: ; Print the digit (0-9) in register A. sta PrintDigitA ; Retain register A value. mvi b,'0' add b out 3 lda PrintDigitA ; Restore register A value. ret ; ------------------- ; Routines to print a DB strings. ; PrintStrA ds 1 STRTERM equ 0ffh ; String terminator. ASM appends 0ffh at the end of db strings. PrintStr: sta PrintStrA ; Retain register A value. PrintStrContinue: mov a,m ; Move the data from H:L address to register A. (HL) -> A. cpi STRTERM ; Compare to see if it's the string terminate byte. jz PrintStrDone out 3 ; Out register A to the serial terminal port. inx h ; Increment H:L register pair. jmp PrintStrContinue PrintStrDone: lda PrintStrA ; Restore register A value. ret ; println: mvi a,'\r' out 3 mvi a,'\n' out 3 ret ; -------------------------------------- ; Variables byteL ds 1 byteH ds 1 ; -------------------------------------- end ; -------------------------------------- ; Successful run: ; + Download complete. + r, RUN. + runProcessor() ++ Initialize setting. ++ 1: > Register H:L = 2: 6 = 00000010:00000110, Data: 0 = 000 = 00000000 > Register SP = 128 = 00000000:10000000 > Register SP = 518 = 00000010:00000110 ++ 2: ++ HALT, host_read_status_led_WAIT() = 0 ; -------------------------------------- ; --------------------------------------
source/action_algorithms.ads
jquorning/CELLE
0
26843
-- -- -- with Sessions; with Actions; package Action_Algorithms is subtype Session_Type is Sessions.Session_Type; subtype Action_Record is Actions.Action_Record; function Compute_Action (Session : Session_Type; Action : Action_Record) return Integer; -- Given an action, compute the integer value for that action -- which is to be put in the action table of the generated machine. -- Return negative if no action should be generated. end Action_Algorithms;
programs/oeis/001/A001105.asm
karttu/loda
1
3670
; A001105: a(n) = 2*n^2. ; 0,2,8,18,32,50,72,98,128,162,200,242,288,338,392,450,512,578,648,722,800,882,968,1058,1152,1250,1352,1458,1568,1682,1800,1922,2048,2178,2312,2450,2592,2738,2888,3042,3200,3362,3528,3698,3872,4050,4232,4418,4608,4802,5000,5202,5408,5618,5832,6050,6272,6498,6728,6962,7200,7442,7688,7938,8192,8450,8712,8978,9248,9522,9800,10082,10368,10658,10952,11250,11552,11858,12168,12482,12800,13122,13448,13778,14112,14450,14792,15138,15488,15842,16200,16562,16928,17298,17672,18050,18432,18818,19208,19602,20000,20402,20808,21218,21632,22050,22472,22898,23328,23762,24200,24642,25088,25538,25992,26450,26912,27378,27848,28322,28800,29282,29768,30258,30752,31250,31752,32258,32768,33282,33800,34322,34848,35378,35912,36450,36992,37538,38088,38642,39200,39762,40328,40898,41472,42050,42632,43218,43808,44402,45000,45602,46208,46818,47432,48050,48672,49298,49928,50562,51200,51842,52488,53138,53792,54450,55112,55778,56448,57122,57800,58482,59168,59858,60552,61250,61952,62658,63368,64082,64800,65522,66248,66978,67712,68450,69192,69938,70688,71442,72200,72962,73728,74498,75272,76050,76832,77618,78408,79202,80000,80802,81608,82418,83232,84050,84872,85698,86528,87362,88200,89042,89888,90738,91592,92450,93312,94178,95048,95922,96800,97682,98568,99458,100352,101250,102152,103058,103968,104882,105800,106722,107648,108578,109512,110450,111392,112338,113288,114242,115200,116162,117128,118098,119072,120050,121032,122018,123008,124002 mov $1,$0 pow $1,2 mul $1,2
programs/oeis/106/A106805.asm
karttu/loda
0
178796
<gh_stars>0 ; A106805: G.f.: 1 / (1-2*x-x^2+x^3). ; 1,2,5,11,25,56,126,283,636,1429,3211,7215,16212,36428,81853,183922,413269,928607,2086561,4688460,10534874,23671647,53189708,119516189,268550439,603427359,1355888968,3046654856,6845771321,15382308530,34563733525,77664004259 add $0,2 mov $2,1 lpb $0,1 sub $0,1 add $1,$4 mov $3,$2 add $4,$1 add $2,$4 mov $4,$3 lpe
programs/oeis/159/A159955.asm
karttu/loda
1
175299
<reponame>karttu/loda<gh_stars>1-10 ; A159955: Period 9: repeat [0, 1, 2, 1, 2, 0, 2, 0, 1]. ; 0,1,2,1,2,0,2,0,1,0,1,2,1,2,0,2,0,1,0,1,2,1,2,0,2,0,1,0,1,2,1,2,0,2,0,1,0,1,2,1,2,0,2,0,1,0,1,2,1,2,0,2,0,1,0,1,2,1,2,0,2,0,1,0,1,2,1,2,0,2,0,1,0,1,2,1,2,0,2,0,1,0,1,2,1,2,0,2,0,1,0,1,2,1,2,0,2,0,1 mov $1,$0 mul $1,4 div $1,3 mod $1,3
extern/game_support/src/backends/opengl_sdl_gnat_sdl/display-basic.adb
AdaCore/training_material
15
14353
<reponame>AdaCore/training_material ----------------------------------------------------------------------- -- Ada Labs -- -- -- -- Copyright (C) 2008-2013, AdaCore -- -- -- -- Labs 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 2 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, write to the Free Software Foundation, Inc., 59 Temple -- -- Place - Suite 330, Boston, MA 02111-1307, USA. -- ----------------------------------------------------------------------- with Display.Kernel; use Display.Kernel; with GL_gl_h; use GL_gl_h; with Display.Basic.Fonts; use Display.Basic.Fonts; with Display.Basic.Utils; use Display.Basic.Utils; with Interfaces.C; use Interfaces.C; with SDL_SDL_events_h; use SDL_SDL_events_h; with SDL_SDL_video_h; use SDL_SDL_video_h; with Display.Basic.GLFonts; use Display.Basic.GLFonts; package body Display.Basic is function Is_Killed return Boolean is begin return Is_Stopped; end Is_Killed; -- procedure Poll_Events is -- E : aliased SDL_Event; -- begin -- while SDL_PollEvent (E'Access) /= 0 loop -- case unsigned (E.c_type) is -- when SDL_SDL_events_h.SDL_Quit => -- Killed := True; -- SDL_SDL_h.SDL_Quit; -- when SDL_SDL_events_h.SDL_MOUSEBUTTONDOWN => -- Internal_Cursor.Position := (Integer(E.motion.x), Integer(E.motion.y)); -- Internal_Cursor.Pressed := True; -- when SDL_SDL_events_h.SDL_MOUSEBUTTONUP => -- Internal_Cursor.Position := (Integer(E.motion.x), Integer(E.motion.y)); -- Internal_Cursor.Pressed := False; -- -- when others => -- null; -- end case; -- end loop; -- end Poll_Events; -- -- function At_End return Boolean is -- begin -- return Display.Kernel.At_End; -- end At_End; ---------- -- Draw -- ---------- type Windows_Array is array (Window_ID) of OpenGL_Surface; Nb_Windows : Integer := 0; Stored_Windows : Windows_Array; function Create_Window (Width : Integer; Height : Integer; Name : String) return Window_ID is Current_Id : Window_ID; begin if Nb_Windows = Windows_Array'Length then raise Too_Many_Windows; end if; Current_Id := Window_ID (Integer (Window_ID'First) + Nb_Windows); Stored_Windows(Current_Id) := Display.Kernel.Create_Window (Width, Height, Name); Nb_Windows := Nb_Windows + 1; return Current_Id; end Create_Window; procedure Swap_Buffers(Window : Window_ID; Erase : Boolean := True) is begin Display.Kernel.Swap_Buffers(Stored_Windows(Window)); end Swap_Buffers; procedure Swap_Copy_Buffers(Window : Window_ID) is begin -- to be implemented properly Display.Kernel.Swap_Buffers(Stored_Windows(Window)); end Swap_Copy_Buffers; function Get_Zoom_Factor(Canvas : Canvas_ID) return Float is begin return Get_Internal_Canvas(Canvas).Zoom_Factor; end Get_Zoom_Factor; procedure Set_Zoom_Factor (Canvas : Canvas_ID; ZF : Float) is C : T_Internal_Canvas := Get_Internal_Canvas(Canvas); begin Display.Basic.Utils.Set_Zoom_Factor(Canvas, ZF); UpdateProjection(Canvas); end Set_Zoom_Factor; function Get_Canvas(Window : Window_ID) return Canvas_ID is begin return Stored_Windows(Window).Canvas; end Get_Canvas; procedure Set_Color(Color : RGBA_T) is begin glColor3d (double(Color.R) / 255.0, double(Color.G) / 255.0, double(Color.B) / 255.0); end Set_Color; procedure Fill(Canvas : Canvas_ID; Color: RGBA_T) is begin raise Display_Error; end Fill; procedure Draw_Sphere (Canvas : Canvas_ID; Position : Point_3d; Radius : Float; Color: RGBA_T) is IC : T_Internal_Canvas := Get_Internal_Canvas (Canvas); begin glPushMatrix; glTranslated (GLdouble (Position.X - (Float(IC.Center.X) * (1.0/IC.Zoom_Factor))), GLdouble (Position.Y - (Float(IC.Center.Y) * (1.0/IC.Zoom_Factor))), GLdouble (Position.Z)); Set_Color (Color); if Radius < 0.1 then Disable_3d_Light(Canvas_ID'First); glBegin(GL_POINTS); glVertex2i(0, 0); glEnd; Enable_3d_Light(Canvas_ID'First); else Display.Kernel.Draw_Sphere(Radius, Color); end if; glPopMatrix; end Draw_Sphere; procedure Draw_Sphere (Canvas : Canvas_ID; Position: Screen_Point; Radius : Integer; Color: RGBA_T) is begin raise Display_Error; end Draw_Sphere; procedure Draw_Circle (Canvas : Canvas_ID; Position: Point_3d; Radius : Float; Color: RGBA_T) is IC : T_Internal_Canvas := Get_Internal_Canvas(Canvas); begin glPushMatrix; glTranslated (GLdouble (Position.X - (Float(IC.Center.X) * (1.0/IC.Zoom_Factor))), GLdouble (Position.Y - (Float(IC.Center.Y) * (1.0/IC.Zoom_Factor))), GLdouble (Position.Z)); Set_Color (Color); Disable_3d_Light(Canvas); glShadeModel(GL_SMOOTH); glHint(GL_LINE_SMOOTH_HINT, GL_NICEST); glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST); glHint(GL_POINT_SMOOTH_HINT, GL_NICEST); glEnable(GL_LINE_SMOOTH); glEnable(GL_POLYGON_SMOOTH); glEnable(GL_POINT_SMOOTH); DrawDisk(InnerRadius => Radius, OuterRadius => Radius + 1.0, VSlices => 40, HSlices => 40, Color => Color); Enable_3d_Light (Canvas); glPopMatrix; end Draw_Circle; procedure Draw_Circle (Canvas : Canvas_ID; Position: Screen_Point; Radius : Integer; Color: RGBA_T) is begin raise Display_Error; end Draw_Circle; procedure Draw_Line (Canvas : Canvas_ID; P1: Point_3d; P2 : Point_3d; Color: RGBA_T) is begin raise Display_Error; end Draw_Line; procedure Draw_Line (Canvas : Canvas_ID; P1: Screen_Point; P2 : Screen_Point; Color: RGBA_T) is begin raise Display_Error; end Draw_Line; procedure Draw_Text (Canvas : Canvas_ID; Position: Point_3d; Text : String; Color: RGBA_T; Bg_Color : RGBA_T := Black; Wrap: Boolean := True) is -- S : access SDL_Surface; --Format : UInt32; IC : T_Internal_Canvas := Get_Internal_Canvas(Canvas); Cursor : Screen_Point := (0, 0); Font : BMP_Font := Font8x8; w : Integer := Char_Size (Font).X; h : Integer := Char_Size (Font).Y; begin glPushMatrix; -- glTranslated -- (GLdouble (Position.X), -- GLdouble (Position.Y), -- GLdouble (Position.Z)); glTranslated (GLdouble (Position.X - (Float(IC.Center.X) * (1.0/IC.Zoom_Factor))), GLdouble (Position.Y - (Float(IC.Center.Y) * (1.0/IC.Zoom_Factor))), GLdouble (Position.Z)); glScalef(1.0/IC.Zoom_Factor, 1.0/IC.Zoom_Factor, 1.0/IC.Zoom_Factor); --glMatrixMode(GL_PROJECTION); --glPushMatrix; --glLoadIdentity; -- glOrtho(0.0, double(IC.Surface.w), -- double(IC.Surface.h), 0.0, 0.0, 1.0); Disable_3d_Light(Canvas); glDisable(GL_DEPTH_TEST); glEnable(GL_TEXTURE_2D); glEnable(GL_BLEND); -- glBlendFunc(GL_SRC_ALPHA, GL_ONE);--_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); Set_Color (Color); for C of Text loop glBindTexture(GL_TEXTURE_2D, getCharTexture(C)); glBegin(GL_QUADS); glTexCoord2f(0.0, 1.0); glVertex3f(Float(Cursor.X), Float(Cursor.Y), 0.0); glTexCoord2f(0.0, 0.0); glVertex3f(Float(Cursor.X), Float(Cursor.Y) + Float(h), 0.0); glTexCoord2f(1.0, 0.0); glVertex3f(Float(Cursor.X) + Float(w), Float(Cursor.Y) + Float(h), 0.0); glTexCoord2f(1.0, 1.0); glVertex3f(Float(Cursor.X) + Float(w), Float(Cursor.Y), 0.0); glEnd; if Cursor.X + Char_Size (Font).X > Integer(IC.Surface.w) then if Wrap then Cursor.Y := Cursor.Y + h; Cursor.X := 0; else exit; end if; else Cursor.X := Cursor.X + w; end if; end loop; glDisable(GL_TEXTURE_2D); glDisable(GL_BLEND); glEnable(GL_DEPTH_TEST); Enable_3d_Light(Canvas); -- glPopMatrix; -- glMatrixMode(GL_MODELVIEW); -- glLoadIdentity; glPopMatrix; end Draw_Text; procedure Draw_Text (Canvas : Canvas_ID; Position: Screen_Point; Text : String; Color: RGBA_T; Bg_Color : RGBA_T := Black; Wrap: Boolean := True) is --Format : UInt32 := SDL_PIXELFORMAT_RGBA32; IC : T_Internal_Canvas := Get_Internal_Canvas(Canvas); Cursor : Screen_Point := Position; Font : BMP_Font := Font8x8; w : Integer := Char_Size (Font).X; h : Integer := Char_Size (Font).Y; begin Disable_3d_Light(Canvas); glDisable(GL_DEPTH_TEST); glEnable(GL_TEXTURE_2D); glEnable(GL_BLEND); -- glBlendFunc(GL_SRC_ALPHA, GL_ONE);--_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glMatrixMode(GL_PROJECTION); glPushMatrix; glLoadIdentity; glOrtho(0.0, double(IC.Surface.w), double(IC.Surface.h), 0.0, 0.0, 1.0); Set_Color (Color); for C of Text loop glBindTexture(GL_TEXTURE_2D, getCharTexture(C)); glBegin(GL_QUADS); glTexCoord2f(0.0, 0.0); glVertex3f(Float(Cursor.X), Float(Cursor.Y), 0.0); glTexCoord2f(0.0, 1.0); glVertex3f(Float(Cursor.X), Float(Cursor.Y) + Float(h), 0.0); glTexCoord2f(1.0, 1.0); glVertex3f(Float(Cursor.X) + Float(w), Float(Cursor.Y) + Float(h), 0.0); glTexCoord2f(1.0, 0.0); glVertex3f(Float(Cursor.X) + Float(w), Float(Cursor.Y), 0.0); glEnd; if Cursor.X + Char_Size (Font).X > Integer(IC.Surface.w) then if Wrap then Cursor.Y := Cursor.Y + h; Cursor.X := 0; else exit; end if; else Cursor.X := Cursor.X + w; end if; end loop; glPopMatrix; glMatrixMode(GL_MODELVIEW); glLoadIdentity; glDisable(GL_TEXTURE_2D); glDisable(GL_BLEND); glEnable(GL_DEPTH_TEST); Enable_3d_Light(Canvas); end Draw_Text; procedure Draw_Rect (Canvas : Canvas_ID; Position : Point_3d; Width, Height : Float; Color : RGBA_T) is begin null; -- raise Display_Error; end Draw_Rect; procedure Draw_Rect (Canvas : Canvas_ID; Position : Screen_Point; Width, Height : Integer; Color : RGBA_T) is C : T_Internal_Canvas := Get_Internal_Canvas(Canvas); begin glMatrixMode(GL_PROJECTION); glPushMatrix; glLoadIdentity; glOrtho(0.0, double(C.Surface.w), double(C.Surface.h), 0.0, 0.0, 1.0); Disable_3d_Light (Canvas); Set_Color (Color); glRecti(int (Position.X), int (Position.Y), int (Position.X + Width), int (Position.Y + Height)); Enable_3d_Light (Canvas); glPopMatrix; glMatrixMode(GL_MODELVIEW); glLoadIdentity; end Draw_Rect; procedure Draw_Fill_Rect (Canvas : Canvas_ID; Position : Point_3d; Width, Height : Float; Color : RGBA_T) is begin raise Display_Error; end Draw_Fill_Rect; procedure Draw_Fill_Rect (Canvas : Canvas_ID; Position : Screen_Point; Width, Height : Integer; Color : RGBA_T) is C : T_Internal_Canvas := Get_Internal_Canvas(Canvas); begin glMatrixMode(GL_PROJECTION); glPushMatrix; glLoadIdentity; glOrtho(0.0, double(C.Surface.w), double(C.Surface.h), 0.0, 0.0, 1.0); Disable_3d_Light (Canvas); Set_Color (Color); glRecti(int (Position.X), int (Position.Y), int (Position.X + Width), int (Position.Y + Height)); Enable_3d_Light (Canvas); glPopMatrix; glMatrixMode(GL_MODELVIEW); glLoadIdentity; end Draw_Fill_Rect; procedure Set_Pixel (Canvas : Canvas_ID; Position : Screen_Point; Color : RGBA_T) is begin raise Display_Error; end Set_Pixel; function Get_Text_Size(Text : String) return Screen_Point is begin return String_Size (Font8x8, Text); end Get_Text_Size; function Scale (Canvas: T_Internal_Canvas; L : Float) return Integer is (Integer (L * Canvas.Zoom_Factor)); procedure Set_Center (Canvas : Canvas_ID; Position : Point_3d) is C : T_Internal_Canvas := Get_Internal_Canvas(Canvas); begin Display.Basic.Utils.Set_Center(Canvas, (Scale(C, Position.X), Scale(C, Position.Y))); end Set_Center; procedure Set_Center (Canvas : Canvas_ID; Position : Screen_Point) is begin Display.Basic.Utils.Set_Center(Canvas, Position); end Set_Center; function Get_Center (Canvas : Canvas_ID) return Screen_Point is begin return Display.Basic.Utils.Get_Center(Canvas); end Get_Center; function Get_Cursor_Status return Cursor_T is begin return Get_Internal_Cursor; end Get_Cursor_Status; function To_Point3d (Canvas : Canvas_ID; P : Screen_Point) return Point_3d is C : T_Internal_Canvas := Get_Internal_Canvas(Canvas); begin return (Float(P.X - Integer(C.Surface.w / 2) - C.Center.X), Float(Integer(C.Surface.h / 2) - C.Center.Y - P.Y), 0.0); end To_Point3d; function To_Screen_Point (Canvas : Canvas_ID; P : Point_3d) return Screen_Point is C : T_Internal_Canvas := Get_Internal_Canvas(Canvas); begin return Screen_Point'(X => Integer (C.Zoom_Factor * P.X) + Integer(C.Surface.w / 2) - C.Center.X, Y => Integer(C.Surface.h / 2) + C.Center.Y - Integer (C.Zoom_Factor * P.Y)); end To_Screen_Point; function Get_Canvas_Size(Canvas : Canvas_ID) return Screen_Point is C : T_Internal_Canvas := Get_Internal_Canvas(Canvas); begin return Screen_Point'(Integer(C.Surface.w), Integer(C.Surface.h)); end Get_Canvas_Size; procedure Set_3d_Light (Canvas : Canvas_ID; Position : Point_3d; Diffuse_Color : RGBA_T; Ambient_Color : RGBA_T) is type GLFloat_Array is array (Natural range <>) of aliased GLfloat; light_position : aliased GLFloat_Array := (Position.X, Position.Y, Position.Z, 1.0); light_diffuse : aliased GLFloat_Array := (Float (Diffuse_Color.R) / 255.0, Float (Diffuse_Color.G) / 255.0, Float (Diffuse_Color.B) / 255.0, 1.0); light_ambient : aliased GLFloat_Array := (Float (Ambient_Color.R) / 255.0, Float (Ambient_Color.G) / 255.0, Float (Ambient_Color.B) / 255.0, 1.0); IC : T_Internal_Canvas := Get_Internal_Canvas (Canvas); begin glPushMatrix; glTranslated (GLdouble (- (Float(IC.Center.X) * (1.0/IC.Zoom_Factor))), GLdouble (- (Float(IC.Center.Y) * (1.0/IC.Zoom_Factor))), GLdouble (0.0)); glLightfv (GL_LIGHT0, GL_POSITION, light_position (0)'Access); glLightfv (GL_LIGHT0, GL_DIFFUSE, light_diffuse (0)'Access); glLightfv (GL_LIGHT0, GL_AMBIENT, light_ambient (0)'Access); glPopMatrix; end Set_3d_Light; procedure Enable_3d_Light (Canvas : Canvas_ID) is begin glEnable (GL_LIGHTING); glEnable (GL_LIGHT0); end Enable_3d_Light; procedure Disable_3d_Light (Canvas : Canvas_ID) is begin glDisable (GL_LIGHTING); glDisable (GL_LIGHT0); end Disable_3d_Light; end Display.Basic;
libsrc/graphics/px4/swapgfxbk.asm
teknoplop/z88dk
0
138
<gh_stars>0 ; ; Z88 Graphics Functions - Small C+ stubs ; ; Written around the Interlogic Standard Library ; ; Stubs Written by <NAME> - 15/10/98 ; ; ; Page the graphics bank in/out - used by all gfx functions ; Simply does a swap... ; ; ; $Id: swapgfxbk.asm,v 1.2 2015/11/05 16:08:04 stefano Exp $ ; PUBLIC swapgfxbk PUBLIC swapgfxbk1 .swapgfxbk ret .swapgfxbk1 ret
programs/oeis/267/A267053.asm
neoneye/loda
22
99558
<filename>programs/oeis/267/A267053.asm ; A267053: Triangle read by rows giving successive states of cellular automaton generated by "Rule 93" initiated with a single ON (black) cell. ; 1,0,1,1,1,0,1,0,0,0,1,0,1,1,1,1,1,0,1,0,1,0,0,0,0,0,1,0,1,0,1,1,1,1,1,1,1,0,1,0,1,0,1,0,0,0,0,0,0,0,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,1 mov $1,$0 lpb $1 mov $1,$0 sub $1,1 add $2,1 trn $0,$2 sub $0,$2 lpe mod $0,2 add $0,1
Sources/Globe_3d/models/vehic002.adb
ForYouEyesOnly/Space-Convoy
1
1265
pragma Warnings (Off); pragma Style_Checks (Off); -- Space vehicle #002 3D model. Copyright (c) <NAME> 1999 - 2000 -- CH - 2000 Neuchatel -- SWITZERLAND -- Permission granted to use the herein contained 3D model for any purpose, -- provided this copyright note remains attached and unmodified. with GL; with Ada.Numerics.Float_Random; use Ada.Numerics.Float_Random; package body Vehic002 is procedure Create ( object : in out GLOBE_3D.p_Object_3D; scale : GLOBE_3D.Real; centre : GLOBE_3D.Point_3D; metal_door, metal_surface, bumped_blue : GLOBE_3D.Image_id ) is use GL, GLOBE_3D; po, fa : Natural := 0; c1, c2, c3, c4 : Positive; x, y, z : Real; p : Point_3D; rx, ry, fx : Real; nth : constant := 13; ntv : constant := 121; seed : Generator; face_0 : Face_type; -- takes defaults values point : constant p_Point_3D_array := new Point_3D_array (1 .. (nth + 1)*ntv*4); face : constant p_Face_array := new Face_array (1 .. nth*ntv*4 + 2*ntv*ntv); begin Reset (seed); for tv in 0 .. ntv loop rx := 2.0*Real (tv)/Real (ntv) - 1.0; x := scale*rx; fx := 0.15 + 0.002 * (3.0* (rx*1.55 + 0.2)**5 - 16.0* (rx**2) - 5.0* (rx**4) + 1.2*rx); z := scale*fx; for co in 1 .. 4 loop for th in 1 .. nth loop ry := 2.0*Real (th - 1)/Real (nth) - 1.0; ry := ry * fx; y := scale*ry; case co is when 1 => p := (x, - y, - z); when 2 => p := (x, - z, y); when 3 => p := (x, y, z); when 4 => p := (x, z, - y); end case; if tv>=1 then c1 := (co - 1)*nth + th; c2 := c1 mod (4*nth) + 1; c3 := c2 + 4*nth; c4 := c1 + 4*nth; c1 := c1 + 4*nth* (tv - 1); c2 := c2 + 4*nth* (tv - 1); c3 := c3 + 4*nth* (tv - 1); c4 := c4 + 4*nth* (tv - 1); fa := fa + 1; face_0.P := (c1, c4, c3, c2); if th in 2 .. nth - 1 then face_0.skin := colour_only; face_0.colour := (0.3, 0.3, 0.3 + 0.4*Real (Random (seed))); else face_0.skin := coloured_texture; face_0.colour := (0.2, 0.2, 0.2 + 0.2*Real (Random (seed))); face_0.texture := bumped_blue; face_0.repeat_U := 3; face_0.repeat_V := 3; end if; face (fa) := face_0; end if; po := po + 1; point (po) := p; end loop; end loop; end loop; fa := fa + 1; face_0.P := (1, 1 + nth, 1 + 2*nth, 1 + 3*nth); face_0.skin := texture_only; face_0.texture := metal_door; face_0.repeat_U := 1; face_0.repeat_V := 1; face (fa) := face_0; -- fa := fa + 1; c1 := 1 + ntv*4*nth; face_0.P := (c1, c1 + 3*nth, c1 + 2*nth, c1 + nth); face_0.skin := texture_only; face_0.texture := metal_surface; face_0.repeat_U := 5; face_0.repeat_V := 5; face (fa) := face_0; object := new Object_3D (po, fa); object.point := point (1 .. po); object.face := face (1 .. fa); object.centre := centre; Set_name (object.all, "vehicle_002"); end Create; end Vehic002;
osaka2/main.asm
genivia-inc/PC1403-Music-Routines
1
1123
;osaka II beeper engine for sharp pc-1403 ;version 1.0 by utz 07'2014 ;2 channels pulse-interleaving square wave sound + pwm drums I equ $00 J equ $01 A equ $02 B equ $03 XL equ $04 XH equ $05 YL equ $06 YH equ $07 K equ $08 L equ $09 M equ $0A N equ $0B WRK equ $0C OUTP equ $5f ;beeper out org $80e8 begin: lip OUTP ;preserve outbyte ldm push init: lp XL ;setup index register, X = XL+(XH*256) mpntr0: lia $b4 ;point to song data-1 exam lp XH mpntr1: lia $88 exam lp WRK ;store ptn sequence pointer in $0c..$0d liq XL mvb setptn: ;read pattern sequence lp XL ;restore ptn seq pointer liq WRK mvb ixl ;hibyte of ptn address to A cpia $00 ;if it is 0, end of seq reached -> reset pointer ;jpz end ;exit if $ff found - uncomment this and comment out next if you don't want to loop jrzm init exab ;hibyte of ptn addr to B ixl ;lobyte of ptn addr to A lp WRK ;store ptn sequence pointer in $0c..$0d liq XL mvb lp XL ;store ptn address in X liq A mvb rdata: test 8 ;check BRK/ON key jpnz end ;and exit if pressed ixl ;inc index, ->dp, value to A (drum byte) cpia $ff ;check for end marker $ff jrzm setptn ;loop if $ff found lp M ;store speed value exam ldm ;load back anim $fc ;delete drum value ania $03 ;delete speed value cpia 0 ;check if drum is active jrzp nodrum call drum ;play drum nodrum: ixl ;point to ch1 counter and backup in A ix ;point to ch2 counter lp L mvmd ;put it in L call playrow chkbp: jp rdata playrow: push ;************************************************************** a0b0: ;ch1 off, ch2 off ;when a counts down, go to a1b0 ;when b counts down, to to a0b1 deca ;4 ;decrement counter ch1 jrnzp skip1a ;7/4 ;when counter ch1 has reached 0 pop ;3 ;restore counter ch1 push ;2 ;and reload backup jp skip3 ;6 ;and continue in a1b0 skip1a: lip OUTP ;4 ;set output mask anim 0 ;4 skip1: outc ;2 ;write to beeper port decl ;4 ;decrement counter ch2 jrnzp skip2a ;7/4 lp L ;2 ;restore counter mvmd ;3 jp skip6 ;6 ;and continue in a0b1 skip2a: lip OUTP ;4 anim 0 ;4 skip2: outc ;2 ;44*16+10 = 714 ;******* ;lp K ;2 deca ;4 jrnzp skip1aB ;7/4 ;when counter ch1 has reached 0 pop ;3 ;restore counter ch1 push ;2 ;and reload backup jp skip3B ;6 ;and continue in a1b0 skip1aB: ;wait 2 ;8 ;eliminate overhead lip OUTP ;4 anim 0 ;4 skip1B: outc ;2 ;lp L ;2 decl ;4 jrnzp skip2aB ;7/4 lp L ;3 ;restore counter mvmd jp skip6B ;6 ;and continue in a0b1 skip2aB: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP ;4 anim 0 ;4 skip2B: outc ;2 ;******* ;lp K ;2 deca ;4 jrnzp skip1aC ;7/4 ;when counter ch1 has reached 0 pop ;3 ;restore counter ch1 push ;2 ;and reload backup jp skip3C ;6 ;and continue in a1b0 skip1aC: ;wait 2 ;8 ;eliminate overhead lip OUTP ;4 anim 0 ;4 skip1C: outc ;2 ;lp L ;2 decl ;4 jrnzp skip2aC ;7/4 lp L ;3 ;restore counter mvmd jp skip6C ;6 ;and continue in a0b1 skip2aC: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP ;4 anim 0 ;4 skip2C: outc ;2 ;******* ;lp K ;2 deca ;4 jrnzp skip1aD ;7/4 ;when counter ch1 has reached 0 pop ;3 ;restore counter ch1 push ;2 ;and reload backup jp skip3D ;6 ;and continue in a1b0 skip1aD: ;wait 2 ;8 ;eliminate overhead lip OUTP ;4 anim 0 ;4 skip1D: outc ;2 ;lp L ;2 decl ;4 jrnzp skip2aD ;7/4 lp L ;3 ;restore counter mvmd jp skip6D ;6 ;and continue in a0b1 skip2aD: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP ;4 anim 0 ;4 skip2D: outc ;2 ;******* ;lp K ;2 deca ;4 jrnzp skip1aE ;7/4 ;when counter ch1 has reached 0 pop ;3 ;restore counter ch1 push ;2 ;and reload backup jp skip3E ;6 ;and continue in a1b0 skip1aE: ;wait 2 ;8 ;eliminate overhead lip OUTP ;4 anim 0 ;4 skip1E: outc ;2 ;lp L ;2 decl ;4 jrnzp skip2aE ;7/4 lp L ;3 ;restore counter mvmd jp skip6E ;6 ;and continue in a0b1 skip2aE: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP ;4 anim 0 ;4 skip2E: outc ;2 ;******* ;lp K ;2 deca ;4 jrnzp skip1aF ;7/4 ;when counter ch1 has reached 0 pop ;3 ;restore counter ch1 push ;2 ;and reload backup jp skip3F ;6 ;and continue in a1b0 skip1aF: ;wait 2 ;8 ;eliminate overhead lip OUTP ;4 anim 0 ;4 skip1F: outc ;2 ;lp L ;2 decl ;4 jrnzp skip2aF ;7/4 lp L ;3 ;restore counter mvmd jp skip6F ;6 ;and continue in a0b1 skip2aF: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP ;4 anim 0 ;4 skip2F: outc ;2 ;******* ;lp K ;2 deca ;4 jrnzp skip1aG ;7/4 ;when counter ch1 has reached 0 pop ;3 ;restore counter ch1 push ;2 ;and reload backup jp skip3G ;6 ;and continue in a1b0 skip1aG: ;wait 2 ;8 ;eliminate overhead lip OUTP ;4 anim 0 ;4 skip1G: outc ;2 ;lp L ;2 decl ;4 jrnzp skip2aG ;7/4 lp L ;3 ;restore counter mvmd jp skip6G ;6 ;and continue in a0b1 skip2aG: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP ;4 anim 0 ;4 skip2G: outc ;2 ;******* ;lp K ;2 deca ;4 jrnzp skip1aH ;7/4 ;when counter ch1 has reached 0 pop ;3 ;restore counter ch1 push ;2 ;and reload backup jp skip3H ;6 ;and continue in a1b0 skip1aH: ;wait 2 ;8 ;eliminate overhead lip OUTP ;4 anim 0 ;4 skip1H: outc ;2 ;lp L ;2 decl ;4 jrnzp skip2aH ;7/4 lp L ;3 ;restore counter mvmd jp skip6H ;6 ;and continue in a0b1 skip2aH: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP ;4 anim 0 ;4 skip2H: outc ;2 ;******* ;lp K ;2 deca ;4 jrnzp skip1aI ;7/4 ;when counter ch1 has reached 0 pop ;3 ;restore counter ch1 push ;2 ;and reload backup jp skip3I ;6 ;and continue in a1b0 skip1aI: ;wait 2 ;8 ;eliminate overhead lip OUTP ;4 anim 0 ;4 skip1I: outc ;2 ;lp L ;2 decl ;4 jrnzp skip2aI ;7/4 lp L ;3 ;restore counter mvmd jp skip6I ;6 ;and continue in a0b1 skip2aI: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP ;4 anim 0 ;4 skip2I: outc ;2 ;******* ;lp K ;2 deca ;4 jrnzp skip1aJ ;7/4 ;when counter ch1 has reached 0 pop ;3 ;restore counter ch1 push ;2 ;and reload backup jp skip3J ;6 ;and continue in a1b0 skip1aJ: ;wait 2 ;8 ;eliminate overhead lip OUTP ;4 skip1J: anim 0 ;4 outc ;2 ;lp L ;2 decl ;4 jrnzp skip2aJ ;7/4 lp L ;3 ;restore counter mvmd jp skip6J ;6 ;and continue in a0b1 skip2aJ: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP ;4 anim 0 ;4 skip2J: outc ;2 ;******* ;lp K ;2 deca ;4 jrnzp skip1aK ;7/4 ;when counter ch1 has reached 0 pop ;3 ;restore counter ch1 push ;2 ;and reload backup jp skip3K ;6 ;and continue in a1b0 skip1aK: ;wait 2 ;8 ;eliminate overhead skip1K: lip OUTP ;4 anim 0 ;4 outc ;2 ;lp L ;2 decl ;4 jrnzp skip2aK ;7/4 lp L ;3 ;restore counter mvmd jp skip6K ;6 ;and continue in a0b1 skip2aK: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP ;4 anim 0 ;4 skip2K: outc ;2 ;******* ;lp K ;2 deca ;4 jrnzp skip1aL ;7/4 ;when counter ch1 has reached 0 pop ;3 ;restore counter ch1 push ;2 ;and reload backup jp skip3L ;6 ;and continue in a1b0 skip1aL: ;wait 2 ;8 ;eliminate overhead lip OUTP ;4 anim 0 ;4 skip1L: outc ;2 ;lp L ;2 decl ;4 jrnzp skip2aL ;7/4 lp L ;3 ;restore counter mvmd jp skip6L ;6 ;and continue in a0b1 skip2aL: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP ;4 anim 0 ;4 skip2L: outc ;2 ;******* ;lp K ;2 deca ;4 jrnzp skip1aM ;7/4 ;when counter ch1 has reached 0 pop ;3 ;restore counter ch1 push ;2 ;and reload backup jp skip3M ;6 ;and continue in a1b0 skip1aM: ;wait 2 ;8 ;eliminate overhead lip OUTP ;4 anim 0 ;4 skip1M: outc ;2 ;lp L ;2 decl ;4 jrnzp skip2aM ;7/4 lp L ;3 ;restore counter mvmd jp skip6M ;6 ;and continue in a0b1 skip2aM: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP ;4 anim 0 ;4 skip2M: outc ;2 ;******* ;lp K ;2 deca ;4 jrnzp skip1aN ;7/4 ;when counter ch1 has reached 0 pop ;3 ;restore counter ch1 push ;2 ;and reload backup jp skip3N ;6 ;and continue in a1b0 skip1aN: ;wait 2 ;8 ;eliminate overhead lip OUTP ;4 anim 0 ;4 skip1N: outc ;2 ;lp L ;2 decl ;4 jrnzp skip2aN ;7/4 lp L ;3 ;restore counter mvmd jp skip6N ;6 ;and continue in a0b1 skip2aN: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP ;4 anim 0 ;4 skip2N: outc ;2 ;******* ;lp K ;2 deca ;4 jrnzp skip1aO ;7/4 ;when counter ch1 has reached 0 pop ;3 ;restore counter ch1 push ;2 ;and reload backup jp skip3O ;6 ;and continue in a1b0 skip1aO: ;wait 2 ;8 ;eliminate overhead lip OUTP ;4 anim 0 ;4 skip1O: outc ;2 ;lp L ;2 decl ;4 jrnzp skip2aO ;7/4 lp L ;3 ;restore counter mvmd jp skip6O ;6 ;and continue in a0b1 skip2aO: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP ;4 anim 0 ;4 skip2O: outc ;2 ;******* ;lp K ;2 deca ;4 jrnzp skip1aP ;7/4 ;when counter ch1 has reached 0 pop ;3 ;restore counter ch1 push ;2 ;and reload backup jp skip3P ;6 ;and continue in a1b0 skip1aP: ;wait 2 ;8 ;eliminate overhead lip OUTP ;4 anim 0 ;4 skip1P: outc ;2 ;lp L ;2 decl ;4 jrnzp skip2aP ;7/4 lp L ;3 ;restore counter mvmd jp skip6P ;6 ;and continue in a0b1 skip2aP: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP ;4 anim 0 ;4 skip2P: outc ;2 decm ;decrement primary speed counter jpnz a0b0 ;and loop if not 0 pop rtn ;************************************************************** a1b0: ;ch1 on, ch2 off ;when a counts down, go to a0b0 ;when b counts down, go to a1b1 ;lp K deca jrnzp skip3a pop ;3 push jp skip1 ;and continue in a0b0 skip3a: ;wait 2 lip OUTP orim $10 skip3: outc ;lp L decl jrnzp skip4a lp L ;restore counter mvmd jp skip8 ;and continue in a1b1 skip4a: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP anim 0 skip4: outc ;******* ;lp K deca jrnzp skip3aB pop ;3 push jp skip1B ;and continue in a0b0 skip3aB: ;wait 2 lip OUTP orim $10 skip3B: outc ;lp L decl jrnzp skip4aB lp L ;restore counter mvmd jp skip8B ;and continue in a1b1 skip4aB: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP anim 0 skip4B: outc ;******* ;lp K deca jrnzp skip3aC pop ;3 push jp skip1C ;and continue in a0b0 skip3aC: ;wait 2 lip OUTP orim $10 skip3C: outc ;lp L decl jrnzp skip4aC lp L ;restore counter mvmd jp skip8C ;and continue in a1b1 skip4aC: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP anim 0 skip4C: outc ;******* ;lp K deca jrnzp skip3aD pop ;3 push jp skip1D ;and continue in a0b0 skip3aD: ;wait 2 lip OUTP orim $10 skip3D: outc ;lp L decl jrnzp skip4aD lp L ;restore counter mvmd jp skip8D ;and continue in a1b1 skip4aD: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP anim 0 skip4D: outc ;******* ;lp K deca jrnzp skip3aE pop ;3 push jp skip1E ;and continue in a0b0 skip3aE: ;wait 2 lip OUTP orim $10 skip3E: outc ;lp L decl jrnzp skip4aE lp L ;restore counter mvmd jp skip8E ;and continue in a1b1 skip4aE: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP anim 0 skip4E: outc ;******* ;lp K deca jrnzp skip3aF pop ;3 push jp skip1F ;and continue in a0b0 skip3aF: ;wait 2 lip OUTP orim $10 skip3F: outc ;lp L decl jrnzp skip4aF lp L ;restore counter mvmd jp skip8F ;and continue in a1b1 skip4aF: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP anim 0 skip4F: outc ;******* ;lp K deca jrnzp skip3aG pop ;3 push jp skip1G ;and continue in a0b0 skip3aG: ;wait 2 lip OUTP orim $10 skip3G: outc ;lp L decl jrnzp skip4aG lp L ;restore counter mvmd jp skip8G ;and continue in a1b1 skip4aG: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP anim 0 skip4G: outc ;******* ;lp K deca jrnzp skip3aH pop ;3 push jp skip1H ;and continue in a0b0 skip3aH: ;wait 2 lip OUTP orim $10 skip3H: outc ;lp L decl jrnzp skip4aH lp L ;restore counter mvmd jp skip8H ;and continue in a1b1 skip4aH: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP anim 0 skip4H: outc ;******* ;lp K deca jrnzp skip3aI pop ;3 push jp skip1I ;and continue in a0b0 skip3aI: ;wait 2 lip OUTP orim $10 skip3I: outc ;lp L decl jrnzp skip4aI lp L ;restore counter mvmd jp skip8I ;and continue in a1b1 skip4aI: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP anim 0 skip4I: outc ;******* ;lp K deca jrnzp skip3aJ pop ;3 push jp skip1J ;and continue in a0b0 skip3aJ: ;wait 2 lip OUTP orim $10 skip3J: outc ;lp L decl jrnzp skip4aJ lp L ;restore counter mvmd jp skip8J ;and continue in a1b1 skip4aJ: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP anim 0 skip4J: outc ;******* ;lp K deca jrnzp skip3aK pop ;3 push jp skip1K ;and continue in a0b0 skip3aK: ;wait 2 lip OUTP orim $10 skip3K: outc ;lp L decl jrnzp skip4aK lp L ;restore counter mvmd jp skip8K ;and continue in a1b1 skip4aK: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP anim 0 skip4K: outc ;******* ;lp K deca jrnzp skip3aL pop ;3 push jp skip1L ;and continue in a0b0 skip3aL: ;wait 2 lip OUTP orim $10 skip3L: outc ;lp L decl jrnzp skip4aL lp L ;restore counter mvmd jp skip8L ;and continue in a1b1 skip4aL: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP anim 0 skip4L: outc ;******* ;lp K deca jrnzp skip3aM pop ;3 push jp skip1M ;and continue in a0b0 skip3aM: ;wait 2 lip OUTP orim $10 skip3M: outc ;lp L decl jrnzp skip4aM lp L ;restore counter mvmd jp skip8M ;and continue in a1b1 skip4aM: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP anim 0 skip4M: outc ;******* ;lp K deca jrnzp skip3aN pop ;3 push jp skip1N ;and continue in a0b0 skip3aN: ;wait 2 lip OUTP orim $10 skip3N: outc ;lp L decl jrnzp skip4aN lp L ;restore counter mvmd jp skip8N ;and continue in a1b1 skip4aN: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP anim 0 skip4N: outc ;******* ;lp K deca jrnzp skip3aO pop ;3 push jp skip1O ;and continue in a0b0 skip3aO: ;wait 2 lip OUTP orim $10 skip3O: outc ;lp L decl jrnzp skip4aO lp L ;restore counter mvmd jp skip8O ;and continue in a1b1 skip4aO: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP anim 0 skip4O: outc ;******* ;lp K deca jrnzp skip3aP pop ;3 push jp skip1P ;and continue in a0b0 skip3aP: ;wait 2 lip OUTP orim $10 skip3P: outc ;lp L decl jrnzp skip4aP lp L ;restore counter mvmd jp skip8P ;and continue in a1b1 skip4aP: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP anim 0 skip4P: outc decm jpnz a1b0 pop rtn ;************************************************************** a0b1: ;ch1 off, ch2 on ;when a counts down, go to a1b1 ;when b counts down, go to a0b0 ;lp K deca jrnzp skip5a pop push ;3 jp skip7 ;and continue in a1b1 skip5a: ;wait 2 lip OUTP anim 0 skip5: outc ;lp L decl jrnzp skip6a lp L ;restore counter mvmd jp skip2 ;and continue in a0b0 skip6a: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP orim $10 skip6: outc ;******* ;lp K deca jrnzp skip5aB pop push ;3 jp skip7B ;and continue in a1b1 skip5aB: ;wait 2 lip OUTP anim 0 skip5B: outc ;lp L decl jrnzp skip6aB lp L ;restore counter mvmd jp skip2B ;and continue in a0b0 skip6aB: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP orim $10 skip6B: outc ;******* ;lp K deca jrnzp skip5aC pop push ;3 jp skip7C ;and continue in a1b1 skip5aC: ;wait 2 lip OUTP anim 0 skip5C: outc ;lp L decl jrnzp skip6aC lp L ;restore counter mvmd jp skip2C ;and continue in a0b0 skip6aC: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP orim $10 skip6C: outc ;******* ;lp K deca jrnzp skip5aD pop push ;3 jp skip7D ;and continue in a1b1 skip5aD: ;wait 2 lip OUTP anim 0 skip5D: outc ;lp L decl jrnzp skip6aD lp L ;restore counter mvmd jp skip2D ;and continue in a0b0 skip6aD: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP orim $10 skip6D: outc ;******* ;lp K deca jrnzp skip5aE pop push ;3 jp skip7E ;and continue in a1b1 skip5aE: ;wait 2 lip OUTP anim 0 skip5E: outc ;lp L decl jrnzp skip6aE lp L ;restore counter mvmd jp skip2E ;and continue in a0b0 skip6aE: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP orim $10 skip6E: outc ;******* ;lp K deca jrnzp skip5aF pop push ;3 jp skip7F ;and continue in a1b1 skip5aF: ;wait 2 lip OUTP anim 0 skip5F: outc ;lp L decl jrnzp skip6aF lp L ;restore counter mvmd jp skip2F ;and continue in a0b0 skip6aF: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP orim $10 skip6F: outc ;******* ;lp K deca jrnzp skip5aG pop push ;3 jp skip7G ;and continue in a1b1 skip5aG: ;wait 2 lip OUTP anim 0 skip5G: outc ;lp L decl jrnzp skip6aG lp L ;restore counter mvmd jp skip2G ;and continue in a0b0 skip6aG: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP orim $10 skip6G: outc ;******* ;lp K deca jrnzp skip5aH pop push ;3 jp skip7H ;and continue in a1b1 skip5aH: ;wait 2 lip OUTP anim 0 skip5H: outc ;lp L decl jrnzp skip6aH lp L ;restore counter mvmd jp skip2H ;and continue in a0b0 skip6aH: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP orim $10 skip6H: outc ;******* ;lp K deca jrnzp skip5aI pop push ;3 jp skip7I ;and continue in a1b1 skip5aI: ;wait 2 lip OUTP anim 0 skip5I: outc ;lp L decl jrnzp skip6aI lp L ;restore counter mvmd jp skip2I ;and continue in a0b0 skip6aI: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP orim $10 skip6I: outc ;******* ;lp K deca jrnzp skip5aJ pop push ;3 jp skip7J ;and continue in a1b1 skip5aJ: ;wait 2 lip OUTP anim 0 skip5J: outc ;lp L decl jrnzp skip6aJ lp L ;restore counter mvmd jp skip2J ;and continue in a0b0 skip6aJ: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP orim $10 skip6J: outc ;******* ;lp K deca jrnzp skip5aK pop push ;3 jp skip7K ;and continue in a1b1 skip5aK: ;wait 2 lip OUTP anim 0 skip5K: outc ;lp L decl jrnzp skip6aK lp L ;restore counter mvmd jp skip2K ;and continue in a0b0 skip6aK: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP orim $10 skip6K: outc ;******* ;lp K deca jrnzp skip5aL pop push ;3 jp skip7L ;and continue in a1b1 skip5aL: ;wait 2 lip OUTP anim 0 skip5L: outc ;lp L decl jrnzp skip6aL lp L ;restore counter mvmd jp skip2L ;and continue in a0b0 skip6aL: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP orim $10 skip6L: outc ;******* ;lp K deca jrnzp skip5aM pop push ;3 jp skip7M ;and continue in a1b1 skip5aM: ;wait 2 lip OUTP anim 0 skip5M: outc ;lp L decl jrnzp skip6aM lp L ;restore counter mvmd jp skip2M ;and continue in a0b0 skip6aM: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP orim $10 skip6M: outc ;******* ;lp K deca jrnzp skip5aN pop push ;3 jp skip7N ;and continue in a1b1 skip5aN: ;wait 2 lip OUTP anim 0 skip5N: outc ;lp L decl jrnzp skip6aN lp L ;restore counter mvmd jp skip2N ;and continue in a0b0 skip6aN: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP orim $10 skip6N: outc ;******* ;lp K deca jrnzp skip5aO pop push ;3 jp skip7O ;and continue in a1b1 skip5aO: ;wait 2 lip OUTP anim 0 skip5O: outc ;lp L decl jrnzp skip6aO lp L ;restore counter mvmd jp skip2O ;and continue in a0b0 skip6aO: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP orim $10 skip6O: outc ;******* ;lp K deca jrnzp skip5aP pop push ;3 jp skip7P ;and continue in a1b1 skip5aP: ;wait 2 lip OUTP anim 0 skip5P: outc ;lp L decl jrnzp skip6aP lp L ;restore counter mvmd jp skip2P ;and continue in a0b0 skip6aP: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP orim $10 skip6P: outc ;deci ;jpnz a0b1 decm jpnz a0b1 pop rtn ;************************************************************** a1b1: ;ch1 on, ch2 on ;when a counts down, go to a0b1 ;when b counts down, go to a1b0 ;lp K deca jrnzp skip7a pop ;3 push jp skip5 ;and continue in a0b1 skip7a: ;wait 2 lip OUTP orim $10 skip7: outc ;lp L decl jrnzp skip8a lp L ;restore counter mvmd jp skip4 ;and continue in a1b0 skip8a: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP orim $10 skip8: outc ;******* ;lp K deca jrnzp skip7aB pop ;3 push jp skip5B ;and continue in a0b1 skip7aB: ;wait 2 lip OUTP orim $10 skip7B: outc ;lp L decl jrnzp skip8aB lp L ;restore counter mvmd jp skip4B ;and continue in a1b0 skip8aB: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP orim $10 skip8B: outc ;******* ;lp K deca jrnzp skip7aC pop ;3 push jp skip5C ;and continue in a0b1 skip7aC: ;wait 2 lip OUTP orim $10 skip7C: outc ;lp L decl jrnzp skip8aC lp L ;restore counter mvmd jp skip4C ;and continue in a1b0 skip8aC: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP orim $10 skip8C: outc ;******* ;lp K deca jrnzp skip7aD pop ;3 push jp skip5D ;and continue in a0b1 skip7aD: ;wait 2 lip OUTP orim $10 skip7D: outc ;lp L decl jrnzp skip8aD lp L ;restore counter mvmd jp skip4D ;and continue in a1b0 skip8aD: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP orim $10 skip8D: outc ;******* ;lp K deca jrnzp skip7aE pop ;3 push jp skip5E ;and continue in a0b1 skip7aE: ;wait 2 lip OUTP orim $10 skip7E: outc ;lp L decl jrnzp skip8aE lp L ;restore counter mvmd jp skip4E ;and continue in a1b0 skip8aE: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP orim $10 skip8E: outc ;******* ;lp K deca jrnzp skip7aF pop ;3 push jp skip5F ;and continue in a0b1 skip7aF: ;wait 2 lip OUTP orim $10 skip7F: outc ;lp L decl jrnzp skip8aF lp L ;restore counter mvmd jp skip4F ;and continue in a1b0 skip8aF: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP orim $10 skip8F: outc ;******* ;lp K deca jrnzp skip7aG pop ;3 push jp skip5G ;and continue in a0b1 skip7aG: ;wait 2 lip OUTP orim $10 skip7G: outc ;lp L decl jrnzp skip8aG lp L ;restore counter mvmd jp skip4G ;and continue in a1b0 skip8aG: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP orim $10 skip8G: outc ;******* ;lp K deca jrnzp skip7aH pop ;3 push jp skip5H ;and continue in a0b1 skip7aH: ;wait 2 lip OUTP orim $10 skip7H: outc ;lp L decl jrnzp skip8aH lp L ;restore counter mvmd jp skip4H ;and continue in a1b0 skip8aH: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP orim $10 skip8H: outc ;******* ;lp K deca jrnzp skip7aI pop ;3 push jp skip5I ;and continue in a0b1 skip7aI: ;wait 2 lip OUTP orim $10 skip7I: outc ;lp L decl jrnzp skip8aI lp L ;restore counter mvmd jp skip4I ;and continue in a1b0 skip8aI: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP orim $10 skip8I: outc ;******* ;lp K deca jrnzp skip7aJ pop ;3 push jp skip5J ;and continue in a0b1 skip7aJ: ;wait 2 lip OUTP orim $10 skip7J: outc ;lp L decl jrnzp skip8aJ lp L ;restore counter mvmd jp skip4J ;and continue in a1b0 skip8aJ: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP orim $10 skip8J: outc ;******* ;lp K deca jrnzp skip7aK pop ;3 push jp skip5K ;and continue in a0b1 skip7aK: ;wait 2 lip OUTP orim $10 skip7K: outc ;lp L decl jrnzp skip8aK lp L ;restore counter mvmd jp skip4K ;and continue in a1b0 skip8aK: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP orim $10 skip8K: outc ;******* ;lp K deca jrnzp skip7aL pop ;3 push jp skip5L ;and continue in a0b1 skip7aL: ;wait 2 lip OUTP orim $10 skip7L: outc ;lp L decl jrnzp skip8aL lp L ;restore counter mvmd jp skip4L ;and continue in a1b0 skip8aL: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP orim $10 skip8L: outc ;******* ;lp K deca jrnzp skip7aM pop ;3 push jp skip5M ;and continue in a0b1 skip7aM: ;wait 2 lip OUTP orim $10 skip7M: outc ;lp L decl jrnzp skip8aM lp L ;restore counter mvmd jp skip4M ;and continue in a1b0 skip8aM: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP orim $10 skip8M: outc ;******* ;lp K deca jrnzp skip7aN pop ;3 push jp skip5N ;and continue in a0b1 skip7aN: ;wait 2 lip OUTP orim $10 skip7N: outc ;lp L decl jrnzp skip8aN lp L ;restore counter mvmd jp skip4N ;and continue in a1b0 skip8aN: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP orim $10 skip8N: outc ;******* ;lp K deca jrnzp skip7aO pop ;3 push jp skip5O ;and continue in a0b1 skip7aO: ;wait 2 lip OUTP orim $10 skip7O: outc ;lp L decl jrnzp skip8aO lp L ;restore counter mvmd jp skip4O ;and continue in a1b0 skip8aO: ;nopt ;3 ;eliminate overhead ;nopt ;3 lip OUTP orim $10 skip8O: outc ;******* ;lp K deca jrnzp skip7aP pop ;3 push jp skip5P ;and continue in a0b1 skip7aP: ;wait 2 lip OUTP orim $10 skip7P: outc ;lp L decl jrnzp skip8aP lp L ;restore counter ;nopw mvmd jp skip4P ;and continue in a1b0 skip8aP: lip OUTP orim $10 skip8P: outc decm jpnz a1b1 pop rtn ;*************************************************************** end: pop lip OUTP ;restore outbyte exam rtn ;*************************************************************** ds 6,0 ;padding, so drum sounds are w/in page limits drum: dinit: lp YL ;2 ;1 ;preserve song data pointer in Y liq XL ;4 ;2 mvb ;7 ;1 dselect: rc ;2 ;1 ;clear carry deca ;4 ;1 ;decrease offset byte lp XL ;2 ;1 ;set lobyte of drum table pointer-1 exam ;3 ;1 lp XH ;2 ;1 ;set hibyte of drum sound/table pointer-1 lia $88 ;4 ;2 exam ;3 ;1 ixl ;load offset from table lp XL exam lip OUTP ;4 ;2 ;set pointer to value for Port C ;39 playDrum: ixl ;7 ;1 ;load next counter value cpma ;3 ;1 ;(P)=0, so we can do this and save 1 byte jrzp dexit ;7/4 ;2 ;exit if counter val=0 orim $10 ;4 ;1 ;beeper on outc ;2 ;1 dwait1: deca ;(4) ;1 jrnzm dwait1 ;(7)/4 ;2 sum=11*sum_of_odd_bytes anim $ef ;4 ;2 ;mask for beeper off ixl ;7 ;1 ;load next counter value cpma ;3 ;1 ;if it is 0 jrzp dexit ;7/4 ;2 ;exit outc ;2 ;1 dwait2: deca ;(4) ;1 jrnzm dwait2 ;(7)/4 ;2 sum=11*sum_of_even_bytes jrm playDrum ;7 ;2 ;51*number_of_bytes dexit: lp XL ;2 ;1 ;restore song data pointer liq YL ;4 ;2 mvb ;7 ;1 lp M ;2 ;1 ;adjust primary speed counter lia 21 ;4 ;2 sbm ;3 ;1 rtn ;4 ;1 ;26 ;45 ;39+26+7+[51*number_of_bytes]+[11*sum_of_bytes] drumTable: ;the locations of the drum sounds-1 db $03,$1d,$66 drum1: db 1,4,3,8,6,4,9,8,8,8 db 16,16,16,32,32,32,32 db 64,64,64,64,65 db 128,128,128,0 drum2: db 4,3,8,6,4,9,8,8,8 db 16,16,16,32,32,32,32,64,64,64 db 16,4,15,22,11,13,22,15,7 db 19,12,2,11,15,3,5,7,15,18 db 20,19,17,9,20,11,18,15,2,3 db 11,9,11,15,9,12,7,15,8,16 db 8,14,7,4,11,15,21,15,22,7 db 17,17,25,20,0 drum3: db 5,2,4,1,5,8,2,3,8,7 db 5,3,5,8,4,8,6,6,1,7 db 7,4,2,7,5,8,6,8,8,5 db 3,3,7,2,3,3,4,6,5,8 db 5,8,5,5,1,5,3,4,3,7 db 6,3,1,8,6,1,6,2,2,1 db 6,6,3,6,8,7,3,1,8,7 db 4,2,1,4,1,255,255,0 sdata:
Library/Chart/Axis/axisCategory.asm
steakknife/pcgeos
504
29890
<gh_stars>100-1000 COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) GeoWorks 1991 -- All Rights Reserved PROJECT: PC GEOS MODULE: FILE: axisCategory.asm AUTHOR: <NAME> METHODS: Name Description ---- ----------- FUNCTIONS: Scope Name Description ----- ---- ----------- REVISION HISTORY: Name Date Description ---- ---- ----------- CDB 12/12/91 Initial version. DESCRIPTION: $Id: axisCategory.asm,v 1.1 97/04/04 17:45:13 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ AxisCode segment COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CategoryAxisBuild %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Build a category axis CALLED BY: MSG_CHART_OBJECT_BUILD PASS: *ds:si = Category Axis object ds:di = instance data cl - ChartType ch - ChartVariation dx - ChartFlags RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: For a category axis set a few things: tickMajorUnit = 1 tickMajorUnit = 0.5 minimum = 0 maximum = nCategories KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 11/ 7/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CategoryAxisBuild method dynamic CategoryAxisClass, MSG_CHART_OBJECT_BUILD uses ax,cx,dx,bp .enter call CategoryAxisChooseDefaultValues mov ds:[di].AI_tickAttr, mask ATA_MAJOR_TICKS or \ mask ATA_LABELS clr al test dx, mask CF_CATEGORY_MARGIN jz gotMarginAmount mov al, AXIS_CATEGORY_MARGIN gotMarginAmount: ; Set category margin mov ds:[di].CAI_margin, al .leave mov di, offset CategoryAxisClass GOTO ObjCallSuperNoLock CategoryAxisBuild endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CategoryAxisChooseDefaultValues %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: Choose default values for category axis PASS: *ds:si = CategoryAxisClass object ds:di = CategoryAxisClass instance data es = Segment of CategoryAxisClass. RETURN: nothing DESTROYED: nothing REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- CDB 12/12/91 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CategoryAxisChooseDefaultValues proc near uses ax,bx,cx,dx,ds,es,si,di class CategoryAxisClass .enter ; ; Compute nCategories ; push si ; chunk handle mov ax, MSG_CHART_GROUP_GET_CATEGORY_COUNT mov si, offset TemplateChartGroup call ObjCallInstanceNoLock ; cx <- # of categories pop si ; store # labels in instance data mov bx, offset AI_numLabels call AxisStoreWordSetState mov ax, cx call FloatWordToFloat ; Convert to a float number mov bx, di ; Store nCategories as MAX value segmov es, ds, di lea di, ds:[bx].AI_max call FloatPopNumber ; Store 0 as MIN value lea di, ds:[bx].AI_min clr ax mov cx, size FloatNum/2 rep stosw ; set tick major unit = 1 segmov ds, cs, si lea si, cs:[float1] lea di, ds:[bx].AI_tickMajorUnit MovMem <size FloatNum> ; tick minor unit = .5 lea si, cs:[floatHalf] lea di, ds:[bx].AI_tickMinorUnit MovMem <size FloatNum> .leave ret CategoryAxisChooseDefaultValues endp float1 FloatNum <0,0,0,0x8000,<0,0x3fff>> floatHalf FloatNum <0,0,0,0x8000,<0,0x3ffe>> COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% AxisStoreWordSetState %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Store a word in the instance data. Set the IMAGE and GEOMETRY flags if the value changes CALLED BY: PASS: ds:[di][bx] - location to store *ds:si - axis object cx - value to store RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- CDB 5/18/92 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ AxisStoreWordSetState proc near uses cx .enter cmp cx, ds:[di][bx] je done mov ds:[di][bx], cx mov cx, mask COS_IMAGE_INVALID or \ mask COS_GEOMETRY_INVALID call ChartObjectSetState done: .leave ret AxisStoreWordSetState endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CategoryAxisRecalcSize %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: Perform "part 1" of the geometry calculations PASS: *ds:si = CategoryAxisClass object ds:di = CategoryAxisClass instance data es = Segment of CategoryAxisClass. cx, dx - suggested size RETURN: cx, dx - desired size DESTROYED: nothing REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- CDB 1/10/92 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CategoryAxisRecalcSize method dynamic CategoryAxisClass, MSG_CHART_OBJECT_RECALC_SIZE uses ax axisSize local Point push dx, cx .enter call CategoryAxisComputeMaxLabelSizePart1 test ds:[di].AI_attr, mask AA_VERTICAL jnz vertical ; Horizontal Axis: Set size ; WIDTH = max(passed x, AXIS_MIN_PLOT_DISTANCE) Max cx, AXIS_MIN_PLOT_DISTANCE mov axisSize.P_x, cx ; HEIGHT = AXIS_STANDARD_AXIS_HEIGHT + max Label height mov ax, ds:[di].AI_maxLabelSize.P_y add ax, AXIS_STANDARD_AXIS_HEIGHT mov axisSize.P_y, ax ; Make initial stab at plot bounds mov ds:[di].AI_plotBounds.R_top, AXIS_ABOVE_HEIGHT mov ds:[di].AI_plotBounds.R_bottom, AXIS_ABOVE_HEIGHT mov ds:[di].AI_plotBounds.R_left, 0 mov ds:[di].AI_plotBounds.R_right, cx jmp done vertical: ; Set size. ; HEIGHT = max(passed height, AXIS_MIN_PLOT_DISTANCE) Max dx, AXIS_MIN_PLOT_DISTANCE mov axisSize.P_y, dx ; WIDTH = max label width + standard axis width mov ax, ds:[di].AI_maxLabelSize.P_x mov bx, ax add bx, AXIS_STANDARD_AXIS_WIDTH mov axisSize.P_x, bx ; Make initial stab at plot bounds mov ds:[di].AI_plotBounds.R_top, 0 mov ds:[di].AI_plotBounds.R_bottom, dx add ax, AXIS_LEFT_WIDTH + 1 ; max label size mov ds:[di].AI_plotBounds.R_left, ax mov ds:[di].AI_plotBounds.R_right, ax done: movP cxdx, axisSize .leave mov di, offset CategoryAxisClass GOTO ObjCallSuperNoLock CategoryAxisRecalcSize endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CategoryAxisComputeMaxLabelSizePart1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Make the initial guess at the max label size CALLED BY: CategoryAxisRecalcSize PASS: *ds:si - category axis RETURN: nothing -- AI_maxLabelSize fields filled in DESTROYED: nothing PSEUDO CODE/STRATEGY: VERTICAL AXIS: width = text size HORIZONTAL AXIS: height = text size Can't set the other value until later. KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- CDB 3/18/92 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CategoryAxisComputeMaxLabelSizePart1 proc near uses ax,bx,cx,dx,di class CategoryAxisClass .enter ; ; Make sure there are labels to be displayed! ; mov ax, MSG_CHART_GROUP_GET_DATA_ATTRIBUTES call UtilCallChartGroup test al, mask CDA_HAS_CATEGORY_TITLES jz noLabelSize DerefChartObject ds, si, di test ds:[di].AI_tickAttr, mask ATA_LABELS jz noLabelSize call UtilGetTextLineHeight clr bx ; ; AX - height ; bx - width ; (for horizontal axis) ; test ds:[di].AI_attr, mask AA_VERTICAL jnz setValues xchg ax, bx setValues: mov ds:[di].AI_maxLabelSize.P_x, ax mov ds:[di].AI_maxLabelSize.P_y, bx .leave ret noLabelSize: clr ax, bx jmp setValues CategoryAxisComputeMaxLabelSizePart1 endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CategoryAxisGeometryPart2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: Do the final geometry calculations for a category axis. PASS: *ds:si = CategoryAxisClass object ds:di = CategoryAxisClass instance data es = Segment of CategoryAxisClass. RETURN: nothing DESTROYED: nothing REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- CDB 1/10/92 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CategoryAxisGeometryPart2 method dynamic CategoryAxisClass, MSG_AXIS_GEOMETRY_PART_2 uses ax,cx,dx,bp .enter ; call superclass to adjust plot bounds based on related axis. mov di, offset CategoryAxisClass call ObjCallSuperNoLock ; ; Now that we've got the plot bounds of the axis (which ; were adjusted based on the size of the related axis), ; re-calculate the maximum width of the labels for the ; horizontal axis. (height for vertical axis). ; push si DerefChartObject ds, si, di lea si, ds:[di].AI_tickMajorUnit call FloatPushNumber pop si call AxisRelValueToRelPosition call FloatFloatToDword ; ax <- major unit ECMakeSureZero dx test ds:[di].AI_attr, mask AA_VERTICAL jz horizontal mov ds:[di].AI_maxLabelSize.P_y, ax jmp done horizontal: mov ds:[di].AI_maxLabelSize.P_x, ax done: .leave ret CategoryAxisGeometryPart2 endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CategoryAxisGetValuePosition %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: PASS: *ds:si = CategoryAxisClass object ds:di = CategoryAxisClass instance data es = Segment of CategoryAxisClass. dx = category number RETURN: nothing DESTROYED: nothing REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- CDB 12/12/91 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CategoryAxisGetValuePosition method dynamic CategoryAxisClass, MSG_AXIS_GET_VALUE_POSITION ERROR -1 ; caller should be using ; MSG_CATEGORY_AXIS_GET_CATEGORY_POSITION instead CategoryAxisGetValuePosition endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CategoryAxisGetCategoryPosition %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: PASS: *ds:si = CategoryAxisClass object ds:di = CategoryAxisClass instance data es = Segment of CategoryAxisClass. dx = category number RETURN: FP stack: position DESTROYED: ax REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- CDB 12/12/91 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CategoryAxisGetCategoryPosition method dynamic CategoryAxisClass, MSG_CATEGORY_AXIS_GET_CATEGORY_POSITION .enter mov bx, dx call AxisTickToRelValue lea si, ds:[di].AI_tickMinorUnit call FloatPushNumber call FloatAdd call AxisRelValueToRelPosition call AxisRelPositionToPosition .leave ret CategoryAxisGetCategoryPosition endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CategoryAxisGetCategoryWidth %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: PASS: *ds:si = CategoryAxisClass object ds:di = CategoryAxisClass instance data es = Segment of CategoryAxisClass. RETURN: FP STACK: category width DESTROYED: nothing REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- CDB 1/ 9/92 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CategoryAxisGetCategoryWidth method dynamic CategoryAxisClass, MSG_CATEGORY_AXIS_GET_CATEGORY_WIDTH uses ax,cx,dx,bp .enter ; stick total plot distance on the fp stack call AxisGetPlotDistance call FloatWordToFloat ; get number of categoryes mov ax, MSG_CHART_GROUP_GET_CATEGORY_COUNT mov si, offset TemplateChartGroup call ObjCallInstanceNoLock mov ax, cx call FloatWordToFloat call FloatDivide call FloatDup ; FP: width width mov al, ds:[di].CAI_margin call FloatPushPercent call FloatMultiply ; FP: width width*margin call FloatSub ; FP: width-width*margin .leave ret CategoryAxisGetCategoryWidth endm AxisCode ends
Cubical/HITs/James/Inductive/Coherence.agda
thomas-lamiaux/cubical
1
2072
{- This file contains: - Path lemmas used in the colimit-equivalence proof. Verbose, indeed. But should be simple. The length mainly thanks to: - Degenerate cubes that seem "obvious", but have to be constructed manually; - J rule is cubersome to use, especially when iteratively applied, also it is overcomplicated to construct JRefl in nested cases. -} {-# OPTIONS --safe --experimental-lossy-unification #-} module Cubical.HITs.James.Inductive.Coherence where open import Cubical.Foundations.Prelude open import Cubical.Foundations.GroupoidLaws open import Cubical.Foundations.Function private variable ℓ ℓ' : Level -- Lots of degenerate cubes used as intial input to J rule private module _ {A : Type ℓ}(a : A) where degenerate1 : (i j k : I) → A degenerate1 i j k = hfill (λ k → λ { (i = i0) → a ; (i = i1) → doubleCompPath-filler (refl {x = a}) refl refl k j ; (j = i0) → a ; (j = i1) → a}) (inS a) k degenerate1' : (i j k : I) → A degenerate1' i j k = hfill (λ k → λ { (i = i0) → a ; (i = i1) → compPath-filler (refl {x = a}) refl k j ; (j = i0) → a ; (j = i1) → a}) (inS a) k degenerate1'' : (i j k : I) → A degenerate1'' i j k = hfill (λ k → λ { (i = i0) → a ; (i = i1) → compPath-filler (refl {x = a}) (refl ∙ refl) k j ; (j = i0) → a ; (j = i1) → degenerate1 i k i1}) (inS a) k module _ {B : Type ℓ'}(f : A → B) where degenerate2 : (i j k : I) → B degenerate2 i j k = hfill (λ k → λ { (i = i0) → f a ; (i = i1) → doubleCompPath-filler (refl {x = f a}) refl refl k j ; (j = i0) → f a ; (j = i1) → f a }) (inS (f a)) k degenerate3 : (i j k : I) → B degenerate3 i j k = hfill (λ k → λ { (i = i0) → f (doubleCompPath-filler (refl {x = a}) refl refl k j) ; (i = i1) → doubleCompPath-filler (refl {x = f a}) refl refl k j ; (j = i0) → f a ; (j = i1) → f a }) (inS (f a)) k someCommonDegenerateCube : (i j k : I) → B someCommonDegenerateCube i j k = hcomp (λ l → λ { (i = i0) → f a ; (i = i1) → degenerate3 k j l ; (j = i0) → f a ; (j = i1) → f a ; (k = i0) → f (degenerate1 i j l) ; (k = i1) → degenerate2 i j l }) (f a) degenerate4 : (i j k : I) → A degenerate4 i j k = hfill (λ k → λ { (i = i0) → compPath-filler (refl {x = a}) (refl ∙∙ refl ∙∙ refl) k j ; (i = i1) → doubleCompPath-filler (refl {x = a}) refl refl j k ; (j = i0) → a ; (j = i1) → (refl {x = a} ∙∙ refl ∙∙ refl) k }) (inS a) k degenerate5 : (i j k : I) → A degenerate5 i j k = hcomp (λ l → λ { (i = i0) → compPath-filler (refl {x = a}) (refl ∙∙ refl ∙∙ refl) k j ; (i = i1) → doubleCompPath-filler (refl {x = a}) refl refl (j ∧ ~ l) k ; (j = i0) → a ; (j = i1) → doubleCompPath-filler (refl {x = a}) refl refl (~ i ∨ ~ l) k ; (k = i0) → a ; (k = i1) → degenerate4 i j i1 }) (degenerate4 i j k) degenerate5' : (i j k : I) → A degenerate5' i j k = hfill (λ k → λ { (i = i0) → doubleCompPath-filler (refl {x = a}) refl (refl ∙ refl) k j ; (i = i1) → a ; (j = i0) → a ; (j = i1) → compPath-filler (refl {x = a}) refl (~ i) k }) (inS a) k -- Cubes of which mostly are constructed by J rule module _ {A : Type ℓ}{a : A} where coh-helper-refl : (q' : a ≡ a)(h : refl ≡ q') → refl ≡ refl ∙∙ refl ∙∙ q' coh-helper-refl q' h i j = hcomp (λ k → λ { (i = i0) → a ; (i = i1) → doubleCompPath-filler refl refl q' k j ; (j = i0) → a ; (j = i1) → h i k }) a coh-helper' : (b : A)(p : a ≡ b) (c : A)(q : b ≡ c) (q' : b ≡ c)(r : PathP (λ i → p i ≡ q i) p q') → refl ≡ (sym q) ∙∙ refl ∙∙ q' coh-helper' = J> J> coh-helper-refl coh-helper'-Refl1 : coh-helper' _ refl ≡ J> coh-helper-refl coh-helper'-Refl1 = transportRefl _ coh-helper'-Refl2 : coh-helper' _ refl _ refl ≡ coh-helper-refl coh-helper'-Refl2 = (λ i → coh-helper'-Refl1 i _ refl) ∙ transportRefl _ coh-helper : {b c : A}(p : a ≡ b)(q q' : b ≡ c) (h : PathP (λ i → p i ≡ q i) p q') → refl ≡ (sym q) ∙∙ refl ∙∙ q' coh-helper p = coh-helper' _ p _ coh-helper-Refl : coh-helper-refl ≡ coh-helper refl refl coh-helper-Refl = sym coh-helper'-Refl2 module _ {A : Type ℓ}{B : Type ℓ'}{a b c d : A} where doubleCompPath-cong-filler : {a' b' c' d' : B} (f : A → B) {pa : f a ≡ a'}{pb : f b ≡ b'}{pc : f c ≡ c'}{pd : f d ≡ d'} (p : a ≡ b)(q : b ≡ c)(r : c ≡ d) {p' : a' ≡ b'}{q' : b' ≡ c'}{r' : c' ≡ d'} (h : PathP (λ i → pa i ≡ pb i) (cong f p) p') (h' : PathP (λ i → pb i ≡ pc i) (cong f q) q') (h'' : PathP (λ i → pc i ≡ pd i) (cong f r) r') → (i j k : I) → B doubleCompPath-cong-filler f p q r {p' = p'} {q' = q'} {r' = r'} h h' h'' i j k = hfill (λ k → λ { (i = i0) → f (doubleCompPath-filler p q r k j) ; (i = i1) → doubleCompPath-filler p' q' r' k j ; (j = i0) → h i (~ k) ; (j = i1) → h'' i k }) (inS (h' i j)) k doubleCompPath-cong : (f : A → B) (p : a ≡ b)(q : b ≡ c)(r : c ≡ d) → cong f (p ∙∙ q ∙∙ r) ≡ cong f p ∙∙ cong f q ∙∙ cong f r doubleCompPath-cong f p q r i j = doubleCompPath-cong-filler f {pa = refl} {pb = refl} {pc = refl} {pd = refl} p q r refl refl refl i j i1 module _ {A : Type ℓ}{a b c : A} where comp-cong-square' : (p : a ≡ b)(q : a ≡ c) (r : b ≡ c)(h : r ≡ sym p ∙∙ refl ∙∙ q) → p ∙ r ≡ q comp-cong-square' p q r h i j = hcomp (λ k → λ { (i = i0) → compPath-filler p r k j ; (i = i1) → doubleCompPath-filler (sym p) refl q j k ; (j = i0) → a ; (j = i1) → h i k }) (p j) module _ {B : Type ℓ'} where comp-cong-square : (f : A → B) (p : a ≡ b)(q : b ≡ c) → cong f (p ∙ q) ≡ cong f p ∙ cong f q comp-cong-square f p q i j = hcomp (λ k → λ { (i = i0) → f (compPath-filler p q k j) ; (i = i1) → compPath-filler (cong f p) (cong f q) k j ; (j = i0) → f a ; (j = i1) → f (q k) }) (f (p j)) module _ {A : Type ℓ}{B : Type ℓ'}{a b c : A} (f : A → B)(p : a ≡ b) (q : f a ≡ f c)(r : b ≡ c) (h : cong f r ≡ sym (cong f p) ∙∙ refl ∙∙ q) where comp-cong-helper-filler : (i j k : I) → B comp-cong-helper-filler i j k = hfill (λ k → λ { (i = i0) → comp-cong-square f p r (~ k) j ; (i = i1) → q j ; (j = i0) → f a ; (j = i1) → f c }) (inS (comp-cong-square' _ _ _ h i j)) k comp-cong-helper : cong f (p ∙ r) ≡ q comp-cong-helper i j = comp-cong-helper-filler i j i1 module _ {A : Type ℓ}{a : A} where push-helper-refl : (q' : a ≡ a)(h : refl ≡ q') → refl ≡ refl ∙ q' push-helper-refl q' h i j = hcomp (λ k → λ { (i = i0) → a ; (i = i1) → compPath-filler refl q' k j ; (j = i0) → a ; (j = i1) → h i k }) a push-helper' : (b : A)(p : a ≡ b) (c : A)(q : b ≡ c) (q' : c ≡ c)(h : refl ≡ q') → PathP (λ i → p i ≡ q i) p (q ∙ q') push-helper' = J> J> push-helper-refl push-helper'-Refl1 : push-helper' _ refl ≡ J> push-helper-refl push-helper'-Refl1 = transportRefl _ push-helper'-Refl2 : push-helper' _ refl _ refl ≡ push-helper-refl push-helper'-Refl2 = (λ i → push-helper'-Refl1 i _ refl) ∙ transportRefl _ push-helper : {b c : A} (p : a ≡ b)(q : b ≡ c)(q' : c ≡ c)(h : refl ≡ q') → PathP (λ i → p i ≡ q i) p (q ∙ q') push-helper p = push-helper' _ p _ push-helper-Refl : push-helper-refl ≡ push-helper refl refl push-helper-Refl = sym push-helper'-Refl2 module _ {A : Type ℓ}{B : Type ℓ'}{a : A}(f : A → B) where push-helper-cong-Type : {b c : A} (p : a ≡ b)(q : b ≡ c) (q' : c ≡ c)(sqr : refl ≡ q') → Type _ push-helper-cong-Type p q q' sqr = SquareP (λ i j → f (push-helper p q _ sqr i j) ≡ push-helper (cong f p) (cong f q) _ (λ i j → f (sqr i j)) i j) (λ i j → f (p i)) (λ i j → comp-cong-square f q q' j i) (λ i j → f (p i)) (λ i j → f (q i)) push-helper-cong-refl : push-helper-cong-Type refl refl refl refl push-helper-cong-refl = transport (λ t → SquareP (λ i j → f (push-helper-Refl t _ (λ i j → a) i j) ≡ push-helper-Refl t _ (λ i j → f a) i j) (λ i j → f a) (λ i j → comp-cong-square f (refl {x = a}) refl j i) (λ i j → f a) (λ i j → f a)) (λ i j k → someCommonDegenerateCube a f i j k) push-helper-cong' : (b : A)(p : a ≡ b) (c : A)(q : b ≡ c) (q' : c ≡ c)(sqr : refl ≡ q') → push-helper-cong-Type p q q' sqr push-helper-cong' = J> J> J> push-helper-cong-refl push-helper-cong : ∀ {b c} p q q' sqr → push-helper-cong-Type {b = b} {c = c} p q q' sqr push-helper-cong p = push-helper-cong' _ p _ module _ {A : Type ℓ}{a : A} where push-coh-helper-Type : {b c : A} (p : a ≡ b)(q q' : b ≡ c) (sqr : PathP (λ i → p i ≡ q i) p q') → Type _ push-coh-helper-Type p q q' sqr = SquareP (λ i j → push-helper p q _ (coh-helper _ _ _ sqr) i j ≡ sqr i j) (λ i j → p i) (λ i j → comp-cong-square' q q' _ refl j i) (λ i j → p i) (λ i j → q i) push-coh-helper-refl' : SquareP (λ i j → push-helper-refl _ (coh-helper-refl _ (λ i j → a)) i j ≡ a) (λ i j → a) (λ i j → comp-cong-square' (refl {x = a}) refl _ refl j i) (λ i j → a) (λ i j → a) push-coh-helper-refl' i j k = hcomp (λ l → λ { (i = i0) → a ; (i = i1) → degenerate5 a k j l ; (j = i0) → a ; (j = i1) → degenerate1 a i l (~ k) ; (k = i0) → degenerate1'' a i j l ; (k = i1) → a }) a push-coh-helper-refl : push-coh-helper-Type refl refl refl refl push-coh-helper-refl = transport (λ t → SquareP (λ i j → push-helper-Refl t _ (coh-helper-Refl t _ (λ i j → a)) i j ≡ a) (λ i j → a) (λ i j → comp-cong-square' (refl {x = a}) refl _ refl j i) (λ i j → a) (λ i j → a)) push-coh-helper-refl' push-coh-helper' : (b : A)(p : a ≡ b) (c : A)(q : b ≡ c) (q' : b ≡ c)(sqr : PathP (λ i → p i ≡ q i) p q') → push-coh-helper-Type p q q' sqr push-coh-helper' = J> J> J> push-coh-helper-refl push-coh-helper : ∀ {b c} p q q' sqr → push-coh-helper-Type {b = b} {c = c} p q q' sqr push-coh-helper p q q' sqr = push-coh-helper' _ p _ q q' sqr module _ {A : Type ℓ}{a : A} where push-square-helper-refl : refl ∙∙ refl ∙∙ (refl ∙ refl) ≡ refl {x = a} push-square-helper-refl i j = degenerate5' a i j i1 push-square-helper' : (b : A)(q : a ≡ b) (c : A)(q' : b ≡ c) → sym q ∙∙ refl ∙∙ (q ∙ q') ≡ q' push-square-helper' = J> J> push-square-helper-refl push-square-helper'-Refl1 : push-square-helper' _ refl ≡ J> push-square-helper-refl push-square-helper'-Refl1 = transportRefl _ push-square-helper'-Refl2 : push-square-helper' _ refl _ refl ≡ push-square-helper-refl push-square-helper'-Refl2 = (λ i → push-square-helper'-Refl1 i _ refl) ∙ transportRefl _ push-square-helper : {b c : A} (q : a ≡ b)(q' : b ≡ c) → sym q ∙∙ refl ∙∙ (q ∙ q') ≡ q' push-square-helper p = push-square-helper' _ p _ push-square-helper-Refl : push-square-helper-refl ≡ push-square-helper refl refl push-square-helper-Refl = sym push-square-helper'-Refl2 module _ {A : Type ℓ}{a : A} where coh-cube-helper-Type : {b c : A}(p : a ≡ b)(q : b ≡ c) (q' : c ≡ c)(sqr : refl ≡ q') → Type _ coh-cube-helper-Type {c = c} p q q' sqr = SquareP (λ i j → coh-helper _ _ _ (push-helper p q q' sqr) i j ≡ sqr i j) (λ i j → c) (λ i j → push-square-helper q q' j i) (λ i j → c) (λ i j → c) coh-cube-helper-refl' : SquareP (λ i j → coh-helper-refl _ (push-helper-refl refl (λ i j → a)) i j ≡ a) (λ i j → a) (λ i j → push-square-helper-refl {a = a} j i) (λ i j → a) (λ i j → a) coh-cube-helper-refl' i j k = hcomp (λ l → λ { (i = i0) → a ; (i = i1) → degenerate5' a k j l ; (j = i0) → a ; (j = i1) → degenerate1' a i l (~ k) ; (k = i0) → degenerate1'' a i j l ; (k = i1) → a }) a coh-cube-helper-refl : coh-cube-helper-Type refl refl refl refl coh-cube-helper-refl = transport (λ t → SquareP (λ i j → coh-helper-Refl t _ (push-helper-Refl t refl (λ i j → a)) i j ≡ a) (λ i j → a) (λ i j → push-square-helper-Refl {a = a} t j i) (λ i j → a) (λ i j → a)) coh-cube-helper-refl' coh-cube-helper' : (b : A)(p : a ≡ b) (c : A)(q : b ≡ c) (q' : c ≡ c)(sqr : refl ≡ q') → coh-cube-helper-Type p q q' sqr coh-cube-helper' = J> J> J> coh-cube-helper-refl coh-cube-helper : ∀ {b c} p q q' sqr → coh-cube-helper-Type {b = b} {c = c} p q q' sqr coh-cube-helper p q q' sqr = coh-cube-helper' _ p _ q q' sqr module _ {A : Type ℓ}{B : Type ℓ'}{a : A}(f : A → B) where coh-helper-cong-Type : {b c : A}{a' b' c' : B} (pa : f a ≡ a')(pb : f b ≡ b')(pc : f c ≡ c') {p : a ≡ b }(q r : b ≡ c ) {p' : a' ≡ b'}{q' r' : b' ≡ c'} (h : PathP (λ i → pa i ≡ pb i) (cong f p) p') (h' : PathP (λ i → pb i ≡ pc i) (cong f q) q') (h'' : PathP (λ i → pb i ≡ pc i) (cong f r) r') (sqr : PathP (λ i → p i ≡ q i) p r) (sqr' : PathP (λ i → p' i ≡ q' i) p' r') → Type _ coh-helper-cong-Type pa pb pc q r h h' h'' sqr sqr' = SquareP (λ i j → f (coh-helper _ _ _ sqr i j) ≡ coh-helper _ _ _ (λ i j → sqr' i j) i j) (λ i j → pc j) (λ i j → doubleCompPath-cong-filler f (sym q) refl r (λ i j → h' i (~ j)) (λ i j → pb i) h'' j i i1) (λ i j → pc j) (λ i j → pc j) coh-helper-cong-refl : coh-helper-cong-Type refl refl refl refl refl refl refl refl refl refl coh-helper-cong-refl = transport (λ t → SquareP (λ i j → f (coh-helper-Refl t _ (λ i j → a) i j) ≡ coh-helper-Refl t _ (λ i j → f a) i j) (λ i j → f a) (λ i j → doubleCompPath-cong-filler f refl refl refl (λ i j → f a) (λ i j → f a) (λ i j → f a) j i i1) (λ i j → f a) (λ i j → f a)) (λ i j k → someCommonDegenerateCube a f i j k) coh-helper-cong' : (b : A)(p : a ≡ b) (c : A)(q : b ≡ c) (a' : B)(pa : f a ≡ a') (b' : B)(pb : f b ≡ b') (c' : B)(pc : f c ≡ c') (r : b ≡ c)(sqr : PathP (λ i → p i ≡ q i) p r) (p' : a' ≡ b')(h : PathP (λ i → pa i ≡ pb i) (cong f p) p') (q' : b' ≡ c')(h' : PathP (λ i → pb i ≡ pc i) (cong f q) q') (r' : b' ≡ c')(h'' : PathP (λ i → pb i ≡ pc i) (cong f r) r') (sqr' : PathP (λ i → p' i ≡ q' i) p' r') (hsqr : SquareP (λ i j → h i j ≡ h' i j) (λ i j → f (sqr i j)) sqr' h h'') → coh-helper-cong-Type pa pb pc q r h h' h'' sqr sqr' coh-helper-cong' = J> J> J> J> J> J> J> J> J> J> coh-helper-cong-refl coh-helper-cong : ∀ {b c a' b' c' pa pb pc} p q r {p' q' r' h h' h''} sqr {sqr'} (hsqr : SquareP (λ i j → f (sqr i j) ≡ sqr' i j) (λ i j → h j i) (λ i j → h'' j i) (λ i j → h j i) (λ i j → h' j i)) → coh-helper-cong-Type {b = b} {c = c} {a' = a'} {b' = b'} {c' = c'} pa pb pc q r {p' = p'} {q' = q'} {r' = r'} h h' h'' sqr sqr' coh-helper-cong p q r sqr hsqr = coh-helper-cong' _ p _ q _ _ _ _ _ _ r sqr _ _ _ _ _ _ _ (λ i j k → hsqr j k i)
awa/src/awa-events-services.ads
twdroeger/ada-awa
81
10844
<reponame>twdroeger/ada-awa<gh_stars>10-100 ----------------------------------------------------------------------- -- awa-events-services -- AWA Event Manager -- Copyright (C) 2012, 2016, 2020 <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 Ada.Finalization; with Ada.Containers.Doubly_Linked_Lists; with Util.Strings; with EL.Expressions; with EL.Beans; with AWA.Events.Models; with AWA.Events.Queues; with AWA.Events.Queues.Maps; with AWA.Events.Dispatchers; limited with AWA.Applications; package AWA.Events.Services is -- ------------------------------ -- Event manager -- ------------------------------ -- The `Event_Manager` manages the dispatch of event to the right event queue -- or to the event action. The event manager holds a list of actions that -- must be triggered for a particular event/queue pair. Such list is created -- and initialized when the application is configured. It never changes. type Event_Manager is tagged limited private; type Event_Manager_Access is access all Event_Manager'Class; -- Find the event queue identified by the given name. function Find_Queue (Manager : in Event_Manager; Name : in String) return AWA.Events.Queues.Queue_Ref; -- Add the event queue in the registry. procedure Add_Queue (Manager : in out Event_Manager; Queue : in AWA.Events.Queues.Queue_Ref); -- Send the event to the modules that subscribed to it. -- The event is sent on each event queue. Event queues will dispatch the event -- by invoking immediately or later on the `Dispatch`> operation. -- The synchronous or asynchronous reception of the event depends -- on the event queue. procedure Send (Manager : in Event_Manager; Event : in Module_Event'Class); -- Set the event message type which correspond to the `Kind` event index. procedure Set_Message_Type (Manager : in Event_Manager; Event : in out AWA.Events.Models.Message_Ref; Kind : in Event_Index); -- Set the event queue associated with the event message. -- The event queue identified by `Name` is searched to find the -- `Queue_Ref` instance. procedure Set_Event_Queue (Manager : in Event_Manager; Event : in out AWA.Events.Models.Message_Ref; Name : in String); -- Dispatch the event identified by `Event` and associated with the event -- queue `Queue`. The event actions which are associated with the event are -- executed synchronously. procedure Dispatch (Manager : in Event_Manager; Queue : in AWA.Events.Queues.Queue_Ref; Event : in Module_Event'Class); -- Add an action invoked when the event identified by `Event` is sent. -- The event is posted on the queue identified by `Queue`. -- When the event queue dispatches the event, the Ada bean identified -- by the method action represented by `Action` is created and initialized -- by evaluating and setting the parameters defined in `Params`. -- The action method is then invoked. procedure Add_Action (Manager : in out Event_Manager; Event : in String; Queue : in AWA.Events.Queues.Queue_Ref; Action : in EL.Expressions.Method_Expression; Params : in EL.Beans.Param_Vectors.Vector); -- Add a dispatcher to process the event queues matching the `Match` string. -- The dispatcher can create up to `Count` tasks running at the priority -- `Priority`. procedure Add_Dispatcher (Manager : in out Event_Manager; Match : in String; Count : in Positive; Priority : in Positive); type Application_Access is access all AWA.Applications.Application'Class; -- Initialize the event manager. procedure Initialize (Manager : in out Event_Manager; App : in Application_Access); -- Start the event manager. The dispatchers are configured to dispatch -- the event queues and tasks are started to process asynchronous events. procedure Start (Manager : in out Event_Manager); -- Stop the event manager. procedure Stop (Manager : in out Event_Manager); -- Get the application associated with the event manager. function Get_Application (Manager : in Event_Manager) return Application_Access; private use AWA.Events.Queues; -- An event queue associated with a dispatcher. type Queue_Dispatcher is record Queue : AWA.Events.Queues.Queue_Ref; Dispatcher : AWA.Events.Dispatchers.Dispatcher_Access := null; Model : AWA.Events.Models.Queue_Ref; end record; -- Finalize the queue dispatcher releasing the dispatcher memory. procedure Finalize (Object : in out Queue_Dispatcher); -- A list of event queue dispatcher. package Queue_Dispatcher_Lists is new Ada.Containers.Doubly_Linked_Lists (Element_Type => Queue_Dispatcher); -- A list of event queues for a given event. type Event_Queues is record Queues : Queue_Dispatcher_Lists.List; Name : Util.Strings.Name_Access; Event : AWA.Events.Models.Message_Type_Ref; end record; -- Finalize the event queues and the dispatchers. procedure Finalize (Object : in out Event_Queues); -- An array of event queue actions. type Event_Queues_Array is array (Event_Index range <>) of Event_Queues; type Event_Queues_Array_Access is access all Event_Queues_Array; type Event_Manager is new Ada.Finalization.Limited_Controlled with record Actions : Event_Queues_Array_Access := null; Queues : AWA.Events.Queues.Maps.Map; Application : Application_Access := null; Dispatchers : Events.Dispatchers.Dispatcher_Access_Array := (others => null); end record; -- Finalize the event manager by releasing the allocated storage. overriding procedure Finalize (Manager : in out Event_Manager); end AWA.Events.Services;
Cubical/Algebra/CommAlgebra/FreeCommAlgebra/Base.agda
thomas-lamiaux/cubical
0
3797
<gh_stars>0 {-# OPTIONS --safe #-} module Cubical.Algebra.CommAlgebra.FreeCommAlgebra.Base where {- The free commutative algebra over a commutative ring, or in other words the ring of polynomials with coefficients in a given ring. Note that this is a constructive definition, which entails that polynomials cannot be represented by lists of coefficients, where the last one is non-zero. For rings with decidable equality, that is still possible. I learned about this (and other) definition(s) from <NAME>. You can watch him talk about these things here: https://www.youtube.com/watch?v=VNp-f_9MnVk This file contains * the definition of the free commutative algebra on a type I over a commutative ring R as a HIT (let us call that R[I]) * a prove that the construction is an commutative R-algebra * definitions of the induced maps appearing in the universal property of R[I], that is: * for any map I → A, where A is a commutative R-algebra, the induced algebra homomorphism R[I] → A ('inducedHom') * for any hom R[I] → A, the 'restricttion to variables' I → A ('evaluateAt') * a proof that the two constructions are inverse to each other ('homRetrievable' and 'mapRetrievable') * a proof, that the corresponding pointwise equivalence of functors is natural ('naturalR', 'naturalL') -} open import Cubical.Foundations.Prelude open import Cubical.Algebra.CommRing open import Cubical.Algebra.CommAlgebra.Base private variable ℓ ℓ' : Level module Construction (R : CommRing ℓ) where open CommRingStr (snd R) using (1r; 0r) renaming (_+_ to _+r_; _·_ to _·r_) data R[_] (I : Type ℓ') : Type (ℓ-max ℓ ℓ') where var : I → R[ I ] const : fst R → R[ I ] _+_ : R[ I ] → R[ I ] → R[ I ] -_ : R[ I ] → R[ I ] _·_ : R[ I ] → R[ I ] → R[ I ] -- \cdot +-assoc : (x y z : R[ I ]) → x + (y + z) ≡ (x + y) + z +-rid : (x : R[ I ]) → x + (const 0r) ≡ x +-rinv : (x : R[ I ]) → x + (- x) ≡ (const 0r) +-comm : (x y : R[ I ]) → x + y ≡ y + x ·-assoc : (x y z : R[ I ]) → x · (y · z) ≡ (x · y) · z ·-lid : (x : R[ I ]) → (const 1r) · x ≡ x ·-comm : (x y : R[ I ]) → x · y ≡ y · x ldist : (x y z : R[ I ]) → (x + y) · z ≡ (x · z) + (y · z) +HomConst : (s t : fst R) → const (s +r t) ≡ const s + const t ·HomConst : (s t : fst R) → const (s ·r t) ≡ (const s) · (const t) 0-trunc : (x y : R[ I ]) (p q : x ≡ y) → p ≡ q _⋆_ : {I : Type ℓ'} → fst R → R[ I ] → R[ I ] r ⋆ x = const r · x ⋆-assoc : {I : Type ℓ'} → (s t : fst R) (x : R[ I ]) → (s ·r t) ⋆ x ≡ s ⋆ (t ⋆ x) ⋆-assoc s t x = const (s ·r t) · x ≡⟨ cong (λ u → u · x) (·HomConst _ _) ⟩ (const s · const t) · x ≡⟨ sym (·-assoc _ _ _) ⟩ const s · (const t · x) ≡⟨ refl ⟩ s ⋆ (t ⋆ x) ∎ ⋆-ldist-+ : {I : Type ℓ'} → (s t : fst R) (x : R[ I ]) → (s +r t) ⋆ x ≡ (s ⋆ x) + (t ⋆ x) ⋆-ldist-+ s t x = (s +r t) ⋆ x ≡⟨ cong (λ u → u · x) (+HomConst _ _) ⟩ (const s + const t) · x ≡⟨ ldist _ _ _ ⟩ (s ⋆ x) + (t ⋆ x) ∎ ⋆-rdist-+ : {I : Type ℓ'} → (s : fst R) (x y : R[ I ]) → s ⋆ (x + y) ≡ (s ⋆ x) + (s ⋆ y) ⋆-rdist-+ s x y = const s · (x + y) ≡⟨ ·-comm _ _ ⟩ (x + y) · const s ≡⟨ ldist _ _ _ ⟩ (x · const s) + (y · const s) ≡⟨ cong (λ u → u + (y · const s)) (·-comm _ _) ⟩ (s ⋆ x) + (y · const s) ≡⟨ cong (λ u → (s ⋆ x) + u) (·-comm _ _) ⟩ (s ⋆ x) + (s ⋆ y) ∎ ⋆-assoc-· : {I : Type ℓ'} → (s : fst R) (x y : R[ I ]) → (s ⋆ x) · y ≡ s ⋆ (x · y) ⋆-assoc-· s x y = (s ⋆ x) · y ≡⟨ sym (·-assoc _ _ _) ⟩ s ⋆ (x · y) ∎ 0a : {I : Type ℓ'} → R[ I ] 0a = (const 0r) 1a : {I : Type ℓ'} → R[ I ] 1a = (const 1r) isCommAlgebra : {I : Type ℓ'} → IsCommAlgebra R {A = R[ I ]} 0a 1a _+_ _·_ -_ _⋆_ isCommAlgebra = makeIsCommAlgebra 0-trunc +-assoc +-rid +-rinv +-comm ·-assoc ·-lid ldist ·-comm ⋆-assoc ⋆-rdist-+ ⋆-ldist-+ ·-lid ⋆-assoc-· _[_] : (R : CommRing ℓ) (I : Type ℓ') → CommAlgebra R (ℓ-max ℓ ℓ') (R [ I ]) = R[ I ] , commalgebrastr 0a 1a _+_ _·_ -_ _⋆_ isCommAlgebra where open Construction R
Soundness.agda
elpinal/exsub-ccc
3
11184
<reponame>elpinal/exsub-ccc<filename>Soundness.agda open import Theory open import Categories.Category using (Category) open import Categories.Category.CartesianClosed module Soundness {o ℓ e} (𝒞 : Category o ℓ e) (CC : CartesianClosed 𝒞) {ℓ₁ ℓ₂ ℓ₃} (Th : Theory ℓ₁ ℓ₂ ℓ₃) where open Theory.Theory Th open import Semantics 𝒞 CC Sg open import Syntax open Term Sg open import Categories.Category.Cartesian 𝒞 open import Categories.Category.BinaryProducts 𝒞 open import Categories.Object.Product 𝒞 open import Categories.Object.Terminal 𝒞 using (Terminal) open Category 𝒞 open CartesianClosed CC open Cartesian cartesian open BinaryProducts products module T = Terminal terminal open import Data.Product using (Σ; Σ-syntax; proj₁; proj₂) module _ (M : Model 𝒞 CC Th) where open Structure (proj₁ M) open HomReasoning soundness : forall {Γ A} {e₁ e₂ : Γ ⊢ A} -> Γ ⊢ e₁ ≡ e₂ -> ⟦ e₁ ⟧ ≈ ⟦ e₂ ⟧ soundness-sub : forall {Γ Γ′} {γ₁ γ₂ : Γ ⊨ Γ′} -> Γ ⊨ γ₁ ≡ γ₂ -> ⟦ γ₁ ⟧S ≈ ⟦ γ₂ ⟧S soundness (ax x) = proj₂ M x soundness refl = Equiv.refl soundness (sym D) = Equiv.sym (soundness D) soundness (trans D D₁) = Equiv.trans (soundness D) (soundness D₁) soundness sub/id = identityʳ soundness sub/∙ = sym-assoc soundness (eta/Unit e) = T.!-unique ⟦ e ⟧ soundness (beta/*₁ _ e₂) = project₁ soundness (beta/*₂ e₁ _) = project₂ soundness (eta/* _) = g-η soundness (beta/=> e e′) = begin ⟦ app (abs e) e′ ⟧ ≈˘⟨ ∘-resp-≈ʳ (Equiv.trans ⁂∘⟨⟩ (⟨⟩-cong₂ identityʳ identityˡ)) ⟩ eval′ ∘ (λg ⟦ e ⟧ ⁂ Category.id 𝒞) ∘ ⟨ Category.id 𝒞 , ⟦ e′ ⟧ ⟩ ≈⟨ Equiv.trans sym-assoc (∘-resp-≈ˡ β′) ⟩ ⟦ e [ ext Term.id e′ ] ⟧ ∎ soundness (eta/=> e) = begin ⟦ abs (app (e [ weaken ]) var) ⟧ ≈˘⟨ λ-cong (∘-resp-≈ʳ (⟨⟩-cong₂ Equiv.refl identityˡ)) ⟩ λg (eval′ ∘ ⟨ ⟦ e ⟧ ∘ π₁ , Category.id 𝒞 ∘ π₂ ⟩) ≈˘⟨ λ-cong (∘-resp-≈ʳ ⁂∘⟨⟩) ⟩ λg (eval′ ∘ (⟦ e ⟧ ⁂ Category.id 𝒞) ∘ ⟨ π₁ , π₂ ⟩) ≈⟨ λ-cong (∘-resp-≈ʳ (∘-resp-≈ʳ η)) ⟩ λg (eval′ ∘ (⟦ e ⟧ ⁂ Category.id 𝒞) ∘ Category.id 𝒞) ≈⟨ λ-cong (∘-resp-≈ʳ identityʳ) ⟩ λg (eval′ ∘ (⟦ e ⟧ ⁂ Category.id 𝒞)) ≈⟨ η-exp′ ⟩ ⟦ e ⟧ ∎ soundness (comm/func _ Γ′ γ f e) = assoc soundness (comm/unit _ Γ′ γ) = Equiv.sym (T.!-unique (T.! ∘ ⟦ γ ⟧S)) soundness comm/pair = Product.∘-distribʳ-⟨⟩ product soundness comm/fst = assoc soundness comm/snd = assoc soundness (comm/abs {γ = γ} {e = e}) = begin λg ⟦ e ⟧ ∘ ⟦ γ ⟧S ≈⟨ exp.subst product product ⟩ λg (⟦ e ⟧ ∘ (⟦ γ ⟧S ⁂ Category.id 𝒞)) ≈˘⟨ λ-cong (∘-resp-≈ʳ (Equiv.trans (∘-resp-≈ʳ η) identityʳ)) ⟩ λg (⟦ e ⟧ ∘ (⟦ γ ⟧S ⁂ Category.id 𝒞) ∘ ⟨ π₁ , π₂ ⟩) ≈⟨ λ-cong (∘-resp-≈ʳ (⁂∘⟨⟩)) ⟩ λg (⟦ e ⟧ ∘ ⟨ ⟦ γ ⟧S ∘ π₁ , Category.id 𝒞 ∘ π₂ ⟩) ≈⟨ λ-cong (∘-resp-≈ʳ (⟨⟩-cong₂ Equiv.refl identityˡ)) ⟩ λg (⟦ e ⟧ ∘ ⟨ ⟦ γ ⟧S ∘ π₁ , π₂ ⟩ ) ∎ soundness comm/app = Equiv.trans assoc (∘-resp-≈ʳ ⟨⟩∘) soundness (var/ext γ _) = project₂ soundness (cong/sub D D′) = ∘-resp-≈ (soundness D′) (soundness-sub D) soundness (cong/pair D D₁) = ⟨⟩-cong₂ (soundness D) (soundness D₁) soundness (cong/fst D) = ∘-resp-≈ʳ (soundness D) soundness (cong/snd D) = ∘-resp-≈ʳ (soundness D) soundness (cong/app D D₁) = ∘-resp-≈ʳ (⟨⟩-cong₂ (soundness D) (soundness D₁)) soundness (cong/abs D) = λ-cong (soundness D) soundness (cong/func D) = ∘-resp-≈ Equiv.refl (soundness D) soundness-sub refl = Equiv.refl soundness-sub (sym D) = Equiv.sym (soundness-sub D) soundness-sub (trans D D₁) = Equiv.trans (soundness-sub D) (soundness-sub D₁) soundness-sub (!-unique {γ = γ}) = T.!-unique ⟦ γ ⟧S soundness-sub η-pair = begin ⟨ π₁ , π₂ ⟩ ≈⟨ Product.η product ⟩ Category.id 𝒞 ∎ soundness-sub ext∙ = ⟨⟩∘ soundness-sub (cong/ext D D′) = ⟨⟩-cong₂ (soundness-sub D) (soundness D′) soundness-sub weaken/ext = project₁ soundness-sub (cong/∙ D D₁) = ∘-resp-≈ (soundness-sub D) (soundness-sub D₁) soundness-sub id∙ˡ = identityˡ soundness-sub id∙ʳ = identityʳ soundness-sub assoc∙ = assoc
FFI/MachineWord.agda
Lolirofle/stuff-in-agda
6
16428
module FFI.MachineWord where import Lvl open import Data.Boolean open import Numeral.Natural open import String open import Syntax.Number open import Type postulate Word64 : Type{Lvl.𝟎} {-# BUILTIN WORD64 Word64 #-} private module Primitives where primitive primWord64ToNat : Word64 → ℕ primitive primWord64FromNat : ℕ → Word64 module Word64 where open Primitives renaming ( primWord64ToNat to toℕ ; primWord64FromNat to fromℕ ) public instance Word64-infiniteNumeral : InfiniteNumeral(Word64) Word64-infiniteNumeral = InfiniteNumeral.intro fromℕ
programs/oeis/014/A014675.asm
karttu/loda
0
80488
; A014675: The infinite Fibonacci word (start with 1, apply 1->2, 2->21, take limit). ; 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,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 mov $9,$0 mov $11,2 lpb $11,1 clr $0,9 mov $0,$9 sub $11,1 add $0,$11 sub $0,1 mov $4,$0 add $4,2 add $7,5 mul $7,$4 div $4,18 sub $7,1 sub $7,$4 div $7,8 mov $1,$7 mov $12,$11 lpb $12,1 mov $10,$1 sub $12,1 lpe lpe lpb $9,1 mov $9,0 sub $10,$1 lpe mov $1,$10 add $1,1
audio/sfx/battle_2f.asm
etdv-thevoid/pokemon-rgb-enhanced
1
102285
SFX_Battle_2F_Ch4: dutycycle 43 unknownsfx0x20 3, 241, 240, 7 unknownsfx0x20 4, 242, 0, 2 loopchannel 8, SFX_Battle_2F_Ch4 endchannel SFX_Battle_2F_Ch5: dutycycle 179 unknownsfx0x20 4, 226, 2, 2 unknownsfx0x20 4, 225, 226, 7 loopchannel 9, SFX_Battle_2F_Ch5 endchannel SFX_Battle_2F_Ch7: unknownnoise0x20 4, 255, 67 unknownnoise0x20 4, 242, 68 loopchannel 9, SFX_Battle_2F_Ch7 endchannel
source/strings/a-stwima.ads
ytomino/drake
33
8222
<filename>source/strings/a-stwima.ads pragma License (Unrestricted); with Ada.Strings.Maps; package Ada.Strings.Wide_Maps is pragma Preelaborate; -- Representation for a set of Wide_Character values: -- modified -- type Wide_Character_Set is private; subtype Wide_Character_Set is Maps.Character_Set; -- modified -- Null_Set : constant Wide_Character_Set; function Null_Set return Wide_Character_Set renames Maps.Null_Set; -- type Wide_Character_Range is record -- Low : Wide_Character; -- High : Wide_Character; -- end record; subtype Wide_Character_Range is Maps.Wide_Character_Range; -- Represents Wide_Character range Low..High -- type Wide_Character_Ranges is -- array (Positive range <>) of Wide_Character_Range; subtype Wide_Character_Ranges is Maps.Wide_Character_Ranges; function To_Set (Ranges : Wide_Character_Ranges) return Wide_Character_Set renames Maps.Overloaded_To_Set; function To_Set (Span : Wide_Character_Range) return Wide_Character_Set renames Maps.Overloaded_To_Set; function To_Ranges (Set : Wide_Character_Set) return Wide_Character_Ranges renames Maps.Overloaded_To_Ranges; function "=" (Left, Right : Wide_Character_Set) return Boolean renames Maps."="; function "not" (Right : Wide_Character_Set) return Wide_Character_Set renames Maps."not"; function "and" (Left, Right : Wide_Character_Set) return Wide_Character_Set renames Maps."and"; function "or" (Left, Right : Wide_Character_Set) return Wide_Character_Set renames Maps."or"; function "xor" (Left, Right : Wide_Character_Set) return Wide_Character_Set renames Maps."xor"; function "-" (Left, Right : Wide_Character_Set) return Wide_Character_Set renames Maps."-"; function Is_In ( Element : Wide_Character; Set : Wide_Character_Set) return Boolean renames Maps.Overloaded_Is_In; function Is_Subset ( Elements : Wide_Character_Set; Set : Wide_Character_Set) return Boolean renames Maps.Is_Subset; function "<=" ( Left : Wide_Character_Set; Right : Wide_Character_Set) return Boolean renames Maps.Is_Subset; -- Alternative representation for a set of Wide_Character values: subtype Wide_Character_Sequence is Wide_String; function To_Set (Sequence : Wide_Character_Sequence) return Wide_Character_Set renames Maps.Overloaded_To_Set; function To_Set (Singleton : Wide_Character) return Wide_Character_Set renames Maps.Overloaded_To_Set; function To_Sequence (Set : Wide_Character_Set) return Wide_Character_Sequence renames Maps.Overloaded_To_Sequence; -- Representation for a Wide_Character to -- Wide_Character mapping: -- modified -- type Wide_Character_Mapping is private; subtype Wide_Character_Mapping is Maps.Character_Mapping; function Value ( Map : Wide_Character_Mapping; Element : Wide_Character) return Wide_Character renames Maps.Overloaded_Value; -- modified -- Identity : constant Wide_Character_Mapping; function Identity return Wide_Character_Mapping renames Maps.Identity; function To_Mapping (From, To : Wide_Character_Sequence) return Wide_Character_Mapping renames Maps.Overloaded_To_Mapping; function To_Domain (Map : Wide_Character_Mapping) return Wide_Character_Sequence renames Maps.Overloaded_To_Domain; function To_Range (Map : Wide_Character_Mapping) return Wide_Character_Sequence renames Maps.Overloaded_To_Range; type Wide_Character_Mapping_Function is access function (From : Wide_Character) return Wide_Character; end Ada.Strings.Wide_Maps;
1_5.asm
EduardaSRBastos/Assembly-2020
0
160881
mov ah, 9 ;Escrever frase no ecra lea dx, texto1 ;dx aponta para a memoria texto1 int 21h ;interromper ret ;return texto1 db 'Ola,', 0ah,0dh, ' mundo!', 0ah, '!!$' ;db=define byte end
固件源码/三代控A12-带模型命名源码-易深工程/List/____hi0.asm
wooddoor/Loli3
47
245299
;-------------------------------------------------------- ; File Created by SDCC : free open source ANSI-C Compiler ; Version 3.9.0 #11195 (MINGW32) ;-------------------------------------------------------- .module ____hi0 .optsdcc -mmcs51 --model-small ;-------------------------------------------------------- ; Public variables in this module ;-------------------------------------------------------- .globl _main .globl ____TR1 .globl ____TR0 .globl ____TI .globl ____TF1 .globl ____TF0 .globl ____TB8 .globl ____SM2 .globl ____SM1 .globl ____SM0 .globl ____RS1 .globl ____RS0 .globl ____RI .globl ____REN .globl ____RB8 .globl ____PX1 .globl ____PX0 .globl ____PT1 .globl ____PT0 .globl ____PS .globl ____PPCA .globl ____PLVD .globl ____PADC .globl ____P53 .globl ____P52 .globl ____P51 .globl ____P50 .globl ____P47 .globl ____P46 .globl ____P45 .globl ____P44 .globl ____P43 .globl ____P42 .globl ____P41 .globl ____P40 .globl ____P37 .globl ____P36 .globl ____P35 .globl ____P34 .globl ____P33 .globl ____P32 .globl ____P31 .globl ____P30 .globl ____P27 .globl ____P26 .globl ____P25 .globl ____P24 .globl ____P23 .globl ____P22 .globl ____P21 .globl ____P20 .globl ____P17 .globl ____P16 .globl ____P15 .globl ____P14 .globl ____P13 .globl ____P12 .globl ____P11 .globl ____P10 .globl ____P07 .globl ____P06 .globl ____P05 .globl ____P04 .globl ____P03 .globl ____P02 .globl ____P01 .globl ____P00 .globl ____P .globl ____OV .globl ____IT1 .globl ____IT0 .globl ____IE1 .globl ____IE0 .globl ____F0 .globl ____EX1 .globl ____EX0 .globl ____ET1 .globl ____ET0 .globl ____ES .globl ____ELVD .globl ____EADC .globl ____EA .globl ____CY .globl ____CR .globl ____CF .globl ____CCF1 .globl ____CCF0 .globl ____AC .globl ____WDT_CONTR .globl ____WAKE_CLKO .globl ____TMOD .globl ____TL1 .globl ____TL0 .globl ____TH1 .globl ____TH0 .globl ____TCON .globl ____SPSTAT .globl ____SPDAT .globl ____SPCTL .globl ____SP .globl ____SCON .globl ____SBUF .globl ____SADEN .globl ____SADDR .globl ____S2CON .globl ____S2BUF .globl ____PSW .globl ____PCON .globl ____PCA_PWM1 .globl ____PCA_PWM0 .globl ____P5M1 .globl ____P5M0 .globl ____P5 .globl ____P4SW .globl ____P4M1 .globl ____P4M0 .globl ____P4 .globl ____P3M1 .globl ____P3M0 .globl ____P3 .globl ____P2M1 .globl ____P2M0 .globl ____P2 .globl ____P1M1 .globl ____P1M0 .globl ____P1ASF .globl ____P1 .globl ____P0M1 .globl ____P0M0 .globl ____P0 .globl ____IPH2 .globl ____IPH .globl ____IP2 .globl ____IP .globl ____IE2 .globl ____IE .globl ____IAP_TRIG .globl ____IAP_DATA .globl ____IAP_CONTR .globl ____IAP_CMD .globl ____IAP_ADDRL .globl ____IAP_ADDRH .globl ____DPL .globl ____DPH .globl ____CMOD .globl ____CLK_DIV .globl ____CL .globl ____CH .globl ____CCON .globl ____CCAPM1 .globl ____CCAPM0 .globl ____CCAP1L .globl ____CCAP1H .globl ____CCAP0L .globl ____CCAP0H .globl ____BUS_SPEED .globl ____BRT .globl ____B .globl ____AUXR1 .globl ____AUXR .globl ____ADC_RESL .globl ____ADC_RES .globl ____ADC_CONTR .globl ____ACC ;-------------------------------------------------------- ; special function registers ;-------------------------------------------------------- .area RSEG (ABS,DATA) .org 0x0000 G$___ACC$0_0$0 == 0x00e0 ____ACC = 0x00e0 G$___ADC_CONTR$0_0$0 == 0x00bc ____ADC_CONTR = 0x00bc G$___ADC_RES$0_0$0 == 0x00bd ____ADC_RES = 0x00bd G$___ADC_RESL$0_0$0 == 0x00be ____ADC_RESL = 0x00be G$___AUXR$0_0$0 == 0x008e ____AUXR = 0x008e G$___AUXR1$0_0$0 == 0x00a2 ____AUXR1 = 0x00a2 G$___B$0_0$0 == 0x00f0 ____B = 0x00f0 G$___BRT$0_0$0 == 0x009c ____BRT = 0x009c G$___BUS_SPEED$0_0$0 == 0x00a1 ____BUS_SPEED = 0x00a1 G$___CCAP0H$0_0$0 == 0x00fa ____CCAP0H = 0x00fa G$___CCAP0L$0_0$0 == 0x00ea ____CCAP0L = 0x00ea G$___CCAP1H$0_0$0 == 0x00fb ____CCAP1H = 0x00fb G$___CCAP1L$0_0$0 == 0x00eb ____CCAP1L = 0x00eb G$___CCAPM0$0_0$0 == 0x00da ____CCAPM0 = 0x00da G$___CCAPM1$0_0$0 == 0x00db ____CCAPM1 = 0x00db G$___CCON$0_0$0 == 0x00d8 ____CCON = 0x00d8 G$___CH$0_0$0 == 0x00f9 ____CH = 0x00f9 G$___CL$0_0$0 == 0x00e9 ____CL = 0x00e9 G$___CLK_DIV$0_0$0 == 0x0097 ____CLK_DIV = 0x0097 G$___CMOD$0_0$0 == 0x00d9 ____CMOD = 0x00d9 G$___DPH$0_0$0 == 0x0083 ____DPH = 0x0083 G$___DPL$0_0$0 == 0x0082 ____DPL = 0x0082 G$___IAP_ADDRH$0_0$0 == 0x00c3 ____IAP_ADDRH = 0x00c3 G$___IAP_ADDRL$0_0$0 == 0x00c4 ____IAP_ADDRL = 0x00c4 G$___IAP_CMD$0_0$0 == 0x00c5 ____IAP_CMD = 0x00c5 G$___IAP_CONTR$0_0$0 == 0x00c7 ____IAP_CONTR = 0x00c7 G$___IAP_DATA$0_0$0 == 0x00c2 ____IAP_DATA = 0x00c2 G$___IAP_TRIG$0_0$0 == 0x00c6 ____IAP_TRIG = 0x00c6 G$___IE$0_0$0 == 0x00a8 ____IE = 0x00a8 G$___IE2$0_0$0 == 0x00af ____IE2 = 0x00af G$___IP$0_0$0 == 0x00b8 ____IP = 0x00b8 G$___IP2$0_0$0 == 0x00b5 ____IP2 = 0x00b5 G$___IPH$0_0$0 == 0x00b7 ____IPH = 0x00b7 G$___IPH2$0_0$0 == 0x00b6 ____IPH2 = 0x00b6 G$___P0$0_0$0 == 0x0080 ____P0 = 0x0080 G$___P0M0$0_0$0 == 0x0094 ____P0M0 = 0x0094 G$___P0M1$0_0$0 == 0x0093 ____P0M1 = 0x0093 G$___P1$0_0$0 == 0x0090 ____P1 = 0x0090 G$___P1ASF$0_0$0 == 0x009d ____P1ASF = 0x009d G$___P1M0$0_0$0 == 0x0092 ____P1M0 = 0x0092 G$___P1M1$0_0$0 == 0x0091 ____P1M1 = 0x0091 G$___P2$0_0$0 == 0x00a0 ____P2 = 0x00a0 G$___P2M0$0_0$0 == 0x0096 ____P2M0 = 0x0096 G$___P2M1$0_0$0 == 0x0095 ____P2M1 = 0x0095 G$___P3$0_0$0 == 0x00b0 ____P3 = 0x00b0 G$___P3M0$0_0$0 == 0x00b2 ____P3M0 = 0x00b2 G$___P3M1$0_0$0 == 0x00b1 ____P3M1 = 0x00b1 G$___P4$0_0$0 == 0x00c0 ____P4 = 0x00c0 G$___P4M0$0_0$0 == 0x00b4 ____P4M0 = 0x00b4 G$___P4M1$0_0$0 == 0x00b3 ____P4M1 = 0x00b3 G$___P4SW$0_0$0 == 0x00bb ____P4SW = 0x00bb G$___P5$0_0$0 == 0x00c8 ____P5 = 0x00c8 G$___P5M0$0_0$0 == 0x00ca ____P5M0 = 0x00ca G$___P5M1$0_0$0 == 0x00c9 ____P5M1 = 0x00c9 G$___PCA_PWM0$0_0$0 == 0x00f2 ____PCA_PWM0 = 0x00f2 G$___PCA_PWM1$0_0$0 == 0x00f3 ____PCA_PWM1 = 0x00f3 G$___PCON$0_0$0 == 0x0087 ____PCON = 0x0087 G$___PSW$0_0$0 == 0x00d0 ____PSW = 0x00d0 G$___S2BUF$0_0$0 == 0x009b ____S2BUF = 0x009b G$___S2CON$0_0$0 == 0x009a ____S2CON = 0x009a G$___SADDR$0_0$0 == 0x00a9 ____SADDR = 0x00a9 G$___SADEN$0_0$0 == 0x00b9 ____SADEN = 0x00b9 G$___SBUF$0_0$0 == 0x0099 ____SBUF = 0x0099 G$___SCON$0_0$0 == 0x0098 ____SCON = 0x0098 G$___SP$0_0$0 == 0x0081 ____SP = 0x0081 G$___SPCTL$0_0$0 == 0x00ce ____SPCTL = 0x00ce G$___SPDAT$0_0$0 == 0x00cf ____SPDAT = 0x00cf G$___SPSTAT$0_0$0 == 0x00cd ____SPSTAT = 0x00cd G$___TCON$0_0$0 == 0x0088 ____TCON = 0x0088 G$___TH0$0_0$0 == 0x008c ____TH0 = 0x008c G$___TH1$0_0$0 == 0x008d ____TH1 = 0x008d G$___TL0$0_0$0 == 0x008a ____TL0 = 0x008a G$___TL1$0_0$0 == 0x008b ____TL1 = 0x008b G$___TMOD$0_0$0 == 0x0089 ____TMOD = 0x0089 G$___WAKE_CLKO$0_0$0 == 0x008f ____WAKE_CLKO = 0x008f G$___WDT_CONTR$0_0$0 == 0x00c1 ____WDT_CONTR = 0x00c1 ;-------------------------------------------------------- ; special function bits ;-------------------------------------------------------- .area RSEG (ABS,DATA) .org 0x0000 G$___AC$0_0$0 == 0x00d6 ____AC = 0x00d6 G$___CCF0$0_0$0 == 0x00d8 ____CCF0 = 0x00d8 G$___CCF1$0_0$0 == 0x00d9 ____CCF1 = 0x00d9 G$___CF$0_0$0 == 0x00df ____CF = 0x00df G$___CR$0_0$0 == 0x00de ____CR = 0x00de G$___CY$0_0$0 == 0x00d7 ____CY = 0x00d7 G$___EA$0_0$0 == 0x00af ____EA = 0x00af G$___EADC$0_0$0 == 0x00ad ____EADC = 0x00ad G$___ELVD$0_0$0 == 0x00ae ____ELVD = 0x00ae G$___ES$0_0$0 == 0x00ac ____ES = 0x00ac G$___ET0$0_0$0 == 0x00a9 ____ET0 = 0x00a9 G$___ET1$0_0$0 == 0x00ab ____ET1 = 0x00ab G$___EX0$0_0$0 == 0x00a8 ____EX0 = 0x00a8 G$___EX1$0_0$0 == 0x00aa ____EX1 = 0x00aa G$___F0$0_0$0 == 0x00d5 ____F0 = 0x00d5 G$___IE0$0_0$0 == 0x0089 ____IE0 = 0x0089 G$___IE1$0_0$0 == 0x008b ____IE1 = 0x008b G$___IT0$0_0$0 == 0x0088 ____IT0 = 0x0088 G$___IT1$0_0$0 == 0x008a ____IT1 = 0x008a G$___OV$0_0$0 == 0x00d2 ____OV = 0x00d2 G$___P$0_0$0 == 0x00d0 ____P = 0x00d0 G$___P00$0_0$0 == 0x0080 ____P00 = 0x0080 G$___P01$0_0$0 == 0x0081 ____P01 = 0x0081 G$___P02$0_0$0 == 0x0082 ____P02 = 0x0082 G$___P03$0_0$0 == 0x0083 ____P03 = 0x0083 G$___P04$0_0$0 == 0x0084 ____P04 = 0x0084 G$___P05$0_0$0 == 0x0085 ____P05 = 0x0085 G$___P06$0_0$0 == 0x0086 ____P06 = 0x0086 G$___P07$0_0$0 == 0x0087 ____P07 = 0x0087 G$___P10$0_0$0 == 0x0090 ____P10 = 0x0090 G$___P11$0_0$0 == 0x0091 ____P11 = 0x0091 G$___P12$0_0$0 == 0x0092 ____P12 = 0x0092 G$___P13$0_0$0 == 0x0093 ____P13 = 0x0093 G$___P14$0_0$0 == 0x0094 ____P14 = 0x0094 G$___P15$0_0$0 == 0x0095 ____P15 = 0x0095 G$___P16$0_0$0 == 0x0096 ____P16 = 0x0096 G$___P17$0_0$0 == 0x0097 ____P17 = 0x0097 G$___P20$0_0$0 == 0x00a0 ____P20 = 0x00a0 G$___P21$0_0$0 == 0x00a1 ____P21 = 0x00a1 G$___P22$0_0$0 == 0x00a2 ____P22 = 0x00a2 G$___P23$0_0$0 == 0x00a3 ____P23 = 0x00a3 G$___P24$0_0$0 == 0x00a4 ____P24 = 0x00a4 G$___P25$0_0$0 == 0x00a5 ____P25 = 0x00a5 G$___P26$0_0$0 == 0x00a6 ____P26 = 0x00a6 G$___P27$0_0$0 == 0x00a7 ____P27 = 0x00a7 G$___P30$0_0$0 == 0x00b0 ____P30 = 0x00b0 G$___P31$0_0$0 == 0x00b1 ____P31 = 0x00b1 G$___P32$0_0$0 == 0x00b2 ____P32 = 0x00b2 G$___P33$0_0$0 == 0x00b3 ____P33 = 0x00b3 G$___P34$0_0$0 == 0x00b4 ____P34 = 0x00b4 G$___P35$0_0$0 == 0x00b5 ____P35 = 0x00b5 G$___P36$0_0$0 == 0x00b6 ____P36 = 0x00b6 G$___P37$0_0$0 == 0x00b7 ____P37 = 0x00b7 G$___P40$0_0$0 == 0x00c0 ____P40 = 0x00c0 G$___P41$0_0$0 == 0x00c1 ____P41 = 0x00c1 G$___P42$0_0$0 == 0x00c2 ____P42 = 0x00c2 G$___P43$0_0$0 == 0x00c3 ____P43 = 0x00c3 G$___P44$0_0$0 == 0x00c4 ____P44 = 0x00c4 G$___P45$0_0$0 == 0x00c5 ____P45 = 0x00c5 G$___P46$0_0$0 == 0x00c6 ____P46 = 0x00c6 G$___P47$0_0$0 == 0x00c7 ____P47 = 0x00c7 G$___P50$0_0$0 == 0x00c8 ____P50 = 0x00c8 G$___P51$0_0$0 == 0x00c9 ____P51 = 0x00c9 G$___P52$0_0$0 == 0x00ca ____P52 = 0x00ca G$___P53$0_0$0 == 0x00cb ____P53 = 0x00cb G$___PADC$0_0$0 == 0x00bd ____PADC = 0x00bd G$___PLVD$0_0$0 == 0x00be ____PLVD = 0x00be G$___PPCA$0_0$0 == 0x00bf ____PPCA = 0x00bf G$___PS$0_0$0 == 0x00bc ____PS = 0x00bc G$___PT0$0_0$0 == 0x00b9 ____PT0 = 0x00b9 G$___PT1$0_0$0 == 0x00bb ____PT1 = 0x00bb G$___PX0$0_0$0 == 0x00b8 ____PX0 = 0x00b8 G$___PX1$0_0$0 == 0x00ba ____PX1 = 0x00ba G$___RB8$0_0$0 == 0x009a ____RB8 = 0x009a G$___REN$0_0$0 == 0x009c ____REN = 0x009c G$___RI$0_0$0 == 0x0098 ____RI = 0x0098 G$___RS0$0_0$0 == 0x00d3 ____RS0 = 0x00d3 G$___RS1$0_0$0 == 0x00d4 ____RS1 = 0x00d4 G$___SM0$0_0$0 == 0x009f ____SM0 = 0x009f G$___SM1$0_0$0 == 0x009e ____SM1 = 0x009e G$___SM2$0_0$0 == 0x009d ____SM2 = 0x009d G$___TB8$0_0$0 == 0x009b ____TB8 = 0x009b G$___TF0$0_0$0 == 0x008d ____TF0 = 0x008d G$___TF1$0_0$0 == 0x008f ____TF1 = 0x008f G$___TI$0_0$0 == 0x0099 ____TI = 0x0099 G$___TR0$0_0$0 == 0x008c ____TR0 = 0x008c G$___TR1$0_0$0 == 0x008e ____TR1 = 0x008e ;-------------------------------------------------------- ; overlayable register banks ;-------------------------------------------------------- .area REG_BANK_0 (REL,OVR,DATA) .ds 8 ;-------------------------------------------------------- ; internal ram data ;-------------------------------------------------------- .area DSEG (DATA) ;-------------------------------------------------------- ; overlayable items in internal ram ;-------------------------------------------------------- ;-------------------------------------------------------- ; Stack segment in internal ram ;-------------------------------------------------------- .area SSEG __start__stack: .ds 1 ;-------------------------------------------------------- ; indirectly addressable internal ram data ;-------------------------------------------------------- .area ISEG (DATA) ;-------------------------------------------------------- ; absolute internal ram data ;-------------------------------------------------------- .area IABS (ABS,DATA) .area IABS (ABS,DATA) ;-------------------------------------------------------- ; bit data ;-------------------------------------------------------- .area BSEG (BIT) ;-------------------------------------------------------- ; paged external ram data ;-------------------------------------------------------- .area PSEG (PAG,XDATA) ;-------------------------------------------------------- ; external ram data ;-------------------------------------------------------- .area XSEG (XDATA) ;-------------------------------------------------------- ; absolute external ram data ;-------------------------------------------------------- .area XABS (ABS,XDATA) ;-------------------------------------------------------- ; external initialized ram data ;-------------------------------------------------------- .area XISEG (XDATA) .area HOME (CODE) .area GSINIT0 (CODE) .area GSINIT1 (CODE) .area GSINIT2 (CODE) .area GSINIT3 (CODE) .area GSINIT4 (CODE) .area GSINIT5 (CODE) .area GSINIT (CODE) .area GSFINAL (CODE) .area CSEG (CODE) ;-------------------------------------------------------- ; interrupt vector ;-------------------------------------------------------- .area HOME (CODE) __interrupt_vect: ljmp __sdcc_gsinit_startup ;-------------------------------------------------------- ; global & static initialisations ;-------------------------------------------------------- .area HOME (CODE) .area GSINIT (CODE) .area GSFINAL (CODE) .area GSINIT (CODE) .globl __sdcc_gsinit_startup .globl __sdcc_program_startup .globl __start__stack .globl __mcs51_genXINIT .globl __mcs51_genXRAMCLEAR .globl __mcs51_genRAMCLEAR .area GSFINAL (CODE) ljmp __sdcc_program_startup ;-------------------------------------------------------- ; Home ;-------------------------------------------------------- .area HOME (CODE) .area HOME (CODE) __sdcc_program_startup: ljmp _main ; return from main will return to caller ;-------------------------------------------------------- ; code ;-------------------------------------------------------- .area CSEG (CODE) ;------------------------------------------------------------ ;Allocation info for local variables in function 'main' ;------------------------------------------------------------ G$main$0$0 ==. C$____hi0.c$3$0_0$1 ==. ; ____hi0.c:3: int main() ; ----------------------------------------- ; function main ; ----------------------------------------- _main: ar7 = 0x07 ar6 = 0x06 ar5 = 0x05 ar4 = 0x04 ar3 = 0x03 ar2 = 0x02 ar1 = 0x01 ar0 = 0x00 C$____hi0.c$5$1_0$1 ==. ; ____hi0.c:5: return 0; mov dptr,#0x0000 C$____hi0.c$6$1_0$1 ==. ; ____hi0.c:6: } C$____hi0.c$6$1_0$1 ==. XG$main$0$0 ==. ret .area CSEG (CODE) .area CONST (CODE) .area XINIT (CODE) .area CABS (ABS,CODE)
3-mid/impact/source/3d/collision/narrowphase/impact-d3-collision-gjk_epa.ads
charlie5/lace
20
17909
<reponame>charlie5/lace with impact.d3.Shape.convex; -- #include "BulletCollision/CollisionShapes/impact.d3.Shape.convex.h" package impact.d3.collision.gjk_epa -- -- GJK-EPA collision solver by <NAME>, 2008 -- is use Math; -- btGjkEpaSolver contributed under zlib by <NAME> -- package btGjkEpaSolver2 is type eStatus is (Separated, -- Shapes doesnt penetrate Penetrating, -- Shapes are penetrating GJK_Failed, -- GJK phase fail, no big issue, shapes are probably just 'touching' EPA_Failed); -- EPA phase fail, bigger problem, need to save parameters, and debug status : eStatus; type Witnesses is array (1 .. 2) of math.Vector_3; type sResults is record witnesses : btGjkEpaSolver2.Witnesses; normal : math.Vector_3; distance : math.Real; status : eStatus; end record; function StackSizeRequirement return Integer; function Distance (shape0 : in impact.d3.Shape.convex.view; wtrs0 : in Transform_3d; shape1 : in impact.d3.Shape.convex.view; wtrs1 : in Transform_3d; guess : in math.Vector_3; results : access sResults) return Boolean; function Penetration (shape0 : in impact.d3.Shape.convex.view; wtrs0 : in Transform_3d; shape1 : in impact.d3.Shape.convex.view; wtrs1 : in Transform_3d; guess : in math.Vector_3; results : access sResults; usemargins : in Boolean := True) return Boolean; function SignedDistance (position : in math.Vector_3; margin : in math.Real; shape0 : in impact.d3.Shape.convex.view; wtrs0 : in Transform_3d; results : access sResults) return math.Real; function SignedDistance (shape0 : in impact.d3.Shape.convex.view; wtrs0 : in Transform_3d; shape1 : in impact.d3.Shape.convex.view; wtrs1 : in Transform_3d; guess : in math.Vector_3; results : access sResults) return Boolean; end btGjkEpaSolver2; end impact.d3.collision.gjk_epa;
src/gen/gstreamer-gst_low_level-gstreamer_0_10_gst_base_gstdataqueue_h.ads
persan/A-gst
1
18108
pragma Ada_2005; pragma Style_Checks (Off); pragma Warnings (Off); with Interfaces.C; use Interfaces.C; with glib; with glib.Values; with System; limited with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstminiobject_h; with GLIB; -- with GStreamer.GST_Low_Level.glibconfig_h; -- with GStreamer.GST_Low_Level.glib_2_0_gobject_gobject_h; -- limited with GStreamer.GST_Low_Level.glib_2_0_glib_gqueue_h; with System; -- limited -- with GStreamer.GST_Low_Level.glib_2_0_glib_gthread_h; with glib; package GStreamer.GST_Low_Level.gstreamer_0_10_gst_base_gstdataqueue_h is -- unsupported macro: GST_TYPE_DATA_QUEUE (gst_data_queue_get_type()) -- arg-macro: function GST_DATA_QUEUE (obj) -- return G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DATA_QUEUE,GstDataQueue); -- arg-macro: function GST_DATA_QUEUE_CLASS (klass) -- return G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DATA_QUEUE,GstDataQueueClass); -- arg-macro: function GST_IS_DATA_QUEUE (obj) -- return G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DATA_QUEUE); -- arg-macro: function GST_IS_DATA_QUEUE_CLASS (klass) -- return G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DATA_QUEUE); -- GStreamer -- * Copyright (C) 2006 <NAME> <<EMAIL>> -- * -- * gstdataqueue.h: -- * -- * This library is free software; you can redistribute it and/or -- * modify it under the terms of the GNU Library General Public -- * License as published by the Free Software Foundation; either -- * version 2 of the License, or (at your option) any later version. -- * -- * This library 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 -- * Library General Public License for more details. -- * -- * You should have received a copy of the GNU Library General Public -- * License along with this library; if not, write to the -- * Free Software Foundation, Inc., 59 Temple Place - Suite 330, -- * Boston, MA 02111-1307, USA. -- type GstDataQueue; type anon_311; type anon_312 is record waiting_add : aliased GLIB.gboolean; -- gst/base/gstdataqueue.h:140 waiting_del : aliased GLIB.gboolean; -- gst/base/gstdataqueue.h:141 end record; pragma Convention (C_Pass_By_Copy, anon_312); type u_GstDataQueue_u_gst_reserved_array is array (0 .. 1) of System.Address; type anon_311 (discr : unsigned := 0) is record case discr is when 0 => ABI : aliased anon_312; -- gst/base/gstdataqueue.h:142 when others => u_gst_reserved : u_GstDataQueue_u_gst_reserved_array; -- gst/base/gstdataqueue.h:143 end case; end record; pragma Convention (C_Pass_By_Copy, anon_311); pragma Unchecked_Union (anon_311);--subtype GstDataQueue is u_GstDataQueue; -- gst/base/gstdataqueue.h:39 type GstDataQueueClass; type u_GstDataQueueClass_u_gst_reserved_array is array (0 .. 3) of System.Address; --subtype GstDataQueueClass is u_GstDataQueueClass; -- gst/base/gstdataqueue.h:40 type GstDataQueueSize; --subtype GstDataQueueSize is u_GstDataQueueSize; -- gst/base/gstdataqueue.h:41 type GstDataQueueItem; --subtype GstDataQueueItem is u_GstDataQueueItem; -- gst/base/gstdataqueue.h:42 --* -- * GstDataQueueItem: -- * @object: the #GstMiniObject to queue. -- * @size: the size in bytes of the miniobject. -- * @duration: the duration in #GstClockTime of the miniobject. Can not be -- * #GST_CLOCK_TIME_NONE. -- * @visible: #TRUE if @object should be considered as a visible object. -- * @destroy: The #GDestroyNotify function to use to free the #GstDataQueueItem. -- * This function should also drop the reference to @object the owner of the -- * #GstDataQueueItem is assumed to hold. -- * -- * Structure used by #GstDataQueue. You can supply a different structure, as -- * long as the top of the structure is identical to this structure. -- * -- * Since: 0.10.11 -- type GstDataQueueItem is record object : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstminiobject_h.GstMiniObject; -- gst/base/gstdataqueue.h:63 size : aliased GLIB.guint; -- gst/base/gstdataqueue.h:64 duration : aliased GLIB.guint64; -- gst/base/gstdataqueue.h:65 visible : aliased GLIB.gboolean; -- gst/base/gstdataqueue.h:66 destroy : GStreamer.GST_Low_Level.glib_2_0_glib_gtypes_h.GDestroyNotify; -- gst/base/gstdataqueue.h:69 end record; pragma Convention (C_Pass_By_Copy, GstDataQueueItem); -- gst/base/gstdataqueue.h:61 -- user supplied destroy function --* -- * GstDataQueueSize: -- * @visible: number of buffers -- * @bytes: number of bytes -- * @time: amount of time -- * -- * Structure describing the size of a queue. -- * -- * Since: 0.10.11 -- type GstDataQueueSize is record visible : aliased GLIB.guint; -- gst/base/gstdataqueue.h:84 bytes : aliased GLIB.guint; -- gst/base/gstdataqueue.h:85 time : aliased GLIB.guint64; -- gst/base/gstdataqueue.h:86 end record; pragma Convention (C_Pass_By_Copy, GstDataQueueSize); -- gst/base/gstdataqueue.h:82 --* -- * GstDataQueueCheckFullFunction: -- * @queue: a #GstDataQueue. -- * @visible: The number of visible items currently in the queue. -- * @bytes: The amount of bytes currently in the queue. -- * @time: The accumulated duration of the items currently in the queue. -- * @checkdata: The #gpointer registered when the #GstDataQueue was created. -- * -- * The prototype of the function used to inform the queue that it should be -- * considered as full. -- * -- * Returns: #TRUE if the queue should be considered full. -- * -- * Since: 0.10.11 -- type GstDataQueueCheckFullFunction is access function (arg1 : access GstDataQueue; arg2 : GLIB.guint; arg3 : GLIB.guint; arg4 : GLIB.guint64; arg5 : System.Address) return GLIB.gboolean; pragma Convention (C, GstDataQueueCheckFullFunction); -- gst/base/gstdataqueue.h:104 type GstDataQueueFullCallback is access procedure (arg1 : access GstDataQueue; arg2 : System.Address); pragma Convention (C, GstDataQueueFullCallback); -- gst/base/gstdataqueue.h:107 type GstDataQueueEmptyCallback is access procedure (arg1 : access GstDataQueue; arg2 : System.Address); pragma Convention (C, GstDataQueueEmptyCallback); -- gst/base/gstdataqueue.h:108 --* -- * GstDataQueue: -- * @object: the parent structure -- * -- * Opaque #GstDataQueue structure. -- * -- * Since: 0.10.11 -- type GstDataQueue is record object : aliased GLIB.Object.GObject; -- gst/base/gstdataqueue.h:120 queue : access GStreamer.GST_Low_Level.glib_2_0_glib_gqueue_h.GQueue; -- gst/base/gstdataqueue.h:124 cur_level : aliased GstDataQueueSize; -- gst/base/gstdataqueue.h:126 checkfull : GstDataQueueCheckFullFunction; -- gst/base/gstdataqueue.h:127 checkdata : System.Address; -- gst/base/gstdataqueue.h:128 qlock : access GStreamer.GST_Low_Level.glib_2_0_glib_gthread_h.GMutex; -- gst/base/gstdataqueue.h:130 item_add : access GStreamer.GST_Low_Level.glib_2_0_glib_gthread_h.GCond; -- gst/base/gstdataqueue.h:131 item_del : access GStreamer.GST_Low_Level.glib_2_0_glib_gthread_h.GCond; -- gst/base/gstdataqueue.h:132 flushing : aliased GLIB.gboolean; -- gst/base/gstdataqueue.h:133 fullcallback : GstDataQueueFullCallback; -- gst/base/gstdataqueue.h:135 emptycallback : GstDataQueueEmptyCallback; -- gst/base/gstdataqueue.h:136 abidata : aliased anon_311; -- gst/base/gstdataqueue.h:144 end record; pragma Convention (C_Pass_By_Copy, GstDataQueue); -- gst/base/gstdataqueue.h:118 --< private > -- the queue of data we're keeping our grubby hands on -- size of the queue -- Callback to check if the queue is full -- lock for queue (vs object lock) -- signals buffers now available for reading -- signals space now available for writing -- indicates whether conditions where signalled because -- * of external flushing type GstDataQueueClass is record parent_class : aliased GLIB.Object.GObject_Class; -- gst/base/gstdataqueue.h:149 empty : access procedure (arg1 : access GstDataQueue); -- gst/base/gstdataqueue.h:152 full : access procedure (arg1 : access GstDataQueue); -- gst/base/gstdataqueue.h:153 u_gst_reserved : u_GstDataQueueClass_u_gst_reserved_array; -- gst/base/gstdataqueue.h:155 end record; pragma Convention (C_Pass_By_Copy, GstDataQueueClass); -- gst/base/gstdataqueue.h:147 -- signals function gst_data_queue_get_type return GLIB.GType; -- gst/base/gstdataqueue.h:158 pragma Import (C, gst_data_queue_get_type, "gst_data_queue_get_type"); function gst_data_queue_new (checkfull : GstDataQueueCheckFullFunction; checkdata : System.Address) return access GstDataQueue; -- gst/base/gstdataqueue.h:160 pragma Import (C, gst_data_queue_new, "gst_data_queue_new"); function gst_data_queue_new_full (checkfull : GstDataQueueCheckFullFunction; fullcallback : GstDataQueueFullCallback; emptycallback : GstDataQueueEmptyCallback; checkdata : System.Address) return access GstDataQueue; -- gst/base/gstdataqueue.h:163 pragma Import (C, gst_data_queue_new_full, "gst_data_queue_new_full"); function gst_data_queue_push (queue : access GstDataQueue; item : access GstDataQueueItem) return GLIB.gboolean; -- gst/base/gstdataqueue.h:168 pragma Import (C, gst_data_queue_push, "gst_data_queue_push"); function gst_data_queue_pop (queue : access GstDataQueue; item : System.Address) return GLIB.gboolean; -- gst/base/gstdataqueue.h:169 pragma Import (C, gst_data_queue_pop, "gst_data_queue_pop"); procedure gst_data_queue_flush (queue : access GstDataQueue); -- gst/base/gstdataqueue.h:171 pragma Import (C, gst_data_queue_flush, "gst_data_queue_flush"); procedure gst_data_queue_set_flushing (queue : access GstDataQueue; flushing : GLIB.gboolean); -- gst/base/gstdataqueue.h:172 pragma Import (C, gst_data_queue_set_flushing, "gst_data_queue_set_flushing"); function gst_data_queue_drop_head (queue : access GstDataQueue; c_type : GLIB.GType) return GLIB.gboolean; -- gst/base/gstdataqueue.h:174 pragma Import (C, gst_data_queue_drop_head, "gst_data_queue_drop_head"); function gst_data_queue_is_full (queue : access GstDataQueue) return GLIB.gboolean; -- gst/base/gstdataqueue.h:176 pragma Import (C, gst_data_queue_is_full, "gst_data_queue_is_full"); function gst_data_queue_is_empty (queue : access GstDataQueue) return GLIB.gboolean; -- gst/base/gstdataqueue.h:177 pragma Import (C, gst_data_queue_is_empty, "gst_data_queue_is_empty"); procedure gst_data_queue_get_level (queue : access GstDataQueue; level : access GstDataQueueSize); -- gst/base/gstdataqueue.h:179 pragma Import (C, gst_data_queue_get_level, "gst_data_queue_get_level"); procedure gst_data_queue_limits_changed (queue : access GstDataQueue); -- gst/base/gstdataqueue.h:180 pragma Import (C, gst_data_queue_limits_changed, "gst_data_queue_limits_changed"); end GStreamer.GST_Low_Level.gstreamer_0_10_gst_base_gstdataqueue_h;
kv-avm-line_parser.ads
davidkristola/vole
4
17587
<reponame>davidkristola/vole package kv.avm.Line_Parser is type Parse_Line_Interface is interface; procedure Parse_Line (Self : in out Parse_Line_Interface; Line : in String) is abstract; end kv.avm.Line_Parser;
Soundcheck/Create Spoken Line Check Cues.applescript
bsmith96/Qlab-Scripts
1
54
<filename>Soundcheck/Create Spoken Line Check Cues.applescript -- @description Create spoken line check cues -- @author <NAME> -- @link bensmithsound.uk -- @version 2.2 -- @testedmacos 10.14.6 -- @testedqlab 4.6.10 -- @about Creates spoken output names and automated line check cues -- @separateprocess TRUE -- @changelog -- v2.2 + bug fix for gang-fix in 2.1 -- v2.1 + now works if your template audio cue includes ganged channels -- v2.0 + moved common functions to external script -- v1.5 + allows assignment of UDVs from the script calling this one -- v1.4 + takes channel list and level information from the notes of cues, to streamline editing for new projects -- v1.3 + creates cues in the correct order -- + cleaned up "speak output names" loop -- + recompiling or running the script within qlab no longer throws an error -- USER DEFINED VARIABLES ----------------- -- Locate the cue list containing Script Variables try -- if global variables are given when this script is called by another, use those variables variableCueListName on error set variableCueListName to "Other scripts & utilities" end try -- Set file type to save (wav or aiff) try fileType on error set fileType to ".wav" end try -- Set the cue which you want to precede your line check group try rigCheckTitleCue on error set rigCheckTitleCue to " RIG CHECK" -- Leave blank to use the current position end try -- Set the cue list you want to place this group cue in try mainCueListName on error set mainCueListName to "Main Cue list" end try -- Set the name of the sub sound. This should be saved, relative to the Qlab file, in "~/Soundcheck/Line Checks" try subFileName on error set subFileName to "Sub v2.wav" end try -- Set the delay between each file playing in seconds try userDelay on error set userDelay to 0.5 end try ---------- END OF USER DEFINED VARIABLES -- -- VARIABLES FROM QLAB NOTES -------------- -- Input channel names as a single string, separated by ", ". -- Some guidance on channel names for the best result: -- 1. for main PA, using the term "pros" will have its pronunciation corrected. -- 2. for foldback, the TTS works better if "Foldback" is not the first word. Try putting the side before, rather than after, "Foldback". If there is only 1 foldback channel, try "Stage Foldback" -- 3. for subs, include the word "Sub" in each channel's name. This will use the sub soundcheck sound instead of a spoken voice. tell application id "com.figure53.Qlab.4" to tell front workspace set userChannels to notes of (first cue of (first cue list whose q name is variableCueListName) whose q name is "Output channel names") end tell -- Set the level which the audio files will play back at in Qlab. Sub is separate since it is a separate sound. tell application id "com.figure53.Qlab.4" to tell front workspace set userLevel to notes of (first cue of (first cue list whose q name is variableCueListName) whose q name is "Line checks: output level") set subLevel to notes of (first cue of (first cue list whose q name is variableCueListName) whose q name is "Line checks: sub level") end tell ------------------ END OF QLAB VARIABLES -- property util : script "Applescript Utilities" ---- RUN SCRIPT --------------------------- -- Get the path to the project tell application id "com.figure53.Qlab.4" to tell front workspace set qlabPath to path end tell tell application "Finder" set qlabPathAlias to POSIX file qlabPath as alias set qlabParentPath to (container of qlabPathAlias) as alias end tell set saveLocation to (POSIX path of qlabParentPath & "Soundcheck/Line Checks/") -- Set current cue list to the Main Cue List. tell application id "com.figure53.Qlab.4" to tell front workspace set current cue list to first cue list whose q name is mainCueListName end tell -- If the cues already exist, delete them before running the rest of this script: checkForCues() -- If the audio files already exist, delete them before running the rest of this script: checkForFiles(saveLocation, subFileName) -- Convert userChannels into a list set theChannels to util's splitString(userChannels, ", ") -- Speak output names set outputCount to count of theChannels repeat with eachOutput from 1 to outputCount set eachOutputToSay to correctOutputName(item eachOutput of theChannels) if eachOutputToSay does not contain "Sub" then say (eachOutputToSay) using "Daniel" saving to (POSIX file saveLocation & checkDigits(eachOutput, 2) & " " & (item eachOutput of theChannels) as string) & fileType else set newFileName to (checkDigits(eachOutput, 2) & " " & (item eachOutput of theChannels) as string) & fileType tell application "Finder" set newFile to duplicate file (POSIX file (saveLocation & subFileName) as alias) set name of newFile to newFileName end tell end if end repeat ---- Import into Qlab -- Make main cue list a variable tell application id "com.figure53.Qlab.4" to tell front workspace set mainCueList to (first cue list whose q name is mainCueListName) -- Get rig check title cue, so it knows where to make these cues if rigCheckTitleCue is not "" then set current cue list to mainCueList set titleCue to (first cue whose q name is rigCheckTitleCue) set playback position of mainCueList to titleCue end if -- Make the group make type "Group" set groupCue to last item of (selected as list) set q name of groupCue to "Line Check" set mode of groupCue to timeline end tell -- Get all files in the linecheck folder tell application "Finder" set saveLocationAlias to POSIX file saveLocation as alias delay 1 set allTheFiles to (entire contents of folder saveLocationAlias) end tell -- Make audio cues tell application id "com.figure53.Qlab.4" to tell front workspace repeat with eachOutput in util's sortList(allTheFiles) if q number of eachOutput is not subFileName then set eachOutputName to my getOutputName(eachOutput) set eachOutputNumber to my getOutputNumber(eachOutput) make type "Audio" -- make cue set thisCue to last item of (selected as list) -- give the cue a variable set file target of thisCue to eachOutput as alias -- add the file to the cue set q name of thisCue to eachOutputName -- Put the cue into the group cue set thisCueID to uniqueID of thisCue try move cue id thisCueID of parent of thisCue to end of groupCue end try -- Set level of cues as they are made repeat with eachColumn from 1 to outputCount if eachColumn is eachOutputNumber then set eachGang to getGang thisCue row 0 column eachColumn if item eachOutputNumber of theChannels contains "Sub" then if eachGang is missing value then setLevel thisCue row 0 column eachColumn db subLevel setLevel thisCue row 1 column eachColumn db 0 else setGang thisCue row 0 column eachColumn gang "" setLevel thisCue row 0 column eachColumn db subLevel setLevel thisCue row 1 column eachColumn db 0 setGang thisCue row 0 column eachColumn gang eachGang end if else if eachGang is missing value then setLevel thisCue row 0 column eachColumn db userLevel setLevel thisCue row 1 column eachColumn db 0 else setGang thisCue row 0 column eachColumn gang "" setLevel thisCue row 0 column eachColumn db userLevel setLevel thisCue row 1 column eachColumn db 0 setGang thisCue row 0 column eachColumn gang eachGang end if end if else setLevel thisCue row 0 column eachColumn db "-inf" end if end repeat -- Set predelay of cues as they are made set previousCue to cue before thisCue if eachOutputNumber is not 1 then set previousDuration to duration of previousCue set previousPreWait to pre wait of previousCue set pre wait of thisCue to (previousDuration + previousPreWait + userDelay) end if end if end repeat -- Brief delay to let the user see the completed cue stack delay 0.5 collapse groupCue end tell -- FUNCTIONS ------------------------------ on checkDigits(num, howLong) set num to text -howLong thru -1 of ("00" & num) return num end checkDigits on correctOutputName(outputName) if outputName contains "Pros" then set newOutputName to util's findAndReplaceInText(outputName, "Pros", "Proz") return newOutputName else return outputName end if end correctOutputName -- Checks for cues and deletes them if they're already present on checkForCues() tell application id "com.figure53.Qlab.4" to tell front workspace set groupCueAlready to "" try set groupCueAlready to (first cue whose q name is "Line Check") set groupCueAlreadyID to uniqueID of groupCueAlready end try if groupCueAlready is not "" then delete cue id groupCueAlreadyID of parent of groupCueAlready -- of cue list mainCueList end if end tell end checkForCues -- Checks for audio files and deletes them if they're already present on checkForFiles(saveLocation, subFileName) tell application "Finder" set saveLocationAlias to POSIX file saveLocation as alias set startingFolderContents to (entire contents of folder saveLocationAlias) if (count of startingFolderContents) is not 1 then repeat with eachItem in startingFolderContents if name of eachItem is not (subFileName) then delete eachItem end if end repeat end if end tell end checkForFiles -- Gets the output name from the file name. Hopefully useful if the list is not in the correct order. on getOutputName(theFile) tell application "Finder" set fileName to name of theFile end tell set nameWithoutExtension to util's splitString(fileName, ".") set nameAsList to util's splitString(item 1 of nameWithoutExtension, "") set outputList to items 4 thru -1 of nameAsList as string return outputList end getOutputName -- Gets the output number from the file name. Similarly (hopefully) useful if the list is not in the correct order. on getOutputNumber(theFile) tell application "Finder" set fileName to name of theFile end tell set nameAsList to util's splitString(items 1 thru 2 of fileName, "") set outputNumber to item 1 of nameAsList & item 2 of nameAsList as number return outputNumber end getOutputNumber
38_Particle_Engines/Dot.asm
DebugBSD/SDLExamples
3
11485
<gh_stars>1-10 include Dot.inc Dot_shiftColliders proto :PTR Dot Dot_renderParticles proto :PTR Dot .code Dot_ctor proc uses rsi rdi r10 r11, pDot:PTR Dot ; Constructor LOCAL r10q_:QWORD mov rdi, pDot mov (Dot PTR [rdi]).m_PosX, 0 mov (Dot PTR [rdi]).m_PosY, 0 mov (Dot PTR [rdi]).m_VelX, 0 mov (Dot PTR [rdi]).m_VelY, 0 lea rsi, (Dot PTR [rdi]).m_Particles xor r10, r10 .while r10<TOTAL_PARTICLES mov r10q_, r10 invoke Particle_ctor, rsi, (Dot PTR [rdi]).m_PosX, (Dot PTR [rdi]).m_PosY mov r10, r10q_ add rsi, SIZEOF Particle inc r10 .endw ret Dot_ctor endp Dot_dtor proc uses rdi r10 r11, pDot:PTR Dot ; Destructor mov rdi, pDot lea rsi, (Dot PTR [rdi]).m_Particles xor r10, r10 ; Call destructor .while r10<TOTAL_PARTICLES invoke Particle_dtor, rsi add rsi, SIZEOF Particle inc r10 .endw ret Dot_dtor endp Dot_handleEvent proc uses rax rbx rcx rdx rsi, pDot:ptr Dot, e:ptr SDL_Event mov rsi, e mov rdi, pDot .if (SDL_Event PTR[rsi]).type_ == SDL_KEYDOWN && (SDL_Event PTR[rsi]).key.repeat_==0 .if (SDL_Event PTR[rsi]).key.keysym.sym==SDLK_UP sub (Dot PTR [rdi]).m_VelY, DOT_VEL .elseif (SDL_Event PTR[rsi]).key.keysym.sym==SDLK_DOWN add (Dot PTR [rdi]).m_VelY, DOT_VEL .elseif (SDL_Event PTR[rsi]).key.keysym.sym==SDLK_LEFT sub (Dot PTR [rdi]).m_VelX, DOT_VEL .elseif (SDL_Event PTR[rsi]).key.keysym.sym==SDLK_RIGHT add (Dot PTR [rdi]).m_VelX, DOT_VEL .endif .elseif (SDL_Event PTR[rsi]).type_ == SDL_KEYUP && (SDL_Event PTR[rsi]).key.repeat_==0 .if (SDL_Event PTR[rsi]).key.keysym.sym==SDLK_UP add (Dot PTR [rdi]).m_VelY, DOT_VEL .elseif (SDL_Event PTR[rsi]).key.keysym.sym==SDLK_DOWN sub (Dot PTR [rdi]).m_VelY, DOT_VEL .elseif (SDL_Event PTR[rsi]).key.keysym.sym==SDLK_LEFT add (Dot PTR [rdi]).m_VelX, DOT_VEL .elseif (SDL_Event PTR[rsi]).key.keysym.sym==SDLK_RIGHT sub (Dot PTR [rdi]).m_VelX, DOT_VEL .endif .endif ret Dot_handleEvent endp Dot_move proc uses rsi r10 r11, pDot:PTR Dot LOCAL t1:DWORD LOCAL t2:QWORD mov rsi, pDot ; Move the dot left or right mov r10d, (Dot PTR[rsi]).m_PosX add r10d, (Dot PTR[rsi]).m_VelX mov (Dot PTR[rsi]).m_PosX, r10d ; m_PosX += m_VelX mov r11d, r10d add r11d, DOT_WIDTH ; if ((m_PosX < 0) || (m_PosX + DOT_WIDTH) > LEVEL_WIDTH) .if r10d<0 || r11d > LEVEL_WIDTH sub r10d, (Dot PTR[rsi]).m_VelX mov (Dot PTR[rsi]).m_PosX, r10d ; m_PosX -= m_VelX .endif ; Move the dot up or down mov r10d, (Dot PTR[rsi]).m_PosY add r10d, (Dot PTR[rsi]).m_VelY mov (Dot PTR[rsi]).m_PosY, r10d ; m_PosX += m_VelX mov r11d, r10d add r11d, DOT_HEIGHT ; if ((m_PosY < 0) || (m_PosY + DOT_HEIGHT) > LEVEL_HEIGHT) .if r10d<0 || r11d > LEVEL_HEIGHT sub r10d, (Dot PTR[rsi]).m_VelY mov (Dot PTR[rsi]).m_PosY, r10d ; m_PosY -= m_VelY .endif ret Dot_move endp Dot_render proc uses rsi r11 r12, pDot:ptr Dot, pTexture:ptr LTexture mov rsi, pDot invoke renderTexture, gRenderer, pTexture, (Dot PTR [rsi]).m_PosX , (Dot PTR [rsi]).m_PosY, 0, 0, 0, 0 invoke Dot_renderParticles, pDot ret Dot_render endp Dot_renderParticles proc uses rsi rdi r10, pDot:PTR Dot LOCAL r10q_:QWORD mov rdi, pDot lea rsi, (Dot PTR [rdi]).m_Particles xor r10, r10 .while r10<TOTAL_PARTICLES invoke Particle_isDead, rsi .if rax==1 invoke Particle_ctor, rsi, (Dot PTR [rdi]).m_PosX, (Dot PTR [rdi]).m_PosY .endif add rsi, SIZEOF Particle inc r10 .endw ; Show particle lea rsi, (Dot PTR [rdi]).m_Particles xor r10, r10 .while r10<TOTAL_PARTICLES mov r10q_, r10 invoke Particle_render, rsi mov r10, r10q_ add rsi, SIZEOF Particle inc r10 .endw ret Dot_renderParticles endp
src/ether-requests.adb
Lucretia/ether
4
6119
<gh_stars>1-10 -- -*- Mode: Ada -*- -- Filename : ether-requests.adb -- Description : Body to the request objects. -- Author : <NAME> -- Created On : Sun Jul 4 19:11:27 2010 with Ada.Characters.Latin_1; with Ada.Text_IO; use Ada.Text_IO; with Ada.Unchecked_Deallocation; with Ada.Unchecked_Conversion; with AWS.MIME; with Ether.Forms; package body Ether.Requests is procedure Receive (Object : in out Request; Input : in GNAT.Sockets.Stream_Access) is package L1 renames Ada.Characters.Latin_1; package AS renames Ada.Streams; use type AS.Stream_Element; use type AS.Stream_Element_Offset; use type US.Unbounded_String; ------------------------------------------------------------------------- -- Read in the environment variables from the web server as a NetString. procedure Read_Environment (Object : in out Request; Input : in GNAT.Sockets.Stream_Access) is Char : AS.Stream_Element; Buffer : US.Unbounded_String := US.Null_Unbounded_String; Colon : constant AS.Stream_Element := Character'Pos(':'); Comma : constant AS.Stream_Element := Character'Pos(','); Nul : constant AS.Stream_Element := Character'Pos(L1.Nul); Length : AS.Stream_Element_Offset := AS.Stream_Element_Offset'First; begin Read_Header_Length : loop Char := AS.Stream_Element'Input(Input); -- Ada.Text_IO.Put_Line("[" & Character'Val(Char) & "]"); exit when Char = Colon; US.Append(Buffer, Character'Val(Char)); end loop Read_Header_Length; Length := AS.Stream_Element_Offset'Value(US.To_String(Buffer)); -- Ada.Text_IO.Put_Line("Buffer: " & US.To_String(Buffer) & " - Length: " & Ada.Streams.Stream_Element_Offset'Image(Length)); Buffer := US.Null_Unbounded_String; -- Read in the rest of the NetString. Read_Net_String : declare Actual_Read : AS.Stream_Element_Offset; Total_Read : AS.Stream_Element_Offset := 1; Message : AS.Stream_Element_Array(1 .. Length); begin -- Just in case it won't read the header in 1 chunk. while Total_Read < Length loop AS.Read(Input.all, Message(Total_Read .. Length), Actual_Read); Total_Read := Total_Read + Actual_Read; end loop; -- Make sure we end the netstring with a comma. Char := AS.Stream_Element'Input(Input); if Char /= Comma then raise Request_Error with "[Ether] Missing comma from NetString in request!"; end if; Decode_Net_String : declare Reading_Key : Boolean := True; Key : US.Unbounded_String := US.Null_Unbounded_String; begin for I in 1 .. Length loop if Message(I) = Nul then if Reading_Key then Key := Buffer; Buffer := US.Null_Unbounded_String; Reading_Key := False; else -- TODO: When this works, get rid of this header from -- the enumeration. -- This is because the cookies are stored in a -- separate map therefore this key is not required. if Key = "HTTP_COOKIE" then Put_Line(US.To_String(Key) & " : " & US.To_String(Buffer)); Cookie_Map.Insert (Container => Object.Cookies, Key => US.To_String(Key), New_Item => US.To_String(Buffer)); else Put_Line(US.To_String(Key) & " : " & US.To_String(Buffer)); Variable_Map.Insert (Container => Object.Environment, Key => US.To_String(Key), New_Item => US.To_String(Buffer)); end if; Key := US.Null_Unbounded_String; Buffer := US.Null_Unbounded_String; Reading_Key := True; end if; else -- Ada.Text_IO.Put(Character'Val(Message(I))); US.Append(Buffer, Character'Val(Message(I))); end if; end loop; end Decode_Net_String; end Read_Net_String; end Read_Environment; function Find_Boundary (Object : in Request) return String is Data : String := Value (Object, Content_Type); Index : Positive := Positive'First; Boundary : constant String := "boundary="; begin -- find "boundary=" while Index /= Data'Length loop exit when Data (Index) = ';'; Index := Index + 1; end loop; -- Have not found the ; and therefore not a multipart! if Index = Data'Length then raise SCGI_Error with "[Ether] Content has no multipart data within, boundary not present."; end if; -- Skip past the ';' Index := Index + 1; if Data (Index) = ' ' then -- Skip past the space. Index := Index + 1; -- We need to make sure we find the boundary marker. if Data'Length - Index < Boundary'Length then raise SCGI_Error with "[Ether] Content has no multipart data within, ""boundary="" not found."; end if; -- The remainder of the string is our boundary. if Data (Index .. Index + Boundary'Length - 1) = Boundary then return Data (Index + Boundary'Length .. Data'Length); end if; end if; -- Should never get here! return ""; end Find_Boundary; ------------------------------------------------------------------------- -- This is the data that follows the NetString, if there is any; usually -- form data. -- function Read_Content -- (Input : GNAT.Sockets.Stream_Access; -- Length : Integer) return US.Unbounded_String is -- L : AS.Stream_Element_Offset := AS.Stream_Element_Offset(Length); -- Actual_Read : AS.Stream_Element_Offset; -- Total_Read : AS.Stream_Element_Offset := 1; -- Message : AS.Stream_Element_Array(1 .. L); -- Result : String(1 .. Length); -- begin -- -- Just in case it won't read the content in 1 chunk. -- while Total_Read < L loop -- AS.Read(Input.all, Message(Total_Read .. L), Actual_Read); -- Total_Read := Total_Read + Actual_Read; -- end loop; -- -- Convert the stream elements into characters that we can display. -- for Count in Message'Range loop -- Result(Integer(Count)) := Character'Val(Message(Count)); -- end loop; -- return US.To_Unbounded_String(Result); -- end Read_Content; type Stream_Element_Array_Access is access AS.Stream_Element_Array; procedure Read_Content (Input : in GNAT.Sockets.Stream_Access; Content : in out Stream_Element_Array_Access) is L : AS.Stream_Element_Offset := Content.all'Length; Actual_Read : AS.Stream_Element_Offset; Total_Read : AS.Stream_Element_Offset := 1; begin -- Just in case it won't read the content in 1 chunk. while Total_Read < L loop AS.Read(Input.all, Content.all (Total_Read .. L), Actual_Read); Total_Read := Total_Read + Actual_Read; end loop; end Read_Content; procedure Free is new Ada.Unchecked_Deallocation (Object => AS.Stream_Element_Array, Name => Stream_Element_Array_Access); function To_Stream_Element_Array (Data : in String) return AS.Stream_Element_Array is R : AS.Stream_Element_Array (1 .. Data'Length); begin for Index in Data'Range loop R (AS.Stream_Element_Offset (Index)) := AS.Stream_Element (Character'Pos (Data (Index))); end loop; return R; end To_Stream_Element_Array; function To_String (Data : in AS.Stream_Element_Array) return String is Current : Positive := Positive'First; R : String (Current .. Data'Length); begin for Index in Data'Range loop R (Current) := Character'Val (Data (Index)); Current := Current + 1; end loop; return R; end To_String; function Matches (Data : in AS.Stream_Element_Array; Match : in String) return Boolean is Test : String := To_String (Data (Data'First .. Data'First + AS.Stream_Element_Offset (Match'Length) - 1)); begin if Test = Match then return True; end if; return False; end Matches; -- Find the index of the next CRLF pair in a string. function Find_CRLF (Data : in String) return Positive is Index : Positive := Data'First; begin while Index /= Data'Last - 1 loop if Data (Index) = L1.CR and Data (Index + 1) = L1.LF then return Index; end if; Index := Index + 1; end loop; return Positive'Last; end Find_CRLF; -- Find Key within Data, then return whatever is in quotes, i.e. <key>="<value>" procedure Find_Value (Data : in String; Key : in String; Value : out US.Unbounded_String; Last_Index : out Positive) is Index : Positive := Data'First; First : Positive := Positive'First; Last : Positive := Positive'First; begin -- Obviously a fail. if Data = "" then Last_Index := Positive'Last; Value := US.Null_Unbounded_String; return; end if; while Index /= Data'Last - Key'Length loop if Data (Index .. Index + Key'Length - 1) = Key then -- The first character after the '="' marker. First := Index + Key'Length + 2; -- Then find where the terminating quote is. for Count in First .. Data'Last loop if Data (Count) = L1.Quotation then Last := Count - 1; exit; end if; end loop; -- Skip past the " Last_Index := Last + 2; Value := US.To_Unbounded_String (Data (First .. Last)); return; else Index := Index + 1; end if; end loop; Last_Index := Positive'Last; Value := US.Null_Unbounded_String; end Find_Value; -- Matches a string within a stream up until a CRLF pair. procedure Is_In (Data : in AS.Stream_Element_Array; Match : in String; Includes : out Boolean; At_Index : out Positive) is Test : String := To_String (Data (Data'First .. Data'First + AS.Stream_Element_Offset (Match'Length))); CRLF_Pos : Positive := Find_CRLF (Test); Index : Positive := Positive'First; begin -- Should never get here, unless the stream is just wrong. if CRLF_Pos = Positive'Last then raise SCGI_Error with "[Ether] No CRLF pair found in current stream."; end if; while AS.Stream_Element_Offset (Index) /= Data'Last - AS.Stream_Element_Offset (Match'Length) loop if Test (Index .. Match'Length) = Match then At_Index := Index; Includes := True; exit; end if; end loop; At_Index := Positive'Last; Includes := False; end Is_In; Content_Disposition : constant String := "Content-Disposition"; Form_Data : constant String := "form-data"; Name : constant String := "name"; Filename : constant String := "filename"; L : Integer := 0; Index : Positive := Positive'First; Chunk_Size : Positive := Positive'First; begin Read_Environment(Object, Input); -- We read in the form data, if there is any... if Form_Data_Method_Is (Object) = Get then -- from a urlencoded string. Ether.Forms.Decode_Query (Value (Object, Query_String)); else -- from multipart/form-data content body. if Is_Valid(Object) then L := Content_Length(Object); if L /= 0 then -- Only have a boundary if this is multipart. if Get_Content_Type (Object) = AWS.MIME.Multipart_Form_Data then declare Content : Stream_Element_Array_Access := new AS.Stream_Element_Array (1 .. AS.Stream_Element_Offset (L)); Boundary : US.Unbounded_String := US.To_Unbounded_String (Find_Boundary (Object)); Current_Char : Character; Next_Char : Character; begin Put_Line ("boundary = '" & US.To_String (Boundary) & "'"); -- Temporarily read in the rest of the stream into memory. Read_Content (Input, Content); while Index /= Content'Length - 1 loop Current_Char := Character'Val (Content (AS.Stream_Element_Offset (Index))); Next_Char := Character'Val (Content (AS.Stream_Element_Offset (Index + 1))); if Current_Char = L1.CR and Next_Char = L1.LF then Put_Line ("-- CRLF -- "); Index := Index + 2; elsif Current_Char = L1.Hyphen and Next_Char = L1.Hyphen then if Index = Content'Length - 3 then -- This is the end marker of the stream which is "--CRLF". Put_Line ("## End of content ##"); Index := Index + 2; elsif Content'Length - Index >= US.Length (Boundary) then -- Found the boundary marker. if To_String (Content (AS.Stream_Element_Offset (Index + 2) .. AS.Stream_Element_Offset (Index + 1 + US.Length (Boundary)))) = Boundary then Put_Line ("## Boundary ##"); Index := Index + 2 + US.Length (Boundary); else raise SCGI_Error with "[Ether] Invalid boundary marker found within content."; end if; end if; elsif Matches (Content (AS.Stream_Element_Offset (Index) .. Content'Last), Content_Disposition) then declare -- Get the position of the next line start, this will be the blank line before the form data. Next_Line : Positive := Find_CRLF (To_String (Content (AS.Stream_Element_Offset (Index) .. Content'Last))); Name : US.Unbounded_String; Filename : US.Unbounded_String; Index_After_Name : Positive; Index_After_Filename : Positive; begin Find_Value (Data => To_String (Content (AS.Stream_Element_Offset (Index) + Content_Disposition'Length .. AS.Stream_Element_Offset (Index + Next_Line))), Key => "name", Value => Name, Last_Index => Index_After_Name); Find_Value (Data => To_String (Content (AS.Stream_Element_Offset (Index + Index_After_Name) .. AS.Stream_Element_Offset (Index + Next_Line))), Key => "filename", Value => Filename, Last_Index => Index_After_Filename); Put ("Form field '" & US.To_String (Name) & "' = '"); -- Normal field data. -- Skip the next CRLF which indicates a blank line.. declare Data_First : AS.Stream_Element_Offset := AS.Stream_Element_Offset (Index + Next_Line + 2); Data_Last : AS.Stream_Element_Offset := AS.Stream_Element_Offset (Index + Find_CRLF (To_String (Content (Data_First .. Content'Last)))); begin Put_Line (To_String (Content (Data_First .. Data_Last)) & "'"); end; if Filename /= "" then -- Contents of a file. Put_Line ("Form field filename '" & US.To_String (Filename) & "' = '"); Index := Index + Next_Line; end if; -- Skip to the next line. Index := Index + Positive (Next_Line) + 1; end; -- Find_CRLF after Content_Disposition, find "name" and/or "filename" getting -- their value's. -- declare -- First : AS.Stream_Element_Offset : AS.Strea_Element_Offset (Index + Content_Disposition'Length); -- begin -- if Matches (Content (First .. First + 1), ": ") then -- -- Skip ": " -- First := First + 2; -- if Matches (Content (First .. First + AS.Strea_Element_Offset (Form_Data'Length)), Form_Data) then -- -- Skip "form-data" -- First := First + AS.Strea_Element_Offset (Form_Data'Length); -- if Matches (Content (First .. First + 1), "; ") then -- -- Skip "; " -- First := First + 2; -- if Matches (Content (First .. First + AS.Strea_Element_Offset (Name'Length)), Name) then -- Put_Line -- ("Form field name: " & -- Content (AS.Strea_Element_Offset (Form_Data'Length) .. )); -- else -- raise SCGI_Error -- with "[Ether] Missing ""name"" after Content-Disposition in content."; -- end if; -- else -- raise SCGI_Error -- with "[Ether] Missing ""; "" after form-data in Content-Disposition in content."; -- end if; -- else -- raise SCGI_Error -- with "[Ether] Missing ""Form-Data"" after Content-Disposition in content."; -- end if; -- else -- raise SCGI_Error -- with "[Ether] Missing "": "" after Content-Disposition in content."; -- end if; -- end; else Put (Current_Char); Index := Index + 1; end if; end loop; Free (Content); end; else declare Content : String (1 .. L); begin String'Read (Input, Content); Ether.Forms.Decode_Query (Content); end; end if; -- -- At this point, we know we have content after the headers. We -- -- just don't know what type it is. -- if Value(Object, Content_Type) = AWS.MIME.Application_Form_Data then -- -- URIs.Decode -- -- (Request => Value(Object, Request_URI), -- -- Path =>, -- -- Params => Form); -- null; -- elsif Value(Object, Content_Type) = AWS.MIME.Multipart_Form_Data then -- null; -- -- elsif Value(Object, Content_Type) = MIME.Get_Mime(MIME.Multipart_Digest) then -- -- null; -- -- elsif Value(Object, Content_Type) = MIME.Get_Mime(MIME.Multipart_Mixed) then -- else -- null; -- end if; -- Object.Content := Read_Content(Input, L); end if; else raise Request_Error with "[Ether] Non-SCGI request received."; end if; end if; end Receive; procedure Clean(Object : in out Request) is begin Variable_Map.Clear(Object.Environment); -- Object.Content := US.Null_Unbounded_String; end Clean; function Is_Valid(Object : Request) return Boolean is SCGI_Value : String := Value(Object, SCGI); begin -- According to the spec, this should always be "1" if SCGI_Value = "" or SCGI_Value /= "1" then return False; end if; return True; end Is_Valid; function Value(Object : Request; Item : Header) return String is begin return Value(Object, Header'Image(Item)); end Value; function Value(Object : Request; Item : String) return String is begin if Variable_Map.Contains(Object.Environment, Item) then return Variable_Map.Element(Object.Environment, Item); end if; return ""; end Value; function Cookie(Object : Request; Item : String) return String is begin if Cookie_Map.Contains(Object.Cookies, Item) then return Cookie_Map.Element(Object.Cookies, Item); end if; return ""; end Cookie; function Form(Object : Request; Item : String) return Unicode.CES.Byte_Sequence is --Unicode.UTF8_String is begin if Form_Map.Contains(Object.Form, Item) then return Form_Map.Element(Object.Form, Item); end if; return ""; end Form; -- function Content(Object : Request) return String is -- begin -- return Object.Content.all; -- end Content; function Content_Length(Object : Request) return Natural is L : String := Value(Object, Content_Length); begin -- If we get no length, there's a problem! if L = "" then raise Request_Error with "[Ether] No content length defined."; end if; return Natural'Value(L); end Content_Length; function Get_Content_Type (Object : Request) return String is C : String := Value (Object, Content_Type); begin if C = AWS.MIME.Application_Form_Data then return AWS.MIME.Application_Form_Data; elsif C (1 .. AWS.MIME.Multipart_Form_Data'Length) = AWS.MIME.Multipart_Form_Data then return AWS.MIME.Multipart_Form_Data; else raise SCGI_Error with "[Ether] Unknown Content-Type found."; end if; end Get_Content_Type; function Form_Data_Method_Is (Object : in Request) return Form_Data_Method is begin if Content_Length(Object) = 0 and Value(Object, Request_Method) = "GET" then return Get; end if; return Put; end Form_Data_Method_Is; function Hash(Key : Header) return Ada.Containers.Hash_Type is begin return Ada.Strings.Hash(Header'Image(Key)); end Hash; end Ether.Requests;
src/loggers/adabase-logger-base-file.adb
jrmarino/AdaBase
30
12885
<gh_stars>10-100 -- This file is covered by the Internet Software Consortium (ISC) License -- Reference: ../../License.txt with Ada.Text_IO.Unbounded_IO; package body AdaBase.Logger.Base.File is package TIO renames Ada.Text_IO; package UIO renames Ada.Text_IO.Unbounded_IO; overriding procedure reaction (listener : File_Logger) is output : TIO.File_Type; begin if CT.IsBlank (listener.filepath) then return; end if; begin TIO.Open (File => output, Mode => TIO.Append_File, Name => CT.USS (listener.filepath)); exception when TIO.Name_Error => TIO.Create (File => output, Mode => TIO.Out_File, Name => CT.USS (listener.filepath)); end; UIO.Put_Line (File => output, Item => listener.composite); TIO.Close (File => output); end reaction; -------------------- -- set_filepath -- -------------------- procedure set_filepath (listener : out File_Logger; filename : String) is begin listener.filepath := CT.SUS (filename); end set_filepath; end AdaBase.Logger.Base.File;
programs/oeis/185/A185706.asm
neoneye/loda
22
23918
<reponame>neoneye/loda<filename>programs/oeis/185/A185706.asm ; A185706: Characteristic function of positive numbers that are primes ending in 3. ; 0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 mov $1,$0 add $0,1 seq $1,10051 ; Characteristic function of primes: 1 if n is prime, else 0. mul $0,$1 mov $1,5 mov $2,$0 sub $2,3 gcd $1,$2 mov $0,$1 div $0,4
game1/room2.asm
w84death/arm-assembly
3
105423
@ --------------------------------------------------- @ @ Raspberry Pi Assembly GAME#1 by KJ/P1X @ @ http://p1x.in | http://krzysztofjankowski.com @ https://github.com/w84death/arm-assembly @ @ --------------------------------------------------- .arm .include "globals.asm" .data .equ cmd_mask, 38 @ west/east/look .equ trigger_turn, 8 welcome: .string "This particular cave is named - Old Spider - guess why?\n" .equ welcome_len, .-welcome description: .string "\nYou enter another cave. This one is smaller.\nYou see spider crawling next to you..\nThere is a path on [west] site but the spider is looking dangerous.\n" .equ desc_len, .-description description2: .string "\nThe spider has gone. You see path on the [west] site.\n" .equ desc2_len, .-description2 spider_attack: .string "\nSpider jumps on to your head and bite you right in the neck...\n" .equ spider_len, .-spider_attack .text .global _room2 _room2: LDR R1, =welcome MOV R2, #welcome_len BL _ui_render_welcome BL _increment_turn _skip_welcome: MOV R1, #cmd_mask BL _prompt CMP R0, #cmd_west BEQ _try_room4 CMP R0, #cmd_east BEQ _room1 CMP R0, #cmd_look BEQ _look B _skip_welcome _look: BL _increment_turn BL _get_turn CMP R0, #trigger_turn BGT _post_trigger LDR R1, =description MOV R2, #desc_len MOV R3, #desc_style BL _ui_render_message B _skip_welcome _post_trigger: LDR R1, =description2 MOV R2, #desc2_len MOV R3, #desc_style BL _ui_render_message B _skip_welcome _try_room4: BL _get_turn CMP R0, #trigger_turn BGT _room4 LDR R1, =spider_attack MOV R2, #spider_len MOV R3, #desc_style BL _ui_render_message B _game_over
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0.log_21829_760.asm
ljhsiun2/medusa
9
91984
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r14 push %rbp push %rbx push %rcx push %rdi push %rsi lea addresses_D_ht+0xf6f3, %rsi lea addresses_WC_ht+0x1b0cc, %rdi clflush (%rsi) nop add %r14, %r14 mov $15, %rcx rep movsq nop nop nop nop nop inc %r11 lea addresses_WT_ht+0xea58, %rsi lea addresses_UC_ht+0x10398, %rdi nop nop nop nop cmp %rbx, %rbx mov $48, %rcx rep movsq nop nop nop nop nop inc %rsi lea addresses_WT_ht+0xee79, %r11 nop nop nop nop cmp $53533, %rbp movl $0x61626364, (%r11) nop nop nop dec %r14 lea addresses_D_ht+0x108d8, %rcx nop nop lfence mov $0x6162636465666768, %rbp movq %rbp, %xmm0 vmovups %ymm0, (%rcx) nop inc %r14 pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %r14 pop %r11 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r13 push %rax push %rcx // Faulty Load lea addresses_normal+0xc58, %rax nop nop nop nop and %r13, %r13 mov (%rax), %r11d lea oracles, %rcx and $0xff, %r11 shlq $12, %r11 mov (%rcx,%r11,1), %r11 pop %rcx pop %rax pop %r13 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_normal', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'} [Faulty Load] {'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_normal', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'same': False, 'congruent': 0, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 0, 'type': 'addresses_WC_ht'}} {'src': {'same': False, 'congruent': 9, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_UC_ht'}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 4}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 32}} {'34': 21829} 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 */
test/Succeed/Issue1847.agda
shlevy/agda
1,989
4095
record Additive {ℓ} (A : Set ℓ) : Set ℓ where field zero : A _+_ : A → A → A open Additive {{...}} public record Subtractive {ℓ} (A : Set ℓ) {{ADD : Additive A}} : Set ℓ where field _-_ : A → A → A neg : A → A neg x = zero - x open Subtractive {{...}} public check : ∀ ℓ (A : Set ℓ) (ADD : Additive A) (SUB : Subtractive A {{ADD}}) → A → A check ℓ A ADD SUB x = Subtractive.neg {ℓ} {A} {{ADD}} SUB x
src/Core/InterruptHandlers/Joypad.asm
stoneface86/GameboyBoilerplateProj
25
1615
<gh_stars>10-100 include "./src/Includes.inc" section "JoypadHandler", rom0 ; Unused and really shouldn't be used Joypad:: ld a, JOYPAD_INTERRUPT_CODE ld [wLastInterrupt], a reti
agda/PLRTree/Complete/Correctness/Base.agda
bgbianchi/sorting
6
12068
<reponame>bgbianchi/sorting module PLRTree.Complete.Correctness.Base {A : Set} where open import BTree.Complete.Base {A} open import BTree.Complete.Alternative.Correctness {A} renaming (lemma-complete'-complete to lemma-complete''-complete) open import Function using (_∘_) open import PLRTree {A} open import PLRTree.Complete {A} renaming (Complete to Complete' ; _⋗_ to _⋗'_ ; _⋘_ to _⋘'_ ; _⋙_ to _⋙'_) open import PLRTree.Complete.Correctness.Alternative {A} renaming (lemma-complete'-complete to lemma-complete'-complete'') open import PLRTree.Equality.Correctness {A} lemma-complete'-complete : {t : PLRTree} → Complete' t → Complete (forget t) lemma-complete'-complete = lemma-complete''-complete ∘ lemma-complete'-complete''
alloy4fun_models/trashltl/models/7/o7ZdtoWGvFWzFSmCQ.als
Kaixi26/org.alloytools.alloy
0
2740
<filename>alloy4fun_models/trashltl/models/7/o7ZdtoWGvFWzFSmCQ.als open main pred ido7ZdtoWGvFWzFSmCQ_prop8 { all f:File | some link.f implies eventually f in Trash } pred __repair { ido7ZdtoWGvFWzFSmCQ_prop8 } check __repair { ido7ZdtoWGvFWzFSmCQ_prop8 <=> prop8o }
src/Pi/ArrMp.agda
mietek/formal-logic
26
14287
-- Minimal implicational logic, PHOAS approach, initial encoding module Pi.ArrMp where -- Types infixr 0 _=>_ data Ty : Set where UNIT : Ty _=>_ : Ty -> Ty -> Ty -- Context and truth judgement Cx : Set1 Cx = Ty -> Set isTrue : Ty -> Cx -> Set isTrue a tc = tc a -- Terms module ArrMp where infixl 1 _$_ data Tm (tc : Cx) : Ty -> Set where var : forall {a} -> isTrue a tc -> Tm tc a lam' : forall {a b} -> (isTrue a tc -> Tm tc b) -> Tm tc (a => b) _$_ : forall {a b} -> Tm tc (a => b) -> Tm tc a -> Tm tc b lam'' : forall {tc a b} -> (Tm tc a -> Tm tc b) -> Tm tc (a => b) lam'' f = lam' \x -> f (var x) syntax lam'' (\a -> b) = lam a => b Thm : Ty -> Set1 Thm a = forall {tc} -> Tm tc a open ArrMp public -- Example theorems aI : forall {a} -> Thm (a => a) aI = lam x => x aK : forall {a b} -> Thm (a => b => a) aK = lam x => lam _ => x aS : forall {a b c} -> Thm ((a => b => c) => (a => b) => a => c) aS = lam f => lam g => lam x => f $ x $ (g $ x) tSKK : forall {a} -> Thm (a => a) tSKK {a = a} = aS {b = a => a} $ aK $ aK
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/no_final.adb
best08618/asylo
7
13641
-- { dg-do run } pragma Restrictions (No_Finalization); procedure no_final is package P is type T is tagged null record; type T1 is new T with record A : String (1..80); end record; function F return T'Class; end P; Str : String (1..80) := (1..80=>'x'); package body P is function F return T'Class is X : T1 := T1'(A => Str); begin return X; end F; end P; Obj : P.T'class := P.F; begin if P.T1 (Obj).A /= Str then raise Constraint_Error; end if; end;
src/z80asm/t/data/ops_z80_ok.asm
jpoikela/z88dk
0
103407
ld b, ixh ;; 0000: DD 44 ld b, ixl ;; 0002: DD 45 ld c, ixh ;; 0004: DD 4C ld c, ixl ;; 0006: DD 4D ld d, ixh ;; 0008: DD 54 ld d, ixl ;; 000A: DD 55 ld e, ixh ;; 000C: DD 5C ld e, ixl ;; 000E: DD 5D ld ixh, ixh ;; 0010: DD 64 ld ixh, ixl ;; 0012: DD 65 ld ixl, ixh ;; 0014: DD 6C ld ixl, ixl ;; 0016: DD 6D ld a, ixh ;; 0018: DD 7C ld a, ixl ;; 001A: DD 7D ld b, iyh ;; 001C: FD 44 ld b, iyl ;; 001E: FD 45 ld c, iyh ;; 0020: FD 4C ld c, iyl ;; 0022: FD 4D ld d, iyh ;; 0024: FD 54 ld d, iyl ;; 0026: FD 55 ld e, iyh ;; 0028: FD 5C ld e, iyl ;; 002A: FD 5D ld iyh, iyh ;; 002C: FD 64 ld iyh, iyl ;; 002E: FD 65 ld iyl, iyh ;; 0030: FD 6C ld iyl, iyl ;; 0032: FD 6D ld a, iyh ;; 0034: FD 7C ld a, iyl ;; 0036: FD 7D ld b, 0 ;; 0038: 06 00 ld b, 85 ;; 003A: 06 55 ld b, 170 ;; 003C: 06 AA ld b, 255 ;; 003E: 06 FF ld c, 0 ;; 0040: 0E 00 ld c, 85 ;; 0042: 0E 55 ld c, 170 ;; 0044: 0E AA ld c, 255 ;; 0046: 0E FF ld d, 0 ;; 0048: 16 00 ld d, 85 ;; 004A: 16 55 ld d, 170 ;; 004C: 16 AA ld d, 255 ;; 004E: 16 FF ld e, 0 ;; 0050: 1E 00 ld e, 85 ;; 0052: 1E 55 ld e, 170 ;; 0054: 1E AA ld e, 255 ;; 0056: 1E FF ld h, 0 ;; 0058: 26 00 ld h, 85 ;; 005A: 26 55 ld h, 170 ;; 005C: 26 AA ld h, 255 ;; 005E: 26 FF ld l, 0 ;; 0060: 2E 00 ld l, 85 ;; 0062: 2E 55 ld l, 170 ;; 0064: 2E AA ld l, 255 ;; 0066: 2E FF ld a, 0 ;; 0068: 3E 00 ld a, 85 ;; 006A: 3E 55 ld a, 170 ;; 006C: 3E AA ld a, 255 ;; 006E: 3E FF ld ixh, 0 ;; 0070: DD 26 00 ld ixh, 85 ;; 0073: DD 26 55 ld ixh, 170 ;; 0076: DD 26 AA ld ixh, 255 ;; 0079: DD 26 FF ld ixl, 0 ;; 007C: DD 2E 00 ld ixl, 85 ;; 007F: DD 2E 55 ld ixl, 170 ;; 0082: DD 2E AA ld ixl, 255 ;; 0085: DD 2E FF ld iyh, 0 ;; 0088: FD 26 00 ld iyh, 85 ;; 008B: FD 26 55 ld iyh, 170 ;; 008E: FD 26 AA ld iyh, 255 ;; 0091: FD 26 FF ld iyl, 0 ;; 0094: FD 2E 00 ld iyl, 85 ;; 0097: FD 2E 55 ld iyl, 170 ;; 009A: FD 2E AA ld iyl, 255 ;; 009D: FD 2E FF ld b, (hl) ;; 00A0: 46 ld c, (hl) ;; 00A1: 4E ld d, (hl) ;; 00A2: 56 ld e, (hl) ;; 00A3: 5E ld h, (hl) ;; 00A4: 66 ld l, (hl) ;; 00A5: 6E ld a, (hl) ;; 00A6: 7E ld b, (ix + -128) ;; 00A7: DD 46 80 ld b, (ix) ;; 00AA: DD 46 00 ld b, (ix + 127) ;; 00AD: DD 46 7F ld c, (ix + -128) ;; 00B0: DD 4E 80 ld c, (ix) ;; 00B3: DD 4E 00 ld c, (ix + 127) ;; 00B6: DD 4E 7F ld d, (ix + -128) ;; 00B9: DD 56 80 ld d, (ix) ;; 00BC: DD 56 00 ld d, (ix + 127) ;; 00BF: DD 56 7F ld e, (ix + -128) ;; 00C2: DD 5E 80 ld e, (ix) ;; 00C5: DD 5E 00 ld e, (ix + 127) ;; 00C8: DD 5E 7F ld h, (ix + -128) ;; 00CB: DD 66 80 ld h, (ix) ;; 00CE: DD 66 00 ld h, (ix + 127) ;; 00D1: DD 66 7F ld l, (ix + -128) ;; 00D4: DD 6E 80 ld l, (ix) ;; 00D7: DD 6E 00 ld l, (ix + 127) ;; 00DA: DD 6E 7F ld a, (ix + -128) ;; 00DD: DD 7E 80 ld a, (ix) ;; 00E0: DD 7E 00 ld a, (ix + 127) ;; 00E3: DD 7E 7F ld b, (iy + -128) ;; 00E6: FD 46 80 ld b, (iy) ;; 00E9: FD 46 00 ld b, (iy + 127) ;; 00EC: FD 46 7F ld c, (iy + -128) ;; 00EF: FD 4E 80 ld c, (iy) ;; 00F2: FD 4E 00 ld c, (iy + 127) ;; 00F5: FD 4E 7F ld d, (iy + -128) ;; 00F8: FD 56 80 ld d, (iy) ;; 00FB: FD 56 00 ld d, (iy + 127) ;; 00FE: FD 56 7F ld e, (iy + -128) ;; 0101: FD 5E 80 ld e, (iy) ;; 0104: FD 5E 00 ld e, (iy + 127) ;; 0107: FD 5E 7F ld h, (iy + -128) ;; 010A: FD 66 80 ld h, (iy) ;; 010D: FD 66 00 ld h, (iy + 127) ;; 0110: FD 66 7F ld l, (iy + -128) ;; 0113: FD 6E 80 ld l, (iy) ;; 0116: FD 6E 00 ld l, (iy + 127) ;; 0119: FD 6E 7F ld a, (iy + -128) ;; 011C: FD 7E 80 ld a, (iy) ;; 011F: FD 7E 00 ld a, (iy + 127) ;; 0122: FD 7E 7F ld (hl), b ;; 0125: 70 ld (hl), c ;; 0126: 71 ld (hl), d ;; 0127: 72 ld (hl), e ;; 0128: 73 ld (hl), h ;; 0129: 74 ld (hl), l ;; 012A: 75 ld (hl), a ;; 012B: 77 ld (ix + -128), b ;; 012C: DD 70 80 ld (ix), b ;; 012F: DD 70 00 ld (ix + 127), b ;; 0132: DD 70 7F ld (ix + -128), c ;; 0135: DD 71 80 ld (ix), c ;; 0138: DD 71 00 ld (ix + 127), c ;; 013B: DD 71 7F ld (ix + -128), d ;; 013E: DD 72 80 ld (ix), d ;; 0141: DD 72 00 ld (ix + 127), d ;; 0144: DD 72 7F ld (ix + -128), e ;; 0147: DD 73 80 ld (ix), e ;; 014A: DD 73 00 ld (ix + 127), e ;; 014D: DD 73 7F ld (ix + -128), h ;; 0150: DD 74 80 ld (ix), h ;; 0153: DD 74 00 ld (ix + 127), h ;; 0156: DD 74 7F ld (ix + -128), l ;; 0159: DD 75 80 ld (ix), l ;; 015C: DD 75 00 ld (ix + 127), l ;; 015F: DD 75 7F ld (ix + -128), a ;; 0162: DD 77 80 ld (ix), a ;; 0165: DD 77 00 ld (ix + 127), a ;; 0168: DD 77 7F ld (iy + -128), b ;; 016B: FD 70 80 ld (iy), b ;; 016E: FD 70 00 ld (iy + 127), b ;; 0171: FD 70 7F ld (iy + -128), c ;; 0174: FD 71 80 ld (iy), c ;; 0177: FD 71 00 ld (iy + 127), c ;; 017A: FD 71 7F ld (iy + -128), d ;; 017D: FD 72 80 ld (iy), d ;; 0180: FD 72 00 ld (iy + 127), d ;; 0183: FD 72 7F ld (iy + -128), e ;; 0186: FD 73 80 ld (iy), e ;; 0189: FD 73 00 ld (iy + 127), e ;; 018C: FD 73 7F ld (iy + -128), h ;; 018F: FD 74 80 ld (iy), h ;; 0192: FD 74 00 ld (iy + 127), h ;; 0195: FD 74 7F ld (iy + -128), l ;; 0198: FD 75 80 ld (iy), l ;; 019B: FD 75 00 ld (iy + 127), l ;; 019E: FD 75 7F ld (iy + -128), a ;; 01A1: FD 77 80 ld (iy), a ;; 01A4: FD 77 00 ld (iy + 127), a ;; 01A7: FD 77 7F ld (hl), 0 ;; 01AA: 36 00 ld (hl), 85 ;; 01AC: 36 55 ld (hl), 170 ;; 01AE: 36 AA ld (hl), 255 ;; 01B0: 36 FF ld (ix + -128), 0 ;; 01B2: DD 36 80 00 ld (ix), 0 ;; 01B6: DD 36 00 00 ld (ix + 127), 0 ;; 01BA: DD 36 7F 00 ld (ix + -128), 85 ;; 01BE: DD 36 80 55 ld (ix), 85 ;; 01C2: DD 36 00 55 ld (ix + 127), 85 ;; 01C6: DD 36 7F 55 ld (ix + -128), 170 ;; 01CA: DD 36 80 AA ld (ix), 170 ;; 01CE: DD 36 00 AA ld (ix + 127), 170 ;; 01D2: DD 36 7F AA ld (ix + -128), 255 ;; 01D6: DD 36 80 FF ld (ix), 255 ;; 01DA: DD 36 00 FF ld (ix + 127), 255 ;; 01DE: DD 36 7F FF ld (iy + -128), 0 ;; 01E2: FD 36 80 00 ld (iy), 0 ;; 01E6: FD 36 00 00 ld (iy + 127), 0 ;; 01EA: FD 36 7F 00 ld (iy + -128), 85 ;; 01EE: FD 36 80 55 ld (iy), 85 ;; 01F2: FD 36 00 55 ld (iy + 127), 85 ;; 01F6: FD 36 7F 55 ld (iy + -128), 170 ;; 01FA: FD 36 80 AA ld (iy), 170 ;; 01FE: FD 36 00 AA ld (iy + 127), 170 ;; 0202: FD 36 7F AA ld (iy + -128), 255 ;; 0206: FD 36 80 FF ld (iy), 255 ;; 020A: FD 36 00 FF ld (iy + 127), 255 ;; 020E: FD 36 7F FF ld a, (bc) ;; 0212: 0A ld a, (de) ;; 0213: 1A ld (bc), a ;; 0214: 02 ld (de), a ;; 0215: 12 ld a, (0) ;; 0216: 3A 00 00 ld a, (291) ;; 0219: 3A 23 01 ld a, (17767) ;; 021C: 3A 67 45 ld a, (35243) ;; 021F: 3A AB 89 ld a, (52719) ;; 0222: 3A EF CD ld a, (65535) ;; 0225: 3A FF FF ld (0), a ;; 0228: 32 00 00 ld (291), a ;; 022B: 32 23 01 ld (17767), a ;; 022E: 32 67 45 ld (35243), a ;; 0231: 32 AB 89 ld (52719), a ;; 0234: 32 EF CD ld (65535), a ;; 0237: 32 FF FF add a, b ;; 023A: 80 add a, c ;; 023B: 81 add a, d ;; 023C: 82 add a, e ;; 023D: 83 add a, h ;; 023E: 84 add a, l ;; 023F: 85 add a, (hl) ;; 0240: 86 add a, a ;; 0241: 87 adc a, b ;; 0242: 88 adc a, c ;; 0243: 89 adc a, d ;; 0244: 8A adc a, e ;; 0245: 8B adc a, h ;; 0246: 8C adc a, l ;; 0247: 8D adc a, (hl) ;; 0248: 8E adc a, a ;; 0249: 8F sub a, b ;; 024A: 90 sub a, c ;; 024B: 91 sub a, d ;; 024C: 92 sub a, e ;; 024D: 93 sub a, h ;; 024E: 94 sub a, l ;; 024F: 95 sub a, (hl) ;; 0250: 96 sub a, a ;; 0251: 97 sbc a, b ;; 0252: 98 sbc a, c ;; 0253: 99 sbc a, d ;; 0254: 9A sbc a, e ;; 0255: 9B sbc a, h ;; 0256: 9C sbc a, l ;; 0257: 9D sbc a, (hl) ;; 0258: 9E sbc a, a ;; 0259: 9F and a, b ;; 025A: A0 and a, c ;; 025B: A1 and a, d ;; 025C: A2 and a, e ;; 025D: A3 and a, h ;; 025E: A4 and a, l ;; 025F: A5 and a, (hl) ;; 0260: A6 and a, a ;; 0261: A7 xor a, b ;; 0262: A8 xor a, c ;; 0263: A9 xor a, d ;; 0264: AA xor a, e ;; 0265: AB xor a, h ;; 0266: AC xor a, l ;; 0267: AD xor a, (hl) ;; 0268: AE xor a, a ;; 0269: AF or a, b ;; 026A: B0 or a, c ;; 026B: B1 or a, d ;; 026C: B2 or a, e ;; 026D: B3 or a, h ;; 026E: B4 or a, l ;; 026F: B5 or a, (hl) ;; 0270: B6 or a, a ;; 0271: B7 cp a, b ;; 0272: B8 cp a, c ;; 0273: B9 cp a, d ;; 0274: BA cp a, e ;; 0275: BB cp a, h ;; 0276: BC cp a, l ;; 0277: BD cp a, (hl) ;; 0278: BE cp a, a ;; 0279: BF add b ;; 027A: 80 add c ;; 027B: 81 add d ;; 027C: 82 add e ;; 027D: 83 add h ;; 027E: 84 add l ;; 027F: 85 add (hl) ;; 0280: 86 add a ;; 0281: 87 adc b ;; 0282: 88 adc c ;; 0283: 89 adc d ;; 0284: 8A adc e ;; 0285: 8B adc h ;; 0286: 8C adc l ;; 0287: 8D adc (hl) ;; 0288: 8E adc a ;; 0289: 8F sub b ;; 028A: 90 sub c ;; 028B: 91 sub d ;; 028C: 92 sub e ;; 028D: 93 sub h ;; 028E: 94 sub l ;; 028F: 95 sub (hl) ;; 0290: 96 sub a ;; 0291: 97 sbc b ;; 0292: 98 sbc c ;; 0293: 99 sbc d ;; 0294: 9A sbc e ;; 0295: 9B sbc h ;; 0296: 9C sbc l ;; 0297: 9D sbc (hl) ;; 0298: 9E sbc a ;; 0299: 9F and b ;; 029A: A0 and c ;; 029B: A1 and d ;; 029C: A2 and e ;; 029D: A3 and h ;; 029E: A4 and l ;; 029F: A5 and (hl) ;; 02A0: A6 and a ;; 02A1: A7 xor b ;; 02A2: A8 xor c ;; 02A3: A9 xor d ;; 02A4: AA xor e ;; 02A5: AB xor h ;; 02A6: AC xor l ;; 02A7: AD xor (hl) ;; 02A8: AE xor a ;; 02A9: AF or b ;; 02AA: B0 or c ;; 02AB: B1 or d ;; 02AC: B2 or e ;; 02AD: B3 or h ;; 02AE: B4 or l ;; 02AF: B5 or (hl) ;; 02B0: B6 or a ;; 02B1: B7 cp b ;; 02B2: B8 cp c ;; 02B3: B9 cp d ;; 02B4: BA cp e ;; 02B5: BB cp h ;; 02B6: BC cp l ;; 02B7: BD cp (hl) ;; 02B8: BE cp a ;; 02B9: BF add a, (ix+-128) ;; 02BA: DD 86 80 add a, (ix) ;; 02BD: DD 86 00 add a, (ix+127) ;; 02C0: DD 86 7F adc a, (ix+-128) ;; 02C3: DD 8E 80 adc a, (ix) ;; 02C6: DD 8E 00 adc a, (ix+127) ;; 02C9: DD 8E 7F sub a, (ix+-128) ;; 02CC: DD 96 80 sub a, (ix) ;; 02CF: DD 96 00 sub a, (ix+127) ;; 02D2: DD 96 7F sbc a, (ix+-128) ;; 02D5: DD 9E 80 sbc a, (ix) ;; 02D8: DD 9E 00 sbc a, (ix+127) ;; 02DB: DD 9E 7F and a, (ix+-128) ;; 02DE: DD A6 80 and a, (ix) ;; 02E1: DD A6 00 and a, (ix+127) ;; 02E4: DD A6 7F xor a, (ix+-128) ;; 02E7: DD AE 80 xor a, (ix) ;; 02EA: DD AE 00 xor a, (ix+127) ;; 02ED: DD AE 7F or a, (ix+-128) ;; 02F0: DD B6 80 or a, (ix) ;; 02F3: DD B6 00 or a, (ix+127) ;; 02F6: DD B6 7F cp a, (ix+-128) ;; 02F9: DD BE 80 cp a, (ix) ;; 02FC: DD BE 00 cp a, (ix+127) ;; 02FF: DD BE 7F add (ix+-128) ;; 0302: DD 86 80 add (ix) ;; 0305: DD 86 00 add (ix+127) ;; 0308: DD 86 7F adc (ix+-128) ;; 030B: DD 8E 80 adc (ix) ;; 030E: DD 8E 00 adc (ix+127) ;; 0311: DD 8E 7F sub (ix+-128) ;; 0314: DD 96 80 sub (ix) ;; 0317: DD 96 00 sub (ix+127) ;; 031A: DD 96 7F sbc (ix+-128) ;; 031D: DD 9E 80 sbc (ix) ;; 0320: DD 9E 00 sbc (ix+127) ;; 0323: DD 9E 7F and (ix+-128) ;; 0326: DD A6 80 and (ix) ;; 0329: DD A6 00 and (ix+127) ;; 032C: DD A6 7F xor (ix+-128) ;; 032F: DD AE 80 xor (ix) ;; 0332: DD AE 00 xor (ix+127) ;; 0335: DD AE 7F or (ix+-128) ;; 0338: DD B6 80 or (ix) ;; 033B: DD B6 00 or (ix+127) ;; 033E: DD B6 7F cp (ix+-128) ;; 0341: DD BE 80 cp (ix) ;; 0344: DD BE 00 cp (ix+127) ;; 0347: DD BE 7F add a, (iy+-128) ;; 034A: FD 86 80 add a, (iy) ;; 034D: FD 86 00 add a, (iy+127) ;; 0350: FD 86 7F adc a, (iy+-128) ;; 0353: FD 8E 80 adc a, (iy) ;; 0356: FD 8E 00 adc a, (iy+127) ;; 0359: FD 8E 7F sub a, (iy+-128) ;; 035C: FD 96 80 sub a, (iy) ;; 035F: FD 96 00 sub a, (iy+127) ;; 0362: FD 96 7F sbc a, (iy+-128) ;; 0365: FD 9E 80 sbc a, (iy) ;; 0368: FD 9E 00 sbc a, (iy+127) ;; 036B: FD 9E 7F and a, (iy+-128) ;; 036E: FD A6 80 and a, (iy) ;; 0371: FD A6 00 and a, (iy+127) ;; 0374: FD A6 7F xor a, (iy+-128) ;; 0377: FD AE 80 xor a, (iy) ;; 037A: FD AE 00 xor a, (iy+127) ;; 037D: FD AE 7F or a, (iy+-128) ;; 0380: FD B6 80 or a, (iy) ;; 0383: FD B6 00 or a, (iy+127) ;; 0386: FD B6 7F cp a, (iy+-128) ;; 0389: FD BE 80 cp a, (iy) ;; 038C: FD BE 00 cp a, (iy+127) ;; 038F: FD BE 7F add (iy+-128) ;; 0392: FD 86 80 add (iy) ;; 0395: FD 86 00 add (iy+127) ;; 0398: FD 86 7F adc (iy+-128) ;; 039B: FD 8E 80 adc (iy) ;; 039E: FD 8E 00 adc (iy+127) ;; 03A1: FD 8E 7F sub (iy+-128) ;; 03A4: FD 96 80 sub (iy) ;; 03A7: FD 96 00 sub (iy+127) ;; 03AA: FD 96 7F sbc (iy+-128) ;; 03AD: FD 9E 80 sbc (iy) ;; 03B0: FD 9E 00 sbc (iy+127) ;; 03B3: FD 9E 7F and (iy+-128) ;; 03B6: FD A6 80 and (iy) ;; 03B9: FD A6 00 and (iy+127) ;; 03BC: FD A6 7F xor (iy+-128) ;; 03BF: FD AE 80 xor (iy) ;; 03C2: FD AE 00 xor (iy+127) ;; 03C5: FD AE 7F or (iy+-128) ;; 03C8: FD B6 80 or (iy) ;; 03CB: FD B6 00 or (iy+127) ;; 03CE: FD B6 7F cp (iy+-128) ;; 03D1: FD BE 80 cp (iy) ;; 03D4: FD BE 00 cp (iy+127) ;; 03D7: FD BE 7F add a, ixh ;; 03DA: DD 84 add a, ixl ;; 03DC: DD 85 adc a, ixh ;; 03DE: DD 8C adc a, ixl ;; 03E0: DD 8D sub a, ixh ;; 03E2: DD 94 sub a, ixl ;; 03E4: DD 95 sbc a, ixh ;; 03E6: DD 9C sbc a, ixl ;; 03E8: DD 9D and a, ixh ;; 03EA: DD A4 and a, ixl ;; 03EC: DD A5 xor a, ixh ;; 03EE: DD AC xor a, ixl ;; 03F0: DD AD or a, ixh ;; 03F2: DD B4 or a, ixl ;; 03F4: DD B5 cp a, ixh ;; 03F6: DD BC cp a, ixl ;; 03F8: DD BD add ixh ;; 03FA: DD 84 add ixl ;; 03FC: DD 85 adc ixh ;; 03FE: DD 8C adc ixl ;; 0400: DD 8D sub ixh ;; 0402: DD 94 sub ixl ;; 0404: DD 95 sbc ixh ;; 0406: DD 9C sbc ixl ;; 0408: DD 9D and ixh ;; 040A: DD A4 and ixl ;; 040C: DD A5 xor ixh ;; 040E: DD AC xor ixl ;; 0410: DD AD or ixh ;; 0412: DD B4 or ixl ;; 0414: DD B5 cp ixh ;; 0416: DD BC cp ixl ;; 0418: DD BD add a, iyh ;; 041A: FD 84 add a, iyl ;; 041C: FD 85 adc a, iyh ;; 041E: FD 8C adc a, iyl ;; 0420: FD 8D sub a, iyh ;; 0422: FD 94 sub a, iyl ;; 0424: FD 95 sbc a, iyh ;; 0426: FD 9C sbc a, iyl ;; 0428: FD 9D and a, iyh ;; 042A: FD A4 and a, iyl ;; 042C: FD A5 xor a, iyh ;; 042E: FD AC xor a, iyl ;; 0430: FD AD or a, iyh ;; 0432: FD B4 or a, iyl ;; 0434: FD B5 cp a, iyh ;; 0436: FD BC cp a, iyl ;; 0438: FD BD add iyh ;; 043A: FD 84 add iyl ;; 043C: FD 85 adc iyh ;; 043E: FD 8C adc iyl ;; 0440: FD 8D sub iyh ;; 0442: FD 94 sub iyl ;; 0444: FD 95 sbc iyh ;; 0446: FD 9C sbc iyl ;; 0448: FD 9D and iyh ;; 044A: FD A4 and iyl ;; 044C: FD A5 xor iyh ;; 044E: FD AC xor iyl ;; 0450: FD AD or iyh ;; 0452: FD B4 or iyl ;; 0454: FD B5 cp iyh ;; 0456: FD BC cp iyl ;; 0458: FD BD add a, 0 ;; 045A: C6 00 add a, 85 ;; 045C: C6 55 add a, 170 ;; 045E: C6 AA add a, 255 ;; 0460: C6 FF adc a, 0 ;; 0462: CE 00 adc a, 85 ;; 0464: CE 55 adc a, 170 ;; 0466: CE AA adc a, 255 ;; 0468: CE FF sub a, 0 ;; 046A: D6 00 sub a, 85 ;; 046C: D6 55 sub a, 170 ;; 046E: D6 AA sub a, 255 ;; 0470: D6 FF sbc a, 0 ;; 0472: DE 00 sbc a, 85 ;; 0474: DE 55 sbc a, 170 ;; 0476: DE AA sbc a, 255 ;; 0478: DE FF and a, 0 ;; 047A: E6 00 and a, 85 ;; 047C: E6 55 and a, 170 ;; 047E: E6 AA and a, 255 ;; 0480: E6 FF xor a, 0 ;; 0482: EE 00 xor a, 85 ;; 0484: EE 55 xor a, 170 ;; 0486: EE AA xor a, 255 ;; 0488: EE FF or a, 0 ;; 048A: F6 00 or a, 85 ;; 048C: F6 55 or a, 170 ;; 048E: F6 AA or a, 255 ;; 0490: F6 FF cp a, 0 ;; 0492: FE 00 cp a, 85 ;; 0494: FE 55 cp a, 170 ;; 0496: FE AA cp a, 255 ;; 0498: FE FF add 0 ;; 049A: C6 00 add 85 ;; 049C: C6 55 add 170 ;; 049E: C6 AA add 255 ;; 04A0: C6 FF adc 0 ;; 04A2: CE 00 adc 85 ;; 04A4: CE 55 adc 170 ;; 04A6: CE AA adc 255 ;; 04A8: CE FF sub 0 ;; 04AA: D6 00 sub 85 ;; 04AC: D6 55 sub 170 ;; 04AE: D6 AA sub 255 ;; 04B0: D6 FF sbc 0 ;; 04B2: DE 00 sbc 85 ;; 04B4: DE 55 sbc 170 ;; 04B6: DE AA sbc 255 ;; 04B8: DE FF and 0 ;; 04BA: E6 00 and 85 ;; 04BC: E6 55 and 170 ;; 04BE: E6 AA and 255 ;; 04C0: E6 FF xor 0 ;; 04C2: EE 00 xor 85 ;; 04C4: EE 55 xor 170 ;; 04C6: EE AA xor 255 ;; 04C8: EE FF or 0 ;; 04CA: F6 00 or 85 ;; 04CC: F6 55 or 170 ;; 04CE: F6 AA or 255 ;; 04D0: F6 FF cp 0 ;; 04D2: FE 00 cp 85 ;; 04D4: FE 55 cp 170 ;; 04D6: FE AA cp 255 ;; 04D8: FE FF inc b ;; 04DA: 04 inc c ;; 04DB: 0C inc d ;; 04DC: 14 inc e ;; 04DD: 1C inc h ;; 04DE: 24 inc l ;; 04DF: 2C inc a ;; 04E0: 3C dec b ;; 04E1: 05 dec c ;; 04E2: 0D dec d ;; 04E3: 15 dec e ;; 04E4: 1D dec h ;; 04E5: 25 dec l ;; 04E6: 2D dec a ;; 04E7: 3D inc ixh ;; 04E8: DD 24 inc ixl ;; 04EA: DD 2C dec ixh ;; 04EC: DD 25 dec ixl ;; 04EE: DD 2D inc iyh ;; 04F0: FD 24 inc iyl ;; 04F2: FD 2C dec iyh ;; 04F4: FD 25 dec iyl ;; 04F6: FD 2D inc (hl) ;; 04F8: 34 dec (hl) ;; 04F9: 35 inc (ix + -128) ;; 04FA: DD 34 80 inc (ix) ;; 04FD: DD 34 00 inc (ix + 127) ;; 0500: DD 34 7F dec (ix + -128) ;; 0503: DD 35 80 dec (ix) ;; 0506: DD 35 00 dec (ix + 127) ;; 0509: DD 35 7F inc (iy + -128) ;; 050C: FD 34 80 inc (iy) ;; 050F: FD 34 00 inc (iy + 127) ;; 0512: FD 34 7F dec (iy + -128) ;; 0515: FD 35 80 dec (iy) ;; 0518: FD 35 00 dec (iy + 127) ;; 051B: FD 35 7F cpl ;; 051E: 2F cpl a ;; 051F: 2F neg ;; 0520: ED 44 neg a ;; 0522: ED 44 ccf ;; 0524: 3F ccf f ;; 0525: 3F scf ;; 0526: 37 scf f ;; 0527: 37 ld bc, 0 ;; 0528: 01 00 00 ld bc, 291 ;; 052B: 01 23 01 ld bc, 17767 ;; 052E: 01 67 45 ld bc, 35243 ;; 0531: 01 AB 89 ld bc, 52719 ;; 0534: 01 EF CD ld bc, 65535 ;; 0537: 01 FF FF ld de, 0 ;; 053A: 11 00 00 ld de, 291 ;; 053D: 11 23 01 ld de, 17767 ;; 0540: 11 67 45 ld de, 35243 ;; 0543: 11 AB 89 ld de, 52719 ;; 0546: 11 EF CD ld de, 65535 ;; 0549: 11 FF FF ld hl, 0 ;; 054C: 21 00 00 ld hl, 291 ;; 054F: 21 23 01 ld hl, 17767 ;; 0552: 21 67 45 ld hl, 35243 ;; 0555: 21 AB 89 ld hl, 52719 ;; 0558: 21 EF CD ld hl, 65535 ;; 055B: 21 FF FF ld sp, 0 ;; 055E: 31 00 00 ld sp, 291 ;; 0561: 31 23 01 ld sp, 17767 ;; 0564: 31 67 45 ld sp, 35243 ;; 0567: 31 AB 89 ld sp, 52719 ;; 056A: 31 EF CD ld sp, 65535 ;; 056D: 31 FF FF ld ix, 0 ;; 0570: DD 21 00 00 ld ix, 291 ;; 0574: DD 21 23 01 ld ix, 17767 ;; 0578: DD 21 67 45 ld ix, 35243 ;; 057C: DD 21 AB 89 ld ix, 52719 ;; 0580: DD 21 EF CD ld ix, 65535 ;; 0584: DD 21 FF FF ld iy, 0 ;; 0588: FD 21 00 00 ld iy, 291 ;; 058C: FD 21 23 01 ld iy, 17767 ;; 0590: FD 21 67 45 ld iy, 35243 ;; 0594: FD 21 AB 89 ld iy, 52719 ;; 0598: FD 21 EF CD ld iy, 65535 ;; 059C: FD 21 FF FF ld hl, (0) ;; 05A0: 2A 00 00 ld hl, (291) ;; 05A3: 2A 23 01 ld hl, (17767) ;; 05A6: 2A 67 45 ld hl, (35243) ;; 05A9: 2A AB 89 ld hl, (52719) ;; 05AC: 2A EF CD ld hl, (65535) ;; 05AF: 2A FF FF ld ix, (0) ;; 05B2: DD 2A 00 00 ld ix, (291) ;; 05B6: DD 2A 23 01 ld ix, (17767) ;; 05BA: DD 2A 67 45 ld ix, (35243) ;; 05BE: DD 2A AB 89 ld ix, (52719) ;; 05C2: DD 2A EF CD ld ix, (65535) ;; 05C6: DD 2A FF FF ld iy, (0) ;; 05CA: FD 2A 00 00 ld iy, (291) ;; 05CE: FD 2A 23 01 ld iy, (17767) ;; 05D2: FD 2A 67 45 ld iy, (35243) ;; 05D6: FD 2A AB 89 ld iy, (52719) ;; 05DA: FD 2A EF CD ld iy, (65535) ;; 05DE: FD 2A FF FF ld (0), hl ;; 05E2: 22 00 00 ld (291), hl ;; 05E5: 22 23 01 ld (17767), hl ;; 05E8: 22 67 45 ld (35243), hl ;; 05EB: 22 AB 89 ld (52719), hl ;; 05EE: 22 EF CD ld (65535), hl ;; 05F1: 22 FF FF ld (0), ix ;; 05F4: DD 22 00 00 ld (291), ix ;; 05F8: DD 22 23 01 ld (17767), ix ;; 05FC: DD 22 67 45 ld (35243), ix ;; 0600: DD 22 AB 89 ld (52719), ix ;; 0604: DD 22 EF CD ld (65535), ix ;; 0608: DD 22 FF FF ld (0), iy ;; 060C: FD 22 00 00 ld (291), iy ;; 0610: FD 22 23 01 ld (17767), iy ;; 0614: FD 22 67 45 ld (35243), iy ;; 0618: FD 22 AB 89 ld (52719), iy ;; 061C: FD 22 EF CD ld (65535), iy ;; 0620: FD 22 FF FF ld bc, (0) ;; 0624: ED 4B 00 00 ld bc, (291) ;; 0628: ED 4B 23 01 ld bc, (17767) ;; 062C: ED 4B 67 45 ld bc, (35243) ;; 0630: ED 4B AB 89 ld bc, (52719) ;; 0634: ED 4B EF CD ld bc, (65535) ;; 0638: ED 4B FF FF ld de, (0) ;; 063C: ED 5B 00 00 ld de, (291) ;; 0640: ED 5B 23 01 ld de, (17767) ;; 0644: ED 5B 67 45 ld de, (35243) ;; 0648: ED 5B AB 89 ld de, (52719) ;; 064C: ED 5B EF CD ld de, (65535) ;; 0650: ED 5B FF FF ld sp, (0) ;; 0654: ED 7B 00 00 ld sp, (291) ;; 0658: ED 7B 23 01 ld sp, (17767) ;; 065C: ED 7B 67 45 ld sp, (35243) ;; 0660: ED 7B AB 89 ld sp, (52719) ;; 0664: ED 7B EF CD ld sp, (65535) ;; 0668: ED 7B FF FF ld (0), bc ;; 066C: ED 43 00 00 ld (291), bc ;; 0670: ED 43 23 01 ld (17767), bc ;; 0674: ED 43 67 45 ld (35243), bc ;; 0678: ED 43 AB 89 ld (52719), bc ;; 067C: ED 43 EF CD ld (65535), bc ;; 0680: ED 43 FF FF ld (0), de ;; 0684: ED 53 00 00 ld (291), de ;; 0688: ED 53 23 01 ld (17767), de ;; 068C: ED 53 67 45 ld (35243), de ;; 0690: ED 53 AB 89 ld (52719), de ;; 0694: ED 53 EF CD ld (65535), de ;; 0698: ED 53 FF FF ld (0), sp ;; 069C: ED 73 00 00 ld (291), sp ;; 06A0: ED 73 23 01 ld (17767), sp ;; 06A4: ED 73 67 45 ld (35243), sp ;; 06A8: ED 73 AB 89 ld (52719), sp ;; 06AC: ED 73 EF CD ld (65535), sp ;; 06B0: ED 73 FF FF ld sp, hl ;; 06B4: F9 ld sp, ix ;; 06B5: DD F9 ld sp, iy ;; 06B7: FD F9 push bc ;; 06B9: C5 push de ;; 06BA: D5 push hl ;; 06BB: E5 push af ;; 06BC: F5 push ix ;; 06BD: DD E5 push iy ;; 06BF: FD E5 pop bc ;; 06C1: C1 pop de ;; 06C2: D1 pop hl ;; 06C3: E1 pop af ;; 06C4: F1 pop ix ;; 06C5: DD E1 pop iy ;; 06C7: FD E1 add hl, bc ;; 06C9: 09 add hl, de ;; 06CA: 19 add hl, hl ;; 06CB: 29 add hl, sp ;; 06CC: 39 add ix, bc ;; 06CD: DD 09 add ix, de ;; 06CF: DD 19 add ix, ix ;; 06D1: DD 29 add ix, sp ;; 06D3: DD 39 add iy, bc ;; 06D5: FD 09 add iy, de ;; 06D7: FD 19 add iy, iy ;; 06D9: FD 29 add iy, sp ;; 06DB: FD 39 sbc hl, bc ;; 06DD: ED 42 sbc hl, de ;; 06DF: ED 52 sbc hl, hl ;; 06E1: ED 62 sbc hl, sp ;; 06E3: ED 72 adc hl, bc ;; 06E5: ED 4A adc hl, de ;; 06E7: ED 5A adc hl, hl ;; 06E9: ED 6A adc hl, sp ;; 06EB: ED 7A inc bc ;; 06ED: 03 inc de ;; 06EE: 13 inc hl ;; 06EF: 23 inc sp ;; 06F0: 33 dec bc ;; 06F1: 0B dec de ;; 06F2: 1B dec hl ;; 06F3: 2B dec sp ;; 06F4: 3B inc ix ;; 06F5: DD 23 dec ix ;; 06F7: DD 2B inc iy ;; 06F9: FD 23 dec iy ;; 06FB: FD 2B ex af, af ;; 06FD: 08 ex af, af' ;; 06FE: 08 exx ;; 06FF: D9 ex (sp), hl ;; 0700: E3 ex (sp), ix ;; 0701: DD E3 ex (sp), iy ;; 0703: FD E3 ex de, hl ;; 0705: EB rlca ;; 0706: 07 rrca ;; 0707: 0F rla ;; 0708: 17 rra ;; 0709: 1F rlc b ;; 070A: CB 00 rlc c ;; 070C: CB 01 rlc d ;; 070E: CB 02 rlc e ;; 0710: CB 03 rlc h ;; 0712: CB 04 rlc l ;; 0714: CB 05 rlc (hl) ;; 0716: CB 06 rlc a ;; 0718: CB 07 rrc b ;; 071A: CB 08 rrc c ;; 071C: CB 09 rrc d ;; 071E: CB 0A rrc e ;; 0720: CB 0B rrc h ;; 0722: CB 0C rrc l ;; 0724: CB 0D rrc (hl) ;; 0726: CB 0E rrc a ;; 0728: CB 0F rl b ;; 072A: CB 10 rl c ;; 072C: CB 11 rl d ;; 072E: CB 12 rl e ;; 0730: CB 13 rl h ;; 0732: CB 14 rl l ;; 0734: CB 15 rl (hl) ;; 0736: CB 16 rl a ;; 0738: CB 17 rr b ;; 073A: CB 18 rr c ;; 073C: CB 19 rr d ;; 073E: CB 1A rr e ;; 0740: CB 1B rr h ;; 0742: CB 1C rr l ;; 0744: CB 1D rr (hl) ;; 0746: CB 1E rr a ;; 0748: CB 1F sla b ;; 074A: CB 20 sla c ;; 074C: CB 21 sla d ;; 074E: CB 22 sla e ;; 0750: CB 23 sla h ;; 0752: CB 24 sla l ;; 0754: CB 25 sla (hl) ;; 0756: CB 26 sla a ;; 0758: CB 27 sra b ;; 075A: CB 28 sra c ;; 075C: CB 29 sra d ;; 075E: CB 2A sra e ;; 0760: CB 2B sra h ;; 0762: CB 2C sra l ;; 0764: CB 2D sra (hl) ;; 0766: CB 2E sra a ;; 0768: CB 2F srl b ;; 076A: CB 38 srl c ;; 076C: CB 39 srl d ;; 076E: CB 3A srl e ;; 0770: CB 3B srl h ;; 0772: CB 3C srl l ;; 0774: CB 3D srl (hl) ;; 0776: CB 3E srl a ;; 0778: CB 3F sll b ;; 077A: CB 30 sll c ;; 077C: CB 31 sll d ;; 077E: CB 32 sll e ;; 0780: CB 33 sll h ;; 0782: CB 34 sll l ;; 0784: CB 35 sll (hl) ;; 0786: CB 36 sll a ;; 0788: CB 37 rlc (ix+-128) ;; 078A: DD CB 80 06 rlc (ix) ;; 078E: DD CB 00 06 rlc (ix+127) ;; 0792: DD CB 7F 06 rrc (ix+-128) ;; 0796: DD CB 80 0E rrc (ix) ;; 079A: DD CB 00 0E rrc (ix+127) ;; 079E: DD CB 7F 0E rl (ix+-128) ;; 07A2: DD CB 80 16 rl (ix) ;; 07A6: DD CB 00 16 rl (ix+127) ;; 07AA: DD CB 7F 16 rr (ix+-128) ;; 07AE: DD CB 80 1E rr (ix) ;; 07B2: DD CB 00 1E rr (ix+127) ;; 07B6: DD CB 7F 1E sla (ix+-128) ;; 07BA: DD CB 80 26 sla (ix) ;; 07BE: DD CB 00 26 sla (ix+127) ;; 07C2: DD CB 7F 26 sra (ix+-128) ;; 07C6: DD CB 80 2E sra (ix) ;; 07CA: DD CB 00 2E sra (ix+127) ;; 07CE: DD CB 7F 2E srl (ix+-128) ;; 07D2: DD CB 80 3E srl (ix) ;; 07D6: DD CB 00 3E srl (ix+127) ;; 07DA: DD CB 7F 3E sll (ix+-128) ;; 07DE: DD CB 80 36 sll (ix) ;; 07E2: DD CB 00 36 sll (ix+127) ;; 07E6: DD CB 7F 36 rlc (iy+-128) ;; 07EA: FD CB 80 06 rlc (iy) ;; 07EE: FD CB 00 06 rlc (iy+127) ;; 07F2: FD CB 7F 06 rrc (iy+-128) ;; 07F6: FD CB 80 0E rrc (iy) ;; 07FA: FD CB 00 0E rrc (iy+127) ;; 07FE: FD CB 7F 0E rl (iy+-128) ;; 0802: FD CB 80 16 rl (iy) ;; 0806: FD CB 00 16 rl (iy+127) ;; 080A: FD CB 7F 16 rr (iy+-128) ;; 080E: FD CB 80 1E rr (iy) ;; 0812: FD CB 00 1E rr (iy+127) ;; 0816: FD CB 7F 1E sla (iy+-128) ;; 081A: FD CB 80 26 sla (iy) ;; 081E: FD CB 00 26 sla (iy+127) ;; 0822: FD CB 7F 26 sra (iy+-128) ;; 0826: FD CB 80 2E sra (iy) ;; 082A: FD CB 00 2E sra (iy+127) ;; 082E: FD CB 7F 2E srl (iy+-128) ;; 0832: FD CB 80 3E srl (iy) ;; 0836: FD CB 00 3E srl (iy+127) ;; 083A: FD CB 7F 3E sll (iy+-128) ;; 083E: FD CB 80 36 sll (iy) ;; 0842: FD CB 00 36 sll (iy+127) ;; 0846: FD CB 7F 36 bit 0, b ;; 084A: CB 40 bit 0, c ;; 084C: CB 41 bit 0, d ;; 084E: CB 42 bit 0, e ;; 0850: CB 43 bit 0, h ;; 0852: CB 44 bit 0, l ;; 0854: CB 45 bit 0, (hl) ;; 0856: CB 46 bit 0, a ;; 0858: CB 47 bit 1, b ;; 085A: CB 48 bit 1, c ;; 085C: CB 49 bit 1, d ;; 085E: CB 4A bit 1, e ;; 0860: CB 4B bit 1, h ;; 0862: CB 4C bit 1, l ;; 0864: CB 4D bit 1, (hl) ;; 0866: CB 4E bit 1, a ;; 0868: CB 4F bit 2, b ;; 086A: CB 50 bit 2, c ;; 086C: CB 51 bit 2, d ;; 086E: CB 52 bit 2, e ;; 0870: CB 53 bit 2, h ;; 0872: CB 54 bit 2, l ;; 0874: CB 55 bit 2, (hl) ;; 0876: CB 56 bit 2, a ;; 0878: CB 57 bit 3, b ;; 087A: CB 58 bit 3, c ;; 087C: CB 59 bit 3, d ;; 087E: CB 5A bit 3, e ;; 0880: CB 5B bit 3, h ;; 0882: CB 5C bit 3, l ;; 0884: CB 5D bit 3, (hl) ;; 0886: CB 5E bit 3, a ;; 0888: CB 5F bit 4, b ;; 088A: CB 60 bit 4, c ;; 088C: CB 61 bit 4, d ;; 088E: CB 62 bit 4, e ;; 0890: CB 63 bit 4, h ;; 0892: CB 64 bit 4, l ;; 0894: CB 65 bit 4, (hl) ;; 0896: CB 66 bit 4, a ;; 0898: CB 67 bit 5, b ;; 089A: CB 68 bit 5, c ;; 089C: CB 69 bit 5, d ;; 089E: CB 6A bit 5, e ;; 08A0: CB 6B bit 5, h ;; 08A2: CB 6C bit 5, l ;; 08A4: CB 6D bit 5, (hl) ;; 08A6: CB 6E bit 5, a ;; 08A8: CB 6F bit 6, b ;; 08AA: CB 70 bit 6, c ;; 08AC: CB 71 bit 6, d ;; 08AE: CB 72 bit 6, e ;; 08B0: CB 73 bit 6, h ;; 08B2: CB 74 bit 6, l ;; 08B4: CB 75 bit 6, (hl) ;; 08B6: CB 76 bit 6, a ;; 08B8: CB 77 bit 7, b ;; 08BA: CB 78 bit 7, c ;; 08BC: CB 79 bit 7, d ;; 08BE: CB 7A bit 7, e ;; 08C0: CB 7B bit 7, h ;; 08C2: CB 7C bit 7, l ;; 08C4: CB 7D bit 7, (hl) ;; 08C6: CB 7E bit 7, a ;; 08C8: CB 7F res 0, b ;; 08CA: CB 80 res 0, c ;; 08CC: CB 81 res 0, d ;; 08CE: CB 82 res 0, e ;; 08D0: CB 83 res 0, h ;; 08D2: CB 84 res 0, l ;; 08D4: CB 85 res 0, (hl) ;; 08D6: CB 86 res 0, a ;; 08D8: CB 87 res 1, b ;; 08DA: CB 88 res 1, c ;; 08DC: CB 89 res 1, d ;; 08DE: CB 8A res 1, e ;; 08E0: CB 8B res 1, h ;; 08E2: CB 8C res 1, l ;; 08E4: CB 8D res 1, (hl) ;; 08E6: CB 8E res 1, a ;; 08E8: CB 8F res 2, b ;; 08EA: CB 90 res 2, c ;; 08EC: CB 91 res 2, d ;; 08EE: CB 92 res 2, e ;; 08F0: CB 93 res 2, h ;; 08F2: CB 94 res 2, l ;; 08F4: CB 95 res 2, (hl) ;; 08F6: CB 96 res 2, a ;; 08F8: CB 97 res 3, b ;; 08FA: CB 98 res 3, c ;; 08FC: CB 99 res 3, d ;; 08FE: CB 9A res 3, e ;; 0900: CB 9B res 3, h ;; 0902: CB 9C res 3, l ;; 0904: CB 9D res 3, (hl) ;; 0906: CB 9E res 3, a ;; 0908: CB 9F res 4, b ;; 090A: CB A0 res 4, c ;; 090C: CB A1 res 4, d ;; 090E: CB A2 res 4, e ;; 0910: CB A3 res 4, h ;; 0912: CB A4 res 4, l ;; 0914: CB A5 res 4, (hl) ;; 0916: CB A6 res 4, a ;; 0918: CB A7 res 5, b ;; 091A: CB A8 res 5, c ;; 091C: CB A9 res 5, d ;; 091E: CB AA res 5, e ;; 0920: CB AB res 5, h ;; 0922: CB AC res 5, l ;; 0924: CB AD res 5, (hl) ;; 0926: CB AE res 5, a ;; 0928: CB AF res 6, b ;; 092A: CB B0 res 6, c ;; 092C: CB B1 res 6, d ;; 092E: CB B2 res 6, e ;; 0930: CB B3 res 6, h ;; 0932: CB B4 res 6, l ;; 0934: CB B5 res 6, (hl) ;; 0936: CB B6 res 6, a ;; 0938: CB B7 res 7, b ;; 093A: CB B8 res 7, c ;; 093C: CB B9 res 7, d ;; 093E: CB BA res 7, e ;; 0940: CB BB res 7, h ;; 0942: CB BC res 7, l ;; 0944: CB BD res 7, (hl) ;; 0946: CB BE res 7, a ;; 0948: CB BF set 0, b ;; 094A: CB C0 set 0, c ;; 094C: CB C1 set 0, d ;; 094E: CB C2 set 0, e ;; 0950: CB C3 set 0, h ;; 0952: CB C4 set 0, l ;; 0954: CB C5 set 0, (hl) ;; 0956: CB C6 set 0, a ;; 0958: CB C7 set 1, b ;; 095A: CB C8 set 1, c ;; 095C: CB C9 set 1, d ;; 095E: CB CA set 1, e ;; 0960: CB CB set 1, h ;; 0962: CB CC set 1, l ;; 0964: CB CD set 1, (hl) ;; 0966: CB CE set 1, a ;; 0968: CB CF set 2, b ;; 096A: CB D0 set 2, c ;; 096C: CB D1 set 2, d ;; 096E: CB D2 set 2, e ;; 0970: CB D3 set 2, h ;; 0972: CB D4 set 2, l ;; 0974: CB D5 set 2, (hl) ;; 0976: CB D6 set 2, a ;; 0978: CB D7 set 3, b ;; 097A: CB D8 set 3, c ;; 097C: CB D9 set 3, d ;; 097E: CB DA set 3, e ;; 0980: CB DB set 3, h ;; 0982: CB DC set 3, l ;; 0984: CB DD set 3, (hl) ;; 0986: CB DE set 3, a ;; 0988: CB DF set 4, b ;; 098A: CB E0 set 4, c ;; 098C: CB E1 set 4, d ;; 098E: CB E2 set 4, e ;; 0990: CB E3 set 4, h ;; 0992: CB E4 set 4, l ;; 0994: CB E5 set 4, (hl) ;; 0996: CB E6 set 4, a ;; 0998: CB E7 set 5, b ;; 099A: CB E8 set 5, c ;; 099C: CB E9 set 5, d ;; 099E: CB EA set 5, e ;; 09A0: CB EB set 5, h ;; 09A2: CB EC set 5, l ;; 09A4: CB ED set 5, (hl) ;; 09A6: CB EE set 5, a ;; 09A8: CB EF set 6, b ;; 09AA: CB F0 set 6, c ;; 09AC: CB F1 set 6, d ;; 09AE: CB F2 set 6, e ;; 09B0: CB F3 set 6, h ;; 09B2: CB F4 set 6, l ;; 09B4: CB F5 set 6, (hl) ;; 09B6: CB F6 set 6, a ;; 09B8: CB F7 set 7, b ;; 09BA: CB F8 set 7, c ;; 09BC: CB F9 set 7, d ;; 09BE: CB FA set 7, e ;; 09C0: CB FB set 7, h ;; 09C2: CB FC set 7, l ;; 09C4: CB FD set 7, (hl) ;; 09C6: CB FE set 7, a ;; 09C8: CB FF bit 0, (ix+-128) ;; 09CA: DD CB 80 46 bit 0, (ix) ;; 09CE: DD CB 00 46 bit 0, (ix+127) ;; 09D2: DD CB 7F 46 bit 1, (ix+-128) ;; 09D6: DD CB 80 4E bit 1, (ix) ;; 09DA: DD CB 00 4E bit 1, (ix+127) ;; 09DE: DD CB 7F 4E bit 2, (ix+-128) ;; 09E2: DD CB 80 56 bit 2, (ix) ;; 09E6: DD CB 00 56 bit 2, (ix+127) ;; 09EA: DD CB 7F 56 bit 3, (ix+-128) ;; 09EE: DD CB 80 5E bit 3, (ix) ;; 09F2: DD CB 00 5E bit 3, (ix+127) ;; 09F6: DD CB 7F 5E bit 4, (ix+-128) ;; 09FA: DD CB 80 66 bit 4, (ix) ;; 09FE: DD CB 00 66 bit 4, (ix+127) ;; 0A02: DD CB 7F 66 bit 5, (ix+-128) ;; 0A06: DD CB 80 6E bit 5, (ix) ;; 0A0A: DD CB 00 6E bit 5, (ix+127) ;; 0A0E: DD CB 7F 6E bit 6, (ix+-128) ;; 0A12: DD CB 80 76 bit 6, (ix) ;; 0A16: DD CB 00 76 bit 6, (ix+127) ;; 0A1A: DD CB 7F 76 bit 7, (ix+-128) ;; 0A1E: DD CB 80 7E bit 7, (ix) ;; 0A22: DD CB 00 7E bit 7, (ix+127) ;; 0A26: DD CB 7F 7E res 0, (ix+-128) ;; 0A2A: DD CB 80 86 res 0, (ix) ;; 0A2E: DD CB 00 86 res 0, (ix+127) ;; 0A32: DD CB 7F 86 res 1, (ix+-128) ;; 0A36: DD CB 80 8E res 1, (ix) ;; 0A3A: DD CB 00 8E res 1, (ix+127) ;; 0A3E: DD CB 7F 8E res 2, (ix+-128) ;; 0A42: DD CB 80 96 res 2, (ix) ;; 0A46: DD CB 00 96 res 2, (ix+127) ;; 0A4A: DD CB 7F 96 res 3, (ix+-128) ;; 0A4E: DD CB 80 9E res 3, (ix) ;; 0A52: DD CB 00 9E res 3, (ix+127) ;; 0A56: DD CB 7F 9E res 4, (ix+-128) ;; 0A5A: DD CB 80 A6 res 4, (ix) ;; 0A5E: DD CB 00 A6 res 4, (ix+127) ;; 0A62: DD CB 7F A6 res 5, (ix+-128) ;; 0A66: DD CB 80 AE res 5, (ix) ;; 0A6A: DD CB 00 AE res 5, (ix+127) ;; 0A6E: DD CB 7F AE res 6, (ix+-128) ;; 0A72: DD CB 80 B6 res 6, (ix) ;; 0A76: DD CB 00 B6 res 6, (ix+127) ;; 0A7A: DD CB 7F B6 res 7, (ix+-128) ;; 0A7E: DD CB 80 BE res 7, (ix) ;; 0A82: DD CB 00 BE res 7, (ix+127) ;; 0A86: DD CB 7F BE set 0, (ix+-128) ;; 0A8A: DD CB 80 C6 set 0, (ix) ;; 0A8E: DD CB 00 C6 set 0, (ix+127) ;; 0A92: DD CB 7F C6 set 1, (ix+-128) ;; 0A96: DD CB 80 CE set 1, (ix) ;; 0A9A: DD CB 00 CE set 1, (ix+127) ;; 0A9E: DD CB 7F CE set 2, (ix+-128) ;; 0AA2: DD CB 80 D6 set 2, (ix) ;; 0AA6: DD CB 00 D6 set 2, (ix+127) ;; 0AAA: DD CB 7F D6 set 3, (ix+-128) ;; 0AAE: DD CB 80 DE set 3, (ix) ;; 0AB2: DD CB 00 DE set 3, (ix+127) ;; 0AB6: DD CB 7F DE set 4, (ix+-128) ;; 0ABA: DD CB 80 E6 set 4, (ix) ;; 0ABE: DD CB 00 E6 set 4, (ix+127) ;; 0AC2: DD CB 7F E6 set 5, (ix+-128) ;; 0AC6: DD CB 80 EE set 5, (ix) ;; 0ACA: DD CB 00 EE set 5, (ix+127) ;; 0ACE: DD CB 7F EE set 6, (ix+-128) ;; 0AD2: DD CB 80 F6 set 6, (ix) ;; 0AD6: DD CB 00 F6 set 6, (ix+127) ;; 0ADA: DD CB 7F F6 set 7, (ix+-128) ;; 0ADE: DD CB 80 FE set 7, (ix) ;; 0AE2: DD CB 00 FE set 7, (ix+127) ;; 0AE6: DD CB 7F FE bit 0, (iy+-128) ;; 0AEA: FD CB 80 46 bit 0, (iy) ;; 0AEE: FD CB 00 46 bit 0, (iy+127) ;; 0AF2: FD CB 7F 46 bit 1, (iy+-128) ;; 0AF6: FD CB 80 4E bit 1, (iy) ;; 0AFA: FD CB 00 4E bit 1, (iy+127) ;; 0AFE: FD CB 7F 4E bit 2, (iy+-128) ;; 0B02: FD CB 80 56 bit 2, (iy) ;; 0B06: FD CB 00 56 bit 2, (iy+127) ;; 0B0A: FD CB 7F 56 bit 3, (iy+-128) ;; 0B0E: FD CB 80 5E bit 3, (iy) ;; 0B12: FD CB 00 5E bit 3, (iy+127) ;; 0B16: FD CB 7F 5E bit 4, (iy+-128) ;; 0B1A: FD CB 80 66 bit 4, (iy) ;; 0B1E: FD CB 00 66 bit 4, (iy+127) ;; 0B22: FD CB 7F 66 bit 5, (iy+-128) ;; 0B26: FD CB 80 6E bit 5, (iy) ;; 0B2A: FD CB 00 6E bit 5, (iy+127) ;; 0B2E: FD CB 7F 6E bit 6, (iy+-128) ;; 0B32: FD CB 80 76 bit 6, (iy) ;; 0B36: FD CB 00 76 bit 6, (iy+127) ;; 0B3A: FD CB 7F 76 bit 7, (iy+-128) ;; 0B3E: FD CB 80 7E bit 7, (iy) ;; 0B42: FD CB 00 7E bit 7, (iy+127) ;; 0B46: FD CB 7F 7E res 0, (iy+-128) ;; 0B4A: FD CB 80 86 res 0, (iy) ;; 0B4E: FD CB 00 86 res 0, (iy+127) ;; 0B52: FD CB 7F 86 res 1, (iy+-128) ;; 0B56: FD CB 80 8E res 1, (iy) ;; 0B5A: FD CB 00 8E res 1, (iy+127) ;; 0B5E: FD CB 7F 8E res 2, (iy+-128) ;; 0B62: FD CB 80 96 res 2, (iy) ;; 0B66: FD CB 00 96 res 2, (iy+127) ;; 0B6A: FD CB 7F 96 res 3, (iy+-128) ;; 0B6E: FD CB 80 9E res 3, (iy) ;; 0B72: FD CB 00 9E res 3, (iy+127) ;; 0B76: FD CB 7F 9E res 4, (iy+-128) ;; 0B7A: FD CB 80 A6 res 4, (iy) ;; 0B7E: FD CB 00 A6 res 4, (iy+127) ;; 0B82: FD CB 7F A6 res 5, (iy+-128) ;; 0B86: FD CB 80 AE res 5, (iy) ;; 0B8A: FD CB 00 AE res 5, (iy+127) ;; 0B8E: FD CB 7F AE res 6, (iy+-128) ;; 0B92: FD CB 80 B6 res 6, (iy) ;; 0B96: FD CB 00 B6 res 6, (iy+127) ;; 0B9A: FD CB 7F B6 res 7, (iy+-128) ;; 0B9E: FD CB 80 BE res 7, (iy) ;; 0BA2: FD CB 00 BE res 7, (iy+127) ;; 0BA6: FD CB 7F BE set 0, (iy+-128) ;; 0BAA: FD CB 80 C6 set 0, (iy) ;; 0BAE: FD CB 00 C6 set 0, (iy+127) ;; 0BB2: FD CB 7F C6 set 1, (iy+-128) ;; 0BB6: FD CB 80 CE set 1, (iy) ;; 0BBA: FD CB 00 CE set 1, (iy+127) ;; 0BBE: FD CB 7F CE set 2, (iy+-128) ;; 0BC2: FD CB 80 D6 set 2, (iy) ;; 0BC6: FD CB 00 D6 set 2, (iy+127) ;; 0BCA: FD CB 7F D6 set 3, (iy+-128) ;; 0BCE: FD CB 80 DE set 3, (iy) ;; 0BD2: FD CB 00 DE set 3, (iy+127) ;; 0BD6: FD CB 7F DE set 4, (iy+-128) ;; 0BDA: FD CB 80 E6 set 4, (iy) ;; 0BDE: FD CB 00 E6 set 4, (iy+127) ;; 0BE2: FD CB 7F E6 set 5, (iy+-128) ;; 0BE6: FD CB 80 EE set 5, (iy) ;; 0BEA: FD CB 00 EE set 5, (iy+127) ;; 0BEE: FD CB 7F EE set 6, (iy+-128) ;; 0BF2: FD CB 80 F6 set 6, (iy) ;; 0BF6: FD CB 00 F6 set 6, (iy+127) ;; 0BFA: FD CB 7F F6 set 7, (iy+-128) ;; 0BFE: FD CB 80 FE set 7, (iy) ;; 0C02: FD CB 00 FE set 7, (iy+127) ;; 0C06: FD CB 7F FE ldi ;; 0C0A: ED A0 ldir ;; 0C0C: ED B0 ldd ;; 0C0E: ED A8 lddr ;; 0C10: ED B8 nop ;; 0C12: 00 halt ;; 0C13: 76 jp 0 ;; 0C14: C3 00 00 jp 291 ;; 0C17: C3 23 01 jp 17767 ;; 0C1A: C3 67 45 jp 35243 ;; 0C1D: C3 AB 89 jp 52719 ;; 0C20: C3 EF CD jp 65535 ;; 0C23: C3 FF FF jp nz, 0 ;; 0C26: C2 00 00 jp nz, 291 ;; 0C29: C2 23 01 jp nz, 17767 ;; 0C2C: C2 67 45 jp nz, 35243 ;; 0C2F: C2 AB 89 jp nz, 52719 ;; 0C32: C2 EF CD jp nz, 65535 ;; 0C35: C2 FF FF jp z, 0 ;; 0C38: CA 00 00 jp z, 291 ;; 0C3B: CA 23 01 jp z, 17767 ;; 0C3E: CA 67 45 jp z, 35243 ;; 0C41: CA AB 89 jp z, 52719 ;; 0C44: CA EF CD jp z, 65535 ;; 0C47: CA FF FF jp nc, 0 ;; 0C4A: D2 00 00 jp nc, 291 ;; 0C4D: D2 23 01 jp nc, 17767 ;; 0C50: D2 67 45 jp nc, 35243 ;; 0C53: D2 AB 89 jp nc, 52719 ;; 0C56: D2 EF CD jp nc, 65535 ;; 0C59: D2 FF FF jp c, 0 ;; 0C5C: DA 00 00 jp c, 291 ;; 0C5F: DA 23 01 jp c, 17767 ;; 0C62: DA 67 45 jp c, 35243 ;; 0C65: DA AB 89 jp c, 52719 ;; 0C68: DA EF CD jp c, 65535 ;; 0C6B: DA FF FF jp po, 0 ;; 0C6E: E2 00 00 jp po, 291 ;; 0C71: E2 23 01 jp po, 17767 ;; 0C74: E2 67 45 jp po, 35243 ;; 0C77: E2 AB 89 jp po, 52719 ;; 0C7A: E2 EF CD jp po, 65535 ;; 0C7D: E2 FF FF jp pe, 0 ;; 0C80: EA 00 00 jp pe, 291 ;; 0C83: EA 23 01 jp pe, 17767 ;; 0C86: EA 67 45 jp pe, 35243 ;; 0C89: EA AB 89 jp pe, 52719 ;; 0C8C: EA EF CD jp pe, 65535 ;; 0C8F: EA FF FF jp p, 0 ;; 0C92: F2 00 00 jp p, 291 ;; 0C95: F2 23 01 jp p, 17767 ;; 0C98: F2 67 45 jp p, 35243 ;; 0C9B: F2 AB 89 jp p, 52719 ;; 0C9E: F2 EF CD jp p, 65535 ;; 0CA1: F2 FF FF jp m, 0 ;; 0CA4: FA 00 00 jp m, 291 ;; 0CA7: FA 23 01 jp m, 17767 ;; 0CAA: FA 67 45 jp m, 35243 ;; 0CAD: FA AB 89 jp m, 52719 ;; 0CB0: FA EF CD jp m, 65535 ;; 0CB3: FA FF FF jp (hl) ;; 0CB6: E9 jp (ix) ;; 0CB7: DD E9 jp (iy) ;; 0CB9: FD E9 djnz ASMPC ;; 0CBB: 10 FE djnz b, ASMPC ;; 0CBD: 10 FE jr ASMPC ;; 0CBF: 18 FE jr nz, ASMPC ;; 0CC1: 20 FE jr z, ASMPC ;; 0CC3: 28 FE jr nc, ASMPC ;; 0CC5: 30 FE jr c, ASMPC ;; 0CC7: 38 FE call 0 ;; 0CC9: CD 00 00 call 291 ;; 0CCC: CD 23 01 call 17767 ;; 0CCF: CD 67 45 call 35243 ;; 0CD2: CD AB 89 call 52719 ;; 0CD5: CD EF CD call 65535 ;; 0CD8: CD FF FF ret ;; 0CDB: C9 ret nz ;; 0CDC: C0 ret z ;; 0CDD: C8 ret nc ;; 0CDE: D0 ret c ;; 0CDF: D8 ret po ;; 0CE0: E0 ret pe ;; 0CE1: E8 ret p ;; 0CE2: F0 ret m ;; 0CE3: F8 rst 16 ;; 0CE4: D7 rst 24 ;; 0CE5: DF rst 32 ;; 0CE6: E7 rst 40 ;; 0CE7: EF rst 56 ;; 0CE8: FF in a, (0) ;; 0CE9: DB 00 in a, (85) ;; 0CEB: DB 55 in a, (170) ;; 0CED: DB AA in a, (255) ;; 0CEF: DB FF in b, (c) ;; 0CF1: ED 40 in c, (c) ;; 0CF3: ED 48 in d, (c) ;; 0CF5: ED 50 in e, (c) ;; 0CF7: ED 58 in h, (c) ;; 0CF9: ED 60 in l, (c) ;; 0CFB: ED 68 in f, (c) ;; 0CFD: ED 70 in a, (c) ;; 0CFF: ED 78 out (0), a ;; 0D01: D3 00 out (85), a ;; 0D03: D3 55 out (170), a ;; 0D05: D3 AA out (255), a ;; 0D07: D3 FF out (c), b ;; 0D09: ED 41 out (c), c ;; 0D0B: ED 49 out (c), d ;; 0D0D: ED 51 out (c), e ;; 0D0F: ED 59 out (c), h ;; 0D11: ED 61 out (c), l ;; 0D13: ED 69 out (c), 0 ;; 0D15: ED 71 out (c), a ;; 0D17: ED 79 ini ;; 0D19: ED A2 inir ;; 0D1B: ED B2 ind ;; 0D1D: ED AA indr ;; 0D1F: ED BA outi ;; 0D21: ED A3 otir ;; 0D23: ED B3 outd ;; 0D25: ED AB otdr ;; 0D27: ED BB di ;; 0D29: F3 ei ;; 0D2A: FB im 0 ;; 0D2B: ED 46 im 1 ;; 0D2D: ED 56 im 2 ;; 0D2F: ED 5E ld i, a ;; 0D31: ED 47 ld a, i ;; 0D33: ED 57 ld r, a ;; 0D35: ED 4F ld a, r ;; 0D37: ED 5F reti ;; 0D39: ED 4D retn ;; 0D3B: ED 45
wc.asm
via007/learnos-xv6
1
102095
<reponame>via007/learnos-xv6 _wc: 文件格式 elf32-i386 Disassembly of section .text: 00000000 <main>: printf(1, "%d %d %d %s\n", l, w, c, name); } int main(int argc, char *argv[]) { 0: 8d 4c 24 04 lea 0x4(%esp),%ecx 4: 83 e4 f0 and $0xfffffff0,%esp 7: ff 71 fc pushl -0x4(%ecx) a: 55 push %ebp b: 89 e5 mov %esp,%ebp d: 57 push %edi e: 56 push %esi f: be 01 00 00 00 mov $0x1,%esi 14: 53 push %ebx 15: 51 push %ecx 16: 83 ec 18 sub $0x18,%esp 19: 8b 01 mov (%ecx),%eax 1b: 8b 59 04 mov 0x4(%ecx),%ebx 1e: 89 45 e4 mov %eax,-0x1c(%ebp) 21: 83 c3 04 add $0x4,%ebx int fd, i; if(argc <= 1){ 24: 83 f8 01 cmp $0x1,%eax 27: 7e 56 jle 7f <main+0x7f> 29: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi wc(0, ""); exit(); } for(i = 1; i < argc; i++){ if((fd = open(argv[i], 0)) < 0){ 30: 83 ec 08 sub $0x8,%esp 33: 6a 00 push $0x0 35: ff 33 pushl (%ebx) 37: e8 d5 03 00 00 call 411 <open> 3c: 83 c4 10 add $0x10,%esp 3f: 89 c7 mov %eax,%edi 41: 85 c0 test %eax,%eax 43: 78 26 js 6b <main+0x6b> printf(1, "wc: cannot open %s\n", argv[i]); exit(); } wc(fd, argv[i]); 45: 83 ec 08 sub $0x8,%esp 48: ff 33 pushl (%ebx) for(i = 1; i < argc; i++){ 4a: 83 c6 01 add $0x1,%esi 4d: 83 c3 04 add $0x4,%ebx wc(fd, argv[i]); 50: 50 push %eax 51: e8 4a 00 00 00 call a0 <wc> close(fd); 56: 89 3c 24 mov %edi,(%esp) 59: e8 9b 03 00 00 call 3f9 <close> for(i = 1; i < argc; i++){ 5e: 83 c4 10 add $0x10,%esp 61: 39 75 e4 cmp %esi,-0x1c(%ebp) 64: 75 ca jne 30 <main+0x30> } exit(); 66: e8 66 03 00 00 call 3d1 <exit> printf(1, "wc: cannot open %s\n", argv[i]); 6b: 50 push %eax 6c: ff 33 pushl (%ebx) 6e: 68 fb 08 00 00 push $0x8fb 73: 6a 01 push $0x1 75: e8 f6 04 00 00 call 570 <printf> exit(); 7a: e8 52 03 00 00 call 3d1 <exit> wc(0, ""); 7f: 52 push %edx 80: 52 push %edx 81: 68 ed 08 00 00 push $0x8ed 86: 6a 00 push $0x0 88: e8 13 00 00 00 call a0 <wc> exit(); 8d: e8 3f 03 00 00 call 3d1 <exit> 92: 66 90 xchg %ax,%ax 94: 66 90 xchg %ax,%ax 96: 66 90 xchg %ax,%ax 98: 66 90 xchg %ax,%ax 9a: 66 90 xchg %ax,%ax 9c: 66 90 xchg %ax,%ax 9e: 66 90 xchg %ax,%ax 000000a0 <wc>: { a0: 55 push %ebp a1: 89 e5 mov %esp,%ebp a3: 57 push %edi a4: 56 push %esi a5: 53 push %ebx l = w = c = 0; a6: 31 db xor %ebx,%ebx { a8: 83 ec 1c sub $0x1c,%esp inword = 0; ab: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) l = w = c = 0; b2: c7 45 dc 00 00 00 00 movl $0x0,-0x24(%ebp) b9: c7 45 e0 00 00 00 00 movl $0x0,-0x20(%ebp) while((n = read(fd, buf, sizeof(buf))) > 0){ c0: 83 ec 04 sub $0x4,%esp c3: 68 00 02 00 00 push $0x200 c8: 68 20 0c 00 00 push $0xc20 cd: ff 75 08 pushl 0x8(%ebp) d0: e8 14 03 00 00 call 3e9 <read> d5: 83 c4 10 add $0x10,%esp d8: 89 c6 mov %eax,%esi da: 85 c0 test %eax,%eax dc: 7e 62 jle 140 <wc+0xa0> for(i=0; i<n; i++){ de: 31 ff xor %edi,%edi e0: eb 14 jmp f6 <wc+0x56> e2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi inword = 0; e8: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) for(i=0; i<n; i++){ ef: 83 c7 01 add $0x1,%edi f2: 39 fe cmp %edi,%esi f4: 74 42 je 138 <wc+0x98> if(buf[i] == '\n') f6: 0f be 87 20 0c 00 00 movsbl 0xc20(%edi),%eax l++; fd: 31 c9 xor %ecx,%ecx ff: 3c 0a cmp $0xa,%al 101: 0f 94 c1 sete %cl if(strchr(" \r\t\n\v", buf[i])) 104: 83 ec 08 sub $0x8,%esp 107: 50 push %eax l++; 108: 01 cb add %ecx,%ebx if(strchr(" \r\t\n\v", buf[i])) 10a: 68 d8 08 00 00 push $0x8d8 10f: e8 3c 01 00 00 call 250 <strchr> 114: 83 c4 10 add $0x10,%esp 117: 85 c0 test %eax,%eax 119: 75 cd jne e8 <wc+0x48> else if(!inword){ 11b: 8b 55 e4 mov -0x1c(%ebp),%edx 11e: 85 d2 test %edx,%edx 120: 75 cd jne ef <wc+0x4f> for(i=0; i<n; i++){ 122: 83 c7 01 add $0x1,%edi w++; 125: 83 45 e0 01 addl $0x1,-0x20(%ebp) inword = 1; 129: c7 45 e4 01 00 00 00 movl $0x1,-0x1c(%ebp) for(i=0; i<n; i++){ 130: 39 fe cmp %edi,%esi 132: 75 c2 jne f6 <wc+0x56> 134: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 138: 01 75 dc add %esi,-0x24(%ebp) 13b: eb 83 jmp c0 <wc+0x20> 13d: 8d 76 00 lea 0x0(%esi),%esi if(n < 0){ 140: 75 24 jne 166 <wc+0xc6> printf(1, "%d %d %d %s\n", l, w, c, name); 142: 83 ec 08 sub $0x8,%esp 145: ff 75 0c pushl 0xc(%ebp) 148: ff 75 dc pushl -0x24(%ebp) 14b: ff 75 e0 pushl -0x20(%ebp) 14e: 53 push %ebx 14f: 68 ee 08 00 00 push $0x8ee 154: 6a 01 push $0x1 156: e8 15 04 00 00 call 570 <printf> } 15b: 83 c4 20 add $0x20,%esp 15e: 8d 65 f4 lea -0xc(%ebp),%esp 161: 5b pop %ebx 162: 5e pop %esi 163: 5f pop %edi 164: 5d pop %ebp 165: c3 ret printf(1, "wc: read error\n"); 166: 50 push %eax 167: 50 push %eax 168: 68 de 08 00 00 push $0x8de 16d: 6a 01 push $0x1 16f: e8 fc 03 00 00 call 570 <printf> exit(); 174: e8 58 02 00 00 call 3d1 <exit> 179: 66 90 xchg %ax,%ax 17b: 66 90 xchg %ax,%ax 17d: 66 90 xchg %ax,%ax 17f: 90 nop 00000180 <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, const char *t) { 180: 55 push %ebp char *os; os = s; while((*s++ = *t++) != 0) 181: 31 d2 xor %edx,%edx { 183: 89 e5 mov %esp,%ebp 185: 53 push %ebx 186: 8b 45 08 mov 0x8(%ebp),%eax 189: 8b 5d 0c mov 0xc(%ebp),%ebx 18c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi while((*s++ = *t++) != 0) 190: 0f b6 0c 13 movzbl (%ebx,%edx,1),%ecx 194: 88 0c 10 mov %cl,(%eax,%edx,1) 197: 83 c2 01 add $0x1,%edx 19a: 84 c9 test %cl,%cl 19c: 75 f2 jne 190 <strcpy+0x10> ; return os; } 19e: 5b pop %ebx 19f: 5d pop %ebp 1a0: c3 ret 1a1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 1a8: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 1af: 90 nop 000001b0 <strcmp>: int strcmp(const char *p, const char *q) { 1b0: 55 push %ebp 1b1: 89 e5 mov %esp,%ebp 1b3: 56 push %esi 1b4: 53 push %ebx 1b5: 8b 5d 08 mov 0x8(%ebp),%ebx 1b8: 8b 75 0c mov 0xc(%ebp),%esi while(*p && *p == *q) 1bb: 0f b6 13 movzbl (%ebx),%edx 1be: 0f b6 0e movzbl (%esi),%ecx 1c1: 84 d2 test %dl,%dl 1c3: 74 1e je 1e3 <strcmp+0x33> 1c5: b8 01 00 00 00 mov $0x1,%eax 1ca: 38 ca cmp %cl,%dl 1cc: 74 09 je 1d7 <strcmp+0x27> 1ce: eb 20 jmp 1f0 <strcmp+0x40> 1d0: 83 c0 01 add $0x1,%eax 1d3: 38 ca cmp %cl,%dl 1d5: 75 19 jne 1f0 <strcmp+0x40> 1d7: 0f b6 14 03 movzbl (%ebx,%eax,1),%edx 1db: 0f b6 0c 06 movzbl (%esi,%eax,1),%ecx 1df: 84 d2 test %dl,%dl 1e1: 75 ed jne 1d0 <strcmp+0x20> 1e3: 31 c0 xor %eax,%eax p++, q++; return (uchar)*p - (uchar)*q; } 1e5: 5b pop %ebx 1e6: 5e pop %esi return (uchar)*p - (uchar)*q; 1e7: 29 c8 sub %ecx,%eax } 1e9: 5d pop %ebp 1ea: c3 ret 1eb: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 1ef: 90 nop 1f0: 0f b6 c2 movzbl %dl,%eax 1f3: 5b pop %ebx 1f4: 5e pop %esi return (uchar)*p - (uchar)*q; 1f5: 29 c8 sub %ecx,%eax } 1f7: 5d pop %ebp 1f8: c3 ret 1f9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 00000200 <strlen>: uint strlen(const char *s) { 200: 55 push %ebp 201: 89 e5 mov %esp,%ebp 203: 8b 4d 08 mov 0x8(%ebp),%ecx int n; for(n = 0; s[n]; n++) 206: 80 39 00 cmpb $0x0,(%ecx) 209: 74 15 je 220 <strlen+0x20> 20b: 31 d2 xor %edx,%edx 20d: 8d 76 00 lea 0x0(%esi),%esi 210: 83 c2 01 add $0x1,%edx 213: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1) 217: 89 d0 mov %edx,%eax 219: 75 f5 jne 210 <strlen+0x10> ; return n; } 21b: 5d pop %ebp 21c: c3 ret 21d: 8d 76 00 lea 0x0(%esi),%esi for(n = 0; s[n]; n++) 220: 31 c0 xor %eax,%eax } 222: 5d pop %ebp 223: c3 ret 224: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 22b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 22f: 90 nop 00000230 <memset>: void* memset(void *dst, int c, uint n) { 230: 55 push %ebp 231: 89 e5 mov %esp,%ebp 233: 57 push %edi 234: 8b 55 08 mov 0x8(%ebp),%edx } static inline void stosb(void *addr, int data, int cnt) { asm volatile("cld; rep stosb" : 237: 8b 4d 10 mov 0x10(%ebp),%ecx 23a: 8b 45 0c mov 0xc(%ebp),%eax 23d: 89 d7 mov %edx,%edi 23f: fc cld 240: f3 aa rep stos %al,%es:(%edi) stosb(dst, c, n); return dst; } 242: 89 d0 mov %edx,%eax 244: 5f pop %edi 245: 5d pop %ebp 246: c3 ret 247: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 24e: 66 90 xchg %ax,%ax 00000250 <strchr>: char* strchr(const char *s, char c) { 250: 55 push %ebp 251: 89 e5 mov %esp,%ebp 253: 53 push %ebx 254: 8b 45 08 mov 0x8(%ebp),%eax 257: 8b 55 0c mov 0xc(%ebp),%edx for(; *s; s++) 25a: 0f b6 18 movzbl (%eax),%ebx 25d: 84 db test %bl,%bl 25f: 74 1d je 27e <strchr+0x2e> 261: 89 d1 mov %edx,%ecx if(*s == c) 263: 38 d3 cmp %dl,%bl 265: 75 0d jne 274 <strchr+0x24> 267: eb 17 jmp 280 <strchr+0x30> 269: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 270: 38 ca cmp %cl,%dl 272: 74 0c je 280 <strchr+0x30> for(; *s; s++) 274: 83 c0 01 add $0x1,%eax 277: 0f b6 10 movzbl (%eax),%edx 27a: 84 d2 test %dl,%dl 27c: 75 f2 jne 270 <strchr+0x20> return (char*)s; return 0; 27e: 31 c0 xor %eax,%eax } 280: 5b pop %ebx 281: 5d pop %ebp 282: c3 ret 283: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 28a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 00000290 <gets>: char* gets(char *buf, int max) { 290: 55 push %ebp 291: 89 e5 mov %esp,%ebp 293: 57 push %edi 294: 56 push %esi int i, cc; char c; for(i=0; i+1 < max; ){ 295: 31 f6 xor %esi,%esi { 297: 53 push %ebx 298: 89 f3 mov %esi,%ebx 29a: 83 ec 1c sub $0x1c,%esp 29d: 8b 7d 08 mov 0x8(%ebp),%edi for(i=0; i+1 < max; ){ 2a0: eb 2f jmp 2d1 <gets+0x41> 2a2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi cc = read(0, &c, 1); 2a8: 83 ec 04 sub $0x4,%esp 2ab: 8d 45 e7 lea -0x19(%ebp),%eax 2ae: 6a 01 push $0x1 2b0: 50 push %eax 2b1: 6a 00 push $0x0 2b3: e8 31 01 00 00 call 3e9 <read> if(cc < 1) 2b8: 83 c4 10 add $0x10,%esp 2bb: 85 c0 test %eax,%eax 2bd: 7e 1c jle 2db <gets+0x4b> break; buf[i++] = c; 2bf: 0f b6 45 e7 movzbl -0x19(%ebp),%eax 2c3: 83 c7 01 add $0x1,%edi 2c6: 88 47 ff mov %al,-0x1(%edi) if(c == '\n' || c == '\r') 2c9: 3c 0a cmp $0xa,%al 2cb: 74 23 je 2f0 <gets+0x60> 2cd: 3c 0d cmp $0xd,%al 2cf: 74 1f je 2f0 <gets+0x60> for(i=0; i+1 < max; ){ 2d1: 83 c3 01 add $0x1,%ebx 2d4: 89 fe mov %edi,%esi 2d6: 3b 5d 0c cmp 0xc(%ebp),%ebx 2d9: 7c cd jl 2a8 <gets+0x18> 2db: 89 f3 mov %esi,%ebx break; } buf[i] = '\0'; return buf; } 2dd: 8b 45 08 mov 0x8(%ebp),%eax buf[i] = '\0'; 2e0: c6 03 00 movb $0x0,(%ebx) } 2e3: 8d 65 f4 lea -0xc(%ebp),%esp 2e6: 5b pop %ebx 2e7: 5e pop %esi 2e8: 5f pop %edi 2e9: 5d pop %ebp 2ea: c3 ret 2eb: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 2ef: 90 nop 2f0: 8b 75 08 mov 0x8(%ebp),%esi 2f3: 8b 45 08 mov 0x8(%ebp),%eax 2f6: 01 de add %ebx,%esi 2f8: 89 f3 mov %esi,%ebx buf[i] = '\0'; 2fa: c6 03 00 movb $0x0,(%ebx) } 2fd: 8d 65 f4 lea -0xc(%ebp),%esp 300: 5b pop %ebx 301: 5e pop %esi 302: 5f pop %edi 303: 5d pop %ebp 304: c3 ret 305: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 30c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 00000310 <stat>: int stat(const char *n, struct stat *st) { 310: 55 push %ebp 311: 89 e5 mov %esp,%ebp 313: 56 push %esi 314: 53 push %ebx int fd; int r; fd = open(n, O_RDONLY); 315: 83 ec 08 sub $0x8,%esp 318: 6a 00 push $0x0 31a: ff 75 08 pushl 0x8(%ebp) 31d: e8 ef 00 00 00 call 411 <open> if(fd < 0) 322: 83 c4 10 add $0x10,%esp 325: 85 c0 test %eax,%eax 327: 78 27 js 350 <stat+0x40> return -1; r = fstat(fd, st); 329: 83 ec 08 sub $0x8,%esp 32c: ff 75 0c pushl 0xc(%ebp) 32f: 89 c3 mov %eax,%ebx 331: 50 push %eax 332: e8 f2 00 00 00 call 429 <fstat> close(fd); 337: 89 1c 24 mov %ebx,(%esp) r = fstat(fd, st); 33a: 89 c6 mov %eax,%esi close(fd); 33c: e8 b8 00 00 00 call 3f9 <close> return r; 341: 83 c4 10 add $0x10,%esp } 344: 8d 65 f8 lea -0x8(%ebp),%esp 347: 89 f0 mov %esi,%eax 349: 5b pop %ebx 34a: 5e pop %esi 34b: 5d pop %ebp 34c: c3 ret 34d: 8d 76 00 lea 0x0(%esi),%esi return -1; 350: be ff ff ff ff mov $0xffffffff,%esi 355: eb ed jmp 344 <stat+0x34> 357: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 35e: 66 90 xchg %ax,%ax 00000360 <atoi>: int atoi(const char *s) { 360: 55 push %ebp 361: 89 e5 mov %esp,%ebp 363: 53 push %ebx 364: 8b 4d 08 mov 0x8(%ebp),%ecx int n; n = 0; while('0' <= *s && *s <= '9') 367: 0f be 11 movsbl (%ecx),%edx 36a: 8d 42 d0 lea -0x30(%edx),%eax 36d: 3c 09 cmp $0x9,%al n = 0; 36f: b8 00 00 00 00 mov $0x0,%eax while('0' <= *s && *s <= '9') 374: 77 1f ja 395 <atoi+0x35> 376: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 37d: 8d 76 00 lea 0x0(%esi),%esi n = n*10 + *s++ - '0'; 380: 83 c1 01 add $0x1,%ecx 383: 8d 04 80 lea (%eax,%eax,4),%eax 386: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax while('0' <= *s && *s <= '9') 38a: 0f be 11 movsbl (%ecx),%edx 38d: 8d 5a d0 lea -0x30(%edx),%ebx 390: 80 fb 09 cmp $0x9,%bl 393: 76 eb jbe 380 <atoi+0x20> return n; } 395: 5b pop %ebx 396: 5d pop %ebp 397: c3 ret 398: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 39f: 90 nop 000003a0 <memmove>: void* memmove(void *vdst, const void *vsrc, int n) { 3a0: 55 push %ebp 3a1: 89 e5 mov %esp,%ebp 3a3: 57 push %edi 3a4: 8b 55 10 mov 0x10(%ebp),%edx 3a7: 8b 45 08 mov 0x8(%ebp),%eax 3aa: 56 push %esi 3ab: 8b 75 0c mov 0xc(%ebp),%esi char *dst; const char *src; dst = vdst; src = vsrc; while(n-- > 0) 3ae: 85 d2 test %edx,%edx 3b0: 7e 13 jle 3c5 <memmove+0x25> 3b2: 01 c2 add %eax,%edx dst = vdst; 3b4: 89 c7 mov %eax,%edi 3b6: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 3bd: 8d 76 00 lea 0x0(%esi),%esi *dst++ = *src++; 3c0: a4 movsb %ds:(%esi),%es:(%edi) while(n-- > 0) 3c1: 39 fa cmp %edi,%edx 3c3: 75 fb jne 3c0 <memmove+0x20> return vdst; } 3c5: 5e pop %esi 3c6: 5f pop %edi 3c7: 5d pop %ebp 3c8: c3 ret 000003c9 <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 3c9: b8 01 00 00 00 mov $0x1,%eax 3ce: cd 40 int $0x40 3d0: c3 ret 000003d1 <exit>: SYSCALL(exit) 3d1: b8 02 00 00 00 mov $0x2,%eax 3d6: cd 40 int $0x40 3d8: c3 ret 000003d9 <wait>: SYSCALL(wait) 3d9: b8 03 00 00 00 mov $0x3,%eax 3de: cd 40 int $0x40 3e0: c3 ret 000003e1 <pipe>: SYSCALL(pipe) 3e1: b8 04 00 00 00 mov $0x4,%eax 3e6: cd 40 int $0x40 3e8: c3 ret 000003e9 <read>: SYSCALL(read) 3e9: b8 05 00 00 00 mov $0x5,%eax 3ee: cd 40 int $0x40 3f0: c3 ret 000003f1 <write>: SYSCALL(write) 3f1: b8 10 00 00 00 mov $0x10,%eax 3f6: cd 40 int $0x40 3f8: c3 ret 000003f9 <close>: SYSCALL(close) 3f9: b8 15 00 00 00 mov $0x15,%eax 3fe: cd 40 int $0x40 400: c3 ret 00000401 <kill>: SYSCALL(kill) 401: b8 06 00 00 00 mov $0x6,%eax 406: cd 40 int $0x40 408: c3 ret 00000409 <exec>: SYSCALL(exec) 409: b8 07 00 00 00 mov $0x7,%eax 40e: cd 40 int $0x40 410: c3 ret 00000411 <open>: SYSCALL(open) 411: b8 0f 00 00 00 mov $0xf,%eax 416: cd 40 int $0x40 418: c3 ret 00000419 <mknod>: SYSCALL(mknod) 419: b8 11 00 00 00 mov $0x11,%eax 41e: cd 40 int $0x40 420: c3 ret 00000421 <unlink>: SYSCALL(unlink) 421: b8 12 00 00 00 mov $0x12,%eax 426: cd 40 int $0x40 428: c3 ret 00000429 <fstat>: SYSCALL(fstat) 429: b8 08 00 00 00 mov $0x8,%eax 42e: cd 40 int $0x40 430: c3 ret 00000431 <link>: SYSCALL(link) 431: b8 13 00 00 00 mov $0x13,%eax 436: cd 40 int $0x40 438: c3 ret 00000439 <mkdir>: SYSCALL(mkdir) 439: b8 14 00 00 00 mov $0x14,%eax 43e: cd 40 int $0x40 440: c3 ret 00000441 <chdir>: SYSCALL(chdir) 441: b8 09 00 00 00 mov $0x9,%eax 446: cd 40 int $0x40 448: c3 ret 00000449 <dup>: SYSCALL(dup) 449: b8 0a 00 00 00 mov $0xa,%eax 44e: cd 40 int $0x40 450: c3 ret 00000451 <getpid>: SYSCALL(getpid) 451: b8 0b 00 00 00 mov $0xb,%eax 456: cd 40 int $0x40 458: c3 ret 00000459 <sbrk>: SYSCALL(sbrk) 459: b8 0c 00 00 00 mov $0xc,%eax 45e: cd 40 int $0x40 460: c3 ret 00000461 <sleep>: SYSCALL(sleep) 461: b8 0d 00 00 00 mov $0xd,%eax 466: cd 40 int $0x40 468: c3 ret 00000469 <uptime>: SYSCALL(uptime) 469: b8 0e 00 00 00 mov $0xe,%eax 46e: cd 40 int $0x40 470: c3 ret 00000471 <printingMyFavoriteYear>: SYSCALL(printingMyFavoriteYear) 471: b8 16 00 00 00 mov $0x16,%eax 476: cd 40 int $0x40 478: c3 ret 00000479 <getChildren>: SYSCALL(getChildren) 479: b8 17 00 00 00 mov $0x17,%eax 47e: cd 40 int $0x40 480: c3 ret 00000481 <getRunningProcessPID>: SYSCALL(getRunningProcessPID) 481: b8 18 00 00 00 mov $0x18,%eax 486: cd 40 int $0x40 488: c3 ret 00000489 <changePolicy>: SYSCALL(changePolicy) 489: b8 19 00 00 00 mov $0x19,%eax 48e: cd 40 int $0x40 490: c3 ret 00000491 <Quantum_Increaser>: SYSCALL(Quantum_Increaser) 491: b8 1a 00 00 00 mov $0x1a,%eax 496: cd 40 int $0x40 498: c3 ret 00000499 <Quantum_Decreaser>: SYSCALL(Quantum_Decreaser) 499: b8 1b 00 00 00 mov $0x1b,%eax 49e: cd 40 int $0x40 4a0: c3 ret 4a1: 66 90 xchg %ax,%ax 4a3: 66 90 xchg %ax,%ax 4a5: 66 90 xchg %ax,%ax 4a7: 66 90 xchg %ax,%ax 4a9: 66 90 xchg %ax,%ax 4ab: 66 90 xchg %ax,%ax 4ad: 66 90 xchg %ax,%ax 4af: 90 nop 000004b0 <printint>: write(fd, &c, 1); } static void printint(int fd, int xx, int base, int sgn) { 4b0: 55 push %ebp 4b1: 89 e5 mov %esp,%ebp 4b3: 57 push %edi 4b4: 56 push %esi 4b5: 53 push %ebx uint x; neg = 0; if(sgn && xx < 0){ neg = 1; x = -xx; 4b6: 89 d3 mov %edx,%ebx { 4b8: 83 ec 3c sub $0x3c,%esp 4bb: 89 45 bc mov %eax,-0x44(%ebp) if(sgn && xx < 0){ 4be: 85 d2 test %edx,%edx 4c0: 0f 89 92 00 00 00 jns 558 <printint+0xa8> 4c6: f6 45 08 01 testb $0x1,0x8(%ebp) 4ca: 0f 84 88 00 00 00 je 558 <printint+0xa8> neg = 1; 4d0: c7 45 c0 01 00 00 00 movl $0x1,-0x40(%ebp) x = -xx; 4d7: f7 db neg %ebx } else { x = xx; } i = 0; 4d9: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp) 4e0: 8d 75 d7 lea -0x29(%ebp),%esi 4e3: eb 08 jmp 4ed <printint+0x3d> 4e5: 8d 76 00 lea 0x0(%esi),%esi do{ buf[i++] = digits[x % base]; 4e8: 89 7d c4 mov %edi,-0x3c(%ebp) }while((x /= base) != 0); 4eb: 89 c3 mov %eax,%ebx buf[i++] = digits[x % base]; 4ed: 89 d8 mov %ebx,%eax 4ef: 31 d2 xor %edx,%edx 4f1: 8b 7d c4 mov -0x3c(%ebp),%edi 4f4: f7 f1 div %ecx 4f6: 83 c7 01 add $0x1,%edi 4f9: 0f b6 92 18 09 00 00 movzbl 0x918(%edx),%edx 500: 88 14 3e mov %dl,(%esi,%edi,1) }while((x /= base) != 0); 503: 39 d9 cmp %ebx,%ecx 505: 76 e1 jbe 4e8 <printint+0x38> if(neg) 507: 8b 45 c0 mov -0x40(%ebp),%eax 50a: 85 c0 test %eax,%eax 50c: 74 0d je 51b <printint+0x6b> buf[i++] = '-'; 50e: c6 44 3d d8 2d movb $0x2d,-0x28(%ebp,%edi,1) 513: ba 2d 00 00 00 mov $0x2d,%edx buf[i++] = digits[x % base]; 518: 89 7d c4 mov %edi,-0x3c(%ebp) 51b: 8b 45 c4 mov -0x3c(%ebp),%eax 51e: 8b 7d bc mov -0x44(%ebp),%edi 521: 8d 5c 05 d7 lea -0x29(%ebp,%eax,1),%ebx 525: eb 0f jmp 536 <printint+0x86> 527: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 52e: 66 90 xchg %ax,%ax 530: 0f b6 13 movzbl (%ebx),%edx 533: 83 eb 01 sub $0x1,%ebx write(fd, &c, 1); 536: 83 ec 04 sub $0x4,%esp 539: 88 55 d7 mov %dl,-0x29(%ebp) 53c: 6a 01 push $0x1 53e: 56 push %esi 53f: 57 push %edi 540: e8 ac fe ff ff call 3f1 <write> while(--i >= 0) 545: 83 c4 10 add $0x10,%esp 548: 39 de cmp %ebx,%esi 54a: 75 e4 jne 530 <printint+0x80> putc(fd, buf[i]); } 54c: 8d 65 f4 lea -0xc(%ebp),%esp 54f: 5b pop %ebx 550: 5e pop %esi 551: 5f pop %edi 552: 5d pop %ebp 553: c3 ret 554: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi neg = 0; 558: c7 45 c0 00 00 00 00 movl $0x0,-0x40(%ebp) 55f: e9 75 ff ff ff jmp 4d9 <printint+0x29> 564: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 56b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 56f: 90 nop 00000570 <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, const char *fmt, ...) { 570: 55 push %ebp 571: 89 e5 mov %esp,%ebp 573: 57 push %edi 574: 56 push %esi 575: 53 push %ebx 576: 83 ec 2c sub $0x2c,%esp int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 579: 8b 75 0c mov 0xc(%ebp),%esi 57c: 0f b6 1e movzbl (%esi),%ebx 57f: 84 db test %bl,%bl 581: 0f 84 b9 00 00 00 je 640 <printf+0xd0> ap = (uint*)(void*)&fmt + 1; 587: 8d 45 10 lea 0x10(%ebp),%eax 58a: 83 c6 01 add $0x1,%esi write(fd, &c, 1); 58d: 8d 7d e7 lea -0x19(%ebp),%edi state = 0; 590: 31 d2 xor %edx,%edx ap = (uint*)(void*)&fmt + 1; 592: 89 45 d0 mov %eax,-0x30(%ebp) 595: eb 38 jmp 5cf <printf+0x5f> 597: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 59e: 66 90 xchg %ax,%ax 5a0: 89 55 d4 mov %edx,-0x2c(%ebp) c = fmt[i] & 0xff; if(state == 0){ if(c == '%'){ state = '%'; 5a3: ba 25 00 00 00 mov $0x25,%edx if(c == '%'){ 5a8: 83 f8 25 cmp $0x25,%eax 5ab: 74 17 je 5c4 <printf+0x54> write(fd, &c, 1); 5ad: 83 ec 04 sub $0x4,%esp 5b0: 88 5d e7 mov %bl,-0x19(%ebp) 5b3: 6a 01 push $0x1 5b5: 57 push %edi 5b6: ff 75 08 pushl 0x8(%ebp) 5b9: e8 33 fe ff ff call 3f1 <write> 5be: 8b 55 d4 mov -0x2c(%ebp),%edx } else { putc(fd, c); 5c1: 83 c4 10 add $0x10,%esp 5c4: 83 c6 01 add $0x1,%esi for(i = 0; fmt[i]; i++){ 5c7: 0f b6 5e ff movzbl -0x1(%esi),%ebx 5cb: 84 db test %bl,%bl 5cd: 74 71 je 640 <printf+0xd0> c = fmt[i] & 0xff; 5cf: 0f be cb movsbl %bl,%ecx 5d2: 0f b6 c3 movzbl %bl,%eax if(state == 0){ 5d5: 85 d2 test %edx,%edx 5d7: 74 c7 je 5a0 <printf+0x30> } } else if(state == '%'){ 5d9: 83 fa 25 cmp $0x25,%edx 5dc: 75 e6 jne 5c4 <printf+0x54> if(c == 'd'){ 5de: 83 f8 64 cmp $0x64,%eax 5e1: 0f 84 99 00 00 00 je 680 <printf+0x110> printint(fd, *ap, 10, 1); ap++; } else if(c == 'x' || c == 'p'){ 5e7: 81 e1 f7 00 00 00 and $0xf7,%ecx 5ed: 83 f9 70 cmp $0x70,%ecx 5f0: 74 5e je 650 <printf+0xe0> printint(fd, *ap, 16, 0); ap++; } else if(c == 's'){ 5f2: 83 f8 73 cmp $0x73,%eax 5f5: 0f 84 d5 00 00 00 je 6d0 <printf+0x160> s = "(null)"; while(*s != 0){ putc(fd, *s); s++; } } else if(c == 'c'){ 5fb: 83 f8 63 cmp $0x63,%eax 5fe: 0f 84 8c 00 00 00 je 690 <printf+0x120> putc(fd, *ap); ap++; } else if(c == '%'){ 604: 83 f8 25 cmp $0x25,%eax 607: 0f 84 b3 00 00 00 je 6c0 <printf+0x150> write(fd, &c, 1); 60d: 83 ec 04 sub $0x4,%esp 610: c6 45 e7 25 movb $0x25,-0x19(%ebp) 614: 6a 01 push $0x1 616: 57 push %edi 617: ff 75 08 pushl 0x8(%ebp) 61a: e8 d2 fd ff ff call 3f1 <write> putc(fd, c); } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); putc(fd, c); 61f: 88 5d e7 mov %bl,-0x19(%ebp) write(fd, &c, 1); 622: 83 c4 0c add $0xc,%esp 625: 6a 01 push $0x1 627: 83 c6 01 add $0x1,%esi 62a: 57 push %edi 62b: ff 75 08 pushl 0x8(%ebp) 62e: e8 be fd ff ff call 3f1 <write> for(i = 0; fmt[i]; i++){ 633: 0f b6 5e ff movzbl -0x1(%esi),%ebx putc(fd, c); 637: 83 c4 10 add $0x10,%esp } state = 0; 63a: 31 d2 xor %edx,%edx for(i = 0; fmt[i]; i++){ 63c: 84 db test %bl,%bl 63e: 75 8f jne 5cf <printf+0x5f> } } } 640: 8d 65 f4 lea -0xc(%ebp),%esp 643: 5b pop %ebx 644: 5e pop %esi 645: 5f pop %edi 646: 5d pop %ebp 647: c3 ret 648: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 64f: 90 nop printint(fd, *ap, 16, 0); 650: 83 ec 0c sub $0xc,%esp 653: b9 10 00 00 00 mov $0x10,%ecx 658: 6a 00 push $0x0 65a: 8b 5d d0 mov -0x30(%ebp),%ebx 65d: 8b 45 08 mov 0x8(%ebp),%eax 660: 8b 13 mov (%ebx),%edx 662: e8 49 fe ff ff call 4b0 <printint> ap++; 667: 89 d8 mov %ebx,%eax 669: 83 c4 10 add $0x10,%esp state = 0; 66c: 31 d2 xor %edx,%edx ap++; 66e: 83 c0 04 add $0x4,%eax 671: 89 45 d0 mov %eax,-0x30(%ebp) 674: e9 4b ff ff ff jmp 5c4 <printf+0x54> 679: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi printint(fd, *ap, 10, 1); 680: 83 ec 0c sub $0xc,%esp 683: b9 0a 00 00 00 mov $0xa,%ecx 688: 6a 01 push $0x1 68a: eb ce jmp 65a <printf+0xea> 68c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi putc(fd, *ap); 690: 8b 5d d0 mov -0x30(%ebp),%ebx write(fd, &c, 1); 693: 83 ec 04 sub $0x4,%esp putc(fd, *ap); 696: 8b 03 mov (%ebx),%eax write(fd, &c, 1); 698: 6a 01 push $0x1 ap++; 69a: 83 c3 04 add $0x4,%ebx write(fd, &c, 1); 69d: 57 push %edi 69e: ff 75 08 pushl 0x8(%ebp) putc(fd, *ap); 6a1: 88 45 e7 mov %al,-0x19(%ebp) write(fd, &c, 1); 6a4: e8 48 fd ff ff call 3f1 <write> ap++; 6a9: 89 5d d0 mov %ebx,-0x30(%ebp) 6ac: 83 c4 10 add $0x10,%esp state = 0; 6af: 31 d2 xor %edx,%edx 6b1: e9 0e ff ff ff jmp 5c4 <printf+0x54> 6b6: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 6bd: 8d 76 00 lea 0x0(%esi),%esi putc(fd, c); 6c0: 88 5d e7 mov %bl,-0x19(%ebp) write(fd, &c, 1); 6c3: 83 ec 04 sub $0x4,%esp 6c6: e9 5a ff ff ff jmp 625 <printf+0xb5> 6cb: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 6cf: 90 nop s = (char*)*ap; 6d0: 8b 45 d0 mov -0x30(%ebp),%eax 6d3: 8b 18 mov (%eax),%ebx ap++; 6d5: 83 c0 04 add $0x4,%eax 6d8: 89 45 d0 mov %eax,-0x30(%ebp) if(s == 0) 6db: 85 db test %ebx,%ebx 6dd: 74 17 je 6f6 <printf+0x186> while(*s != 0){ 6df: 0f b6 03 movzbl (%ebx),%eax state = 0; 6e2: 31 d2 xor %edx,%edx while(*s != 0){ 6e4: 84 c0 test %al,%al 6e6: 0f 84 d8 fe ff ff je 5c4 <printf+0x54> 6ec: 89 75 d4 mov %esi,-0x2c(%ebp) 6ef: 89 de mov %ebx,%esi 6f1: 8b 5d 08 mov 0x8(%ebp),%ebx 6f4: eb 1a jmp 710 <printf+0x1a0> s = "(null)"; 6f6: bb 0f 09 00 00 mov $0x90f,%ebx while(*s != 0){ 6fb: 89 75 d4 mov %esi,-0x2c(%ebp) 6fe: b8 28 00 00 00 mov $0x28,%eax 703: 89 de mov %ebx,%esi 705: 8b 5d 08 mov 0x8(%ebp),%ebx 708: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 70f: 90 nop write(fd, &c, 1); 710: 83 ec 04 sub $0x4,%esp s++; 713: 83 c6 01 add $0x1,%esi 716: 88 45 e7 mov %al,-0x19(%ebp) write(fd, &c, 1); 719: 6a 01 push $0x1 71b: 57 push %edi 71c: 53 push %ebx 71d: e8 cf fc ff ff call 3f1 <write> while(*s != 0){ 722: 0f b6 06 movzbl (%esi),%eax 725: 83 c4 10 add $0x10,%esp 728: 84 c0 test %al,%al 72a: 75 e4 jne 710 <printf+0x1a0> 72c: 8b 75 d4 mov -0x2c(%ebp),%esi state = 0; 72f: 31 d2 xor %edx,%edx 731: e9 8e fe ff ff jmp 5c4 <printf+0x54> 736: 66 90 xchg %ax,%ax 738: 66 90 xchg %ax,%ax 73a: 66 90 xchg %ax,%ax 73c: 66 90 xchg %ax,%ax 73e: 66 90 xchg %ax,%ax 00000740 <free>: static Header base; static Header *freep; void free(void *ap) { 740: 55 push %ebp Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 741: a1 00 0c 00 00 mov 0xc00,%eax { 746: 89 e5 mov %esp,%ebp 748: 57 push %edi 749: 56 push %esi 74a: 53 push %ebx 74b: 8b 5d 08 mov 0x8(%ebp),%ebx 74e: 8b 10 mov (%eax),%edx bp = (Header*)ap - 1; 750: 8d 4b f8 lea -0x8(%ebx),%ecx for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 753: 39 c8 cmp %ecx,%eax 755: 73 19 jae 770 <free+0x30> 757: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 75e: 66 90 xchg %ax,%ax 760: 39 d1 cmp %edx,%ecx 762: 72 14 jb 778 <free+0x38> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 764: 39 d0 cmp %edx,%eax 766: 73 10 jae 778 <free+0x38> { 768: 89 d0 mov %edx,%eax 76a: 8b 10 mov (%eax),%edx for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 76c: 39 c8 cmp %ecx,%eax 76e: 72 f0 jb 760 <free+0x20> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 770: 39 d0 cmp %edx,%eax 772: 72 f4 jb 768 <free+0x28> 774: 39 d1 cmp %edx,%ecx 776: 73 f0 jae 768 <free+0x28> break; if(bp + bp->s.size == p->s.ptr){ 778: 8b 73 fc mov -0x4(%ebx),%esi 77b: 8d 3c f1 lea (%ecx,%esi,8),%edi 77e: 39 fa cmp %edi,%edx 780: 74 1e je 7a0 <free+0x60> bp->s.size += p->s.ptr->s.size; bp->s.ptr = p->s.ptr->s.ptr; } else bp->s.ptr = p->s.ptr; 782: 89 53 f8 mov %edx,-0x8(%ebx) if(p + p->s.size == bp){ 785: 8b 50 04 mov 0x4(%eax),%edx 788: 8d 34 d0 lea (%eax,%edx,8),%esi 78b: 39 f1 cmp %esi,%ecx 78d: 74 28 je 7b7 <free+0x77> p->s.size += bp->s.size; p->s.ptr = bp->s.ptr; } else p->s.ptr = bp; 78f: 89 08 mov %ecx,(%eax) freep = p; } 791: 5b pop %ebx freep = p; 792: a3 00 0c 00 00 mov %eax,0xc00 } 797: 5e pop %esi 798: 5f pop %edi 799: 5d pop %ebp 79a: c3 ret 79b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 79f: 90 nop bp->s.size += p->s.ptr->s.size; 7a0: 03 72 04 add 0x4(%edx),%esi 7a3: 89 73 fc mov %esi,-0x4(%ebx) bp->s.ptr = p->s.ptr->s.ptr; 7a6: 8b 10 mov (%eax),%edx 7a8: 8b 12 mov (%edx),%edx 7aa: 89 53 f8 mov %edx,-0x8(%ebx) if(p + p->s.size == bp){ 7ad: 8b 50 04 mov 0x4(%eax),%edx 7b0: 8d 34 d0 lea (%eax,%edx,8),%esi 7b3: 39 f1 cmp %esi,%ecx 7b5: 75 d8 jne 78f <free+0x4f> p->s.size += bp->s.size; 7b7: 03 53 fc add -0x4(%ebx),%edx freep = p; 7ba: a3 00 0c 00 00 mov %eax,0xc00 p->s.size += bp->s.size; 7bf: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 7c2: 8b 53 f8 mov -0x8(%ebx),%edx 7c5: 89 10 mov %edx,(%eax) } 7c7: 5b pop %ebx 7c8: 5e pop %esi 7c9: 5f pop %edi 7ca: 5d pop %ebp 7cb: c3 ret 7cc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 000007d0 <malloc>: return freep; } void* malloc(uint nbytes) { 7d0: 55 push %ebp 7d1: 89 e5 mov %esp,%ebp 7d3: 57 push %edi 7d4: 56 push %esi 7d5: 53 push %ebx 7d6: 83 ec 1c sub $0x1c,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 7d9: 8b 45 08 mov 0x8(%ebp),%eax if((prevp = freep) == 0){ 7dc: 8b 3d 00 0c 00 00 mov 0xc00,%edi nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 7e2: 8d 70 07 lea 0x7(%eax),%esi 7e5: c1 ee 03 shr $0x3,%esi 7e8: 83 c6 01 add $0x1,%esi if((prevp = freep) == 0){ 7eb: 85 ff test %edi,%edi 7ed: 0f 84 ad 00 00 00 je 8a0 <malloc+0xd0> base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 7f3: 8b 17 mov (%edi),%edx if(p->s.size >= nunits){ 7f5: 8b 4a 04 mov 0x4(%edx),%ecx 7f8: 39 f1 cmp %esi,%ecx 7fa: 73 72 jae 86e <malloc+0x9e> 7fc: 81 fe 00 10 00 00 cmp $0x1000,%esi 802: bb 00 10 00 00 mov $0x1000,%ebx 807: 0f 43 de cmovae %esi,%ebx p = sbrk(nu * sizeof(Header)); 80a: 8d 04 dd 00 00 00 00 lea 0x0(,%ebx,8),%eax 811: 89 45 e4 mov %eax,-0x1c(%ebp) 814: eb 1b jmp 831 <malloc+0x61> 816: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 81d: 8d 76 00 lea 0x0(%esi),%esi for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 820: 8b 02 mov (%edx),%eax if(p->s.size >= nunits){ 822: 8b 48 04 mov 0x4(%eax),%ecx 825: 39 f1 cmp %esi,%ecx 827: 73 4f jae 878 <malloc+0xa8> 829: 8b 3d 00 0c 00 00 mov 0xc00,%edi 82f: 89 c2 mov %eax,%edx p->s.size = nunits; } freep = prevp; return (void*)(p + 1); } if(p == freep) 831: 39 d7 cmp %edx,%edi 833: 75 eb jne 820 <malloc+0x50> p = sbrk(nu * sizeof(Header)); 835: 83 ec 0c sub $0xc,%esp 838: ff 75 e4 pushl -0x1c(%ebp) 83b: e8 19 fc ff ff call 459 <sbrk> if(p == (char*)-1) 840: 83 c4 10 add $0x10,%esp 843: 83 f8 ff cmp $0xffffffff,%eax 846: 74 1c je 864 <malloc+0x94> hp->s.size = nu; 848: 89 58 04 mov %ebx,0x4(%eax) free((void*)(hp + 1)); 84b: 83 ec 0c sub $0xc,%esp 84e: 83 c0 08 add $0x8,%eax 851: 50 push %eax 852: e8 e9 fe ff ff call 740 <free> return freep; 857: 8b 15 00 0c 00 00 mov 0xc00,%edx if((p = morecore(nunits)) == 0) 85d: 83 c4 10 add $0x10,%esp 860: 85 d2 test %edx,%edx 862: 75 bc jne 820 <malloc+0x50> return 0; } } 864: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 867: 31 c0 xor %eax,%eax } 869: 5b pop %ebx 86a: 5e pop %esi 86b: 5f pop %edi 86c: 5d pop %ebp 86d: c3 ret if(p->s.size >= nunits){ 86e: 89 d0 mov %edx,%eax 870: 89 fa mov %edi,%edx 872: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(p->s.size == nunits) 878: 39 ce cmp %ecx,%esi 87a: 74 54 je 8d0 <malloc+0x100> p->s.size -= nunits; 87c: 29 f1 sub %esi,%ecx 87e: 89 48 04 mov %ecx,0x4(%eax) p += p->s.size; 881: 8d 04 c8 lea (%eax,%ecx,8),%eax p->s.size = nunits; 884: 89 70 04 mov %esi,0x4(%eax) freep = prevp; 887: 89 15 00 0c 00 00 mov %edx,0xc00 } 88d: 8d 65 f4 lea -0xc(%ebp),%esp return (void*)(p + 1); 890: 83 c0 08 add $0x8,%eax } 893: 5b pop %ebx 894: 5e pop %esi 895: 5f pop %edi 896: 5d pop %ebp 897: c3 ret 898: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 89f: 90 nop base.s.ptr = freep = prevp = &base; 8a0: c7 05 00 0c 00 00 04 movl $0xc04,0xc00 8a7: 0c 00 00 base.s.size = 0; 8aa: bf 04 0c 00 00 mov $0xc04,%edi base.s.ptr = freep = prevp = &base; 8af: c7 05 04 0c 00 00 04 movl $0xc04,0xc04 8b6: 0c 00 00 for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 8b9: 89 fa mov %edi,%edx base.s.size = 0; 8bb: c7 05 08 0c 00 00 00 movl $0x0,0xc08 8c2: 00 00 00 if(p->s.size >= nunits){ 8c5: e9 32 ff ff ff jmp 7fc <malloc+0x2c> 8ca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi prevp->s.ptr = p->s.ptr; 8d0: 8b 08 mov (%eax),%ecx 8d2: 89 0a mov %ecx,(%edx) 8d4: eb b1 jmp 887 <malloc+0xb7>
other.7z/SFC.7z/SFC/ソースデータ/MarioKart/ISPK-7E.asm
prismotizm/gigaleak
0
2480
<reponame>prismotizm/gigaleak Name: ISPK-7E.asm Type: file Size: 7432 Last-Modified: '1992-07-01T15:00:00Z' SHA-1: 791BE768C7EA7755BF11EA76D0C0628D622FDCA2 Description: null
src/GBA.Display.Tiles.adb
98devin/ada-gba-dev
7
8551
-- Copyright (c) 2021 <NAME> -- zlib License -- see LICENSE for details. with System; use type System.Address; package body GBA.Display.Tiles is function Tile_Block_Address (Ix : Tile_Block_Index) return Address is begin return Video_RAM_Address'First + (Address (Ix) * 16#4000#); end; function Screen_Block_Address (Ix : Screen_Block_Index) return Address is begin return Video_RAM_Address'First + (Address (Ix) * 16#800#); end; end GBA.Display.Tiles;
sk/sfx/B7.asm
Cancer52/flamedriver
9
174913
Sound_B7_Header: smpsHeaderStartSong 3, 1 smpsHeaderVoice Sound_B7_Voices smpsHeaderTempoSFX $01 smpsHeaderChanSFX $02 smpsHeaderSFXChannel cFM4, Sound_B7_FM4, $00, $02 smpsHeaderSFXChannel cFM5, Sound_B7_FM5, $00, $02 ; FM4 Data Sound_B7_FM4: smpsAlterNote $03 dc.b nRst, $02 ; FM5 Data Sound_B7_FM5: smpsSetvoice $00 dc.b nG5, $16 smpsStop Sound_B7_Voices: ; Voice $00 ; $14 ; $25, $33, $36, $11, $1F, $1F, $1F, $1F, $15, $18, $1C, $13 ; $0B, $08, $0D, $09, $0F, $9F, $8F, $0F, $24, $05, $0A, $80 smpsVcAlgorithm $04 smpsVcFeedback $02 smpsVcUnusedBits $00 smpsVcDetune $01, $03, $03, $02 smpsVcCoarseFreq $01, $06, $03, $05 smpsVcRateScale $00, $00, $00, $00 smpsVcAttackRate $1F, $1F, $1F, $1F smpsVcAmpMod $00, $00, $00, $00 smpsVcDecayRate1 $13, $1C, $18, $15 smpsVcDecayRate2 $09, $0D, $08, $0B smpsVcDecayLevel $00, $08, $09, $00 smpsVcReleaseRate $0F, $0F, $0F, $0F smpsVcTotalLevel $80, $0A, $05, $24
Transynther/x86/_processed/NONE/_ht_zr_/i9-9900K_12_0xca.log_21829_1800.asm
ljhsiun2/medusa
9
162012
<reponame>ljhsiun2/medusa .global s_prepare_buffers s_prepare_buffers: push %r14 push %r8 push %r9 push %rbp push %rcx push %rdi push %rsi lea addresses_normal_ht+0xf5d0, %rsi lea addresses_UC_ht+0x1bcc7, %rdi nop nop add $50821, %r9 mov $52, %rcx rep movsw nop and %r8, %r8 lea addresses_UC_ht+0xe904, %rbp nop nop nop nop add %rsi, %rsi movb $0x61, (%rbp) nop xor %r8, %r8 lea addresses_WC_ht+0x3f7, %rsi lea addresses_WC_ht+0x1e7e7, %rdi nop sub $15966, %r14 mov $104, %rcx rep movsb add $63163, %rcx lea addresses_WT_ht+0x76b, %rsi sub %rdi, %rdi mov $0x6162636465666768, %r9 movq %r9, (%rsi) nop nop sub $65391, %rsi pop %rsi pop %rdi pop %rcx pop %rbp pop %r9 pop %r8 pop %r14 ret .global s_faulty_load s_faulty_load: push %r13 push %r14 push %r9 push %rbp push %rbx push %rdi push %rdx // Store lea addresses_D+0x1b584, %rdx nop nop nop nop dec %rbp mov $0x5152535455565758, %r9 movq %r9, %xmm4 vmovups %ymm4, (%rdx) inc %r9 // Load lea addresses_RW+0x102c7, %rbp nop nop cmp $65231, %rbx movb (%rbp), %r9b nop nop sub %r14, %r14 // Store lea addresses_WC+0x30c7, %rdi nop xor $46386, %rdx movb $0x51, (%rdi) nop and $63501, %rbp // Store lea addresses_WT+0x1e4c7, %rdx nop and $55588, %r9 movl $0x51525354, (%rdx) nop nop nop nop sub $22255, %rdi // Store lea addresses_WT+0x9013, %rbx nop nop nop add $4732, %r14 movw $0x5152, (%rbx) nop xor $44738, %r13 // Faulty Load lea addresses_WC+0x30c7, %rbp nop xor %rdi, %rdi vmovups (%rbp), %ymm6 vextracti128 $1, %ymm6, %xmm6 vpextrq $1, %xmm6, %r13 lea oracles, %rdx and $0xff, %r13 shlq $12, %r13 mov (%rdx,%r13,1), %r13 pop %rdx pop %rdi pop %rbx pop %rbp pop %r9 pop %r14 pop %r13 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'size': 8, 'NT': True, 'type': 'addresses_WC', 'same': False, 'AVXalign': False, 'congruent': 0}} {'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_D', 'same': False, 'AVXalign': False, 'congruent': 0}} {'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_RW', 'same': False, 'AVXalign': False, 'congruent': 9}} {'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_WC', 'same': True, 'AVXalign': False, 'congruent': 0}} {'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_WT', 'same': False, 'AVXalign': True, 'congruent': 10}} {'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_WT', 'same': False, 'AVXalign': False, 'congruent': 2}} [Faulty Load] {'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_WC', 'same': True, 'AVXalign': False, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 0}, 'dst': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 8}} {'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 0}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 3}, 'dst': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 5}} {'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 2}} {'44': 2, '00': 21827} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
dv3/atari/dmastat.asm
olifink/smsqe
0
80400
<reponame>olifink/smsqe<filename>dv3/atari/dmastat.asm<gh_stars>0 ; Check Status of Atari DMA  1990 <NAME> QJUMP section adma xdef at_stat xdef at_stata xref at_wait80 include 'dev8_keys_atari' include 'dev8_keys_err' ;+++ ; This routine waits for interrupt at end of operation and checks the DMA ; address for completion ; ; a1 c p end DMA address ; a3 c p pointer to linkage block ; ; status return 0, 1 (no interrupt) or ERR.NC (dma not complete) ; ;--- at_stata bsr.s at_stat ; wait for completion bne.s ats_rts move.b dma_high,d0 ; get address swap d0 move.b dma_mid,d0 lsl.w #8,d0 move.b dma_low,d0 cmp.l a1,d0 ; correct address? beq.s ats_ok moveq #err.nc,d0 ; not complete ats_rts rts ;+++ ; This routine waits for interrupt at end of operation. ; ; a3 c p pointer to linkage block ; ; status return standard 0 or 1 ; ;--- at_stat move.w #1000,d0 ; wait 1000*20 == 20secs ats_stttim swap d0 move.b #239,d0 ; wait 240*83 == 20ms jsr at_wait80 ats_sttw btst #mfp..hdi,mfp_hdpi ; wait for interrupt bne.s ats_ok btst #mfp..tai,mfp_tapi ; or timeout beq.s ats_sttw swap d0 dbra d0,ats_stttim moveq #1,d0 rts ats_ok move.b #mfp.hdpc,mfp_hdpi ; interrupt not pending now moveq #0,d0 rts end $$$$$$$$$$$$$$$$$$$$$$$ ats_sttw btst #mfp..dmi,mfp_dmi ; for interrupt beq.s ats_ok btst #mfp..tai,mfp_tapi ; or timeout beq.s ats_sttw swap d0 dbra d0,ats_stttim ; and again moveq #1,d0 ats_rts rts ats_ok moveq #0,d0 rts end
block-3/pp/block3/cc/tabular/tabular.g4
tcoenraad/compiler-construction
1
931
grammar Tabular; @header{package pp.block3.cc.tabular;} table : '\\begin{tabular}{' TABLE_OPTIONS? '}' row* '\\end{tabular}'; row : (cell '&')* cell '\\\\'; cell : TEXT?; TABLE_OPTIONS : ['lcr']+; COMMENT : '%' ~('\n')* '\n' -> skip; TEXT : (~[' \t\n\r\\{}$&#ˆ_̃%']+ ~['\\{}$&#ˆ_̃%']+ ~[' \t\n\r\\{}$&#ˆ_̃%']+) | ~[' \t\n\r\\{}$&#ˆ_̃%']+; // special chars in LaTeX: \{}$&#ˆ_̃% // alternative 1 // not WHITESPACE and NOT A SPECIAL CHAR for 1 or more times, // then NOT A SPECIAL CHAR for 1 or more times, // then NOT WHITESPACE and NOT A SPECIAL CHAR for 1 or more times // alternative 2 // NOT WHITESPACE AND NOT SPECIAL CHAR for 1 or more times WS : [ \t\n\r]+ -> skip;
Library/Ruler/rulerUtils.asm
steakknife/pcgeos
504
93920
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) GeoWorks 1991 -- All Rights Reserved PROJECT: PC GEOS MODULE: GeoCalc FILE: rulerUtils.asm AUTHOR: <NAME>, Jun 17, 1991 ROUTINES: Name Description ---- ----------- GetRulerTable Get ptr to RulerScale entry to use SetMinTick Set minimum tick size ScaleRulerToDraw Scale ruler point to draw point CreateGState create a GState DestroyGState destroy a GState REVISION HISTORY: Name Date Description ---- ---- ----------- Gene 6/17/91 Initial revision DESCRIPTION: $Id: rulerUtils.asm,v 1.1 97/04/07 10:42:53 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ RulerBasicCode segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RulerScaleDocToWinCoords %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Scale a ruler point in document coords to window coordinates CALLED BY: UTILITY PASS: *ds:si - VisRuler object dx:cx.ax - point to scale (DWFixed) RETURN: dx:cx.ax - scaled point (DWFixed) DESTROYED: none PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- eca 7/ 1/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ RulerScaleDocToWinCoords proc far uses si class VisRulerClass .enter mov si, ds:[si] add si, ds:[si].VisRuler_offset ;ds:si <- ptr to instance data ; ; See if any scaling in necessary. ; tst ds:[si].VRI_scale.WWF_frac jnz doScale ;branch if fraction cmp ds:[si].VRI_scale.WWF_int, 1 je done ;branch if (scale == 1.0) doScale: push bx, di mov di, dx mov dx, cx mov_tr cx, ax ;didx.cx = multiplier movdw bxax, ds:[si].VRI_scale clr si ;sibx.ax = multiplicand call GrMulDWFixed ;dxcx.bx = result mov_tr ax, bx ;dxcx.ax = result pop bx, di done: .leave ret RulerScaleDocToWinCoords endp COMMENT @---------------------------------------------------------------------- FUNCTION: RulerTransformDocToWin DESCRIPTION: Transform a position in document coordinates to a position in window coordinates CALLED BY: INTERNAL PASS: *ds:si - ruler object dxcx.ax - position RETURN: dxcx.ax - position DESTROYED: none REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 5/21/92 Initial version ------------------------------------------------------------------------------@ RulerTransformDocToWin proc far uses di class VisRulerClass .enter mov di, ds:[si] add di, ds:[di].Vis_offset test ds:[di].VRI_rulerAttrs, mask VRA_IGNORE_ORIGIN jnz 10$ adddwf dxcxax, ds:[di].VRI_origin 10$: call RulerScaleDocToWinCoords .leave ret RulerTransformDocToWin endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RulerScaleWinToDocCoords %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Scale a ruler point in window coords to document coordinates CALLED BY: UTILITY PASS: *ds:si - VisRuler object dx:cx.ax - point to scale (DWFixed) RETURN: dx:cx.ax - scaled point (DWFixed) DESTROYED: none PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- eca 7/ 1/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ RulerScaleWinToDocCoords proc far uses bx, si, bp class VisRulerClass .enter mov_tr bp, ax ;bp <- frac mov si, ds:[si] add si, ds:[si].VisRuler_offset ;ds:si <- ptr to instance data movdw bxax, ds:[si].VRI_scale cmpdw bxax, 0x00010000 jz done call GrSDivDWFbyWWF done: mov_tr ax, bp .leave ret RulerScaleWinToDocCoords endp COMMENT @---------------------------------------------------------------------- FUNCTION: RulerTransformWinToDoc DESCRIPTION: Transform a position in window coordinates to a position in document coordinates CALLED BY: INTERNAL PASS: *ds:si - ruler object dxcx.ax - position RETURN: dxcx.ax - position DESTROYED: none REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 5/21/92 Initial version ------------------------------------------------------------------------------@ if 0 RulerTransformWinToDoc proc far uses di class VisRulerClass .enter call RulerScaleWinToDocCoords mov di, ds:[si] add di, ds:[di].Vis_offset test ds:[di].VRI_rulerAttrs, mask VRA_IGNORE_ORIGIN jnz 10$ subdwf dxcxax, ds:[di].VRI_origin 10$: .leave ret RulerTransformWinToDoc endp endif COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GetRulerTable %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Get pointer to RulerScale entry to use CALLED BY: RulerSetupCommon() PASS: *ds:si - VisRuler object RETURN: cs:bx - ptr to RulerScale entry to use DESTROYED: none PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- eca 7/ 1/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GetRulerTable proc near uses si class VisRulerClass .enter mov si, ds:[si] add si, ds:[si].VisRuler_offset ;ds:si <- ptr to instance data push ax mov bl, ds:[si].VRI_type ;bl <- VisRulerType cmp bl, VRT_DEFAULT jnz gotType call LocalGetMeasurementType mov bl, VRT_INCHES cmp al, MEASURE_US jz gotType mov bl, VRT_CENTIMETERS gotType: pop ax clr bh shl bx, 1 mov bx, cs:rulerTables[bx] .leave ret GetRulerTable endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SetMinTick %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Set minimum tick size based on ruler type and scale factor CALLED BY: RulerSetupCommon() PASS: cs:bx - ptr to RulerScale structure *ds:si - VisRuler object RETURN: dl - minimum tick size ax - minimum label increment DESTROYED: dh PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- eca 6/18/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SetMinTick proc near uses bx, cx, di, si class VisRulerClass .enter mov si, ds:[si] add si, ds:[si].VisRuler_offset ;ds:si <- ptr to instance data mov dl, ds:[si].VRI_minIncrement ;dl <- suggested minimum tick lea di, cs:[bx].RS_minTicks ;cs:di <- ptr to TickScale table push cs:[bx].RS_intervalValue mov cx, NUM_MIN_TICKS ;cx <- # of TickScale entries mov bx, ds:[si].VRI_scale.WWF_frac mov ax, ds:[si].VRI_scale.WWF_int ;ax.bx <- scale factor pop si ;si <- default interval value tickLoop: ; ; See if this entry is relevant based on tick size ; mov dh, cs:[di].TS_incType ;dh <- minimum tick for scale cmp dl, dh ;our tick size larger? ja tickOK ;branch if already larger ; ; See if this entry is relevant based on scale factor ; cmp ax, cs:[di].TS_minScale.WWF_int ja tickOK ;branch if our scale larger jb tickNotOK ;branch if our scale smaller cmp bx, cs:[di].TS_minScale.WWF_frac ja tickOK ;branch if our scale larger tickNotOK: mov dl, dh ;dl <- new minimum mov si, cs:[di].TS_incLabel ;si <- minimum label inc tickOK: add di, (size TickScale) ;cs:di <- ptr to next entry loop tickLoop ;loop while more ticks mov ax, si ;ax <- minimum label increment .leave ret SetMinTick endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CreateGState %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Create a GState associated with our window CALLED BY: UTILITY PASS: *ds:si - VisRuler object RETURN: di - handle of GState DESTROYED: none PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- eca 9/18/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CreateGState proc near uses ax, cx, dx, bp .enter ; ; Query to create a GState ; mov ax, MSG_VIS_VUP_CREATE_GSTATE call ObjCallInstanceNoLock mov di, bp ;di <- handle of GState .leave ret CreateGState endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DestroyGState %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Destroy a GState we created previously CALLED BY: UTILITY PASS: *ds:si - VisRuler object di - handle of GState RETURN: none DESTROYED: none PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- eca 9/18/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ DestroyGState proc near .enter call GrDestroyState .leave ret DestroyGState endp RulerBasicCode ends
aunit/aunit-test_suites.adb
btmalone/alog
0
8832
<gh_stars>0 ------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- A U N I T . T E S T _ S U I T E S -- -- -- -- B o d y -- -- -- -- -- -- Copyright (C) 2000-2011, AdaCore -- -- -- -- 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. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT is maintained by AdaCore (http://www.adacore.com) -- -- -- ------------------------------------------------------------------------------ with Ada.Unchecked_Conversion; with AUnit.Memory.Utils; package body AUnit.Test_Suites is -------------- -- Add_Test -- -------------- procedure Add_Test (S : access Test_Suite'Class; T : access Test_Suite'Class) is begin Append (S.Tests, (Kind => TS_Elt, TS => Access_Test_Suite'(T.all'Unchecked_Access))); end Add_Test; -------------- -- Add_Test -- -------------- procedure Add_Test (S : access Test_Suite'Class; T : access Test_Case'Class) is begin Append (S.Tests, (Kind => TC_Elt, TC => Test_Case_Access'(T.all'Unchecked_Access))); end Add_Test; --------- -- Run -- --------- procedure Run (Suite : access Test_Suite; Options : AUnit_Options; R : in out Result'Class; Outcome : out Status) is C : Cursor := First (Suite.Tests); Result : Status := Success; begin Outcome := Success; while Has_Element (C) loop case Element (C).Kind is when TC_Elt => Run (Element (C).TC, Options, R, Result); when TS_Elt => Run (Element (C).TS, Options, R, Result); end case; if Result = Failure then Outcome := Failure; end if; Next (C); end loop; end Run; --------------- -- New_Suite -- --------------- function New_Suite return Access_Test_Suite is type Access_Type is access all Test_Suite; pragma No_Strict_Aliasing (Access_Type); function Alloc is new AUnit.Memory.Utils.Gen_Alloc (Test_Suite, Access_Type); function Convert is new Ada.Unchecked_Conversion (Access_Type, Access_Test_Suite); Ret : constant Access_Type := Alloc; Obj : Test_Suite; for Obj'Address use Ret.all'Address; pragma Warnings (Off, Obj); begin return Convert (Ret); end New_Suite; end AUnit.Test_Suites;
src/kernel/x86/thread_32.asm
kiznit/kiznix
5
175019
<reponame>kiznit/kiznix<gh_stars>1-10 ; Copyright (c) 2015, <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. ; ; 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. [bits 32] global thread_switch section .text ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; void thread_switch(thread_registers_t** old, thread_registers_t* new); ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; thread_switch: mov eax, [esp + 4] ; eax = old mov edx, [esp + 8] ; edx = new ; Save old context push ebp push edi push esi push ebx ; Switch stacks mov [eax], esp ; *old = esp mov esp, edx ; esp = new ; Restore new context pop ebx pop esi pop edi pop ebp ret
Transynther/x86/_processed/US/_zr_/i7-8650U_0xd2.log_12045_99.asm
ljhsiun2/medusa
9
23574
<filename>Transynther/x86/_processed/US/_zr_/i7-8650U_0xd2.log_12045_99.asm .global s_prepare_buffers s_prepare_buffers: push %r12 push %r9 push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_A_ht+0x72c1, %rsi lea addresses_A_ht+0x2969, %rdi clflush (%rdi) nop nop xor %rbx, %rbx mov $80, %rcx rep movsb nop nop and %r12, %r12 lea addresses_A_ht+0xbec1, %r9 nop and %rdx, %rdx mov $0x6162636465666768, %rdi movq %rdi, (%r9) nop nop nop add $37797, %rdi lea addresses_normal_ht+0x176c1, %rdx nop sub %rbx, %rbx movl $0x61626364, (%rdx) nop nop nop nop nop inc %rdx lea addresses_A_ht+0xa4f3, %rcx nop dec %rbx vmovups (%rcx), %ymm2 vextracti128 $1, %ymm2, %xmm2 vpextrq $0, %xmm2, %rsi xor %rsi, %rsi lea addresses_WT_ht+0x1301, %r12 nop cmp $48347, %rdi movl $0x61626364, (%r12) nop nop inc %rdi pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %r9 pop %r12 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %r14 push %r15 push %r9 push %rbp push %rcx // Store lea addresses_UC+0x241, %r12 cmp $53656, %r15 movb $0x51, (%r12) inc %rbp // Store lea addresses_WC+0xa781, %r13 nop nop add $52569, %rcx mov $0x5152535455565758, %r14 movq %r14, (%r13) add %r12, %r12 // Store lea addresses_UC+0xbc81, %r13 nop add $31519, %r15 movl $0x51525354, (%r13) nop nop add $28412, %rbp // Load lea addresses_PSE+0x1bcc1, %r14 nop nop nop and %r9, %r9 mov (%r14), %ebp nop nop dec %r14 // Faulty Load lea addresses_US+0x18ec1, %rbp nop nop add $44409, %rcx movb (%rbp), %r15b lea oracles, %rbp and $0xff, %r15 shlq $12, %r15 mov (%rbp,%r15,1), %r15 pop %rcx pop %rbp pop %r9 pop %r15 pop %r14 pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'size': 1, 'AVXalign': False, 'NT': True, 'congruent': 4, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}} {'00': 12045} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/g-crc32.adb
djamal2727/Main-Bearing-Analytical-Model
0
21365
<reponame>djamal2727/Main-Bearing-Analytical-Model<gh_stars>0 ------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- G N A T . C R C 3 2 -- -- -- -- B o d y -- -- -- -- Copyright (C) 2001-2020, AdaCore -- -- -- -- 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. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Ada.Unchecked_Conversion; package body GNAT.CRC32 is ------------ -- Update -- ------------ procedure Update (C : in out CRC32; Value : String) is begin for K in Value'Range loop Update (C, Value (K)); end loop; end Update; procedure Update (C : in out CRC32; Value : Ada.Streams.Stream_Element) is function To_Char is new Ada.Unchecked_Conversion (Ada.Streams.Stream_Element, Character); V : constant Character := To_Char (Value); begin Update (C, V); end Update; procedure Update (C : in out CRC32; Value : Ada.Streams.Stream_Element_Array) is begin for K in Value'Range loop Update (C, Value (K)); end loop; end Update; ----------------- -- Wide_Update -- ----------------- procedure Wide_Update (C : in out CRC32; Value : Wide_Character) is subtype S2 is String (1 .. 2); function To_S2 is new Ada.Unchecked_Conversion (Wide_Character, S2); VS : constant S2 := To_S2 (Value); begin Update (C, VS (1)); Update (C, VS (2)); end Wide_Update; procedure Wide_Update (C : in out CRC32; Value : Wide_String) is begin for K in Value'Range loop Wide_Update (C, Value (K)); end loop; end Wide_Update; end GNAT.CRC32;
kernel/arch/i686/interrupts/interrupts.asm
wodOS/wodOS
4
97999
<reponame>wodOS/wodOS ;; ; wodOS Operating System ; Copyright © 2021-2022 wodOS Operating System Developers. All rights reserved. ; ; Use of this source code is governed by a BSD-style license that can be ; found in the LICENSE file. ; ; Contributor(s): ; - <NAME> <<EMAIL>> ;; [extern isr_handler] [extern irq_handler] %macro ISR 1 global isr%1 isr%1: push byte 0 push byte %1 jmp isr_common_stub %endmacro %macro ISR_ERR 1 global isr%1 isr%1: push byte %1 jmp isr_common_stub %endmacro %macro IRQ 2 global irq%1 irq%1: push byte %1 push byte %2 jmp irq_common_stub %endmacro %macro SAVE_CPU_STATE 0 pusha mov ax, ds push eax mov ax, 0x10 mov ds, ax mov es, ax mov fs, ax mov gs, ax %endmacro %macro RESTORE_CPU_STATE 0 pop ebx mov ds, bx mov es, bx mov fs, bx mov gs, bx popa add esp, 8 iret %endmacro ; Common ISR code isr_common_stub: SAVE_CPU_STATE push esp call isr_handler pop eax RESTORE_CPU_STATE irq_common_stub: SAVE_CPU_STATE push esp call irq_handler pop ebx RESTORE_CPU_STATE ISR 0 ; 0: Divide By Zero Exception ISR 1 ; 1: Debug Exception ISR 2 ; 2: Non Maskable Interrupt Exception ISR 3 ; 3: Int 3 Exception ISR 4 ; 4: INTO Exception ISR 5 ; 5: Out of Bounds Exception ISR 6 ; 6: Invalid Opcode Exception ISR 7 ; 7: Coprocessor Not Available Exception ISR_ERR 8 ; 8: Double Fault Exception (With Error Code!) ISR 9 ; 9: Coprocessor Segment Overrun Exception ISR_ERR 10 ; 10: Bad TSS Exception (With Error Code!) ISR_ERR 11 ; 11: Segment Not Present Exception (With Error Code!) ISR_ERR 12 ; 12: Stack Fault Exception (With Error Code!) ISR_ERR 13 ; 13: General Protection Fault Exception (With Error Code!) ISR_ERR 14 ; 14: Page Fault Exception (With Error Code!) ISR 15 ; 15: Reserved Exception ISR 16 ; 16: Floating Point Exception ISR 17 ; 17: Alignment Check Exception ISR 18 ; 18: Machine Check Exception ISR 19 ; 19: Reserved ISR 20 ; 20: Reserved ISR 21 ; 21: Reserved ISR 22 ; 22: Reserved ISR 23 ; 23: Reserved ISR 24 ; 24: Reserved ISR 25 ; 25: Reserved ISR 26 ; 26: Reserved ISR 27 ; 27: Reserved ISR 28 ; 28: Reserved ISR 29 ; 29: Reserved ISR 30 ; 30: Reserved ISR 31 ; 31: Reserved IRQ 0, 32 IRQ 1, 33 IRQ 2, 34 IRQ 3, 35 IRQ 4, 36 IRQ 5, 37 IRQ 6, 38 IRQ 7, 39 IRQ 8, 40 IRQ 9, 41 IRQ 10, 42 IRQ 11, 43 IRQ 12, 44 IRQ 13, 45 IRQ 14, 46 IRQ 15, 47
solutions/07 - Collation Station/size-10_speed-5.asm
michaelgundlach/7billionhumans
45
165486
<filename>solutions/07 - Collation Station/size-10_speed-5.asm<gh_stars>10-100 -- 7 Billion Humans (2053) -- -- 7: Collation Station -- -- Author: soerface -- Size: 10 -- Speed: 5 step s step s a: step s if n != datacube: jump a endif pickup n b: if s != hole: step s jump b endif drop
alloy4fun_models/trashltl/models/11/aHf3sdiovgopRAbhF.als
Kaixi26/org.alloytools.alloy
0
4918
<reponame>Kaixi26/org.alloytools.alloy open main pred idaHf3sdiovgopRAbhF_prop12 { always (some f:File&Trash | always f in Trash) } pred __repair { idaHf3sdiovgopRAbhF_prop12 } check __repair { idaHf3sdiovgopRAbhF_prop12 <=> prop12o }
models/tests/test69g.als
transclosure/Amalgam
4
5145
<filename>models/tests/test69g.als module tests/test check { no sig$ && no field$ } expect 0 // since no user sigs nor fields are defined
src/gen/gstreamer-gst_low_level-gstreamer_0_10_gst_rtsp_gstrtspmessage_h.ads
persan/A-gst
1
3446
pragma Ada_2005; pragma Style_Checks (Off); pragma Warnings (Off); with Interfaces.C; use Interfaces.C; with GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h; with glib; with glib.Values; with System; with GLIB; -- with GStreamer.GST_Low_Level.glibconfig_h; -- limited with GStreamer.GST_Low_Level.glib_2_0_glib_garray_h; with System; -- limited with GStreamer.GST_Low_Level.glib_2_0_glib_gstring_h; package GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspmessage_h is -- GStreamer -- * Copyright (C) <2005,2006> <NAME> <<EMAIL>> -- * -- * This library is free software; you can redistribute it and/or -- * modify it under the terms of the GNU Library General Public -- * License as published by the Free Software Foundation; either -- * version 2 of the License, or (at your option) any later version. -- * -- * This library 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 -- * Library General Public License for more details. -- * -- * You should have received a copy of the GNU Library General Public -- * License along with this library; if not, write to the -- * Free Software Foundation, Inc., 59 Temple Place - Suite 330, -- * Boston, MA 02111-1307, USA. -- -- * Unless otherwise indicated, Source Code is licensed under MIT license. -- * See further explanation attached in License Statement (distributed in the file -- * LICENSE). -- * -- * 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. -- --* -- * GstRTSPMsgType: -- * @GST_RTSP_MESSAGE_INVALID: invalid message type -- * @GST_RTSP_MESSAGE_REQUEST: RTSP request message -- * @GST_RTSP_MESSAGE_RESPONSE: RTSP response message -- * @GST_RTSP_MESSAGE_HTTP_REQUEST: HTTP request message. Since 0.10.25 -- * @GST_RTSP_MESSAGE_HTTP_RESPONSE: HTTP response message. Since 0.10.25 -- * @GST_RTSP_MESSAGE_DATA: data message -- * -- * The type of a message. -- type GstRTSPMsgType is (GST_RTSP_MESSAGE_INVALID, GST_RTSP_MESSAGE_REQUEST, GST_RTSP_MESSAGE_RESPONSE, GST_RTSP_MESSAGE_HTTP_REQUEST, GST_RTSP_MESSAGE_HTTP_RESPONSE, GST_RTSP_MESSAGE_DATA); pragma Convention (C, GstRTSPMsgType); -- gst/rtsp/gstrtspmessage.h:71 type GstRTSPMessage; type anon_410; type anon_411 is record method : aliased GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPMethod; -- gst/rtsp/gstrtspmessage.h:88 uri : access GLIB.gchar; -- gst/rtsp/gstrtspmessage.h:89 version : aliased GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPVersion; -- gst/rtsp/gstrtspmessage.h:90 end record; pragma Convention (C_Pass_By_Copy, anon_411); type anon_412 is record code : aliased GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPStatusCode; -- gst/rtsp/gstrtspmessage.h:93 reason : access GLIB.gchar; -- gst/rtsp/gstrtspmessage.h:94 version : aliased GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPVersion; -- gst/rtsp/gstrtspmessage.h:95 end record; pragma Convention (C_Pass_By_Copy, anon_412); type anon_413 is record channel : aliased GLIB.guint8; -- gst/rtsp/gstrtspmessage.h:98 end record; pragma Convention (C_Pass_By_Copy, anon_413); type anon_410 (discr : unsigned := 0) is record case discr is when 0 => request : aliased anon_411; -- gst/rtsp/gstrtspmessage.h:91 when 1 => response : aliased anon_412; -- gst/rtsp/gstrtspmessage.h:96 when others => data : aliased anon_413; -- gst/rtsp/gstrtspmessage.h:99 end case; end record; pragma Convention (C_Pass_By_Copy, anon_410); pragma Unchecked_Union (anon_410);--subtype GstRTSPMessage is u_GstRTSPMessage; -- gst/rtsp/gstrtspmessage.h:73 --* -- * GstRTSPMessage: -- * @type: the message type -- * -- * An RTSP message containing request, response or data messages. Depending on -- * the @type, the appropriate structure may be accessed. -- type GstRTSPMessage is record c_type : aliased GstRTSPMsgType; -- gst/rtsp/gstrtspmessage.h:84 type_data : aliased anon_410; -- gst/rtsp/gstrtspmessage.h:100 hdr_fields : System.Address; -- access GStreamer.GST_Low_Level.glib_2_0_glib_garray_h.GArray -- gst/rtsp/gstrtspmessage.h:103 c_body : access GLIB.guint8; -- gst/rtsp/gstrtspmessage.h:105 body_size : aliased GLIB.guint; -- gst/rtsp/gstrtspmessage.h:106 end record; pragma Convention (C_Pass_By_Copy, GstRTSPMessage); -- gst/rtsp/gstrtspmessage.h:82 --< private > -- memory management function gst_rtsp_message_new (msg : System.Address) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspmessage.h:110 pragma Import (C, gst_rtsp_message_new, "gst_rtsp_message_new"); function gst_rtsp_message_init (msg : access GstRTSPMessage) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspmessage.h:111 pragma Import (C, gst_rtsp_message_init, "gst_rtsp_message_init"); function gst_rtsp_message_unset (msg : access GstRTSPMessage) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspmessage.h:112 pragma Import (C, gst_rtsp_message_unset, "gst_rtsp_message_unset"); function gst_rtsp_message_free (msg : access GstRTSPMessage) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspmessage.h:113 pragma Import (C, gst_rtsp_message_free, "gst_rtsp_message_free"); function gst_rtsp_message_get_type (msg : access GstRTSPMessage) return GstRTSPMsgType; -- gst/rtsp/gstrtspmessage.h:115 pragma Import (C, gst_rtsp_message_get_type, "gst_rtsp_message_get_type"); -- request function gst_rtsp_message_new_request (msg : System.Address; method : GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPMethod; uri : access GLIB.gchar) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspmessage.h:118 pragma Import (C, gst_rtsp_message_new_request, "gst_rtsp_message_new_request"); function gst_rtsp_message_init_request (msg : access GstRTSPMessage; method : GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPMethod; uri : access GLIB.gchar) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspmessage.h:121 pragma Import (C, gst_rtsp_message_init_request, "gst_rtsp_message_init_request"); function gst_rtsp_message_parse_request (msg : access GstRTSPMessage; method : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPMethod; uri : System.Address; version : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPVersion) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspmessage.h:124 pragma Import (C, gst_rtsp_message_parse_request, "gst_rtsp_message_parse_request"); -- response function gst_rtsp_message_new_response (msg : System.Address; code : GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPStatusCode; reason : access GLIB.gchar; request : access constant GstRTSPMessage) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspmessage.h:130 pragma Import (C, gst_rtsp_message_new_response, "gst_rtsp_message_new_response"); function gst_rtsp_message_init_response (msg : access GstRTSPMessage; code : GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPStatusCode; reason : access GLIB.gchar; request : access constant GstRTSPMessage) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspmessage.h:134 pragma Import (C, gst_rtsp_message_init_response, "gst_rtsp_message_init_response"); function gst_rtsp_message_parse_response (msg : access GstRTSPMessage; code : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPStatusCode; reason : System.Address; version : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPVersion) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspmessage.h:138 pragma Import (C, gst_rtsp_message_parse_response, "gst_rtsp_message_parse_response"); -- data function gst_rtsp_message_new_data (msg : System.Address; channel : GLIB.guint8) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspmessage.h:144 pragma Import (C, gst_rtsp_message_new_data, "gst_rtsp_message_new_data"); function gst_rtsp_message_init_data (msg : access GstRTSPMessage; channel : GLIB.guint8) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspmessage.h:146 pragma Import (C, gst_rtsp_message_init_data, "gst_rtsp_message_init_data"); function gst_rtsp_message_parse_data (msg : access GstRTSPMessage; channel : access GLIB.guint8) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspmessage.h:148 pragma Import (C, gst_rtsp_message_parse_data, "gst_rtsp_message_parse_data"); -- headers function gst_rtsp_message_add_header (msg : access GstRTSPMessage; field : GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPHeaderField; value : access GLIB.gchar) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspmessage.h:152 pragma Import (C, gst_rtsp_message_add_header, "gst_rtsp_message_add_header"); function gst_rtsp_message_take_header (msg : access GstRTSPMessage; field : GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPHeaderField; value : access GLIB.gchar) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspmessage.h:155 pragma Import (C, gst_rtsp_message_take_header, "gst_rtsp_message_take_header"); function gst_rtsp_message_remove_header (msg : access GstRTSPMessage; field : GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPHeaderField; indx : GLIB.gint) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspmessage.h:158 pragma Import (C, gst_rtsp_message_remove_header, "gst_rtsp_message_remove_header"); function gst_rtsp_message_get_header (msg : access constant GstRTSPMessage; field : GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPHeaderField; value : System.Address; indx : GLIB.gint) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspmessage.h:161 pragma Import (C, gst_rtsp_message_get_header, "gst_rtsp_message_get_header"); function gst_rtsp_message_append_headers (msg : access constant GstRTSPMessage; str : access GStreamer.GST_Low_Level.glib_2_0_glib_gstring_h.GString) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspmessage.h:165 pragma Import (C, gst_rtsp_message_append_headers, "gst_rtsp_message_append_headers"); -- handling the body function gst_rtsp_message_set_body (msg : access GstRTSPMessage; data : access GLIB.guint8; size : GLIB.guint) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspmessage.h:169 pragma Import (C, gst_rtsp_message_set_body, "gst_rtsp_message_set_body"); function gst_rtsp_message_take_body (msg : access GstRTSPMessage; data : access GLIB.guint8; size : GLIB.guint) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspmessage.h:172 pragma Import (C, gst_rtsp_message_take_body, "gst_rtsp_message_take_body"); function gst_rtsp_message_get_body (msg : access constant GstRTSPMessage; data : System.Address; size : access GLIB.guint) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspmessage.h:175 pragma Import (C, gst_rtsp_message_get_body, "gst_rtsp_message_get_body"); function gst_rtsp_message_steal_body (msg : access GstRTSPMessage; data : System.Address; size : access GLIB.guint) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspmessage.h:178 pragma Import (C, gst_rtsp_message_steal_body, "gst_rtsp_message_steal_body"); -- debug function gst_rtsp_message_dump (msg : access GstRTSPMessage) return GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h.GstRTSPResult; -- gst/rtsp/gstrtspmessage.h:183 pragma Import (C, gst_rtsp_message_dump, "gst_rtsp_message_dump"); end GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspmessage_h;
programs/oeis/120/A120200.asm
neoneye/loda
22
27419
; A120200: a(1)=7; a(n)=floor((62+sum(a(1) to a(n-1)))/8). ; 7,8,9,10,12,13,15,17,19,21,24,27,30,34,38,43,48,54,61,69,77,87,98,110,124,139,157,176,198,223,251,282,317,357,402,452,508,572,643,724 mov $5,$0 add $5,1 mov $7,$0 lpb $5 mov $0,$7 sub $5,1 sub $0,$5 mov $9,2 mov $11,$0 lpb $9 mov $0,$11 sub $9,1 add $0,$9 sub $0,1 mov $13,2 mov $15,$0 lpb $13 mov $0,$15 sub $13,1 add $0,$13 add $0,1 mov $6,0 lpb $0 mov $2,$0 sub $0,1 mov $3,$2 add $6,6 lpb $3 trn $0,1 add $0,1 mov $3,$6 mov $4,$6 div $6,8 add $6,$4 add $6,1 trn $3,$6 lpe mov $2,$6 lpe mul $2,3 lpb $6 mov $4,$2 mov $6,$3 lpe mov $6,$4 mov $12,$13 lpb $12 sub $12,1 mov $14,$6 lpe lpe lpb $15 sub $14,$6 mov $15,0 lpe mov $6,$14 mov $8,$9 lpb $8 sub $8,1 mov $10,$6 lpe lpe lpb $11 sub $10,$6 mov $11,0 lpe mov $6,$10 sub $6,3 div $6,3 add $6,1 add $1,$6 lpe mov $0,$1
Library/SpecUI/CommonUI/CItem/citemCheckedItem.asm
steakknife/pcgeos
504
173408
<reponame>steakknife/pcgeos COMMENT @----------------------------------------------------------------------- Copyright (c) GeoWorks 1988 -- All Rights Reserved PROJECT: PC GEOS MODULE: CommonUI/COpen (common code for specific UIs) FILE: copenCheckedItem.asm METHODS: Name Description ---- ----------- OLCheckedItemDraw Draws the CheckedItem on the screen OLCheckedItemRerecalcSize Calculates the width and height of the child OLCheckedItemGetExtraSize Returns the non-moniker size of the CheckedItem. OLCheckedItemMkrPos Returns position of the moniker. OLCheckedItemLostGadgetExcl Handler for method. ROUTINES: Name Description ---- ----------- GetCheckedItemBounds Returns the coordinates of the CheckedItem itself DrawBWCheckedItem Draws the CheckedItem in B & W. BWCheckedItemBackground Erases the CheckedItem in a background color DrawColorCheckedItem Draws the CheckedItem in color REVISION HISTORY: Name Date Description ---- ---- ----------- Clayton 8/89 Initial version Eric 4/90 New USER/ACTUAL exclusives, drawing state separation work. DESCRIPTION: $Id: citemCheckedItem.asm,v 1.2 98/03/11 05:54:22 joon Exp $ -------------------------------------------------------------------------------@ CommonUIClassStructures segment resource OLCheckedItemClass mask CLASSF_DISCARD_ON_SAVE or \ mask CLASSF_NEVER_SAVED CommonUIClassStructures ends ;----------------------- Build segment resource COMMENT @---------------------------------------------------------------------- METHOD: OLItemInitialize -- MSG_META_INITIALIZE for OLItemClass DESCRIPTION: Initialize an item object. PASS: *ds:si - instance data ax - MSG_META_INITIALIZE RETURN: ds, si, bx, di, es = same DESTROYED: ax, cx, dx, bp PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- Eric 4/90 Initial version ------------------------------------------------------------------------------@ OLCheckedItemInitialize method private static OLCheckedItemClass, \ MSG_META_INITIALIZE uses bx, di, es ; To comply w/static call requirements .enter ; that bx, si, di, & es are preserved. ; NOTE that es is NOT segment of class ;call superclass to set default attributes mov di, segment OLCheckedItemClass mov es, di mov di, offset OLCheckedItemClass CallSuper MSG_META_INITIALIZE ;set a flag which allows the OLItemClass MSG_VIS_DRAW handler ;to draw object correctly. call Build_DerefVisSpecDI ORNF ds:[di].OLII_state, mask OLIS_IS_CHECKBOX .leave ret OLCheckedItemInitialize endp Build ends ;------------------------- ItemGeometry segment resource COMMENT @---------------------------------------------------------------------- METHOD: OLCheckedItemRerecalcSize -- MSG_VIS_RECALC_SIZE for OLCheckedItemClass DESCRIPTION: Returns the size of the CheckedItem. PASS: *ds:si - instance data es - segment of OLCheckedItemClass di - MSG_VIS_GET_SIZE cx - width info for choosing size dx - height info RETURN: cx - width to use dx - height to use DESTROYED: bx, si, di, ds, es REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Chris 3/15/89 Initial version ------------------------------------------------------------------------------@ OLCheckedItemRerecalcSize method OLCheckedItemClass, MSG_VIS_RECALC_SIZE test ds:[di].OLBI_moreAttrs, mask OLBMA_IN_TOOLBOX jz CheckedItem ;not a toolbox, do normal mov di, offset OLCheckedItemClass ;else handle as regular item GOTO ObjCallSuperNoLock CheckedItem: if _CUA_STYLE ;--------------------------------------------------------------- mov di, offset OLCheckedItemClass CallSuper MSG_VIS_RECALC_SIZE mov ax, CHECK_BOX_WIDTH ;use as minimum width ;use as minimum height mov bx, CHECK_HEIGHT + CHECK_TOP_BORDER + CHECK_BOTTOM_BORDER clr bp ;do not optionally expand items ;and desired is minimum ; ; In menu, leave room in the minimum height for an outline. -cbh 1/30/93 ; mov di, ds:[si] add di, ds:[di].Vis_offset test ds:[di].OLBI_specState, mask OLBSS_IN_MENU jz 10$ add bx, 2 10$: call VisHandleMinResize ret endif ;--------------------------------------------------------------- if _OL_STYLE ;--------------------------------------------------------------- segmov es,ds EC < call GenCheckGenAssumption ; Make sure gen data exists > mov di, ds:[si] ; ptr to instance data add di,ds:[di].Gen_offset ; ds:di = GenInstance mov di,ds:[di].GI_visMoniker ; fetch moniker push cx push dx clr bp ;get have no GState... call SpecGetMonikerSize ;get size of moniker ; Compensate for the CheckedItem add cx, CHECK_WIDTH_REAL+CHECK_LEFT_BORDER+ \ CHECK_REAL_RIGHT_BORDER + CHECK_BOX_OFFSET mov ax,cx ;use as minimum width mov bx,dx ;use as minimum height cmp ax, CHECK_WIDTH jae 10$ mov ax, CHECK_WIDTH 10$: cmp bx, CHECK_HEIGHT+2 jae 20$ mov bx, CHECK_HEIGHT+2 20$: pop dx pop cx ; if the CheckedItem has a mark in it add size for the mark clr bp ;do not optionally expand CheckedItems GOTO VisHandleMinResize endif ;--------------------------------------------------------------- OLCheckedItemRerecalcSize endp COMMENT @---------------------------------------------------------------------- METHOD: OLCheckedItemGetExtraSize -- MSG_SPEC_GET_EXTRA_SIZE for OLCheckedItemClass DESCRIPTION: Returns the non-moniker size of the CheckedItem. PASS: *ds:si - instance data es - segment of MetaClass ax - MSG_SPEC_GET_EXTRA_SIZE RETURN: cx, dx - extra size DESTROYED: bx, si, di, ds, es REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Chris 11/ 7/89 Initial version ------------------------------------------------------------------------------@ OLCheckedItemGetExtraSize method OLCheckedItemClass, MSG_SPEC_GET_EXTRA_SIZE test ds:[di].OLBI_moreAttrs, mask OLBMA_IN_TOOLBOX jz CheckedItem ;not a toolbox, do normal mov di, offset OLCheckedItemClass ;else handle as regular item GOTO ObjCallSuperNoLock CheckedItem: OLS < mov cx, CHECK_WIDTH_REAL+CHECK_RIGHT_BORDER > OLS < mov dx, 18-12 ;BUTTON_MIN_HEIGHT-2 > CUAS < mov cx, MO_BUTTON_INSET_X*2 > CUAS < mov dx, 18-12 ;BUTTON_MIN_HEIGHT-2 > ret OLCheckedItemGetExtraSize endp COMMENT @---------------------------------------------------------------------- METHOD: OLCheckedItemMkrPos -- MSG_GET_FIRST_MKR_POS for OLCheckedItemClass DESCRIPTION: Returns position of the moniker. PASS: *ds:si - instance data es - segment of MetaClass ax - MSG_GET_FIRST_MKR_POS RETURN: carry set if handled, with: ax, cx - position of moniker DESTROYED: bx, si, di, ds, es REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Chris 11/ 1/89 Initial version ------------------------------------------------------------------------------@ OLCheckedItemMkrPos method OLCheckedItemClass, MSG_GET_FIRST_MKR_POS test ds:[di].OLBI_moreAttrs, mask OLBMA_IN_TOOLBOX jz CheckedItem ;not a toolbox, do normal mov di, offset OLCheckedItemClass ;else handle as regular item GOTO ObjCallSuperNoLock CheckedItem: mov di, ds:[si] ; ptr to instance data add di,ds:[di].Gen_offset ; ds:di = GenInstance mov bx,ds:[di].GI_visMoniker ; fetch moniker tst bx ; no moniker, message not jz exit ; handled, exit (C=0) segmov es, ds sub sp, size DrawMonikerArgs mov bp, sp mov cl, (J_LEFT shl offset DMF_X_JUST) or \ (J_CENTER shl offset DMF_Y_JUST) OLS < clr dx ; dh=yoffset, dl=xoffset > CUAS < ; dh=yoffset, dl=xoffset > CUAS < mov dx, CHECK_WIDTH_REAL + CHECK_LEFT_BORDER + CHECK_RIGHT_BORDER > clr ss:[bp].DMA_yInset ; y inset mov ss:[bp].DMA_xInset, dx clr ss:[bp].DMA_gState call SpecGetMonikerPos ; return position of moniker if _MOTIF or _ISUI ; ; It appears that the x offset is bogus at this point (or, rather, not ; really representing reality for some reason :), so let's stuff ; the correct thing in for these purposes. -cbh 11/16/92 ; mov di, ds:[si] add di, ds:[di].Vis_offset test ds:[di].OLBI_specState, mask OLBSS_IN_MENU jnz 20$ mov ax, ds:[di].VI_bounds.R_left ;get left edge add ax, CHECK_BOX_WIDTH ;<256. I guarantee it. test ds:[di].OLII_state, mask OLIS_DRAW_AS_TOOLBOX jz 20$ add ax, TOOLBOX_INSET_X ;only a byte, anyway. 20$: endif add sp, size DrawMonikerArgs mov cx, bx ; return y pos in cx stc ; return carry set exit: ret OLCheckedItemMkrPos endp ItemGeometry ends ;----------------------- ItemCommon segment resource COMMENT @---------------------------------------------------------------------- FUNCTION: OLCheckedItemLostGadgetExclusive -- MSG_VIS_LOST_GADGET_EXCL handler DESCRIPTION: This method is received when some other object has grabbed the GADGET exclusive for this level in the visual tree. PASS: *ds:si - instance data es - segment of OLCheckedItemClass ax - method number RETURN: Nothing DESTROYED: di REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Clayton 6/89 Initial version ------------------------------------------------------------------------------@ OLCheckedItemLostGadgetExcl method dynamic OLCheckedItemClass, \ MSG_VIS_LOST_GADGET_EXCL test ds:[di].OLBI_moreAttrs, mask OLBMA_IN_TOOLBOX jz CheckedItem ;not a toolbox, do normal mov di, offset OLCheckedItemClass ;else handle as regular item GOTO ObjCallSuperNoLock CheckedItem: ;may already be reset. Save bytes: go ahead and reset and redraw ;if necessary. Motif: reset BORDERED in case is in menu. OLS< ANDNF ds:[di].OLBI_specState, not (mask OLBSS_DEPRESSED) > NOT_MO< ANDNF ds:[di].OLBI_specState, not (mask OLBSS_DEPRESSED) > MO < ANDNF ds:[di].OLBI_specState, not (mask OLBSS_DEPRESSED or \ mask OLBSS_BORDERED) > ISU < ANDNF ds:[di].OLBI_specState, not (mask OLBSS_DEPRESSED or \ mask OLBSS_BORDERED) > call OLButtonDrawNOWIfNewState ;Redraw immediately if necessary call VisReleaseMouse ; Release mouse, if we haven't done so ; already. ret OLCheckedItemLostGadgetExcl endp ItemCommon ends
src/util-beans-objects.ads
Letractively/ada-util
0
19867
----------------------------------------------------------------------- -- Util.Beans.Objects -- Generic Typed Data Representation -- Copyright (C) 2009, 2010, 2011, 2013 <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. ----------------------------------------------------------------------- -- Provides a data type to manage entities of different types using the -- same abstraction. -- -- An ''Object' can hold one of the following values: -- o a boolean -- o a long long integer -- o a date -- o a string -- o a wide wide string -- o a generic data -- -- -- Value : Object := To_Object ("something"); -- Value := Value + To_Object ("12"); -- with Ada.Strings.Unbounded; with Ada.Strings.Wide_Wide_Unbounded; with Ada.Finalization; private with Util.Concurrent.Counters; limited with Util.Beans.Basic; package Util.Beans.Objects is pragma Preelaborate; use Ada.Strings.Unbounded; use Ada.Strings.Wide_Wide_Unbounded; -- Exception raised when an object cannot be converted to a given type. Conversion_Error : exception; type Data_Type is (TYPE_NULL, -- The object holds a boolean value. TYPE_BOOLEAN, -- The object holds an integer value (64-bits). TYPE_INTEGER, -- The object holds a floating point value. TYPE_FLOAT, -- The object holds a date and time TYPE_TIME, -- The object holds a string TYPE_STRING, -- The object holds a wide wide string TYPE_WIDE_STRING, -- The object holds a generic bean TYPE_BEAN); type Storage_Type is (STATIC, DYNAMIC); -- Exception raised when the value identified by a name is not -- recognized. No_Value : exception; -- ------------------------------ -- Generic Object holding a value -- ------------------------------ -- The object has a type represented by 'Object_Type'. -- It can hold any value while being tightly coupled with a type. -- The object can be converted to standard Ada types. type Object is private; type Object_Value is private; -- The null object. Null_Object : constant Object; -- ------------------------------ -- Type definition -- ------------------------------ -- The Object_Type describes a type. It serves as a basis -- for type conversion. type Object_Type is limited interface; type Object_Type_Access is not null access constant Object_Type'Class; -- Get the type name function Get_Name (Type_Def : Object_Type) return String is abstract; -- Get the base data type. function Get_Data_Type (Type_Def : Object_Type) return Data_Type is abstract; -- Convert the value into a string. function To_String (Type_Def : in Object_Type; Value : in Object_Value) return String is abstract; -- Convert the value into a wide string. function To_Wide_Wide_String (Type_Def : in Object_Type; Value : in Object_Value) return Wide_Wide_String is abstract; -- Convert the value into an integer. function To_Long_Long (Type_Def : in Object_Type; Value : in Object_Value) return Long_Long_Integer is abstract; -- Convert the value into a float. function To_Long_Float (Type_Def : in Object_Type; Value : in Object_Value) return Long_Long_Float is abstract; -- Convert the value into a boolean. function To_Boolean (Type_Def : in Object_Type; Value : in Object_Value) return Boolean is abstract; -- Convert the value into a duration. function To_Duration (Type_Def : in Object_Type; Value : in Object_Value) return Duration is abstract; -- Returns True if the value is empty. function Is_Empty (Type_Def : in Object_Type; Value : in Object_Value) return Boolean is abstract; -- ------------------------------ -- Generic Object holding a value -- ------------------------------ -- Check whether the object contains a value. -- Returns true if the object does not contain a value. function Is_Null (Value : in Object) return Boolean; -- Check whether the object is empty. -- If the object is null, returns true. -- If the object is the empty string, returns true. -- If the object is a list bean whose Get_Count is 0, returns true. -- Otherwise returns false. function Is_Empty (Value : in Object) return Boolean; -- function Is_Constant (Value : in Object) return Boolean; -- Get a type identification for the object value. function Get_Type (Value : in Object) return Data_Type; -- Get the type definition of the object value. function Get_Type (Value : in Object) return Object_Type_Access; -- Get the type name of this object. function Get_Type_Name (Value : Object) return String; -- Get the value identified by the name in the bean object. -- If the value object is not a bean, returns the null object. function Get_Value (Value : in Object; Name : in String) return Object; -- Convert the object to the corresponding type. function To_String (Value : in Object) return String; function To_Wide_Wide_String (Value : in Object) return Wide_Wide_String; function To_Unbounded_String (Value : in Object) return Unbounded_String; function To_Unbounded_Wide_Wide_String (Value : in Object) return Unbounded_Wide_Wide_String; function To_Integer (Value : in Object) return Integer; function To_Boolean (Value : in Object) return Boolean; function To_Long_Integer (Value : in Object) return Long_Integer; function To_Long_Long_Integer (Value : in Object) return Long_Long_Integer; function To_Float (Value : in Object) return Float; function To_Long_Float (Value : in Object) return Long_Float; function To_Long_Long_Float (Value : in Object) return Long_Long_Float; function To_Duration (Value : in Object) return Duration; function To_Bean (Value : in Object) return access Util.Beans.Basic.Readonly_Bean'Class; -- Convert the object to an object of another time. -- Force the object to be an integer. function Cast_Integer (Value : Object) return Object; -- Force the object to be a float. function Cast_Float (Value : Object) return Object; -- Force the object to be a duration. function Cast_Duration (Value : Object) return Object; -- Force the object to be a string. function Cast_String (Value : Object) return Object; -- Convert a value to a generic typed object. function To_Object (Value : in Integer) return Object; function To_Object (Value : in Long_Integer) return Object; function To_Object (Value : in Long_Long_Integer) return Object; function To_Object (Value : in Float) return Object; function To_Object (Value : in Long_Float) return Object; function To_Object (Value : in Long_Long_Float) return Object; function To_Object (Value : in String) return Object; function To_Object (Value : in Wide_Wide_String) return Object; function To_Object (Value : in Unbounded_String) return Object; function To_Object (Value : in Unbounded_Wide_Wide_String) return Object; function To_Object (Value : in Boolean) return Object; function To_Object (Value : in Duration) return Object; -- Create an object that refers to the bean object. With the storage type -- <b>DYNAMIC</b>, the default, the bean object will be freed when there is -- no <b>Object</b> that refers to that bean. With <b>STATIC</b>, the bean -- is a static bean and it will not be freed automaticaly. function To_Object (Value : access Util.Beans.Basic.Readonly_Bean'Class; Storage : in Storage_Type := DYNAMIC) return Object; -- Comparison of objects function "<" (Left, Right : Object) return Boolean; function "<=" (Left, Right : Object) return Boolean; function ">" (Left, Right : Object) return Boolean; function ">=" (Left, Right : Object) return Boolean; function "=" (Left, Right : Object) return Boolean; -- Arithmetic operations on objects function "+" (Left, Right : Object) return Object; function "-" (Left, Right : Object) return Object; function "*" (Left, Right : Object) return Object; function "/" (Left, Right : Object) return Object; function "&" (Left, Right : Object) return Object; function "mod" (Left, Right : Object) return Object; function "-" (Left : Object) return Object; private use Ada.Finalization; type Name_Access is access constant String; type Basic_Type is abstract limited new Object_Type with null record; -- Convert the value into a wide string. function To_Wide_Wide_String (Type_Def : in Basic_Type; Value : in Object_Value) return Wide_Wide_String; -- Convert the value into an integer. function To_Long_Long (Type_Def : in Basic_Type; Value : in Object_Value) return Long_Long_Integer; -- Convert the value into a float. function To_Long_Float (Type_Def : in Basic_Type; Value : in Object_Value) return Long_Long_Float; -- Convert the value into a boolean. function To_Boolean (Type_Def : in Basic_Type; Value : in Object_Value) return Boolean; -- Convert the value into a duration. function To_Duration (Type_Def : in Basic_Type; Value : in Object_Value) return Duration; -- Returns False function Is_Empty (Type_Def : in Basic_Type; Value : in Object_Value) return Boolean; -- ------------------------------ -- Null Type -- ------------------------------ type Null_Type is new Basic_Type with null record; -- Get the type name function Get_Name (Type_Def : Null_Type) return String; -- Get the base data type. function Get_Data_Type (Type_Def : Null_Type) return Data_Type; -- Convert the value into a string. function To_String (Type_Def : in Null_Type; Value : in Object_Value) return String; -- Returns True function Is_Empty (Type_Def : in Null_Type; Value : in Object_Value) return Boolean; -- ------------------------------ -- Integer Type -- ------------------------------ type Int_Type is new Basic_Type with null record; -- Get the type name function Get_Name (Type_Def : Int_Type) return String; -- Get the base data type. function Get_Data_Type (Type_Def : Int_Type) return Data_Type; function To_String (Type_Def : in Int_Type; Value : in Object_Value) return String; -- Convert the value into an integer. function To_Long_Long (Type_Def : in Int_Type; Value : in Object_Value) return Long_Long_Integer; -- Convert the value into a float. function To_Long_Float (Type_Def : in Int_Type; Value : in Object_Value) return Long_Long_Float; -- Convert the value into a boolean. function To_Boolean (Type_Def : in Int_Type; Value : in Object_Value) return Boolean; -- Convert the value into a duration. function To_Duration (Type_Def : in Int_Type; Value : in Object_Value) return Duration; -- ------------------------------ -- Float Type -- ------------------------------ type Float_Type is new Basic_Type with null record; -- Get the type name function Get_Name (Type_Def : in Float_Type) return String; -- Get the base data type. function Get_Data_Type (Type_Def : in Float_Type) return Data_Type; -- Convert the value into a string. function To_String (Type_Def : in Float_Type; Value : in Object_Value) return String; -- Convert the value into an integer. function To_Long_Long (Type_Def : in Float_Type; Value : in Object_Value) return Long_Long_Integer; -- Convert the value into a float. function To_Long_Float (Type_Def : in Float_Type; Value : in Object_Value) return Long_Long_Float; -- Convert the value into a boolean. function To_Boolean (Type_Def : in Float_Type; Value : in Object_Value) return Boolean; -- Convert the value into a duration. function To_Duration (Type_Def : in Float_Type; Value : in Object_Value) return Duration; -- ------------------------------ -- String Type -- ------------------------------ type String_Type is new Basic_Type with null record; -- Get the type name function Get_Name (Type_Def : in String_Type) return String; -- Get the base data type. function Get_Data_Type (Type_Def : in String_Type) return Data_Type; -- Convert the value into a string. function To_String (Type_Def : in String_Type; Value : in Object_Value) return String; -- Convert the value into an integer. function To_Long_Long (Type_Def : in String_Type; Value : in Object_Value) return Long_Long_Integer; -- Convert the value into a float. function To_Long_Float (Type_Def : in String_Type; Value : in Object_Value) return Long_Long_Float; -- Convert the value into a boolean. function To_Boolean (Type_Def : in String_Type; Value : in Object_Value) return Boolean; -- Convert the value into a duration. function To_Duration (Type_Def : in String_Type; Value : in Object_Value) return Duration; -- Returns True if the value is empty. function Is_Empty (Type_Def : in String_Type; Value : in Object_Value) return Boolean; -- ------------------------------ -- Wide String Type -- ------------------------------ type Wide_String_Type is new Basic_Type with null record; -- Get the type name function Get_Name (Type_Def : in Wide_String_Type) return String; -- Get the base data type. function Get_Data_Type (Type_Def : in Wide_String_Type) return Data_Type; -- Convert the value into a string. function To_String (Type_Def : in Wide_String_Type; Value : in Object_Value) return String; -- Convert the value into a wide string. function To_Wide_Wide_String (Type_Def : in Wide_String_Type; Value : in Object_Value) return Wide_Wide_String; -- Convert the value into an integer. function To_Long_Long (Type_Def : in Wide_String_Type; Value : in Object_Value) return Long_Long_Integer; -- Convert the value into a float. function To_Long_Float (Type_Def : in Wide_String_Type; Value : in Object_Value) return Long_Long_Float; -- Convert the value into a boolean. function To_Boolean (Type_Def : in Wide_String_Type; Value : in Object_Value) return Boolean; -- Convert the value into a duration. function To_Duration (Type_Def : in Wide_String_Type; Value : in Object_Value) return Duration; -- Returns True if the value is empty. function Is_Empty (Type_Def : in Wide_String_Type; Value : in Object_Value) return Boolean; -- ------------------------------ -- Boolean Type -- ------------------------------ type Boolean_Type is new Basic_Type with null record; -- Get the type name function Get_Name (Type_Def : in Boolean_Type) return String; -- Get the base data type. function Get_Data_Type (Type_Def : in Boolean_Type) return Data_Type; -- Convert the value into a string. function To_String (Type_Def : in Boolean_Type; Value : in Object_Value) return String; -- Convert the value into an integer. function To_Long_Long (Type_Def : in Boolean_Type; Value : in Object_Value) return Long_Long_Integer; -- Convert the value into a float. function To_Long_Float (Type_Def : in Boolean_Type; Value : in Object_Value) return Long_Long_Float; -- Convert the value into a boolean. function To_Boolean (Type_Def : in Boolean_Type; Value : in Object_Value) return Boolean; -- ------------------------------ -- Duration Type -- ------------------------------ type Duration_Type_Def is new Basic_Type with null record; -- Get the type name function Get_Name (Type_Def : in Duration_Type_Def) return String; -- Get the base data type. function Get_Data_Type (Type_Def : in Duration_Type_Def) return Data_Type; -- Convert the value into a string. function To_String (Type_Def : in Duration_Type_Def; Value : in Object_Value) return String; -- Convert the value into an integer. function To_Long_Long (Type_Def : in Duration_Type_Def; Value : in Object_Value) return Long_Long_Integer; -- Convert the value into a float. function To_Long_Float (Type_Def : in Duration_Type_Def; Value : in Object_Value) return Long_Long_Float; -- Convert the value into a boolean. function To_Boolean (Type_Def : in Duration_Type_Def; Value : in Object_Value) return Boolean; -- Convert the value into a duration. function To_Duration (Type_Def : in Duration_Type_Def; Value : in Object_Value) return Duration; -- ------------------------------ -- Bean Type -- ------------------------------ type Bean_Type is new Basic_Type with null record; -- Get the type name function Get_Name (Type_Def : in Bean_Type) return String; -- Get the base data type. function Get_Data_Type (Type_Def : in Bean_Type) return Data_Type; -- Convert the value into a string. function To_String (Type_Def : in Bean_Type; Value : in Object_Value) return String; -- Convert the value into an integer. function To_Long_Long (Type_Def : in Bean_Type; Value : in Object_Value) return Long_Long_Integer; -- Convert the value into a float. function To_Long_Float (Type_Def : in Bean_Type; Value : in Object_Value) return Long_Long_Float; -- Convert the value into a boolean. function To_Boolean (Type_Def : in Bean_Type; Value : in Object_Value) return Boolean; -- Returns True if the value is empty. function Is_Empty (Type_Def : in Bean_Type; Value : in Object_Value) return Boolean; subtype Proxy_Data_Type is Data_Type range TYPE_STRING .. TYPE_BEAN; type Proxy is tagged limited record Ref_Counter : Util.Concurrent.Counters.Counter; end record; -- Release the object pointed to by the proxy (if necessary). procedure Release (P : in out Proxy) is null; type Bean_Proxy_Access is access all Proxy'Class; type String_Proxy (Len : Natural) is new Proxy with record Value : String (1 .. Len); end record; type String_Proxy_Access is access all String_Proxy; type Wide_String_Proxy (Len : Natural) is new Proxy with record Value : Wide_Wide_String (1 .. Len); end record; type Wide_String_Proxy_Access is access all Wide_String_Proxy; type Bean_Proxy is new Proxy with record Bean : access Util.Beans.Basic.Readonly_Bean'Class; Storage : Storage_Type; end record; -- Release the object pointed to by the proxy (if necessary). overriding procedure Release (P : in out Bean_Proxy); type Object_Value (Of_Type : Data_Type := TYPE_NULL) is record case Of_Type is when TYPE_NULL => null; -- Integers and enums are stored as 64-bit integer. when TYPE_INTEGER => Int_Value : Long_Long_Integer; when TYPE_BOOLEAN => Bool_Value : Boolean; when TYPE_FLOAT => Float_Value : Long_Long_Float; when TYPE_TIME => Time_Value : Duration; when TYPE_STRING => String_Proxy : String_Proxy_Access; when TYPE_WIDE_STRING => Wide_Proxy : Wide_String_Proxy_Access; when TYPE_BEAN => Proxy : Bean_Proxy_Access; end case; end record; No_Type : aliased constant Null_Type := Null_Type '(others => <>); Null_Value : constant Object_Value := Object_Value '(Of_Type => TYPE_NULL); type Object is new Controlled with record Type_Def : Object_Type_Access := No_Type'Access; V : Object_Value := Null_Value; end record; overriding procedure Adjust (Obj : in out Object); overriding procedure Finalize (Obj : in out Object); Null_Object : constant Object := Object '(Controlled with V => Object_Value '(Of_Type => TYPE_NULL), Type_Def => No_Type'Access); end Util.Beans.Objects;
mkdir.asm
eastclo/OS_3
0
99352
_mkdir: file format elf32-i386 Disassembly of section .text: 00000000 <main>: #include "stat.h" #include "user.h" int main(int argc, char *argv[]) { 0: 8d 4c 24 04 lea 0x4(%esp),%ecx 4: 83 e4 f0 and $0xfffffff0,%esp 7: ff 71 fc pushl -0x4(%ecx) a: 55 push %ebp b: 89 e5 mov %esp,%ebp d: 57 push %edi e: 56 push %esi f: 53 push %ebx 10: 51 push %ecx 11: bf 01 00 00 00 mov $0x1,%edi 16: 83 ec 08 sub $0x8,%esp 19: 8b 31 mov (%ecx),%esi 1b: 8b 59 04 mov 0x4(%ecx),%ebx 1e: 83 c3 04 add $0x4,%ebx int i; if(argc < 2){ 21: 83 fe 01 cmp $0x1,%esi 24: 7e 3e jle 64 <main+0x64> 26: 8d 76 00 lea 0x0(%esi),%esi 29: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi printf(2, "Usage: mkdir files...\n"); exit(); } for(i = 1; i < argc; i++){ if(mkdir(argv[i]) < 0){ 30: 83 ec 0c sub $0xc,%esp 33: ff 33 pushl (%ebx) 35: e8 00 03 00 00 call 33a <mkdir> 3a: 83 c4 10 add $0x10,%esp 3d: 85 c0 test %eax,%eax 3f: 78 0f js 50 <main+0x50> for(i = 1; i < argc; i++){ 41: 83 c7 01 add $0x1,%edi 44: 83 c3 04 add $0x4,%ebx 47: 39 fe cmp %edi,%esi 49: 75 e5 jne 30 <main+0x30> printf(2, "mkdir: %s failed to create\n", argv[i]); break; } } exit(); 4b: e8 82 02 00 00 call 2d2 <exit> printf(2, "mkdir: %s failed to create\n", argv[i]); 50: 50 push %eax 51: ff 33 pushl (%ebx) 53: 68 bf 07 00 00 push $0x7bf 58: 6a 02 push $0x2 5a: e8 f1 03 00 00 call 450 <printf> break; 5f: 83 c4 10 add $0x10,%esp 62: eb e7 jmp 4b <main+0x4b> printf(2, "Usage: mkdir files...\n"); 64: 52 push %edx 65: 52 push %edx 66: 68 a8 07 00 00 push $0x7a8 6b: 6a 02 push $0x2 6d: e8 de 03 00 00 call 450 <printf> exit(); 72: e8 5b 02 00 00 call 2d2 <exit> 77: 66 90 xchg %ax,%ax 79: 66 90 xchg %ax,%ax 7b: 66 90 xchg %ax,%ax 7d: 66 90 xchg %ax,%ax 7f: 90 nop 00000080 <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, const char *t) { 80: 55 push %ebp 81: 89 e5 mov %esp,%ebp 83: 53 push %ebx 84: 8b 45 08 mov 0x8(%ebp),%eax 87: 8b 4d 0c mov 0xc(%ebp),%ecx char *os; os = s; while((*s++ = *t++) != 0) 8a: 89 c2 mov %eax,%edx 8c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 90: 83 c1 01 add $0x1,%ecx 93: 0f b6 59 ff movzbl -0x1(%ecx),%ebx 97: 83 c2 01 add $0x1,%edx 9a: 84 db test %bl,%bl 9c: 88 5a ff mov %bl,-0x1(%edx) 9f: 75 ef jne 90 <strcpy+0x10> ; return os; } a1: 5b pop %ebx a2: 5d pop %ebp a3: c3 ret a4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi aa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 000000b0 <strcmp>: int strcmp(const char *p, const char *q) { b0: 55 push %ebp b1: 89 e5 mov %esp,%ebp b3: 53 push %ebx b4: 8b 55 08 mov 0x8(%ebp),%edx b7: 8b 4d 0c mov 0xc(%ebp),%ecx while(*p && *p == *q) ba: 0f b6 02 movzbl (%edx),%eax bd: 0f b6 19 movzbl (%ecx),%ebx c0: 84 c0 test %al,%al c2: 75 1c jne e0 <strcmp+0x30> c4: eb 2a jmp f0 <strcmp+0x40> c6: 8d 76 00 lea 0x0(%esi),%esi c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi p++, q++; d0: 83 c2 01 add $0x1,%edx while(*p && *p == *q) d3: 0f b6 02 movzbl (%edx),%eax p++, q++; d6: 83 c1 01 add $0x1,%ecx d9: 0f b6 19 movzbl (%ecx),%ebx while(*p && *p == *q) dc: 84 c0 test %al,%al de: 74 10 je f0 <strcmp+0x40> e0: 38 d8 cmp %bl,%al e2: 74 ec je d0 <strcmp+0x20> return (uchar)*p - (uchar)*q; e4: 29 d8 sub %ebx,%eax } e6: 5b pop %ebx e7: 5d pop %ebp e8: c3 ret e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi f0: 31 c0 xor %eax,%eax return (uchar)*p - (uchar)*q; f2: 29 d8 sub %ebx,%eax } f4: 5b pop %ebx f5: 5d pop %ebp f6: c3 ret f7: 89 f6 mov %esi,%esi f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00000100 <strlen>: uint strlen(const char *s) { 100: 55 push %ebp 101: 89 e5 mov %esp,%ebp 103: 8b 4d 08 mov 0x8(%ebp),%ecx int n; for(n = 0; s[n]; n++) 106: 80 39 00 cmpb $0x0,(%ecx) 109: 74 15 je 120 <strlen+0x20> 10b: 31 d2 xor %edx,%edx 10d: 8d 76 00 lea 0x0(%esi),%esi 110: 83 c2 01 add $0x1,%edx 113: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1) 117: 89 d0 mov %edx,%eax 119: 75 f5 jne 110 <strlen+0x10> ; return n; } 11b: 5d pop %ebp 11c: c3 ret 11d: 8d 76 00 lea 0x0(%esi),%esi for(n = 0; s[n]; n++) 120: 31 c0 xor %eax,%eax } 122: 5d pop %ebp 123: c3 ret 124: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 12a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 00000130 <memset>: void* memset(void *dst, int c, uint n) { 130: 55 push %ebp 131: 89 e5 mov %esp,%ebp 133: 57 push %edi 134: 8b 55 08 mov 0x8(%ebp),%edx } static inline void stosb(void *addr, int data, int cnt) { asm volatile("cld; rep stosb" : 137: 8b 4d 10 mov 0x10(%ebp),%ecx 13a: 8b 45 0c mov 0xc(%ebp),%eax 13d: 89 d7 mov %edx,%edi 13f: fc cld 140: f3 aa rep stos %al,%es:(%edi) stosb(dst, c, n); return dst; } 142: 89 d0 mov %edx,%eax 144: 5f pop %edi 145: 5d pop %ebp 146: c3 ret 147: 89 f6 mov %esi,%esi 149: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00000150 <strchr>: char* strchr(const char *s, char c) { 150: 55 push %ebp 151: 89 e5 mov %esp,%ebp 153: 53 push %ebx 154: 8b 45 08 mov 0x8(%ebp),%eax 157: 8b 5d 0c mov 0xc(%ebp),%ebx for(; *s; s++) 15a: 0f b6 10 movzbl (%eax),%edx 15d: 84 d2 test %dl,%dl 15f: 74 1d je 17e <strchr+0x2e> if(*s == c) 161: 38 d3 cmp %dl,%bl 163: 89 d9 mov %ebx,%ecx 165: 75 0d jne 174 <strchr+0x24> 167: eb 17 jmp 180 <strchr+0x30> 169: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 170: 38 ca cmp %cl,%dl 172: 74 0c je 180 <strchr+0x30> for(; *s; s++) 174: 83 c0 01 add $0x1,%eax 177: 0f b6 10 movzbl (%eax),%edx 17a: 84 d2 test %dl,%dl 17c: 75 f2 jne 170 <strchr+0x20> return (char*)s; return 0; 17e: 31 c0 xor %eax,%eax } 180: 5b pop %ebx 181: 5d pop %ebp 182: c3 ret 183: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 189: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00000190 <gets>: char* gets(char *buf, int max) { 190: 55 push %ebp 191: 89 e5 mov %esp,%ebp 193: 57 push %edi 194: 56 push %esi 195: 53 push %ebx int i, cc; char c; for(i=0; i+1 < max; ){ 196: 31 f6 xor %esi,%esi 198: 89 f3 mov %esi,%ebx { 19a: 83 ec 1c sub $0x1c,%esp 19d: 8b 7d 08 mov 0x8(%ebp),%edi for(i=0; i+1 < max; ){ 1a0: eb 2f jmp 1d1 <gets+0x41> 1a2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi cc = read(0, &c, 1); 1a8: 8d 45 e7 lea -0x19(%ebp),%eax 1ab: 83 ec 04 sub $0x4,%esp 1ae: 6a 01 push $0x1 1b0: 50 push %eax 1b1: 6a 00 push $0x0 1b3: e8 32 01 00 00 call 2ea <read> if(cc < 1) 1b8: 83 c4 10 add $0x10,%esp 1bb: 85 c0 test %eax,%eax 1bd: 7e 1c jle 1db <gets+0x4b> break; buf[i++] = c; 1bf: 0f b6 45 e7 movzbl -0x19(%ebp),%eax 1c3: 83 c7 01 add $0x1,%edi 1c6: 88 47 ff mov %al,-0x1(%edi) if(c == '\n' || c == '\r') 1c9: 3c 0a cmp $0xa,%al 1cb: 74 23 je 1f0 <gets+0x60> 1cd: 3c 0d cmp $0xd,%al 1cf: 74 1f je 1f0 <gets+0x60> for(i=0; i+1 < max; ){ 1d1: 83 c3 01 add $0x1,%ebx 1d4: 3b 5d 0c cmp 0xc(%ebp),%ebx 1d7: 89 fe mov %edi,%esi 1d9: 7c cd jl 1a8 <gets+0x18> 1db: 89 f3 mov %esi,%ebx break; } buf[i] = '\0'; return buf; } 1dd: 8b 45 08 mov 0x8(%ebp),%eax buf[i] = '\0'; 1e0: c6 03 00 movb $0x0,(%ebx) } 1e3: 8d 65 f4 lea -0xc(%ebp),%esp 1e6: 5b pop %ebx 1e7: 5e pop %esi 1e8: 5f pop %edi 1e9: 5d pop %ebp 1ea: c3 ret 1eb: 90 nop 1ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 1f0: 8b 75 08 mov 0x8(%ebp),%esi 1f3: 8b 45 08 mov 0x8(%ebp),%eax 1f6: 01 de add %ebx,%esi 1f8: 89 f3 mov %esi,%ebx buf[i] = '\0'; 1fa: c6 03 00 movb $0x0,(%ebx) } 1fd: 8d 65 f4 lea -0xc(%ebp),%esp 200: 5b pop %ebx 201: 5e pop %esi 202: 5f pop %edi 203: 5d pop %ebp 204: c3 ret 205: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 209: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00000210 <stat>: int stat(const char *n, struct stat *st) { 210: 55 push %ebp 211: 89 e5 mov %esp,%ebp 213: 56 push %esi 214: 53 push %ebx int fd; int r; fd = open(n, O_RDONLY); 215: 83 ec 08 sub $0x8,%esp 218: 6a 00 push $0x0 21a: ff 75 08 pushl 0x8(%ebp) 21d: e8 f0 00 00 00 call 312 <open> if(fd < 0) 222: 83 c4 10 add $0x10,%esp 225: 85 c0 test %eax,%eax 227: 78 27 js 250 <stat+0x40> return -1; r = fstat(fd, st); 229: 83 ec 08 sub $0x8,%esp 22c: ff 75 0c pushl 0xc(%ebp) 22f: 89 c3 mov %eax,%ebx 231: 50 push %eax 232: e8 f3 00 00 00 call 32a <fstat> close(fd); 237: 89 1c 24 mov %ebx,(%esp) r = fstat(fd, st); 23a: 89 c6 mov %eax,%esi close(fd); 23c: e8 b9 00 00 00 call 2fa <close> return r; 241: 83 c4 10 add $0x10,%esp } 244: 8d 65 f8 lea -0x8(%ebp),%esp 247: 89 f0 mov %esi,%eax 249: 5b pop %ebx 24a: 5e pop %esi 24b: 5d pop %ebp 24c: c3 ret 24d: 8d 76 00 lea 0x0(%esi),%esi return -1; 250: be ff ff ff ff mov $0xffffffff,%esi 255: eb ed jmp 244 <stat+0x34> 257: 89 f6 mov %esi,%esi 259: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00000260 <atoi>: int atoi(const char *s) { 260: 55 push %ebp 261: 89 e5 mov %esp,%ebp 263: 53 push %ebx 264: 8b 4d 08 mov 0x8(%ebp),%ecx int n; n = 0; while('0' <= *s && *s <= '9') 267: 0f be 11 movsbl (%ecx),%edx 26a: 8d 42 d0 lea -0x30(%edx),%eax 26d: 3c 09 cmp $0x9,%al n = 0; 26f: b8 00 00 00 00 mov $0x0,%eax while('0' <= *s && *s <= '9') 274: 77 1f ja 295 <atoi+0x35> 276: 8d 76 00 lea 0x0(%esi),%esi 279: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi n = n*10 + *s++ - '0'; 280: 8d 04 80 lea (%eax,%eax,4),%eax 283: 83 c1 01 add $0x1,%ecx 286: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax while('0' <= *s && *s <= '9') 28a: 0f be 11 movsbl (%ecx),%edx 28d: 8d 5a d0 lea -0x30(%edx),%ebx 290: 80 fb 09 cmp $0x9,%bl 293: 76 eb jbe 280 <atoi+0x20> return n; } 295: 5b pop %ebx 296: 5d pop %ebp 297: c3 ret 298: 90 nop 299: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 000002a0 <memmove>: void* memmove(void *vdst, const void *vsrc, int n) { 2a0: 55 push %ebp 2a1: 89 e5 mov %esp,%ebp 2a3: 56 push %esi 2a4: 53 push %ebx 2a5: 8b 5d 10 mov 0x10(%ebp),%ebx 2a8: 8b 45 08 mov 0x8(%ebp),%eax 2ab: 8b 75 0c mov 0xc(%ebp),%esi char *dst; const char *src; dst = vdst; src = vsrc; while(n-- > 0) 2ae: 85 db test %ebx,%ebx 2b0: 7e 14 jle 2c6 <memmove+0x26> 2b2: 31 d2 xor %edx,%edx 2b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi *dst++ = *src++; 2b8: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx 2bc: 88 0c 10 mov %cl,(%eax,%edx,1) 2bf: 83 c2 01 add $0x1,%edx while(n-- > 0) 2c2: 39 d3 cmp %edx,%ebx 2c4: 75 f2 jne 2b8 <memmove+0x18> return vdst; } 2c6: 5b pop %ebx 2c7: 5e pop %esi 2c8: 5d pop %ebp 2c9: c3 ret 000002ca <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 2ca: b8 01 00 00 00 mov $0x1,%eax 2cf: cd 40 int $0x40 2d1: c3 ret 000002d2 <exit>: SYSCALL(exit) 2d2: b8 02 00 00 00 mov $0x2,%eax 2d7: cd 40 int $0x40 2d9: c3 ret 000002da <wait>: SYSCALL(wait) 2da: b8 03 00 00 00 mov $0x3,%eax 2df: cd 40 int $0x40 2e1: c3 ret 000002e2 <pipe>: SYSCALL(pipe) 2e2: b8 04 00 00 00 mov $0x4,%eax 2e7: cd 40 int $0x40 2e9: c3 ret 000002ea <read>: SYSCALL(read) 2ea: b8 05 00 00 00 mov $0x5,%eax 2ef: cd 40 int $0x40 2f1: c3 ret 000002f2 <write>: SYSCALL(write) 2f2: b8 10 00 00 00 mov $0x10,%eax 2f7: cd 40 int $0x40 2f9: c3 ret 000002fa <close>: SYSCALL(close) 2fa: b8 15 00 00 00 mov $0x15,%eax 2ff: cd 40 int $0x40 301: c3 ret 00000302 <kill>: SYSCALL(kill) 302: b8 06 00 00 00 mov $0x6,%eax 307: cd 40 int $0x40 309: c3 ret 0000030a <exec>: SYSCALL(exec) 30a: b8 07 00 00 00 mov $0x7,%eax 30f: cd 40 int $0x40 311: c3 ret 00000312 <open>: SYSCALL(open) 312: b8 0f 00 00 00 mov $0xf,%eax 317: cd 40 int $0x40 319: c3 ret 0000031a <mknod>: SYSCALL(mknod) 31a: b8 11 00 00 00 mov $0x11,%eax 31f: cd 40 int $0x40 321: c3 ret 00000322 <unlink>: SYSCALL(unlink) 322: b8 12 00 00 00 mov $0x12,%eax 327: cd 40 int $0x40 329: c3 ret 0000032a <fstat>: SYSCALL(fstat) 32a: b8 08 00 00 00 mov $0x8,%eax 32f: cd 40 int $0x40 331: c3 ret 00000332 <link>: SYSCALL(link) 332: b8 13 00 00 00 mov $0x13,%eax 337: cd 40 int $0x40 339: c3 ret 0000033a <mkdir>: SYSCALL(mkdir) 33a: b8 14 00 00 00 mov $0x14,%eax 33f: cd 40 int $0x40 341: c3 ret 00000342 <chdir>: SYSCALL(chdir) 342: b8 09 00 00 00 mov $0x9,%eax 347: cd 40 int $0x40 349: c3 ret 0000034a <dup>: SYSCALL(dup) 34a: b8 0a 00 00 00 mov $0xa,%eax 34f: cd 40 int $0x40 351: c3 ret 00000352 <getpid>: SYSCALL(getpid) 352: b8 0b 00 00 00 mov $0xb,%eax 357: cd 40 int $0x40 359: c3 ret 0000035a <sbrk>: SYSCALL(sbrk) 35a: b8 0c 00 00 00 mov $0xc,%eax 35f: cd 40 int $0x40 361: c3 ret 00000362 <sleep>: SYSCALL(sleep) 362: b8 0d 00 00 00 mov $0xd,%eax 367: cd 40 int $0x40 369: c3 ret 0000036a <uptime>: SYSCALL(uptime) 36a: b8 0e 00 00 00 mov $0xe,%eax 36f: cd 40 int $0x40 371: c3 ret 00000372 <hello>: SYSCALL(hello) 372: b8 16 00 00 00 mov $0x16,%eax 377: cd 40 int $0x40 379: c3 ret 0000037a <hello_name>: SYSCALL(hello_name) 37a: b8 17 00 00 00 mov $0x17,%eax 37f: cd 40 int $0x40 381: c3 ret 00000382 <get_num_proc>: SYSCALL(get_num_proc) 382: b8 18 00 00 00 mov $0x18,%eax 387: cd 40 int $0x40 389: c3 ret 0000038a <get_max_pid>: SYSCALL(get_max_pid) 38a: b8 19 00 00 00 mov $0x19,%eax 38f: cd 40 int $0x40 391: c3 ret 00000392 <get_proc_info>: SYSCALL(get_proc_info) 392: b8 1a 00 00 00 mov $0x1a,%eax 397: cd 40 int $0x40 399: c3 ret 0000039a <set_prio>: SYSCALL(set_prio) 39a: b8 1b 00 00 00 mov $0x1b,%eax 39f: cd 40 int $0x40 3a1: c3 ret 000003a2 <get_prio>: SYSCALL(get_prio) 3a2: b8 1c 00 00 00 mov $0x1c,%eax 3a7: cd 40 int $0x40 3a9: c3 ret 3aa: 66 90 xchg %ax,%ax 3ac: 66 90 xchg %ax,%ax 3ae: 66 90 xchg %ax,%ax 000003b0 <printint>: write(fd, &c, 1); } static void printint(int fd, int xx, int base, int sgn) { 3b0: 55 push %ebp 3b1: 89 e5 mov %esp,%ebp 3b3: 57 push %edi 3b4: 56 push %esi 3b5: 53 push %ebx 3b6: 83 ec 3c sub $0x3c,%esp char buf[16]; int i, neg; uint x; neg = 0; if(sgn && xx < 0){ 3b9: 85 d2 test %edx,%edx { 3bb: 89 45 c0 mov %eax,-0x40(%ebp) neg = 1; x = -xx; 3be: 89 d0 mov %edx,%eax if(sgn && xx < 0){ 3c0: 79 76 jns 438 <printint+0x88> 3c2: f6 45 08 01 testb $0x1,0x8(%ebp) 3c6: 74 70 je 438 <printint+0x88> x = -xx; 3c8: f7 d8 neg %eax neg = 1; 3ca: c7 45 c4 01 00 00 00 movl $0x1,-0x3c(%ebp) } else { x = xx; } i = 0; 3d1: 31 f6 xor %esi,%esi 3d3: 8d 5d d7 lea -0x29(%ebp),%ebx 3d6: eb 0a jmp 3e2 <printint+0x32> 3d8: 90 nop 3d9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi do{ buf[i++] = digits[x % base]; 3e0: 89 fe mov %edi,%esi 3e2: 31 d2 xor %edx,%edx 3e4: 8d 7e 01 lea 0x1(%esi),%edi 3e7: f7 f1 div %ecx 3e9: 0f b6 92 e4 07 00 00 movzbl 0x7e4(%edx),%edx }while((x /= base) != 0); 3f0: 85 c0 test %eax,%eax buf[i++] = digits[x % base]; 3f2: 88 14 3b mov %dl,(%ebx,%edi,1) }while((x /= base) != 0); 3f5: 75 e9 jne 3e0 <printint+0x30> if(neg) 3f7: 8b 45 c4 mov -0x3c(%ebp),%eax 3fa: 85 c0 test %eax,%eax 3fc: 74 08 je 406 <printint+0x56> buf[i++] = '-'; 3fe: c6 44 3d d8 2d movb $0x2d,-0x28(%ebp,%edi,1) 403: 8d 7e 02 lea 0x2(%esi),%edi 406: 8d 74 3d d7 lea -0x29(%ebp,%edi,1),%esi 40a: 8b 7d c0 mov -0x40(%ebp),%edi 40d: 8d 76 00 lea 0x0(%esi),%esi 410: 0f b6 06 movzbl (%esi),%eax write(fd, &c, 1); 413: 83 ec 04 sub $0x4,%esp 416: 83 ee 01 sub $0x1,%esi 419: 6a 01 push $0x1 41b: 53 push %ebx 41c: 57 push %edi 41d: 88 45 d7 mov %al,-0x29(%ebp) 420: e8 cd fe ff ff call 2f2 <write> while(--i >= 0) 425: 83 c4 10 add $0x10,%esp 428: 39 de cmp %ebx,%esi 42a: 75 e4 jne 410 <printint+0x60> putc(fd, buf[i]); } 42c: 8d 65 f4 lea -0xc(%ebp),%esp 42f: 5b pop %ebx 430: 5e pop %esi 431: 5f pop %edi 432: 5d pop %ebp 433: c3 ret 434: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi neg = 0; 438: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp) 43f: eb 90 jmp 3d1 <printint+0x21> 441: eb 0d jmp 450 <printf> 443: 90 nop 444: 90 nop 445: 90 nop 446: 90 nop 447: 90 nop 448: 90 nop 449: 90 nop 44a: 90 nop 44b: 90 nop 44c: 90 nop 44d: 90 nop 44e: 90 nop 44f: 90 nop 00000450 <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, const char *fmt, ...) { 450: 55 push %ebp 451: 89 e5 mov %esp,%ebp 453: 57 push %edi 454: 56 push %esi 455: 53 push %ebx 456: 83 ec 2c sub $0x2c,%esp int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 459: 8b 75 0c mov 0xc(%ebp),%esi 45c: 0f b6 1e movzbl (%esi),%ebx 45f: 84 db test %bl,%bl 461: 0f 84 b3 00 00 00 je 51a <printf+0xca> ap = (uint*)(void*)&fmt + 1; 467: 8d 45 10 lea 0x10(%ebp),%eax 46a: 83 c6 01 add $0x1,%esi state = 0; 46d: 31 ff xor %edi,%edi ap = (uint*)(void*)&fmt + 1; 46f: 89 45 d4 mov %eax,-0x2c(%ebp) 472: eb 2f jmp 4a3 <printf+0x53> 474: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi c = fmt[i] & 0xff; if(state == 0){ if(c == '%'){ 478: 83 f8 25 cmp $0x25,%eax 47b: 0f 84 a7 00 00 00 je 528 <printf+0xd8> write(fd, &c, 1); 481: 8d 45 e2 lea -0x1e(%ebp),%eax 484: 83 ec 04 sub $0x4,%esp 487: 88 5d e2 mov %bl,-0x1e(%ebp) 48a: 6a 01 push $0x1 48c: 50 push %eax 48d: ff 75 08 pushl 0x8(%ebp) 490: e8 5d fe ff ff call 2f2 <write> 495: 83 c4 10 add $0x10,%esp 498: 83 c6 01 add $0x1,%esi for(i = 0; fmt[i]; i++){ 49b: 0f b6 5e ff movzbl -0x1(%esi),%ebx 49f: 84 db test %bl,%bl 4a1: 74 77 je 51a <printf+0xca> if(state == 0){ 4a3: 85 ff test %edi,%edi c = fmt[i] & 0xff; 4a5: 0f be cb movsbl %bl,%ecx 4a8: 0f b6 c3 movzbl %bl,%eax if(state == 0){ 4ab: 74 cb je 478 <printf+0x28> state = '%'; } else { putc(fd, c); } } else if(state == '%'){ 4ad: 83 ff 25 cmp $0x25,%edi 4b0: 75 e6 jne 498 <printf+0x48> if(c == 'd'){ 4b2: 83 f8 64 cmp $0x64,%eax 4b5: 0f 84 05 01 00 00 je 5c0 <printf+0x170> printint(fd, *ap, 10, 1); ap++; } else if(c == 'x' || c == 'p'){ 4bb: 81 e1 f7 00 00 00 and $0xf7,%ecx 4c1: 83 f9 70 cmp $0x70,%ecx 4c4: 74 72 je 538 <printf+0xe8> printint(fd, *ap, 16, 0); ap++; } else if(c == 's'){ 4c6: 83 f8 73 cmp $0x73,%eax 4c9: 0f 84 99 00 00 00 je 568 <printf+0x118> s = "(null)"; while(*s != 0){ putc(fd, *s); s++; } } else if(c == 'c'){ 4cf: 83 f8 63 cmp $0x63,%eax 4d2: 0f 84 08 01 00 00 je 5e0 <printf+0x190> putc(fd, *ap); ap++; } else if(c == '%'){ 4d8: 83 f8 25 cmp $0x25,%eax 4db: 0f 84 ef 00 00 00 je 5d0 <printf+0x180> write(fd, &c, 1); 4e1: 8d 45 e7 lea -0x19(%ebp),%eax 4e4: 83 ec 04 sub $0x4,%esp 4e7: c6 45 e7 25 movb $0x25,-0x19(%ebp) 4eb: 6a 01 push $0x1 4ed: 50 push %eax 4ee: ff 75 08 pushl 0x8(%ebp) 4f1: e8 fc fd ff ff call 2f2 <write> 4f6: 83 c4 0c add $0xc,%esp 4f9: 8d 45 e6 lea -0x1a(%ebp),%eax 4fc: 88 5d e6 mov %bl,-0x1a(%ebp) 4ff: 6a 01 push $0x1 501: 50 push %eax 502: ff 75 08 pushl 0x8(%ebp) 505: 83 c6 01 add $0x1,%esi } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); putc(fd, c); } state = 0; 508: 31 ff xor %edi,%edi write(fd, &c, 1); 50a: e8 e3 fd ff ff call 2f2 <write> for(i = 0; fmt[i]; i++){ 50f: 0f b6 5e ff movzbl -0x1(%esi),%ebx write(fd, &c, 1); 513: 83 c4 10 add $0x10,%esp for(i = 0; fmt[i]; i++){ 516: 84 db test %bl,%bl 518: 75 89 jne 4a3 <printf+0x53> } } } 51a: 8d 65 f4 lea -0xc(%ebp),%esp 51d: 5b pop %ebx 51e: 5e pop %esi 51f: 5f pop %edi 520: 5d pop %ebp 521: c3 ret 522: 8d b6 00 00 00 00 lea 0x0(%esi),%esi state = '%'; 528: bf 25 00 00 00 mov $0x25,%edi 52d: e9 66 ff ff ff jmp 498 <printf+0x48> 532: 8d b6 00 00 00 00 lea 0x0(%esi),%esi printint(fd, *ap, 16, 0); 538: 83 ec 0c sub $0xc,%esp 53b: b9 10 00 00 00 mov $0x10,%ecx 540: 6a 00 push $0x0 542: 8b 7d d4 mov -0x2c(%ebp),%edi 545: 8b 45 08 mov 0x8(%ebp),%eax 548: 8b 17 mov (%edi),%edx 54a: e8 61 fe ff ff call 3b0 <printint> ap++; 54f: 89 f8 mov %edi,%eax 551: 83 c4 10 add $0x10,%esp state = 0; 554: 31 ff xor %edi,%edi ap++; 556: 83 c0 04 add $0x4,%eax 559: 89 45 d4 mov %eax,-0x2c(%ebp) 55c: e9 37 ff ff ff jmp 498 <printf+0x48> 561: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi s = (char*)*ap; 568: 8b 45 d4 mov -0x2c(%ebp),%eax 56b: 8b 08 mov (%eax),%ecx ap++; 56d: 83 c0 04 add $0x4,%eax 570: 89 45 d4 mov %eax,-0x2c(%ebp) if(s == 0) 573: 85 c9 test %ecx,%ecx 575: 0f 84 8e 00 00 00 je 609 <printf+0x1b9> while(*s != 0){ 57b: 0f b6 01 movzbl (%ecx),%eax state = 0; 57e: 31 ff xor %edi,%edi s = (char*)*ap; 580: 89 cb mov %ecx,%ebx while(*s != 0){ 582: 84 c0 test %al,%al 584: 0f 84 0e ff ff ff je 498 <printf+0x48> 58a: 89 75 d0 mov %esi,-0x30(%ebp) 58d: 89 de mov %ebx,%esi 58f: 8b 5d 08 mov 0x8(%ebp),%ebx 592: 8d 7d e3 lea -0x1d(%ebp),%edi 595: 8d 76 00 lea 0x0(%esi),%esi write(fd, &c, 1); 598: 83 ec 04 sub $0x4,%esp s++; 59b: 83 c6 01 add $0x1,%esi 59e: 88 45 e3 mov %al,-0x1d(%ebp) write(fd, &c, 1); 5a1: 6a 01 push $0x1 5a3: 57 push %edi 5a4: 53 push %ebx 5a5: e8 48 fd ff ff call 2f2 <write> while(*s != 0){ 5aa: 0f b6 06 movzbl (%esi),%eax 5ad: 83 c4 10 add $0x10,%esp 5b0: 84 c0 test %al,%al 5b2: 75 e4 jne 598 <printf+0x148> 5b4: 8b 75 d0 mov -0x30(%ebp),%esi state = 0; 5b7: 31 ff xor %edi,%edi 5b9: e9 da fe ff ff jmp 498 <printf+0x48> 5be: 66 90 xchg %ax,%ax printint(fd, *ap, 10, 1); 5c0: 83 ec 0c sub $0xc,%esp 5c3: b9 0a 00 00 00 mov $0xa,%ecx 5c8: 6a 01 push $0x1 5ca: e9 73 ff ff ff jmp 542 <printf+0xf2> 5cf: 90 nop write(fd, &c, 1); 5d0: 83 ec 04 sub $0x4,%esp 5d3: 88 5d e5 mov %bl,-0x1b(%ebp) 5d6: 8d 45 e5 lea -0x1b(%ebp),%eax 5d9: 6a 01 push $0x1 5db: e9 21 ff ff ff jmp 501 <printf+0xb1> putc(fd, *ap); 5e0: 8b 7d d4 mov -0x2c(%ebp),%edi write(fd, &c, 1); 5e3: 83 ec 04 sub $0x4,%esp putc(fd, *ap); 5e6: 8b 07 mov (%edi),%eax write(fd, &c, 1); 5e8: 6a 01 push $0x1 ap++; 5ea: 83 c7 04 add $0x4,%edi putc(fd, *ap); 5ed: 88 45 e4 mov %al,-0x1c(%ebp) write(fd, &c, 1); 5f0: 8d 45 e4 lea -0x1c(%ebp),%eax 5f3: 50 push %eax 5f4: ff 75 08 pushl 0x8(%ebp) 5f7: e8 f6 fc ff ff call 2f2 <write> ap++; 5fc: 89 7d d4 mov %edi,-0x2c(%ebp) 5ff: 83 c4 10 add $0x10,%esp state = 0; 602: 31 ff xor %edi,%edi 604: e9 8f fe ff ff jmp 498 <printf+0x48> s = "(null)"; 609: bb db 07 00 00 mov $0x7db,%ebx while(*s != 0){ 60e: b8 28 00 00 00 mov $0x28,%eax 613: e9 72 ff ff ff jmp 58a <printf+0x13a> 618: 66 90 xchg %ax,%ax 61a: 66 90 xchg %ax,%ax 61c: 66 90 xchg %ax,%ax 61e: 66 90 xchg %ax,%ax 00000620 <free>: static Header base; static Header *freep; void free(void *ap) { 620: 55 push %ebp Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 621: a1 94 0a 00 00 mov 0xa94,%eax { 626: 89 e5 mov %esp,%ebp 628: 57 push %edi 629: 56 push %esi 62a: 53 push %ebx 62b: 8b 5d 08 mov 0x8(%ebp),%ebx bp = (Header*)ap - 1; 62e: 8d 4b f8 lea -0x8(%ebx),%ecx 631: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 638: 39 c8 cmp %ecx,%eax 63a: 8b 10 mov (%eax),%edx 63c: 73 32 jae 670 <free+0x50> 63e: 39 d1 cmp %edx,%ecx 640: 72 04 jb 646 <free+0x26> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 642: 39 d0 cmp %edx,%eax 644: 72 32 jb 678 <free+0x58> break; if(bp + bp->s.size == p->s.ptr){ 646: 8b 73 fc mov -0x4(%ebx),%esi 649: 8d 3c f1 lea (%ecx,%esi,8),%edi 64c: 39 fa cmp %edi,%edx 64e: 74 30 je 680 <free+0x60> bp->s.size += p->s.ptr->s.size; bp->s.ptr = p->s.ptr->s.ptr; } else bp->s.ptr = p->s.ptr; 650: 89 53 f8 mov %edx,-0x8(%ebx) if(p + p->s.size == bp){ 653: 8b 50 04 mov 0x4(%eax),%edx 656: 8d 34 d0 lea (%eax,%edx,8),%esi 659: 39 f1 cmp %esi,%ecx 65b: 74 3a je 697 <free+0x77> p->s.size += bp->s.size; p->s.ptr = bp->s.ptr; } else p->s.ptr = bp; 65d: 89 08 mov %ecx,(%eax) freep = p; 65f: a3 94 0a 00 00 mov %eax,0xa94 } 664: 5b pop %ebx 665: 5e pop %esi 666: 5f pop %edi 667: 5d pop %ebp 668: c3 ret 669: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 670: 39 d0 cmp %edx,%eax 672: 72 04 jb 678 <free+0x58> 674: 39 d1 cmp %edx,%ecx 676: 72 ce jb 646 <free+0x26> { 678: 89 d0 mov %edx,%eax 67a: eb bc jmp 638 <free+0x18> 67c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi bp->s.size += p->s.ptr->s.size; 680: 03 72 04 add 0x4(%edx),%esi 683: 89 73 fc mov %esi,-0x4(%ebx) bp->s.ptr = p->s.ptr->s.ptr; 686: 8b 10 mov (%eax),%edx 688: 8b 12 mov (%edx),%edx 68a: 89 53 f8 mov %edx,-0x8(%ebx) if(p + p->s.size == bp){ 68d: 8b 50 04 mov 0x4(%eax),%edx 690: 8d 34 d0 lea (%eax,%edx,8),%esi 693: 39 f1 cmp %esi,%ecx 695: 75 c6 jne 65d <free+0x3d> p->s.size += bp->s.size; 697: 03 53 fc add -0x4(%ebx),%edx freep = p; 69a: a3 94 0a 00 00 mov %eax,0xa94 p->s.size += bp->s.size; 69f: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 6a2: 8b 53 f8 mov -0x8(%ebx),%edx 6a5: 89 10 mov %edx,(%eax) } 6a7: 5b pop %ebx 6a8: 5e pop %esi 6a9: 5f pop %edi 6aa: 5d pop %ebp 6ab: c3 ret 6ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 000006b0 <malloc>: return freep; } void* malloc(uint nbytes) { 6b0: 55 push %ebp 6b1: 89 e5 mov %esp,%ebp 6b3: 57 push %edi 6b4: 56 push %esi 6b5: 53 push %ebx 6b6: 83 ec 0c sub $0xc,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 6b9: 8b 45 08 mov 0x8(%ebp),%eax if((prevp = freep) == 0){ 6bc: 8b 15 94 0a 00 00 mov 0xa94,%edx nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 6c2: 8d 78 07 lea 0x7(%eax),%edi 6c5: c1 ef 03 shr $0x3,%edi 6c8: 83 c7 01 add $0x1,%edi if((prevp = freep) == 0){ 6cb: 85 d2 test %edx,%edx 6cd: 0f 84 9d 00 00 00 je 770 <malloc+0xc0> 6d3: 8b 02 mov (%edx),%eax 6d5: 8b 48 04 mov 0x4(%eax),%ecx base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ if(p->s.size >= nunits){ 6d8: 39 cf cmp %ecx,%edi 6da: 76 6c jbe 748 <malloc+0x98> 6dc: 81 ff 00 10 00 00 cmp $0x1000,%edi 6e2: bb 00 10 00 00 mov $0x1000,%ebx 6e7: 0f 43 df cmovae %edi,%ebx p = sbrk(nu * sizeof(Header)); 6ea: 8d 34 dd 00 00 00 00 lea 0x0(,%ebx,8),%esi 6f1: eb 0e jmp 701 <malloc+0x51> 6f3: 90 nop 6f4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 6f8: 8b 02 mov (%edx),%eax if(p->s.size >= nunits){ 6fa: 8b 48 04 mov 0x4(%eax),%ecx 6fd: 39 f9 cmp %edi,%ecx 6ff: 73 47 jae 748 <malloc+0x98> p->s.size = nunits; } freep = prevp; return (void*)(p + 1); } if(p == freep) 701: 39 05 94 0a 00 00 cmp %eax,0xa94 707: 89 c2 mov %eax,%edx 709: 75 ed jne 6f8 <malloc+0x48> p = sbrk(nu * sizeof(Header)); 70b: 83 ec 0c sub $0xc,%esp 70e: 56 push %esi 70f: e8 46 fc ff ff call 35a <sbrk> if(p == (char*)-1) 714: 83 c4 10 add $0x10,%esp 717: 83 f8 ff cmp $0xffffffff,%eax 71a: 74 1c je 738 <malloc+0x88> hp->s.size = nu; 71c: 89 58 04 mov %ebx,0x4(%eax) free((void*)(hp + 1)); 71f: 83 ec 0c sub $0xc,%esp 722: 83 c0 08 add $0x8,%eax 725: 50 push %eax 726: e8 f5 fe ff ff call 620 <free> return freep; 72b: 8b 15 94 0a 00 00 mov 0xa94,%edx if((p = morecore(nunits)) == 0) 731: 83 c4 10 add $0x10,%esp 734: 85 d2 test %edx,%edx 736: 75 c0 jne 6f8 <malloc+0x48> return 0; } } 738: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 73b: 31 c0 xor %eax,%eax } 73d: 5b pop %ebx 73e: 5e pop %esi 73f: 5f pop %edi 740: 5d pop %ebp 741: c3 ret 742: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(p->s.size == nunits) 748: 39 cf cmp %ecx,%edi 74a: 74 54 je 7a0 <malloc+0xf0> p->s.size -= nunits; 74c: 29 f9 sub %edi,%ecx 74e: 89 48 04 mov %ecx,0x4(%eax) p += p->s.size; 751: 8d 04 c8 lea (%eax,%ecx,8),%eax p->s.size = nunits; 754: 89 78 04 mov %edi,0x4(%eax) freep = prevp; 757: 89 15 94 0a 00 00 mov %edx,0xa94 } 75d: 8d 65 f4 lea -0xc(%ebp),%esp return (void*)(p + 1); 760: 83 c0 08 add $0x8,%eax } 763: 5b pop %ebx 764: 5e pop %esi 765: 5f pop %edi 766: 5d pop %ebp 767: c3 ret 768: 90 nop 769: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi base.s.ptr = freep = prevp = &base; 770: c7 05 94 0a 00 00 98 movl $0xa98,0xa94 777: 0a 00 00 77a: c7 05 98 0a 00 00 98 movl $0xa98,0xa98 781: 0a 00 00 base.s.size = 0; 784: b8 98 0a 00 00 mov $0xa98,%eax 789: c7 05 9c 0a 00 00 00 movl $0x0,0xa9c 790: 00 00 00 793: e9 44 ff ff ff jmp 6dc <malloc+0x2c> 798: 90 nop 799: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi prevp->s.ptr = p->s.ptr; 7a0: 8b 08 mov (%eax),%ecx 7a2: 89 0a mov %ecx,(%edx) 7a4: eb b1 jmp 757 <malloc+0xa7>
programs/oeis/179/A179088.asm
karttu/loda
1
22310
; A179088: Positive integers of the form (2*m^2+1)/11. ; 3,9,41,59,123,153,249,291,419,473,633,699,891,969,1193,1283,1539,1641,1929,2043,2363,2489,2841,2979,3363,3513,3929,4091,4539,4713,5193,5379,5891,6089,6633,6843,7419,7641,8249,8483,9123,9369,10041,10299,11003,11273,12009,12291,13059,13353,14153,14459,15291,15609,16473,16803,17699,18041,18969,19323,20283,20649,21641,22019,23043,23433,24489,24891,25979,26393,27513,27939,29091,29529,30713,31163,32379,32841,34089,34563,35843,36329,37641,38139,39483,39993,41369,41891,43299,43833,45273,45819,47291,47849,49353,49923,51459,52041,53609,54203,55803,56409,58041,58659,60323,60953,62649,63291,65019,65673,67433,68099,69891,70569,72393,73083,74939,75641,77529,78243,80163,80889,82841,83579,85563,86313,88329,89091,91139,91913,93993,94779,96891,97689,99833,100643,102819,103641,105849,106683,108923,109769,112041,112899,115203,116073,118409,119291,121659,122553,124953,125859,128291,129209,131673,132603,135099,136041,138569,139523,142083,143049,145641,146619,149243,150233,152889,153891,156579,157593,160313,161339,164091,165129,167913,168963,171779,172841,175689,176763,179643,180729,183641,184739,187683,188793,191769,192891,195899,197033,200073,201219,204291,205449,208553,209723,212859,214041,217209,218403,221603,222809,226041,227259,230523,231753,235049,236291,239619,240873,244233,245499,248891,250169,253593,254883,258339,259641,263129,264443,267963,269289,272841,274179,277763,279113,282729,284091,287739,289113,292793,294179,297891,299289,303033,304443,308219,309641,313449,314883,318723,320169,324041,325499,329403,330873,334809,336291,340259,341753 mov $2,$0 mov $3,$0 div $0,2 mov $8,$3 mov $3,$0 pow $3,2 add $3,$0 mov $1,$3 mul $1,10 add $8,$1 mov $5,$8 add $5,1 mov $6,2 add $6,$5 mov $1,$6 mov $4,$2 mul $4,2 add $1,$4 mov $7,$2 mul $7,$2 mov $4,$7 mul $4,3 add $1,$4
_posts/code/BlockOrdering/foo_fall_through.asm
dendibakh/dendibakh.github.io
45
4157
%define nop8 db 0x0F, 0x1F, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00 %macro cache_line 0 nop8 nop8 nop8 nop8 nop8 nop8 nop8 nop8 %endmacro GLOBAL foo ALIGN 256 foo: ; This number of nops was adjusted in a way to align hot loops in both cases at a 64 bytes boundary ; Hot loops should have the same alignment, otherwise comparison will not be equal. cache_line cache_line cache_line nop8 nop8 nop8 nop8 nop8 nop8 nop8 nop nop cmp rdi, 0 jnz .cold .hot: dec rsi jnz .hot .merge: ret ud2 .cold: call err_handler jmp .merge ud2 err_handler: cache_line cache_line cache_line cache_line ret
gcc-gcc-7_3_0-release/gcc/ada/mlib-tgt-specific-xi.adb
best08618/asylo
7
26737
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- M L I B . T G T. S P E C I F I C -- -- -- -- B o d y -- -- -- -- Copyright (C) 2003-2011, 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 is the bare board version of the body with Sdefault; with Types; use Types; package body MLib.Tgt.Specific is ----------------------- -- Local Subprograms -- ----------------------- function Get_Target_Prefix return String; -- Returns the required prefix for some utilities -- (such as ar and ranlib) that depend on the real target. -- Non default subprograms function Archive_Builder return String; function Archive_Indexer return String; procedure Build_Dynamic_Library (Ofiles : Argument_List; Options : Argument_List; Interfaces : Argument_List; Lib_Filename : String; Lib_Dir : String; Symbol_Data : Symbol_Record; Driver_Name : Name_Id := No_Name; Lib_Version : String := ""; Auto_Init : Boolean := False); function DLL_Ext return String; function Dynamic_Option return String; function Library_Major_Minor_Id_Supported return Boolean; function PIC_Option return String; function Standalone_Library_Auto_Init_Is_Supported return Boolean; function Support_For_Libraries return Library_Support; --------------------- -- Archive_Builder -- --------------------- function Archive_Builder return String is begin return Get_Target_Prefix & "ar"; end Archive_Builder; --------------------- -- Archive_Indexer -- --------------------- function Archive_Indexer return String is begin return Get_Target_Prefix & "ranlib"; end Archive_Indexer; --------------------------- -- Build_Dynamic_Library -- --------------------------- procedure Build_Dynamic_Library (Ofiles : Argument_List; Options : Argument_List; Interfaces : Argument_List; Lib_Filename : String; Lib_Dir : String; Symbol_Data : Symbol_Record; Driver_Name : Name_Id := No_Name; Lib_Version : String := ""; Auto_Init : Boolean := False) is pragma Unreferenced (Ofiles); pragma Unreferenced (Options); pragma Unreferenced (Interfaces); pragma Unreferenced (Lib_Filename); pragma Unreferenced (Lib_Dir); pragma Unreferenced (Symbol_Data); pragma Unreferenced (Driver_Name); pragma Unreferenced (Lib_Version); pragma Unreferenced (Auto_Init); begin null; end Build_Dynamic_Library; ------------- -- DLL_Ext -- ------------- function DLL_Ext return String is begin return ""; end DLL_Ext; -------------------- -- Dynamic_Option -- -------------------- function Dynamic_Option return String is begin return ""; end Dynamic_Option; ----------------------- -- Get_Target_Prefix -- ----------------------- function Get_Target_Prefix return String is Target_Name : constant String_Ptr := Sdefault.Target_Name; begin -- Target_name is the program prefix without '-' but with a trailing '/' return Target_Name (Target_Name'First .. Target_Name'Last - 1) & '-'; end Get_Target_Prefix; -------------------------------------- -- Library_Major_Minor_Id_Supported -- -------------------------------------- function Library_Major_Minor_Id_Supported return Boolean is begin return False; end Library_Major_Minor_Id_Supported; ---------------- -- PIC_Option -- ---------------- function PIC_Option return String is begin return ""; end PIC_Option; ----------------------------------------------- -- Standalone_Library_Auto_Init_Is_Supported -- ----------------------------------------------- function Standalone_Library_Auto_Init_Is_Supported return Boolean is begin return False; end Standalone_Library_Auto_Init_Is_Supported; --------------------------- -- Support_For_Libraries -- --------------------------- function Support_For_Libraries return Library_Support is begin return Static_Only; end Support_For_Libraries; begin Archive_Builder_Ptr := Archive_Builder'Access; Archive_Indexer_Ptr := Archive_Indexer'Access; Build_Dynamic_Library_Ptr := Build_Dynamic_Library'Access; DLL_Ext_Ptr := DLL_Ext'Access; Dynamic_Option_Ptr := Dynamic_Option'Access; Library_Major_Minor_Id_Supported_Ptr := Library_Major_Minor_Id_Supported'Access; PIC_Option_Ptr := PIC_Option'Access; Standalone_Library_Auto_Init_Is_Supported_Ptr := Standalone_Library_Auto_Init_Is_Supported'Access; Support_For_Libraries_Ptr := Support_For_Libraries'Access; end MLib.Tgt.Specific;
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0.log_21829_1521.asm
ljhsiun2/medusa
9
9027
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r13 push %r14 push %r8 push %rcx push %rdi push %rsi lea addresses_UC_ht+0xdbe2, %r8 nop nop inc %r14 movw $0x6162, (%r8) nop inc %r13 lea addresses_WC_ht+0x1706e, %rsi lea addresses_WT_ht+0x122ee, %rdi nop xor $64638, %r11 mov $108, %rcx rep movsw and %rcx, %rcx lea addresses_A_ht+0x1786e, %r13 clflush (%r13) nop nop nop add $5959, %rdi mov $0x6162636465666768, %rcx movq %rcx, %xmm3 movups %xmm3, (%r13) nop nop nop nop nop and %r14, %r14 lea addresses_WC_ht+0x746e, %rsi lea addresses_UC_ht+0x1516e, %rdi nop nop nop nop nop and %r10, %r10 mov $94, %rcx rep movsw nop cmp $61850, %r8 lea addresses_UC_ht+0x13b04, %r13 nop nop nop nop nop sub $55209, %r8 movups (%r13), %xmm3 vpextrq $1, %xmm3, %rsi and %r13, %r13 lea addresses_UC_ht+0x18b8e, %r11 nop nop xor $4837, %r10 movb (%r11), %r14b nop nop add %rsi, %rsi lea addresses_normal_ht+0x71ee, %rsi nop nop nop nop add %r11, %r11 movb $0x61, (%rsi) nop nop nop nop nop cmp %r10, %r10 lea addresses_A_ht+0x2f2e, %r10 nop sub %r11, %r11 mov $0x6162636465666768, %r8 movq %r8, (%r10) add $37211, %r13 lea addresses_normal_ht+0x1445e, %r13 nop and $39052, %r14 mov $0x6162636465666768, %rdi movq %rdi, %xmm7 movups %xmm7, (%r13) sub %rdi, %rdi lea addresses_UC_ht+0x1c12e, %rsi nop nop nop nop nop inc %rdi movb (%rsi), %r11b nop xor %r14, %r14 lea addresses_D_ht+0xf46e, %r10 nop nop nop xor $20847, %r14 mov (%r10), %rsi nop nop nop dec %rsi lea addresses_WC_ht+0x113ee, %rsi lea addresses_UC_ht+0x1e306, %rdi nop nop nop add %r14, %r14 mov $47, %rcx rep movsl add %rdi, %rdi lea addresses_D_ht+0xa11e, %rsi lea addresses_normal_ht+0xa06e, %rdi xor %r10, %r10 mov $109, %rcx rep movsw nop nop xor $56122, %r14 lea addresses_WT_ht+0x10372, %r13 sub $45880, %r10 movl $0x61626364, (%r13) nop nop nop nop xor $3844, %r14 lea addresses_WT_ht+0x1d76e, %rsi lea addresses_D_ht+0xc66e, %rdi nop nop nop nop nop add $27348, %r14 mov $64, %rcx rep movsw nop nop and $25888, %r13 pop %rsi pop %rdi pop %rcx pop %r8 pop %r14 pop %r13 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r13 push %rbp push %rdi push %rdx // Faulty Load lea addresses_D+0xe86e, %rdi nop nop nop inc %r10 mov (%rdi), %ebp lea oracles, %rdx and $0xff, %rbp shlq $12, %rbp mov (%rdx,%rbp,1), %rbp pop %rdx pop %rdi pop %rbp pop %r13 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_D', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'} [Faulty Load] {'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_D', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 2}} {'src': {'same': False, 'congruent': 9, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 2, 'type': 'addresses_WT_ht'}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 16}} {'src': {'same': False, 'congruent': 10, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 8, 'type': 'addresses_UC_ht'}} {'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'} {'src': {'NT': False, 'same': False, 'congruent': 3, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 1}} {'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 4, 'type': 'addresses_A_ht', 'AVXalign': True, 'size': 8}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 16}} {'src': {'NT': False, 'same': False, 'congruent': 6, 'type': 'addresses_UC_ht', 'AVXalign': True, 'size': 1}, 'OP': 'LOAD'} {'src': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 6, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_UC_ht'}} {'src': {'same': False, 'congruent': 4, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'same': True, 'congruent': 8, 'type': 'addresses_normal_ht'}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 4}} {'src': {'same': False, 'congruent': 8, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 8, 'type': 'addresses_D_ht'}} {'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 */
Transynther/x86/_processed/AVXALIGN/_st_/i3-7100_9_0x84_notsx.log_21829_2390.asm
ljhsiun2/medusa
9
173133
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r15 push %rax push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_normal_ht+0x1c801, %r15 nop nop nop nop nop inc %rcx mov $0x6162636465666768, %rdx movq %rdx, %xmm2 movups %xmm2, (%r15) and $63523, %rbx lea addresses_normal_ht+0x4841, %r10 nop nop nop nop dec %rax vmovups (%r10), %ymm2 vextracti128 $1, %ymm2, %xmm2 vpextrq $0, %xmm2, %rcx nop nop and %rcx, %rcx lea addresses_UC_ht+0x9241, %rsi lea addresses_WC_ht+0x97c1, %rdi nop nop nop nop sub $3421, %rax mov $29, %rcx rep movsb nop nop nop inc %rbx lea addresses_A_ht+0x17141, %rax nop nop and $7709, %r10 mov (%rax), %dx nop nop inc %rbx lea addresses_D_ht+0xa441, %rsi lea addresses_D_ht+0x115c1, %rdi nop nop nop nop nop dec %rbx mov $60, %rcx rep movsl nop nop dec %rsi lea addresses_UC_ht+0x11c41, %r10 nop nop nop nop add $3942, %rbx movw $0x6162, (%r10) nop nop dec %rdx lea addresses_normal_ht+0x41c1, %rdx nop nop inc %r10 mov (%rdx), %esi nop nop nop nop nop cmp %rdx, %rdx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %rax pop %r15 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r13 push %r8 push %rbx push %rcx push %rdx // Load lea addresses_RW+0xfbd5, %rcx nop add $36425, %r10 mov (%rcx), %r8 nop nop nop and $49689, %r10 // Store lea addresses_normal+0x4ac1, %r8 nop nop sub $49063, %r12 movl $0x51525354, (%r8) // Exception!!! nop nop nop nop nop mov (0), %r10 nop add $2372, %r13 // Store mov $0x601, %rdx nop nop nop dec %r13 movw $0x5152, (%rdx) inc %rdx // Load lea addresses_US+0x774d, %r10 nop xor %r8, %r8 vmovups (%r10), %ymm6 vextracti128 $1, %ymm6, %xmm6 vpextrq $1, %xmm6, %rdx nop inc %r12 // Store lea addresses_RW+0x9c41, %r10 nop nop nop nop add $6910, %rbx movb $0x51, (%r10) nop nop nop nop nop cmp %r8, %r8 // Faulty Load lea addresses_D+0x2441, %r8 nop nop nop nop add $43788, %r13 movb (%r8), %r10b lea oracles, %r8 and $0xff, %r10 shlq $12, %r10 mov (%r8,%r10,1), %r10 pop %rdx pop %rcx pop %rbx pop %r8 pop %r13 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_D', 'same': False, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_RW', 'same': False, 'size': 8, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_normal', 'same': False, 'size': 4, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_P', 'same': False, 'size': 2, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_US', 'same': False, 'size': 32, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_RW', 'same': False, 'size': 1, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} [Faulty Load] {'src': {'type': 'addresses_D', 'same': True, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'} <gen_prepare_buffer> {'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 16, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 32, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_A_ht', 'same': False, 'size': 2, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 6, 'same': True}, 'OP': 'REPM'} {'dst': {'type': 'addresses_UC_ht', 'same': True, 'size': 2, 'congruent': 10, 'NT': True, 'AVXalign': True}, 'OP': 'STOR'} {'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 4, 'congruent': 7, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'} {'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 */
tools/aflex/src/tblcmp.adb
svn2github/matreshka
24
20747
<reponame>svn2github/matreshka -- Copyright (c) 1990 Regents of the University of California. -- All rights reserved. -- -- This software was developed by <NAME> of the Arcadia project -- at the University of California, Irvine. -- -- Redistribution and use in source and binary forms are permitted -- provided that the above copyright notice and this paragraph are -- duplicated in all such forms and that any documentation, -- advertising materials, and other materials related to such -- distribution and use acknowledge that the software was developed -- by the University of California, Irvine. The name of the -- University may not be used to endorse or promote products derived -- from this software without specific prior written permission. -- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR -- IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED -- WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. -- TITLE table compression routines -- AUTHOR: <NAME> (UCI) -- DESCRIPTION used for compressed tables only -- NOTES somewhat complicated but works fast and generates efficient scanners -- $Header: /co/ua/self/arcadia/aflex/ada/src/RCS/tblcmpB.a,v 1.8 90/01/12 15:20:43 self Exp Locker: self $ with Ada.Unchecked_Deallocation; with DFA, ECS; with Unicode; package body TBLCMP is use Unicode; -- bldtbl - build table entries for dfa state -- -- synopsis -- int state[numecs], statenum, totaltrans, comstate, comfreq; -- bldtbl( state, statenum, totaltrans, comstate, comfreq ); -- -- State is the statenum'th dfa state. It is indexed by equivalence class and -- gives the number of the state to enter for a given equivalence class. -- totaltrans is the total number of transitions out of the state. Comstate -- is that state which is the destination of the most transitions out of State. -- Comfreq is how many transitions there are out of State to Comstate. -- -- A note on terminology: -- "protos" are transition tables which have a high probability of -- either being redundant (a state processed later will have an identical -- transition table) or nearly redundant (a state processed later will have -- many of the same out-transitions). A "most recently used" queue of -- protos is kept around with the hope that most states will find a proto -- which is similar enough to be usable, and therefore compacting the -- output tables. -- "templates" are a special type of proto. If a transition table is -- homogeneous or nearly homogeneous (all transitions go to the same -- destination) then the odds are good that future states will also go -- to the same destination state on basically the same character set. -- These homogeneous states are so common when dealing with large rule -- sets that they merit special attention. If the transition table were -- simply made into a proto, then (typically) each subsequent, similar -- state will differ from the proto for two out-transitions. One of these -- out-transitions will be that character on which the proto does not go -- to the common destination, and one will be that character on which the -- state does not go to the common destination. Templates, on the other -- hand, go to the common state on EVERY transition character, and therefore -- cost only one difference. procedure BLDTBL(STATE : in UNBOUNDED_INT_ARRAY; STATENUM, TOTALTRANS, COMSTATE, COMFREQ : in INTEGER) is subtype CARRAY is UNBOUNDED_INT_ARRAY(0 .. CSIZE + 1); type CARRAY_Access is access all CARRAY; procedure Free is new Ada.Unchecked_Deallocation (CARRAY, CARRAY_Access); EXTPTR : INTEGER; EXTRCT : array(0 .. 1) of CARRAY_Access := (new CARRAY, new CARRAY); MINDIFF, MINPROT, I, D : INTEGER; CHECKCOM : BOOLEAN; LOCAL_COMSTATE : INTEGER; begin -- If extptr is 0 then the first array of extrct holds the result of the -- "best difference" to date, which is those transitions which occur in -- "state" but not in the proto which, to date, has the fewest differences -- between itself and "state". If extptr is 1 then the second array of -- extrct hold the best difference. The two arrays are toggled -- between so that the best difference to date can be kept around and -- also a difference just created by checking against a candidate "best" -- proto. LOCAL_COMSTATE := COMSTATE; EXTPTR := 0; -- if the state has too few out-transitions, don't bother trying to -- compact its tables if ((TOTALTRANS*100) < (NUMECS*PROTO_SIZE_PERCENTAGE)) then MKENTRY(STATE, NUMECS, STATENUM, JAMSTATE_CONST, TOTALTRANS); else -- checkcom is true if we should only check "state" against -- protos which have the same "comstate" value CHECKCOM := COMFREQ*100 > TOTALTRANS*CHECK_COM_PERCENTAGE; MINPROT := FIRSTPROT; MINDIFF := TOTALTRANS; if (CHECKCOM) then -- find first proto which has the same "comstate" I := FIRSTPROT; while (I /= NIL) loop if (PROTCOMST(I) = LOCAL_COMSTATE) then MINPROT := I; TBLDIFF(STATE, MINPROT, EXTRCT (EXTPTR).all, MINDIFF); exit; end if; I := PROTNEXT(I); end loop; else -- since we've decided that the most common destination out -- of "state" does not occur with a high enough frequency, -- we set the "comstate" to zero, assuring that if this state -- is entered into the proto list, it will not be considered -- a template. LOCAL_COMSTATE := 0; if (FIRSTPROT /= NIL) then MINPROT := FIRSTPROT; TBLDIFF(STATE, MINPROT, EXTRCT (EXTPTR).all, MINDIFF); end if; end if; -- we now have the first interesting proto in "minprot". If -- it matches within the tolerances set for the first proto, -- we don't want to bother scanning the rest of the proto list -- to see if we have any other reasonable matches. if (MINDIFF*100 > TOTALTRANS*FIRST_MATCH_DIFF_PERCENTAGE) then -- not a good enough match. Scan the rest of the protos I := MINPROT; while (I /= NIL) loop TBLDIFF(STATE, I, EXTRCT (1 - EXTPTR).all, D); if (D < MINDIFF) then EXTPTR := 1 - EXTPTR; MINDIFF := D; MINPROT := I; end if; I := PROTNEXT(I); end loop; end if; -- check if the proto we've decided on as our best bet is close -- enough to the state we want to match to be usable if (MINDIFF*100 > TOTALTRANS*ACCEPTABLE_DIFF_PERCENTAGE) then -- no good. If the state is homogeneous enough, we make a -- template out of it. Otherwise, we make a proto. if (COMFREQ*100 >= TOTALTRANS*TEMPLATE_SAME_PERCENTAGE) then MKTEMPLATE(STATE, STATENUM, LOCAL_COMSTATE); else MKPROT(STATE, STATENUM, LOCAL_COMSTATE); MKENTRY(STATE, NUMECS, STATENUM, JAMSTATE_CONST, TOTALTRANS); end if; else -- use the proto MKENTRY (EXTRCT (EXTPTR).all, NUMECS, STATENUM, PROTTBL (MINPROT), MINDIFF); -- if this state was sufficiently different from the proto -- we built it from, make it, too, a proto if (MINDIFF*100 >= TOTALTRANS*NEW_PROTO_DIFF_PERCENTAGE) then MKPROT(STATE, STATENUM, LOCAL_COMSTATE); end if; -- since mkprot added a new proto to the proto queue, it's possible -- that "minprot" is no longer on the proto queue (if it happened -- to have been the last entry, it would have been bumped off). -- If it's not there, then the new proto took its physical place -- (though logically the new proto is at the beginning of the -- queue), so in that case the following call will do nothing. MV2FRONT(MINPROT); end if; end if; for J in EXTRCT'Range loop Free (EXTRCT (J)); end loop; end BLDTBL; -- cmptmps - compress template table entries -- -- template tables are compressed by using the 'template equivalence -- classes', which are collections of transition character equivalence -- classes which always appear together in templates - really meta-equivalence -- classes. until this point, the tables for templates have been stored -- up at the top end of the nxt array; they will now be compressed and have -- table entries made for them. procedure CMPTMPS is TMPSTORAGE : C_Size_Array_Access := new C_Size_Array; TOTALTRANS, TRANS : INTEGER; begin PEAKPAIRS := NUMTEMPS*NUMECS + TBLEND; if (USEMECS) then -- create equivalence classes base on data gathered on template -- transitions ECS.CRE8ECS(TECFWD, TECBCK, NUMECS, NUMMECS); else NUMMECS := NUMECS; end if; if (LASTDFA + NUMTEMPS + 1 >= CURRENT_MAX_DFAS) then DFA.INCREASE_MAX_DFAS; end if; -- loop through each template for I in 1 .. NUMTEMPS loop TOTALTRANS := 0; -- number of non-jam transitions out of this template for J in 1 .. NUMECS loop TRANS := TNXT(NUMECS*I + J); if (USEMECS) then -- the absolute value of tecbck is the meta-equivalence class -- of a given equivalence class, as set up by cre8ecs if (TECBCK(J) > 0) then TMPSTORAGE(TECBCK(J)) := TRANS; if (TRANS > 0) then TOTALTRANS := TOTALTRANS + 1; end if; end if; else TMPSTORAGE(J) := TRANS; if (TRANS > 0) then TOTALTRANS := TOTALTRANS + 1; end if; end if; end loop; -- it is assumed (in a rather subtle way) in the skeleton that -- if we're using meta-equivalence classes, the def[] entry for -- all templates is the jam template, i.e., templates never default -- to other non-jam table entries (e.g., another template) -- leave room for the jam-state after the last real state MKENTRY (TMPSTORAGE.all, NUMMECS, LASTDFA + I + 1, JAMSTATE_CONST, TOTALTRANS); end loop; Free (TMPSTORAGE); end CMPTMPS; -- expand_nxt_chk - expand the next check arrays procedure EXPAND_NXT_CHK is OLD_MAX : constant INTEGER := CURRENT_MAX_XPAIRS; begin CURRENT_MAX_XPAIRS := CURRENT_MAX_XPAIRS + MAX_XPAIRS_INCREMENT; NUM_REALLOCS := NUM_REALLOCS + 1; REALLOCATE_INTEGER_ARRAY(NXT, CURRENT_MAX_XPAIRS); REALLOCATE_INTEGER_ARRAY(CHK, CURRENT_MAX_XPAIRS); for I in OLD_MAX .. CURRENT_MAX_XPAIRS loop CHK(I) := 0; end loop; end EXPAND_NXT_CHK; -- find_table_space - finds a space in the table for a state to be placed -- -- State is the state to be added to the full speed transition table. -- Numtrans is the number of out-transitions for the state. -- -- find_table_space() returns the position of the start of the first block (in -- chk) able to accommodate the state -- -- In determining if a state will or will not fit, find_table_space() must take -- into account the fact that an end-of-buffer state will be added at [0], -- and an action number will be added in [-1]. function FIND_TABLE_SPACE(STATE : in UNBOUNDED_INT_ARRAY; NUMTRANS : in INTEGER) return INTEGER is -- firstfree is the position of the first possible occurrence of two -- consecutive unused records in the chk and nxt arrays I : INTEGER; CNT, SCNT : INTEGER; -- if there are too many out-transitions, put the state at the end of -- nxt and chk begin if (NUMTRANS > MAX_XTIONS_FULL_INTERIOR_FIT) then -- if table is empty, return the first available spot in chk/nxt, -- which should be 1 if (TBLEND < 2) then return (1); end if; I := TBLEND - NUMECS; -- start searching for table space near the -- end of chk/nxt arrays else I := FIRSTFREE; -- start searching for table space from the -- beginning (skipping only the elements -- which will definitely not hold the new -- state) end if; loop -- loops until a space is found if (I + NUMECS > CURRENT_MAX_XPAIRS) then EXPAND_NXT_CHK; end if; -- loops until space for end-of-buffer and action number are found loop if (CHK(I - 1) = 0) then -- check for action number space if (CHK(I) = 0) then -- check for end-of-buffer space exit; else I := I + 2; -- since i != 0, there is no use checking to -- see if (++i) - 1 == 0, because that's the -- same as i == 0, so we skip a space end if; else I := I + 1; end if; if (I + NUMECS > CURRENT_MAX_XPAIRS) then EXPAND_NXT_CHK; end if; end loop; -- if we started search from the beginning, store the new firstfree for -- the next call of find_table_space() if (NUMTRANS <= MAX_XTIONS_FULL_INTERIOR_FIT) then FIRSTFREE := I + 1; end if; -- check to see if all elements in chk (and therefore nxt) that are -- needed for the new state have not yet been taken CNT := I + 1; SCNT := 1; while (CNT /= I + NUMECS + 1) loop if ((STATE(SCNT) /= 0) and (CHK(CNT) /= 0)) then exit; end if; SCNT := SCNT + 1; CNT := CNT + 1; end loop; if (CNT = I + NUMECS + 1) then return I; else I := I + 1; end if; end loop; end FIND_TABLE_SPACE; -- inittbl - initialize transition tables -- -- Initializes "firstfree" to be one beyond the end of the table. Initializes -- all "chk" entries to be zero. Note that templates are built in their -- own tbase/tdef tables. They are shifted down to be contiguous -- with the non-template entries during table generation. procedure INITTBL is begin for I in 0 .. CURRENT_MAX_XPAIRS loop CHK(I) := 0; end loop; TBLEND := 0; FIRSTFREE := TBLEND + 1; NUMTEMPS := 0; if (USEMECS) then -- set up doubly-linked meta-equivalence classes -- these are sets of equivalence classes which all have identical -- transitions out of TEMPLATES TECBCK(1) := NIL; for I in 2 .. NUMECS loop TECBCK(I) := I - 1; TECFWD(I - 1) := I; end loop; TECFWD(NUMECS) := NIL; end if; end INITTBL; -- mkdeftbl - make the default, "jam" table entries procedure MKDEFTBL is begin JAMSTATE := LASTDFA + 1; TBLEND := TBLEND + 1; -- room for transition on end-of-buffer character if (TBLEND + NUMECS > CURRENT_MAX_XPAIRS) then EXPAND_NXT_CHK; end if; -- add in default end-of-buffer transition NXT(TBLEND) := END_OF_BUFFER_STATE; CHK(TBLEND) := JAMSTATE; for I in 1 .. NUMECS loop NXT(TBLEND + I) := 0; CHK(TBLEND + I) := JAMSTATE; end loop; JAMBASE := TBLEND; BASE(JAMSTATE) := JAMBASE; DEF(JAMSTATE) := 0; TBLEND := TBLEND + NUMECS; NUMTEMPS := NUMTEMPS + 1; end MKDEFTBL; -- mkentry - create base/def and nxt/chk entries for transition array -- -- "state" is a transition array "numchars" characters in size, "statenum" -- is the offset to be used into the base/def tables, and "deflink" is the -- entry to put in the "def" table entry. If "deflink" is equal to -- "JAMSTATE", then no attempt will be made to fit zero entries of "state" -- (i.e., jam entries) into the table. It is assumed that by linking to -- "JAMSTATE" they will be taken care of. In any case, entries in "state" -- marking transitions to "SAME_TRANS" are treated as though they will be -- taken care of by whereever "deflink" points. "totaltrans" is the total -- number of transitions out of the state. If it is below a certain threshold, -- the tables are searched for an interior spot that will accommodate the -- state array. procedure MKENTRY(STATE : in UNBOUNDED_INT_ARRAY; NUMCHARS, STATENUM, DEFLINK, TOTALTRANS : in INTEGER) is I, MINEC, MAXEC, BASEADDR, TBLBASE, TBLLAST : INTEGER; begin if (TOTALTRANS = 0) then -- there are no out-transitions if (DEFLINK = JAMSTATE_CONST) then BASE(STATENUM) := JAMSTATE_CONST; else BASE(STATENUM) := 0; end if; DEF(STATENUM) := DEFLINK; return; end if; MINEC := 1; while (MINEC <= NUMCHARS) loop if (STATE(MINEC) /= SAME_TRANS) then if ((STATE(MINEC) /= 0) or (DEFLINK /= JAMSTATE_CONST)) then exit; end if; end if; MINEC := MINEC + 1; end loop; if (TOTALTRANS = 1) then -- there's only one out-transition. Save it for later to fill -- in holes in the tables. STACK1(STATENUM, MINEC, STATE(MINEC), DEFLINK); return; end if; MAXEC := NUMCHARS; while (MAXEC >= 1) loop if (STATE(MAXEC) /= SAME_TRANS) then if ((STATE(MAXEC) /= 0) or (DEFLINK /= JAMSTATE_CONST)) then exit; end if; end if; MAXEC := MAXEC - 1; end loop; -- Whether we try to fit the state table in the middle of the table -- entries we have already generated, or if we just take the state -- table at the end of the nxt/chk tables, we must make sure that we -- have a valid base address (i.e., non-negative). Note that not only are -- negative base addresses dangerous at run-time (because indexing the -- next array with one and a low-valued character might generate an -- array-out-of-bounds error message), but at compile-time negative -- base addresses denote TEMPLATES. -- find the first transition of state that we need to worry about. if (TOTALTRANS*100 <= NUMCHARS*INTERIOR_FIT_PERCENTAGE) then -- attempt to squeeze it into the middle of the tabls BASEADDR := FIRSTFREE; while (BASEADDR < MINEC) loop -- using baseaddr would result in a negative base address below -- find the next free slot BASEADDR := BASEADDR + 1; while (CHK(BASEADDR) /= 0) loop BASEADDR := BASEADDR + 1; end loop; end loop; if (BASEADDR + MAXEC - MINEC >= CURRENT_MAX_XPAIRS) then EXPAND_NXT_CHK; end if; I := MINEC; while (I <= MAXEC) loop if (STATE(I) /= SAME_TRANS) then if ((STATE(I) /= 0) or (DEFLINK /= JAMSTATE_CONST)) then if (CHK(BASEADDR + I - MINEC) /= 0) then -- baseaddr unsuitable - find another BASEADDR := BASEADDR + 1; while ((BASEADDR < CURRENT_MAX_XPAIRS) and (CHK(BASEADDR) /= 0)) loop BASEADDR := BASEADDR + 1; end loop; if (BASEADDR + MAXEC - MINEC >= CURRENT_MAX_XPAIRS) then EXPAND_NXT_CHK; end if; -- reset the loop counter so we'll start all -- over again next time it's incremented I := MINEC - 1; end if; end if; end if; I := I + 1; end loop; else -- ensure that the base address we eventually generate is -- non-negative BASEADDR := Integer'Max (TBLEND + 1, MINEC); end if; TBLBASE := BASEADDR - MINEC; TBLLAST := TBLBASE + MAXEC; if (TBLLAST >= CURRENT_MAX_XPAIRS) then EXPAND_NXT_CHK; end if; BASE(STATENUM) := TBLBASE; DEF(STATENUM) := DEFLINK; for J in MINEC .. MAXEC loop if (STATE(J) /= SAME_TRANS) then if ((STATE(J) /= 0) or (DEFLINK /= JAMSTATE_CONST)) then NXT(TBLBASE + J) := STATE(J); CHK(TBLBASE + J) := STATENUM; end if; end if; end loop; if (BASEADDR = FIRSTFREE) then -- find next free slot in tables FIRSTFREE := FIRSTFREE + 1; while (CHK(FIRSTFREE) /= 0) loop FIRSTFREE := FIRSTFREE + 1; end loop; end if; TBLEND := Integer'Max (TBLEND, TBLLAST); end MKENTRY; -- mk1tbl - create table entries for a state (or state fragment) which -- has only one out-transition procedure MK1TBL(STATE, SYM, ONENXT, ONEDEF : in INTEGER) is begin if (FIRSTFREE < SYM) then FIRSTFREE := SYM; end if; while (CHK(FIRSTFREE) /= 0) loop FIRSTFREE := FIRSTFREE + 1; if (FIRSTFREE >= CURRENT_MAX_XPAIRS) then EXPAND_NXT_CHK; end if; end loop; BASE(STATE) := FIRSTFREE - SYM; DEF(STATE) := ONEDEF; CHK(FIRSTFREE) := STATE; NXT(FIRSTFREE) := ONENXT; if (FIRSTFREE > TBLEND) then TBLEND := FIRSTFREE; FIRSTFREE := FIRSTFREE + 1; if (FIRSTFREE >= CURRENT_MAX_XPAIRS) then EXPAND_NXT_CHK; end if; end if; end MK1TBL; -- mkprot - create new proto entry procedure MKPROT(STATE : in UNBOUNDED_INT_ARRAY; STATENUM, COMSTATE : in INTEGER) is SLOT, TBLBASE : INTEGER; begin NUMPROTS := NUMPROTS + 1; if ((NUMPROTS >= MSP) or (NUMECS*NUMPROTS >= PROT_SAVE_SIZE)) then -- gotta make room for the new proto by dropping last entry in -- the queue SLOT := LASTPROT; LASTPROT := PROTPREV(LASTPROT); PROTNEXT(LASTPROT) := NIL; else SLOT := NUMPROTS; end if; PROTNEXT(SLOT) := FIRSTPROT; if (FIRSTPROT /= NIL) then PROTPREV(FIRSTPROT) := SLOT; end if; FIRSTPROT := SLOT; PROTTBL(SLOT) := STATENUM; PROTCOMST(SLOT) := COMSTATE; -- copy state into save area so it can be compared with rapidly TBLBASE := NUMECS*(SLOT - 1); for I in 1 .. NUMECS loop PROTSAVE(TBLBASE + I) := STATE(I + STATE'FIRST); end loop; end MKPROT; -- mktemplate - create a template entry based on a state, and connect the state -- to it procedure MKTEMPLATE(STATE : in UNBOUNDED_INT_ARRAY; STATENUM, COMSTATE : in INTEGER) is subtype TARRAY is Unicode_Character_Array (0 .. CSIZE); type TARRAY_Access is access all TARRAY; procedure Free is new Ada.Unchecked_Deallocation (TARRAY, TARRAY_Access); NUMDIFF, TMPBASE : INTEGER; TMP : C_Size_Array_Access := new C_Size_Array; TRANSSET : TARRAY_Access := new TARRAY; TSPTR : INTEGER; begin NUMTEMPS := NUMTEMPS + 1; TSPTR := 0; -- calculate where we will temporarily store the transition table -- of the template in the tnxt[] array. The final transition table -- gets created by cmptmps() TMPBASE := NUMTEMPS*NUMECS; if (TMPBASE + NUMECS >= CURRENT_MAX_TEMPLATE_XPAIRS) then CURRENT_MAX_TEMPLATE_XPAIRS := CURRENT_MAX_TEMPLATE_XPAIRS + MAX_TEMPLATE_XPAIRS_INCREMENT; NUM_REALLOCS := NUM_REALLOCS + 1; REALLOCATE_INTEGER_ARRAY(TNXT, CURRENT_MAX_TEMPLATE_XPAIRS); end if; for I in 1 .. NUMECS loop if (STATE(I) = 0) then TNXT(TMPBASE + I) := 0; else TRANSSET(TSPTR) := Unicode_Character'Val (I); TSPTR := TSPTR + 1; TNXT(TMPBASE + I) := COMSTATE; end if; end loop; if (USEMECS) then ECS.MKECCL (TRANSSET.all, TSPTR, TECFWD, TECBCK, NUMECS); end if; MKPROT(TNXT(TMPBASE .. CURRENT_MAX_TEMPLATE_XPAIRS), -NUMTEMPS, COMSTATE); -- we rely on the fact that mkprot adds things to the beginning -- of the proto queue TBLDIFF(STATE, FIRSTPROT, TMP.all, NUMDIFF); MKENTRY(TMP.all, NUMECS, STATENUM, -NUMTEMPS, NUMDIFF); Free (TMP); Free (TRANSSET); end MKTEMPLATE; -- mv2front - move proto queue element to front of queue procedure MV2FRONT(QELM : in INTEGER) is begin if (FIRSTPROT /= QELM) then if (QELM = LASTPROT) then LASTPROT := PROTPREV(LASTPROT); end if; PROTNEXT(PROTPREV(QELM)) := PROTNEXT(QELM); if (PROTNEXT(QELM) /= NIL) then PROTPREV(PROTNEXT(QELM)) := PROTPREV(QELM); end if; PROTPREV(QELM) := NIL; PROTNEXT(QELM) := FIRSTPROT; PROTPREV(FIRSTPROT) := QELM; FIRSTPROT := QELM; end if; end MV2FRONT; -- place_state - place a state into full speed transition table -- -- State is the statenum'th state. It is indexed by equivalence class and -- gives the number of the state to enter for a given equivalence class. -- Transnum is the number of out-transitions for the state. procedure PLACE_STATE(STATE : in UNBOUNDED_INT_ARRAY; STATENUM, TRANSNUM : in INTEGER) is I : INTEGER; POSITION : constant INTEGER := FIND_TABLE_SPACE(STATE, TRANSNUM); begin -- base is the table of start positions BASE(STATENUM) := POSITION; -- put in action number marker; this non-zero number makes sure that -- find_table_space() knows that this position in chk/nxt is taken -- and should not be used for another accepting number in another state CHK(POSITION - 1) := 1; -- put in end-of-buffer marker; this is for the same purposes as above CHK(POSITION) := 1; -- place the state into chk and nxt I := 1; while (I <= NUMECS) loop if (STATE(I) /= 0) then CHK(POSITION + I) := I; NXT(POSITION + I) := STATE(I); end if; I := I + 1; end loop; if (POSITION + NUMECS > TBLEND) then TBLEND := POSITION + NUMECS; end if; end PLACE_STATE; -- stack1 - save states with only one out-transition to be processed later -- -- if there's room for another state one the "one-transition" stack, the -- state is pushed onto it, to be processed later by mk1tbl. If there's -- no room, we process the sucker right now. procedure STACK1(STATENUM, SYM, NEXTSTATE, DEFLINK : in INTEGER) is begin if (ONESP >= ONE_STACK_SIZE - 1) then MK1TBL(STATENUM, SYM, NEXTSTATE, DEFLINK); else ONESP := ONESP + 1; ONESTATE(ONESP) := STATENUM; ONESYM(ONESP) := SYM; ONENEXT(ONESP) := NEXTSTATE; ONEDEF(ONESP) := DEFLINK; end if; end STACK1; -- tbldiff - compute differences between two state tables -- -- "state" is the state array which is to be extracted from the pr'th -- proto. "pr" is both the number of the proto we are extracting from -- and an index into the save area where we can find the proto's complete -- state table. Each entry in "state" which differs from the corresponding -- entry of "pr" will appear in "ext". -- Entries which are the same in both "state" and "pr" will be marked -- as transitions to "SAME_TRANS" in "ext". The total number of differences -- between "state" and "pr" is returned as function value. Note that this -- number is "numecs" minus the number of "SAME_TRANS" entries in "ext". procedure TBLDIFF(STATE : in UNBOUNDED_INT_ARRAY; PR : in INTEGER; EXT : out UNBOUNDED_INT_ARRAY; RESULT : out INTEGER) is SP : INTEGER := 0; EP : INTEGER := 0; NUMDIFF : INTEGER := 0; PROTP : INTEGER; begin PROTP := NUMECS*(PR - 1); for I in reverse 1 .. NUMECS loop PROTP := PROTP + 1; SP := SP + 1; if (PROTSAVE(PROTP) = STATE(SP)) then EP := EP + 1; EXT(EP) := SAME_TRANS; else EP := EP + 1; EXT(EP) := STATE(SP); NUMDIFF := NUMDIFF + 1; end if; end loop; RESULT := NUMDIFF; return; end TBLDIFF; end TBLCMP;
alloy4fun_models/trashltl/models/1/kykkjMnDB5FY32EaN.als
Kaixi26/org.alloytools.alloy
0
452
open main pred idkykkjMnDB5FY32EaN_prop2 { eventually some File } pred __repair { idkykkjMnDB5FY32EaN_prop2 } check __repair { idkykkjMnDB5FY32EaN_prop2 <=> prop2o }
oeis/256/A256309.asm
neoneye/loda-programs
11
90927
<gh_stars>10-100 ; A256309: Number of partitions of 2n into exactly 5 parts. ; 0,0,0,1,3,7,13,23,37,57,84,119,164,221,291,377,480,603,748,918,1115,1342,1602,1898,2233,2611,3034,3507,4033,4616,5260,5969,6747,7599,8529,9542,10642,11835,13125,14518,16019,17633,19366,21224,23212,25337,27604,30020,32591,35324,38225,41301,44559,48006,51649,55496,59553,63829,68331,73067,78045,83273,88759,94512,100540,106852,113456,120362,127578,135114,142979,151182,159733,168642,177918,187572,197613,208052,218899,230165,241860,253995,266581,279629,293150,307156,321657,336666,352194,368253,384855 mul $0,2 seq $0,26811 ; Number of partitions of n in which the greatest part is 5.
agda/VecSN.agda
JacquesCarette/pi-dual
14
831
module VecSN where open import Data.Bool infixr 20 _◎_ ------------------------------------------------------------------------------ -- fix a field F_3 = {0, 1, -1} -- types B (ZERO,ONE,PLUS,TIMES) determine the DIMENSION of a vector space over F_3 -- values of type B are INDICES for B-dimensional vectors -- we do not allow superpositions (we have AT MOST one entry in the -- vector that is non-zero), so we can identify the INDICES with the vectors -- -- in particular: -- - ZERO is not the empty type! it is like the 0-dimensional vector space -- (i.e, the type containing one "annihilating value") -- - ONE is like a 1-dimensional vector space; it is isomorphic to -- the scalars (0,+1,-1) -- - PLUS gives the direct sum of vector spaces (dimension is the sum) -- - TIMES gives the tensor product of vector spaces (dimension is the product) -- - DUAL gives the dual space (functionals that map vectors to scalars; i.e. -- that maps values to scalars) data B : Set where ZERO : B ONE : B PLUS : B → B → B TIMES : B → B → B DUAL : B → B -- now we describe the vectors for each B-dimensional vector space -- the zero vector is everywhere data BVAL : B → Set where zero : {b : B} → BVAL b unit : BVAL ONE left : {b₁ b₂ : B} → BVAL b₁ → BVAL (PLUS b₁ b₂) right : {b₁ b₂ : B} → BVAL b₂ → BVAL (PLUS b₁ b₂) pair : {b₁ b₂ : B} → BVAL b₁ → BVAL b₂ → BVAL (TIMES b₁ b₂) dual : {b : B} → BVAL b → BVAL (DUAL b) -- syntactic equality on vectors b= : { b : B } → BVAL b → BVAL b → Bool b= zero zero = true b= unit unit = true b= (left v₁) (left v₂) = b= v₁ v₂ b= (right v₁) (right v₂) = b= v₁ v₂ b= (pair v₁ v₂) (pair v₁' v₂') = b= v₁ v₁' ∧ b= v₂ v₂' b= (dual v₁) (dual v₂) = b= v₁ v₂ b= _ _ = false data Iso : B → B → Set where -- (+,0) commutative monoid unite₊ : { b : B } → Iso (PLUS ZERO b) b uniti₊ : { b : B } → Iso b (PLUS ZERO b) swap₊ : { b₁ b₂ : B } → Iso (PLUS b₁ b₂) (PLUS b₂ b₁) assocl₊ : { b₁ b₂ b₃ : B } → Iso (PLUS b₁ (PLUS b₂ b₃)) (PLUS (PLUS b₁ b₂) b₃) assocr₊ : { b₁ b₂ b₃ : B } → Iso (PLUS (PLUS b₁ b₂) b₃) (PLUS b₁ (PLUS b₂ b₃)) -- (*,1) commutative monoid unite⋆ : { b : B } → Iso (TIMES ONE b) b uniti⋆ : { b : B } → Iso b (TIMES ONE b) swap⋆ : { b₁ b₂ : B } → Iso (TIMES b₁ b₂) (TIMES b₂ b₁) assocl⋆ : { b₁ b₂ b₃ : B } → Iso (TIMES b₁ (TIMES b₂ b₃)) (TIMES (TIMES b₁ b₂) b₃) assocr⋆ : { b₁ b₂ b₃ : B } → Iso (TIMES (TIMES b₁ b₂) b₃) (TIMES b₁ (TIMES b₂ b₃)) -- * distributes over + dist : { b₁ b₂ b₃ : B } → Iso (TIMES (PLUS b₁ b₂) b₃) (PLUS (TIMES b₁ b₃) (TIMES b₂ b₃)) factor : { b₁ b₂ b₃ : B } → Iso (PLUS (TIMES b₁ b₃) (TIMES b₂ b₃)) (TIMES (PLUS b₁ b₂) b₃) -- closure id⟷ : { b : B } → Iso b b sym : { b₁ b₂ : B } → Iso b₁ b₂ → Iso b₂ b₁ _◎_ : { b₁ b₂ b₃ : B } → Iso b₁ b₂ → Iso b₂ b₃ → Iso b₁ b₃ _⊕_ : { b₁ b₂ b₃ b₄ : B } → Iso b₁ b₃ → Iso b₂ b₄ → Iso (PLUS b₁ b₂) (PLUS b₃ b₄) _⊗_ : { b₁ b₂ b₃ b₄ : B } → Iso b₁ b₃ → Iso b₂ b₄ → Iso (TIMES b₁ b₂) (TIMES b₃ b₄) -- multiplicative duality refe⋆ : { b : B } → Iso (DUAL (DUAL b)) b refi⋆ : { b : B } → Iso b (DUAL (DUAL b)) rile⋆ : { b : B } → Iso (TIMES b (TIMES b (DUAL b))) b rili⋆ : { b : B } → Iso b (TIMES b (TIMES b (DUAL b))) -- negatives: we have a circuit that requires the value to choose -- the incoming value : b₁ can go left or right choose : { b₁ b₂ : B } → Iso b₁ b₂ → Iso b₁ b₂ → Iso b₁ b₂ mutual eval : {b₁ b₂ : B} → Iso b₁ b₂ → BVAL b₁ → BVAL b₂ eval unite₊ (left _) = zero eval unite₊ (right v) = v eval uniti₊ v = right v eval swap₊ (left v) = right v eval swap₊ (right v) = left v eval assocl₊ (left v) = left (left v) eval assocl₊ (right (left v)) = left (right v) eval assocl₊ (right (right v)) = right v eval assocr₊ (left (left v)) = left v eval assocr₊ (left (right v)) = right (left v) eval assocr₊ (right v) = right (right v) eval unite⋆ (pair unit v) = v eval uniti⋆ v = pair unit v eval swap⋆ (pair v1 v2) = pair v2 v1 eval assocl⋆ (pair v1 (pair v2 v3)) = pair (pair v1 v2) v3 eval assocr⋆ (pair (pair v1 v2) v3) = pair v1 (pair v2 v3) eval dist (pair (left v1) v3) = left (pair v1 v3) eval dist (pair (right v2) v3) = right (pair v2 v3) eval factor (left (pair v1 v3)) = pair (left v1) v3 eval factor (right (pair v2 v3)) = pair (right v2) v3 eval id⟷ v = v eval (sym c) v = evalB c v eval (c₁ ◎ c₂) v = eval c₂ (eval c₁ v) eval (c₁ ⊕ c₂) (left v) = left (eval c₁ v) eval (c₁ ⊕ c₂) (right v) = right (eval c₂ v) eval (c₁ ⊗ c₂) (pair v₁ v₂) = pair (eval c₁ v₁) (eval c₂ v₂) eval refe⋆ (dual (dual v)) = v eval refi⋆ v = dual (dual v) eval rile⋆ (pair v (pair v₁ (dual v₂))) with b= v₁ v₂ eval rile⋆ (pair v (pair v₁ (dual v₂))) | true = v eval rile⋆ (pair v (pair v₁ (dual v₂))) | false = zero eval rili⋆ v = pair v (pair v (dual v)) -- choose : { b₁ b₂ : B } → Iso b₁ b₂ → Iso b₁ b₂ → Iso b₁ b₂ eval (choose c₁ c₂) v = {!!} eval _ _ = zero evalB : {b₁ b₂ : B} → Iso b₁ b₂ → BVAL b₂ → BVAL b₁ evalB unite₊ v = right v evalB uniti₊ (left _) = zero evalB uniti₊ (right v) = v evalB swap₊ (left v) = right v evalB swap₊ (right v) = left v evalB assocl₊ (left (left v)) = left v evalB assocl₊ (left (right v)) = right (left v) evalB assocl₊ (right v) = right (right v) evalB assocr₊ (left v) = left (left v) evalB assocr₊ (right (left v)) = left (right v) evalB assocr₊ (right (right v)) = right v evalB unite⋆ v = pair unit v evalB uniti⋆ (pair unit v) = v evalB swap⋆ (pair v1 v2) = pair v2 v1 evalB assocl⋆ (pair (pair v1 v2) v3) = pair v1 (pair v2 v3) evalB assocr⋆ (pair v1 (pair v2 v3)) = pair (pair v1 v2) v3 evalB dist (left (pair v1 v3)) = pair (left v1) v3 evalB dist (right (pair v2 v3)) = pair (right v2) v3 evalB factor (pair (left v1) v3) = left (pair v1 v3) evalB factor (pair (right v2) v3) = right (pair v2 v3) evalB id⟷ v = v evalB (sym c) v = eval c v evalB (c₁ ◎ c₂) v = evalB c₁ (evalB c₂ v) evalB (c₁ ⊕ c₂) (left v) = left (evalB c₁ v) evalB (c₁ ⊕ c₂) (right v) = right (evalB c₂ v) evalB (c₁ ⊗ c₂) (pair v₁ v₂) = pair (evalB c₁ v₁) (evalB c₂ v₂) evalB refe⋆ v = dual (dual v) evalB refi⋆ (dual (dual v)) = v evalB rile⋆ v = pair v (pair v (dual v)) evalB rili⋆ (pair v (pair v₁ (dual v₂))) with b= v₁ v₂ evalB rili⋆ (pair v (pair v₁ (dual v₂))) | true = v evalB rili⋆ (pair v (pair v₁ (dual v₂))) | false = zero evalB _ _ = zero ------------------------------------------------------------------------------ -- example with duals pibool : B pibool = PLUS ONE ONE pitrue : BVAL pibool pitrue = left unit pifalse : BVAL pibool pifalse = right unit -- swap clause 1 = (T => F) clause1 : BVAL (TIMES (DUAL pibool) pibool) clause1 = pair (dual pitrue) pifalse -- swap clause 2 = (F => T) clause2 : BVAL (TIMES (DUAL pibool) pibool) clause2 = pair (dual pifalse) pitrue -- swap clause 1 applied to true ex1 : BVAL (TIMES pibool (TIMES (DUAL pibool) pibool)) ex1 = pair pitrue clause1 -- swap clause 1 applied to false ex2 : BVAL (TIMES pibool (TIMES (DUAL pibool) pibool)) ex2 = pair pifalse clause1 -- swap clause 1 applied to true ex3 : BVAL (TIMES pibool (TIMES (DUAL pibool) pibool)) ex3 = pair pitrue clause2 -- swap clause 1 applied to false ex4 : BVAL (TIMES pibool (TIMES (DUAL pibool) pibool)) ex4 = pair pifalse clause2 -- applies one of the clauses to a value c : Iso (TIMES pibool (TIMES (DUAL pibool) pibool)) pibool c = -- (v,(1/t,f)) assocl⋆ ◎ -- ((v,1/t),f) swap⋆ ◎ -- (f,(v,1/t)) rile⋆ -- f or zero -- v1 = eval c ex1 v2 = eval c ex2 v3 = eval c ex3 v4 = eval c ex4 -- generalize -- applies one of the clauses of a function : b -> b to a value : b apply : {b : B} → Iso (TIMES b (TIMES (DUAL b) b)) b apply = assocl⋆ ◎ swap⋆ ◎ rile⋆ {-- want: value is True in parallel apply clause1 to value and apply clause2 to value one of these will return False and the other will return zero merge the results to get False better: value is True we create a new logic variable ALPHA which can be unified with either clause1 or clause2 we create a value (ALPHA - ALPHA) which we apply to evaluate --} ------------------------------------------------------------------------------
oeis/015/A015601.asm
neoneye/loda-programs
11
104364
; A015601: a(n) = 11*a(n-1) + 7*a(n-2). ; Submitted by <NAME> ; 0,1,11,128,1485,17231,199936,2319913,26918595,312343936,3624213461,42052755623,487949806080,5661817156241,65695637361211,762284731067008,8845001503265565,102631009653390271,1190856116710151936,13817834351385403193,160332170682210498675,1860378717964013307776,21586491092379619876261,250474053041923911793303,2906320021107820368860160,33722838603479491440014881,391295464786029148422184811,4540309982870677072724137088,52682478065079651838920801645,611289428595970909737197777711 mov $1,1 lpb $0 sub $0,1 mov $3,$1 mov $1,$2 mul $1,7 mul $2,11 add $2,$3 lpe mov $0,$2
Ada/problem_13/problem_13.ads
PyllrNL/Project_Euler_Solutions
0
4298
with Test_Solution; use Test_Solution; package problem_13 is type Int128 is range -2**127 .. 2**127 - 1; type Digit_50_Array is array( Natural range <> ) of String( 1 .. 50 ); function solution_1( arr : Digit_50_Array ) return Int128; procedure Test_Solution_1; function Get_Solutions return Solution_Case; end problem_13;
boot_sector_2_stages/stage2/protected_mod.asm
lolblat/OrOS
4
240460
;code switch to protected mode [bits 16] switch_to_protected: cli ; disable int lgdt[gdt_start.size] ; load the idt into the memory mov eax, cr0 or al, 1 ; switch flag true mov cr0, eax jmp 08h:protected_mod_init ; far jump to code ret [bits 32] protected_mod_init: mov ax,gdt_start.gdt_data_descriptor mov ds,ax mov es,ax mov ss,ax mov fs,ax mov gs,ax mov esp,0x7c00 mov ebp,esp call protected_mode gdt_start: .gdt_data: dd 0x0 ; 8 bytes of null descriptor dd 0x0 ;-----------------------------; .gdt_code_descriptor: equ $ - gdt_start dw 0xFFFF ; limit low dw 0x0 ;base low db 0x0 ; base middle db 10011010b ; access db 11001111b ; granularity db 0x0 .gdt_data_descriptor: equ $ - gdt_start dw 0xFFFF ; limit low dw 0 db 0 db 10010010b db 11001111b db 0 .gdt_user_code: equ $ - gdt_start dw 0xFFFF dw 0x0 db 0x0 db 11111010b db 11001111b db 0x0 .gdt_user_data: equ $ - gdt_start dw 0xFFFF dw 0x0 db 0x0 db 11110010b db 11001111b db 0x0 .gdt_tss_entry: equ $ - gdt_start dw 0xFFFF ;limit low 0:15 dw 0x0; base low 0:15 db 0x0 ;base 16:23 db 11101001b ; access db 11001111b ; 4 last bits is limit 16:19 db 0x0; another base 24:31 .end_of_gdt: .size: dw .end_of_gdt - .gdt_data - 1 dd .gdt_data
libsrc/_DEVELOPMENT/math/float/math32/lm32/c/sdcc/___fs2ulong.asm
Frodevan/z88dk
640
21036
<filename>libsrc/_DEVELOPMENT/math/float/math32/lm32/c/sdcc/___fs2ulong.asm SECTION code_fp_math32 PUBLIC ___fs2ulong EXTERN cm32_sdcc___fs2ulong defc ___fs2ulong = cm32_sdcc___fs2ulong
Palmtree.Math.Core.Sint/vs_build/x64_Release/pmc_bytes.asm
rougemeilland/Palmtree.Math.Core.Sint
0
175768
; Listing generated by Microsoft (R) Optimizing Compiler Version 19.16.27026.1 include listing.inc INCLUDELIB OLDNAMES PUBLIC PMC_ToByteArray PUBLIC PMC_FromByteArray ; COMDAT pdata pdata SEGMENT $pdata$PMC_ToByteArray DD imagerel $LN12@PMC_ToByte DD imagerel $LN12@PMC_ToByte+75 DD imagerel $unwind$PMC_ToByteArray pdata ENDS ; COMDAT pdata pdata SEGMENT $pdata$PMC_FromByteArray DD imagerel $LN17@PMC_FromBy DD imagerel $LN17@PMC_FromBy+67 DD imagerel $unwind$PMC_FromByteArray pdata ENDS ; COMDAT pdata pdata SEGMENT $pdata$1$PMC_FromByteArray DD imagerel $LN17@PMC_FromBy+67 DD imagerel $LN17@PMC_FromBy+151 DD imagerel $chain$1$PMC_FromByteArray pdata ENDS ; COMDAT pdata pdata SEGMENT $pdata$2$PMC_FromByteArray DD imagerel $LN17@PMC_FromBy+151 DD imagerel $LN17@PMC_FromBy+157 DD imagerel $chain$2$PMC_FromByteArray pdata ENDS ; COMDAT pdata pdata SEGMENT $pdata$3$PMC_FromByteArray DD imagerel $LN17@PMC_FromBy+157 DD imagerel $LN17@PMC_FromBy+182 DD imagerel $chain$3$PMC_FromByteArray pdata ENDS ; COMDAT pdata pdata SEGMENT $pdata$4$PMC_FromByteArray DD imagerel $LN17@PMC_FromBy+182 DD imagerel $LN17@PMC_FromBy+193 DD imagerel $chain$4$PMC_FromByteArray ; COMDAT xdata xdata SEGMENT $chain$4$PMC_FromByteArray DD 021H DD imagerel $LN17@PMC_FromBy DD imagerel $LN17@PMC_FromBy+67 DD imagerel $unwind$PMC_FromByteArray xdata ENDS ; COMDAT xdata xdata SEGMENT $chain$3$PMC_FromByteArray DD 040021H DD 086400H DD 073400H DD imagerel $LN17@PMC_FromBy DD imagerel $LN17@PMC_FromBy+67 DD imagerel $unwind$PMC_FromByteArray xdata ENDS ; COMDAT xdata xdata SEGMENT $chain$2$PMC_FromByteArray DD 021H DD imagerel $LN17@PMC_FromBy DD imagerel $LN17@PMC_FromBy+67 DD imagerel $unwind$PMC_FromByteArray xdata ENDS ; COMDAT xdata xdata SEGMENT $chain$1$PMC_FromByteArray DD 041321H DD 086413H DD 073405H DD imagerel $LN17@PMC_FromBy DD imagerel $LN17@PMC_FromBy+67 DD imagerel $unwind$PMC_FromByteArray xdata ENDS ; COMDAT xdata xdata SEGMENT $unwind$PMC_FromByteArray DD 020601H DD 070023206H xdata ENDS ; COMDAT xdata xdata SEGMENT $unwind$PMC_ToByteArray DD 010401H DD 06204H END
source/contexts/plain/program-plain_contexts.adb
optikos/oasis
0
5634
<gh_stars>0 -- Copyright (c) 2019 <NAME> <<EMAIL>> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with Ada.Strings.Wide_Wide_Fixed; with System.Storage_Pools.Subpools; with Program.Parsers; with Program.Plain_Compilations; with Program.Storage_Pools; with Program.Resolve_Standard; package body Program.Plain_Contexts is type Plain_Compilation_Access is access all Program.Plain_Compilations.Compilation; ----------------------------- -- Compilation_Unit_Bodies -- ----------------------------- overriding function Compilation_Unit_Bodies (Self : Context) return Program.Compilation_Unit_Vectors.Compilation_Unit_Vector_Access is begin if Self.Bodies.List.Is_Empty then return null; else return Self.Bodies'Unchecked_Access; end if; end Compilation_Unit_Bodies; ------------- -- Element -- ------------- overriding function Element (Self : Unit_Vector; Index : Positive) return not null Program.Compilation_Units.Compilation_Unit_Access is begin return Self.List.Element (Index); end Element; ---------- -- Find -- ---------- function Find (Self : Context'Class; Value : Program.Text) return Program.Symbols.Symbol is begin return Self.Symbols.Find (Value); end Find; --------------------------- -- Find_Or_Create_Symbol -- --------------------------- procedure Find_Or_Create_Symbol (Self : in out Context'Class; Buffer : not null Program.Source_Buffers.Source_Buffer_Access; Span : Program.Source_Buffers.Span; Result : out Program.Symbols.Symbol) is begin Self.Symbols.Find_Or_Create (Buffer, Span, Result); end Find_Or_Create_Symbol; ---------- -- Hash -- ---------- function Hash (Value : Symbol_List_Item) return Ada.Containers.Hash_Type is use type Ada.Containers.Hash_Type; begin return Ada.Containers.Hash_Type'Mod (Value.Prefix) + 100003 * Ada.Containers.Hash_Type'Mod (Value.Symbol); end Hash; --------------- -- Find_Unit -- --------------- overriding function Find_Unit (Self : Unit_Vector; Name : Text) return Program.Compilation_Units.Compilation_Unit_Access is Cursor : Symbol_List_Maps.Cursor; Item : Symbol_List_Item := (0, 0); Result : Symbol_List_Index; Prev : Positive; Dot : Natural := Name'First - 1; begin loop Prev := Dot + 1; Dot := Ada.Strings.Wide_Wide_Fixed.Index (Name, ".", Prev); exit when Dot not in Name'Range; Item.Symbol := Self.Context.Symbols.Find (Name (Prev .. Dot - 1)); Cursor := Self.Context.Symbol_Lists.Find (Item); if Symbol_List_Maps.Has_Element (Cursor) then Item.Prefix := Symbol_List_Maps.Element (Cursor); else return null; end if; end loop; Item.Symbol := Self.Context.Symbols.Find (Name (Dot + 1 .. Name'Last)); Cursor := Self.Context.Symbol_Lists.Find (Item); if Symbol_List_Maps.Has_Element (Cursor) then Result := Symbol_List_Maps.Element (Cursor); else return null; end if; if Self.Map.Contains (Result) then return Self.Map.Element (Result); else return null; end if; end Find_Unit; ---------------- -- Get_Length -- ---------------- overriding function Get_Length (Self : Unit_Vector) return Positive is begin return Self.List.Last_Index; end Get_Length; ---------------- -- Initialize -- ---------------- procedure Initialize (Self : in out Context'Class) is begin Self.Symbols.Initialize; end Initialize; ------------------------------- -- Library_Unit_Declarations -- ------------------------------- overriding function Library_Unit_Declarations (Self : Context) return Program.Compilation_Unit_Vectors.Compilation_Unit_Vector_Access is begin return Self.Declarations'Unchecked_Access; end Library_Unit_Declarations; ---------------- -- Parse_File -- ---------------- procedure Parse_File (Self : aliased in out Context'Class; Text_Name : Text; Env : aliased in out Program.Visibility.Context) is Units : Program.Parsers.Unit_Vectors.Vector; Pragmas : Program.Parsers.Element_Vectors.Vector; Pool : Program.Storage_Pools.Storage_Pool renames Program.Storage_Pools.Pool; Subpool : constant not null System.Storage_Pools.Subpools.Subpool_Handle := Pool.Create_Subpool; Compilation : constant Plain_Compilation_Access := new Program.Plain_Compilations.Compilation (Subpool); -- Plain_Compilation is a controlled type, so don't allocate it in -- the (Subpool) begin Compilation.Initialize (Self'Unchecked_Access); Compilation.Parse_File (Text_Name, Units, Pragmas); Env.Create_Empty_Context; Program.Resolve_Standard (Unit => Units (1), Env => Env); Self.Compilations.Append (Program.Compilations.Compilation_Access (Compilation)); Self.Symbol_Lists.Insert ((0, Program.Symbols.Standard), 1); Self.Declarations.Map.Insert (1, Units (1)); Self.Declarations.List.Append (Units (1)); end Parse_File; end Program.Plain_Contexts;
lsearch_proc.asm
jatin69/mca102-SP
0
92184
; Author - <NAME> ; Course - MCA 102 ; Objective - Implement Linear Search procedure ;data segment DATA SEGMENT ARRAY DW 01H, 04H, 16H, 12H, 17H, 21H ELEMENT DW 17H INDEX DW ? TWO DB 2 DATA ENDS ;code segment CODE SEGMENT ASSUME DS: DATA, CS:CODE START: MOV AX,DATA MOV DS,AX ; clear AX MOV AX,0 ; set SI=0 MOV SI,0 ; CX = array size MOV CX,6 ; moving array base address to BX MOV BX,OFFSET ARRAY ; call mysearch CALL MYSEARCH ;halt program hlt ; a near procedure MYSEARCH PROC NEAR SEARCH: MOV DX,BX[SI] CMP DX,ELEMENT JZ FOUND ; as it is word, SI is incremented twice INC SI INC SI LOOP SEARCH NOTFOUND: MOV INDEX,-1 JMP DONE FOUND: MOV AX, SI DIV TWO MOV AH,0 MOV INDEX,AX JMP DONE DONE: RET MYSEARCH ENDP CODE ENDS END START
oeis/035/A035290.asm
neoneye/loda-programs
11
85529
<gh_stars>10-100 ; A035290: Number of ways to place a non-attacking white and black pawn on n X n chessboard. ; 0,0,6,50,194,522,1142,2186,3810,6194,9542,14082,20066,27770,37494,49562,64322,82146,103430,128594,158082,192362,231926,277290,328994,387602,453702,527906,610850,703194,805622,918842,1043586,1180610,1330694,1494642,1673282,1867466,2078070,2305994,2552162,2817522,3103046,3409730,3738594,4090682,4467062,4868826,5297090,5752994,6237702,6752402,7298306,7876650,8488694,9135722,9819042,10539986,11299910,12100194,12942242,13827482,14757366,15733370,16756994,17829762,18953222,20128946,21358530,22643594 mov $1,$0 pow $0,2 trn $0,2 bin $0,2 mul $1,2 trn $1,2 add $1,$0 mov $0,$1 mul $0,2
constants/move_animation_constants.asm
etdv-thevoid/pokemon-rgb-enhanced
1
26587
<gh_stars>1-10 ; subanimations const_value = $D8 ; special effects, prefaced with "SE" for "Special Effect" const SE_WAVY_SCREEN ; $D8 used in Psywave/Night Shade/Psychic etc. const SE_SUBSTITUTE_MON ; $D9 used in Substitute (turns the pokemon into a mini sprite) const SE_SHAKE_BACK_AND_FORTH ; $DA used in Double Team/Agility const SE_SLIDE_ENEMY_MON_OFF ; $DB used in Whirlwind const SE_SHOW_ENEMY_MON_PIC ; $DC used in Seismic Toss const SE_SHOW_MON_PIC ; $DD used in Low Kick/Quick Attack/Seismic Toss etc. const SE_BLINK_ENEMY_MON ; $DE used in Seismic Toss const SE_HIDE_ENEMY_MON_PIC ; $DF used in Seismic Toss const SE_FLASH_ENEMY_MON_PIC ; $E0 unused const SE_DELAY_ANIMATION_10 ; $E1 used in lots of animations const SE_SPIRAL_BALLS_INWARD ; $E2 used in Growth/Recover/Hyper Beam etc. const SE_SHAKE_ENEMY_HUD_2 ; $E3 unused const SE_SHAKE_ENEMY_HUD ; $E4 const SE_SLIDE_MON_HALF_OFF ; $E5 used in Softboiled const SE_PETALS_FALLING ; $E6 used in Petal Dance const SE_LEAVES_FALLING ; $E7 used in Razor Leaf const SE_TRANSFORM_MON ; $E8 used in Transform const SE_SLIDE_MON_DOWN_AND_HIDE ; $E9 used in Acid Armor const SE_MINIMIZE_MON ; $EA used in Minimize const SE_BOUNCE_UP_AND_DOWN ; $EB used in Splash const SE_SHOOT_MANY_BALLS_UPWARD ; $EC used in Focus Energy const SE_SHOOT_BALLS_UPWARD ; $ED used in Teleport/Sky Attack const SE_SQUISH_MON_PIC ; $EE used in Teleport/Sky Attack const SE_HIDE_MON_PIC ; $EF const SE_LIGHT_SCREEN_PALETTE ; $F0 used in Mist/Double Edge/Absorb/etc. const SE_RESET_MON_POSITION ; $F1 used in Tackle/Body Slam/etc. const SE_MOVE_MON_HORIZONTALLY ; $F2 used in Tackle/Body Slam/etc. const SE_BLINK_MON ; $F3 used in Recover const SE_SLIDE_MON_OFF ; $F4 used in Seismic Toss/Low Kick/etc. const SE_FLASH_MON_PIC ; $F5 const SE_SLIDE_MON_DOWN ; $F6 used in Withdraw/Waterfall/fainting const SE_SLIDE_MON_UP ; $F7 used in Dig/Waterfall/etc. const SE_FLASH_SCREEN_LONG ; $F8 used in Confusion/Psychic/etc. const SE_DARKEN_MON_PALETTE ; $F9 used in Smokescreen/Smog/etc. const SE_WATER_DROPLETS_EVERYWHERE ; $FA used in Mist/Surf/Toxic/etc. const SE_SHAKE_SCREEN ; $FB used in Earthquake/Fissure/etc. const SE_RESET_SCREEN_PALETTE ; $FC used in Leer/Thunderpunch/etc. const SE_DARK_SCREEN_PALETTE ; $FD used in Hyper Beam/Thunderpunch/etc. const SE_DARK_SCREEN_FLASH ; $FE used in Cut/Take Down/etc.
test/src/test_graphic_bounds.ads
Fabien-Chouteau/Giza
7
7159
<gh_stars>1-10 with Basic_Test_Window; use Basic_Test_Window; with Giza.Context; use Giza.Context; with Giza.Events; use Giza.Events; with Giza.Widget.Button; use Giza.Widget; package Test_Graphic_Bounds is type Graphic_Bounds_Window is new Test_Window with private; type Graphic_Boounds_Window_Ref is access all Graphic_Bounds_Window; overriding procedure On_Init (This : in out Graphic_Bounds_Window); overriding procedure On_Displayed (This : in out Graphic_Bounds_Window); overriding procedure On_Hidden (This : in out Graphic_Bounds_Window); overriding procedure Draw (This : in out Graphic_Bounds_Window; Ctx : in out Giza.Context.Class; Force : Boolean := True); private type Graphic_Bounds_Window is new Test_Window with record Evt : aliased Timer_Event; Bound_Btn : Button.Ref; end record; end Test_Graphic_Bounds;
programs/oeis/157/A157854.asm
neoneye/loda
22
29346
<reponame>neoneye/loda<filename>programs/oeis/157/A157854.asm<gh_stars>10-100 ; A157854: 1728000n - 384240. ; 1343760,3071760,4799760,6527760,8255760,9983760,11711760,13439760,15167760,16895760,18623760,20351760,22079760,23807760,25535760,27263760,28991760,30719760,32447760,34175760,35903760,37631760,39359760,41087760,42815760,44543760,46271760,47999760,49727760,51455760,53183760,54911760,56639760,58367760,60095760,61823760,63551760,65279760,67007760,68735760,70463760,72191760,73919760,75647760,77375760,79103760,80831760,82559760,84287760,86015760,87743760,89471760,91199760,92927760,94655760,96383760,98111760,99839760,101567760,103295760,105023760,106751760,108479760,110207760,111935760,113663760,115391760,117119760,118847760,120575760,122303760,124031760,125759760,127487760,129215760,130943760,132671760,134399760,136127760,137855760,139583760,141311760,143039760,144767760,146495760,148223760,149951760,151679760,153407760,155135760,156863760,158591760,160319760,162047760,163775760,165503760,167231760,168959760,170687760,172415760 mul $0,1728000 add $0,1343760
Cubical/Data/Empty/Properties.agda
dan-iel-lee/cubical
0
14661
<reponame>dan-iel-lee/cubical<filename>Cubical/Data/Empty/Properties.agda {-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.Data.Empty.Properties where open import Cubical.Core.Everything open import Cubical.Foundations.Prelude open import Cubical.Foundations.Isomorphism open import Cubical.Data.Empty.Base isProp⊥ : isProp ⊥ isProp⊥ () isContr⊥→A : ∀ {ℓ} {A : Type ℓ} → isContr (⊥ → A) fst isContr⊥→A () snd isContr⊥→A f i () uninhabEquiv : ∀ {ℓ ℓ'} {A : Type ℓ} {B : Type ℓ'} → (A → ⊥) → (B → ⊥) → A ≃ B uninhabEquiv ¬a ¬b = isoToEquiv isom where open Iso isom : Iso _ _ isom .fun a = rec (¬a a) isom .inv b = rec (¬b b) isom .rightInv b = rec (¬b b) isom .leftInv a = rec (¬a a)
src/third_party/nasm/test/br3028880.asm
Mr-Sheep/naiveproxy
2,219
81032
;Testname=br3028880; Arguments=-Ox -fbin -obr3028880.o; Files=stdout stderr br3028880.o %macro import 1 %define %%incfile %!PROJECTBASEDIR/%{1}.inc %endmacro import foo
07/MemoryAccess/StaticTest/StaticTest.asm
Savioor/nand2tetris2022-public
0
82445
<gh_stars>0 // push constant 111 @111 D = A @SP M = M + 1 A = M - 1 M = D // push constant 333 @333 D = A @SP M = M + 1 A = M - 1 M = D // push constant 888 @888 D = A @SP M = M + 1 A = M - 1 M = D // pop static 8 @8 D = A @16 D = A + D @R13 M = D @SP M = M - 1 A = M D = M @R13 A = M M = D // pop static 3 @3 D = A @16 D = A + D @R13 M = D @SP M = M - 1 A = M D = M @R13 A = M M = D // pop static 1 @1 D = A @16 D = A + D @R13 M = D @SP M = M - 1 A = M D = M @R13 A = M M = D // push static 3 @3 D = A @16 A = A + D D = M @SP M = M + 1 A = M - 1 M = D // push static 1 @1 D = A @16 A = A + D D = M @SP M = M + 1 A = M - 1 M = D // sub @SP A = M - 1 A = A - 1 D = M A = A + 1 D = D - M A = A - 1 M = D @SP M = M - 1 // push static 8 @8 D = A @16 A = A + D D = M @SP M = M + 1 A = M - 1 M = D // add @SP A = M - 1 A = A - 1 D = M A = A + 1 D = D + M A = A - 1 M = D @SP M = M - 1
libsrc/_DEVELOPMENT/math/float/math48/c/sccz80/cm48_sccz80p_ddiv.asm
meesokim/z88dk
0
161170
SECTION code_fp_math48 PUBLIC cm48_sccz80p_ddiv EXTERN am48_ddiv cm48_sccz80p_ddiv: ; sccz80 float primitive ; divide math48 doubles ; ; enter : AC'(BCDEHL') = divisor = double x ; stack = dividend y, ret ; ; exit : AC'(BCDEHL') = y/x ; ; uses : AF, BC, DE, HL, AF', BC', DE', HL' pop af pop hl ; AC = y pop de pop bc push af exx jp am48_ddiv
boot-info-table.asm
miles-canfield/Lassen-Peak
0
2083
boot_info_table_addr equ 0x00000000 struc boot_info_table_struc pit_irq: resb 1 keyboard_irq: resb 1 ioapic_count: resb 1 processor_count: resb 1 tsc_frequency: resd 1 ;khz lapic_address: resq 1 ioapic_address: resq 1 ioapic_id: resd 1 processor_list: resw 256 ;msb=processor-id lsb=apic-id endstruc
programs/oeis/063/A063196.asm
neoneye/loda
22
80309
; A063196: Dimension of the space of weight 2n cuspidal newforms for Gamma_0( 7 ). ; 0,1,3,3,5,5,7,7,9,9,11,11,13,13,15,15,17,17,19,19,21,21,23,23,25,25,27,27,29,29,31,31,33,33,35,35,37,37,39,39,41,41,43,43,45,45,47,47,49,49,51,51,53,53,55,55,57,57,59,59,61,61,63,63,65,65,67,67,69,69,71,71,73,73,75,75,77,77,79,79,81,81,83,83,85,85,87,87,89,89,91,91,93,93,95,95,97,97,99,99 mov $1,$0 trn $1,1 mod $1,2 add $0,$1