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
Cubical/Algebra/CommRing/Base.agda
Edlyr/cubical
0
9664
{-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.Algebra.CommRing.Base where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Equiv open import Cubical.Foundations.Equiv.HalfAdjoint open import Cubical.Foundations.HLevels open import Cubical.Foundations.Isomorphism open import Cubical.Foundations.Univalence open import Cubical.Foundations.Transport open import Cubical.Foundations.SIP open import Cubical.Data.Sigma open import Cubical.Reflection.StrictEquiv open import Cubical.Structures.Axioms open import Cubical.Algebra.Semigroup open import Cubical.Algebra.Monoid open import Cubical.Algebra.AbGroup open import Cubical.Algebra.Ring.Base open Iso private variable ℓ : Level record IsCommRing {R : Type ℓ} (0r 1r : R) (_+_ _·_ : R → R → R) (-_ : R → R) : Type ℓ where constructor iscommring field isRing : IsRing 0r 1r _+_ _·_ -_ ·-comm : (x y : R) → x · y ≡ y · x open IsRing isRing public record CommRingStr (A : Type ℓ) : Type (ℓ-suc ℓ) where constructor commringstr field 0r : A 1r : A _+_ : A → A → A _·_ : A → A → A -_ : A → A isCommRing : IsCommRing 0r 1r _+_ _·_ -_ infix 8 -_ infixl 7 _·_ infixl 6 _+_ open IsCommRing isCommRing public CommRing : Type (ℓ-suc ℓ) CommRing = TypeWithStr _ CommRingStr makeIsCommRing : {R : Type ℓ} {0r 1r : R} {_+_ _·_ : R → R → R} { -_ : R → R} (is-setR : isSet R) (+-assoc : (x y z : R) → x + (y + z) ≡ (x + y) + z) (+-rid : (x : R) → x + 0r ≡ x) (+-rinv : (x : R) → x + (- x) ≡ 0r) (+-comm : (x y : R) → x + y ≡ y + x) (·-assoc : (x y z : R) → x · (y · z) ≡ (x · y) · z) (·-rid : (x : R) → x · 1r ≡ x) (·-rdist-+ : (x y z : R) → x · (y + z) ≡ (x · y) + (x · z)) (·-comm : (x y : R) → x · y ≡ y · x) → IsCommRing 0r 1r _+_ _·_ -_ makeIsCommRing {_+_ = _+_} is-setR +-assoc +-rid +-rinv +-comm ·-assoc ·-rid ·-rdist-+ ·-comm = iscommring (makeIsRing is-setR +-assoc +-rid +-rinv +-comm ·-assoc ·-rid (λ x → ·-comm _ _ ∙ ·-rid x) ·-rdist-+ (λ x y z → ·-comm _ _ ∙∙ ·-rdist-+ z x y ∙∙ λ i → (·-comm z x i) + (·-comm z y i))) ·-comm makeCommRing : {R : Type ℓ} (0r 1r : R) (_+_ _·_ : R → R → R) (-_ : R → R) (is-setR : isSet R) (+-assoc : (x y z : R) → x + (y + z) ≡ (x + y) + z) (+-rid : (x : R) → x + 0r ≡ x) (+-rinv : (x : R) → x + (- x) ≡ 0r) (+-comm : (x y : R) → x + y ≡ y + x) (·-assoc : (x y z : R) → x · (y · z) ≡ (x · y) · z) (·-rid : (x : R) → x · 1r ≡ x) (·-rdist-+ : (x y z : R) → x · (y + z) ≡ (x · y) + (x · z)) (·-comm : (x y : R) → x · y ≡ y · x) → CommRing makeCommRing 0r 1r _+_ _·_ -_ is-setR +-assoc +-rid +-rinv +-comm ·-assoc ·-rid ·-rdist-+ ·-comm = _ , commringstr _ _ _ _ _ (makeIsCommRing is-setR +-assoc +-rid +-rinv +-comm ·-assoc ·-rid ·-rdist-+ ·-comm) CommRing→Ring : CommRing {ℓ} → Ring CommRing→Ring (_ , commringstr _ _ _ _ _ H) = _ , ringstr _ _ _ _ _ (IsCommRing.isRing H) CommRingEquiv : (R S : CommRing) (e : ⟨ R ⟩ ≃ ⟨ S ⟩) → Type ℓ CommRingEquiv R S e = RingEquiv (CommRing→Ring R) (CommRing→Ring S) e CommRingHom : (R S : CommRing) → Type ℓ CommRingHom R S = RingHom (CommRing→Ring R) (CommRing→Ring S) module CommRingΣTheory {ℓ} where open RingΣTheory CommRingAxioms : (R : Type ℓ) (s : RawRingStructure R) → Type ℓ CommRingAxioms R (_+_ , 1r , _·_) = RingAxioms R (_+_ , 1r , _·_) × ((x y : R) → x · y ≡ y · x) CommRingStructure : Type ℓ → Type ℓ CommRingStructure = AxiomsStructure RawRingStructure CommRingAxioms CommRingΣ : Type (ℓ-suc ℓ) CommRingΣ = TypeWithStr ℓ CommRingStructure CommRingEquivStr : StrEquiv CommRingStructure ℓ CommRingEquivStr = AxiomsEquivStr RawRingEquivStr CommRingAxioms isPropCommRingAxioms : (R : Type ℓ) (s : RawRingStructure R) → isProp (CommRingAxioms R s) isPropCommRingAxioms R (_·_ , 0r , _+_) = isPropΣ (isPropRingAxioms R (_·_ , 0r , _+_)) λ { (_ , x , _) → isPropΠ2 λ _ _ → x .IsMonoid.isSemigroup .IsSemigroup.is-set _ _} CommRing→CommRingΣ : CommRing → CommRingΣ CommRing→CommRingΣ (_ , commringstr _ _ _ _ _ (iscommring G C)) = _ , _ , Ring→RingΣ (_ , ringstr _ _ _ _ _ G) .snd .snd , C CommRingΣ→CommRing : CommRingΣ → CommRing CommRingΣ→CommRing (_ , _ , G , C) = _ , commringstr _ _ _ _ _ (iscommring (RingΣ→Ring (_ , _ , G) .snd .RingStr.isRing) C) CommRingIsoCommRingΣ : Iso CommRing CommRingΣ CommRingIsoCommRingΣ = iso CommRing→CommRingΣ CommRingΣ→CommRing (λ _ → refl) (λ _ → refl) commRingUnivalentStr : UnivalentStr CommRingStructure CommRingEquivStr commRingUnivalentStr = axiomsUnivalentStr _ isPropCommRingAxioms rawRingUnivalentStr CommRingΣPath : (R S : CommRingΣ) → (R ≃[ CommRingEquivStr ] S) ≃ (R ≡ S) CommRingΣPath = SIP commRingUnivalentStr CommRingEquivΣ : (R S : CommRing) → Type ℓ CommRingEquivΣ R S = CommRing→CommRingΣ R ≃[ CommRingEquivStr ] CommRing→CommRingΣ S CommRingPath : (R S : CommRing) → (Σ[ e ∈ ⟨ R ⟩ ≃ ⟨ S ⟩ ] CommRingEquiv R S e) ≃ (R ≡ S) CommRingPath R S = Σ[ e ∈ ⟨ R ⟩ ≃ ⟨ S ⟩ ] CommRingEquiv R S e ≃⟨ strictIsoToEquiv RingIsoΣPath ⟩ CommRingEquivΣ R S ≃⟨ CommRingΣPath _ _ ⟩ CommRing→CommRingΣ R ≡ CommRing→CommRingΣ S ≃⟨ isoToEquiv (invIso (congIso CommRingIsoCommRingΣ)) ⟩ R ≡ S ■ CommRingPath : (R S : CommRing {ℓ}) → (Σ[ e ∈ ⟨ R ⟩ ≃ ⟨ S ⟩ ] CommRingEquiv R S e) ≃ (R ≡ S) CommRingPath = CommRingΣTheory.CommRingPath isSetCommRing : ((R , str) : CommRing {ℓ}) → isSet R isSetCommRing (R , str) = str .CommRingStr.is-set isPropIsCommRing : {R : Type ℓ} (0r 1r : R) (_+_ _·_ : R → R → R) (-_ : R → R) → isProp (IsCommRing 0r 1r _+_ _·_ -_) isPropIsCommRing 0r 1r _+_ _·_ -_ (iscommring RR RC) (iscommring SR SC) = λ i → iscommring (isPropIsRing _ _ _ _ _ RR SR i) (isPropComm RC SC i) where isSetR : isSet _ isSetR = RR .IsRing.·IsMonoid .IsMonoid.isSemigroup .IsSemigroup.is-set isPropComm : isProp ((x y : _) → x · y ≡ y · x) isPropComm = isPropΠ2 λ _ _ → isSetR _ _
src/Arch/Intel/VMXa.asm
themagicaldeveloper/HyperBone
1
94594
<gh_stars>1-10 ;++ ; ; Copyright (c) <NAME>. All rights reserved. ; ; Module: ; ; VMXa.asm ; ; Abstract: ; ; This module implements AMD64-specific routines for the Simple Hyper Visor. ; ; Author: ; ; <NAME> (@aionescu) 16-Mar-2016 - Initial version ; ; Environment: ; ; Kernel mode only. ; ;-- extern VmxpExitHandler:proc extern RtlCaptureContext:proc .CODE VmxVMEntry PROC push rcx ; save RCX, as we will need to orverride it lea rcx, [rsp+8h] ; store the context in the stack, bias for ; the return address and the push we just did. call RtlCaptureContext ; save the current register state. ; note that this is a specially written function ; which has the following key characteristics: ; 1) it does not taint the value of RCX ; 2) it does not spill any registers, nor ; expect home space to be allocated for it jmp VmxpExitHandler ; jump to the C code handler. we assume that it ; compiled with optimizations and does not use ; home space, which is true of release builds. VmxVMEntry ENDP VmxVMCleanup PROC mov ds, cx ; set DS to parameter 1 mov es, cx ; set ES to parameter 1 mov fs, dx ; set FS to parameter 2 ret ; return VmxVMCleanup ENDP VmxpResume PROC vmresume ret VmxpResume ENDP __vmx_vmcall PROC vmcall ret __vmx_vmcall ENDP __invept PROC invept rcx, OWORD PTR [rdx] ret __invept ENDP __invvpid PROC invvpid rcx, OWORD PTR [rdx] ret __invvpid ENDP END
src/music_2.ads
thomas070605/shoot-n-loot
0
5888
-- Shoot'n'loot -- Copyright (c) 2020 <NAME> with VirtAPU; use VirtAPU; package Music_2 is C_32nd : constant Command := (Wait_Ticks, 1); C_16th : constant Command := (Wait_Ticks, C_32nd.Ticks * 2); C_8th : constant Command := (Wait_Ticks, C_16th.Ticks * 2); C_Quarter : constant Command := (Wait_Ticks, C_8th.Ticks * 2); C_Half : constant Command := (Wait_Ticks, C_Quarter.Ticks * 2); C_Whole : constant Command := (Wait_Ticks, C_Half.Ticks * 2); C_Double : constant Command := (Wait_Ticks, C_Whole.Ticks * 2); C_Long : constant Command := (Wait_Ticks, C_Double.Ticks * 2); Kick : aliased constant Command_Array := ((Set_Decay, 6), (Set_Sweep, Up, 7, 0), (Set_Mode, Noise_2), (Note_On, 150.0), Off ); Snare : aliased constant Command_Array := ((Set_Decay, 6), (Set_Mode, Noise_1), (Note_On, 2000.0), Off ); Hi_Hat : aliased constant Command_Array := ((Set_Decay, 2), (Set_Mode, Noise_1), (Note_On, 10000.0), Off ); Beat_1 : constant Command_Array := Kick & C_Whole & Snare & C_Whole & Kick & C_Whole & Snare & C_Whole; Drums : aliased constant Command_Array := Beat_1; Bass_1 : constant Command_Array := C3 & C_Half & Off & C_Quarter & As2 & C_Half & Off & C_Quarter & C3 & C_Half & Off & C_Double; Bass_2 : constant Command_Array := Gs2 & C_Quarter & Off & C_Half & Ds3 & C_Quarter & Off & C_Half & Gs2 & C_Quarter & Off & C_Quarter & G2 & C_Quarter & Off & C_Half & As2 & C_Quarter & Off & C_Half & B2 & C_Quarter & Off & C_Quarter; Bass_3 : constant Command_Array := C3 & C_Half & Off & C_Quarter & C3 & C_Quarter & Off & C_Quarter & As2 & C_Quarter & C3 & C_Quarter & Off & C_Quarter & C_Quarter & C_Quarter & C_Quarter & C_Quarter & C_Quarter & C_Quarter & C_Quarter & C_Quarter; Bass_4 : constant Command_Array := Gs2 & C_Quarter & Off & C_Half & Ds3 & C_Quarter & Off & C_Half & Gs2 & C_Quarter & Off & C_Quarter & G2 & C_Quarter & Off & C_Half & D3 & C_Quarter & Off & C_Half & G2 & C_Quarter & Off & C_Quarter; Bass : aliased constant Command_Array := Bass_1 & Bass_2 & Bass_3 & Bass_4; end Music_2;
alloy4fun_models/trashltl/models/11/mfFao4anZyZwFvZJY.als
Kaixi26/org.alloytools.alloy
0
3343
open main pred idmfFao4anZyZwFvZJY_prop12 { always all f: File | eventually f in Trash and eventually f in Trash releases f not in Trash } pred __repair { idmfFao4anZyZwFvZJY_prop12 } check __repair { idmfFao4anZyZwFvZJY_prop12 <=> prop12o }
Groups/Homomorphisms/Lemmas2.agda
Smaug123/agdaproofs
4
2411
<gh_stars>1-10 {-# OPTIONS --safe --warning=error --without-K #-} open import LogicalFormulae open import Groups.Groups open import Groups.Homomorphisms.Definition open import Groups.Definition open import Numbers.Naturals.Naturals open import Setoids.Setoids open import Functions.Definition open import Sets.EquivalenceRelations open import Agda.Primitive using (Level; lzero; lsuc; _⊔_) module Groups.Homomorphisms.Lemmas2 {a b : _} {A : Set a} {S : Setoid {a} {b} A} {_+A_ : A → A → A} (G : Group S _+A_) where imageGroup : {c d : _} {B : Set c} {T : Setoid {c} {d} B} {_+B_ : B → B → B} → (f : A → B) → SetoidSurjection S T f → ({x y : A} → Setoid._∼_ T (f (x +A y)) ((f x) +B (f y))) → ({x y m n : B} → Setoid._∼_ T x m → Setoid._∼_ T y n → Setoid._∼_ T (x +B y) (m +B n)) → Group T _+B_ Group.+WellDefined (imageGroup f surj respects+ wd) {m} {n} {x} {y} = wd Group.0G (imageGroup f surj respects+ wd) = f (Group.0G G) Group.inverse (imageGroup f record { wellDefined = wellDefined ; surjective = surjective } respects+ wd) b with surjective {b} Group.inverse (imageGroup f record { wellDefined = wellDefined ; surjective = surjective } respects+ wd) b | a , fa=b = f (Group.inverse G a) Group.+Associative (imageGroup {T = T} f record { wellDefined = wellDefined ; surjective = surjective } respects+ wd) {a} {b} {c} with surjective {a} ... | x , fx=a with surjective {b} ... | y , fy=b with surjective {c} ... | z , fz=c = transitive (wd (symmetric fx=a) (transitive (wd (symmetric fy=b) (symmetric fz=c)) (symmetric respects+))) (transitive (transitive (symmetric respects+) (transitive (wellDefined (Group.+Associative G)) respects+)) (wd (transitive respects+ (wd fx=a fy=b)) fz=c)) where open Setoid T open Equivalence eq Group.identRight (imageGroup {T = T} f record { wellDefined = wd ; surjective = surjective } respects+ bWd) {b} with surjective {b} ... | a , fa=b = transitive (bWd (symmetric fa=b) reflexive) (transitive (symmetric respects+) (transitive (wd (Group.identRight G)) fa=b)) where open Setoid T open Equivalence eq Group.identLeft (imageGroup {T = T} f record { wellDefined = wellDefined ; surjective = surjective } respects+ wd) {b} with surjective {b} ... | a , fa=b = transitive (wd reflexive (symmetric fa=b)) (transitive (symmetric respects+) (transitive (wellDefined (Group.identLeft G)) fa=b)) where open Setoid T open Equivalence eq Group.invLeft (imageGroup {T = T} f record { wellDefined = wellDefined ; surjective = surjective } respects+ wd) {b} with surjective {b} Group.invLeft (imageGroup {T = T} f record { wellDefined = wellDefined ; surjective = surjective } respects+ wd) {b} | a , fa=b = transitive (wd reflexive (symmetric fa=b)) (transitive (symmetric respects+) (wellDefined (Group.invLeft G))) where open Setoid T open Equivalence eq Group.invRight (imageGroup f record { wellDefined = wellDefined ; surjective = surjective } respects+ wd) {b} with surjective {b} Group.invRight (imageGroup {T = T} f record { wellDefined = wellDefined ; surjective = surjective } respects+ wd) {b} | a , fa=b = transitive (wd (symmetric fa=b) reflexive) (transitive (symmetric respects+) (wellDefined (Group.invRight G))) where open Setoid T open Equivalence eq homToImageGroup : {c d : _} {B : Set c} {T : Setoid {c} {d} B} {_+B_ : B → B → B} → (f : A → B) → (surj : SetoidSurjection S T f) → (respects+ : {x y : A} → Setoid._∼_ T (f (x +A y)) ((f x) +B (f y))) → (wd : {x y m n : B} → Setoid._∼_ T x m → Setoid._∼_ T y n → Setoid._∼_ T (x +B y) (m +B n)) → GroupHom G (imageGroup f surj respects+ wd) f GroupHom.groupHom (homToImageGroup f surj respects+ wd) = respects+ GroupHom.wellDefined (homToImageGroup f surj respects+ wd) = SetoidSurjection.wellDefined surj
src/guard_mode_patch.asm
mvdhout1992/ts-patches
33
12013
%include "TiberianSun.inc" %include "macros/patch.inc" %include "macros/datatypes.inc" ;;; http://www.ppmforums.com/viewtopic.php?t=38895 ; # Units in Guard mode will no longer chase after enemies that move out of firing range @CLEAR 0x004A1AA8, 0x90, 0x004A1AAA
Gathered CTF writeups/hitcon_quals_2018/eop/eop_disas.asm
mihaid-b/CyberSakura
1
101742
; ---------------- Node 31 at 0x555555559ADC. Next: 3A ---------------- mov [rbp+iter_14], 0 cmp [rbp+iter_14], 0Fh jg short END_XOR_555555559B66 mov eax, [rbp+iter_14] movsxd rdx, eax lea rax, pwd_1_5555557671A0 movzx ecx, byte ptr [rdx+rax] ; ecx = pwd[0] mov eax, [rbp+iter_14] movsxd rdx, eax lea rax, enc_blk_1_5555557671B0 movzx eax, byte ptr [rdx+rax] xor ecx, eax ; pwd[0:16] ^= enc_blk_1/2[0:16] mov eax, [rbp+iter_14] movsxd rdx, eax lea rax, pwd_1_5555557671A0 mov [rdx+rax], cl add [rbp+iter_14], 1 jmp short XOR_LOOP_555555559B26 ; ---------------- Node 3A at 0x55555555AE98. Next: 3B ---------------- movzx eax, byte ptr cs:pwd_1_5555557671A0 movzx eax, al movzx edx, byte ptr cs:pwd_1_5555557671A0+1 movzx edx, dl shl edx, 8 or edx, eax movzx eax, byte ptr cs:pwd_1_5555557671A0+2 movzx eax, al shl eax, 10h or edx, eax movzx eax, byte ptr cs:pwd_1_5555557671A0+3 movzx eax, al shl eax, 18h or edx, eax ; edx = atoi(pwd_1[0:4]) mov rax, cs:tbl_A_555555767150 mov eax, [rax] xor eax, edx mov cs:tmp_A_5555557671C0, eax ; tmp_A = atoi(pwd_1[0:4]) ^ tbl_A[0] ; ---------------- Node 3B at 0x55555555A026. Next: 3 ---------------- movzx eax, byte ptr cs:pwd_1_5555557671A0+4 movzx eax, al movzx edx, byte ptr cs:pwd_1_5555557671A0+5 movzx edx, dl shl edx, 8 or edx, eax movzx eax, byte ptr cs:pwd_1_5555557671A0+6 movzx eax, al shl eax, 10h or edx, eax movzx eax, byte ptr cs:pwd_1_5555557671A0+7 movzx eax, al shl eax, 18h or edx, eax ; edx = atoi(pwd[4:8]) mov rax, cs:tbl_A_555555767150 mov eax, [rax+4] xor eax, edx mov cs:tmp_B_5555557671C4, eax ; tmp_B = edx = atoi(pwd[4:8]) ^ tbl_A[1] ; ---------------- Node 3 at 0x55555555AFE2. Next: 13 ---------------- movzx eax, byte ptr cs:pwd_2_5555557671A8 movzx eax, al movzx edx, byte ptr cs:pwd_2_5555557671A8+1 movzx edx, dl shl edx, 8 or edx, eax movzx eax, byte ptr cs:pwd_2_5555557671A8+2 movzx eax, al shl eax, 10h or edx, eax movzx eax, byte ptr cs:pwd_2_5555557671A8+3 movzx eax, al shl eax, 18h or edx, eax mov rax, cs:tbl_A_555555767150 mov eax, [rax+8] xor eax, edx mov cs:tmp_C_5555557671C8, eax ; tmp_C = atoi(pwd_2[0:4]) ^ tbl_A[2] ; ---------------- Node 13 at 0x55555555BC30. Next: 0 ---------------- movzx eax, byte ptr cs:pwd_2_5555557671A8+4 movzx eax, al movzx edx, byte ptr cs:pwd_2_5555557671A8+5 movzx edx, dl shl edx, 8 or edx, eax movzx eax, byte ptr cs:pwd_2_5555557671A8+6 movzx eax, al shl eax, 10h or edx, eax movzx eax, byte ptr cs:pwd_2_5555557671A8+7 movzx eax, al shl eax, 18h or edx, eax mov rax, cs:tbl_A_555555767150 mov eax, [rax+0Ch] xor eax, edx mov cs:tmp_D_5555557671CC, eax ; tmp_D = atoi(pwd_2[4:8]) ^ tbl_A[3] ; ---------------- Node 0 at 0x55555555A1E6. Next: C ---------------- ; ---------------- Node C at 0x55555555BB34. Next: 49 ---------------- mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_A_5555557671C0 movzx edx, dl mov edx, edx add rdx, 40h ; sub_A = tbl_A + 0x40 mov edx, [rax+rdx*4] ; edx = sub_A[tmp_A & 0xFF] = sub_A[BYTE_1(tmp_A)] mov rax, cs:tbl_A_555555767150 mov ecx, cs:tmp_A_5555557671C0 shr ecx, 8 movzx ecx, cl mov ecx, ecx add rcx, 140h ; sub_B = tbl_A + 0x140 mov eax, [rax+rcx*4] mov ecx, edx xor ecx, eax ; ecx = sub_A[tmp_A & 0xFF] ^ sub_B[(tmp_A >> 8) & 0xFF]) mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_A_5555557671C0 shr edx, 10h movzx edx, dl mov edx, edx add rdx, 240h ; sub_C = tbl_A + 0x240 mov eax, [rax+rdx*4] xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_A_5555557671C0 shr edx, 18h mov edx, edx add rdx, 340h ; sub_D = tbl_A + 0x340 mov eax, [rax+rdx*4] xor eax, ecx mov cs:tmp_E_5555557671D0, eax ; tmp_E = sub_A[B1(tmp_A)] ^ sub_B[B2(tmp_A)] ^ sub_C[B3(tmp_A)] ^ sub_D[B4(tmp_A)] ; ---------------- Node 49 at 0x55555555D282. Next: 21 ---------------- mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_B_5555557671C4 shr edx, 18h mov edx, edx add rdx, 40h mov edx, [rax+rdx*4] ; a = sub_A[B4(tmp_B)] mov rax, cs:tbl_A_555555767150 mov ecx, cs:tmp_B_5555557671C4 movzx ecx, cl mov ecx, ecx add rcx, 140h mov eax, [rax+rcx*4] ; b = sub_B[B1(tmp_B)] mov ecx, edx xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_B_5555557671C4 shr edx, 8 movzx edx, dl mov edx, edx add rdx, 240h mov eax, [rax+rdx*4] ; c = sub_C[B2(tmp_B)] xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_B_5555557671C4 shr edx, 10h movzx edx, dl mov edx, edx add rdx, 340h mov eax, [rax+rdx*4] ; d = sub_D[B3(tmp_B)] xor eax, ecx mov cs:tmp_F_5555557671D4, eax ; tmp_F = a ^ b ^ c ^ d ; ---------------- Node 21 at 0x55555555A7D2. Next: 19 ---------------- mov edx, cs:tmp_E_5555557671D0 mov eax, cs:tmp_F_5555557671D4 add edx, eax mov rax, cs:tbl_A_555555767150 mov eax, [rax+20h] add edx, eax ; edx = tmp_E + tmp_F + tbl_A[8] mov eax, cs:tmp_C_5555557671C8 xor eax, edx mov cs:tmp_C_5555557671C8, eax ; tmp_C ^= tmp_E + tmp_F + tbl_A[8] ; ---------------- Node 19 at 0x55555555DD88. Next: 1F ---------------- mov eax, cs:tmp_C_5555557671C8 ror eax, 1 ; tmp_C = ror(tmp_C, 1) mov cs:tmp_C_5555557671C8, eax ; ---------------- Node 1F at 0x55555555E1EA. Next: 39 ---------------- mov eax, cs:tmp_D_5555557671CC rol eax, 1 ; tmp_D = rol(tmp_D, 1) mov cs:tmp_D_5555557671CC, eax ; ---------------- Node 39 at 0x55555555C51E. Next: 47 ---------------- mov eax, cs:tmp_F_5555557671D4 lea edx, [rax+rax] ; edx = tmp_F * 2 (32 bit) mov eax, cs:tmp_E_5555557671D0 add edx, eax ; edx = 2*tmp_F + tmp_E (32 bit) mov rax, cs:tbl_A_555555767150 mov eax, [rax+24h] add edx, eax mov eax, cs:tmp_D_5555557671CC xor eax, edx mov cs:tmp_D_5555557671CC, eax ; tmp_D ^= 2*tmp_F + tmp_E + tbl_A[9] ; ---------------- Node 47 at 0x55555555A0EA. Next: 3D ---------------- mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_C_5555557671C8 movzx edx, dl mov edx, edx add rdx, 40h mov edx, [rax+rdx*4] mov rax, cs:tbl_A_555555767150 mov ecx, cs:tmp_C_5555557671C8 shr ecx, 8 movzx ecx, cl mov ecx, ecx add rcx, 140h mov eax, [rax+rcx*4] mov ecx, edx xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_C_5555557671C8 shr edx, 10h movzx edx, dl mov edx, edx add rdx, 240h mov eax, [rax+rdx*4] xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_C_5555557671C8 shr edx, 18h mov edx, edx add rdx, 340h mov eax, [rax+rdx*4] xor eax, ecx mov cs:tmp_E_5555557671D0, eax ; ---------------- Node 3D at 0x55555555CCC8. Next: A ---------------- mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_D_5555557671CC shr edx, 18h mov edx, edx add rdx, 40h mov edx, [rax+rdx*4] mov rax, cs:tbl_A_555555767150 mov ecx, cs:tmp_D_5555557671CC movzx ecx, cl mov ecx, ecx add rcx, 140h mov eax, [rax+rcx*4] mov ecx, edx xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_D_5555557671CC shr edx, 8 movzx edx, dl mov edx, edx add rdx, 240h mov eax, [rax+rdx*4] xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_D_5555557671CC shr edx, 10h movzx edx, dl mov edx, edx add rdx, 340h mov eax, [rax+rdx*4] xor eax, ecx mov cs:tmp_F_5555557671D4, eax ; ---------------- Node A at 0x55555555DE9A. Next: 71 ---------------- mov edx, cs:tmp_E_5555557671D0 mov eax, cs:tmp_F_5555557671D4 add edx, eax mov rax, cs:tbl_A_555555767150 mov eax, [rax+28h] add edx, eax mov eax, cs:tmp_A_5555557671C0 xor eax, edx ; tmp_A ^= tmp_E + tmp_F + tbl_A[9] mov cs:tmp_A_5555557671C0, eax ; ---------------- Node 71 at 0x55555555DF3C. Next: 69 ---------------- mov eax, cs:tmp_A_5555557671C0 ror eax, 1 ; ror(tmp_A, 1) mov cs:tmp_A_5555557671C0, eax ; ---------------- Node 69 at 0x555555559F14. Next: 63 ---------------- mov eax, cs:tmp_B_5555557671C4 rol eax, 1 ; rol(tmp_B, 1) mov cs:tmp_B_5555557671C4, eax ; ---------------- Node 63 at 0x55555555BD7C. Next: 76 ---------------- mov eax, cs:tmp_F_5555557671D4 lea edx, [rax+rax] mov eax, cs:tmp_E_5555557671D0 add edx, eax mov rax, cs:tbl_A_555555767150 mov eax, [rax+2Ch] add edx, eax mov eax, cs:tmp_B_5555557671C4 xor eax, edx mov cs:tmp_B_5555557671C4, eax ; ---------------- Node 76 at 0x55555555D186. Next: 56 ---------------- mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_A_5555557671C0 movzx edx, dl mov edx, edx add rdx, 40h mov edx, [rax+rdx*4] mov rax, cs:tbl_A_555555767150 mov ecx, cs:tmp_A_5555557671C0 shr ecx, 8 movzx ecx, cl mov ecx, ecx add rcx, 140h mov eax, [rax+rcx*4] mov ecx, edx xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_A_5555557671C0 shr edx, 10h movzx edx, dl mov edx, edx add rdx, 240h mov eax, [rax+rdx*4] xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_A_5555557671C0 shr edx, 18h mov edx, edx add rdx, 340h mov eax, [rax+rdx*4] xor eax, ecx mov cs:tmp_E_5555557671D0, eax ; ---------------- Node 56 at 0x55555555B1F2. Next: 53 ---------------- mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_B_5555557671C4 shr edx, 18h mov edx, edx add rdx, 40h mov edx, [rax+rdx*4] mov rax, cs:tbl_A_555555767150 mov ecx, cs:tmp_B_5555557671C4 movzx ecx, cl mov ecx, ecx add rcx, 140h mov eax, [rax+rcx*4] mov ecx, edx xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_B_5555557671C4 shr edx, 8 movzx edx, dl mov edx, edx add rdx, 240h mov eax, [rax+rdx*4] xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_B_5555557671C4 shr edx, 10h movzx edx, dl mov edx, edx add rdx, 340h mov eax, [rax+rdx*4] xor eax, ecx mov cs:tmp_F_5555557671D4, eax ; ---------------- Node 53 at 0x55555555E0C0. Next: 5B ---------------- mov edx, cs:tmp_E_5555557671D0 mov eax, cs:tmp_F_5555557671D4 add edx, eax mov rax, cs:tbl_A_555555767150 mov eax, [rax+30h] add edx, eax mov eax, cs:tmp_C_5555557671C8 xor eax, edx mov cs:tmp_C_5555557671C8, eax ; ---------------- Node 5B at 0x55555555D056. Next: 1E ---------------- mov eax, cs:tmp_C_5555557671C8 ror eax, 1 mov cs:tmp_C_5555557671C8, eax ; ---------------- Node 1E at 0x55555555E162. Next: 20 ---------------- mov eax, cs:tmp_D_5555557671CC rol eax, 1 mov cs:tmp_D_5555557671CC, eax ; ---------------- Node 20 at 0x55555555D6FE. Next: 14 ---------------- mov eax, cs:tmp_F_5555557671D4 lea edx, [rax+rax] mov eax, cs:tmp_E_5555557671D0 add edx, eax mov rax, cs:tbl_A_555555767150 mov eax, [rax+34h] add edx, eax mov eax, cs:tmp_D_5555557671CC xor eax, edx mov cs:tmp_D_5555557671CC, eax ; ---------------- Node 14 at 0x55555555E38C. Next: 2F ---------------- mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_C_5555557671C8 movzx edx, dl mov edx, edx add rdx, 40h mov edx, [rax+rdx*4] mov rax, cs:tbl_A_555555767150 mov ecx, cs:tmp_C_5555557671C8 shr ecx, 8 movzx ecx, cl mov ecx, ecx add rcx, 140h mov eax, [rax+rcx*4] mov ecx, edx xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_C_5555557671C8 shr edx, 10h movzx edx, dl mov edx, edx add rdx, 240h mov eax, [rax+rdx*4] xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_C_5555557671C8 shr edx, 18h mov edx, edx add rdx, 340h mov eax, [rax+rdx*4] xor eax, ecx mov cs:tmp_E_5555557671D0, eax ; ---------------- Node 2F at 0x55555555DC8C. Next: 42 ---------------- mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_D_5555557671CC shr edx, 18h mov edx, edx add rdx, 40h mov edx, [rax+rdx*4] mov rax, cs:tbl_A_555555767150 mov ecx, cs:tmp_D_5555557671CC movzx ecx, cl mov ecx, ecx add rcx, 140h mov eax, [rax+rcx*4] mov ecx, edx xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_D_5555557671CC shr edx, 8 movzx edx, dl mov edx, edx add rdx, 240h mov eax, [rax+rdx*4] xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_D_5555557671CC shr edx, 10h movzx edx, dl mov edx, edx add rdx, 340h mov eax, [rax+rdx*4] xor eax, ecx mov cs:tmp_F_5555557671D4, eax ; ---------------- Node 42 at 0x55555555ABB0. Next: 11 ---------------- mov edx, cs:tmp_E_5555557671D0 mov eax, cs:tmp_F_5555557671D4 add edx, eax mov rax, cs:tbl_A_555555767150 mov eax, [rax+38h] add edx, eax mov eax, cs:tmp_A_5555557671C0 xor eax, edx mov cs:tmp_A_5555557671C0, eax ; ---------------- Node 11 at 0x55555555CB44. Next: 5C ---------------- mov eax, cs:tmp_A_5555557671C0 ror eax, 1 mov cs:tmp_A_5555557671C0, eax ; ---------------- Node 5C at 0x55555555EA52. Next: 37 ---------------- mov eax, cs:tmp_B_5555557671C4 rol eax, 1 mov cs:tmp_B_5555557671C4, eax ; ---------------- Node 37 at 0x55555555A8FC. Next: 1A ---------------- mov eax, cs:tmp_F_5555557671D4 lea edx, [rax+rax] mov eax, cs:tmp_E_5555557671D0 add edx, eax mov rax, cs:tbl_A_555555767150 mov eax, [rax+3Ch] add edx, eax mov eax, cs:tmp_B_5555557671C4 xor eax, edx mov cs:tmp_B_5555557671C4, eax ; ---------------- Node 1A at 0x555555559B9E. Next: 4C ---------------- mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_A_5555557671C0 movzx edx, dl mov edx, edx add rdx, 40h mov edx, [rax+rdx*4] mov rax, cs:tbl_A_555555767150 mov ecx, cs:tmp_A_5555557671C0 shr ecx, 8 movzx ecx, cl mov ecx, ecx add rcx, 140h mov eax, [rax+rcx*4] mov ecx, edx xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_A_5555557671C0 shr edx, 10h movzx edx, dl mov edx, edx add rdx, 240h mov eax, [rax+rdx*4] xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_A_5555557671C0 shr edx, 18h mov edx, edx add rdx, 340h mov eax, [rax+rdx*4] xor eax, ecx mov cs:tmp_E_5555557671D0, eax ; ---------------- Node 4C at 0x55555555A9A2. Next: 40 ---------------- mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_B_5555557671C4 shr edx, 18h mov edx, edx add rdx, 40h mov edx, [rax+rdx*4] mov rax, cs:tbl_A_555555767150 mov ecx, cs:tmp_B_5555557671C4 movzx ecx, cl mov ecx, ecx add rcx, 140h mov eax, [rax+rcx*4] mov ecx, edx xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_B_5555557671C4 shr edx, 8 movzx edx, dl mov edx, edx add rdx, 240h mov eax, [rax+rdx*4] xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_B_5555557671C4 shr edx, 10h movzx edx, dl mov edx, edx add rdx, 340h mov eax, [rax+rdx*4] xor eax, ecx mov cs:tmp_F_5555557671D4, eax ; ---------------- Node 40 at 0x55555555C75E. Next: 41 ---------------- mov edx, cs:tmp_E_5555557671D0 mov eax, cs:tmp_F_5555557671D4 add edx, eax mov rax, cs:tbl_A_555555767150 mov eax, [rax+40h] add edx, eax mov eax, cs:tmp_C_5555557671C8 xor eax, edx mov cs:tmp_C_5555557671C8, eax ; ---------------- Node 41 at 0x55555555E488. Next: 58 ---------------- mov eax, cs:tmp_C_5555557671C8 ror eax, 1 mov cs:tmp_C_5555557671C8, eax ; ---------------- Node 58 at 0x55555555BF1E. Next: 15 ---------------- mov eax, cs:tmp_D_5555557671CC rol eax, 1 mov cs:tmp_D_5555557671CC, eax ; ---------------- Node 15 at 0x55555555A72C. Next: 7B ---------------- mov eax, cs:tmp_F_5555557671D4 lea edx, [rax+rax] mov eax, cs:tmp_E_5555557671D0 add edx, eax mov rax, cs:tbl_A_555555767150 mov eax, [rax+44h] add edx, eax mov eax, cs:tmp_D_5555557671CC xor eax, edx mov cs:tmp_D_5555557671CC, eax ; ---------------- Node 7B at 0x55555555DB16. Next: 2A ---------------- mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_C_5555557671C8 movzx edx, dl mov edx, edx add rdx, 40h mov edx, [rax+rdx*4] mov rax, cs:tbl_A_555555767150 mov ecx, cs:tmp_C_5555557671C8 shr ecx, 8 movzx ecx, cl mov ecx, ecx add rcx, 140h mov eax, [rax+rcx*4] mov ecx, edx xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_C_5555557671C8 shr edx, 10h movzx edx, dl mov edx, edx add rdx, 240h mov eax, [rax+rdx*4] xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_C_5555557671C8 shr edx, 18h mov edx, edx add rdx, 340h mov eax, [rax+rdx*4] xor eax, ecx mov cs:tmp_E_5555557671D0, eax ; ---------------- Node 2A at 0x55555555A5A6. Next: 4 ---------------- mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_D_5555557671CC shr edx, 18h mov edx, edx add rdx, 40h mov edx, [rax+rdx*4] mov rax, cs:tbl_A_555555767150 mov ecx, cs:tmp_D_5555557671CC movzx ecx, cl mov ecx, ecx add rcx, 140h mov eax, [rax+rcx*4] mov ecx, edx xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_D_5555557671CC shr edx, 8 movzx edx, dl mov edx, edx add rdx, 240h mov eax, [rax+rdx*4] xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_D_5555557671CC shr edx, 10h movzx edx, dl mov edx, edx add rdx, 340h mov eax, [rax+rdx*4] xor eax, ecx mov cs:tmp_F_5555557671D4, eax ; ---------------- Node 4 at 0x555555559C9A. Next: 78 ---------------- mov edx, cs:tmp_E_5555557671D0 mov eax, cs:tmp_F_5555557671D4 add edx, eax mov rax, cs:tbl_A_555555767150 mov eax, [rax+48h] add edx, eax mov eax, cs:tmp_A_5555557671C0 xor eax, edx mov cs:tmp_A_5555557671C0, eax ; ---------------- Node 78 at 0x55555555E598. Next: 7A ---------------- mov eax, cs:tmp_A_5555557671C0 ror eax, 1 mov cs:tmp_A_5555557671C0, eax ; ---------------- Node 7A at 0x55555555B4E6. Next: 50 ---------------- mov eax, cs:tmp_B_5555557671C4 rol eax, 1 mov cs:tmp_B_5555557671C4, eax ; ---------------- Node 50 at 0x55555555D974. Next: 26 ---------------- mov eax, cs:tmp_F_5555557671D4 lea edx, [rax+rax] mov eax, cs:tmp_E_5555557671D0 add edx, eax mov rax, cs:tbl_A_555555767150 mov eax, [rax+4Ch] add edx, eax mov eax, cs:tmp_B_5555557671C4 xor eax, edx mov cs:tmp_B_5555557671C4, eax ; ---------------- Node 26 at 0x55555555CBCC. Next: 8 ---------------- mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_A_5555557671C0 movzx edx, dl mov edx, edx add rdx, 40h mov edx, [rax+rdx*4] mov rax, cs:tbl_A_555555767150 mov ecx, cs:tmp_A_5555557671C0 shr ecx, 8 movzx ecx, cl mov ecx, ecx add rcx, 140h mov eax, [rax+rcx*4] mov ecx, edx xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_A_5555557671C0 shr edx, 10h movzx edx, dl mov edx, edx add rdx, 240h mov eax, [rax+rdx*4] xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_A_5555557671C0 shr edx, 18h mov edx, edx add rdx, 340h mov eax, [rax+rdx*4] xor eax, ecx mov cs:tmp_E_5555557671D0, eax ; ---------------- Node 8 at 0x55555555B69E. Next: 17 ---------------- mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_B_5555557671C4 shr edx, 18h mov edx, edx add rdx, 40h mov edx, [rax+rdx*4] mov rax, cs:tbl_A_555555767150 mov ecx, cs:tmp_B_5555557671C4 movzx ecx, cl mov ecx, ecx add rcx, 140h mov eax, [rax+rcx*4] mov ecx, edx xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_B_5555557671C4 shr edx, 8 movzx edx, dl mov edx, edx add rdx, 240h mov eax, [rax+rdx*4] xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_B_5555557671C4 shr edx, 10h movzx edx, dl mov edx, edx add rdx, 340h mov eax, [rax+rdx*4] xor eax, ecx mov cs:tmp_F_5555557671D4, eax ; ---------------- Node 17 at 0x55555555ADF6. Next: 61 ---------------- mov edx, cs:tmp_E_5555557671D0 mov eax, cs:tmp_F_5555557671D4 add edx, eax mov rax, cs:tbl_A_555555767150 mov eax, [rax+50h] add edx, eax mov eax, cs:tmp_C_5555557671C8 xor eax, edx mov cs:tmp_C_5555557671C8, eax ; ---------------- Node 61 at 0x55555555C1C8. Next: D ---------------- mov eax, cs:tmp_C_5555557671C8 ror eax, 1 mov cs:tmp_C_5555557671C8, eax ; ---------------- Node D at 0x55555555BAAC. Next: 48 ---------------- mov eax, cs:tmp_D_5555557671CC rol eax, 1 mov cs:tmp_D_5555557671CC, eax ; ---------------- Node 48 at 0x55555555B14C. Next: 2D ---------------- mov eax, cs:tmp_F_5555557671D4 lea edx, [rax+rax] mov eax, cs:tmp_E_5555557671D0 add edx, eax mov rax, cs:tbl_A_555555767150 mov eax, [rax+54h] add edx, eax mov eax, cs:tmp_D_5555557671CC xor eax, edx mov cs:tmp_D_5555557671CC, eax ; ---------------- Node 2D at 0x55555555B2EE. Next: F ---------------- mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_C_5555557671C8 movzx edx, dl mov edx, edx add rdx, 40h mov edx, [rax+rdx*4] mov rax, cs:tbl_A_555555767150 mov ecx, cs:tmp_C_5555557671C8 shr ecx, 8 movzx ecx, cl mov ecx, ecx add rcx, 140h mov eax, [rax+rcx*4] mov ecx, edx xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_C_5555557671C8 shr edx, 10h movzx edx, dl mov edx, edx add rdx, 240h mov eax, [rax+rdx*4] xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_C_5555557671C8 shr edx, 18h mov edx, edx add rdx, 340h mov eax, [rax+rdx*4] xor eax, ecx mov cs:tmp_E_5555557671D0, eax ; ---------------- Node F at 0x55555555C398. Next: 6E ---------------- mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_D_5555557671CC shr edx, 18h mov edx, edx add rdx, 40h mov edx, [rax+rdx*4] mov rax, cs:tbl_A_555555767150 mov ecx, cs:tmp_D_5555557671CC movzx ecx, cl mov ecx, ecx add rcx, 140h mov eax, [rax+rcx*4] mov ecx, edx xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_D_5555557671CC shr edx, 8 movzx edx, dl mov edx, edx add rdx, 240h mov eax, [rax+rdx*4] xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_D_5555557671CC shr edx, 10h movzx edx, dl mov edx, edx add rdx, 340h mov eax, [rax+rdx*4] xor eax, ecx mov cs:tmp_F_5555557671D4, eax ; ---------------- Node 6E at 0x55555555C2F6. Next: 54 ---------------- mov edx, cs:tmp_E_5555557671D0 mov eax, cs:tmp_F_5555557671D4 add edx, eax mov rax, cs:tbl_A_555555767150 mov eax, [rax+58h] add edx, eax mov eax, cs:tmp_A_5555557671C0 xor eax, edx mov cs:tmp_A_5555557671C0, eax ; ---------------- Node 54 at 0x55555555AB28. Next: 24 ---------------- mov eax, cs:tmp_A_5555557671C0 ror eax, 1 mov cs:tmp_A_5555557671C0, eax ; ---------------- Node 24 at 0x55555555D846. Next: 1B ---------------- mov eax, cs:tmp_B_5555557671C4 rol eax, 1 mov cs:tmp_B_5555557671C4, eax ; ---------------- Node 1B at 0x55555555A260. Next: 4E ---------------- mov eax, cs:tmp_F_5555557671D4 lea edx, [rax+rax] mov eax, cs:tmp_E_5555557671D0 add edx, eax mov rax, cs:tbl_A_555555767150 mov eax, [rax+5Ch] add edx, eax mov eax, cs:tmp_B_5555557671C4 xor eax, edx mov cs:tmp_B_5555557671C4, eax ; ---------------- Node 4E at 0x55555555B79A. Next: 1 ---------------- mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_A_5555557671C0 movzx edx, dl mov edx, edx add rdx, 40h mov edx, [rax+rdx*4] mov rax, cs:tbl_A_555555767150 mov ecx, cs:tmp_A_5555557671C0 shr ecx, 8 movzx ecx, cl mov ecx, ecx add rcx, 140h mov eax, [rax+rcx*4] mov ecx, edx xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_A_5555557671C0 shr edx, 10h movzx edx, dl mov edx, edx add rdx, 240h mov eax, [rax+rdx*4] xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_A_5555557671C0 shr edx, 18h mov edx, edx add rdx, 340h mov eax, [rax+rdx*4] xor eax, ecx mov cs:tmp_E_5555557671D0, eax ; ---------------- Node 1 at 0x55555555DFC4. Next: 23 ---------------- mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_B_5555557671C4 shr edx, 18h mov edx, edx add rdx, 40h mov edx, [rax+rdx*4] mov rax, cs:tbl_A_555555767150 mov ecx, cs:tmp_B_5555557671C4 movzx ecx, cl mov ecx, ecx add rcx, 140h mov eax, [rax+rcx*4] mov ecx, edx xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_B_5555557671C4 shr edx, 8 movzx edx, dl mov edx, edx add rdx, 240h mov eax, [rax+rdx*4] xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_B_5555557671C4 shr edx, 10h movzx edx, dl mov edx, edx add rdx, 340h mov eax, [rax+rdx*4] xor eax, ecx mov cs:tmp_F_5555557671D4, eax ; ---------------- Node 23 at 0x55555555D7A4. Next: 3F ---------------- mov edx, cs:tmp_E_5555557671D0 mov eax, cs:tmp_F_5555557671D4 add edx, eax mov rax, cs:tbl_A_555555767150 mov eax, [rax+60h] add edx, eax mov eax, cs:tmp_C_5555557671C8 xor eax, edx mov cs:tmp_C_5555557671C8, eax ; ---------------- Node 3F at 0x55555555C02E. Next: 66 ---------------- mov eax, cs:tmp_C_5555557671C8 ror eax, 1 mov cs:tmp_C_5555557671C8, eax ; ---------------- Node 66 at 0x55555555E510. Next: 7 ---------------- mov eax, cs:tmp_D_5555557671CC rol eax, 1 mov cs:tmp_D_5555557671CC, eax ; ---------------- Node 7 at 0x55555555C800. Next: 16 ---------------- mov eax, cs:tmp_F_5555557671D4 lea edx, [rax+rax] mov eax, cs:tmp_E_5555557671D0 add edx, eax mov rax, cs:tbl_A_555555767150 mov eax, [rax+64h] add edx, eax mov eax, cs:tmp_D_5555557671CC xor eax, edx mov cs:tmp_D_5555557671CC, eax ; ---------------- Node 16 at 0x55555555DA1A. Next: 3C ---------------- mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_C_5555557671C8 movzx edx, dl mov edx, edx add rdx, 40h mov edx, [rax+rdx*4] mov rax, cs:tbl_A_555555767150 mov ecx, cs:tmp_C_5555557671C8 shr ecx, 8 movzx ecx, cl mov ecx, ecx add rcx, 140h mov eax, [rax+rcx*4] mov ecx, edx xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_C_5555557671C8 shr edx, 10h movzx edx, dl mov edx, edx add rdx, 240h mov eax, [rax+rdx*4] xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_C_5555557671C8 shr edx, 18h mov edx, edx add rdx, 340h mov eax, [rax+rdx*4] xor eax, ecx mov cs:tmp_E_5555557671D0, eax ; ---------------- Node 3C at 0x55555555ACFA. Next: E ---------------- mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_D_5555557671CC shr edx, 18h mov edx, edx add rdx, 40h mov edx, [rax+rdx*4] mov rax, cs:tbl_A_555555767150 mov ecx, cs:tmp_D_5555557671CC movzx ecx, cl mov ecx, ecx add rcx, 140h mov eax, [rax+rcx*4] mov ecx, edx xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_D_5555557671CC shr edx, 8 movzx edx, dl mov edx, edx add rdx, 240h mov eax, [rax+rdx*4] xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_D_5555557671CC shr edx, 10h movzx edx, dl mov edx, edx add rdx, 340h mov eax, [rax+rdx*4] xor eax, ecx mov cs:tmp_F_5555557671D4, eax ; ---------------- Node E at 0x55555555E818. Next: 6C ---------------- mov edx, cs:tmp_E_5555557671D0 mov eax, cs:tmp_F_5555557671D4 add edx, eax mov rax, cs:tbl_A_555555767150 mov eax, [rax+68h] add edx, eax mov eax, cs:tmp_A_5555557671C0 xor eax, edx mov cs:tmp_A_5555557671C0, eax ; ---------------- Node 6C at 0x55555555E304. Next: 38 ---------------- mov eax, cs:tmp_A_5555557671C0 ror eax, 1 mov cs:tmp_A_5555557671C0, eax ; ---------------- Node 38 at 0x55555555E942. Next: 64 ---------------- mov eax, cs:tmp_B_5555557671C4 rol eax, 1 mov cs:tmp_B_5555557671C4, eax ; ---------------- Node 64 at 0x55555555D8CE. Next: 35 ---------------- mov eax, cs:tmp_F_5555557671D4 lea edx, [rax+rax] mov eax, cs:tmp_E_5555557671D0 add edx, eax mov rax, cs:tbl_A_555555767150 mov eax, [rax+6Ch] add edx, eax mov eax, cs:tmp_B_5555557671C4 xor eax, edx mov cs:tmp_B_5555557671C4, eax ; ---------------- Node 35 at 0x55555555CDC4. Next: 32 ---------------- mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_A_5555557671C0 movzx edx, dl mov edx, edx add rdx, 40h mov edx, [rax+rdx*4] mov rax, cs:tbl_A_555555767150 mov ecx, cs:tmp_A_5555557671C0 shr ecx, 8 movzx ecx, cl mov ecx, ecx add rcx, 140h mov eax, [rax+rcx*4] mov ecx, edx xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_A_5555557671C0 shr edx, 10h movzx edx, dl mov edx, edx add rdx, 240h mov eax, [rax+rdx*4] xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_A_5555557671C0 shr edx, 18h mov edx, edx add rdx, 340h mov eax, [rax+rdx*4] xor eax, ecx mov cs:tmp_E_5555557671D0, eax ; ---------------- Node 32 at 0x55555555E71C. Next: 10 ---------------- mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_B_5555557671C4 shr edx, 18h mov edx, edx add rdx, 40h mov edx, [rax+rdx*4] mov rax, cs:tbl_A_555555767150 mov ecx, cs:tmp_B_5555557671C4 movzx ecx, cl mov ecx, ecx add rcx, 140h mov eax, [rax+rcx*4] mov ecx, edx xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_B_5555557671C4 shr edx, 8 movzx edx, dl mov edx, edx add rdx, 240h mov eax, [rax+rdx*4] xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_B_5555557671C4 shr edx, 10h movzx edx, dl mov edx, edx add rdx, 340h mov eax, [rax+rdx*4] xor eax, ecx mov cs:tmp_F_5555557671D4, eax ; ---------------- Node 10 at 0x55555555D550. Next: 5E ---------------- mov edx, cs:tmp_E_5555557671D0 mov eax, cs:tmp_F_5555557671D4 add edx, eax mov rax, cs:tbl_A_555555767150 mov eax, [rax+70h] add edx, eax mov eax, cs:tmp_C_5555557671C8 xor eax, edx mov cs:tmp_C_5555557671C8, eax ; ---------------- Node 5E at 0x55555555BFA6. Next: 74 ---------------- mov eax, cs:tmp_C_5555557671C8 ror eax, 1 mov cs:tmp_C_5555557671C8, eax ; ---------------- Node 74 at 0x55555555C6D6. Next: 5D ---------------- mov eax, cs:tmp_D_5555557671CC rol eax, 1 mov cs:tmp_D_5555557671CC, eax ; ---------------- Node 5D at 0x55555555D4AA. Next: 45 ---------------- mov eax, cs:tmp_F_5555557671D4 lea edx, [rax+rax] mov eax, cs:tmp_E_5555557671D0 add edx, eax mov rax, cs:tbl_A_555555767150 mov eax, [rax+74h] add edx, eax mov eax, cs:tmp_D_5555557671CC xor eax, edx mov cs:tmp_D_5555557671CC, eax ; ---------------- Node 45 at 0x55555555EBD6. Next: 25 ---------------- mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_C_5555557671C8 movzx edx, dl mov edx, edx add rdx, 40h mov edx, [rax+rdx*4] mov rax, cs:tbl_A_555555767150 mov ecx, cs:tmp_C_5555557671C8 shr ecx, 8 movzx ecx, cl mov ecx, ecx add rcx, 140h mov eax, [rax+rcx*4] mov ecx, edx xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_C_5555557671C8 shr edx, 10h movzx edx, dl mov edx, edx add rdx, 240h mov eax, [rax+rdx*4] xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_C_5555557671C8 shr edx, 18h mov edx, edx add rdx, 340h mov eax, [rax+rdx*4] xor eax, ecx mov cs:tmp_E_5555557671D0, eax ; ---------------- Node 25 at 0x55555555B3EA. Next: 44 ---------------- mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_D_5555557671CC shr edx, 18h mov edx, edx add rdx, 40h mov edx, [rax+rdx*4] mov rax, cs:tbl_A_555555767150 mov ecx, cs:tmp_D_5555557671CC movzx ecx, cl mov ecx, ecx add rcx, 140h mov eax, [rax+rcx*4] mov ecx, edx xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_D_5555557671CC shr edx, 8 movzx edx, dl mov edx, edx add rdx, 240h mov eax, [rax+rdx*4] xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_D_5555557671CC shr edx, 10h movzx edx, dl mov edx, edx add rdx, 340h mov eax, [rax+rdx*4] xor eax, ecx mov cs:tmp_F_5555557671D4, eax ; ---------------- Node 44 at 0x55555555D408. Next: 43 ---------------- mov edx, cs:tmp_E_5555557671D0 mov eax, cs:tmp_F_5555557671D4 add edx, eax mov rax, cs:tbl_A_555555767150 mov eax, [rax+78h] add edx, eax mov eax, cs:tmp_A_5555557671C0 xor eax, edx mov cs:tmp_A_5555557671C0, eax ; ---------------- Node 43 at 0x55555555BA24. Next: 34 ---------------- mov eax, cs:tmp_A_5555557671C0 ror eax, 1 mov cs:tmp_A_5555557671C0, eax ; ---------------- Node 34 at 0x55555555C0B6. Next: 4A ---------------- mov eax, cs:tmp_B_5555557671C4 rol eax, 1 mov cs:tmp_B_5555557671C4, eax ; ---------------- Node 4A at 0x55555555C9A2. Next: 6F ---------------- mov eax, cs:tmp_F_5555557671D4 lea edx, [rax+rax] mov eax, cs:tmp_E_5555557671D0 add edx, eax mov rax, cs:tbl_A_555555767150 mov eax, [rax+7Ch] add edx, eax mov eax, cs:tmp_B_5555557671C4 xor eax, edx mov cs:tmp_B_5555557671C4, eax ; ---------------- Node 6F at 0x55555555EADA. Next: 4D ---------------- mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_A_5555557671C0 movzx edx, dl mov edx, edx add rdx, 40h mov edx, [rax+rdx*4] mov rax, cs:tbl_A_555555767150 mov ecx, cs:tmp_A_5555557671C0 shr ecx, 8 movzx ecx, cl mov ecx, ecx add rcx, 140h mov eax, [rax+rcx*4] mov ecx, edx xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_A_5555557671C0 shr edx, 10h movzx edx, dl mov edx, edx add rdx, 240h mov eax, [rax+rdx*4] xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_A_5555557671C0 shr edx, 18h mov edx, edx add rdx, 340h mov eax, [rax+rdx*4] xor eax, ecx mov cs:tmp_E_5555557671D0, eax ; ---------------- Node 4D at 0x55555555CA48. Next: 28 ---------------- mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_B_5555557671C4 shr edx, 18h mov edx, edx add rdx, 40h mov edx, [rax+rdx*4] mov rax, cs:tbl_A_555555767150 mov ecx, cs:tmp_B_5555557671C4 movzx ecx, cl mov ecx, ecx add rcx, 140h mov eax, [rax+rcx*4] mov ecx, edx xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_B_5555557671C4 shr edx, 8 movzx edx, dl mov edx, edx add rdx, 240h mov eax, [rax+rdx*4] xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_B_5555557671C4 shr edx, 10h movzx edx, dl mov edx, edx add rdx, 340h mov eax, [rax+rdx*4] xor eax, ecx mov cs:tmp_F_5555557671D4, eax ; ---------------- Node 28 at 0x55555555C250. Next: 12 ---------------- mov edx, cs:tmp_E_5555557671D0 mov eax, cs:tmp_F_5555557671D4 add edx, eax mov rax, cs:tbl_A_555555767150 mov eax, [rax+80h] add edx, eax mov eax, cs:tmp_C_5555557671C8 xor eax, edx mov cs:tmp_C_5555557671C8, eax ; ---------------- Node 12 at 0x55555555A422. Next: 4B ---------------- mov eax, cs:tmp_C_5555557671C8 ror eax, 1 mov cs:tmp_C_5555557671C8, eax ; ---------------- Node 4B at 0x55555555C64E. Next: 65 ---------------- mov eax, cs:tmp_D_5555557671CC rol eax, 1 mov cs:tmp_D_5555557671CC, eax ; ---------------- Node 65 at 0x55555555D0DE. Next: 6B ---------------- mov eax, cs:tmp_F_5555557671D4 lea edx, [rax+rax] mov eax, cs:tmp_E_5555557671D0 add edx, eax mov rax, cs:tbl_A_555555767150 mov eax, [rax+84h] add edx, eax mov eax, cs:tmp_D_5555557671CC xor eax, edx mov cs:tmp_D_5555557671CC, eax ; ---------------- Node 6B at 0x55555555981E. Next: 2E ---------------- mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_C_5555557671C8 movzx edx, dl mov edx, edx add rdx, 40h mov edx, [rax+rdx*4] mov rax, cs:tbl_A_555555767150 mov ecx, cs:tmp_C_5555557671C8 shr ecx, 8 movzx ecx, cl mov ecx, ecx add rcx, 140h mov eax, [rax+rcx*4] mov ecx, edx xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_C_5555557671C8 shr edx, 10h movzx edx, dl mov edx, edx add rdx, 240h mov eax, [rax+rdx*4] xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_C_5555557671C8 shr edx, 18h mov edx, edx add rdx, 340h mov eax, [rax+rdx*4] xor eax, ecx mov cs:tmp_E_5555557671D0, eax ; ---------------- Node 2E at 0x55555555BE22. Next: 30 ---------------- mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_D_5555557671CC shr edx, 18h mov edx, edx add rdx, 40h mov edx, [rax+rdx*4] mov rax, cs:tbl_A_555555767150 mov ecx, cs:tmp_D_5555557671CC movzx ecx, cl mov ecx, ecx add rcx, 140h mov eax, [rax+rcx*4] mov ecx, edx xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_D_5555557671CC shr edx, 8 movzx edx, dl mov edx, edx add rdx, 240h mov eax, [rax+rdx*4] xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_D_5555557671CC shr edx, 10h movzx edx, dl mov edx, edx add rdx, 340h mov eax, [rax+rdx*4] xor eax, ecx mov cs:tmp_F_5555557671D4, eax ; ---------------- Node 30 at 0x555555559A36. Next: 77 ---------------- mov edx, cs:tmp_E_5555557671D0 mov eax, cs:tmp_F_5555557671D4 add edx, eax mov rax, cs:tbl_A_555555767150 mov eax, [rax+88h] add edx, eax mov eax, cs:tmp_A_5555557671C0 xor eax, edx mov cs:tmp_A_5555557671C0, eax ; ---------------- Node 77 at 0x55555555B56E. Next: 62 ---------------- mov eax, cs:tmp_A_5555557671C0 ror eax, 1 mov cs:tmp_A_5555557671C0, eax ; ---------------- Node 62 at 0x55555555E9CA. Next: 59 ---------------- mov eax, cs:tmp_B_5555557671C4 rol eax, 1 mov cs:tmp_B_5555557671C4, eax ; ---------------- Node 59 at 0x55555555B5F6. Next: 2 ---------------- mov eax, cs:tmp_F_5555557671D4 lea edx, [rax+rax] mov eax, cs:tmp_E_5555557671D0 add edx, eax mov rax, cs:tbl_A_555555767150 mov eax, [rax+8Ch] add edx, eax mov eax, cs:tmp_B_5555557671C4 xor eax, edx mov cs:tmp_B_5555557671C4, eax ; ---------------- Node 2 at 0x55555555E620. Next: 6D ---------------- mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_A_5555557671C0 movzx edx, dl mov edx, edx add rdx, 40h mov edx, [rax+rdx*4] mov rax, cs:tbl_A_555555767150 mov ecx, cs:tmp_A_5555557671C0 shr ecx, 8 movzx ecx, cl mov ecx, ecx add rcx, 140h mov eax, [rax+rcx*4] mov ecx, edx xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_A_5555557671C0 shr edx, 10h movzx edx, dl mov edx, edx add rdx, 240h mov eax, [rax+rdx*4] xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_A_5555557671C0 shr edx, 18h mov edx, edx add rdx, 340h mov eax, [rax+rdx*4] xor eax, ecx mov cs:tmp_E_5555557671D0, eax ; ---------------- Node 6D at 0x55555555B928. Next: 73 ---------------- mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_B_5555557671C4 shr edx, 18h mov edx, edx add rdx, 40h mov edx, [rax+rdx*4] mov rax, cs:tbl_A_555555767150 mov ecx, cs:tmp_B_5555557671C4 movzx ecx, cl mov ecx, ecx add rcx, 140h mov eax, [rax+rcx*4] mov ecx, edx xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_B_5555557671C4 shr edx, 8 movzx edx, dl mov edx, edx add rdx, 240h mov eax, [rax+rdx*4] xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_B_5555557671C4 shr edx, 10h movzx edx, dl mov edx, edx add rdx, 340h mov eax, [rax+rdx*4] xor eax, ecx mov cs:tmp_F_5555557671D4, eax ; ---------------- Node 73 at 0x555555559DE4. Next: 60 ---------------- mov edx, cs:tmp_E_5555557671D0 mov eax, cs:tmp_F_5555557671D4 add edx, eax mov rax, cs:tbl_A_555555767150 mov eax, [rax+90h] add edx, eax mov eax, cs:tmp_C_5555557671C8 xor eax, edx mov cs:tmp_C_5555557671C8, eax ; ---------------- Node 60 at 0x55555555A874. Next: 3E ---------------- mov eax, cs:tmp_C_5555557671C8 ror eax, 1 mov cs:tmp_C_5555557671C8, eax ; ---------------- Node 3E at 0x55555555AF5A. Next: 9 ---------------- mov eax, cs:tmp_D_5555557671CC rol eax, 1 mov cs:tmp_D_5555557671CC, eax ; ---------------- Node 9 at 0x55555555AC52. Next: 70 ---------------- mov eax, cs:tmp_F_5555557671D4 lea edx, [rax+rax] mov eax, cs:tmp_E_5555557671D0 add edx, eax mov rax, cs:tbl_A_555555767150 mov eax, [rax+94h] add edx, eax mov eax, cs:tmp_D_5555557671CC xor eax, edx mov cs:tmp_D_5555557671CC, eax ; ---------------- Node 70 at 0x55555555A4AA. Next: 6A ---------------- mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_C_5555557671C8 movzx edx, dl mov edx, edx add rdx, 40h mov edx, [rax+rdx*4] mov rax, cs:tbl_A_555555767150 mov ecx, cs:tmp_C_5555557671C8 shr ecx, 8 movzx ecx, cl mov ecx, ecx add rcx, 140h mov eax, [rax+rcx*4] mov ecx, edx xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_C_5555557671C8 shr edx, 10h movzx edx, dl mov edx, edx add rdx, 240h mov eax, [rax+rdx*4] xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_C_5555557671C8 shr edx, 18h mov edx, edx add rdx, 340h mov eax, [rax+rdx*4] xor eax, ecx mov cs:tmp_E_5555557671D0, eax ; ---------------- Node 6A at 0x55555555C8A6. Next: 75 ---------------- mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_D_5555557671CC shr edx, 18h mov edx, edx add rdx, 40h mov edx, [rax+rdx*4] mov rax, cs:tbl_A_555555767150 mov ecx, cs:tmp_D_5555557671CC movzx ecx, cl mov ecx, ecx add rcx, 140h mov eax, [rax+rcx*4] mov ecx, edx xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_D_5555557671CC shr edx, 8 movzx edx, dl mov edx, edx add rdx, 240h mov eax, [rax+rdx*4] xor ecx, eax mov rax, cs:tbl_A_555555767150 mov edx, cs:tmp_D_5555557671CC shr edx, 10h movzx edx, dl mov edx, edx add rdx, 340h mov eax, [rax+rdx*4] xor eax, ecx mov cs:tmp_F_5555557671D4, eax ; ---------------- Node 75 at 0x55555555B0A6. Next: 27 ---------------- mov edx, cs:tmp_E_5555557671D0 mov eax, cs:tmp_F_5555557671D4 add edx, eax mov rax, cs:tbl_A_555555767150 mov eax, [rax+98h] add edx, eax mov eax, cs:tmp_A_5555557671C0 xor eax, edx mov cs:tmp_A_5555557671C0, eax ; ---------------- Node 27 at 0x55555555BCF4. Next: 72 ---------------- mov eax, cs:tmp_A_5555557671C0 ror eax, 1 mov cs:tmp_A_5555557671C0, eax ; ---------------- Node 72 at 0x55555555E8BA. Next: 55 ---------------- mov eax, cs:tmp_B_5555557671C4 rol eax, 1 mov cs:tmp_B_5555557671C4, eax ; ---------------- Node 55 at 0x555555559D3C. Next: 67 ---------------- mov eax, cs:tmp_F_5555557671D4 lea edx, [rax+rax] mov eax, cs:tmp_E_5555557671D0 add edx, eax mov rax, cs:tbl_A_555555767150 mov eax, [rax+9Ch] add edx, eax mov eax, cs:tmp_B_5555557671C4 xor eax, edx mov cs:tmp_B_5555557671C4, eax ; ---------------- Node 67 at 0x55555555DC12. Next: 36 ---------------- ; ---------------- Node 36 at 0x55555555A306. Next: 2C ---------------- mov rax, cs:tbl_A_555555767150 mov edx, [rax+10h] mov eax, cs:tmp_C_5555557671C8 xor eax, edx mov cs:tmp_C_5555557671C8, eax ; tmp_C ^= tbl_A[4] ; ---------------- Node 2C at 0x55555555991A. Next: 68 ---------------- mov rax, cs:tbl_A_555555767150 mov edx, [rax+14h] mov eax, cs:tmp_D_5555557671CC xor eax, edx mov cs:tmp_D_5555557671CC, eax ; tmp_D ^= tbl_A[5] ; ---------------- Node 68 at 0x55555555E272. Next: 4F ---------------- mov rax, cs:tbl_A_555555767150 mov edx, [rax+18h] mov eax, cs:tmp_A_5555557671C0 xor eax, edx mov cs:tmp_A_5555557671C0, eax ; tmp_A ^= tbl_A[6] ; ---------------- Node 4F at 0x55555555B896. Next: 57 ---------------- mov rax, cs:tbl_A_555555767150 mov edx, [rax+1Ch] mov eax, cs:tmp_B_5555557671C4 xor eax, edx mov cs:tmp_B_5555557671C4, eax ; tmp_B ^= tbl_A[7] ; ---------------- Node 57 at 0x55555555D5F2. Next: 22 ---------------- mov eax, cs:tmp_C_5555557671C8 mov byte ptr cs:enc_blk_1_5555557671B0, al ; ---------------- Node 22 at 0x555555559F9C. Next: 52 ---------------- mov eax, cs:tmp_C_5555557671C8 shr eax, 8 mov byte ptr cs:enc_blk_1_5555557671B0+1, al ; ---------------- Node 52 at 0x55555555DE10. Next: 51 ---------------- mov eax, cs:tmp_C_5555557671C8 shr eax, 10h mov byte ptr cs:enc_blk_1_5555557671B0+2, al ; ---------------- Node 51 at 0x55555555AA9E. Next: 2B ---------------- mov eax, cs:tmp_C_5555557671C8 shr eax, 18h mov byte ptr cs:enc_blk_1_5555557671B0+3, al ; ---------------- Node 2B at 0x55555555CFD0. Next: 5A ---------------- mov eax, cs:tmp_D_5555557671CC mov byte ptr cs:enc_blk_1_5555557671B0+4, al ; ---------------- Node 5A at 0x555555559E8A. Next: 79 ---------------- mov eax, cs:tmp_D_5555557671CC shr eax, 8 mov byte ptr cs:enc_blk_1_5555557671B0+5, al ; ---------------- Node 79 at 0x55555555D37E. Next: 29 ---------------- mov eax, cs:tmp_D_5555557671CC shr eax, 10h mov byte ptr cs:enc_blk_1_5555557671B0+6, al ; ---------------- Node 29 at 0x55555555A6A2. Next: 5 ---------------- mov eax, cs:tmp_D_5555557671CC shr eax, 18h mov byte ptr cs:enc_blk_1_5555557671B0+7, al ; ---------------- Node 5 at 0x55555555D678. Next: 33 ---------------- mov eax, cs:tmp_A_5555557671C0 mov byte ptr cs:enc_blk_2_5555557671B8, al ; ---------------- Node 33 at 0x55555555C13E. Next: 6 ---------------- mov eax, cs:tmp_A_5555557671C0 shr eax, 8 mov byte ptr cs:enc_blk_2_5555557671B8+1, al ; ---------------- Node 6 at 0x55555555C494. Next: 5F ---------------- mov eax, cs:tmp_A_5555557671C0 shr eax, 10h mov byte ptr cs:enc_blk_2_5555557671B8+2, al ; ---------------- Node 5F at 0x5555555599AC. Next: 46 ---------------- mov eax, cs:tmp_A_5555557671C0 shr eax, 18h mov byte ptr cs:enc_blk_2_5555557671B8+3, al ; ---------------- Node 46 at 0x55555555CF4A. Next: 18 ---------------- mov eax, cs:tmp_B_5555557671C4 mov byte ptr cs:enc_blk_2_5555557671B8+4, al ; ---------------- Node 18 at 0x55555555C5C4. Next: B ---------------- mov eax, cs:tmp_B_5555557671C4 shr eax, 8 mov byte ptr cs:enc_blk_2_5555557671B8+5, al ; ---------------- Node B at 0x55555555A398. Next: 1C ---------------- mov eax, cs:tmp_B_5555557671C4 shr eax, 10h mov byte ptr cs:enc_blk_2_5555557671B8+6, al ; ---------------- Node 1C at 0x55555555CEC0. Next: 1D ---------------- mov eax, cs:tmp_B_5555557671C4 shr eax, 18h mov byte ptr cs:enc_blk_2_5555557671B8+7, al
wof/lcs/123p/63.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
6
22170
<reponame>zengfr/arcade_game_romhacking_sourcecode_top_secret_data copyright zengfr site:http://github.com/zengfr/romhack 0018B6 beq $18bc 001B4E tst.b ($63,A0) [123p+ 20] 001B52 beq $1b60 007F20 bne $7e86 008F54 bgt $8e58 009C34 bgt $9c80 017AFE beq $17b10 01AAB6 tst.b ($63,A0) [123p+ 9E] 01AABA ble $1aace 01C128 bne $1c15a 01D0C6 bne $1d0ee 0214B0 bne $214f0 021A96 beq $21a9e 02A850 bne $2a73e 032A5E bne $32a80 copyright zengfr site:http://github.com/zengfr/romhack
src/data/lib/prim/Agda/Builtin/String.agda
phadej/agda
0
9762
<filename>src/data/lib/prim/Agda/Builtin/String.agda {-# OPTIONS --without-K --safe --no-sized-types --no-guardedness #-} module Agda.Builtin.String where open import Agda.Builtin.Bool open import Agda.Builtin.List open import Agda.Builtin.Char open import Agda.Builtin.Equality postulate String : Set {-# BUILTIN STRING String #-} primitive primStringToList : String → List Char primStringFromList : List Char → String primStringAppend : String → String → String primStringEquality : String → String → Bool primShowChar : Char → String primShowString : String → String primStringToListInjective : ∀ a b → primStringToList a ≡ primStringToList b → a ≡ b {-# COMPILE JS primStringToList = function(x) { return x.split(""); } #-} {-# COMPILE JS primStringFromList = function(x) { return x.join(""); } #-} {-# COMPILE JS primStringAppend = function(x) { return function(y) { return x+y; }; } #-} {-# COMPILE JS primStringEquality = function(x) { return function(y) { return x===y; }; } #-} {-# COMPILE JS primShowChar = function(x) { return JSON.stringify(x); } #-} {-# COMPILE JS primShowString = function(x) { return JSON.stringify(x); } #-}
common.agda
guillaumebrunerie/general-type-theories
0
2294
{-# OPTIONS --rewriting --prop #-} open import Agda.Primitive public open import Agda.Builtin.Nat public renaming (Nat to ℕ) hiding (_==_; _+_) open import Agda.Builtin.Bool public {- Basic datatypes and propositions -} record ⊤ : Prop where instance constructor tt record Unit : Set where instance constructor tt data ⊥ : Prop where data Empty : Set where record _×_ (A B : Set) : Set where constructor _,_ field fst : A snd : B open _×_ public infixr 42 _×_ infixl 4 _,_ record ΣP (A : Prop) (B : A → Prop) : Prop where constructor _,_ field fst : A snd : B fst open ΣP public instance pairP : {A : Prop} {B : A → Prop} {{a : A}} {{b : B a}} → ΣP A B pairP {{a}} {{b}} = a , b record ΣS (A : Set) (B : A → Set) : Set where constructor _,_ field fst : A snd : B fst open ΣS public {- Literal notation for natural numbers and similar things. Later on we will use notation with literal natural numbers for things that are not always defined, so we need to use [fromNat] and a constraint. The idea is that if we have an instance of [Number A], that means that we can potentially use literals to denote elements of [A], as long as instance search can figure out that the constraint is satisfied. We need the constraint to be a set as we will pattern match on it. -} record Number (A : Set) : Set₁ where field Constraint : ℕ → Set fromNat : (n : ℕ) {{_ : Constraint n}} → A open Number {{...}} public {-# BUILTIN FROMNAT fromNat #-} instance NumNat : Number ℕ Number.Constraint NumNat _ = Unit Number.fromNat NumNat n = n {- Equality -} data _≡_ {l} {A : Set l} (x : A) : A → Prop l where instance refl : x ≡ x --{-# BUILTIN EQUALITY _≡_ #-} {-# BUILTIN REWRITE _≡_ #-} infix 4 _≡_ ap : {A B : Set} (f : A → B) {a b : A} → a ≡ b → f a ≡ f b ap f refl = refl ap2 : {A B C : Set} (f : A → B → C) {a a' : A} {b b' : B} → a ≡ a' → b ≡ b' → f a b ≡ f a' b' ap2 f refl refl = refl ap3 : {A B C D : Set} (f : A → B → C → D) {a a' : A} {b b' : B} {c c' : C} → a ≡ a' → b ≡ b' → c ≡ c' → f a b c ≡ f a' b' c' ap3 f refl refl refl = refl ap4 : {A B C D E : Set} (f : A → B → C → D → E) {a a' : A} {b b' : B} {c c' : C} {d d' : D} → a ≡ a' → b ≡ b' → c ≡ c' → d ≡ d' → f a b c d ≡ f a' b' c' d' ap4 f refl refl refl refl = refl _∙_ : {A : Set} {a b c : A} → a ≡ b → b ≡ c → a ≡ c refl ∙ refl = refl infixr 4 _∙_ ! : {A : Set} {a b : A} → a ≡ b → b ≡ a ! refl = refl {- Lifting from Prop/Set to Set₁ -} record Box (P : Prop) : Set where constructor box field unbox : P open Box public {- Monads -} record Monad {ℓ ℓ'} (M : Set ℓ → Set ℓ') : Set (lsuc ℓ ⊔ ℓ') where field return : {A : Set ℓ} → A → M A _>>=_ : {A B : Set ℓ} → M A → (A → M B) → M B _>>_ : {A B : Set ℓ} → M A → M B → M B a >> b = a >>= (λ _ → b) infixr 20 _>>_ open Monad {{…}} public -- {- For the partiality monad, we use (dependent) lists of propositions in order to get rid of useless ⊤s -} -- data ListProp : Set₁ -- pf : ListProp → Prop -- data ListProp where -- [] : ListProp -- [_] : Prop → ListProp -- _,_ : (l : ListProp) → (pf l → ListProp) → ListProp -- pf [] = ⊤ -- pf [ p ] = p -- pf ([] , p) = pf (p tt) -- pf (l , q) = ΣP (pf l) (λ x → pf (q x)) -- lemma : {l : ListProp} {p : pf l → ListProp} → pf (l , p) → ΣP (pf l) (λ x → pf (p x)) -- lemma {[]} q = tt , q -- lemma {[ p ]} q = q -- lemma {l , p} {r} q = (fst q , snd q) {- The partiality monad -} record Partial (A : Set) : Set₁ where field isDefined : Prop _$_ : isDefined → A infix 5 _$_ open Partial public instance PartialityMonad : Monad Partial isDefined (Monad.return PartialityMonad x) = ⊤ Monad.return PartialityMonad x Partial.$ tt = x isDefined (Monad._>>=_ PartialityMonad a f) = ΣP (isDefined a) (λ x → isDefined (f (a $ x))) Monad._>>=_ PartialityMonad a f Partial.$ x = f (a $ fst x) $ snd x assume : (P : Prop) → Partial (Box P) isDefined (assume P) = P assume P $ x = box x fail : {A : Set} → Partial A isDefined fail = ⊥ {- Properties of the natural numbers -} data _≤_ : (n m : ℕ) → Set where instance ≤r : {n : ℕ} → n ≤ n ≤S : {n m : ℕ} → n ≤ m → n ≤ suc m ≤P : {n m : ℕ} → suc n ≤ suc m → n ≤ m ≤P ≤r = ≤r ≤P {n} {suc m} (≤S p) = ≤S (≤P p) _+_ : ℕ → ℕ → ℕ n + zero = n n + suc m = suc (n + m) infixl 20 _+_ instance ≤-+ : {n m : ℕ} → n ≤ (n + m) ≤-+ {m = zero} = ≤r ≤-+ {m = suc m} = ≤S (≤-+ {m = m}) -- ≤-+S : {m : ℕ} (n : ℕ) → m ≤ (m + suc n) -- ≤-+S _ = ≤S ≤-+ instance -- ≤S0 : {n : ℕ} → n ≤ suc n -- ≤S0 = ≤S ≤r 0≤ : {n : ℕ} → 0 ≤ n 0≤ {zero} = ≤r 0≤ {suc n} = ≤S (0≤ {n}) ≤SS : {n m : ℕ} {{_ : n ≤ m}} → suc n ≤ suc m ≤SS ⦃ ≤r ⦄ = ≤r ≤SS ⦃ ≤S p ⦄ = ≤S (≤SS {{p}}) ≤+ : (l : ℕ) {n m : ℕ} {{_ : n ≤ m}} → (n + l) ≤ (m + l) -- ≤+ l {{≤r}} = ≤r -- ≤+ zero {{ ≤S p }} = ≤S p -- ≤+ (suc l) {{ ≤S p }} = ≤SS {{≤+ l {{≤S p}}}} ≤+ zero {{p}} = p ≤+ (suc l) = ≤SS {{≤+ l}} ≤tr : {n m k : ℕ} {{_ : n ≤ m}} {{_ : m ≤ k}} → n ≤ k ≤tr ⦃ ≤r ⦄ ⦃ q ⦄ = q ≤tr ⦃ ≤S p ⦄ ⦃ ≤r ⦄ = ≤S p ≤tr ⦃ ≤S p ⦄ ⦃ ≤S q ⦄ = ≤S (≤tr {{≤S p}} {{q}}) {- Rewrite rules for the natural numbers (!!!) -} +O-rewrite : {n : ℕ} → 0 + n ≡ n +O-rewrite {zero} = refl +O-rewrite {suc n} = ap suc +O-rewrite -- {-# REWRITE +O-rewrite #-} +S-rewrite : {n m : ℕ} → suc m + n ≡ suc (m + n) +S-rewrite {zero} = refl +S-rewrite {suc n} {m} = ap suc (+S-rewrite {n} {m}) -- {-# REWRITE +S-rewrite #-} assoc : {n m k : ℕ} → (n + m) + k ≡ n + (m + k) assoc {k = zero} = refl assoc {n} {m} {k = suc k} = ap suc (assoc {n} {m} {k = k}) -- {-# REWRITE assoc #-} data _===_ {l} {A : Set l} (x : A) : A → Set l where instance refl : x === x {-# BUILTIN EQUALITY _===_ #-} infix 4 _===_ -- transport : {A : Set} {P : A → Set} {a b : A} → a === b → P a → P b -- transport refl u = u -- transport! : {A : Set} {P : A → Set} {a b : A} → a === b → P b → P a -- transport! refl u = u {- Instance arguments -} ⟨⟩ : {A : Prop} {{a : A}} → A ⟨⟩ {{a}} = a {- This is the sorts that we use for the syntax, two sorts: types and terms -} data SyntaxSort : Set where Ty : SyntaxSort Tm : SyntaxSort {- Positions of variables in a context -} data VarPos : ℕ → Set where last : {n : ℕ} → VarPos (suc n) prev : {n : ℕ} → VarPos n → VarPos (suc n) -- Size of the context before (and excluding) that variable _-VarPos'_ : (n : ℕ) → VarPos n → ℕ (suc n) -VarPos' last = n (suc n) -VarPos' prev k = n -VarPos' k -- Size of the context before (and including) that variable _-VarPos_ : (n : ℕ) → VarPos n → ℕ n -VarPos k = suc (n -VarPos' k) --instance suc-VarPos'≤ : {n : ℕ} {p : VarPos (suc n)} → (suc n -VarPos' p) ≤ n suc-VarPos'≤ {n} {last} = ≤r suc-VarPos'≤ {suc n} {prev p} = ≤tr {{suc-VarPos'≤ {n} {p}}} {{≤S ≤r}} {- Positions of weakening spots in a context -} data WeakPos : ℕ → Set where last : {n : ℕ} → WeakPos n prev : {n : ℕ} → WeakPos n → WeakPos (suc n) weakenPos : {n m : ℕ} → n ≤ m → WeakPos n → WeakPos m weakenPos ≤r k = k weakenPos (≤S p) k = prev (weakenPos p k) {- Weakening by a group of variable in the middle of a context -} weakenV : {n m : ℕ} {{_ : n ≤ m}} (p : WeakPos n) → VarPos n → VarPos m weakenV {m = suc m} ⦃ r ⦄ (prev p) last = last weakenV ⦃ ≤r ⦄ p x = x weakenV ⦃ ≤S r ⦄ last x = prev (weakenV {{r}} last x) weakenV ⦃ ≤S r ⦄ (prev p) (prev x) = prev (weakenV {{≤P (≤S r)}} p x) weakenV≤r : {n : ℕ} {p : WeakPos n} {v : VarPos n} → weakenV {{≤r}} p v ≡ v weakenV≤r {p = last} {last} = refl weakenV≤r {p = prev p} {last} = refl weakenV≤r {p = last} {prev v} = refl weakenV≤r {p = prev p} {prev v} = refl
source/directories/a-dirtem.ads
ytomino/drake
33
9670
<reponame>ytomino/drake pragma License (Unrestricted); -- extended unit private with System.Native_Directories.Temporary; package Ada.Directories.Temporary is -- Creating temporary files and directories. -- settings function Temporary_Directory return String; procedure Set_Temporary_Directory (Name : String); pragma Inline (Temporary_Directory); -- renamed pragma Inline (Set_Temporary_Directory); -- renamed -- creating new entries function Create_Temporary_File ( Directory : String := Temporary_Directory) return String; function Create_Temporary_Directory ( Directory : String := Temporary_Directory) return String; pragma Inline (Create_Temporary_File); -- renamed pragma Inline (Create_Temporary_Directory); -- renamed private function Temporary_Directory return String renames System.Native_Directories.Temporary.Temporary_Directory; procedure Set_Temporary_Directory (Name : String) renames System.Native_Directories.Temporary.Set_Temporary_Directory; function Create_Temporary_File ( Directory : String := Temporary_Directory) return String renames System.Native_Directories.Temporary.Create_Temporary_File; function Create_Temporary_Directory ( Directory : String := Temporary_Directory) return String renames System.Native_Directories.Temporary.Create_Temporary_Directory; end Ada.Directories.Temporary;
software/modules/sdlog-tools.adb
TUM-EI-RCS/StratoX
12
1801
<gh_stars>10-100 -- Project: StratoX -- System: Stratosphere Balloon Flight Controller -- Author: <NAME> (<EMAIL>) with Profiler; with Ada.Real_Time; use Ada.Real_Time; with Logger; with Units; with FAT_Filesystem; use FAT_Filesystem; with FAT_Filesystem.Directories; use FAT_Filesystem.Directories; with FAT_Filesystem.Directories.Files; use FAT_Filesystem.Directories.Files; -- @summary tools for SD Logging package body SDLog.Tools with SPARK_Mode => Off is ENDL : constant Character := Character'Val (10); -------------------- -- Perf_Test -------------------- procedure Perf_Test (FS : in FAT_Filesystem_Access; megabytes : Unsigned_32) is dummydata : FAT_Filesystem.Directories.Files.File_Data (1 .. 1024); TARGETSIZE : constant Unsigned_32 := megabytes * 1024 * 1024; filesize : Unsigned_32; filesize_pre : Unsigned_32 := SDLog.Logsize; lapsed_pre : Float := 0.0; prof : Profiler.Profile_Tag; procedure Show_Stats; procedure Show_Stats is ts : constant Time_Span := prof.get_Elapsed; lapsed : constant Float := Float (Units.To_Time (ts)); diff : constant Float := lapsed - lapsed_pre; bps : Integer; cps : Integer; begin if diff > 0.0 then cps := Integer (1000.0 / diff); bps := Integer (Float (filesize - filesize_pre) / diff); Logger.log_console (Logger.INFO, "Time=" & Integer (lapsed)'Img & ", xfer=" & filesize'Img & "=>" & bps'Img & " B/s " & cps'Img & " calls/s"); filesize_pre := filesize; lapsed_pre := lapsed; end if; end Show_Stats; type prescaler is mod 1000; ctr : prescaler := 0; fh_perf : File_Handle; Hnd_Root : Directory_Handle; Status : Status_Code; begin Logger.log_console (Logger.INFO, "Write performance test with " & megabytes'Img & " MB" & ENDL); if (not SDLog.SD_Initialized) or SDLog.Error_State then Logger.log_console (Logger.ERROR, "SD Card not initialized" & ENDL); return; end if; if Open_Root_Directory (FS, Hnd_Root) /= OK then Logger.log_console (Logger.INFO, "Error opening root dir" & ENDL); return; end if; prof.init ("perf"); -- open a file Status := File_Create (Parent => Hnd_Root, newname => "perf.dat", Overwrite => True, File => fh_perf); if Status /= OK then Logger.log_console (Logger.ERROR, "SD Card: Error creating file:" & Image (Status)); return; end if; prof.start; Write_Loop : loop filesize := File_Size (fh_perf); declare n_written : constant Integer := File_Write (fh_perf, dummydata, Status); begin if n_written < dummydata'Length then if n_written < 0 then Logger.log_console (Logger.ERROR, "Perf write error" & Image (Status)); else Logger.log_console (Logger.ERROR, "Perf wrote only " & n_written'Img & " bytes instead of " & dummydata'Length'Img & "(" & Image (Status) & ")"); end if; end if; end; if ctr = 0 then Show_Stats; end if; ctr := ctr + 1; exit Write_Loop when filesize >= TARGETSIZE; end loop Write_Loop; File_Close (fh_perf); prof.stop; Show_Stats; end Perf_Test; ------------------ -- List_Rootdir ------------------ procedure List_Rootdir (FS : in FAT_Filesystem_Access) is Dir : Directory_Handle; Ent : Directory_Entry; begin if (not SDLog.SD_Initialized) or SDLog.Error_State then return; end if; Logger.log_console (Logger.INFO, "SD Card: " & Volume_Label (FS.all) & " (" & File_System_Type (FS.all) & ")"); if Open_Root_Directory (FS, Dir) /= OK then Logger.log_console (Logger.ERROR, "SD Card: Error reading root"); Error_State := True; return; end if; Logger.log_console (Logger.INFO, "SD Card listing:"); while Read (Dir, Ent) = OK loop if Is_System_File (Ent) then declare Contents : String (1 .. 16); pragma Unreferenced (Contents); -- later, when File_Read works. begin Logger.log_console (Logger.INFO, " +- " & Get_Name (Ent)); end; else Logger.log_console (Logger.INFO, " +- " & Get_Name (Ent) & (if Is_Subdirectory (Ent) then "/" else "")); end if; end loop; Close (Dir); pragma Unreferenced (Dir); end List_Rootdir; end SDLog.Tools;
test/Fail/Issue4461.agda
shlevy/agda
1,989
10474
<reponame>shlevy/agda data M : Set where m : (I : _) → (I → M) → M -- inferred -- m : (I : Set) → (I → M) → M
programs/oeis/144/A144864.asm
neoneye/loda
22
171556
; A144864: a(n) = (4*16^(n-1)-1)/3. ; 1,21,341,5461,87381,1398101,22369621,357913941,5726623061,91625968981,1466015503701,23456248059221,375299968947541,6004799503160661,96076792050570581,1537228672809129301,24595658764946068821,393530540239137101141,6296488643826193618261,100743818301219097892181,1611901092819505566274901,25790417485112089060398421,412646679761793424966374741,6602346876188694799461995861,105637550019019116791391933781,1690200800304305868662270940501,27043212804868893898596335048021,432691404877902302377541360768341,6923062478046436838040661772293461,110768999648742989408650588356695381 mov $1,16 pow $1,$0 div $1,15 mul $1,20 add $1,1 mov $0,$1
Appl/FileMgrs2/CommonDesktop/CTree/ctreeManager.asm
steakknife/pcgeos
504
240640
<filename>Appl/FileMgrs2/CommonDesktop/CTree/ctreeManager.asm COMMENT @---------------------------------------------------------------------- Copyright (c) GeoWorks 1988 -- All Rights Reserved PROJECT: PC GEOS MODULE: CommonDesktop/CTree FILE: ctreeManager.asm REVISION HISTORY: Name Date Description ---- ---- ----------- brianc 8/89 Initial version DESCRIPTION: This file assembles the CTree/ module of the desktop. $Id: ctreeManager.asm,v 1.1 97/04/04 15:00:58 newdeal Exp $ ------------------------------------------------------------------------------@ _CTree = 1 ;----------------------------------------------------------------------------- ; Include common definitions ;----------------------------------------------------------------------------- include cdesktopGeode.def ;----------------------------------------------------------------------------- ; Include cdefinitions for this module ;----------------------------------------------------------------------------- if _TREE_MENU include drive.def ; for DriveGetStatus, etc. include fileEnum.def ; for FileEnum stuff include vm.def ; for transfer stuff include disk.def include driver.def include ctreeConstant.def include ctreeVariable.def ;----------------------------------------------------------------------------- ; Include code ;----------------------------------------------------------------------------- include ctreeClass.asm include ctreeScan.asm include ctreeOutline.asm include ctreeUtils.asm endif ; if _TREE_MENU end
tests/vice-tests/CIA/tod/hzsync1.asm
PhylumChordata/chips-test
330
174984
<gh_stars>100-1000 ;Clock-Test #2b: 50Hz counter sync test (PAL only). Source for 64Tass (<NAME>) ;simplified version ignoring hrs, min and secs to see if that makes any difference ;find out if the 50/60Hz counter is running freely ;or somehow synchronized with writes to TOD-time: ;in the latter case .1secs should change roughly 5 frames after last rewrite ;in the former case .1secs should change about 2 frames after last rewrite ;slight variations of +/-1 frames can be expected as neither frame rate nor ToD input ;are exactly 50 Hz. ;note: when RUNning the test multiple times, VICE 2.4 (r28019) often shows quite ;erratic results on the very first test pass. frame = $02 ;frame counter * = $801 .word eol,2192 .byte $9e,$32,$30,$34,$39,0 eol .word 0 lda #<text ;print what this test is all about ldy #>text jsr $ab1e lda #$7f ;disable any CIA interrupts sta $dc0d sta $dd0d lda #$80 sta $dd0e ;input freq = 50Hzish lda #$00 sta $dd0f ;writes = ToD sei ;just for safety's sake ldy #5 sty $d020 ldx #$00 ;init test pass counter set lda $d020 pha set2 lda #$00 jsr sync sta $d020 ;black border to indicate write/re-read phase of test pass sta $dd08 ;at raster #$100, Tod := x:xx:xx.0 lda $dd08 bne set2 ;try again if time read != time written sta frame ;reset frame counter dec $d020 jsr sync ;wait for 3 frames jsr sync ;what should be roughly 2 frames jsr sync ;before the .1 secs get inc'ed again sta $dd08 ;reset Tod to x:xx:xx.0 lda $dd08 bne set2 ;repeat the whole procedure if time read != time written pla sta $d020 wait4change inc frame ;repeat frame count++ jsr sync ;wait another frame lda $dd08 beq wait4change ;until .1 secs change lda frame ;current frame # ora #$30 ;+ offset screencode "0" sta $400,x ;put on screen in white ldy #5 cmp #$31 beq ok1 cmp #$32 beq ok1 ldy #10 sty $d020 ok1 tya sta $d800,x inx ;test 256 times in a row bne set cli ;reenable timer1 irqs lda #$81 sta $dc0d lda $d020 and #$0f ldx #0 ; success cmp #5 beq nofail ldx #$ff ; failure nofail: stx $d7ff jmp * sync ldy #$ff ;wait til raster #$100 cpy $d012 bne *-3 cpy $d012 beq *-3 rts text .byte 147,13,13,13,13,13,13,13 .text "hzsync1",13,13 ;1234567890123456789012345678901234567890 .text "tod input frequency counter test:",13 .text "1-3 = free running",13 .text "4-6 = synced to tod writes",13,13 .text "expected: all free running (mostly 1s,",13 .text "some 2s)",0
alloy4fun_models/trashltl/models/9/hv2mBh38o6s3WB6RC.als
Kaixi26/org.alloytools.alloy
0
1209
<reponame>Kaixi26/org.alloytools.alloy open main pred idhv2mBh38o6s3WB6RC_prop10 { always all f:File | f in Protected implies always f in Protected } pred __repair { idhv2mBh38o6s3WB6RC_prop10 } check __repair { idhv2mBh38o6s3WB6RC_prop10 <=> prop10o }
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_89_1610.asm
ljhsiun2/medusa
9
175209
<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r11 push %r13 push %rcx push %rdi push %rsi lea addresses_A_ht+0xfcfb, %rsi lea addresses_A_ht+0x17e32, %rdi nop nop nop nop nop add $61475, %r11 mov $54, %rcx rep movsw nop nop nop nop and %rcx, %rcx lea addresses_WT_ht+0x162ee, %rsi lea addresses_A_ht+0x1e0de, %rdi clflush (%rdi) nop nop nop nop inc %r13 mov $122, %rcx rep movsb nop nop cmp $5820, %r13 pop %rsi pop %rdi pop %rcx pop %r13 pop %r11 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r13 push %r14 push %r15 push %rcx push %rsi // Load lea addresses_US+0x1b9e, %r12 nop dec %rcx vmovups (%r12), %ymm1 vextracti128 $1, %ymm1, %xmm1 vpextrq $0, %xmm1, %r14 nop nop nop nop inc %r12 // Store mov $0x69e, %r15 nop sub $58499, %r13 movb $0x51, (%r15) nop nop nop nop xor %r14, %r14 // Store lea addresses_PSE+0x1fb9e, %rcx nop nop sub %r13, %r13 movl $0x51525354, (%rcx) nop nop nop cmp %rcx, %rcx // Load lea addresses_WT+0xeb9e, %r15 clflush (%r15) nop nop nop nop nop cmp %r11, %r11 vmovups (%r15), %ymm3 vextracti128 $0, %ymm3, %xmm3 vpextrq $1, %xmm3, %r12 nop nop nop cmp %r12, %r12 // Store lea addresses_WT+0x4f9e, %rsi cmp %r15, %r15 mov $0x5152535455565758, %rcx movq %rcx, %xmm4 movups %xmm4, (%rsi) nop nop nop cmp $64614, %r13 // Store lea addresses_RW+0x1529e, %rcx nop and %r11, %r11 movl $0x51525354, (%rcx) cmp %r15, %r15 // Load lea addresses_UC+0xab9e, %r12 clflush (%r12) cmp $2069, %r13 movb (%r12), %r14b nop nop dec %r14 // Faulty Load lea addresses_WT+0xeb9e, %rsi nop nop xor $39151, %r14 movb (%rsi), %r11b lea oracles, %rcx and $0xff, %r11 shlq $12, %r11 mov (%rcx,%r11,1), %r11 pop %rsi pop %rcx pop %r15 pop %r14 pop %r13 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_P', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'size': 4, 'AVXalign': False, 'NT': True, 'congruent': 10, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}} {'39': 89} 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 */
source/nls/a-eeenst.ads
ytomino/drake
33
15739
<gh_stars>10-100 pragma License (Unrestricted); -- extended unit package Ada.Environment_Encoding.Encoding_Streams is -- This is a stream wrapper encoding from/to another stream. pragma Preelaborate; -- only reading type In_Type is limited private; -- subtype Open_In_Type is In_Type -- with -- Dynamic_Predicate => Is_Open (Open_In_Type), -- Predicate_Failure => raise Status_Error; function Is_Open (Object : In_Type) return Boolean; pragma Inline (Is_Open); -- management function Open ( Decoder : Converter; -- Open_Converter Stream : not null access Streams.Root_Stream_Type'Class) return In_Type; -- Note: The parameter Decoder is neither access nor aliased, for accepting -- derived types. The same applies hereafter. -- stream access function Stream ( Object : aliased in out In_Type) -- Open_In_Type return not null access Streams.Root_Stream_Type'Class; -- only writing type Out_Type is limited private; -- subtype Open_Out_Type is Out_Type -- with -- Dynamic_Predicate => Is_Open (Open_Out_Type), -- Predicate_Failure => raise Status_Error; function Is_Open (Object : Out_Type) return Boolean; pragma Inline (Is_Open); -- management function Open ( Encoder : Converter; -- Open_Converter Stream : not null access Streams.Root_Stream_Type'Class) return Out_Type; -- stream access function Stream ( Object : aliased in out Out_Type) -- Open_Out_Type return not null access Streams.Root_Stream_Type'Class; -- finish writing procedure Finish ( Object : in out Out_Type); -- Open_Out_Type -- bidirectional type Inout_Type is limited private; -- subtype Open_Inout_Type is Out_Type -- with -- Dynamic_Predicate => Is_Open (Open_Inout_Type), -- Predicate_Failure => raise Status_Error; function Is_Open (Object : Inout_Type) return Boolean; pragma Inline (Is_Open); -- management function Open ( Internal : Encoding_Id; External : Encoding_Id; Stream : not null access Streams.Root_Stream_Type'Class) return Inout_Type; -- substitute (encoded as internal) function Substitute ( Object : Inout_Type) -- Open_Inout_Type return Streams.Stream_Element_Array; procedure Set_Substitute ( Object : in out Inout_Type; -- Open_Inout_Type Substitute : Streams.Stream_Element_Array); -- stream access function Stream ( Object : aliased in out Inout_Type) -- Open_Inout_Type return not null access Streams.Root_Stream_Type'Class; -- finish writing procedure Finish ( Object : in out Inout_Type); -- Open_Inout_Type private use type Streams.Stream_Element_Offset; Half_Buffer_Length : constant := 64; subtype Buffer_Type is Streams.Stream_Element_Array (0 .. 2 * Half_Buffer_Length - 1); type Reading_Status_Type is (Continuing, Finishing, Ended); pragma Discard_Names (Reading_Status_Type); type Reading_Context_Type is record Buffer : Buffer_Type; First : Streams.Stream_Element_Offset; Last : Streams.Stream_Element_Offset; Converted_Buffer : Buffer_Type; Converted_First : Streams.Stream_Element_Offset; Converted_Last : Streams.Stream_Element_Offset; Status : Reading_Status_Type; end record; pragma Suppress_Initialization (Reading_Context_Type); type Writing_Context_Type is record Buffer : Buffer_Type; First : Streams.Stream_Element_Offset; Last : Streams.Stream_Element_Offset; end record; pragma Suppress_Initialization (Writing_Context_Type); type Converter_Access is access constant Converter; for Converter_Access'Storage_Size use 0; -- only reading type In_Type is limited new Streams.Root_Stream_Type with record Stream : System.Address := -- access Root_Stream_Type'Class; System.Null_Address; Reading_Converter : Converter_Access; Reading_Context : Reading_Context_Type; end record; overriding procedure Read ( Object : in out In_Type; Item : out Streams.Stream_Element_Array; Last : out Streams.Stream_Element_Offset); overriding procedure Write ( Object : in out In_Type; Item : Streams.Stream_Element_Array) with Import, Convention => Ada, External_Name => "__drake_program_error"; -- only writing type Out_Type is limited new Streams.Root_Stream_Type with record Stream : System.Address := -- access Root_Stream_Type'Class; System.Null_Address; Writing_Converter : Converter_Access; Writing_Context : Writing_Context_Type; end record; overriding procedure Read ( Object : in out Out_Type; Item : out Streams.Stream_Element_Array; Last : out Streams.Stream_Element_Offset) with Import, Convention => Ada, External_Name => "__drake_program_error"; overriding procedure Write ( Object : in out Out_Type; Item : Streams.Stream_Element_Array); -- bidirectional type Inout_Type is limited new Streams.Root_Stream_Type with record Internal : Encoding_Id; External : Encoding_Id; Stream : System.Address := -- access Root_Stream_Type'Class; System.Null_Address; -- substitute (encoded as internal) Substitute_Length : Streams.Stream_Element_Offset; Substitute : Streams.Stream_Element_Array (1 .. Max_Substitute_Length); -- reading Reading_Converter : Converter; Reading_Context : Reading_Context_Type; -- writing Writing_Converter : Converter; Writing_Context : Writing_Context_Type; end record; overriding procedure Read ( Object : in out Inout_Type; Item : out Streams.Stream_Element_Array; Last : out Streams.Stream_Element_Offset); overriding procedure Write ( Object : in out Inout_Type; Item : Streams.Stream_Element_Array); end Ada.Environment_Encoding.Encoding_Streams;
example/incrementer.asm
eljay26/smsspec
2
1199
<filename>example/incrementer.asm .section "Incrementer" free Incrementer.increment: inc a ret Incrementer.incrementRandom: push bc ld b, a call RandomGenerator.generateByte add a, b pop bc ret .ends
oeis/081/A081298.asm
neoneye/loda-programs
11
27310
; A081298: Main diagonal of the square array A081297. ; Submitted by <NAME> ; 1,1,7,25,461,2821,84883,734161,30684601,342800821,18348174791,251203133545,16394732478853,265727053328101,20464206411678331,383172119935376161,34011762638354230001,722380674949394645269,72612297324747331499503,1724810936986001071965241,193652171180145915155637181,5086826743677068010410304901,630930695596905384379583573987,18159255592633662716147142891505,2465867359477945759605479363173801,77170069234447926077439430435658101,11386520704309884151489870983350097943 mov $4,7 mov $5,$0 lpb $0 sub $0,1 mul $2,$5 mov $3,$2 mov $2,$4 add $4,$3 mul $3,$5 add $4,$3 lpe mov $0,$4 div $0,7
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/g-socthi__mingw.adb
djamal2727/Main-Bearing-Analytical-Model
0
13128
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- G N A T . S O C K E T S . T H I N -- -- -- -- B o d y -- -- -- -- Copyright (C) 2001-2020, AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package provides a target dependent thin interface to the sockets -- layer for use by the GNAT.Sockets package (g-socket.ads). This package -- should not be directly with'ed by an applications program. -- This version is for NT with Ada.Unchecked_Conversion; with Interfaces.C.Strings; use Interfaces.C.Strings; with System; use System; with System.Storage_Elements; use System.Storage_Elements; package body GNAT.Sockets.Thin is use type C.unsigned; WSAData_Dummy : array (1 .. 512) of C.int; WS_Version : constant := 16#0202#; -- Winsock 2.2 Initialized : Boolean := False; function Standard_Connect (S : C.int; Name : System.Address; Namelen : C.int) return C.int; pragma Import (Stdcall, Standard_Connect, "connect"); function Standard_Select (Nfds : C.int; Readfds : access Fd_Set; Writefds : access Fd_Set; Exceptfds : access Fd_Set; Timeout : Timeval_Access) return C.int; pragma Import (Stdcall, Standard_Select, "select"); type Error_Type is (N_EINTR, N_EBADF, N_EACCES, N_EFAULT, N_EINVAL, N_EMFILE, N_EWOULDBLOCK, N_EINPROGRESS, N_EALREADY, N_ENOTSOCK, N_EDESTADDRREQ, N_EMSGSIZE, N_EPROTOTYPE, N_ENOPROTOOPT, N_EPROTONOSUPPORT, N_ESOCKTNOSUPPORT, N_EOPNOTSUPP, N_EPFNOSUPPORT, N_EAFNOSUPPORT, N_EADDRINUSE, N_EADDRNOTAVAIL, N_ENETDOWN, N_ENETUNREACH, N_ENETRESET, N_ECONNABORTED, N_ECONNRESET, N_ENOBUFS, N_EISCONN, N_ENOTCONN, N_ESHUTDOWN, N_ETOOMANYREFS, N_ETIMEDOUT, N_ECONNREFUSED, N_ELOOP, N_ENAMETOOLONG, N_EHOSTDOWN, N_EHOSTUNREACH, N_WSASYSNOTREADY, N_WSAVERNOTSUPPORTED, N_WSANOTINITIALISED, N_WSAEDISCON, N_HOST_NOT_FOUND, N_TRY_AGAIN, N_NO_RECOVERY, N_NO_DATA, N_OTHERS); Error_Messages : constant array (Error_Type) of chars_ptr := (N_EINTR => New_String ("Interrupted system call"), N_EBADF => New_String ("Bad file number"), N_EACCES => New_String ("Permission denied"), N_EFAULT => New_String ("Bad address"), N_EINVAL => New_String ("Invalid argument"), N_EMFILE => New_String ("Too many open files"), N_EWOULDBLOCK => New_String ("Operation would block"), N_EINPROGRESS => New_String ("Operation now in progress. This error is " & "returned if any Windows Sockets API " & "function is called while a blocking " & "function is in progress"), N_EALREADY => New_String ("Operation already in progress"), N_ENOTSOCK => New_String ("Socket operation on nonsocket"), N_EDESTADDRREQ => New_String ("Destination address required"), N_EMSGSIZE => New_String ("Message too long"), N_EPROTOTYPE => New_String ("Protocol wrong type for socket"), N_ENOPROTOOPT => New_String ("Protocol not available"), N_EPROTONOSUPPORT => New_String ("Protocol not supported"), N_ESOCKTNOSUPPORT => New_String ("Socket type not supported"), N_EOPNOTSUPP => New_String ("Operation not supported on socket"), N_EPFNOSUPPORT => New_String ("Protocol family not supported"), N_EAFNOSUPPORT => New_String ("Address family not supported by protocol family"), N_EADDRINUSE => New_String ("Address already in use"), N_EADDRNOTAVAIL => New_String ("Cannot assign requested address"), N_ENETDOWN => New_String ("Network is down. This error may be " & "reported at any time if the Windows " & "Sockets implementation detects an " & "underlying failure"), N_ENETUNREACH => New_String ("Network is unreachable"), N_ENETRESET => New_String ("Network dropped connection on reset"), N_ECONNABORTED => New_String ("Software caused connection abort"), N_ECONNRESET => New_String ("Connection reset by peer"), N_ENOBUFS => New_String ("No buffer space available"), N_EISCONN => New_String ("Socket is already connected"), N_ENOTCONN => New_String ("Socket is not connected"), N_ESHUTDOWN => New_String ("Cannot send after socket shutdown"), N_ETOOMANYREFS => New_String ("Too many references: cannot splice"), N_ETIMEDOUT => New_String ("Connection timed out"), N_ECONNREFUSED => New_String ("Connection refused"), N_ELOOP => New_String ("Too many levels of symbolic links"), N_ENAMETOOLONG => New_String ("File name too long"), N_EHOSTDOWN => New_String ("Host is down"), N_EHOSTUNREACH => New_String ("No route to host"), N_WSASYSNOTREADY => New_String ("Returned by WSAStartup(), indicating that " & "the network subsystem is unusable"), N_WSAVERNOTSUPPORTED => New_String ("Returned by WSAStartup(), indicating that " & "the Windows Sockets DLL cannot support " & "this application"), N_WSANOTINITIALISED => New_String ("Winsock not initialized. This message is " & "returned by any function except WSAStartup(), " & "indicating that a successful WSAStartup() has " & "not yet been performed"), N_WSAEDISCON => New_String ("Disconnected"), N_HOST_NOT_FOUND => New_String ("Host not found. This message indicates " & "that the key (name, address, and so on) was not found"), N_TRY_AGAIN => New_String ("Nonauthoritative host not found. This error may " & "suggest that the name service itself is not " & "functioning"), N_NO_RECOVERY => New_String ("Nonrecoverable error. This error may suggest that the " & "name service itself is not functioning"), N_NO_DATA => New_String ("Valid name, no data record of requested type. " & "This error indicates that the key (name, address, " & "and so on) was not found."), N_OTHERS => New_String ("Unknown system error")); --------------- -- C_Connect -- --------------- function C_Connect (S : C.int; Name : System.Address; Namelen : C.int) return C.int is Res : C.int; begin Res := Standard_Connect (S, Name, Namelen); if Res = -1 then if Socket_Errno = SOSC.EWOULDBLOCK then Set_Socket_Errno (SOSC.EINPROGRESS); end if; end if; return Res; end C_Connect; ------------------ -- Socket_Ioctl -- ------------------ function Socket_Ioctl (S : C.int; Req : SOSC.IOCTL_Req_T; Arg : access C.int) return C.int is begin return C_Ioctl (S, Req, Arg); end Socket_Ioctl; --------------- -- C_Recvmsg -- --------------- function C_Recvmsg (S : C.int; Msg : System.Address; Flags : C.int) return System.CRTL.ssize_t is use type C.size_t; Fill : constant Boolean := SOSC.MSG_WAITALL /= -1 and then (C.unsigned (Flags) and SOSC.MSG_WAITALL) /= 0; -- Is the MSG_WAITALL flag set? If so we need to fully fill all vectors Res : C.int; Count : C.int := 0; MH : Msghdr; for MH'Address use Msg; Iovec : array (0 .. MH.Msg_Iovlen - 1) of Vector_Element; for Iovec'Address use MH.Msg_Iov; pragma Import (Ada, Iovec); Iov_Index : Integer; Current_Iovec : Vector_Element; function To_Access is new Ada.Unchecked_Conversion (System.Address, Stream_Element_Reference); pragma Warnings (Off, Stream_Element_Reference); Req : Request_Type (Name => N_Bytes_To_Read); begin -- Windows does not provide an implementation of recvmsg(). The spec for -- WSARecvMsg() is incompatible with the data types we define, and is -- available starting with Windows Vista and Server 2008 only. So, -- we use C_Recv instead. -- Check how much data are available Control_Socket (Socket_Type (S), Req); -- Fill the vectors Iov_Index := -1; Current_Iovec := (Base => null, Length => 0); loop if Current_Iovec.Length = 0 then Iov_Index := Iov_Index + 1; exit when Iov_Index > Integer (Iovec'Last); Current_Iovec := Iovec (SOSC.Msg_Iovlen_T (Iov_Index)); end if; Res := C_Recv (S, Current_Iovec.Base.all'Address, C.int (Current_Iovec.Length), Flags); if Res < 0 then return System.CRTL.ssize_t (Res); elsif Res = 0 and then not Fill then exit; else pragma Assert (Interfaces.C.size_t (Res) <= Current_Iovec.Length); Count := Count + Res; Current_Iovec.Length := Current_Iovec.Length - Interfaces.C.size_t (Res); Current_Iovec.Base := To_Access (Current_Iovec.Base.all'Address + Storage_Offset (Res)); -- If all the data that was initially available read, do not -- attempt to receive more, since this might block, or merge data -- from successive datagrams for a datagram-oriented socket. We -- still try to receive more if we need to fill all vectors -- (MSG_WAITALL flag is set). exit when Natural (Count) >= Req.Size and then -- Either we are not in fill mode (not Fill -- Or else last vector filled or else (Interfaces.C.size_t (Iov_Index) = Iovec'Last and then Current_Iovec.Length = 0)); end if; end loop; return System.CRTL.ssize_t (Count); end C_Recvmsg; -------------- -- C_Select -- -------------- function C_Select (Nfds : C.int; Readfds : access Fd_Set; Writefds : access Fd_Set; Exceptfds : access Fd_Set; Timeout : Timeval_Access) return C.int is pragma Warnings (Off, Exceptfds); Original_WFS : aliased constant Fd_Set := Writefds.all; Res : C.int; S : aliased C.int; Last : aliased C.int; begin -- Asynchronous connection failures are notified in the exception fd -- set instead of the write fd set. To ensure POSIX compatibility, copy -- write fd set into exception fd set. Once select() returns, check any -- socket present in the exception fd set and peek at incoming -- out-of-band data. If the test is not successful, and the socket is -- present in the initial write fd set, then move the socket from the -- exception fd set to the write fd set. if Writefds /= No_Fd_Set_Access then -- Add any socket present in write fd set into exception fd set declare WFS : aliased Fd_Set := Writefds.all; begin Last := Nfds - 1; loop Get_Socket_From_Set (WFS'Access, S'Unchecked_Access, Last'Unchecked_Access); exit when S = -1; Insert_Socket_In_Set (Exceptfds, S); end loop; end; end if; Res := Standard_Select (Nfds, Readfds, Writefds, Exceptfds, Timeout); if Exceptfds /= No_Fd_Set_Access then declare EFSC : aliased Fd_Set := Exceptfds.all; Flag : constant C.int := SOSC.MSG_PEEK + SOSC.MSG_OOB; Buffer : Character; Length : C.int; Fromlen : aliased C.int; begin Last := Nfds - 1; loop Get_Socket_From_Set (EFSC'Access, S'Unchecked_Access, Last'Unchecked_Access); -- No more sockets in EFSC exit when S = -1; -- Check out-of-band data Length := C_Recvfrom (S, Buffer'Address, 1, Flag, From => System.Null_Address, Fromlen => Fromlen'Unchecked_Access); -- Is Fromlen necessary if From is Null_Address??? -- If the signal is not an out-of-band data, then it -- is a connection failure notification. if Length = -1 then Remove_Socket_From_Set (Exceptfds, S); -- If S is present in the initial write fd set, move it from -- exception fd set back to write fd set. Otherwise, ignore -- this event since the user is not watching for it. if Writefds /= No_Fd_Set_Access and then (Is_Socket_In_Set (Original_WFS'Access, S) /= 0) then Insert_Socket_In_Set (Writefds, S); end if; end if; end loop; end; end if; return Res; end C_Select; --------------- -- C_Sendmsg -- --------------- function C_Sendmsg (S : C.int; Msg : System.Address; Flags : C.int) return System.CRTL.ssize_t is use type C.size_t; Res : C.int; Count : C.int := 0; MH : Msghdr; for MH'Address use Msg; Iovec : array (0 .. MH.Msg_Iovlen - 1) of Vector_Element; for Iovec'Address use MH.Msg_Iov; pragma Import (Ada, Iovec); begin -- Windows does not provide an implementation of sendmsg(). The spec for -- WSASendMsg() is incompatible with the data types we define, and is -- available starting with Windows Vista and Server 2008 only. So -- use C_Sendto instead. for J in Iovec'Range loop Res := C_Sendto (S, Iovec (J).Base.all'Address, C.int (Iovec (J).Length), Flags => Flags, To => MH.Msg_Name, Tolen => C.int (MH.Msg_Namelen)); if Res < 0 then return System.CRTL.ssize_t (Res); else Count := Count + Res; end if; -- Exit now if the buffer is not fully transmitted exit when Interfaces.C.size_t (Res) < Iovec (J).Length; end loop; return System.CRTL.ssize_t (Count); end C_Sendmsg; ------------------ -- C_Socketpair -- ------------------ function C_Socketpair (Domain : C.int; Typ : C.int; Protocol : C.int; Fds : not null access Fd_Pair) return C.int is separate; -------------- -- Finalize -- -------------- procedure Finalize is begin if Initialized then WSACleanup; Initialized := False; end if; end Finalize; ------------------------- -- Host_Error_Messages -- ------------------------- package body Host_Error_Messages is -- On Windows, socket and host errors share the same code space, and -- error messages are provided by Socket_Error_Message, so the default -- separate body for Host_Error_Messages is not used in this case. function Host_Error_Message (H_Errno : Integer) return String renames Socket_Error_Message; end Host_Error_Messages; ---------------- -- Initialize -- ---------------- procedure Initialize is Return_Value : Interfaces.C.int; begin if not Initialized then Return_Value := WSAStartup (WS_Version, WSAData_Dummy'Address); pragma Assert (Return_Value = 0); Initialized := True; end if; end Initialize; -------------------- -- Signalling_Fds -- -------------------- package body Signalling_Fds is separate; -------------------------- -- Socket_Error_Message -- -------------------------- function Socket_Error_Message (Errno : Integer) return String is use GNAT.Sockets.SOSC; Errm : C.Strings.chars_ptr; begin case Errno is when EINTR => Errm := Error_Messages (N_EINTR); when EBADF => Errm := Error_Messages (N_EBADF); when EACCES => Errm := Error_Messages (N_EACCES); when EFAULT => Errm := Error_Messages (N_EFAULT); when EINVAL => Errm := Error_Messages (N_EINVAL); when EMFILE => Errm := Error_Messages (N_EMFILE); when EWOULDBLOCK => Errm := Error_Messages (N_EWOULDBLOCK); when EINPROGRESS => Errm := Error_Messages (N_EINPROGRESS); when EALREADY => Errm := Error_Messages (N_EALREADY); when ENOTSOCK => Errm := Error_Messages (N_ENOTSOCK); when EDESTADDRREQ => Errm := Error_Messages (N_EDESTADDRREQ); when EMSGSIZE => Errm := Error_Messages (N_EMSGSIZE); when EPROTOTYPE => Errm := Error_Messages (N_EPROTOTYPE); when ENOPROTOOPT => Errm := Error_Messages (N_ENOPROTOOPT); when EPROTONOSUPPORT => Errm := Error_Messages (N_EPROTONOSUPPORT); when ESOCKTNOSUPPORT => Errm := Error_Messages (N_ESOCKTNOSUPPORT); when EOPNOTSUPP => Errm := Error_Messages (N_EOPNOTSUPP); when EPFNOSUPPORT => Errm := Error_Messages (N_EPFNOSUPPORT); when EAFNOSUPPORT => Errm := Error_Messages (N_EAFNOSUPPORT); when EADDRINUSE => Errm := Error_Messages (N_EADDRINUSE); when EADDRNOTAVAIL => Errm := Error_Messages (N_EADDRNOTAVAIL); when ENETDOWN => Errm := Error_Messages (N_ENETDOWN); when ENETUNREACH => Errm := Error_Messages (N_ENETUNREACH); when ENETRESET => Errm := Error_Messages (N_ENETRESET); when ECONNABORTED => Errm := Error_Messages (N_ECONNABORTED); when ECONNRESET => Errm := Error_Messages (N_ECONNRESET); when ENOBUFS => Errm := Error_Messages (N_ENOBUFS); when EISCONN => Errm := Error_Messages (N_EISCONN); when ENOTCONN => Errm := Error_Messages (N_ENOTCONN); when ESHUTDOWN => Errm := Error_Messages (N_ESHUTDOWN); when ETOOMANYREFS => Errm := Error_Messages (N_ETOOMANYREFS); when ETIMEDOUT => Errm := Error_Messages (N_ETIMEDOUT); when ECONNREFUSED => Errm := Error_Messages (N_ECONNREFUSED); when ELOOP => Errm := Error_Messages (N_ELOOP); when ENAMETOOLONG => Errm := Error_Messages (N_ENAMETOOLONG); when EHOSTDOWN => Errm := Error_Messages (N_EHOSTDOWN); when EHOSTUNREACH => Errm := Error_Messages (N_EHOSTUNREACH); -- Windows-specific error codes when WSASYSNOTREADY => Errm := Error_Messages (N_WSASYSNOTREADY); when WSAVERNOTSUPPORTED => Errm := Error_Messages (N_WSAVERNOTSUPPORTED); when WSANOTINITIALISED => Errm := Error_Messages (N_WSANOTINITIALISED); when WSAEDISCON => Errm := Error_Messages (N_WSAEDISCON); -- h_errno values when HOST_NOT_FOUND => Errm := Error_Messages (N_HOST_NOT_FOUND); when TRY_AGAIN => Errm := Error_Messages (N_TRY_AGAIN); when NO_RECOVERY => Errm := Error_Messages (N_NO_RECOVERY); when NO_DATA => Errm := Error_Messages (N_NO_DATA); when others => Errm := Error_Messages (N_OTHERS); end case; return Value (Errm); end Socket_Error_Message; end GNAT.Sockets.Thin;
src/core/bytecode/wasm/module/section/section.asm
Hiroshi123/bin_tools
0
8435
section .text default rel global _0x00_none ;; global _0x01_type global _0x02_import global _0x03_function global _0x04_table global _0x05_memory global _0x06_global global _0x07_export global _0x08_start global _0x09_element global _0x0a_code global _0x0b_data ;;; _0x00_none: ret ;; _0x01_type: ;; ret _0x02_import: ret _0x03_function: ret _0x04_table: ret _0x05_memory: ret ;;; _0x06_global: ret ;;; if it is export, you should prepare one section on a object format. _0x07_export: ret ;;; _0x08_start: ret ;;; _0x09_element: ret ;;; _0x0a_code: ret ;;; _0x0b_data: ret
vp8/common/x86/recon_sse2.asm
CM-Archive/android_external_libvpx
3
8746
; ; Copyright (c) 2010 The WebM project authors. All Rights Reserved. ; ; Use of this source code is governed by a BSD-style license ; that can be found in the LICENSE file in the root of the source ; tree. An additional intellectual property rights grant can be found ; in the file PATENTS. All contributing project authors may ; be found in the AUTHORS file in the root of the source tree. ; %include "vpx_ports/x86_abi_support.asm" ;void vp8_recon2b_sse2(unsigned char *s, short *q, unsigned char *d, int stride) global sym(vp8_recon2b_sse2) sym(vp8_recon2b_sse2): push rbp mov rbp, rsp SHADOW_ARGS_TO_STACK 4 push rsi push rdi ; end prolog mov rsi, arg(0) ;s mov rdi, arg(2) ;d mov rdx, arg(1) ;q movsxd rax, dword ptr arg(3) ;stride pxor xmm0, xmm0 movq xmm1, MMWORD PTR [rsi] punpcklbw xmm1, xmm0 paddsw xmm1, XMMWORD PTR [rdx] packuswb xmm1, xmm0 ; pack and unpack to saturate movq MMWORD PTR [rdi], xmm1 movq xmm2, MMWORD PTR [rsi+8] punpcklbw xmm2, xmm0 paddsw xmm2, XMMWORD PTR [rdx+16] packuswb xmm2, xmm0 ; pack and unpack to saturate movq MMWORD PTR [rdi+rax], xmm2 movq xmm3, MMWORD PTR [rsi+16] punpcklbw xmm3, xmm0 paddsw xmm3, XMMWORD PTR [rdx+32] packuswb xmm3, xmm0 ; pack and unpack to saturate movq MMWORD PTR [rdi+rax*2], xmm3 add rdi, rax movq xmm4, MMWORD PTR [rsi+24] punpcklbw xmm4, xmm0 paddsw xmm4, XMMWORD PTR [rdx+48] packuswb xmm4, xmm0 ; pack and unpack to saturate movq MMWORD PTR [rdi+rax*2], xmm4 ; begin epilog pop rdi pop rsi UNSHADOW_ARGS pop rbp ret ;void vp8_recon4b_sse2(unsigned char *s, short *q, unsigned char *d, int stride) global sym(vp8_recon4b_sse2) sym(vp8_recon4b_sse2): push rbp mov rbp, rsp SHADOW_ARGS_TO_STACK 4 SAVE_XMM push rsi push rdi ; end prolog mov rsi, arg(0) ;s mov rdi, arg(2) ;d mov rdx, arg(1) ;q movsxd rax, dword ptr arg(3) ;stride pxor xmm0, xmm0 movdqa xmm1, XMMWORD PTR [rsi] movdqa xmm5, xmm1 punpcklbw xmm1, xmm0 punpckhbw xmm5, xmm0 paddsw xmm1, XMMWORD PTR [rdx] paddsw xmm5, XMMWORD PTR [rdx+16] packuswb xmm1, xmm5 ; pack and unpack to saturate movdqa XMMWORD PTR [rdi], xmm1 movdqa xmm2, XMMWORD PTR [rsi+16] movdqa xmm6, xmm2 punpcklbw xmm2, xmm0 punpckhbw xmm6, xmm0 paddsw xmm2, XMMWORD PTR [rdx+32] paddsw xmm6, XMMWORD PTR [rdx+48] packuswb xmm2, xmm6 ; pack and unpack to saturate movdqa XMMWORD PTR [rdi+rax], xmm2 movdqa xmm3, XMMWORD PTR [rsi+32] movdqa xmm7, xmm3 punpcklbw xmm3, xmm0 punpckhbw xmm7, xmm0 paddsw xmm3, XMMWORD PTR [rdx+64] paddsw xmm7, XMMWORD PTR [rdx+80] packuswb xmm3, xmm7 ; pack and unpack to saturate movdqa XMMWORD PTR [rdi+rax*2], xmm3 add rdi, rax movdqa xmm4, XMMWORD PTR [rsi+48] movdqa xmm5, xmm4 punpcklbw xmm4, xmm0 punpckhbw xmm5, xmm0 paddsw xmm4, XMMWORD PTR [rdx+96] paddsw xmm5, XMMWORD PTR [rdx+112] packuswb xmm4, xmm5 ; pack and unpack to saturate movdqa XMMWORD PTR [rdi+rax*2], xmm4 ; begin epilog pop rdi pop rsi RESTORE_XMM UNSHADOW_ARGS pop rbp ret ;void copy_mem16x16_sse2( ; unsigned char *src, ; int src_stride, ; unsigned char *dst, ; int dst_stride ; ) global sym(vp8_copy_mem16x16_sse2) sym(vp8_copy_mem16x16_sse2): push rbp mov rbp, rsp SHADOW_ARGS_TO_STACK 4 push rsi push rdi ; end prolog mov rsi, arg(0) ;src; movdqu xmm0, [rsi] movsxd rax, dword ptr arg(1) ;src_stride; mov rdi, arg(2) ;dst; movdqu xmm1, [rsi+rax] movdqu xmm2, [rsi+rax*2] movsxd rcx, dword ptr arg(3) ;dst_stride lea rsi, [rsi+rax*2] movdqa [rdi], xmm0 add rsi, rax movdqa [rdi+rcx], xmm1 movdqa [rdi+rcx*2],xmm2 lea rdi, [rdi+rcx*2] movdqu xmm3, [rsi] add rdi, rcx movdqu xmm4, [rsi+rax] movdqu xmm5, [rsi+rax*2] lea rsi, [rsi+rax*2] movdqa [rdi], xmm3 add rsi, rax movdqa [rdi+rcx], xmm4 movdqa [rdi+rcx*2],xmm5 lea rdi, [rdi+rcx*2] movdqu xmm0, [rsi] add rdi, rcx movdqu xmm1, [rsi+rax] movdqu xmm2, [rsi+rax*2] lea rsi, [rsi+rax*2] movdqa [rdi], xmm0 add rsi, rax movdqa [rdi+rcx], xmm1 movdqa [rdi+rcx*2], xmm2 movdqu xmm3, [rsi] movdqu xmm4, [rsi+rax] lea rdi, [rdi+rcx*2] add rdi, rcx movdqu xmm5, [rsi+rax*2] lea rsi, [rsi+rax*2] movdqa [rdi], xmm3 add rsi, rax movdqa [rdi+rcx], xmm4 movdqa [rdi+rcx*2],xmm5 movdqu xmm0, [rsi] lea rdi, [rdi+rcx*2] movdqu xmm1, [rsi+rax] add rdi, rcx movdqu xmm2, [rsi+rax*2] lea rsi, [rsi+rax*2] movdqa [rdi], xmm0 movdqa [rdi+rcx], xmm1 movdqa [rdi+rcx*2],xmm2 movdqu xmm3, [rsi+rax] lea rdi, [rdi+rcx*2] movdqa [rdi+rcx], xmm3 ; begin epilog pop rdi pop rsi UNSHADOW_ARGS pop rbp ret
programs/oeis/155/A155120.asm
neoneye/loda
22
8099
<filename>programs/oeis/155/A155120.asm<gh_stars>10-100 ; A155120: a(n) = 2*(n^3 + n^2 + n - 1). ; -2,4,26,76,166,308,514,796,1166,1636,2218,2924,3766,4756,5906,7228,8734,10436,12346,14476,16838,19444,22306,25436,28846,32548,36554,40876,45526,50516,55858,61564,67646,74116,80986,88268,95974,104116,112706,121756,131278,141284,151786,162796,174326,186388,198994,212156,225886,240196,255098,270604,286726,303476,320866,338908,357614,376996,397066,417836,439318,461524,484466,508156,532606,557828,583834,610636,638246,666676,695938,726044,757006,788836,821546,855148,889654,925076,961426,998716,1036958,1076164,1116346,1157516,1199686,1242868,1287074,1332316,1378606,1425956,1474378,1523884,1574486,1626196,1679026,1732988,1788094,1844356,1901786,1960396 add $0,1 mov $1,$0 pow $0,2 add $0,2 sub $1,2 mul $0,$1 mul $0,2 add $0,4
oeis/113/A113128.asm
neoneye/loda-programs
11
179462
; A113128: A simple 4-diagonal matrix based on (1+x)^3. ; Submitted by <NAME> ; 1,3,2,3,6,3,1,6,9,4,0,2,9,12,5,0,0,3,12,15,6,0,0,0,4,15,18,7,0,0,0,0,5,18,21,8,0,0,0,0,0,6,21,24,9,0,0,0,0,0,0,7,24,27,10,0,0,0,0,0,0,0,8,27,30,11,0,0,0,0,0,0,0,0,9,30,33,12,0,0,0,0,0,0,0,0,0,10,33,36,13,0,0,0,0 lpb $0 add $1,1 sub $0,$1 mov $2,$1 sub $2,$0 lpe add $0,1 mov $1,3 bin $1,$2 mul $1,$0 mov $0,$1
test/Fail/customised/Issue2649-1.agda
shlevy/agda
1,989
15302
module Issue2649-1 where module MyModule (A : Set) (a : A) where foo : A foo = a
helpdesk.interpretador.impl/LabeledExprOld.g4
RuiAP/HelpDeskAsService
0
2921
<reponame>RuiAP/HelpDeskAsService grammar LabeledExprOld; prog: stat ; stat: expr NEWLINE # printExpr | ID '=' expr NEWLINE # assign | NEWLINE # blank ; expr: expr op=('*'|'/') expr # MulDiv | expr op=('+'|'-') expr# AddSub | INT # int | ID # id | '(' expr ')' # parens ; NEWLINE : [\r\n]+ ; INT:[0-9]+; ID:[a-z]+; MUL : '*' ; // assigns token name to '*' used above in grammar DIV : '/' ; ADD : '+' ; SUB : '-' ; ATR : '=' ; LPR : '(' ; RPR : ')' ;
programs/oeis/291/A291557.asm
karttu/loda
1
162606
; A291557: a(n) = 23*2^n - 1. ; 22,45,91,183,367,735,1471,2943,5887,11775,23551,47103,94207,188415,376831,753663,1507327,3014655,6029311,12058623,24117247,48234495,96468991,192937983,385875967,771751935,1543503871,3087007743,6174015487,12348030975,24696061951,49392123903,98784247807,197568495615,395136991231,790273982463,1580547964927 mov $1,2 pow $1,$0 sub $1,1 mul $1,23 add $1,22
programs/oeis/186/A186685.asm
neoneye/loda
22
11022
<filename>programs/oeis/186/A186685.asm<gh_stars>10-100 ; A186685: Total number of n-digit numbers requiring 19 positive biquadrates in their representation as sum of biquadrates. ; 0,1,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 sub $0,1 pow $0,3 mov $1,6 bin $1,$0 mov $0,$1
src/apsepp-test_node_class-suite_stub.adb
thierr26/ada-apsepp
0
11230
<reponame>thierr26/ada-apsepp<gh_stars>0 -- Copyright (C) 2019 <NAME> <<EMAIL>> -- MIT license. Please refer to the LICENSE file. with Apsepp.Test_Node_Class.Private_Test_Reporter; package body Apsepp.Test_Node_Class.Suite_Stub is T_S_S : aliased Test_Suite_Stub; ---------------------------------------------------------------------------- procedure Run_Children (Obj : Test_Node_Interfa'Class; Outcome : out Test_Outcome; Kind : Run_Kind) is use Private_Test_Reporter; T : constant Tag := Obj'Tag; Current_Child : Test_Node_Access := T_S_S'Access; Child_Run_Outcome : Test_Outcome; begin Outcome := Passed; for K in 1 .. Obj.Child_Count loop begin Current_Child := Obj.Child (K); begin Current_Child.Run (Child_Run_Outcome, Kind); case Child_Run_Outcome is when Passed => null; when Failed => Outcome := Failed; end case; exception when E : others => Outcome := Failed; case Kind is when Check_Cond => Test_Reporter.Report_Unexpected_Node_Cond_Check_Error (T, E); when Assert_Cond_And_Run_Test => Test_Reporter.Report_Unexpected_Node_Run_Error (T, E); end case; end; exception when Access_E : others => Test_Reporter.Report_Failed_Child_Test_Node_Access (T, (if K = 1 then No_Tag else Current_Child'Tag), Access_E); end; end loop; end Run_Children; ---------------------------------------------------------------------------- overriding procedure Run (Obj : in out Test_Suite_Stub; Outcome : out Test_Outcome; Kind : Run_Kind := Assert_Cond_And_Run_Test) is ----------------------------------------------------- function Cond return Boolean is Outc : Test_Outcome := Passed; begin case Kind is when Check_Cond => Run_Children (Obj, Outc, Kind); when Assert_Cond_And_Run_Test => null; end case; return (case Outc is when Failed => False, when Passed => True); end Cond; ----------------------------------------------------- begin Run_Body (Obj, Outcome, Kind, Cond'Access); case Kind is when Check_Cond => null; when Assert_Cond_And_Run_Test => Obj.Early_Run_Done_Flag := False; end case; end Run; ---------------------------------------------------------------------------- overriding function Child (Obj : Test_Suite_Stub; K : Test_Node_Index) return Test_Node_Access is (T_S_S'Access); -- Raises because of class-wide pre-condition violation -- (K <= Obj.Child_Count). ---------------------------------------------------------------------------- overriding function Early_Run_Done (Obj : Test_Suite_Stub) return Boolean is (Obj.Early_Run_Done_Flag); ---------------------------------------------------------------------------- overriding procedure Early_Run (Obj : in out Test_Suite_Stub) is begin Obj.Early_Run_Done_Flag := True; for K in 1 .. Test_Suite_Stub'Class (Obj).Child_Count loop declare Ch : constant Test_Node_Access := Test_Suite_Stub'Class (Obj).Child (K); begin if not Ch.Early_Run_Done then Ch.Early_Run; end if; end; end loop; end Early_Run; ---------------------------------------------------------------------------- end Apsepp.Test_Node_Class.Suite_Stub;
programs/oeis/010/A010004.asm
karttu/loda
1
26080
<reponame>karttu/loda ; A010004: a(0) = 1, a(n) = 13*n^2 + 2 for n>0. ; 1,15,54,119,210,327,470,639,834,1055,1302,1575,1874,2199,2550,2927,3330,3759,4214,4695,5202,5735,6294,6879,7490,8127,8790,9479,10194,10935,11702,12495,13314,14159,15030,15927,16850,17799,18774,19775,20802,21855,22934,24039,25170,26327,27510,28719,29954,31215,32502,33815,35154,36519,37910,39327,40770,42239,43734,45255,46802,48375,49974,51599,53250,54927,56630,58359,60114,61895,63702,65535,67394,69279,71190,73127,75090,77079,79094,81135,83202,85295,87414,89559,91730,93927,96150,98399,100674,102975,105302,107655,110034,112439,114870,117327,119810,122319,124854,127415,130002,132615,135254,137919,140610,143327,146070,148839,151634,154455,157302,160175,163074,165999,168950,171927,174930,177959,181014,184095,187202,190335,193494,196679,199890,203127,206390,209679,212994,216335,219702,223095,226514,229959,233430,236927,240450,243999,247574,251175,254802,258455,262134,265839,269570,273327,277110,280919,284754,288615,292502,296415,300354,304319,308310,312327,316370,320439,324534,328655,332802,336975,341174,345399,349650,353927,358230,362559,366914,371295,375702,380135,384594,389079,393590,398127,402690,407279,411894,416535,421202,425895,430614,435359,440130,444927,449750,454599,459474,464375,469302,474255,479234,484239,489270,494327,499410,504519,509654,514815,520002,525215,530454,535719,541010,546327,551670,557039,562434,567855,573302,578775,584274,589799,595350,600927,606530,612159,617814,623495,629202,634935,640694,646479,652290,658127,663990,669879,675794,681735,687702,693695,699714,705759,711830,717927,724050,730199,736374,742575,748802,755055,761334,767639,773970,780327,786710,793119,799554,806015 pow $1,$0 gcd $1,2 mov $3,$0 mul $3,$0 mov $2,$3 mul $2,13 add $1,$2
src/gen-artifacts-yaml.ads
My-Colaborations/dynamo
0
22975
<reponame>My-Colaborations/dynamo<gh_stars>0 ----------------------------------------------------------------------- -- gen-artifacts-yaml -- Yaml database model files -- Copyright (C) 2018 <NAME> -- Written by <NAME> (<EMAIL>) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Gen.Model.Packages; package Gen.Artifacts.Yaml is -- ------------------------------ -- Yaml artifact -- ------------------------------ type Artifact is new Gen.Artifacts.Artifact with private; -- Prepare the model after all the configuration files have been read and before -- actually invoking the generation. overriding procedure Prepare (Handler : in out Artifact; Model : in out Gen.Model.Packages.Model_Definition'Class; Context : in out Generator'Class); -- Read the UML/XMI model file. procedure Read_Model (Handler : in out Artifact; File : in String; Model : in out Gen.Model.Packages.Model_Definition; Context : in out Generator'Class); -- Save the model in a YAML file. procedure Save_Model (Handler : in Artifact; Path : in String; Model : in out Gen.Model.Packages.Model_Definition'Class; Context : in out Generator'Class); private type Artifact is new Gen.Artifacts.Artifact with null record; end Gen.Artifacts.Yaml;
Scripts/AppleScript/Test Standard Suite.applescript
ghartnett/MenubarCountdown
75
2665
<filename>Scripts/AppleScript/Test Standard Suite.applescript -- Demonstrates how to use these Standard Suite scripting properties: -- -- - name -- - version -- - frontmost tell application "Menubar Countdown" activate show start dialog say "The name of the application is " & name & "." say "The version is " & version & "." if frontmost then say "The application is frontmost." else say "The application is not frontmost." end if quit end tell
examples/stm32f0/power_modes/main.adb
ekoeppen/STM32_Generic_Ada_Drivers
1
19791
<reponame>ekoeppen/STM32_Generic_Ada_Drivers<gh_stars>1-10 with System; with STM32GD; with STM32_SVD; use STM32_SVD; with STM32_SVD.Flash; use STM32_SVD.Flash; with STM32_SVD.RCC; use STM32_SVD.RCC; with STM32_SVD.PWR; use STM32_SVD.PWR; with STM32_SVD.GPIO; use STM32_SVD.GPIO; with STM32_SVD.RTC; use STM32_SVD.RTC; with Startup; procedure Main is procedure Deactivate_Peripherals is begin RCC_Periph.AHBENR := ( IOPAEN => 1, IOPBEN => 1, IOPCEN => 1, IOPDEN => 1, IOPFEN => 1, Reserved_7_16 => 0, Reserved_23_31 => 0, others => 0); GPIOA_Periph.MODER.Val := 16#FFFF_FFFF#; GPIOB_Periph.MODER.Val := 16#FFFF_FFFF#; GPIOC_Periph.MODER.Val := 16#FFFF_FFFF#; GPIOD_Periph.MODER.Val := 16#FFFF_FFFF#; GPIOF_Periph.MODER.Val := 16#FFFF_FFFF#; RCC_Periph.AHBENR := ( Reserved_7_16 => 0, Reserved_23_31 => 0, others => 0); RCC_Periph.APB1ENR := ( Reserved_2_3 => 0, Reserved_5_7 => 0, Reserved_9_10 => 0, Reserved_12_13 => 0, Reserved_15_16 => 0, Reserved_18_20 => 0, Reserved_23_27 => 0, Reserved_29_31 => 0, others => 0); RCC_Periph.APB2ENR := ( Reserved_1_8 => 0, Reserved_19_21 => 0, Reserved_23_31 => 0, others => 0); end Deactivate_Peripherals; procedure Start_RTC is begin RCC_Periph.CSR.LSION := 1; while RCC_Periph.CSR.LSIRDY = 0 loop null; end loop; RCC_Periph.BDCR.RTCSEL := 2#10#; RCC_Periph.BDCR.RTCEN := 1; end Start_RTC; procedure Sleep is begin loop STM32GD.WFI; end loop; end Sleep; procedure Stop is SCB_SCR : aliased STM32_SVD.UInt32 with Address => System'To_Address (16#E000ED10#); SCR : UInt32; begin PWR_Periph.CR.LPDS := 1; PWR_Periph.CR.PDDS := 0; SCR := SCB_SCR or 2#100#; SCB_SCR := SCR; Deactivate_Peripherals; Sleep; end Stop; procedure Standby is SCB_SCR : aliased STM32_SVD.UInt32 with Address => System'To_Address (16#E000ED10#); SCR : UInt32; begin PWR_Periph.CR.LPDS := 1; PWR_Periph.CR.PDDS := 1; SCR := SCB_SCR or 2#100#; SCB_SCR := SCR; Deactivate_Peripherals; Sleep; end Standby; begin RCC_Periph.APB1ENR.PWREN := 1; loop Start_RTC; -- Sleep; -- Low_Power_Sleep; Stop; -- Standby; end loop; end Main;
oeis/168/A168420.asm
neoneye/loda-programs
11
241294
; A168420: a(n) = 4 + 10*floor(n/2). ; Submitted by <NAME> ; 4,14,14,24,24,34,34,44,44,54,54,64,64,74,74,84,84,94,94,104,104,114,114,124,124,134,134,144,144,154,154,164,164,174,174,184,184,194,194,204,204,214,214,224,224,234,234,244,244,254,254,264,264,274,274,284,284,294,294,304,304,314,314,324,324,334,334,344,344,354,354,364,364,374,374,384,384,394,394,404,404,414,414,424,424,434,434,444,444,454,454,464,464,474,474,484,484,494,494,504 add $0,1 div $0,2 mul $0,10 add $0,4
programs/oeis/204/A204443.asm
neoneye/loda
22
101476
; A204443: Symmetric matrix: f(i,j)=floor[(i+j+3)/4]-floor[(i+j)/4], by (constant) antidiagonals. ; 1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 seq $0,2024 ; n appears n times; a(n) = floor(sqrt(2n) + 1/2). bin $0,3 add $0,1 mod $0,2
src/Categories/Category/Lift.agda
Trebor-Huang/agda-categories
279
6916
<reponame>Trebor-Huang/agda-categories {-# OPTIONS --without-K --safe #-} module Categories.Category.Lift where open import Level open import Categories.Category open import Categories.Functor using (Functor) liftC : ∀ {o ℓ e} o′ ℓ′ e′ → Category o ℓ e → Category (o ⊔ o′) (ℓ ⊔ ℓ′) (e ⊔ e′) liftC o′ ℓ′ e′ C = record { Obj = Lift o′ Obj ; _⇒_ = λ X Y → Lift ℓ′ (lower X ⇒ lower Y) ; _≈_ = λ f g → Lift e′ (lower f ≈ lower g) ; id = lift id ; _∘_ = λ f g → lift (lower f ∘ lower g) ; assoc = lift assoc ; sym-assoc = lift sym-assoc ; identityˡ = lift identityˡ ; identityʳ = lift identityʳ ; identity² = lift identity² ; equiv = record { refl = lift Equiv.refl ; sym = λ eq → lift (Equiv.sym (lower eq)) ; trans = λ eq eq′ → lift (Equiv.trans (lower eq) (lower eq′)) } ; ∘-resp-≈ = λ eq eq′ → lift (∘-resp-≈ (lower eq) (lower eq′)) } where open Category C liftF : ∀ {o ℓ e} o′ ℓ′ e′ (C : Category o ℓ e) → Functor C (liftC o′ ℓ′ e′ C) liftF o′ ℓ′ e′ C = record { F₀ = lift ; F₁ = lift ; identity = lift refl ; homomorphism = lift refl ; F-resp-≈ = lift } where open Category C open Equiv unliftF : ∀ {o ℓ e} o′ ℓ′ e′ (C : Category o ℓ e) → Functor (liftC o′ ℓ′ e′ C) C unliftF o′ ℓ′ e′ C = record { F₀ = lower ; F₁ = lower ; identity = refl ; homomorphism = refl ; F-resp-≈ = lower } where open Category C open Equiv
agda/Invert.agda
anqurvanillapy/fpl
1
8931
<filename>agda/Invert.agda {-# OPTIONS --safe #-} module Invert where open import Relation.Binary.PropositionalEquality open import Data.Nat open import Data.Nat.Properties _∘_ : ∀ {A B C : Set} → (B → C) → (A → B) → (A → C) (g ∘ f) x = g (f x) pred₂ : ℕ → ℕ pred₂ = pred ∘ pred lemma : (a b : ℕ) → pred₂ (suc a + suc a) ≡ pred₂ (suc b + suc b) → a + a ≡ b + b lemma a b p = begin a + a ≡⟨⟩ pred₂ (suc (suc (a + a))) ≡⟨⟩ pred₂ (suc (suc a + a)) ≡⟨ cong (pred₂ ∘ suc) (+-comm (suc a) a) ⟩ pred₂ (suc (a + suc a)) ≡⟨⟩ pred₂ (suc a + suc a) ≡⟨ p ⟩ pred₂ (suc b + suc b) ≡⟨⟩ pred₂ (suc (b + suc b)) ≡⟨ cong (pred₂ ∘ suc) (+-comm b (suc b)) ⟩ pred₂ (suc (suc b + b)) ≡⟨⟩ b + b ∎ where open ≡-Reasoning invert : (a b : ℕ) → a + a ≡ b + b → a ≡ b invert zero zero p = refl invert (suc m) (suc n) p = cong suc (invert m n (lemma m n (cong pred₂ p)))
Sound Scripts/MuteInternalMic.applescript
rogues-gallery/applescript
360
4295
<reponame>rogues-gallery/applescript<filename>Sound Scripts/MuteInternalMic.applescript --- Automated mic muting tell application "System Events" to set volume input volume 0
tier-1/gmp/source/thin/gmp_c-mpf_srcptr.ads
charlie5/cBound
2
102
-- This file is generated by SWIG. Please do *not* modify by hand. -- with gmp_c.a_a_mpf_struct; with Interfaces.C; package gmp_c.mpf_srcptr is -- Item -- subtype Item is gmp_c.a_a_mpf_struct.Pointer; -- Items -- type Items is array (Interfaces.C.size_t range <>) of aliased gmp_c.mpf_srcptr.Item; -- Pointer -- type Pointer is access all gmp_c.mpf_srcptr.Item; -- Pointers -- type Pointers is array (Interfaces.C.size_t range <>) of aliased gmp_c.mpf_srcptr.Pointer; -- Pointer_Pointer -- type Pointer_Pointer is access all gmp_c.mpf_srcptr.Pointer; end gmp_c.mpf_srcptr;
arch/ARM/STM32/driver_demos/demo_dac_dma/src/demo_dac_dma.adb
rocher/Ada_Drivers_Library
192
23959
<gh_stars>100-1000 ------------------------------------------------------------------------------ -- -- -- Copyright (C) 2015-2017, AdaCore -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. 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 -- -- 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. -- -- -- ------------------------------------------------------------------------------ -- This program demonstrates digital-to-analog conversion (DAC) output using -- DMA driven by a timer for the DAC input. -- The user increments the percentage of the DAC output (VRef+) voltage -- using the blue User button on the STM32F429 Discovery board. The current -- percentage is displayed on the LCD. The percentage is converted into an -- absolute value based on the selected resolution. For example, a digital -- value of 2048 represents 50% in 12-bit resolution. The DMA controller -- periodically transfers this digital value to the DAC, driven by a timer. -- The DAC continuously converts this digital value to an analog voltage. -- Attach a voltmeter to PA4 (or PA5 if channel 2 is used) to see the voltage -- changes. with Last_Chance_Handler; pragma Unreferenced (Last_Chance_Handler); with HAL; use HAL; with STM32.Board; use STM32.Board; with STM32.Device; use STM32.Device; with STM32.GPIO; use STM32.GPIO; with STM32.DAC; use STM32.DAC; with STM32.DMA; use STM32.DMA; with STM32.Timers; use STM32.Timers; with LCD_Std_Out; use LCD_Std_Out; with System; procedure Demo_DAC_DMA is --------------------------------- DMA ------------------------------------ -- Note that DAC channel 1 uses DMA controller 1, Stream 5, Channel 7 Controller : DMA_Controller renames DMA_1; Stream : constant DMA_Stream_Selector := Stream_5; Selected_DMA_Channel : constant DMA_Channel_Selector := Channel_7; -------------------------------- Timer ----------------------------------- Selected_Timer : Timer renames Timer_6; Selected_Trigger : constant External_Event_Trigger_Selection := Timer_6_Output_Trigger; -- NB: must match the timer selected above --------------------------------- DAC ------------------------------------ Selected_DAC : Digital_To_Analog_Converter renames DAC_1; Output_Channel : constant DAC_Channel := Channel_1; -- DAC channel 1 uses DMA controller 1, Stream 5, Channel 7 DAC_Data_Register_Address : constant System.Address := Data_Address (Selected_DAC, Output_Channel, DAC_Resolution_12_Bits, Right_Aligned); -- The address of the "data holding register" within the DAC that will -- receive the value of Counts via DMA. ---------------------------------------------------------------------------- Requested_Percentage : UInt32 range 0 .. 100; -- User input (via the button) representing the currently requested -- percentage of the VRef+ DAC output voltage. Counts : UInt32 := 0 with Atomic; -- The numeric input to the DAC that ultimately controls the voltage -- produced (by the DAC) on the GPIO analog output pin. The value is -- computed using the Requested_Percentage variable (set by the user) -- and Max_Counts, which is either 4095 (12-bit resolution) or 255 (8-bit -- resolution). For example, at 12-bit resolution, to get half of the VRef+ -- output voltage would require Counts to be 2048. procedure Print (Value : UInt32); -- Prints the image of the arg at a fixed location procedure Await_Button; -- Wait for the user to press and then release the blue user button procedure Configure_DAC_GPIO (Output_Channel : DAC_Channel); procedure Initialize_DMA; procedure Initialize_Timer; procedure Initialize_DAC; ----------- -- Print -- ----------- procedure Print (Value : UInt32) is Value_Image : constant String := Value'Img; begin Put (170, 52, Value_Image (2 .. Value_Image'Last) & " "); end Print; ------------------ -- Await_Button -- ------------------ procedure Await_Button is begin Await_Pressed : loop exit Await_Pressed when Set (User_Button_Point); end loop Await_Pressed; Await_Released : loop exit Await_Released when not Set (User_Button_Point); end loop Await_Released; end Await_Button; ------------------------ -- Configure_DAC_GPIO -- ------------------------ procedure Configure_DAC_GPIO (Output_Channel : DAC_Channel) is Output : constant GPIO_Point := (if Output_Channel = Channel_1 then DAC_Channel_1_IO else DAC_Channel_2_IO); begin Enable_Clock (Output); Configure_IO (Output, (Mode => Mode_Analog, Resistors => Floating)); end Configure_DAC_GPIO; -------------------- -- Initialize_DMA -- -------------------- procedure Initialize_DMA is Config : DMA_Stream_Configuration; begin Enable_Clock (Controller); Reset (Controller, Stream); Config.Channel := Selected_DMA_Channel; Config.Direction := Memory_To_Peripheral; Config.Memory_Data_Format := HalfWords; Config.Peripheral_Data_Format := HalfWords; Config.Increment_Peripheral_Address := False; Config.Increment_Memory_Address := False; Config.Operation_Mode := Circular_Mode; Config.Priority := Priority_Very_High; Config.FIFO_Enabled := False; Config.FIFO_Threshold := FIFO_Threshold_Half_Full_Configuration; Config.Memory_Burst_Size := Memory_Burst_Single; Config.Peripheral_Burst_Size := Peripheral_Burst_Single; Configure (Controller, Stream, Config); Clear_All_Status (Controller, Stream); Configure_Data_Flow (Controller, Stream, Source => Counts'Address, Destination => DAC_Data_Register_Address, Data_Count => 1); -- 1 halfword Enable (Controller, Stream); end Initialize_DMA; ---------------------- -- Initialize_Timer -- ---------------------- procedure Initialize_Timer is begin Enable_Clock (Selected_Timer); Configure (Selected_Timer, Prescaler => 0, Period => 16#FF#); Select_Output_Trigger (Selected_Timer, Source => Update); end Initialize_Timer; -------------------- -- Initialize_DAC -- -------------------- procedure Initialize_DAC is begin Configure_DAC_GPIO (Output_Channel); Enable_Clock (Selected_DAC); Reset (Selected_DAC); Select_Trigger (Selected_DAC, Output_Channel, Selected_Trigger); Enable_Trigger (Selected_DAC, Output_Channel); Enable (Selected_DAC, Output_Channel); Enable_DMA (Selected_DAC, Output_Channel); end Initialize_DAC; begin -- main subprogram Initialize_LEDs; All_LEDs_Off; Configure_User_Button_GPIO; LCD_Std_Out.Clear_Screen; Initialize_Timer; Initialize_DMA; Initialize_DAC; Enable (Selected_Timer); Put (0, 0, "VRef+ is 2.95V"); -- Vdd, measured Put (0, 25, "Button advances"); Put (0, 52, "Current %:"); loop for K in UInt32 range 0 .. 10 loop Requested_Percentage := K * 10; Print (Requested_Percentage); Counts := (Requested_Percentage * Max_12bit_Resolution) / 100; -- Counts is transferred to the DAC via DMA Await_Button; end loop; end loop; end Demo_DAC_DMA;
Task/Pangram-checker/Ada/pangram-checker-1.ada
LaudateCorpus1/RosettaCodeData
1
20589
<reponame>LaudateCorpus1/RosettaCodeData with Ada.Text_IO; use Ada.Text_IO; with Ada.Strings.Maps; use Ada.Strings.Maps; with Ada.Characters.Handling; use Ada.Characters.Handling; procedure pangram is function ispangram(txt: String) return Boolean is (Is_Subset(To_Set(Span => ('a','z')), To_Set(To_Lower(txt)))); begin put_line(Boolean'Image(ispangram("This is a test"))); put_line(Boolean'Image(ispangram("The quick brown fox jumps over the lazy dog"))); put_line(Boolean'Image(ispangram("NOPQRSTUVWXYZ abcdefghijklm"))); put_line(Boolean'Image(ispangram("abcdefghijklopqrstuvwxyz"))); --Missing m, n end pangram;
bios.nasm
fasync/Syndicate
1
7851
;; Copyright (c) 2021, <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: ;; 1. Redistributions of source code must retain the above copyright ;; notice, this list of conditions and the following disclaimer. ;; ;; 2. Redistributions in binary form must reproduce the above copyright notice, ;; this list of conditions and the following disclaimer in the ;; documentation and/or other materials provided with the distribution. ;; ;; THIS SOFTWARE IS PROVIDED BY <NAME> ''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 <NAME> 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. ;; bios.nasm ;; Routine for detecting the BIOS ;; Try to detect EGA, VGA or VESA BIOS detect_bios: push ax push bx push cx push dx ;; Get EGA Info http://www.ctyme.com/intr/rb-0162.htm mov ah, 0x12 mov bl, 0x10 int 0x10 cmp bl, 0x10 jne _detect_bios_success ;; Get VGA Info http://www.ctyme.com/intr/rb-0219.htm mov ax, 0x1A00 int 0x10 cmp al, 0x1A ; Function was supported je _detect_bios_success ;; Get SuperVGA Info http://www.ctyme.com/intr/rb-0273.htm mov ax, __vesa_info_buffer mov es, ax xor di, di mov ax, 0x4F00 int 0x10 cmp ax, 0x004F je _detect_bios_success _detect_bios_error: mov si, __msg_detect_bios_error call printer jmp $ _detect_bios_success: pop dx pop cx pop bx pop ax ret __msg_detect_bios_error: db 0xD, 0xE, `Error: Could not detect BIOS.`, 0x00 __vesa_info_buffer: db 256
python_src/other/export/screen_2_4.asm
fjpena/sword-of-ianna-msx2
43
23956
<filename>python_src/other/export/screen_2_4.asm org $0000 ; Object types OBJECT_NONE EQU 0 OBJECT_SWITCH EQU 1 OBJECT_DOOR EQU 2 OBJECT_DOOR_DESTROY EQU 3 OBJECT_FLOOR_DESTROY EQU 4 OBJECT_WALL_DESTROY EQU 5 OBJECT_BOX_LEFT EQU 6 OBJECT_BOX_RIGHT EQU 7 OBJECT_JAR EQU 8 OBJECT_TELEPORTER EQU 9 ; Pickable object types OBJECT_KEY_GREEN EQU 11 OBJECT_KEY_BLUE EQU 12 OBJECT_KEY_YELLOW EQU 13 OBJECT_BREAD EQU 14 OBJECT_MEAT EQU 15 OBJECT_HEALTH EQU 16 OBJECT_KEY_RED EQU 17 OBJECT_KEY_WHITE EQU 18 OBJECT_KEY_PURPLE EQU 19 ; Object types for enemies OBJECT_ENEMY_SKELETON EQU 20 OBJECT_ENEMY_ORC EQU 21 OBJECT_ENEMY_MUMMY EQU 22 OBJECT_ENEMY_TROLL EQU 23 OBJECT_ENEMY_ROCK EQU 24 OBJECT_ENEMY_KNIGHT EQU 25 OBJECT_ENEMY_DALGURAK EQU 26 OBJECT_ENEMY_GOLEM EQU 27 OBJECT_ENEMY_OGRE EQU 28 OBJECT_ENEMY_MINOTAUR EQU 29 OBJECT_ENEMY_DEMON EQU 30 OBJECT_ENEMY_SECONDARY EQU 31 Screen_2_4: DB 8, 9, 33, 34, 8, 9, 33, 34, 33, 34, 8, 9, 33, 34, 8, 60 DB 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60 DB 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 26, 77 DB 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 60 DB 15, 14, 14, 17, 20, 0, 0, 0, 21, 19, 19, 19, 19, 19, 19, 78 DB 50, 49, 50, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 126, 147, 22 DB 109, 110, 49, 65, 0, 0, 0, 0, 0, 0, 0, 0, 126, 146, 0, 23 DB 112, 111, 110, 18, 73, 74, 13, 0, 0, 0, 0, 126, 147, 145, 0, 23 DB 252, 253, 31, 36, 78, 76, 78, 77, 13, 0, 126, 147, 0, 0, 0, 24 DB 14, 14, 14, 15, 14, 15, 14, 14, 15, 14, 14, 180, 163, 37, 14, 15 HardScreen_2_4: DB 170, 170, 170, 169 DB 0, 0, 0, 1 DB 0, 0, 0, 5 DB 0, 0, 0, 5 DB 85, 128, 170, 169 DB 85, 0, 0, 1 DB 85, 0, 0, 1 DB 85, 92, 0, 1 DB 85, 85, 192, 1 DB 85, 85, 87, 245 Obj_2_4: DB 1 ; PLAYER DB 0, OBJECT_ENEMY_ORC, 12, 2, 0, 47 DB 0, OBJECT_NONE, 0, 0, 0, 0 ; EMPTY ENEMY DB 11, OBJECT_SWITCH, 14, 2, 0, 34 DB 27, OBJECT_DOOR, 15, 5, 0, 49 DB 50, OBJECT_JAR, 12, 9, 0, 36 DB 56, OBJECT_TELEPORTER, 15, 7, 0, 50 DB 0, OBJECT_NONE, 0, 0, 0, 0 ; EMPTY OBJECT
tests/nonsmoke/functional/CompileTests/experimental_ada_tests/tests/simple_expression_range.ads
ouankou/rose
488
8629
<reponame>ouankou/rose package Simple_Expression_Range is type Constrained_Type is new Integer range 1..10; end Simple_Expression_Range;
libsrc/_DEVELOPMENT/math/integer/z180/l_z180_mulu_32_16x16.asm
Toysoft/z88dk
0
25825
INCLUDE "config_private.inc" SECTION code_clib SECTION code_math PUBLIC l_z180_mulu_32_16x16 l_z180_mulu_32_16x16: ; multiplication of two 16-bit numbers into a 32-bit product ; ; enter : hl = 16-bit multiplier = x ; de = 16-bit multiplicand = y ; ; exit : dehl = 32-bit product ; carry reset ; ; uses : af, bc, de, hl ld b,l ; xl ld c,d ; yh ld d,l ; xl ld l,c push hl ; xh yh ld l,e ; yl ; bc = xl yh ; de = xl yl ; hl = xh yl ; stack = xh yh mlt de ; xl*yl mlt bc ; xl*yh mlt hl ; xh*yl xor a ; zero A add hl,bc ; sum cross products adc a,a ; capture carry ld b,a ; carry from cross products ld c,h ; LSB of MSW from cross products ld a,d add a,l ld d,a ; de = final LSW pop hl mlt hl ; xh*yh adc hl,bc ; hl = final MSW ex de,hl ret
Cubical/Foundations/Univalence/Universe.agda
dan-iel-lee/cubical
0
17040
<gh_stars>0 {-# OPTIONS --cubical --no-import-sorts --safe --postfix-projections #-} open import Cubical.Core.Everything open import Cubical.Functions.Embedding open import Cubical.Foundations.Equiv open import Cubical.Foundations.Function open import Cubical.Foundations.Isomorphism open import Cubical.Foundations.Prelude open import Cubical.Foundations.Univalence open import Cubical.Foundations.Transport -- A helper module for deriving univalence for a higher inductive-recursive -- universe. -- -- U is the type of codes -- El is the decoding -- un is a higher constructor that requires paths between codes to exist -- for equivalences of decodings -- comp is intended to be the computational behavior of El on un, although -- it seems that being a path is sufficient. -- -- Given a universe defined as above, it's possible to show that the path -- space of the code type is equivalent to the path space of the actual -- decodings, which are themselves determined by equivalences. -- -- The levels are left independent, but of course it will generally be -- impossible to define this sort of universe unless ℓ' < ℓ, because El will -- be too big to go in a constructor of U. The exception would be if U could -- be defined independently of El, though it might be tricky to get the right -- higher structure in such a case. module Cubical.Foundations.Univalence.Universe {ℓ ℓ'} (U : Type ℓ) (El : U → Type ℓ') (un : ∀ s t → El s ≃ El t → s ≡ t) (comp : ∀{s t} (e : El s ≃ El t) → cong El (un s t e) ≡ ua e) where private variable A : Type ℓ' module UU-Lemmas where reg : transport (λ _ → A) ≡ idfun A reg {A} i z = transp (λ _ → A) i z nu : ∀ x y → x ≡ y → El x ≃ El y nu x y p = transportEquiv (cong El p) cong-un-te : ∀ x y (p : El x ≡ El y) → cong El (un x y (transportEquiv p)) ≡ p cong-un-te x y p = comp (transportEquiv p) ∙ uaTransportη p nu-un : ∀ x y (e : El x ≃ El y) → nu x y (un x y e) ≡ e nu-un x y e = equivEq {e = nu x y (un x y e)} {f = e} λ i z → (cong (λ p → transport p z) (comp e) ∙ uaβ e z) i El-un-equiv : ∀ x i → El (un x x (idEquiv _) i) ≃ El x El-un-equiv x i = λ where .fst → transp (λ j → p j) (i ∨ ~ i) .snd → transp (λ j → isEquiv (transp (λ k → p (j ∧ k)) (~ j ∨ i ∨ ~ i))) (i ∨ ~ i) (idIsEquiv T) where T = El (un x x (idEquiv _) i) p : T ≡ El x p j = (comp (idEquiv _) ∙ uaIdEquiv {A = El x}) j i un-refl : ∀ x → un x x (idEquiv (El x)) ≡ refl un-refl x i j = hcomp (λ k → λ where (i = i0) → un x x (idEquiv (El x)) j (i = i1) → un x x (idEquiv (El x)) (j ∨ k) (j = i0) → un x x (idEquiv (El x)) (~ i ∨ k) (j = i1) → x) (un (un x x (idEquiv (El x)) (~ i)) x (El-un-equiv x (~ i)) j) nu-refl : ∀ x → nu x x refl ≡ idEquiv (El x) nu-refl x = equivEq {e = nu x x refl} {f = idEquiv (El x)} reg un-nu : ∀ x y (p : x ≡ y) → un x y (nu x y p) ≡ p un-nu x y p = J (λ z q → un x z (nu x z q) ≡ q) (cong (un x x) (nu-refl x) ∙ un-refl x) p open UU-Lemmas open Iso equivIso : ∀ s t → Iso (s ≡ t) (El s ≃ El t) equivIso s t .fun = nu s t equivIso s t .inv = un s t equivIso s t .rightInv = nu-un s t equivIso s t .leftInv = un-nu s t pathIso : ∀ s t → Iso (s ≡ t) (El s ≡ El t) pathIso s t .fun = cong El pathIso s t .inv = un s t ∘ transportEquiv pathIso s t .rightInv = cong-un-te s t pathIso s t .leftInv = un-nu s t minivalence : ∀{s t} → (s ≡ t) ≃ (El s ≃ El t) minivalence {s} {t} = isoToEquiv (equivIso s t) path-reflection : ∀{s t} → (s ≡ t) ≃ (El s ≡ El t) path-reflection {s} {t} = isoToEquiv (pathIso s t) isEmbeddingEl : isEmbedding El isEmbeddingEl s t = snd path-reflection
src/main/fragment/mos6502-common/vbuxx=_byte1_vwum1.asm
jbrandwood/kickc
2
3697
ldx {m1}+1
Transynther/x86/_processed/US/_zr_/i7-7700_9_0xca_notsx.log_21829_1629.asm
ljhsiun2/medusa
9
98635
.global s_prepare_buffers s_prepare_buffers: push %r13 push %r15 push %r8 push %rbp push %rbx push %rdi push %rdx lea addresses_WT_ht+0xd349, %rdi nop nop nop nop nop dec %rbp mov (%rdi), %bx xor %rdi, %rdi lea addresses_normal_ht+0x6c9, %rdx nop nop nop nop nop cmp %rbp, %rbp movb (%rdx), %r15b nop nop nop nop sub %r15, %r15 lea addresses_WC_ht+0x31c9, %r13 add %r8, %r8 mov $0x6162636465666768, %rbp movq %rbp, (%r13) nop nop xor $63854, %rdx lea addresses_normal_ht+0x112c9, %r8 clflush (%r8) add %r13, %r13 movb (%r8), %bl cmp $56471, %r13 pop %rdx pop %rdi pop %rbx pop %rbp pop %r8 pop %r15 pop %r13 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r13 push %r14 push %rcx push %rdi push %rdx push %rsi // Store lea addresses_UC+0x1f9c1, %r14 nop and $21638, %r11 mov $0x5152535455565758, %r12 movq %r12, (%r14) nop and %rsi, %rsi // Store lea addresses_PSE+0x19b49, %r14 nop inc %r12 mov $0x5152535455565758, %r11 movq %r11, (%r14) nop nop dec %r13 // REPMOV mov $0x2c9, %rsi mov $0x45f8b100000006c9, %rdi nop nop nop nop and $26031, %r13 mov $44, %rcx rep movsb sub %r12, %r12 // Store mov $0xb89, %r12 nop nop and $17268, %r11 movb $0x51, (%r12) nop nop nop nop xor %rdx, %rdx // Faulty Load lea addresses_US+0x106c9, %r12 clflush (%r12) nop nop nop nop nop dec %rcx mov (%r12), %r13d lea oracles, %r12 and $0xff, %r13 shlq $12, %r13 mov (%r12,%r13,1), %r13 pop %rsi pop %rdx pop %rdi pop %rcx pop %r14 pop %r13 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': False, 'type': 'addresses_US'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 3, 'same': False, 'type': 'addresses_UC'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 6, 'same': False, 'type': 'addresses_PSE'}, 'OP': 'STOR'} {'src': {'congruent': 9, 'same': False, 'type': 'addresses_P'}, 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_NC'}, 'OP': 'REPM'} {'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 2, 'same': False, 'type': 'addresses_P'}, 'OP': 'STOR'} [Faulty Load] {'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': True, 'type': 'addresses_US'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 7, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'} {'src': {'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 11, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'} {'dst': {'NT': True, 'AVXalign': False, 'size': 8, 'congruent': 7, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'} {'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 2, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'} {'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 */
source/nodes/program-nodes-component_definitions.adb
optikos/oasis
0
15598
<filename>source/nodes/program-nodes-component_definitions.adb -- Copyright (c) 2019 <NAME> <<EMAIL>> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- package body Program.Nodes.Component_Definitions is function Create (Aliased_Token : Program.Lexical_Elements.Lexical_Element_Access; Subtype_Indication : not null Program.Elements.Element_Access) return Component_Definition is begin return Result : Component_Definition := (Aliased_Token => Aliased_Token, Subtype_Indication => Subtype_Indication, Enclosing_Element => null) do Initialize (Result); end return; end Create; function Create (Subtype_Indication : not null Program.Elements.Element_Access; Is_Part_Of_Implicit : Boolean := False; Is_Part_Of_Inherited : Boolean := False; Is_Part_Of_Instance : Boolean := False; Has_Aliased : Boolean := False) return Implicit_Component_Definition is begin return Result : Implicit_Component_Definition := (Subtype_Indication => Subtype_Indication, Is_Part_Of_Implicit => Is_Part_Of_Implicit, Is_Part_Of_Inherited => Is_Part_Of_Inherited, Is_Part_Of_Instance => Is_Part_Of_Instance, Has_Aliased => Has_Aliased, Enclosing_Element => null) do Initialize (Result); end return; end Create; overriding function Subtype_Indication (Self : Base_Component_Definition) return not null Program.Elements.Element_Access is begin return Self.Subtype_Indication; end Subtype_Indication; overriding function Aliased_Token (Self : Component_Definition) return Program.Lexical_Elements.Lexical_Element_Access is begin return Self.Aliased_Token; end Aliased_Token; overriding function Has_Aliased (Self : Component_Definition) return Boolean is begin return Self.Aliased_Token.Assigned; end Has_Aliased; overriding function Is_Part_Of_Implicit (Self : Implicit_Component_Definition) return Boolean is begin return Self.Is_Part_Of_Implicit; end Is_Part_Of_Implicit; overriding function Is_Part_Of_Inherited (Self : Implicit_Component_Definition) return Boolean is begin return Self.Is_Part_Of_Inherited; end Is_Part_Of_Inherited; overriding function Is_Part_Of_Instance (Self : Implicit_Component_Definition) return Boolean is begin return Self.Is_Part_Of_Instance; end Is_Part_Of_Instance; overriding function Has_Aliased (Self : Implicit_Component_Definition) return Boolean is begin return Self.Has_Aliased; end Has_Aliased; procedure Initialize (Self : aliased in out Base_Component_Definition'Class) is begin Set_Enclosing_Element (Self.Subtype_Indication, Self'Unchecked_Access); null; end Initialize; overriding function Is_Component_Definition_Element (Self : Base_Component_Definition) return Boolean is pragma Unreferenced (Self); begin return True; end Is_Component_Definition_Element; overriding function Is_Definition_Element (Self : Base_Component_Definition) return Boolean is pragma Unreferenced (Self); begin return True; end Is_Definition_Element; overriding procedure Visit (Self : not null access Base_Component_Definition; Visitor : in out Program.Element_Visitors.Element_Visitor'Class) is begin Visitor.Component_Definition (Self); end Visit; overriding function To_Component_Definition_Text (Self : aliased in out Component_Definition) return Program.Elements.Component_Definitions .Component_Definition_Text_Access is begin return Self'Unchecked_Access; end To_Component_Definition_Text; overriding function To_Component_Definition_Text (Self : aliased in out Implicit_Component_Definition) return Program.Elements.Component_Definitions .Component_Definition_Text_Access is pragma Unreferenced (Self); begin return null; end To_Component_Definition_Text; end Program.Nodes.Component_Definitions;
courses/fundamentals_of_ada/labs/solar_system/adv_240_tasking_embedded/answers/solar_system-button.ads
AdaCore/training_material
15
2735
<gh_stars>10-100 package Solar_System.Button is task Button_Monitor; end Solar_System.Button;
libsrc/_DEVELOPMENT/sound/bit/z80/asm_bit_fx/_bitfx_14.asm
meesokim/z88dk
0
166145
<reponame>meesokim/z88dk SECTION smc_sound_bit PUBLIC _bitfx_14 INCLUDE "clib_target_cfg.asm" EXTERN asm_bit_open _bitfx_14: ; Squoink ld a,230 ld (qi_FR_1 + 1),a xor a ld (qi_FR_2 + 1),a call asm_bit_open ld b,200 qi_loop: dec h jr nz, qi_jump push af ld a,(qi_FR_1 + 1) dec a ld (qi_FR_1 + 1),a pop af xor __sound_bit_toggle INCLUDE "sound/bit/z80/output_bit_device_2.inc" qi_FR_1: ld h,50 qi_jump: inc l jr nz, qi_loop push af ld a,(qi_FR_2 + 1) inc a ld (qi_FR_2 + 1),a pop af xor __sound_bit_toggle INCLUDE "sound/bit/z80/output_bit_device_2.inc" qi_FR_2: ld l,0 djnz qi_loop ret
src/core/util-executors.adb
RREE/ada-util
60
9487
<reponame>RREE/ada-util<gh_stars>10-100 ----------------------------------------------------------------------- -- util-executors -- Execute work that is queued -- Copyright (C) 2019, 2020 <NAME> -- Written by <NAME> (<EMAIL>) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- package body Util.Executors is overriding procedure Initialize (Manager : in out Executor_Manager) is begin Manager.Self := Manager'Unchecked_Access; end Initialize; -- ------------------------------ -- Execute the work through the executor. -- ------------------------------ procedure Execute (Manager : in out Executor_Manager; Work : in Work_Type) is W : constant Work_Info := Work_Info '(Work => Work, Done => False); begin Manager.Queue.Enqueue (W); end Execute; -- ------------------------------ -- Start the executor tasks. -- ------------------------------ procedure Start (Manager : in out Executor_Manager; Autostop : in Boolean := False) is begin Manager.Autostop := Autostop; for Worker of Manager.Workers loop Worker.Start (Manager.Self); end loop; end Start; -- ------------------------------ -- Stop the tasks and wait for their completion. -- ------------------------------ procedure Stop (Manager : in out Executor_Manager) is W : Work_Info; begin W.Done := True; for Worker of Manager.Workers loop if not Worker'Terminated then Manager.Queue.Enqueue (W); end if; end loop; end Stop; -- ------------------------------ -- Set the work queue size. -- ------------------------------ procedure Set_Queue_Size (Manager : in out Executor_Manager; Capacity : in Positive) is begin Manager.Queue.Set_Size (Capacity); end Set_Queue_Size; -- ------------------------------ -- Wait for the pending work to be executed by the executor tasks. -- ------------------------------ procedure Wait (Manager : in out Executor_Manager) is begin Manager.Queue.Wait_Empty; end Wait; -- ------------------------------ -- Get the number of elements in the queue. -- ------------------------------ function Get_Count (Manager : in Executor_Manager) return Natural is begin return Manager.Queue.Get_Count; end Get_Count; -- ------------------------------ -- Stop and release the executor. -- ------------------------------ overriding procedure Finalize (Manager : in out Executor_Manager) is begin Manager.Stop; end Finalize; task body Worker_Task is M : access Executor_Manager; Autostop : Boolean := False; begin select accept Start (Manager : in Executor_Manager_Access) do M := Manager; end Start; or terminate; end select; while M /= null loop declare Work : Work_Info; begin if Autostop then M.Queue.Dequeue (Work, 0.0); else M.Queue.Dequeue (Work); end if; exit when Work.Done; begin Execute (Work.Work); exception when E : others => Error (Work.Work, E); end; Autostop := M.Autostop; exception when Work_Queue.Timeout => exit; end; end loop; end Worker_Task; end Util.Executors;
test/Succeed/fol-theorems/LogicalConstants.agda
asr/apia
10
12486
<gh_stars>1-10 ------------------------------------------------------------------------------ -- Testing the translation of the logical constants ------------------------------------------------------------------------------ {-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types #-} {-# OPTIONS --no-universe-polymorphism #-} {-# OPTIONS --without-K #-} module LogicalConstants where infix 5 ¬_ infixr 4 _∧_ infixr 3 _∨_ infixr 2 _⇒_ infixr 1 _↔_ _⇔_ ------------------------------------------------------------------------------ -- Propositional logic -- The logical constants -- The logical constants are hard-coded in our implementation, -- i.e. the following symbols must be used (it is possible to use Agda -- non-dependent function space → instead of ⇒). postulate ⊥ ⊤ : Set -- N.B. the name of the tautology symbol is "\top" not T. ¬_ : Set → Set -- N.B. the right hole. _∧_ _∨_ : Set → Set → Set _⇒_ _↔_ _⇔_ : Set → Set → Set -- We postulate some formulae (which are translated as 0-ary -- predicates). postulate A B C : Set -- Testing the conditional using the non-dependent function type. postulate A→A : A → A {-# ATP prove A→A #-} -- Testing the conditional using the hard-coded function type. postulate A⇒A : A ⇒ A {-# ATP prove A⇒A #-} -- The introduction and elimination rules for the propositional -- connectives are theorems. postulate →I : (A → B) → A ⇒ B →E : (A ⇒ B) → A → B ∧I : A → B → A ∧ B ∧E₁ : A ∧ B → A ∧E₂ : A ∧ B → B ∨I₁ : A → A ∨ B ∨I₂ : B → A ∨ B ∨E : (A ⇒ C) → (B ⇒ C) → A ∨ B → C ⊥E : ⊥ → A ¬E : (¬ A → ⊥) → A {-# ATP prove →I #-} {-# ATP prove →E #-} {-# ATP prove ∧I #-} {-# ATP prove ∧E₁ #-} {-# ATP prove ∧E₂ #-} {-# ATP prove ∨I₁ #-} {-# ATP prove ∨I₂ #-} {-# ATP prove ∨E #-} {-# ATP prove ⊥E #-} {-# ATP prove ¬E #-} -- Testing other logical constants. postulate thm₁ : A ∧ ⊤ → A thm₂ : A ∨ ⊥ → A thm₃ : A ↔ A thm₄ : A ⇔ A {-# ATP prove thm₁ #-} {-# ATP prove thm₂ #-} {-# ATP prove thm₃ #-} {-# ATP prove thm₄ #-} ------------------------------------------------------------------------------ -- Predicate logic --- The universe of discourse. postulate D : Set -- The propositional equality is hard-coded in our implementation, i.e. the -- following symbol must be used. postulate _≡_ : D → D → Set -- Testing propositional equality. postulate refl : ∀ {x} → x ≡ x {-# ATP prove refl #-} -- The quantifiers are hard-coded in our implementation, i.e. the -- following symbols must be used (it is possible to use Agda -- dependent function space ∀ x → A instead of ⋀). postulate ∃ : (A : D → Set) → Set ⋀ : (A : D → Set) → Set -- We postulate some formulae and propositional functions. postulate A¹ B¹ : D → Set A² : D → D → Set -- The introduction and elimination rules for the quantifiers are -- theorems. postulate ∀I₁ : ((x : D) → A¹ x) → ⋀ A¹ ∀I₂ : ((x : D) → A¹ x) → ∀ x → A¹ x ∀E₁ : (t : D) → ⋀ A¹ → A¹ t ∀E₂ : (t : D) → (∀ x → A¹ x) → A¹ t {-# ATP prove ∀I₁ #-} {-# ATP prove ∀I₂ #-} {-# ATP prove ∀E₁ #-} {-# ATP prove ∀E₂ #-} postulate ∃I : (t : D) → A¹ t → ∃ A¹ {-# ATP prove ∃I #-} postulate ∃E : ∃ A¹ → ((x : D) → A¹ x → A) → A {-# ATP prove ∃E #-}
filtros/prewitt_asm.asm
partu18/edge_detection_algorithm_SIMD
0
7201
<gh_stars>0 ; void prewitt_asm ( ; unsigned char *src, ; unsigned char *dst, ; int h, ; int w, ; int src_row_size, ; int dst_row_size ; ); section .data ultimas2WordsNO: DW 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x0000, 0x0000 ultimas2WordsSI: DW 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF, 0xFFFF ultimaWordSi: DW 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF anteUltimaWordSi: DW 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF, 0x0000 section .text global prewitt_asm prewitt_asm: ; rdi --> *src/ puntero a src ; rsi --> *dst/ dst ; edx --> h/ cantidad de filas ; ecx --> w/ columnas ; r8d --> src_row size ; r9d --> dst_row_size ;Salvar registros, armar el stack frame y alinear pila. PUSH rbp;A MOV rbp,rsp; PUSH r15;D PUSH r14;A PUSH r12;D SUB rbp, 8; A ;Limpio parte alta de los registros XOR r12,r12 MOV r12d, r8d XOR r8,r8 MOV r8, r12 MOV r12d, r9d XOR r9,r9 MOV r9, r12 MOV r12d, ecx XOR rcx,rcx MOV rcx, r12 MOVDQU xmm12, [anteUltimaWordSi] ;guardamos las máscaras MOVDQU xmm13, [ultimaWordSi] MOVDQU xmm14, [ultimas2WordsNO] MOVDQU xmm15, [ultimas2WordsSI] ;Poner 0's en la primer fila del dst MOV r15, rsi ;Guardo el puntero al destino en r11 (para usarlo de iterador ; de la primer fila) MOV r12, rcx ;Guardo en r12, la cantidad de columnas para poder ;comparar contra 0 cuando termine de iterar toda la fila ;Resumen: ; r12 ----> Cantidad de colunas a procesar ; r11 ----> puntero a la dirección de memoria próxima a escribir PXOR xmm2,xmm2 primerFila: CMP r12,0 ;Armo un loop para la primer fila JE seguirConMedio CMP r12, 16; JL redimensionarPrimFila MOVDQU [r15], xmm2 ;Escribo un 0 en la posición de memoria apuntada por el iterador ADD r15,16 ;Aumento el iterador SUB r12,16 ;Disminuyo la cantidad de columnas que me faltan recorrer JMP primerFila redimensionarPrimFila: MOV r11, 16; SUB r11, r12 SUB r15 , r11 MOV r12, 16; JMP primerFila seguirConMedio: DEC edx ;Decremento la cantidad de filas puesto que la primera ya fué escrita LEA rdi, [rdi + r8] ; Muevo los punteros de las imágenes al primero de la segunda fila LEA rsi, [rsi + r9] ; sumandole el row_size correspondiente a cada uno. ;De la forma que se va a implementar podemos procesar de a 14 pixeles a la vez,porque lo de las puntas ;no se pueden procesar ya que necesitan los píxeles de los costados. cicloPorFilas: CMP edx,1 ; Comparo a ver si la cantidad de filas que me restan por procesar es 1 (solo resta la ùltima). JE parteFinal MOV r14, rdi ; Creo el iterador de la fila actual de la imagen src MOV r15, rsi ; Creo el iterador de la fila actual de la imagen dst MOV r12, rcx ; Pongo en r12d la cantidad de columnas que voy a procesar MOV BYTE [r15],0 ; Escribo que en el borde izquierdo halla un 0. INC r15; cicloPorColumnas: CMP r12, 16 ; Si es menor a la 16 hay que redimensionar JL redimensionar MOV r10, r14 SUB r10, r8 MOVDQU xmm0, [r10] ;Levanto los 16 bytes de arriba (U15,U14,U13..U0) MOVDQU xmm1, [r14] ;Levanto los 16 bytes del medio (M15,M14,M13..M0) MOVDQU xmm2, [r14 + r8] ;Levanto los 16 bytes de abajo (D15,D14,D13..D0) MOVDQU xmm3, xmm0 ; MOVDQU xmm4, xmm1 ; MOVDQU xmm5, xmm2 ; PXOR xmm8,xmm8 ; Lo limpio para poder extender con 0's PUNPCKLBW xmm0, xmm8 ; xmm0 = [U15|U14|U13|U12|U11|U10|U9|U8] PUNPCKHBW xmm3, xmm8 ; xmm3 = [U7|U6|U5|U4|U3|U2|U1|U0] PUNPCKLBW xmm1, xmm8 ; xmm1 = [M15|M14|M13|M12|M11|M10|M9|M8] PUNPCKHBW xmm4, xmm8 ; xmm4 = [M7|M6|M5|M4|M3|M2|M1|M0] PUNPCKLBW xmm2, xmm8 ; xmm2 = [D15|D14|D13|D12|D11|D10|D9|D8] PUNPCKHBW xmm5, xmm8 ; xmm5 = [D7|D6|D5|D4|D3|D2|D1|D0] ;************************************************************************************************************************************************************************************************************************ ;************************************************************************************************************************************************************************************************************************ ;******************************************************************************************* Calcular GX **************************************************************************************************************** ;************************************************************************************************************************************************************************************************************************ ;************************************************************************************************************************************************************************************************************************ ; Matriz de convolución: ; -1 0 1 ---> U ; -1 0 1 ---> M ; -1 0 1 ---> D ; En xmm0 están los píxeles de arriba ---> [U15|U14|U13|U12|U11|U10|U9|U8|U7|U6|U5|U4|U3|U2|U1|U0] ; En xmm1 están los píxeles de del medio ---> [M15|M14|M13|M12|M11|M10|M9|M8|M7|M6|M5|M4|M3|M2|M1|M0] ; En xmm2 están los píxeles de abajo ---> [D15|D14|D13|D12|D11|D10|D9|D8|D7|U6|D5|U4|U3|U2|D1|D0] ; Si hacemos que : -(xmm0+xmm1+xmm2) + 2<<(xmm0+xmm1+xmm2) ; Entonces, se cumple que en la parte alta del registro queda : ; [GX(M14)|GX(M13)|GX(M12)|GX(M11)|GX(M10)|GX(M9)|Basura|Basura] ; donde GX(M{n}) = -(U{n+}1 + M{n+}1 + D{n+1}) + U{n-1} + M{n-1} + D{n-1} (n es la posición dentro del registro del pixel a procesar) ; Busco que xmm7 = (xmm0+xmm1+xmm2) MOVDQU xmm7, xmm0 ; xmm7 = [U15|U14|U13|U12|U11|U10|U9|U8] PADDW xmm7,xmm1 ; xmm7 = [U15 + 2*M15 | .. | U8 + 2*M8] PADDW xmm7,xmm2 ; xmm7 = [U15 + 2*M15 + D15 | ..| U8 + 2*M8 + D8] MOVDQU xmm9, xmm7 ; Para calcular GX(8) y GX(7) PSUBW xmm8,xmm7 ; xmm8 = -xmm7 = -(xmm0+xmm1+xmm2) ; xmm8 = [-(U15 + 2*M15 + D15) | ..| -(U8 + 2*M8 + D8)] PSRLDQ xmm7,4 ; xmm7 = [U13 + 2*M13 + D13 | ..| Basura|Basura] PADDW xmm8,xmm7 ; xmm8 = [-(U15 + 2*M15 + D15) + U13 + 2*M13 + D13 | ..| Basura|Basura] ; xmm8 = [GX(M14)|GX(M13)|GX(M12)|GX(M11)|GX(M10)|GX(M9)|Basura|Basura] ; Si hacemos que : -(xmm3+xmm4+xmm5) + 2<<(xmm3+2*xmm4+xmm5 ) ; Entonces, se cumple que en la parte alta del registro queda : ; [GX(M6)|GX(M5)|GX(M4)|GX(M3)|GX(M2)|GX(M1)|Basura|Basura] ; donde GX(M{n}) = -(U{n+}1 + M{n+}1 + D{n+1}) + U{n-1} + M{n-1} + D{n-1} (n es la posición dentro del registro del pixel a procesar) ; quiero que xmm10 = (xmm3+xmm4+xmm5) MOVDQU xmm10, xmm3 ; xmm10 = [U7|U6|U5|U4|U3|U2|U1|U0] PADDW xmm10,xmm4 ; xmm10 = [U7 + 2*M7 |...|U0 + 2*M0] PADDW xmm10,xmm5 ; xmm10 = [U7 + 2*M7 + D7|...|U0 + 2*M0 + D0] MOVDQU xmm7, xmm10 ; Para calcular GX(8) y GX(7) PXOR xmm11,xmm11 ; PSUBW xmm11,xmm10 ; xmm11 = -xmm10 = -(xmm3+xmm4+xmm5) ; xmm11 = [-(U7 + 2*M7 + D7)|...|-(U0 + 2*M0 + D0)] PSRLDQ xmm10,4 ; xmm10 = [U5 + 2*M5 + D5|..|Basura|Basura] PADDW xmm11,xmm10 ; xmm11 = [-(U7 + 2*M7 + D7) + U5 + 2*M5 + D5|..|Basura|Basura] ; xmm11 = [GX(M6)|GX(M5)|GX(M4)|GX(M3)|GX(M2)|GX(M1)|Basura|Basura] ; Ya sabiamos que M15, y M0 no los ibamos a poder procesar ya que se necesitan sus vecinos y no los tenemos. Por ende solo procesamos los 14 píxeles del medio. Como tuvimos que hacer unpack, ; nos quedaron en el medio M7 y M8 que sí se pueden hacer. Para eso hay que hacer unos corrimientos, porque al separar un solo registro que tenía 2 extremos (M15 y M0) en dos, ; ahora se nos suman dos nuevos extremos. ;xmm9 = [U15 + 2*M15 + D15 | ..| U8 + 2*M8 + D8] ;xmm7 = [U7 + 2*M7 + D7|...|U0 + 2*M0 + D0] ; Necesitamos obtener en la parte baja de algun registro : ; [Basura|Basura|...|GX(M8)|GX(M7)] osea: ; [M|M|...|U7 + 2*M7 + D7 - (U9 + 2*M9 + D9)|U6 + 2*M6 + D6 - (U8 + 2*M8 + D8)] PSLLDQ xmm7, 12 ;xmm7 = [Basura|...|U7 + 2*M7 + D7|U6 + 2*M6 + D6] PSUBW xmm7,xmm9 ;xmm7 = [Basura|Basura|..|F(M8)|F(M7)] ;Resumen: ; xmm8 = [GX(M14)|GX(M13)|GX(M12)|GX(M11)|GX(M10)|GX(M9)|Basura|Basura] ; xmm11 = [GX(M6)|GX(M5)|GX(M4)|GX(M3)|GX(M2)|GX(M1)|Basura|Basura] ; xmm7 = [Basura|Basura|..|GX(M8)|GX(M7)] ;Ahora unimos todo: PAND xmm8,xmm14 ; xmm8 = [GX(M14)|GX(M13)|GX(M12)|GX(M11)|GX(M10)|GX(M9)|0|0] PAND xmm7,xmm15 ; xmm7 =[0|0|..|GX(M8)|GX(M7)] PADDW xmm8,xmm7 ; xmm8 = [GX(M14)|GX(M13)|GX(M12)|GX(M11)|GX(M10)|GX(M9)|GX(M8)|GX(M7)] ;---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ; Ya calculamos GX : ; xmm8 = [GX(M14)|GX(M13)|GX(M12)|GX(M11)|GX(M10)|GX(M9)|GX(M8)|GX(M7)] ; xmm11 = [GX(M6)|GX(M5)|GX(M4)|GX(M3)|GX(M2)|GX(M1)|Basura|Basura] ;---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ;************************************************************************************************************************************************************************************************************************ ;************************************************************************************************************************************************************************************************************************ ;******************************************************************************************* Calcular GX **************************************************************************************************************** ;************************************************************************************************************************************************************************************************************************ ;************************************************************************************************************************************************************************************************************************ ; Matriz de convolución: ; 1 1 1 ---> U ; 0 0 0 ---> M ; -1 -1 -1 ---> D MOVDQU xmm1, xmm3 MOVDQU xmm4, xmm2 ;Resumen: ; xmm0 = [U15|U14|U13|U12|U11|U10|U9|U8] ; xmm1 = [U7|U6|U5|U4|U3|U2|U1|U0] ; xmm2 = [M15|M14|M13|M12|M11|M10|M9|M8] /n uso ; xmm3 = [M7|M6|M5|M4|M3|M2|M1|M0 /nl uso] ; xmm4 = [D15|D14|D13|D12|D11|D10|D9|D8] ; xmm5 = [D7|D6|D5|D4|D3|D2|D1|D0] ; xmm8 = [GX(M14)|GX(M13)|GX(M12)|GX(M11)|GX(M10)|GX(M9)|GX(M8)|GX(M7)] ; xmm11 = [GX(M6)|GX(M5)|GX(M4)|GX(M3)|GX(M2)|GX(M1)|Basura|Basura] ; GY(Mn) = Un+1 + Un + Un-1 - (Dn+1 + Dn + Dn-1) ; xmm2 y xmm3 no me interesan porque no trabajo con M. Ya que está en la matriz de convolución aparece toda en 0 esa fila ;Cálculo de la parte LOW de los registros sometidos al pack. ;Acomodamos los píxeles de arriba (U) MOVDQU xmm2, xmm0 ; xmm2 = [U15|U14|U13|U12|U11|U10|U9|U8] MOVDQU xmm6, xmm0 ; para calcular GY(8) y GY(7) PSRLDQ xmm2, 2 ; xmm2 = [U14|U13|U12|U11|U10|U9|U8|0] MOVDQU xmm3, xmm0 ; xmm3 = [U15|U14|U13|U12|U11|U10|U9|U8] PSRLDQ xmm3, 4 ; xmm3 = [U13|U12|U11|U10|U9|U8|0|0] PADDW xmm0, xmm2 ; xmm0 = [U15 + U14 | ..| U10 + U9 | U9 + 2*U8 | 0] MOVDQU xmm10, xmm0 ; para calcular GY(8) y GY(7) PADDW xmm0, xmm3 ; xmm0 = [U15 + U14 + U13 | .. | U10 + U9 + U8| Basura | Basura] ;Acomodamos los píxeles de abajo (D) MOVDQU xmm2, xmm4 ; xmm2 = [D15|D14|D13|D12|D11|D10|D9|D8] MOVDQU xmm7, xmm2 ; para calcular GY(8) y GY(7) PSRLDQ xmm2, 2 ; xmm2 = [D14|D13|D12|D11|D10|D9|D8|0] MOVDQU xmm3, xmm4 ; xmm3 = [D15|D14|D13|D12|D11|D10|D9|D8] PSRLDQ xmm3, 4 ; xmm3 = [D13|D12|D11|D10|D9|D8|0|0] PADDW xmm4, xmm2 ; xmm4 = [D15 + D14 | ..| D10 + D9 | D9 + 2*D8 | D8] PSUBW xmm10,xmm4 ; xmm10 = [U15 + 2*U14 - (D15 + 2*D14) | ..| U9 + 2*U8 - (D9 + 2*D8) | D8] PADDW xmm4, xmm3 ; xmm4 = [D15 + D14 + D13 | .. | D10 + D9 + 2*D8| Basura | D8] ; Unimos la parte low completa: PSUBW xmm0,xmm4 ; xmm0 = [U15 + 2*U14 + U13 - (D15 + 2*D14 + D13) | .. | U10 + 2*U9 + 2*U8 - (D10 + 2*D9 + 2*D8)| 0 | 0] ; xmm0 = [GY(M14)|GY(M13)|GY(M12)|GY(M11)|GY(M10)|GY(M9)|Basura|Basura] ;Cálculo de la parte LOW de los registros sometidos al pack. ;Acomodamos los píxeles de arriba (U) MOVDQU xmm2, xmm1 ; xmm2 = [U7|U6|U5|U4|U3|U2|U1|U0] MOVDQU xmm9, xmm2 ; para calcular GY(8) y GY(7) PSRLDQ xmm2, 2 ; xmm2 = [U6|U5|U4|U3|U2|U1|U0|0] MOVDQU xmm3, xmm1 ; xmm3 = [U7|U6|U5|U4|U3|U2|U1|U0] PSRLDQ xmm3, 4 ; xmm3 = [U5|U4|U3|U2|U1|U0|0|0] PADDW xmm1, xmm2 ; xmm1 = [Un7+U6|..|U2+U1|Basura|Basura] PADDW xmm1, xmm3 ; xmm1 = [U7+ U6 + U5|..|U2 + U1 + U0|Basura|Basura] ;Acomodamos los píxeles de abajo (D) MOVDQU xmm2, xmm5 ; xmm2 = [D7|D6|D5|D4|D3|D2|D1|D0] MOVDQU xmm4, xmm2 ; para calcular GY(8) y GY(7) PSRLDQ xmm2, 2 ; xmm2 = [D6|D5|D4|D3|D2|D1|D0|0] MOVDQU xmm3, xmm5 ; xmm3 = [D7|D6|D5|D4|D3|D2|D1|D0] PSRLDQ xmm3, 4 ; xmm3 = [D5|D4|D3|D2|D1|D0|Basura|Basura] PADDW xmm5, xmm2 ; xmm5 = [D7 + D6 |..|D2 + D1|Basura|Basura] PADDW xmm5, xmm3 ; xmm5 = [D7 + D6 + D5 |..|D2 + D1 + D0|Basura|Basura] ;Unimos la parte high completa: PSUBW xmm1,xmm5 ; xmm1 = [D7 + D6 + D5 - (U7+ U6 + U5) |..|D2 + D1 + D0 - (U2 + U1 + U0)|Basura|Basura] ; xmm1 = [GY(M6)|GY(M5)|GY(M4)|GY(M3)|GY(M2)|GY(M1)||Basura|Basura] ;---------------------------------------------------------------------------------------------------------------- ;// ;RESUMEN ;// ;xmm0 = [GY(M14)|GY(M13)|GY(M12)|GY(M11)|GY(M10)|GY(M9)|Basura|Basura] ;// ;xmm1 = [GY(M6)|GY(M5)|GY(M4)|GY(M3)|GY(M2)|GY(M1)|Basura|Basura] ;// ; ;// ;xmm4 = [D7|D6|D5|D4|D3|D2|D1|D0] ;// ;xmm6 = [U15|U14|U13|U12|U11|U10|U9|U8] ;// ;xmm7 = [D15|D14|D13|D12|D11|D10|D9|D8] ;// ;xmm9 = [U7|U6|U5|U4|U3|U2|U1|U0] ;// ;xmm10 = [U15 + U14 - (D15 + D14) | ..| U9 + U8 - (D9 + D8) | D8] ;---------------------------------------------------------------------------------------------------------------- ;Faltan obtener GY(8) y GY(7) igual que como pasó en GX(8) Y GX(7) ;GY(8) = U9 + U8 + U7 - (D9 + D8 + D7) ;GY(7) = U8 + U7 + U6 - (D8 + D7 + D6) ;Cálculo para obtener GY(8) PSLLDQ xmm9, 12 ; xmm9 = [0|..|0|U7|U6] PSLLDQ xmm4, 12 ; xmm4 = [0|..|0|D7|D6] PADDW xmm10, xmm9 ; xmm10 = [Basura| ..|U9 + U8 + U7 - (D9 + D8)| D8+D6] PSUBW xmm10, xmm4 ; xmm10 = [Basura| ..|U9 + U8 + U7 - (D9 + D8 + D7)| Basura] ;xmm10 = [Basura|..|GY(8)|Basura] ;Cálculo para obtener GY(8) ;Acomodamos los píxeles de arriba (U) MOVDQU xmm5,xmm9 ; xmm5 = [0|..|0|U7|U6] PSLLDQ xmm9,2 ; xmm9 = [Basura|..|U7] PADDW xmm9,xmm5 ; xmm9 = [Basura|..|U7 + U6 ] PADDW xmm9,xmm6 ; xmm9 = [Basura|..|U7 + U6 + U8] ;Acomodamos los píxeles de abajo (D) MOVDQU xmm5, xmm4 ; xmm5 = [0|..|0|D7|D6] PSLLDQ xmm4,2 ; xmm4 = [Basura|..|D7] PADDW xmm4,xmm5 ; xmm4 = [Basura|..|D7 + D6 ] PADDW xmm4,xmm7 ; xmm4 = [Basura|..|D7 + D6 + D8] PSUBW xmm9,xmm4 ; xmm9 = [Basura|..|U7 + U6 + U8 - (D7 + D6 + D8)] ;xmm9 = [Basura|..|GY(7)] ;---------------------------------------------------------------------------------------------------------------- ;// ;Resumen: ;// ; xmm0 = [GY(M14)|GY(M13)|GY(M12)|GY(M11)|GY(M10)|GY(M9)|Basura|Basura] ;// ; xmm1 = [GY(M6)|GY(M5)|GY(M4)|GY(M3)|GY(M2)|GY(M1)|Basura|Basura] ;// ; xmm10 = [Basura|..|GY(8)|Basura] ;// ; xmm9 = [Basura|..|GY(7)] ;---------------------------------------------------------------------------------------------------------------- ;Unimos los GY PAND xmm10, xmm12 ; Deja pasar sólo la anteúltima word PAND xmm9, xmm13 ; Deja pasar sólo la última word PAND xmm0, xmm14 ; Deja pasar todo menos las últimas 2 words PADDW xmm0, xmm10; xmm0 = [GY(M14)|GY(M13)|GY(M12)|GY(M11)|GY(M10)|GY(M9)|GY(8)|Basura] PADDW xmm0, xmm9; xmm0 = [GY(M14)|GY(M13)|GY(M12)|GY(M11)|GY(M10)|GY(M9)|GY(8)|GY(7)] ;************************************************************************************************************************************************************************************************************************ ;************************************************************************************************************************************************************************************************************************ ;******************************************************************************************* Parte Final **************************************************************************************************************** ;************************************************************************************************************************************************************************************************************************ ;************************************************************************************************************************************************************************************************************************ ;---------------------------------------------------------------------------------------------------------------- ;// ;Resumen ;// ; xmm0 = [GY(M14)|GY(M13)|GY(M12)|GY(M11)|GY(M10)|GY(M9)|GY(8)|GY(7)] ;// ; xmm1 = [GY(M6)|GY(M5)|GY(M4)|GY(M3)|GY(M2)|GY(M1)|Basura|Basura] ;// ; xmm8 = [GX(M14)|GX(M13)|GX(M12)|GX(M11)|GX(M10)|GX(M9)|GX(M8)|GX(M7)] ;// ; xmm11 = [GX(M6)|GX(M5)|GX(M4)|GX(M3)|GX(M2)|GX(M1)|Basura|Basura] ;---------------------------------------------------------------------------------------------------------------- ;Debemos hacer: √(GY(Mi)² + GX(Mi)²), para cada i = 1 .. 14 (14 píxeles centrales) ;Tomamos módulo PABSW xmm1,xmm1 PABSW xmm0,xmm0 PABSW xmm8,xmm8 PABSW xmm11,xmm11 MOVDQU xmm2, xmm0 MOVDQU xmm3,xmm1 MOVDQU xmm7,xmm8 MOVDQU xmm10,xmm11 PXOR xmm5,xmm5 ;Extendemos a double words PUNPCKHWD xmm0, xmm5 ; xmm0 = [GY(M10)|GY(M9)|GY(8)|GY(7)] PUNPCKHWD xmm1, xmm5 ; xmm1 = [GY(M2)|GY(M1)|Basura|Basura] PUNPCKHWD xmm8, xmm5 ; xmm8 = [GX(M10)|GX(M9)|GX(M8)|GX(M7)] PUNPCKHWD xmm11, xmm5 ; xmm11 = [GX(M2)|GX(M1)|Basura|Basura] PUNPCKLWD xmm2, xmm5 ; xmm2 = [GY(M14)|GY(M13)|GY(M12)|GY(M11)] PUNPCKLWD xmm3, xmm5 ; xmm3 = [GY(M6)|GY(M5)|GY(M4)|GY(M3)] PUNPCKLWD xmm7, xmm5 ; xmm7 = [GX(M14)|GX(M13)|GX(M12)|GX(M11)] PUNPCKLWD xmm10, xmm5 ; xmm10 = [GX(M6)|GX(M5)|GX(M4)|GX(M3)] ;Convertimos a punto flotante de precisión simple CVTDQ2PS xmm0,xmm0 ; xmm0 = [GY(M10)|GY(M9)|GY(8)|GY(7)] CVTDQ2PS xmm1,xmm1 ; xmm1 = [GY(M2)|GY(M1)|Basura|Basura] CVTDQ2PS xmm2,xmm2 ; xmm2 = [GY(M14)|GY(M13)|GY(M12)|GY(M11)] CVTDQ2PS xmm3,xmm3 ; xmm3 = [GY(M6)|GY(M5)|GY(M4)|GY(M3)] CVTDQ2PS xmm7,xmm7 ; xmm7 = [GX(M14)|GX(M13)|GX(M12)|GX(M11)] CVTDQ2PS xmm8,xmm8 ; xmm8 = [GX(M10)|GX(M9)|GX(M8)|GX(M7)] CVTDQ2PS xmm10,xmm10 ; xmm10 = [GX(M6)|GX(M5)|GX(M4)|GX(M3)] CVTDQ2PS xmm11,xmm11 ; xmm11 = [GX(M2)|GX(M1)|Basura|Basura] ;Elevamos cada término al cuadrdado (GY(Mi)² / GX(Mi)²) MULPS xmm0,xmm0 ; xmm0 = [GY(M10)²|GY(M9)²|GY(M8)²|GY(M7)²] MULPS xmm1,xmm1 ; xmm1 = [GY(M2)²|GY(M1)²|Basura|Basura] MULPS xmm2,xmm2 ; xmm2 = [GY(M14)²|GY(M13)²|GY(M12)²|GY(M11)²] MULPS xmm3,xmm3 ; xmm3 = [GY(M6)²|GY(M5)²|GY(M4)²|GY(M3)²] MULPS xmm7,xmm7 ; xmm7 = [GX(M14)²|GX(M13)²|GX(M12)²|GX(M11)²] MULPS xmm8,xmm8 ; xmm8 = [GX(M10)²|GX(M9)²|GX(M8)²|GX(M7)²] MULPS xmm10,xmm10 ; xmm10 = [GX(M6)²|GX(M5)²|GX(M4)²|GX(M3)²] MULPS xmm11,xmm11 ; xmm11 = [GX(M2)²|GX(M1)²|Basura|Basura] ;Hacemos la suma de GX + GY con respecto al i (GY(Mi)² + GX(Mi)²) ADDPS xmm2, xmm7 ; xmm2 = [GY(M14)² + GX(M14)²|...|GY(M11)² + GX(M11)²] ADDPS xmm0, xmm8 ; xmm0 = [GY(M10)² + GX(M10)²|...|GY(M7)² + GX(M7)² ] ADDPS xmm3, xmm10 ; xmm3 = [GY(M6)² + GX(M6)²|...|GY(M3)² + GX(M3)²] ADDPS xmm1, xmm11 ; xmm1 = [GY(M2)² + GX(M2)²|GY(M1)² + GX(M1)²|Basura|Basura] ;Aplico Raíz SQRTPS xmm2,xmm2 ; xmm2 = [√(GY(M14)² + GX(M14)²)|...|√(GY(M11)² + GX(M11)²)] SQRTPS xmm0,xmm0 ; xmm0 = [√(GY(M10)² + GX(M10)²)|...|√(GY(M7)² + GX(M7)²) ] SQRTPS xmm3,xmm3 ; xmm3 = [√(GY(M6)² + GX(M6)²)|...|√(GY(M3)² + GX(M3)²)] SQRTPS xmm1,xmm1 ; xmm1 = [√(GY(M2)² + GX(M2)²)|√(GY(M1)² + GX(M1)²)|Basura|Basura] ;Volvemos a enteros (Double words) CVTPS2DQ xmm2,xmm2 ; xmm2 = [√(GY(M14)² + GX(M14)²)|...|√(GY(M11)² + GX(M11)²)] CVTPS2DQ xmm0,xmm0 ; xmm0 = [√(GY(M10)² + GX(M10)²)|...|√(GY(M7)² + GX(M7)²) ] CVTPS2DQ xmm3,xmm3 ; xmm3 = [√(GY(M6)² + GX(M6)²)|...|√(GY(M3)² + GX(M3)²)] CVTPS2DQ xmm1,xmm1 ; xmm1 = [√(GY(M2)² + GX(M2)²)|√(GY(M1)² + GX(M1)²)|Basura|Basura] ;Volvemos a words PACKUSDW xmm2,xmm0 ; xmm2 = [Prewitt(M14)|...|Prewitt(M11)|Prewitt(M10)|...|Prewitt(M7) ] PACKUSDW xmm3, xmm1 ; xmm3 = [Prewitt(M6)|...|Prewitt(M3)|Prewitt(M2)|Prewitt(M1)|Basura|Basura] ;Volvemos a bytes PACKUSWB xmm2,xmm3 ; xmm2 = [Prewitt(M14)| .. |Prewitt(M1)|Basura|Basura] ;Escritura en memoria CMP r12,16 ; Me fijo si es la última escritura de la fila o no. JE ultimaEscritura MOVDQU [r15], xmm2 ; Si no es la última escritura, entonces escribo los 16 bytes. ADD r14, 14 ; Aumento 14 ya que es la cantidad de píxeles que procesamos a la vez. ADD r15, 14 SUB r12,14 ; Resto las 14 columnas ya procesadas. JMP cicloPorColumnas ultimaEscritura: MOVQ [r15], xmm2 ; Escribe los primeros 8 bytes en memoria. PSRLDQ xmm2, 8 MOVD [r15+8], xmm2 ; Escribe los siguientes 4 bytes en memoria. PSRLDQ xmm2, 4 MOVD eax, xmm2 ; Pone en eax (4bytes) los últimos 4 bytes de xmm2 . MOV WORD [r15+12], ax ; Escribe los siguientes 2 bytes en memoria. SHR eax, 8 MOV BYTE [r15+14], 0 ; Escribe en memoria el último byte. JMP cambiarDeFila redimensionar: MOV r11, 16 ; Hago esto para retroceder (16-r12d) para atrás que es lo que necesito que retrocedan los iteradores para poder hacer la última escritura. SUB r11, r12 SUB r14, r11 SUB r15, r11 MOV r12, 16 JMP cicloPorColumnas cambiarDeFila: LEA rdi, [rdi + r8] ; Muevo los punteros de las imágenes al primero de la segunda fila sumandole el row_size correspondiente a cada uno. LEA rsi, [rsi + r9] DEC edx ; Decremento una fila JMP cicloPorFilas ;Opero con la última fila parteFinal: MOV r15, rsi ;Guardo el puntero al destino en r11 (para usarlo de iterador de la última fila). MOV r12, rcx ;Guardo en r12, la cantidad de columnas para poder comparar contra 0 cuando termine de iterar toda la fila. XOR r11,r11 PXOR xmm2,xmm2 ultimaFila: CMP r12,0 JE salir CMP r12,16 ;Armo un loop para la última fila. JL redimensionUltFila MOVDQU [r15], xmm2 ;Escribo un 0 en la posición de memoria apuntada por el iterador. ADD r15,16 SUB r12,16 ;Disminuyo la cantidad de columnas que me faltan recorrer. JMP ultimaFila redimensionUltFila: MOV r11,16; SUB r11, r12; SUB r15, r11; MOV r12, 16 JMP ultimaFila salir: ADD rbp,8; POP r12 POP r14 POP r15 POP rbp RET
pixy/src/host/pantilt_in_ada/specs/xlocale_h.ads
GambuzX/Pixy-SIW
1
2929
<filename>pixy/src/host/pantilt_in_ada/specs/xlocale_h.ads -- -- Copyright (c) 2015, <NAME> <<EMAIL>> -- -- Permission to use, copy, modify, and/or distribute this software for any -- purpose with or without fee is hereby granted, provided that the above copyright -- notice and this permission notice appear in all copies. -- -- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD -- TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN -- NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR -- CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR -- PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, -- ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -- pragma Ada_2005; pragma Style_Checks (Off); with Interfaces.C; use Interfaces.C; with System; with Interfaces.C.Strings; package xlocale_h is type uu_locale_struct_uu_locales_array is array (0 .. 12) of System.Address; type uu_locale_struct_uu_names_array is array (0 .. 12) of Interfaces.C.Strings.chars_ptr; type uu_locale_struct is record uu_locales : aliased uu_locale_struct_uu_locales_array; -- /usr/include/xlocale.h:30 uu_ctype_b : access unsigned_short; -- /usr/include/xlocale.h:33 uu_ctype_tolower : access int; -- /usr/include/xlocale.h:34 uu_ctype_toupper : access int; -- /usr/include/xlocale.h:35 uu_names : aliased uu_locale_struct_uu_names_array; -- /usr/include/xlocale.h:38 end record; pragma Convention (C_Pass_By_Copy, uu_locale_struct); -- /usr/include/xlocale.h:27 -- skipped empty struct uu_locale_data type uu_locale_t is access all uu_locale_struct; -- /usr/include/xlocale.h:39 subtype locale_t is uu_locale_t; -- /usr/include/xlocale.h:42 end xlocale_h;
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_378_1622.asm
ljhsiun2/medusa
9
85545
<reponame>ljhsiun2/medusa .global s_prepare_buffers s_prepare_buffers: push %r11 push %r13 push %rbp push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_A_ht+0x11209, %rsi add $11401, %r13 mov $0x6162636465666768, %rbx movq %rbx, %xmm0 vmovups %ymm0, (%rsi) cmp $28240, %rbp lea addresses_UC_ht+0xc00, %r11 nop nop nop nop nop and $37660, %rdi mov (%r11), %rbp nop nop sub %rsi, %rsi lea addresses_D_ht+0x17b20, %rsi nop nop nop nop nop dec %rdx movups (%rsi), %xmm1 vpextrq $1, %xmm1, %r11 nop and $47259, %r11 lea addresses_UC_ht+0x14708, %rsi lea addresses_D_ht+0x18800, %rdi nop nop dec %rbx mov $103, %rcx rep movsw nop xor $21221, %rsi lea addresses_UC_ht+0xb8a0, %rbp nop sub $55997, %rdi mov (%rbp), %r11w nop nop nop nop sub $63829, %rbp lea addresses_D_ht+0xa188, %rbx nop sub %r13, %r13 movw $0x6162, (%rbx) nop nop nop cmp $10723, %rsi lea addresses_normal_ht+0x16e18, %r13 nop lfence mov (%r13), %di add $31773, %rsi lea addresses_D_ht+0x19e00, %rsi lea addresses_normal_ht+0xb500, %rdi nop nop add %r11, %r11 mov $111, %rcx rep movsb nop nop nop cmp $48284, %r13 lea addresses_D_ht+0x16f60, %rsi lea addresses_normal_ht+0x121c0, %rdi nop nop nop xor $954, %rbx mov $109, %rcx rep movsw sub %rdi, %rdi lea addresses_WT_ht+0x19100, %rdx sub %rbp, %rbp mov (%rdx), %r11d nop nop nop nop nop add %r13, %r13 lea addresses_WC_ht+0x12e00, %rcx nop nop dec %rsi movb (%rcx), %bl nop nop nop cmp %r11, %r11 lea addresses_UC_ht+0x6900, %r13 nop nop nop nop cmp $40673, %rsi mov (%r13), %rdi nop nop nop nop nop add $1442, %rbp lea addresses_UC_ht+0xaf00, %rbx nop xor $17137, %r11 movb (%rbx), %cl nop nop nop add $44966, %r11 lea addresses_WC_ht+0xd9e0, %rdi clflush (%rdi) and %rcx, %rcx mov $0x6162636465666768, %rsi movq %rsi, (%rdi) nop nop nop nop dec %r13 pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %rbp pop %r13 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r15 push %rbx push %rcx push %rdi push %rdx // Store mov $0x417f160000000600, %r12 nop nop nop cmp %rdx, %rdx mov $0x5152535455565758, %rbx movq %rbx, (%r12) add %r10, %r10 // Store lea addresses_A+0x5e78, %rbx clflush (%rbx) nop xor %rdi, %rdi movl $0x51525354, (%rbx) sub $2169, %rdi // Store lea addresses_D+0x5658, %rcx nop nop cmp %r15, %r15 movb $0x51, (%rcx) nop sub $54479, %rdx // Faulty Load lea addresses_PSE+0x3900, %r12 clflush (%r12) sub %rcx, %rcx movups (%r12), %xmm7 vpextrq $1, %xmm7, %rdx lea oracles, %r15 and $0xff, %rdx shlq $12, %rdx mov (%r15,%rdx,1), %rdx pop %rdx pop %rdi pop %rcx pop %rbx pop %r15 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_PSE', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_NC', 'size': 8, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_A', 'size': 4, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_D', 'size': 1, 'AVXalign': False}} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_PSE', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False}} {'src': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_D_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}} {'src': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_UC_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_D_ht', 'size': 2, 'AVXalign': False}} {'src': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_D_ht', 'congruent': 8, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': False}} {'src': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': True}} {'src': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 9, 'NT': True, 'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': False}} {'33': 378} 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 */
make_puzzle3.als
nishio/learning_alloy
1
4758
<filename>make_puzzle3.als enum Person {A, B, C, D, E} enum Bool {T, F} enum BoolBool {TT, TF, FT, FF} abstract sig Constrain{} sig is_liar extends Constrain { by: one Person, who: one Person }{ by not in who } sig is_coward extends Constrain { by: one Person, who: one Person }{ by not in who } pred satisfy(cs: Constrain, a, b, c, d, e: BoolBool){ let bb = (A -> a) + (B -> b) + (C -> c) + (D -> d) + (E -> e), b0 = bb.(TT -> T + TF -> T + FT -> F + FF -> F), b1 = bb.(TT -> T + TF -> F + FT -> T + FF -> F) { // b0: Person -> Bool // 正直 // b1: Person -> Bool // 小心 // 嘘つきの人数を指定 #{b0.F} = 2 // 小心者の人数を指定 #{b1.T} = 2 // すべての嘘つき発言について、発言者が正直なら充足される all c: cs & is_liar{ (c.by.b0 = T) => (c.who.b0 = F) } // すべての小心者発言について、発言者が正直なら充足される all c: cs & is_coward{ (c.by.b0 = T) => (c.who.b1 = T) } // すべての小心な嘘つきについて all p: b0.F & b1.T { // 一つしか嘘をつかない: plus[ #{c: (is_coward <: by).p | c.who.b1 = F}, #{c: (is_liar <: by).p | c.who.b0 = T} ] = 1 } } } run { let answers = { a, b, c, d, e: BoolBool | satisfy[Constrain, a, b, c, d, e]} { one answers all x: Constrain { not one { a, b, c, d, e: BoolBool | satisfy[Constrain - x, a, b, c, d, e] } } } } for exactly 7 Constrain
src/gen-commands.adb
Letractively/ada-gen
0
11221
<filename>src/gen-commands.adb ----------------------------------------------------------------------- -- gen-commands -- Commands for dynamo -- Copyright (C) 2011, 2012 <NAME> -- Written by <NAME> (<EMAIL>) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Text_IO; with Ada.Command_Line; with GNAT.Command_Line; with Gen.Configs; with Gen.Commands.Generate; with Gen.Commands.Project; with Gen.Commands.Page; with Gen.Commands.Layout; with Gen.Commands.Model; with Gen.Commands.Propset; with Gen.Commands.Database; with Gen.Commands.Info; with Gen.Commands.Distrib; with Gen.Commands.Plugins; with Gen.Commands.Docs; with Util.Log.Loggers; package body Gen.Commands is use Ada.Strings.Unbounded; use Util.Log; Log : constant Loggers.Logger := Loggers.Create ("Gen.Commands"); Commands : Command_Maps.Map; -- ------------------------------ -- Write the command usage. -- ------------------------------ procedure Usage (Cmd : in Command) is begin null; end Usage; -- ------------------------------ -- Print a message on the standard output. -- ------------------------------ procedure Print (Cmd : in Command; Message : in String) is pragma Unreferenced (Cmd); begin Ada.Text_IO.Put_Line (Message); end Print; -- ------------------------------ -- Print dynamo usage -- ------------------------------ procedure Usage is use Ada.Text_IO; begin Put_Line (Gen.Configs.RELEASE); New_Line; Put ("Usage: "); Put (Ada.Command_Line.Command_Name); Put_Line (" [-v] [-o directory] [-t templates] {command} {arguments}"); Put_Line ("where:"); Put_Line (" -v Print the version, configuration and installation paths"); Put_Line (" -o directory Directory where the Ada mapping files are generated"); Put_Line (" -t templates Directory where the Ada templates are defined"); Put_Line (" -c dir Directory where the Ada templates " & "and configurations are defined"); end Usage; -- ------------------------------ -- Print dynamo short usage. -- ------------------------------ procedure Short_Help_Usage is use Ada.Text_IO; begin New_Line; Put ("Type '"); Put (Ada.Command_Line.Command_Name); Put_Line (" help' for the list of commands."); end Short_Help_Usage; -- ------------------------------ -- Execute the command with the arguments. -- ------------------------------ procedure Execute (Cmd : in Help_Command; Generator : in out Gen.Generator.Handler) is pragma Unreferenced (Cmd); procedure Print (Position : in Command_Maps.Cursor); use Ada.Text_IO; use GNAT.Command_Line; procedure Print (Position : in Command_Maps.Cursor) is Name : constant Unbounded_String := Command_Maps.Key (Position); begin Put_Line (" " & To_String (Name)); end Print; Name : constant String := Get_Argument; begin Log.Debug ("Execute command {0}", Name); if Name'Length = 0 then Usage; New_Line; Put ("Type '"); Put (Ada.Command_Line.Command_Name); Put_Line (" help {command}' for help on a specific command."); New_Line; Put_Line ("Available subcommands:"); Commands.Iterate (Process => Print'Access); else declare Target_Cmd : constant Command_Access := Find_Command (Name); begin if Target_Cmd = null then Generator.Error ("Unknown command {0}", Name); else Target_Cmd.Help (Generator); end if; end; end if; end Execute; -- ------------------------------ -- Write the help associated with the command. -- ------------------------------ procedure Help (Cmd : in Help_Command; Generator : in out Gen.Generator.Handler) is begin null; end Help; -- ------------------------------ -- Register the command under the given name. -- ------------------------------ procedure Add_Command (Cmd : in Command_Access; Name : in String) is begin Commands.Include (Key => To_Unbounded_String (Name), New_Item => Cmd); end Add_Command; -- ------------------------------ -- Find the command having the given name. -- ------------------------------ function Find_Command (Name : in String) return Command_Access is Pos : constant Command_Maps.Cursor := Commands.Find (To_Unbounded_String (Name)); begin if Command_Maps.Has_Element (Pos) then return Command_Maps.Element (Pos); else return null; end if; end Find_Command; -- Generate command. Generate_Cmd : aliased Gen.Commands.Generate.Command; -- Create project command. Create_Project_Cmd : aliased Gen.Commands.Project.Command; -- Add page command. Add_Page_Cmd : aliased Gen.Commands.Page.Command; -- Add layout command. Add_Layout_Cmd : aliased Gen.Commands.Layout.Command; -- Add model command. Add_Model_Cmd : aliased Gen.Commands.Model.Command; -- Sets a property on the dynamo.xml project. Propset_Cmd : aliased Gen.Commands.Propset.Command; -- Create database command. Database_Cmd : aliased Gen.Commands.Database.Command; -- Project information command. Info_Cmd : aliased Gen.Commands.Info.Command; -- Distrib command. Dist_Cmd : aliased Gen.Commands.Distrib.Command; -- Create plugin command. Create_Plugin_Cmd : aliased Gen.Commands.Plugins.Command; -- Documentation command. Doc_Plugin_Cmd : aliased Gen.Commands.Docs.Command; -- Help command. Help_Cmd : aliased Help_Command; begin Add_Command (Name => "help", Cmd => Help_Cmd'Access); Add_Command (Name => "generate", Cmd => Generate_Cmd'Access); Add_Command (Name => "create-project", Cmd => Create_Project_Cmd'Access); Add_Command (Name => "add-page", Cmd => Add_Page_Cmd'Access); Add_Command (Name => "add-layout", Cmd => Add_Layout_Cmd'Access); Add_Command (Name => "add-model", Cmd => Add_Model_Cmd'Access); Add_Command (Name => "propset", Cmd => Propset_Cmd'Access); Add_Command (Name => "create-database", Cmd => Database_Cmd'Access); Add_Command (Name => "create-plugin", Cmd => Create_Plugin_Cmd'Access); Add_Command (Name => "dist", Cmd => Dist_Cmd'Access); Add_Command (Name => "info", Cmd => Info_Cmd'Access); Add_Command (Name => "build-doc", Cmd => Doc_Plugin_Cmd'Access); end Gen.Commands;
awa/plugins/awa-mail/src/awa-mail-components-messages.ads
My-Colaborations/ada-awa
81
23573
<filename>awa/plugins/awa-mail/src/awa-mail-components-messages.ads ----------------------------------------------------------------------- -- awa-mail-components-recipients -- Mail UI Recipients -- Copyright (C) 2012, 2020 <NAME> -- Written by <NAME> (<EMAIL>) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with ASF.Contexts.Faces; -- === Mail Messages === -- The `AWA.Mail.Components.Messages` package defines the UI components -- to represent the email message with its recipients, subject and body. -- -- The mail message is retrieved by looking at the parent UI component until a -- `UIMailMessage` component is found. The mail message recipients are initialized -- during the render response JSF phase, that is when `Encode_End` are called. -- -- The `<mail:body>` component holds the message body. This component can -- include a facelet labeled `alternative` in which case it will be used -- to build the `text/plain` mail message. The default content type for -- `<mail:body>` is `text/html` but this can be changed by using the -- `type` attribute. -- -- <mail:body type='text/html'> -- <facet name='alternative'> -- The text/plain mail message. -- </facet> -- The text/html mail message. -- </mail:body> package AWA.Mail.Components.Messages is ALTERNATIVE_NAME : constant String := "alternative"; -- ------------------------------ -- The mail recipient -- ------------------------------ type UIMailMessage is new UIMailComponent with private; type UIMailMessage_Access is access all UIMailMessage'Class; -- Set the mail message instance. procedure Set_Message (UI : in out UIMailMessage; Message : in AWA.Mail.Clients.Mail_Message_Access); -- Get the mail message instance. overriding function Get_Message (UI : in UIMailMessage) return AWA.Mail.Clients.Mail_Message_Access; -- Send the mail. overriding procedure Encode_End (UI : in UIMailMessage; Context : in out ASF.Contexts.Faces.Faces_Context'Class); -- Finalize and release the mail message. overriding procedure Finalize (UI : in out UIMailMessage); -- ------------------------------ -- The mail subject -- ------------------------------ type UIMailSubject is new UIMailComponent with private; -- Render the mail subject and initializes the message with its content. overriding procedure Encode_Children (UI : in UIMailSubject; Context : in out ASF.Contexts.Faces.Faces_Context'Class); -- ------------------------------ -- The mail body -- ------------------------------ type UIMailBody is new UIMailComponent with private; -- Render the mail body and initializes the message with its content. overriding procedure Encode_Children (UI : in UIMailBody; Context : in out ASF.Contexts.Faces.Faces_Context'Class); private type UIMailMessage is new UIMailComponent with record Message : AWA.Mail.Clients.Mail_Message_Access; end record; type UIMailBody is new UIMailComponent with null record; type UIMailSubject is new UIMailComponent with null record; end AWA.Mail.Components.Messages;
source/nodes/program-nodes-derived_record_extensions.ads
optikos/oasis
0
10160
-- Copyright (c) 2019 <NAME> <<EMAIL>> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with Program.Lexical_Elements; with Program.Elements.Expressions; with Program.Elements.Definitions; with Program.Elements.Derived_Record_Extensions; with Program.Element_Visitors; package Program.Nodes.Derived_Record_Extensions is pragma Preelaborate; type Derived_Record_Extension is new Program.Nodes.Node and Program.Elements.Derived_Record_Extensions .Derived_Record_Extension and Program.Elements.Derived_Record_Extensions .Derived_Record_Extension_Text with private; function Create (Abstract_Token : Program.Lexical_Elements.Lexical_Element_Access; Limited_Token : Program.Lexical_Elements.Lexical_Element_Access; New_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Parent : not null Program.Elements.Expressions .Expression_Access; And_Token : Program.Lexical_Elements.Lexical_Element_Access; Progenitors : Program.Elements.Expressions.Expression_Vector_Access; With_Token : not null Program.Lexical_Elements .Lexical_Element_Access; Record_Definition : not null Program.Elements.Definitions .Definition_Access) return Derived_Record_Extension; type Implicit_Derived_Record_Extension is new Program.Nodes.Node and Program.Elements.Derived_Record_Extensions .Derived_Record_Extension with private; function Create (Parent : not null Program.Elements.Expressions .Expression_Access; Progenitors : Program.Elements.Expressions .Expression_Vector_Access; Record_Definition : not null Program.Elements.Definitions .Definition_Access; Is_Part_Of_Implicit : Boolean := False; Is_Part_Of_Inherited : Boolean := False; Is_Part_Of_Instance : Boolean := False; Has_Abstract : Boolean := False; Has_Limited : Boolean := False) return Implicit_Derived_Record_Extension with Pre => Is_Part_Of_Implicit or Is_Part_Of_Inherited or Is_Part_Of_Instance; private type Base_Derived_Record_Extension is abstract new Program.Nodes.Node and Program.Elements.Derived_Record_Extensions.Derived_Record_Extension with record Parent : not null Program.Elements.Expressions .Expression_Access; Progenitors : Program.Elements.Expressions .Expression_Vector_Access; Record_Definition : not null Program.Elements.Definitions .Definition_Access; end record; procedure Initialize (Self : aliased in out Base_Derived_Record_Extension'Class); overriding procedure Visit (Self : not null access Base_Derived_Record_Extension; Visitor : in out Program.Element_Visitors.Element_Visitor'Class); overriding function Parent (Self : Base_Derived_Record_Extension) return not null Program.Elements.Expressions.Expression_Access; overriding function Progenitors (Self : Base_Derived_Record_Extension) return Program.Elements.Expressions.Expression_Vector_Access; overriding function Record_Definition (Self : Base_Derived_Record_Extension) return not null Program.Elements.Definitions.Definition_Access; overriding function Is_Derived_Record_Extension_Element (Self : Base_Derived_Record_Extension) return Boolean; overriding function Is_Type_Definition_Element (Self : Base_Derived_Record_Extension) return Boolean; overriding function Is_Definition_Element (Self : Base_Derived_Record_Extension) return Boolean; type Derived_Record_Extension is new Base_Derived_Record_Extension and Program.Elements.Derived_Record_Extensions .Derived_Record_Extension_Text with record Abstract_Token : Program.Lexical_Elements.Lexical_Element_Access; Limited_Token : Program.Lexical_Elements.Lexical_Element_Access; New_Token : not null Program.Lexical_Elements .Lexical_Element_Access; And_Token : Program.Lexical_Elements.Lexical_Element_Access; With_Token : not null Program.Lexical_Elements .Lexical_Element_Access; end record; overriding function To_Derived_Record_Extension_Text (Self : aliased in out Derived_Record_Extension) return Program.Elements.Derived_Record_Extensions .Derived_Record_Extension_Text_Access; overriding function Abstract_Token (Self : Derived_Record_Extension) return Program.Lexical_Elements.Lexical_Element_Access; overriding function Limited_Token (Self : Derived_Record_Extension) return Program.Lexical_Elements.Lexical_Element_Access; overriding function New_Token (Self : Derived_Record_Extension) return not null Program.Lexical_Elements.Lexical_Element_Access; overriding function And_Token (Self : Derived_Record_Extension) return Program.Lexical_Elements.Lexical_Element_Access; overriding function With_Token (Self : Derived_Record_Extension) return not null Program.Lexical_Elements.Lexical_Element_Access; overriding function Has_Abstract (Self : Derived_Record_Extension) return Boolean; overriding function Has_Limited (Self : Derived_Record_Extension) return Boolean; type Implicit_Derived_Record_Extension is new Base_Derived_Record_Extension with record Is_Part_Of_Implicit : Boolean; Is_Part_Of_Inherited : Boolean; Is_Part_Of_Instance : Boolean; Has_Abstract : Boolean; Has_Limited : Boolean; end record; overriding function To_Derived_Record_Extension_Text (Self : aliased in out Implicit_Derived_Record_Extension) return Program.Elements.Derived_Record_Extensions .Derived_Record_Extension_Text_Access; overriding function Is_Part_Of_Implicit (Self : Implicit_Derived_Record_Extension) return Boolean; overriding function Is_Part_Of_Inherited (Self : Implicit_Derived_Record_Extension) return Boolean; overriding function Is_Part_Of_Instance (Self : Implicit_Derived_Record_Extension) return Boolean; overriding function Has_Abstract (Self : Implicit_Derived_Record_Extension) return Boolean; overriding function Has_Limited (Self : Implicit_Derived_Record_Extension) return Boolean; end Program.Nodes.Derived_Record_Extensions;
ada/original_2008/ada-gui/agar-gui-widget-hbox.adb
auzkok/libagar
286
25576
<gh_stars>100-1000 package body agar.gui.widget.hbox is package cbinds is procedure set_homogenous (box : hbox_access_t; homogenous : c.int); pragma import (c, set_homogenous, "agar_gui_widget_hbox_set_homogenous"); procedure set_padding (box : hbox_access_t; padding : c.int); pragma import (c, set_padding, "agar_gui_widget_hbox_set_padding"); procedure set_spacing (box : hbox_access_t; spacing : c.int); pragma import (c, set_spacing, "agar_gui_widget_hbox_set_spacing"); end cbinds; procedure set_homogenous (box : hbox_access_t; homogenous : boolean := true) is begin if homogenous then cbinds.set_homogenous (box, 1); else cbinds.set_homogenous (box, 0); end if; end set_homogenous; procedure set_padding (box : hbox_access_t; padding : natural) is begin cbinds.set_padding (box => box, padding => c.int (padding)); end set_padding; procedure set_spacing (box : hbox_access_t; spacing : natural) is begin cbinds.set_spacing (box => box, spacing => c.int (spacing)); end set_spacing; function widget (box : hbox_access_t) return widget_access_t is begin return agar.gui.widget.box.widget (box.box'access); end widget; end agar.gui.widget.hbox;
sim6502/Grammar/sim6502.g4
barryw/sim6502
9
6329
<reponame>barryw/sim6502<gh_stars>1-10 /* Copyright (c) 2020 <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: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 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. */ grammar sim6502; suites : Suites LBrace (suite)* RBrace ; suite : Suite LParen suiteName RParen LBrace (testFunction | symbolsFunction | loadFunction)+ RBrace ; suiteName : StringLiteral ; assignment : expression Assign expression # expressionAssignment | symbolRef Assign expression # symbolAssignment | address Assign expression # addressAssignment | Register Assign expression # registerAssignment | ProcessorFlag Assign expression # flagAssignment ; address : number # numberAddress | symbolRef # symbolAddress ; number : Hex # hexNumber | Int # intNumber | Binary # binaryNumber ; boolean : Boolean ; assertFunction : Assert LParen comparison Comma assertDescription RParen ; assertDescription : StringLiteral ; comparison : compareLHS CompareOperator expression # compareExpression | memoryChkFunction # memoryChk | memoryCmpFunction # memoryCmp ; compareLHS : Register # registerCompare | ProcessorFlag # flagCompare | address # addressCompare | Cycles # cyclesCompare | expression (byteWord)? # expressionCompare ; jsrFunction : JSR LParen address stopOn failOnBreak RParen ; stopOn : Comma StopOnAddress Assign address | Comma StopOnRTS Assign boolean ; failOnBreak : Comma FailOnBRK Assign boolean ; symbolsFunction : Symbols LParen symbolsFilename RParen ; symbolsFilename : StringLiteral ; loadFunction : Load LParen loadFilename (loadAddress)? (stripHeader)? RParen ; loadFilename : StringLiteral ; loadAddress : Comma Address Assign address ; stripHeader : Comma StripHeader Assign boolean ; testFunction : Test LParen testName Comma testDescription RParen LBrace testContents+ RBrace ; testName : StringLiteral ; testDescription : StringLiteral ; testContents : assertFunction+ | assignment+ | jsrFunction+ ; peekByteFunction : PeekByte LParen expression RParen ; peekWordFunction : PeekWord LParen expression RParen ; memoryCmpFunction : MemoryCmp LParen sourceAddress Comma targetAddress Comma memorySize RParen ; memoryChkFunction : MemoryChk LParen sourceAddress Comma memorySize Comma memoryValue RParen ; sourceAddress : expression ; targetAddress : expression ; memorySize : expression ; memoryValue : expression ; expression : address (lbhb)? # addressValue | number (lbhb)? # intValue | boolean # boolValue | intFunction # intFunctionValue | boolFunction # boolFunctionValue | LParen expression RParen # subExpressionValue | expression BitAnd expression # bitAndExpressionValue | expression BitOr expression # bitOrExpressionValue | expression BitXor expression # bitXorExpressionValue | expression Mul expression # multiplyValue | expression Div expression # divisionValue | expression Add expression # addValue | expression Sub expression # subValue ; lbhb : LoByte # loByte | HiByte # hiByte ; byteWord : Byte # byteValue | Word # wordValue ; intFunction : peekByteFunction # peekByteFunctionValue | peekWordFunction # peekWordFunctionValue ; boolFunction : memoryChkFunction # memoryChkFunctionValue | memoryCmpFunction # memoryCmpFunctionValue ; symbolRef : LBracket symbol RBracket ; symbol : Identifier | Identifier '.' Identifier ; Boolean : BoolTrue | BoolFalse ; ProcessorFlag : FlagC | FlagN | FlagZ | FlagD | FlagV ; Register : RegA | RegX | RegY ; Int : [0-9] + ; Hex : Dollar HexDigit + | '0' [xX] HexDigit + ; fragment HexDigit : [0-9a-fA-F] ; Binary : Percent ('0' | '1') + ; CompareOperator : Equal | GT | LT | GTE | LTE | NotEqual ; Assign: '=' ; Equal: '==' ; GT: '>' ; LT: '<' ; GTE: '>=' ; LTE: '<=' ; NotEqual : '<>' | '!=' ; Add: '+' ; Sub: '-' ; Mul: '*' ; Div: '/' ; BitAnd: '&' ; BitOr: '|' ; BitXor: '^' ; Dollar: '$' ; Percent: '%' ; Comma: ',' ; LParen: '(' ; RParen: ')' ; LBrace: '{' ; RBrace: '}' ; LBracket: '[' ; RBracket: ']' ; Quote: '"' ; RegA: [aA] ; RegX: [xX] ; RegY: [yY] ; FlagC: [cC] ; FlagN: [nN] ; FlagV: [vV] ; FlagD: [dD] ; FlagZ: [zZ] ; BoolTrue: 'true' ; BoolFalse: 'false' ; Suites: 'suites' ; Suite: 'suite' ; Test: 'test' ; Load: 'load' ; Symbols: 'symbols' ; Assert: 'assert' ; JSR: 'jsr' ; PeekByte: 'peekbyte' ; PeekWord: 'peekword' ; MemoryCmp: 'memcmp'; MemoryChk: 'memchk'; Cycles: 'cycles' ; Address: 'address'; StripHeader: 'strip_header'; StopOnAddress: 'stop_on_address'; StopOnRTS: 'stop_on_rts'; FailOnBRK: 'fail_on_brk'; LoByte: '.l' | '.L' ; HiByte: '.h' | '.H' ; Byte: '.b' | '.B' ; Word: '.w' | '.W' ; Identifier : [a-zA-Z0-9_.]+ ; StringLiteral : Quote String Quote {Text = Text.Substring(1, Text.Length - 2);} ; fragment String : ~ ["\n\r]+ ; Comment : ';' ~ [\r\n]* -> skip ; WS : [ \t\r\n\u000C]+ -> skip ; NewLine : ( '\r' '\n'? | '\n' ) -> skip ;
Interpreter.agda
ahmadsalim/well-typed-agda-interpreter
10
6528
<reponame>ahmadsalim/well-typed-agda-interpreter module Interpreter where open import Data.Char open import Data.Bool open import Data.Nat import Data.Unit as U open import Data.Product open import Data.Sum open import Relation.Binary.PropositionalEquality as PropEq open import Relation.Nullary.Core import Data.String as Str open import Data.Nat.Show import Data.List as List open import Data.Empty infix 3 _:::_,_ infix 2 _∈_ infix 1 _⊢_ data `Set : Set where `Nat : `Set `Bool : `Set `_⇨_ : `Set → `Set → `Set `Unit : `Set `_×_ : `Set → `Set → `Set `_+_ : `Set → `Set → `Set #_ : `Set → Set # `Nat = ℕ # `Bool = Bool # (` t ⇨ s) = # t → # s # `Unit = U.Unit # (` t × s) = # t × # s # (` t + s) = # t ⊎ # s data Γ : Set where · : Γ _:::_,_ : Char → `Set → Γ → Γ data _∈_ : Char → Γ → Set where H : ∀ {x Δ t } → x ∈ x ::: t , Δ TH : ∀ {x y Δ t } → {{prf : x ∈ Δ}} → x ∈ y ::: t , Δ !Γ_[_] : ∀ {x} → (Δ : Γ) → x ∈ Δ → `Set !Γ_[_] · () !Γ _ ::: t , Δ [ H ] = t !Γ _ ::: _ , Δ [ TH {{prf = i}} ] = !Γ Δ [ i ] data _⊢_ : Γ → `Set → Set where `false : ∀ {Δ} → Δ ⊢ `Bool `true : ∀ {Δ} → Δ ⊢ `Bool `n_ : ∀ {Δ} → ℕ → Δ ⊢ `Nat `v_ : ∀ {Δ} → (x : Char) → {{i : x ∈ Δ}} → Δ ⊢ !Γ Δ [ i ] `_₋_ : ∀ {Δ t s} → Δ ⊢ ` t ⇨ s → Δ ⊢ t → Δ ⊢ s `λ_`:_⇨_ : ∀ {Δ tr} → (x : Char) → (tx : `Set) → x ::: tx , Δ ⊢ tr → Δ ⊢ ` tx ⇨ tr `_+_ : ∀ {Δ} → Δ ⊢ `Nat → Δ ⊢ `Nat → Δ ⊢ `Nat `_*_ : ∀ {Δ} → Δ ⊢ `Nat → Δ ⊢ `Nat → Δ ⊢ `Nat `_∧_ : ∀ {Δ} → Δ ⊢ `Bool → Δ ⊢ `Bool → Δ ⊢ `Bool `_∨_ : ∀ {Δ} → Δ ⊢ `Bool → Δ ⊢ `Bool → Δ ⊢ `Bool `_≤_ : ∀ {Δ} → Δ ⊢ `Nat → Δ ⊢ `Nat → Δ ⊢ `Bool `¬_ : ∀ {Δ} → Δ ⊢ `Bool → Δ ⊢ `Bool `_,_ : ∀ {Δ t s} → Δ ⊢ t → Δ ⊢ s → Δ ⊢ ` t × s `fst : ∀ {Δ t s} → Δ ⊢ ` t × s → Δ ⊢ t `snd : ∀ {Δ t s} → Δ ⊢ ` t × s → Δ ⊢ s `left : ∀ {Δ t s} → Δ ⊢ t → Δ ⊢ ` t + s `right : ∀ {Δ t s} → Δ ⊢ s → Δ ⊢ ` t + s `case_`of_||_ : ∀ {Δ t s u} → Δ ⊢ ` t + s → Δ ⊢ ` t ⇨ u → Δ ⊢ ` s ⇨ u → Δ ⊢ u `tt : ∀ {Δ} → Δ ⊢ `Unit `let_`=_`in_ : ∀ {Δ th tb} → (x : Char) → Δ ⊢ th → x ::: th , Δ ⊢ tb → Δ ⊢ tb `if_`then_`else_ : ∀ {Δ t} → Δ ⊢ `Bool → Δ ⊢ t → Δ ⊢ t → Δ ⊢ t data ⟨_⟩ : Γ → Set₁ where [] : ⟨ · ⟩ _∷_ : ∀ {x t Δ} → # t → ⟨ Δ ⟩ → ⟨ x ::: t , Δ ⟩ !_[_] : ∀ {x Δ} → ⟨ Δ ⟩ → (i : x ∈ Δ) → # !Γ Δ [ i ] !_[_] [] () !_[_] (val ∷ env) H = val !_[_] (val ∷ env) (TH {{prf = i}}) = ! env [ i ] interpret : ∀ {t} → · ⊢ t → # t interpret = interpret' [] where interpret' : ∀ {Δ t} → ⟨ Δ ⟩ → Δ ⊢ t → # t interpret' env `true = true interpret' env `false = false interpret' env `tt = U.unit interpret' env (`n n) = n interpret' env ((`v x) {{i = idx}}) = ! env [ idx ] interpret' env (` f ₋ x) = (interpret' env f) (interpret' env x) interpret' env (`λ _ `: tx ⇨ body) = λ (x : # tx) → interpret' (x ∷ env) body interpret' env (` l + r) = interpret' env l + interpret' env r interpret' env (` l * r) = interpret' env l * interpret' env r interpret' env (` l ∧ r) = interpret' env l ∧ interpret' env r interpret' env (` l ∨ r) = interpret' env l ∨ interpret' env r interpret' env (` l ≤ r) with interpret' env l ≤? interpret' env r interpret' env (` l ≤ r) | yes p = true interpret' env (` l ≤ r) | no ¬p = false interpret' env (`¬ x) = not (interpret' env x) interpret' env (` f , s) = interpret' env f ,′ interpret' env s interpret' env (`fst p) with interpret' env p interpret' env (`fst p) | f , s = f interpret' env (`snd p) with interpret' env p interpret' env (`snd p) | f , s = s interpret' env (`left v) = inj₁ (interpret' env v) interpret' env (`right v) = inj₂ (interpret' env v) interpret' env (`case s `of le || re) with interpret' env s interpret' env (`case s `of le || re) | inj₁ l = (interpret' env le) l interpret' env (`case s `of le || re) | inj₂ r = (interpret' env re) r interpret' env (`let _ `= h `in b) = let hval = interpret' env h in interpret' (hval ∷ env) b interpret' env (`if b `then et `else ef) with interpret' env b interpret' env (`if b `then et `else ef) | true = interpret' env et interpret' env (`if b `then et `else ef) | false = interpret' env ef testSimpleLambda : · ⊢ `Nat testSimpleLambda = ` (`λ 'x' `: `Nat ⇨ ` `v 'x' + `v 'x') ₋ `n 10 testNestedLambda : · ⊢ `Nat testNestedLambda = ` ` (`λ 'x' `: `Nat ⇨ (`λ 'y' `: `Nat ⇨ ` `v 'x' * `v 'y')) ₋ `n 10 ₋ `n 15 -- Should not work because the inner x is not bound to a boolean, and it should not be possible to refer to the outside x using Elem -- TODO Fix this to not work with instance search --testNamingNotWorking : · ⊢ `Bool --testNamingNotWorking = ` ` `λ 'x' `: `Bool ⇨ (`λ 'x' `: `Unit ⇨ `v 'x') ₋ `true ₋ `tt testNamingWorking : · ⊢ `Unit testNamingWorking = ` ` `λ 'x' `: `Bool ⇨ (`λ 'x' `: `Unit ⇨ `v 'x') ₋ `true ₋ `tt testSum1 : · ⊢ `Nat testSum1 = `let 'n' `= `case `left (`n 10) `of `λ 'n' `: `Nat ⇨ `v 'n' || `λ 'b' `: `Bool ⇨ `if `v 'b' `then `n 1 `else `n 0 `in `v 'n' testSum2 : · ⊢ `Nat testSum2 = `let 'n' `= `case `right `true `of `λ 'n' `: `Nat ⇨ `v 'n' || `λ 'b' `: `Bool ⇨ `if `v 'b' `then `n 1 `else `n 0 `in `v 'n' testProduct1 : · ⊢ `Bool testProduct1 = `fst (` `true , (` `n 10 , `tt )) testProduct2 : · ⊢ ` `Nat × `Unit testProduct2 = `snd (` `true , (` `n 10 , `tt )) testDeMorganFullOr : · ⊢ `Bool testDeMorganFullOr = `let 's' `= `λ 'x' `: `Bool ⇨ `λ 'y' `: `Bool ⇨ `¬ (` `v 'x' ∨ `v 'y') `in ` ` `v 's'₋ `true ₋ `true testDeMorganBrokenAnd : · ⊢ `Bool testDeMorganBrokenAnd = `let 's' `= `λ 'x' `: `Bool ⇨ `λ 'y' `: `Bool ⇨ ` `¬ `v 'x' ∧ `¬ `v 'y' `in ` ` `v 's' ₋ `true ₋ `true
programs/oeis/168/A168489.asm
karttu/loda
1
2761
<filename>programs/oeis/168/A168489.asm ; A168489: Numbers that are congruent to {7,11} mod 12. ; 7,11,19,23,31,35,43,47,55,59,67,71,79,83,91,95,103,107,115,119,127,131,139,143,151,155,163,167,175,179,187,191,199,203,211,215,223,227,235,239,247,251,259,263,271,275,283,287,295,299,307,311,319,323,331,335,343,347,355,359,367,371,379,383,391,395,403,407,415,419,427,431,439,443,451,455,463,467,475,479,487,491,499,503,511,515,523,527,535,539,547,551,559,563,571,575,583,587,595,599,607,611,619,623,631,635,643,647,655,659,667,671,679,683,691,695,703,707,715,719,727,731,739,743,751,755,763,767,775,779,787,791,799,803,811,815,823,827,835,839,847,851,859,863,871,875,883,887,895,899,907,911,919,923,931,935,943,947,955,959,967,971,979,983,991,995,1003,1007,1015,1019,1027,1031,1039,1043,1051,1055,1063,1067,1075,1079,1087,1091,1099,1103,1111,1115,1123,1127,1135,1139,1147,1151,1159,1163,1171,1175,1183,1187,1195,1199,1207,1211,1219,1223,1231,1235,1243,1247,1255,1259,1267,1271,1279,1283,1291,1295,1303,1307,1315,1319,1327,1331,1339,1343,1351,1355,1363,1367,1375,1379,1387,1391,1399,1403,1411,1415,1423,1427,1435,1439,1447,1451,1459,1463,1471,1475,1483,1487,1495,1499 mul $0,6 mov $1,$0 div $1,4 mul $1,4 add $1,7
Save EPS from Photoshop with settings.applescript
AlexanderGalen/applescripts
3
2391
<filename>Save EPS from Photoshop with settings.applescript<gh_stars>1-10 tell application "Adobe Photoshop CS6" activate set PSDfilePath to file path of document 1 as string set CurrentDoc to document 1 set myOptions to {class:EPS save options, preview type:eight bit TIFF, encoding:binary, halftone screen:false, transfer function:false, PostScript color management:false} save CurrentDoc in file PSDfilePath as Photoshop EPS with options myOptions with replacing and copying close CurrentDoc end tell
awa/samples/src/atlas-microblog-modules.adb
Letractively/ada-awa
7
19542
----------------------------------------------------------------------- -- atlas-microblog-modules -- Module microblog -- Copyright (C) 2012 <NAME> -- Written by <NAME> (<EMAIL>) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Calendar; with AWA.Modules.Beans; with AWA.Modules.Get; with AWA.Services.Contexts; with ADO.Sessions; with Util.Log.Loggers; with Atlas.Microblog.Beans; package body Atlas.Microblog.Modules is Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("Atlas.Microblog.Module"); package Register is new AWA.Modules.Beans (Module => Microblog_Module, Module_Access => Microblog_Module_Access); -- ------------------------------ -- Initialize the microblog module. -- ------------------------------ overriding procedure Initialize (Plugin : in out Microblog_Module; App : in AWA.Modules.Application_Access; Props : in ASF.Applications.Config) is begin Log.Info ("Initializing the microblog module"); -- Register here any bean class, servlet, filter. Register.Register (Plugin => Plugin, Name => "Atlas.Microblog.Beans.Microblog_Bean", Handler => Atlas.Microblog.Beans.Create_Microblog_Bean'Access); Register.Register (Plugin => Plugin, Name => "Atlas.Microblog.Beans.List_Bean", Handler => Atlas.Microblog.Beans.Create_List_Bean'Access); AWA.Modules.Module (Plugin).Initialize (App, Props); -- Add here the creation of manager instances. end Initialize; -- ------------------------------ -- Get the microblog module. -- ------------------------------ function Get_Microblog_Module return Microblog_Module_Access is function Get is new AWA.Modules.Get (Microblog_Module, Microblog_Module_Access, NAME); begin return Get; end Get_Microblog_Module; -- ------------------------------ -- Create a post for the microblog. -- ------------------------------ procedure Create (Plugin : in Microblog_Module; Post : in out Atlas.Microblog.Models.Mblog_Ref) is pragma Unreferenced (Plugin); use AWA.Services; Ctx : constant Contexts.Service_Context_Access := AWA.Services.Contexts.Current; DB : ADO.Sessions.Master_Session := AWA.Services.Contexts.Get_Master_Session (Ctx); begin Ctx.Start; Post.Set_Creation_Date (Ada.Calendar.Clock); Post.Set_Author (Ctx.Get_User); Post.Save (DB); Ctx.Commit; end Create; end Atlas.Microblog.Modules;
FormalAnalyzer/models/apps/ID3SmokeAlarm+.als
Mohannadcse/IoTCOM_BehavioralRuleExtractor
0
3264
module app_ID3SmokeAlarm open IoTBottomUp as base open cap_alarm open cap_runIn open cap_smokeDetector one sig app_ID3SmokeAlarm extends IoTApp { smoke : one cap_smokeDetector, runIn : one cap_state, state : one cap_state, alarm : one cap_alarm, } { rules = r } one sig cap_state extends cap_runIn {} { attributes = cap_state_attr + cap_runIn_attr } one sig cap_state extends Capability {} { attributes = cap_state_attr } abstract sig cap_state_attr extends Attribute {} one sig cap_state_attr_msg extends cap_state_attr {} { values = cap_state_attr_msg_val } abstract sig cap_state_attr_msg_val extends AttrValue {} one sig cap_state_attr_msg_val_smoke_detected extends cap_state_attr_msg_val {} one sig cap_state_attr_fake extends cap_state_attr {} { values = cap_state_attr_fake_val } abstract sig cap_state_attr_fake_val extends AttrValue {} one sig cap_state_attr_fake_val_true extends cap_state_attr_fake_val {} // application rules base class abstract sig r extends Rule {} one sig r0 extends r {}{ triggers = r0_trig no conditions commands = r0_comm } abstract sig r0_trig extends Trigger {} one sig r0_trig0 extends r0_trig {} { capabilities = app_ID3SmokeAlarm.smoke attribute = cap_smokeDetector_attr_smoke no value } abstract sig r0_comm extends Command {} one sig r0_comm0 extends r0_comm {} { capability = app_ID3SmokeAlarm.alarm attribute = cap_alarm_attr_alarm value = cap_alarm_attr_alarm_val_strobe } one sig r1 extends r {}{ triggers = r1_trig no conditions commands = r1_comm } abstract sig r1_trig extends Trigger {} one sig r1_trig0 extends r1_trig {} { capabilities = app_ID3SmokeAlarm.smoke attribute = cap_smokeDetector_attr_smoke no value } abstract sig r1_comm extends Command {} one sig r1_comm0 extends r1_comm {} { capability = app_ID3SmokeAlarm.runIn attribute = cap_runIn_attr_runIn value = cap_runIn_attr_runIn_val_on }
llvm-gcc-4.2-2.9/gcc/ada/a-chtgke.adb
vidkidz/crossbridge
1
24146
------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- A D A . C O N T A I N E R S . -- -- H A S H _ T A B L E S . G E N E R I C _ K E Y S -- -- -- -- B o d y -- -- -- -- Copyright (C) 2004-2005, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- -- apply solely to the contents of the part following the private keyword. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file 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. -- -- -- -- This unit was originally developed by <NAME>ey. -- ------------------------------------------------------------------------------ package body Ada.Containers.Hash_Tables.Generic_Keys is -------------------------- -- Delete_Key_Sans_Free -- -------------------------- procedure Delete_Key_Sans_Free (HT : in out Hash_Table_Type; Key : Key_Type; X : out Node_Access) is Indx : Hash_Type; Prev : Node_Access; begin if HT.Length = 0 then X := null; return; end if; Indx := Index (HT, Key); X := HT.Buckets (Indx); if X = null then return; end if; if Equivalent_Keys (Key, X) then if HT.Busy > 0 then raise Program_Error; end if; HT.Buckets (Indx) := Next (X); HT.Length := HT.Length - 1; return; end if; loop Prev := X; X := Next (Prev); if X = null then return; end if; if Equivalent_Keys (Key, X) then if HT.Busy > 0 then raise Program_Error; end if; Set_Next (Node => Prev, Next => Next (X)); HT.Length := HT.Length - 1; return; end if; end loop; end Delete_Key_Sans_Free; ---------- -- Find -- ---------- function Find (HT : Hash_Table_Type; Key : Key_Type) return Node_Access is Indx : Hash_Type; Node : Node_Access; begin if HT.Length = 0 then return null; end if; Indx := Index (HT, Key); Node := HT.Buckets (Indx); while Node /= null loop if Equivalent_Keys (Key, Node) then return Node; end if; Node := Next (Node); end loop; return null; end Find; -------------------------------- -- Generic_Conditional_Insert -- -------------------------------- procedure Generic_Conditional_Insert (HT : in out Hash_Table_Type; Key : Key_Type; Node : out Node_Access; Inserted : out Boolean) is Indx : constant Hash_Type := Index (HT, Key); B : Node_Access renames HT.Buckets (Indx); subtype Length_Subtype is Count_Type range 0 .. Count_Type'Last - 1; begin if B = null then if HT.Busy > 0 then raise Program_Error; end if; declare Length : constant Length_Subtype := HT.Length; begin Node := New_Node (Next => null); Inserted := True; B := Node; HT.Length := Length + 1; end; return; end if; Node := B; loop if Equivalent_Keys (Key, Node) then Inserted := False; return; end if; Node := Next (Node); exit when Node = null; end loop; if HT.Busy > 0 then raise Program_Error; end if; declare Length : constant Length_Subtype := HT.Length; begin Node := New_Node (Next => B); Inserted := True; B := Node; HT.Length := Length + 1; end; end Generic_Conditional_Insert; ----------- -- Index -- ----------- function Index (HT : Hash_Table_Type; Key : Key_Type) return Hash_Type is begin return Hash (Key) mod HT.Buckets'Length; end Index; end Ada.Containers.Hash_Tables.Generic_Keys;
arch/lib/scheme/write_sob_vector.asm
Mosseridan/Compiler-Principles
0
12223
/* scheme/write_sob_vector.asm * Take a pointer to a Scheme vector object, and * prints (to stdout) the character representation * of that object. * * Programmer: <NAME>, 2010 */ WRITE_SOB_VECTOR: PUSH(FP); MOV(FP, SP); PUSH(R1); PUSH(R2); PUSH(IMM('#')); CALL(PUTCHAR); MOV(R0, FPARG(0)); PUSH(INDD(R0, 1)); CALL(WRITE_INTEGER); PUSH(IMM('(')); CALL(PUTCHAR); DROP(3); MOV(R0, FPARG(0)); MOV(R1, INDD(R0, 1)); CMP(R1, IMM(0)); JUMP_EQ(L_WSV_EXIT); MOV(R2, R0); ADD(R2, IMM(2)); PUSH(IND(R2)); CALL(WRITE_SOB); DROP(1); INCR(R2); DECR(R1); L_WSV_LOOP: CMP(R1, IMM(0)); JUMP_EQ(L_WSV_EXIT); PUSH(IMM(' ')); CALL(PUTCHAR); DROP(1); PUSH(IND(R2)); CALL(WRITE_SOB); DROP(1); INCR(R2); DECR(R1); JUMP(L_WSV_LOOP); L_WSV_EXIT: PUSH(IMM(')')); CALL(PUTCHAR); DROP(1); POP(R2); POP(R1); POP(FP); RETURN;
programs/oeis/126/A126026.asm
neoneye/loda
22
15934
<reponame>neoneye/loda<filename>programs/oeis/126/A126026.asm ; A126026: Conjectured upper bound on area of the convex hull of any edge-to-edge connected system of regular unit hexagons (n-polyhexes). ; 0,1,2,4,5,8,10,13,17,20,24,28,33,38,43,49,55,61,68,75,82,90,97,106,114,123,133,142,152,162,173,184,195,207,219,231,244,257,270,284,297,312,326,341,357,372,388,404,421,438,455,473,491,509,528,547,566,586,605,626,646,667,689,710,732,754,777,800,823,847,871,895,920,945,970,996,1021,1048,1074,1101,1129,1156,1184,1212,1241,1270,1299,1329,1359,1389,1420,1451,1482,1514,1545,1578,1610,1643,1677,1710 mov $2,$0 mov $3,$0 mul $0,2 div $0,3 sub $3,1 pow $3,2 add $0,$3 div $0,6 add $0,$2
programs/oeis/036/A036131.asm
neoneye/loda
22
89234
<filename>programs/oeis/036/A036131.asm ; A036131: a(n) = 2^n mod 67. ; 1,2,4,8,16,32,64,61,55,43,19,38,9,18,36,5,10,20,40,13,26,52,37,7,14,28,56,45,23,46,25,50,33,66,65,63,59,51,35,3,6,12,24,48,29,58,49,31,62,57,47,27,54,41,15,30,60,53,39,11,22,44,21,42,17,34,1,2,4,8,16,32,64,61,55,43,19,38,9,18,36,5,10,20,40,13,26,52,37,7,14,28,56,45,23,46,25,50,33,66 seq $0,79 ; Powers of 2: a(n) = 2^n. mod $0,67
1.ToyRISC programs/fibonacci.asm
atpk/ToyRISC
0
26644
<filename>1.ToyRISC programs/fibonacci.asm<gh_stars>0 .data n: 10 .text main: addi %x0, 65534, %x3 load %x0, $n, %x4 addi %x0, 2, %x5 blt %x4, %x5, final addi %x0, 1, %x6 store %x6, 0, %x3 subi %x4, 2, %x4 fibonacci: beq %x0, %x4, final load %x3, 0, %x6 load %x3, 1, %x7 add %x6, %x7, %x8 subi %x3, 1, %x3 store %x8, 0, %x3 subi %x4, 1, %x4 jmp fibonacci final: end
cssh.applescript
bmfurtado/iterm2-cssh
12
3142
<gh_stars>10-100 #!/usr/bin/osascript -- Launches multiple SSH session -- completely rewritten but inspired by github:xgdlm/iterm2-cssh on run argv set serverList to argv -- Print help if no servers are given if (count serverList) = 0 log("usage: iterm2-cssh [user@]hostname ...") return end if set numColumns to (round ((count serverList) ^ 0.5) rounding up) set allSessions to {} set columnTops to {} tell application "iTerm" -- create column tops set newWindow to (create window with default profile) tell newWindow copy current session to end of |allSessions| copy current session to end of |columnTops| tell current session repeat numColumns - 1 times set newSession to (split vertically with default profile) copy newSession to end of |allSessions| copy newSession to end of |columnTops| tell newSession to select end repeat end tell end tell -- split each column set columnsDone to 0 repeat with columnTop in columnTops tell columnTop -- calculate how many vertical panes we need here set numVertical to (round(((count serverList)-(count allSessions))/(numColumns-columnsDone)) rounding up) + 1 repeat numVertical - 1 times copy (split horizontally with default profile) to end of |allSessions| end repeat set columnsDone to columnsDone + 1 end tell end repeat -- run ssh commands on all sessions repeat with loopIndex from 1 to number of items in allSessions tell item loopIndex of allSessions write text "ssh " & (item loopIndex of serverList) end tell end repeat -- enable broadcast tell application "System Events" to keystroke "I" using {command down, shift down} end tell end run
seqinc_prio.asm
eastclo/OS_3
0
86764
_seqinc_prio: file format elf32-i386 Disassembly of section .text: 00000000 <main>: for (j = 0; j < 1024 * 10; j++) data[j]++; } } int main(int argc, char *argv[]) { 0: 8d 4c 24 04 lea 0x4(%esp),%ecx 4: 83 e4 f0 and $0xfffffff0,%esp 7: ff 71 fc pushl -0x4(%ecx) a: 55 push %ebp b: 89 e5 mov %esp,%ebp d: 57 push %edi e: 56 push %esi f: 53 push %ebx 10: 51 push %ecx 11: 83 ec 18 sub $0x18,%esp if (argc < 2) 14: 83 39 01 cmpl $0x1,(%ecx) { 17: 8b 41 04 mov 0x4(%ecx),%eax if (argc < 2) 1a: 0f 8e aa 00 00 00 jle ca <main+0xca> { printf(1, "test-case <number-of-children>\n"); exit(); } int N = atoi(argv[1]); 20: 83 ec 0c sub $0xc,%esp 23: ff 70 04 pushl 0x4(%eax) 26: e8 f5 03 00 00 call 420 <atoi> int pids[N]; 2b: 8d 1c 85 00 00 00 00 lea 0x0(,%eax,4),%ebx int N = atoi(argv[1]); 32: 89 c6 mov %eax,%esi int pids[N]; 34: 83 c4 10 add $0x10,%esp 37: 8d 43 12 lea 0x12(%ebx),%eax 3a: 83 e0 f0 and $0xfffffff0,%eax 3d: 29 c4 sub %eax,%esp 3f: 89 65 e4 mov %esp,-0x1c(%ebp) int rets[N]; 42: 29 c4 sub %eax,%esp 44: 89 65 e0 mov %esp,-0x20(%ebp) if(set_prio(1000) < 0) 47: 83 ec 0c sub $0xc,%esp 4a: 68 e8 03 00 00 push $0x3e8 4f: e8 06 05 00 00 call 55a <set_prio> 54: 83 c4 10 add $0x10,%esp 57: 85 c0 test %eax,%eax 59: 0f 88 21 01 00 00 js 180 <main+0x180> printf(1, "set priority error for parent process\n"); printf(1, "Priority of parent process = %d\n", get_prio()); 5f: e8 fe 04 00 00 call 562 <get_prio> 64: 52 push %edx 65: 50 push %eax 66: 68 18 0a 00 00 push $0xa18 6b: 6a 01 push $0x1 6d: e8 9e 05 00 00 call 610 <printf> for (int i = 0; i < N; i++) 72: 83 c4 10 add $0x10,%esp 75: 85 f6 test %esi,%esi 77: 0f 8e 2f 01 00 00 jle 1ac <main+0x1ac> 7d: 31 ff xor %edi,%edi 7f: eb 16 jmp 97 <main+0x97> 81: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(set_prio(priority) < 0) printf(1, "set priority error for child erocess\n"); delay(20); exit(); } else if (ret > 0) 88: 7e 53 jle dd <main+0xdd> { pids[i] = ret; 8a: 8b 55 e4 mov -0x1c(%ebp),%edx 8d: 89 04 ba mov %eax,(%edx,%edi,4) for (int i = 0; i < N; i++) 90: 83 c7 01 add $0x1,%edi 93: 39 fe cmp %edi,%esi 95: 74 59 je f0 <main+0xf0> int ret = fork(); 97: e8 ee 03 00 00 call 48a <fork> if (ret == 0) 9c: 83 f8 00 cmp $0x0,%eax 9f: 75 e7 jne 88 <main+0x88> int priority = 10*i + 1 ; a1: 6b d7 0a imul $0xa,%edi,%edx if(set_prio(priority) < 0) a4: 83 ec 0c sub $0xc,%esp int priority = 10*i + 1 ; a7: 83 c2 01 add $0x1,%edx if(set_prio(priority) < 0) aa: 52 push %edx ab: e8 aa 04 00 00 call 55a <set_prio> b0: 83 c4 10 add $0x10,%esp b3: 85 c0 test %eax,%eax b5: 0f 88 db 00 00 00 js 196 <main+0x196> delay(20); bb: 83 ec 0c sub $0xc,%esp be: 6a 14 push $0x14 c0: e8 0b 01 00 00 call 1d0 <delay> exit(); c5: e8 c8 03 00 00 call 492 <exit> printf(1, "test-case <number-of-children>\n"); ca: 53 push %ebx cb: 53 push %ebx cc: 68 d0 09 00 00 push $0x9d0 d1: 6a 01 push $0x1 d3: e8 38 05 00 00 call 610 <printf> exit(); d8: e8 b5 03 00 00 call 492 <exit> } else { printf(1, "fork error \n"); dd: 57 push %edi de: 57 push %edi df: 68 85 09 00 00 push $0x985 e4: 6a 01 push $0x1 e6: e8 25 05 00 00 call 610 <printf> exit(); eb: e8 a2 03 00 00 call 492 <exit> f0: 8b 75 e0 mov -0x20(%ebp),%esi f3: 8d 04 1e lea (%esi,%ebx,1),%eax for (int i = 0; i < N; i++) f6: 89 f3 mov %esi,%ebx f8: 89 45 e0 mov %eax,-0x20(%ebp) fb: 90 nop fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi } } for (int i = 0; i < N; i++) { rets[i] = wait(); 100: e8 95 03 00 00 call 49a <wait> 105: 83 c3 04 add $0x4,%ebx 108: 89 43 fc mov %eax,-0x4(%ebx) for (int i = 0; i < N; i++) 10b: 3b 5d e0 cmp -0x20(%ebp),%ebx 10e: 75 f0 jne 100 <main+0x100> } printf(1, "\nAll children completed\n"); 110: 52 push %edx 111: 52 push %edx 112: 68 92 09 00 00 push $0x992 117: 6a 01 push $0x1 119: e8 f2 04 00 00 call 610 <printf> 11e: 83 c4 10 add $0x10,%esp 121: 31 c0 xor %eax,%eax 123: 90 nop 124: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for (int i = 0; i < N; i++) printf(1, "Child %d. pid %d\n", i, pids[i]); 128: 8b 4d e4 mov -0x1c(%ebp),%ecx 12b: 89 45 e0 mov %eax,-0x20(%ebp) 12e: ff 34 81 pushl (%ecx,%eax,4) 131: 50 push %eax 132: 68 b9 09 00 00 push $0x9b9 137: 6a 01 push $0x1 139: e8 d2 04 00 00 call 610 <printf> for (int i = 0; i < N; i++) 13e: 8b 45 e0 mov -0x20(%ebp),%eax 141: 83 c4 10 add $0x10,%esp 144: 83 c0 01 add $0x1,%eax 147: 39 f8 cmp %edi,%eax 149: 75 dd jne 128 <main+0x128> printf(1, "\nExit order \n"); 14b: 50 push %eax 14c: 50 push %eax 14d: 68 ab 09 00 00 push $0x9ab 152: 6a 01 push $0x1 154: e8 b7 04 00 00 call 610 <printf> 159: 83 c4 10 add $0x10,%esp 15c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for (int i = 0; i < N; i++) printf(1, "pid %d\n", rets[i]); 160: 83 ec 04 sub $0x4,%esp 163: ff 36 pushl (%esi) 165: 83 c6 04 add $0x4,%esi 168: 68 c6 09 00 00 push $0x9c6 16d: 6a 01 push $0x1 16f: e8 9c 04 00 00 call 610 <printf> for (int i = 0; i < N; i++) 174: 83 c4 10 add $0x10,%esp 177: 39 f3 cmp %esi,%ebx 179: 75 e5 jne 160 <main+0x160> exit(); 17b: e8 12 03 00 00 call 492 <exit> printf(1, "set priority error for parent process\n"); 180: 51 push %ecx 181: 51 push %ecx 182: 68 f0 09 00 00 push $0x9f0 187: 6a 01 push $0x1 189: e8 82 04 00 00 call 610 <printf> 18e: 83 c4 10 add $0x10,%esp 191: e9 c9 fe ff ff jmp 5f <main+0x5f> printf(1, "set priority error for child erocess\n"); 196: 50 push %eax 197: 50 push %eax 198: 68 3c 0a 00 00 push $0xa3c 19d: 6a 01 push $0x1 19f: e8 6c 04 00 00 call 610 <printf> 1a4: 83 c4 10 add $0x10,%esp 1a7: e9 0f ff ff ff jmp bb <main+0xbb> printf(1, "\nAll children completed\n"); 1ac: 51 push %ecx 1ad: 51 push %ecx 1ae: 68 92 09 00 00 push $0x992 1b3: 6a 01 push $0x1 1b5: e8 56 04 00 00 call 610 <printf> printf(1, "\nExit order \n"); 1ba: 5b pop %ebx 1bb: 5e pop %esi 1bc: 68 ab 09 00 00 push $0x9ab 1c1: 6a 01 push $0x1 1c3: e8 48 04 00 00 call 610 <printf> 1c8: 83 c4 10 add $0x10,%esp 1cb: eb ae jmp 17b <main+0x17b> 1cd: 66 90 xchg %ax,%ax 1cf: 90 nop 000001d0 <delay>: { 1d0: 55 push %ebp 1d1: 89 e5 mov %esp,%ebp 1d3: 57 push %edi 1d4: 56 push %esi 1d5: 53 push %ebx 1d6: 83 ec 18 sub $0x18,%esp 1d9: 8b 7d 08 mov 0x8(%ebp),%edi data = (int *)malloc(sizeof(int) * 1024 * 10); 1dc: 68 00 a0 00 00 push $0xa000 1e1: e8 8a 06 00 00 call 870 <malloc> if (data <= 0) 1e6: 83 c4 10 add $0x10,%esp 1e9: 85 c0 test %eax,%eax data = (int *)malloc(sizeof(int) * 1024 * 10); 1eb: 89 c3 mov %eax,%ebx if (data <= 0) 1ed: 75 12 jne 201 <delay+0x31> printf(1, "Error on memory allocation \n"); 1ef: 83 ec 08 sub $0x8,%esp 1f2: 68 68 09 00 00 push $0x968 1f7: 6a 01 push $0x1 1f9: e8 12 04 00 00 call 610 <printf> 1fe: 83 c4 10 add $0x10,%esp for (i = 0; i < count; i++) 201: 31 f6 xor %esi,%esi 203: 85 ff test %edi,%edi 205: 8d 8b 00 a0 00 00 lea 0xa000(%ebx),%ecx 20b: 7e 29 jle 236 <delay+0x66> { 20d: b8 44 16 00 00 mov $0x1644,%eax 212: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 218: 89 da mov %ebx,%edx 21a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi data[j]++; 220: 83 02 01 addl $0x1,(%edx) 223: 83 c2 04 add $0x4,%edx for (j = 0; j < 1024 * 10; j++) 226: 39 ca cmp %ecx,%edx 228: 75 f6 jne 220 <delay+0x50> for (k = 0; k < 5700; k++) 22a: 83 e8 01 sub $0x1,%eax 22d: 75 e9 jne 218 <delay+0x48> for (i = 0; i < count; i++) 22f: 83 c6 01 add $0x1,%esi 232: 39 f7 cmp %esi,%edi 234: 75 d7 jne 20d <delay+0x3d> } 236: 8d 65 f4 lea -0xc(%ebp),%esp 239: 5b pop %ebx 23a: 5e pop %esi 23b: 5f pop %edi 23c: 5d pop %ebp 23d: c3 ret 23e: 66 90 xchg %ax,%ax 00000240 <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, const char *t) { 240: 55 push %ebp 241: 89 e5 mov %esp,%ebp 243: 53 push %ebx 244: 8b 45 08 mov 0x8(%ebp),%eax 247: 8b 4d 0c mov 0xc(%ebp),%ecx char *os; os = s; while((*s++ = *t++) != 0) 24a: 89 c2 mov %eax,%edx 24c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 250: 83 c1 01 add $0x1,%ecx 253: 0f b6 59 ff movzbl -0x1(%ecx),%ebx 257: 83 c2 01 add $0x1,%edx 25a: 84 db test %bl,%bl 25c: 88 5a ff mov %bl,-0x1(%edx) 25f: 75 ef jne 250 <strcpy+0x10> ; return os; } 261: 5b pop %ebx 262: 5d pop %ebp 263: c3 ret 264: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 26a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 00000270 <strcmp>: int strcmp(const char *p, const char *q) { 270: 55 push %ebp 271: 89 e5 mov %esp,%ebp 273: 53 push %ebx 274: 8b 55 08 mov 0x8(%ebp),%edx 277: 8b 4d 0c mov 0xc(%ebp),%ecx while(*p && *p == *q) 27a: 0f b6 02 movzbl (%edx),%eax 27d: 0f b6 19 movzbl (%ecx),%ebx 280: 84 c0 test %al,%al 282: 75 1c jne 2a0 <strcmp+0x30> 284: eb 2a jmp 2b0 <strcmp+0x40> 286: 8d 76 00 lea 0x0(%esi),%esi 289: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi p++, q++; 290: 83 c2 01 add $0x1,%edx while(*p && *p == *q) 293: 0f b6 02 movzbl (%edx),%eax p++, q++; 296: 83 c1 01 add $0x1,%ecx 299: 0f b6 19 movzbl (%ecx),%ebx while(*p && *p == *q) 29c: 84 c0 test %al,%al 29e: 74 10 je 2b0 <strcmp+0x40> 2a0: 38 d8 cmp %bl,%al 2a2: 74 ec je 290 <strcmp+0x20> return (uchar)*p - (uchar)*q; 2a4: 29 d8 sub %ebx,%eax } 2a6: 5b pop %ebx 2a7: 5d pop %ebp 2a8: c3 ret 2a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 2b0: 31 c0 xor %eax,%eax return (uchar)*p - (uchar)*q; 2b2: 29 d8 sub %ebx,%eax } 2b4: 5b pop %ebx 2b5: 5d pop %ebp 2b6: c3 ret 2b7: 89 f6 mov %esi,%esi 2b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 000002c0 <strlen>: uint strlen(const char *s) { 2c0: 55 push %ebp 2c1: 89 e5 mov %esp,%ebp 2c3: 8b 4d 08 mov 0x8(%ebp),%ecx int n; for(n = 0; s[n]; n++) 2c6: 80 39 00 cmpb $0x0,(%ecx) 2c9: 74 15 je 2e0 <strlen+0x20> 2cb: 31 d2 xor %edx,%edx 2cd: 8d 76 00 lea 0x0(%esi),%esi 2d0: 83 c2 01 add $0x1,%edx 2d3: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1) 2d7: 89 d0 mov %edx,%eax 2d9: 75 f5 jne 2d0 <strlen+0x10> ; return n; } 2db: 5d pop %ebp 2dc: c3 ret 2dd: 8d 76 00 lea 0x0(%esi),%esi for(n = 0; s[n]; n++) 2e0: 31 c0 xor %eax,%eax } 2e2: 5d pop %ebp 2e3: c3 ret 2e4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 2ea: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 000002f0 <memset>: void* memset(void *dst, int c, uint n) { 2f0: 55 push %ebp 2f1: 89 e5 mov %esp,%ebp 2f3: 57 push %edi 2f4: 8b 55 08 mov 0x8(%ebp),%edx } static inline void stosb(void *addr, int data, int cnt) { asm volatile("cld; rep stosb" : 2f7: 8b 4d 10 mov 0x10(%ebp),%ecx 2fa: 8b 45 0c mov 0xc(%ebp),%eax 2fd: 89 d7 mov %edx,%edi 2ff: fc cld 300: f3 aa rep stos %al,%es:(%edi) stosb(dst, c, n); return dst; } 302: 89 d0 mov %edx,%eax 304: 5f pop %edi 305: 5d pop %ebp 306: c3 ret 307: 89 f6 mov %esi,%esi 309: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00000310 <strchr>: char* strchr(const char *s, char c) { 310: 55 push %ebp 311: 89 e5 mov %esp,%ebp 313: 53 push %ebx 314: 8b 45 08 mov 0x8(%ebp),%eax 317: 8b 5d 0c mov 0xc(%ebp),%ebx for(; *s; s++) 31a: 0f b6 10 movzbl (%eax),%edx 31d: 84 d2 test %dl,%dl 31f: 74 1d je 33e <strchr+0x2e> if(*s == c) 321: 38 d3 cmp %dl,%bl 323: 89 d9 mov %ebx,%ecx 325: 75 0d jne 334 <strchr+0x24> 327: eb 17 jmp 340 <strchr+0x30> 329: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 330: 38 ca cmp %cl,%dl 332: 74 0c je 340 <strchr+0x30> for(; *s; s++) 334: 83 c0 01 add $0x1,%eax 337: 0f b6 10 movzbl (%eax),%edx 33a: 84 d2 test %dl,%dl 33c: 75 f2 jne 330 <strchr+0x20> return (char*)s; return 0; 33e: 31 c0 xor %eax,%eax } 340: 5b pop %ebx 341: 5d pop %ebp 342: c3 ret 343: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 349: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00000350 <gets>: char* gets(char *buf, int max) { 350: 55 push %ebp 351: 89 e5 mov %esp,%ebp 353: 57 push %edi 354: 56 push %esi 355: 53 push %ebx int i, cc; char c; for(i=0; i+1 < max; ){ 356: 31 f6 xor %esi,%esi 358: 89 f3 mov %esi,%ebx { 35a: 83 ec 1c sub $0x1c,%esp 35d: 8b 7d 08 mov 0x8(%ebp),%edi for(i=0; i+1 < max; ){ 360: eb 2f jmp 391 <gets+0x41> 362: 8d b6 00 00 00 00 lea 0x0(%esi),%esi cc = read(0, &c, 1); 368: 8d 45 e7 lea -0x19(%ebp),%eax 36b: 83 ec 04 sub $0x4,%esp 36e: 6a 01 push $0x1 370: 50 push %eax 371: 6a 00 push $0x0 373: e8 32 01 00 00 call 4aa <read> if(cc < 1) 378: 83 c4 10 add $0x10,%esp 37b: 85 c0 test %eax,%eax 37d: 7e 1c jle 39b <gets+0x4b> break; buf[i++] = c; 37f: 0f b6 45 e7 movzbl -0x19(%ebp),%eax 383: 83 c7 01 add $0x1,%edi 386: 88 47 ff mov %al,-0x1(%edi) if(c == '\n' || c == '\r') 389: 3c 0a cmp $0xa,%al 38b: 74 23 je 3b0 <gets+0x60> 38d: 3c 0d cmp $0xd,%al 38f: 74 1f je 3b0 <gets+0x60> for(i=0; i+1 < max; ){ 391: 83 c3 01 add $0x1,%ebx 394: 3b 5d 0c cmp 0xc(%ebp),%ebx 397: 89 fe mov %edi,%esi 399: 7c cd jl 368 <gets+0x18> 39b: 89 f3 mov %esi,%ebx break; } buf[i] = '\0'; return buf; } 39d: 8b 45 08 mov 0x8(%ebp),%eax buf[i] = '\0'; 3a0: c6 03 00 movb $0x0,(%ebx) } 3a3: 8d 65 f4 lea -0xc(%ebp),%esp 3a6: 5b pop %ebx 3a7: 5e pop %esi 3a8: 5f pop %edi 3a9: 5d pop %ebp 3aa: c3 ret 3ab: 90 nop 3ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 3b0: 8b 75 08 mov 0x8(%ebp),%esi 3b3: 8b 45 08 mov 0x8(%ebp),%eax 3b6: 01 de add %ebx,%esi 3b8: 89 f3 mov %esi,%ebx buf[i] = '\0'; 3ba: c6 03 00 movb $0x0,(%ebx) } 3bd: 8d 65 f4 lea -0xc(%ebp),%esp 3c0: 5b pop %ebx 3c1: 5e pop %esi 3c2: 5f pop %edi 3c3: 5d pop %ebp 3c4: c3 ret 3c5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 3c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 000003d0 <stat>: int stat(const char *n, struct stat *st) { 3d0: 55 push %ebp 3d1: 89 e5 mov %esp,%ebp 3d3: 56 push %esi 3d4: 53 push %ebx int fd; int r; fd = open(n, O_RDONLY); 3d5: 83 ec 08 sub $0x8,%esp 3d8: 6a 00 push $0x0 3da: ff 75 08 pushl 0x8(%ebp) 3dd: e8 f0 00 00 00 call 4d2 <open> if(fd < 0) 3e2: 83 c4 10 add $0x10,%esp 3e5: 85 c0 test %eax,%eax 3e7: 78 27 js 410 <stat+0x40> return -1; r = fstat(fd, st); 3e9: 83 ec 08 sub $0x8,%esp 3ec: ff 75 0c pushl 0xc(%ebp) 3ef: 89 c3 mov %eax,%ebx 3f1: 50 push %eax 3f2: e8 f3 00 00 00 call 4ea <fstat> close(fd); 3f7: 89 1c 24 mov %ebx,(%esp) r = fstat(fd, st); 3fa: 89 c6 mov %eax,%esi close(fd); 3fc: e8 b9 00 00 00 call 4ba <close> return r; 401: 83 c4 10 add $0x10,%esp } 404: 8d 65 f8 lea -0x8(%ebp),%esp 407: 89 f0 mov %esi,%eax 409: 5b pop %ebx 40a: 5e pop %esi 40b: 5d pop %ebp 40c: c3 ret 40d: 8d 76 00 lea 0x0(%esi),%esi return -1; 410: be ff ff ff ff mov $0xffffffff,%esi 415: eb ed jmp 404 <stat+0x34> 417: 89 f6 mov %esi,%esi 419: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00000420 <atoi>: int atoi(const char *s) { 420: 55 push %ebp 421: 89 e5 mov %esp,%ebp 423: 53 push %ebx 424: 8b 4d 08 mov 0x8(%ebp),%ecx int n; n = 0; while('0' <= *s && *s <= '9') 427: 0f be 11 movsbl (%ecx),%edx 42a: 8d 42 d0 lea -0x30(%edx),%eax 42d: 3c 09 cmp $0x9,%al n = 0; 42f: b8 00 00 00 00 mov $0x0,%eax while('0' <= *s && *s <= '9') 434: 77 1f ja 455 <atoi+0x35> 436: 8d 76 00 lea 0x0(%esi),%esi 439: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi n = n*10 + *s++ - '0'; 440: 8d 04 80 lea (%eax,%eax,4),%eax 443: 83 c1 01 add $0x1,%ecx 446: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax while('0' <= *s && *s <= '9') 44a: 0f be 11 movsbl (%ecx),%edx 44d: 8d 5a d0 lea -0x30(%edx),%ebx 450: 80 fb 09 cmp $0x9,%bl 453: 76 eb jbe 440 <atoi+0x20> return n; } 455: 5b pop %ebx 456: 5d pop %ebp 457: c3 ret 458: 90 nop 459: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 00000460 <memmove>: void* memmove(void *vdst, const void *vsrc, int n) { 460: 55 push %ebp 461: 89 e5 mov %esp,%ebp 463: 56 push %esi 464: 53 push %ebx 465: 8b 5d 10 mov 0x10(%ebp),%ebx 468: 8b 45 08 mov 0x8(%ebp),%eax 46b: 8b 75 0c mov 0xc(%ebp),%esi char *dst; const char *src; dst = vdst; src = vsrc; while(n-- > 0) 46e: 85 db test %ebx,%ebx 470: 7e 14 jle 486 <memmove+0x26> 472: 31 d2 xor %edx,%edx 474: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi *dst++ = *src++; 478: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx 47c: 88 0c 10 mov %cl,(%eax,%edx,1) 47f: 83 c2 01 add $0x1,%edx while(n-- > 0) 482: 39 d3 cmp %edx,%ebx 484: 75 f2 jne 478 <memmove+0x18> return vdst; } 486: 5b pop %ebx 487: 5e pop %esi 488: 5d pop %ebp 489: c3 ret 0000048a <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 48a: b8 01 00 00 00 mov $0x1,%eax 48f: cd 40 int $0x40 491: c3 ret 00000492 <exit>: SYSCALL(exit) 492: b8 02 00 00 00 mov $0x2,%eax 497: cd 40 int $0x40 499: c3 ret 0000049a <wait>: SYSCALL(wait) 49a: b8 03 00 00 00 mov $0x3,%eax 49f: cd 40 int $0x40 4a1: c3 ret 000004a2 <pipe>: SYSCALL(pipe) 4a2: b8 04 00 00 00 mov $0x4,%eax 4a7: cd 40 int $0x40 4a9: c3 ret 000004aa <read>: SYSCALL(read) 4aa: b8 05 00 00 00 mov $0x5,%eax 4af: cd 40 int $0x40 4b1: c3 ret 000004b2 <write>: SYSCALL(write) 4b2: b8 10 00 00 00 mov $0x10,%eax 4b7: cd 40 int $0x40 4b9: c3 ret 000004ba <close>: SYSCALL(close) 4ba: b8 15 00 00 00 mov $0x15,%eax 4bf: cd 40 int $0x40 4c1: c3 ret 000004c2 <kill>: SYSCALL(kill) 4c2: b8 06 00 00 00 mov $0x6,%eax 4c7: cd 40 int $0x40 4c9: c3 ret 000004ca <exec>: SYSCALL(exec) 4ca: b8 07 00 00 00 mov $0x7,%eax 4cf: cd 40 int $0x40 4d1: c3 ret 000004d2 <open>: SYSCALL(open) 4d2: b8 0f 00 00 00 mov $0xf,%eax 4d7: cd 40 int $0x40 4d9: c3 ret 000004da <mknod>: SYSCALL(mknod) 4da: b8 11 00 00 00 mov $0x11,%eax 4df: cd 40 int $0x40 4e1: c3 ret 000004e2 <unlink>: SYSCALL(unlink) 4e2: b8 12 00 00 00 mov $0x12,%eax 4e7: cd 40 int $0x40 4e9: c3 ret 000004ea <fstat>: SYSCALL(fstat) 4ea: b8 08 00 00 00 mov $0x8,%eax 4ef: cd 40 int $0x40 4f1: c3 ret 000004f2 <link>: SYSCALL(link) 4f2: b8 13 00 00 00 mov $0x13,%eax 4f7: cd 40 int $0x40 4f9: c3 ret 000004fa <mkdir>: SYSCALL(mkdir) 4fa: b8 14 00 00 00 mov $0x14,%eax 4ff: cd 40 int $0x40 501: c3 ret 00000502 <chdir>: SYSCALL(chdir) 502: b8 09 00 00 00 mov $0x9,%eax 507: cd 40 int $0x40 509: c3 ret 0000050a <dup>: SYSCALL(dup) 50a: b8 0a 00 00 00 mov $0xa,%eax 50f: cd 40 int $0x40 511: c3 ret 00000512 <getpid>: SYSCALL(getpid) 512: b8 0b 00 00 00 mov $0xb,%eax 517: cd 40 int $0x40 519: c3 ret 0000051a <sbrk>: SYSCALL(sbrk) 51a: b8 0c 00 00 00 mov $0xc,%eax 51f: cd 40 int $0x40 521: c3 ret 00000522 <sleep>: SYSCALL(sleep) 522: b8 0d 00 00 00 mov $0xd,%eax 527: cd 40 int $0x40 529: c3 ret 0000052a <uptime>: SYSCALL(uptime) 52a: b8 0e 00 00 00 mov $0xe,%eax 52f: cd 40 int $0x40 531: c3 ret 00000532 <hello>: SYSCALL(hello) 532: b8 16 00 00 00 mov $0x16,%eax 537: cd 40 int $0x40 539: c3 ret 0000053a <hello_name>: SYSCALL(hello_name) 53a: b8 17 00 00 00 mov $0x17,%eax 53f: cd 40 int $0x40 541: c3 ret 00000542 <get_num_proc>: SYSCALL(get_num_proc) 542: b8 18 00 00 00 mov $0x18,%eax 547: cd 40 int $0x40 549: c3 ret 0000054a <get_max_pid>: SYSCALL(get_max_pid) 54a: b8 19 00 00 00 mov $0x19,%eax 54f: cd 40 int $0x40 551: c3 ret 00000552 <get_proc_info>: SYSCALL(get_proc_info) 552: b8 1a 00 00 00 mov $0x1a,%eax 557: cd 40 int $0x40 559: c3 ret 0000055a <set_prio>: SYSCALL(set_prio) 55a: b8 1b 00 00 00 mov $0x1b,%eax 55f: cd 40 int $0x40 561: c3 ret 00000562 <get_prio>: SYSCALL(get_prio) 562: b8 1c 00 00 00 mov $0x1c,%eax 567: cd 40 int $0x40 569: c3 ret 56a: 66 90 xchg %ax,%ax 56c: 66 90 xchg %ax,%ax 56e: 66 90 xchg %ax,%ax 00000570 <printint>: write(fd, &c, 1); } static void printint(int fd, int xx, int base, int sgn) { 570: 55 push %ebp 571: 89 e5 mov %esp,%ebp 573: 57 push %edi 574: 56 push %esi 575: 53 push %ebx 576: 83 ec 3c sub $0x3c,%esp char buf[16]; int i, neg; uint x; neg = 0; if(sgn && xx < 0){ 579: 85 d2 test %edx,%edx { 57b: 89 45 c0 mov %eax,-0x40(%ebp) neg = 1; x = -xx; 57e: 89 d0 mov %edx,%eax if(sgn && xx < 0){ 580: 79 76 jns 5f8 <printint+0x88> 582: f6 45 08 01 testb $0x1,0x8(%ebp) 586: 74 70 je 5f8 <printint+0x88> x = -xx; 588: f7 d8 neg %eax neg = 1; 58a: c7 45 c4 01 00 00 00 movl $0x1,-0x3c(%ebp) } else { x = xx; } i = 0; 591: 31 f6 xor %esi,%esi 593: 8d 5d d7 lea -0x29(%ebp),%ebx 596: eb 0a jmp 5a2 <printint+0x32> 598: 90 nop 599: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi do{ buf[i++] = digits[x % base]; 5a0: 89 fe mov %edi,%esi 5a2: 31 d2 xor %edx,%edx 5a4: 8d 7e 01 lea 0x1(%esi),%edi 5a7: f7 f1 div %ecx 5a9: 0f b6 92 6c 0a 00 00 movzbl 0xa6c(%edx),%edx }while((x /= base) != 0); 5b0: 85 c0 test %eax,%eax buf[i++] = digits[x % base]; 5b2: 88 14 3b mov %dl,(%ebx,%edi,1) }while((x /= base) != 0); 5b5: 75 e9 jne 5a0 <printint+0x30> if(neg) 5b7: 8b 45 c4 mov -0x3c(%ebp),%eax 5ba: 85 c0 test %eax,%eax 5bc: 74 08 je 5c6 <printint+0x56> buf[i++] = '-'; 5be: c6 44 3d d8 2d movb $0x2d,-0x28(%ebp,%edi,1) 5c3: 8d 7e 02 lea 0x2(%esi),%edi 5c6: 8d 74 3d d7 lea -0x29(%ebp,%edi,1),%esi 5ca: 8b 7d c0 mov -0x40(%ebp),%edi 5cd: 8d 76 00 lea 0x0(%esi),%esi 5d0: 0f b6 06 movzbl (%esi),%eax write(fd, &c, 1); 5d3: 83 ec 04 sub $0x4,%esp 5d6: 83 ee 01 sub $0x1,%esi 5d9: 6a 01 push $0x1 5db: 53 push %ebx 5dc: 57 push %edi 5dd: 88 45 d7 mov %al,-0x29(%ebp) 5e0: e8 cd fe ff ff call 4b2 <write> while(--i >= 0) 5e5: 83 c4 10 add $0x10,%esp 5e8: 39 de cmp %ebx,%esi 5ea: 75 e4 jne 5d0 <printint+0x60> putc(fd, buf[i]); } 5ec: 8d 65 f4 lea -0xc(%ebp),%esp 5ef: 5b pop %ebx 5f0: 5e pop %esi 5f1: 5f pop %edi 5f2: 5d pop %ebp 5f3: c3 ret 5f4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi neg = 0; 5f8: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp) 5ff: eb 90 jmp 591 <printint+0x21> 601: eb 0d jmp 610 <printf> 603: 90 nop 604: 90 nop 605: 90 nop 606: 90 nop 607: 90 nop 608: 90 nop 609: 90 nop 60a: 90 nop 60b: 90 nop 60c: 90 nop 60d: 90 nop 60e: 90 nop 60f: 90 nop 00000610 <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, const char *fmt, ...) { 610: 55 push %ebp 611: 89 e5 mov %esp,%ebp 613: 57 push %edi 614: 56 push %esi 615: 53 push %ebx 616: 83 ec 2c sub $0x2c,%esp int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 619: 8b 75 0c mov 0xc(%ebp),%esi 61c: 0f b6 1e movzbl (%esi),%ebx 61f: 84 db test %bl,%bl 621: 0f 84 b3 00 00 00 je 6da <printf+0xca> ap = (uint*)(void*)&fmt + 1; 627: 8d 45 10 lea 0x10(%ebp),%eax 62a: 83 c6 01 add $0x1,%esi state = 0; 62d: 31 ff xor %edi,%edi ap = (uint*)(void*)&fmt + 1; 62f: 89 45 d4 mov %eax,-0x2c(%ebp) 632: eb 2f jmp 663 <printf+0x53> 634: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi c = fmt[i] & 0xff; if(state == 0){ if(c == '%'){ 638: 83 f8 25 cmp $0x25,%eax 63b: 0f 84 a7 00 00 00 je 6e8 <printf+0xd8> write(fd, &c, 1); 641: 8d 45 e2 lea -0x1e(%ebp),%eax 644: 83 ec 04 sub $0x4,%esp 647: 88 5d e2 mov %bl,-0x1e(%ebp) 64a: 6a 01 push $0x1 64c: 50 push %eax 64d: ff 75 08 pushl 0x8(%ebp) 650: e8 5d fe ff ff call 4b2 <write> 655: 83 c4 10 add $0x10,%esp 658: 83 c6 01 add $0x1,%esi for(i = 0; fmt[i]; i++){ 65b: 0f b6 5e ff movzbl -0x1(%esi),%ebx 65f: 84 db test %bl,%bl 661: 74 77 je 6da <printf+0xca> if(state == 0){ 663: 85 ff test %edi,%edi c = fmt[i] & 0xff; 665: 0f be cb movsbl %bl,%ecx 668: 0f b6 c3 movzbl %bl,%eax if(state == 0){ 66b: 74 cb je 638 <printf+0x28> state = '%'; } else { putc(fd, c); } } else if(state == '%'){ 66d: 83 ff 25 cmp $0x25,%edi 670: 75 e6 jne 658 <printf+0x48> if(c == 'd'){ 672: 83 f8 64 cmp $0x64,%eax 675: 0f 84 05 01 00 00 je 780 <printf+0x170> printint(fd, *ap, 10, 1); ap++; } else if(c == 'x' || c == 'p'){ 67b: 81 e1 f7 00 00 00 and $0xf7,%ecx 681: 83 f9 70 cmp $0x70,%ecx 684: 74 72 je 6f8 <printf+0xe8> printint(fd, *ap, 16, 0); ap++; } else if(c == 's'){ 686: 83 f8 73 cmp $0x73,%eax 689: 0f 84 99 00 00 00 je 728 <printf+0x118> s = "(null)"; while(*s != 0){ putc(fd, *s); s++; } } else if(c == 'c'){ 68f: 83 f8 63 cmp $0x63,%eax 692: 0f 84 08 01 00 00 je 7a0 <printf+0x190> putc(fd, *ap); ap++; } else if(c == '%'){ 698: 83 f8 25 cmp $0x25,%eax 69b: 0f 84 ef 00 00 00 je 790 <printf+0x180> write(fd, &c, 1); 6a1: 8d 45 e7 lea -0x19(%ebp),%eax 6a4: 83 ec 04 sub $0x4,%esp 6a7: c6 45 e7 25 movb $0x25,-0x19(%ebp) 6ab: 6a 01 push $0x1 6ad: 50 push %eax 6ae: ff 75 08 pushl 0x8(%ebp) 6b1: e8 fc fd ff ff call 4b2 <write> 6b6: 83 c4 0c add $0xc,%esp 6b9: 8d 45 e6 lea -0x1a(%ebp),%eax 6bc: 88 5d e6 mov %bl,-0x1a(%ebp) 6bf: 6a 01 push $0x1 6c1: 50 push %eax 6c2: ff 75 08 pushl 0x8(%ebp) 6c5: 83 c6 01 add $0x1,%esi } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); putc(fd, c); } state = 0; 6c8: 31 ff xor %edi,%edi write(fd, &c, 1); 6ca: e8 e3 fd ff ff call 4b2 <write> for(i = 0; fmt[i]; i++){ 6cf: 0f b6 5e ff movzbl -0x1(%esi),%ebx write(fd, &c, 1); 6d3: 83 c4 10 add $0x10,%esp for(i = 0; fmt[i]; i++){ 6d6: 84 db test %bl,%bl 6d8: 75 89 jne 663 <printf+0x53> } } } 6da: 8d 65 f4 lea -0xc(%ebp),%esp 6dd: 5b pop %ebx 6de: 5e pop %esi 6df: 5f pop %edi 6e0: 5d pop %ebp 6e1: c3 ret 6e2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi state = '%'; 6e8: bf 25 00 00 00 mov $0x25,%edi 6ed: e9 66 ff ff ff jmp 658 <printf+0x48> 6f2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi printint(fd, *ap, 16, 0); 6f8: 83 ec 0c sub $0xc,%esp 6fb: b9 10 00 00 00 mov $0x10,%ecx 700: 6a 00 push $0x0 702: 8b 7d d4 mov -0x2c(%ebp),%edi 705: 8b 45 08 mov 0x8(%ebp),%eax 708: 8b 17 mov (%edi),%edx 70a: e8 61 fe ff ff call 570 <printint> ap++; 70f: 89 f8 mov %edi,%eax 711: 83 c4 10 add $0x10,%esp state = 0; 714: 31 ff xor %edi,%edi ap++; 716: 83 c0 04 add $0x4,%eax 719: 89 45 d4 mov %eax,-0x2c(%ebp) 71c: e9 37 ff ff ff jmp 658 <printf+0x48> 721: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi s = (char*)*ap; 728: 8b 45 d4 mov -0x2c(%ebp),%eax 72b: 8b 08 mov (%eax),%ecx ap++; 72d: 83 c0 04 add $0x4,%eax 730: 89 45 d4 mov %eax,-0x2c(%ebp) if(s == 0) 733: 85 c9 test %ecx,%ecx 735: 0f 84 8e 00 00 00 je 7c9 <printf+0x1b9> while(*s != 0){ 73b: 0f b6 01 movzbl (%ecx),%eax state = 0; 73e: 31 ff xor %edi,%edi s = (char*)*ap; 740: 89 cb mov %ecx,%ebx while(*s != 0){ 742: 84 c0 test %al,%al 744: 0f 84 0e ff ff ff je 658 <printf+0x48> 74a: 89 75 d0 mov %esi,-0x30(%ebp) 74d: 89 de mov %ebx,%esi 74f: 8b 5d 08 mov 0x8(%ebp),%ebx 752: 8d 7d e3 lea -0x1d(%ebp),%edi 755: 8d 76 00 lea 0x0(%esi),%esi write(fd, &c, 1); 758: 83 ec 04 sub $0x4,%esp s++; 75b: 83 c6 01 add $0x1,%esi 75e: 88 45 e3 mov %al,-0x1d(%ebp) write(fd, &c, 1); 761: 6a 01 push $0x1 763: 57 push %edi 764: 53 push %ebx 765: e8 48 fd ff ff call 4b2 <write> while(*s != 0){ 76a: 0f b6 06 movzbl (%esi),%eax 76d: 83 c4 10 add $0x10,%esp 770: 84 c0 test %al,%al 772: 75 e4 jne 758 <printf+0x148> 774: 8b 75 d0 mov -0x30(%ebp),%esi state = 0; 777: 31 ff xor %edi,%edi 779: e9 da fe ff ff jmp 658 <printf+0x48> 77e: 66 90 xchg %ax,%ax printint(fd, *ap, 10, 1); 780: 83 ec 0c sub $0xc,%esp 783: b9 0a 00 00 00 mov $0xa,%ecx 788: 6a 01 push $0x1 78a: e9 73 ff ff ff jmp 702 <printf+0xf2> 78f: 90 nop write(fd, &c, 1); 790: 83 ec 04 sub $0x4,%esp 793: 88 5d e5 mov %bl,-0x1b(%ebp) 796: 8d 45 e5 lea -0x1b(%ebp),%eax 799: 6a 01 push $0x1 79b: e9 21 ff ff ff jmp 6c1 <printf+0xb1> putc(fd, *ap); 7a0: 8b 7d d4 mov -0x2c(%ebp),%edi write(fd, &c, 1); 7a3: 83 ec 04 sub $0x4,%esp putc(fd, *ap); 7a6: 8b 07 mov (%edi),%eax write(fd, &c, 1); 7a8: 6a 01 push $0x1 ap++; 7aa: 83 c7 04 add $0x4,%edi putc(fd, *ap); 7ad: 88 45 e4 mov %al,-0x1c(%ebp) write(fd, &c, 1); 7b0: 8d 45 e4 lea -0x1c(%ebp),%eax 7b3: 50 push %eax 7b4: ff 75 08 pushl 0x8(%ebp) 7b7: e8 f6 fc ff ff call 4b2 <write> ap++; 7bc: 89 7d d4 mov %edi,-0x2c(%ebp) 7bf: 83 c4 10 add $0x10,%esp state = 0; 7c2: 31 ff xor %edi,%edi 7c4: e9 8f fe ff ff jmp 658 <printf+0x48> s = "(null)"; 7c9: bb 64 0a 00 00 mov $0xa64,%ebx while(*s != 0){ 7ce: b8 28 00 00 00 mov $0x28,%eax 7d3: e9 72 ff ff ff jmp 74a <printf+0x13a> 7d8: 66 90 xchg %ax,%ax 7da: 66 90 xchg %ax,%ax 7dc: 66 90 xchg %ax,%ax 7de: 66 90 xchg %ax,%ax 000007e0 <free>: static Header base; static Header *freep; void free(void *ap) { 7e0: 55 push %ebp Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 7e1: a1 48 0d 00 00 mov 0xd48,%eax { 7e6: 89 e5 mov %esp,%ebp 7e8: 57 push %edi 7e9: 56 push %esi 7ea: 53 push %ebx 7eb: 8b 5d 08 mov 0x8(%ebp),%ebx bp = (Header*)ap - 1; 7ee: 8d 4b f8 lea -0x8(%ebx),%ecx 7f1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 7f8: 39 c8 cmp %ecx,%eax 7fa: 8b 10 mov (%eax),%edx 7fc: 73 32 jae 830 <free+0x50> 7fe: 39 d1 cmp %edx,%ecx 800: 72 04 jb 806 <free+0x26> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 802: 39 d0 cmp %edx,%eax 804: 72 32 jb 838 <free+0x58> break; if(bp + bp->s.size == p->s.ptr){ 806: 8b 73 fc mov -0x4(%ebx),%esi 809: 8d 3c f1 lea (%ecx,%esi,8),%edi 80c: 39 fa cmp %edi,%edx 80e: 74 30 je 840 <free+0x60> bp->s.size += p->s.ptr->s.size; bp->s.ptr = p->s.ptr->s.ptr; } else bp->s.ptr = p->s.ptr; 810: 89 53 f8 mov %edx,-0x8(%ebx) if(p + p->s.size == bp){ 813: 8b 50 04 mov 0x4(%eax),%edx 816: 8d 34 d0 lea (%eax,%edx,8),%esi 819: 39 f1 cmp %esi,%ecx 81b: 74 3a je 857 <free+0x77> p->s.size += bp->s.size; p->s.ptr = bp->s.ptr; } else p->s.ptr = bp; 81d: 89 08 mov %ecx,(%eax) freep = p; 81f: a3 48 0d 00 00 mov %eax,0xd48 } 824: 5b pop %ebx 825: 5e pop %esi 826: 5f pop %edi 827: 5d pop %ebp 828: c3 ret 829: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 830: 39 d0 cmp %edx,%eax 832: 72 04 jb 838 <free+0x58> 834: 39 d1 cmp %edx,%ecx 836: 72 ce jb 806 <free+0x26> { 838: 89 d0 mov %edx,%eax 83a: eb bc jmp 7f8 <free+0x18> 83c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi bp->s.size += p->s.ptr->s.size; 840: 03 72 04 add 0x4(%edx),%esi 843: 89 73 fc mov %esi,-0x4(%ebx) bp->s.ptr = p->s.ptr->s.ptr; 846: 8b 10 mov (%eax),%edx 848: 8b 12 mov (%edx),%edx 84a: 89 53 f8 mov %edx,-0x8(%ebx) if(p + p->s.size == bp){ 84d: 8b 50 04 mov 0x4(%eax),%edx 850: 8d 34 d0 lea (%eax,%edx,8),%esi 853: 39 f1 cmp %esi,%ecx 855: 75 c6 jne 81d <free+0x3d> p->s.size += bp->s.size; 857: 03 53 fc add -0x4(%ebx),%edx freep = p; 85a: a3 48 0d 00 00 mov %eax,0xd48 p->s.size += bp->s.size; 85f: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 862: 8b 53 f8 mov -0x8(%ebx),%edx 865: 89 10 mov %edx,(%eax) } 867: 5b pop %ebx 868: 5e pop %esi 869: 5f pop %edi 86a: 5d pop %ebp 86b: c3 ret 86c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 00000870 <malloc>: return freep; } void* malloc(uint nbytes) { 870: 55 push %ebp 871: 89 e5 mov %esp,%ebp 873: 57 push %edi 874: 56 push %esi 875: 53 push %ebx 876: 83 ec 0c sub $0xc,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 879: 8b 45 08 mov 0x8(%ebp),%eax if((prevp = freep) == 0){ 87c: 8b 15 48 0d 00 00 mov 0xd48,%edx nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 882: 8d 78 07 lea 0x7(%eax),%edi 885: c1 ef 03 shr $0x3,%edi 888: 83 c7 01 add $0x1,%edi if((prevp = freep) == 0){ 88b: 85 d2 test %edx,%edx 88d: 0f 84 9d 00 00 00 je 930 <malloc+0xc0> 893: 8b 02 mov (%edx),%eax 895: 8b 48 04 mov 0x4(%eax),%ecx base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ if(p->s.size >= nunits){ 898: 39 cf cmp %ecx,%edi 89a: 76 6c jbe 908 <malloc+0x98> 89c: 81 ff 00 10 00 00 cmp $0x1000,%edi 8a2: bb 00 10 00 00 mov $0x1000,%ebx 8a7: 0f 43 df cmovae %edi,%ebx p = sbrk(nu * sizeof(Header)); 8aa: 8d 34 dd 00 00 00 00 lea 0x0(,%ebx,8),%esi 8b1: eb 0e jmp 8c1 <malloc+0x51> 8b3: 90 nop 8b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 8b8: 8b 02 mov (%edx),%eax if(p->s.size >= nunits){ 8ba: 8b 48 04 mov 0x4(%eax),%ecx 8bd: 39 f9 cmp %edi,%ecx 8bf: 73 47 jae 908 <malloc+0x98> p->s.size = nunits; } freep = prevp; return (void*)(p + 1); } if(p == freep) 8c1: 39 05 48 0d 00 00 cmp %eax,0xd48 8c7: 89 c2 mov %eax,%edx 8c9: 75 ed jne 8b8 <malloc+0x48> p = sbrk(nu * sizeof(Header)); 8cb: 83 ec 0c sub $0xc,%esp 8ce: 56 push %esi 8cf: e8 46 fc ff ff call 51a <sbrk> if(p == (char*)-1) 8d4: 83 c4 10 add $0x10,%esp 8d7: 83 f8 ff cmp $0xffffffff,%eax 8da: 74 1c je 8f8 <malloc+0x88> hp->s.size = nu; 8dc: 89 58 04 mov %ebx,0x4(%eax) free((void*)(hp + 1)); 8df: 83 ec 0c sub $0xc,%esp 8e2: 83 c0 08 add $0x8,%eax 8e5: 50 push %eax 8e6: e8 f5 fe ff ff call 7e0 <free> return freep; 8eb: 8b 15 48 0d 00 00 mov 0xd48,%edx if((p = morecore(nunits)) == 0) 8f1: 83 c4 10 add $0x10,%esp 8f4: 85 d2 test %edx,%edx 8f6: 75 c0 jne 8b8 <malloc+0x48> return 0; } } 8f8: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 8fb: 31 c0 xor %eax,%eax } 8fd: 5b pop %ebx 8fe: 5e pop %esi 8ff: 5f pop %edi 900: 5d pop %ebp 901: c3 ret 902: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(p->s.size == nunits) 908: 39 cf cmp %ecx,%edi 90a: 74 54 je 960 <malloc+0xf0> p->s.size -= nunits; 90c: 29 f9 sub %edi,%ecx 90e: 89 48 04 mov %ecx,0x4(%eax) p += p->s.size; 911: 8d 04 c8 lea (%eax,%ecx,8),%eax p->s.size = nunits; 914: 89 78 04 mov %edi,0x4(%eax) freep = prevp; 917: 89 15 48 0d 00 00 mov %edx,0xd48 } 91d: 8d 65 f4 lea -0xc(%ebp),%esp return (void*)(p + 1); 920: 83 c0 08 add $0x8,%eax } 923: 5b pop %ebx 924: 5e pop %esi 925: 5f pop %edi 926: 5d pop %ebp 927: c3 ret 928: 90 nop 929: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi base.s.ptr = freep = prevp = &base; 930: c7 05 48 0d 00 00 4c movl $0xd4c,0xd48 937: 0d 00 00 93a: c7 05 4c 0d 00 00 4c movl $0xd4c,0xd4c 941: 0d 00 00 base.s.size = 0; 944: b8 4c 0d 00 00 mov $0xd4c,%eax 949: c7 05 50 0d 00 00 00 movl $0x0,0xd50 950: 00 00 00 953: e9 44 ff ff ff jmp 89c <malloc+0x2c> 958: 90 nop 959: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi prevp->s.ptr = p->s.ptr; 960: 8b 08 mov (%eax),%ecx 962: 89 0a mov %ecx,(%edx) 964: eb b1 jmp 917 <malloc+0xa7>
out/min4.adb
FardaleM/metalang
22
20367
<reponame>FardaleM/metalang<gh_stars>10-100 with ada.text_io, ada.Integer_text_IO, Ada.Text_IO.Text_Streams, Ada.Strings.Fixed, Interfaces.C; use ada.text_io, ada.Integer_text_IO, Ada.Strings, Ada.Strings.Fixed, Interfaces.C; procedure min4 is type stringptr is access all char_array; procedure PString(s : stringptr) is begin String'Write (Text_Streams.Stream (Current_Output), To_Ada(s.all)); end; procedure PInt(i : in Integer) is begin String'Write (Text_Streams.Stream (Current_Output), Trim(Integer'Image(i), Left)); end; function min2_0(a : in Integer; b : in Integer) return Integer is begin if a < b then return a; else return b; end if; end; begin PInt(min2_0(min2_0(min2_0(1, 2), 3), 4)); PString(new char_array'( To_C(" "))); PInt(min2_0(min2_0(min2_0(1, 2), 4), 3)); PString(new char_array'( To_C(" "))); PInt(min2_0(min2_0(min2_0(1, 3), 2), 4)); PString(new char_array'( To_C(" "))); PInt(min2_0(min2_0(min2_0(1, 3), 4), 2)); PString(new char_array'( To_C(" "))); PInt(min2_0(min2_0(min2_0(1, 4), 2), 3)); PString(new char_array'( To_C(" "))); PInt(min2_0(min2_0(min2_0(1, 4), 3), 2)); PString(new char_array'( To_C("" & Character'Val(10)))); PInt(min2_0(min2_0(min2_0(2, 1), 3), 4)); PString(new char_array'( To_C(" "))); PInt(min2_0(min2_0(min2_0(2, 1), 4), 3)); PString(new char_array'( To_C(" "))); PInt(min2_0(min2_0(min2_0(2, 3), 1), 4)); PString(new char_array'( To_C(" "))); PInt(min2_0(min2_0(min2_0(2, 3), 4), 1)); PString(new char_array'( To_C(" "))); PInt(min2_0(min2_0(min2_0(2, 4), 1), 3)); PString(new char_array'( To_C(" "))); PInt(min2_0(min2_0(min2_0(2, 4), 3), 1)); PString(new char_array'( To_C("" & Character'Val(10)))); PInt(min2_0(min2_0(min2_0(3, 1), 2), 4)); PString(new char_array'( To_C(" "))); PInt(min2_0(min2_0(min2_0(3, 1), 4), 2)); PString(new char_array'( To_C(" "))); PInt(min2_0(min2_0(min2_0(3, 2), 1), 4)); PString(new char_array'( To_C(" "))); PInt(min2_0(min2_0(min2_0(3, 2), 4), 1)); PString(new char_array'( To_C(" "))); PInt(min2_0(min2_0(min2_0(3, 4), 1), 2)); PString(new char_array'( To_C(" "))); PInt(min2_0(min2_0(min2_0(3, 4), 2), 1)); PString(new char_array'( To_C("" & Character'Val(10)))); PInt(min2_0(min2_0(min2_0(4, 1), 2), 3)); PString(new char_array'( To_C(" "))); PInt(min2_0(min2_0(min2_0(4, 1), 3), 2)); PString(new char_array'( To_C(" "))); PInt(min2_0(min2_0(min2_0(4, 2), 1), 3)); PString(new char_array'( To_C(" "))); PInt(min2_0(min2_0(min2_0(4, 2), 3), 1)); PString(new char_array'( To_C(" "))); PInt(min2_0(min2_0(min2_0(4, 3), 1), 2)); PString(new char_array'( To_C(" "))); PInt(min2_0(min2_0(min2_0(4, 3), 2), 1)); PString(new char_array'( To_C("" & Character'Val(10)))); end;
univac/src/grammar/smalltalk/Smalltalk.g4
rickerd/univac
0
2557
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ grammar Smalltalk; script : sequence ws EOF; sequence : temps? ws statements? ws; ws : (SEPARATOR | COMMENT)*; temps : ws PIPE (ws IDENTIFIER)+ ws PIPE; statements : answer ws # StatementAnswer | expressions ws PERIOD ws answer # StatementExpressionsAnswer | expressions PERIOD? ws # StatementExpressions ; answer : CARROT ws expression ws PERIOD?; expression : assignment | cascade | keywordSend | binarySend | primitive; expressions : expression expressionList*; expressionList : PERIOD ws expression; cascade : (keywordSend | binarySend) (ws SEMI_COLON ws message)+; message : binaryMessage | unaryMessage | keywordMessage; assignment : variable ws ASSIGNMENT ws expression; variable : IDENTIFIER; binarySend : unarySend binaryTail?; unarySend : operand ws unaryTail?; keywordSend : binarySend keywordMessage; keywordMessage : ws (keywordPair ws)+; keywordPair : KEYWORD ws binarySend ws; operand : literal | reference | subexpression; subexpression : OPEN_PAREN ws expression ws CLOSE_PAREN; literal : runtimeLiteral | parsetimeLiteral; runtimeLiteral : dynamicDictionary | dynamicArray | block; block : BLOCK_START blockParamList? ws (PIPE ws)? sequence BLOCK_END; blockParamList : (ws BLOCK_PARAM)+; dynamicDictionary : DYNDICT_START ws expressions? ws DYNARR_END; dynamicArray : DYNARR_START ws expressions? ws DYNARR_END; parsetimeLiteral : charConstant | pseudoVariable | number | literalArray | string | symbol; number : numberExp | hex | stFloat | stInteger; numberExp : (stFloat | stInteger) EXP stInteger; charConstant : CHARACTER_CONSTANT; hex : MINUS? HEX HEXDIGIT+; stInteger : MINUS? DIGIT+; stFloat : MINUS? DIGIT+ PERIOD DIGIT+; pseudoVariable : RESERVED_WORD; string : STRING; symbol : HASH bareSymbol; primitive : LT ws KEYWORD ws DIGIT+ ws GT; bareSymbol : (IDENTIFIER | BINARY_SELECTOR) | KEYWORD+ | string | PIPE+; literalArray : LITARR_START literalArrayRest; literalArrayRest : (ws (parsetimeLiteral | bareLiteralArray | bareSymbol))* ws CLOSE_PAREN; bareLiteralArray : OPEN_PAREN literalArrayRest; unaryTail : unaryMessage ws unaryTail? ws; unaryMessage : ws unarySelector; unarySelector : IDENTIFIER; keywords : KEYWORD+; reference : variable; binaryTail : binaryMessage binaryTail?; binaryMessage : ws BINARY_SELECTOR ws (unarySend | operand); SEPARATOR : [ \t\r\n]; STRING : '\'' (.)*? '\''; COMMENT : '"' (.)*? '"'; BLOCK_START : '['; BLOCK_END : ']'; CLOSE_PAREN : ')'; OPEN_PAREN : '('; PIPE : '|'; PERIOD : '.'; SEMI_COLON : ';'; BINARY_SELECTOR : ('\\' | '+' | '*' | '/' | '=' | '>' | '<' | ',' | '@' | '%' | '~' | PIPE | '&' | '-' | '?')+; LT : '<'; GT : '>'; MINUS : '-'; RESERVED_WORD : 'nil' | 'true' | 'false' | 'self' | 'super'; IDENTIFIER : [a-zA-Z]+[a-zA-Z0-9_]*; CARROT : '^'; COLON : ':'; ASSIGNMENT : ':='; HASH : '#'; DOLLAR : '$'; EXP : 'e'; HEX : '16r'; LITARR_START : '#('; DYNDICT_START : '#{'; DYNARR_END : '}'; DYNARR_START : '{'; DIGIT : [0-9]; HEXDIGIT : [0-9a-fA-F]; KEYWORD : IDENTIFIER COLON; BLOCK_PARAM : COLON IDENTIFIER; CHARACTER_CONSTANT : DOLLAR .;
bootloader/startup.asm
DKrepsky/CC3200-Bootloader
1
242489
<reponame>DKrepsky/CC3200-Bootloader /* * The MIT License (MIT) * * Copyright (c) 2015 <NAME> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /*! * \file startup.asm * * \brief Startup file for the bootloader. * * This file contains the interrupt vector table, the function to relocate the * bootloader in the SRAM and the function to run and image from another * position in memory. * * Version: 1.0.2 * * Author: <NAME> */ /*! * \def INITIAL_POS 0x20004000 * * \brief Bootloader image initial position. * * Initial position of the image. By default the TI bootloader will load the * binary file to 0x20004000. */ .set INITIAL_POS, 0x20004000 /*! * \def RELOCATED_POS 0x20000000 * * \brief Bootloader final position. * * Position of the bootloader after the relocation process. */ .set RELOCATED_POS, 0x20000000 /* * Bootloader external main function. */ .extern main /* * External BOOTRun function. */ .extern BOOTRun /*! * \brief Interrupt vector * * Interrupt vector with only the SP and the ResetISR (others aren't used). */ .section .intvecs intVector: .global intVector /* * Stack pointer start at the end of bootloader memory. */ .word 0x20004004 /* * Entry point is the relocator function (added of 0x4000 because of the * initial load position). */ .word Relocator+0x4001 .text /*! * \fn void Relocator (void) * * \brief Move the bootloader from 0x20004000 to 0x20000000. * * This function will copy word by word from 0x20004000 to 0x20000000. Then it * uses Run to execute the relocated bootloader. */ Relocator: .global Relocator .align 4 // r1 = New position in memory ldr r1, =RELOCATED_POS // r2 = Current position in memory ldr r2, =INITIAL_POS // r3 = End Addr for relocated bootloader mov r3, r2 // Loop to move every word from the initial position to the new position. reloc: // Copy from position pointed by r2 to position pointed by r1. ldr r4, [r2] str r4, [r1] // Increment pointers. add r1, r1, #4 add r2, r2, #4 // Check for end. cmp r1,r3 bne reloc // Load the new IntVector table address into r0. ldr r0, =RELOCATED_POS // Load main address into the ResetISR pointer (IntVector[1]). ldr r1, =main str r1, [r0, #4] // Run the relocated main. b BOOTRun .end
programs/oeis/130/A130259.asm
jmorken/loda
1
105155
; A130259: Maximal index k of an even Fibonacci number (A001906) such that A001906(k) = Fib(2k) <= n (the 'lower' even Fibonacci Inverse). ; 0,1,1,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6 mov $6,$0 mov $8,$0 lpb $6 mov $0,$8 sub $6,1 sub $0,$6 mov $10,2 mov $12,$0 lpb $10 mov $0,$12 sub $10,1 add $0,$10 sub $0,1 mov $3,$0 mov $5,2 lpb $5 mov $0,$3 sub $5,1 add $0,$5 sub $0,1 cal $0,130261 ; Partial sums of the 'lower' even Fibonacci Inverse A130259. mov $7,$0 sub $7,1 mul $7,2 mov $2,$7 mov $7,2 add $7,$2 mov $13,$5 lpb $13 mov $4,$7 sub $13,1 lpe lpe lpb $3 mov $3,0 sub $4,$7 lpe mov $7,$4 mov $9,$10 lpb $9 sub $9,1 mov $11,$7 lpe lpe lpb $12 sub $11,$7 mov $12,0 lpe mov $7,$11 div $7,2 add $1,$7 lpe
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca.log_21829_854.asm
ljhsiun2/medusa
9
14005
<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r11 push %r15 push %r9 push %rax push %rcx lea addresses_WT_ht+0x17b98, %rcx nop nop add $35696, %r9 mov (%rcx), %r11 nop nop nop nop nop sub $8685, %r11 lea addresses_WC_ht+0x15492, %r15 nop cmp $40570, %rax mov (%r15), %cx nop nop nop add $47392, %r15 pop %rcx pop %rax pop %r9 pop %r15 pop %r11 ret .global s_faulty_load s_faulty_load: push %r11 push %r15 push %r8 push %r9 push %rbp push %rbx push %rdx // Store lea addresses_A+0xfaf2, %r8 nop nop nop nop nop and $42460, %r11 movb $0x51, (%r8) nop nop add %r11, %r11 // Store lea addresses_A+0x1e312, %r15 nop nop nop xor %rbp, %rbp movl $0x51525354, (%r15) cmp $57546, %r9 // Load mov $0xcf2, %rdx nop nop nop sub %r11, %r11 movups (%rdx), %xmm0 vpextrq $1, %xmm0, %r8 nop add %rdx, %rdx // Load lea addresses_US+0xf752, %rdx nop nop nop nop cmp $2869, %r11 mov (%rdx), %rbx nop and %rdx, %rdx // Faulty Load lea addresses_PSE+0x170f2, %r9 nop nop cmp $56883, %r8 mov (%r9), %r15 lea oracles, %r8 and $0xff, %r15 shlq $12, %r15 mov (%r8,%r15,1), %r15 pop %rdx pop %rbx pop %rbp pop %r9 pop %r8 pop %r15 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_PSE', 'same': False, 'AVXalign': False, 'congruent': 0}} {'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_A', 'same': False, 'AVXalign': False, 'congruent': 9}} {'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_A', 'same': False, 'AVXalign': False, 'congruent': 5}} {'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_P', 'same': False, 'AVXalign': False, 'congruent': 10}} {'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_US', 'same': False, 'AVXalign': False, 'congruent': 3}} [Faulty Load] {'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_PSE', 'same': True, 'AVXalign': False, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': True, 'congruent': 0}} {'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 2}} {'33': 21829} 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 */
Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/s-rannum.ads
djamal2727/Main-Bearing-Analytical-Model
0
19580
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . R A N D O M _ N U M B E R S -- -- -- -- S p e c -- -- -- -- Copyright (C) 2007-2020, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- Extended pseudo-random number generation -- This package provides a type representing pseudo-random number generators, -- and subprograms to extract various uniform distributions of numbers -- from them. It also provides types for representing initialization values -- and snapshots of internal generator state, which permit reproducible -- pseudo-random streams. -- The generator currently provided by this package has an extremely long -- period (at least 2**19937-1), and passes the Big Crush test suite, with the -- exception of the two linear complexity tests. Therefore, it is suitable -- for simulations, but should not be used as a cryptographic pseudo-random -- source without additional processing. -- Note: this package is in the System hierarchy so that it can be directly -- used by other predefined packages. User access to this package is via -- the package GNAT.Random_Numbers (file g-rannum.ads), which also extends -- its capabilities. The interfaces are different so as to include in -- System.Random_Numbers only the definitions necessary to implement the -- standard random-number packages Ada.Numerics.Float_Random and -- Ada.Numerics.Discrete_Random. -- Note: this package is marked SPARK_Mode Off, because functions Random work -- by side-effect to change the value of the generator, hence they should not -- be called from SPARK code. with Interfaces; private with Ada.Strings.Text_Output; package System.Random_Numbers with SPARK_Mode => Off is type Generator is limited private; -- Generator encodes the current state of a random number stream, it is -- provided as input to produce the next random number, and updated so -- that it is ready to produce the next one. type State is private; -- A non-limited version of a Generator's internal state function Random (Gen : Generator) return Float; function Random (Gen : Generator) return Long_Float; -- Return pseudo-random numbers uniformly distributed on [0.0 .. 1.0) function Random (Gen : Generator) return Interfaces.Unsigned_32; function Random (Gen : Generator) return Interfaces.Unsigned_64; -- Return pseudo-random numbers uniformly distributed on T'First .. T'Last -- for builtin integer types. generic type Result_Subtype is (<>); Default_Min : Result_Subtype := Result_Subtype'Val (0); function Random_Discrete (Gen : Generator; Min : Result_Subtype := Default_Min; Max : Result_Subtype := Result_Subtype'Last) return Result_Subtype; -- Returns pseudo-random numbers uniformly distributed on Min .. Max generic type Result_Subtype is digits <>; function Random_Float (Gen : Generator) return Result_Subtype; -- Returns pseudo-random numbers uniformly distributed on [0 .. 1) type Initialization_Vector is array (Integer range <>) of Interfaces.Unsigned_32; -- Provides the most general initialization values for a generator (used -- in Reset). In general, there is little point in providing more than -- a certain number of values (currently 624). procedure Reset (Gen : Generator); -- Re-initialize the state of Gen from the time of day procedure Reset (Gen : Generator; Initiator : Initialization_Vector); procedure Reset (Gen : Generator; Initiator : Interfaces.Integer_32); procedure Reset (Gen : Generator; Initiator : Interfaces.Unsigned_32); procedure Reset (Gen : Generator; Initiator : Integer); -- Re-initialize Gen based on the Initiator in various ways. Identical -- values of Initiator cause identical sequences of values. procedure Reset (Gen : Generator; From_State : Generator); -- Causes the state of Gen to be identical to that of From_State; Gen -- and From_State will produce identical sequences of values subsequently. procedure Reset (Gen : Generator; From_State : State); procedure Save (Gen : Generator; To_State : out State); -- The sequence -- Save (Gen2, S); Reset (Gen1, S) -- has the same effect as Reset (Gen2, Gen1). procedure Reset (Gen : Generator; From_Image : String); function Image (Gen : Generator) return String; -- The call -- Reset (Gen2, Image (Gen1)) -- has the same effect as Reset (Gen2, Gen1); Max_Image_Width : constant := 11 * 624; -- Maximum possible length of result of Image (...) function Image (Of_State : State) return String; -- A String representation of Of_State. Identical to the result of -- Image (Gen), if Of_State has been set with Save (Gen, Of_State). function Value (Coded_State : String) return State; -- Inverse of Image on States private N : constant := 624; -- The number of 32-bit integers in the shift register M : constant := 397; -- Feedback distance from the current position subtype State_Val is Interfaces.Unsigned_32; type State is array (0 .. N - 1) of State_Val with Put_Image => Put_Image; procedure Put_Image (S : in out Ada.Strings.Text_Output.Sink'Class; V : State); type Writable_Access (Self : access Generator) is limited null record; -- Auxiliary type to make Generator a self-referential type type Generator is limited record Writable : Writable_Access (Generator'Access); -- This self reference allows functions to modify Generator arguments S : State := (others => 0); -- The shift register, a circular buffer I : Integer := N; -- Current starting position in shift register S (N means uninitialized) -- We should avoid using the identifier I here ??? end record; end System.Random_Numbers;
PRG/objects/1-F.asm
narfman0/smb3_pp1
0
162228
<filename>PRG/objects/1-F.asm .byte $00 ; Unknown purpose .byte OBJ_PODOBOO, $12, $12 .byte OBJ_PODOBOO, $18, $12 .byte OBJ_PODOBOO, $1F, $12 .byte OBJ_PODOBOO, $27, $11 .byte OBJ_ROTODISCCCLOCKWISE, $38, $15 .byte OBJ_ROTODISCCLOCKWISE, $47, $16 .byte OBJ_PODOBOO, $51, $11 .byte OBJ_PODOBOO, $53, $14 .byte OBJ_PODOBOO, $5E, $11 .byte OBJ_ROTODISCCLOCKWISE, $5B, $17 .byte OBJ_DRYBONES, $6B, $18 .byte OBJ_BOOMBOOMJUMP, $9D, $17 .byte $FF ; Terminator
data/phone/text/wade_overworld.asm
Dev727/ancientplatinum
28
173847
<reponame>Dev727/ancientplatinum<filename>data/phone/text/wade_overworld.asm WadeAskNumber1Text: text "You're awesome!" line "I like you!" para "I look for #MON" line "here every day." para "When I'm in the" line "grass, I find all" cont "kinds of BERRIES." para "If you'd like," line "I'll share some." para "Could I get your" line "phone number?" done WadeAskNumber2Text: text "When I'm in the" line "grass, I find all" cont "kinds of BERRIES." para "If you'd like," line "I'll share some." para "Could I get your" line "phone number?" done WadeNumberAcceptedText: text "You'll hear from" line "me as soon as I" para "find anything that" line "you might like." done WadeNumberDeclinedText: text "Oh well. Don't be" line "shy if you want to" cont "get my number." done WadePhoneFullText: text "Your phone list" line "has no room for my" cont "number." done WadeRematchText: text "I was waiting for" line "you. Let's battle!" done WadeGiftText: text "Good to see you!" line "See? This is what" para "I found." line "It's for you!" done WadePackFullText: text "Oops, your PACK's" line "full. Too bad." para "You should come" line "back for it later." done
programs/oeis/232/A232015.asm
neoneye/loda
22
4094
; A232015: Expansion of (1-2*x)/((1+2*x)*(1-3*x)). ; 1,-1,5,-1,29,23,197,335,1517,3527,12629,33791,109565,312311,969701,2843567,8661773,25723175,77693813,232032863,698195741,2090392919,6279567365,18821924879,56499329069,169430878343,508426852757,1525012122815,4575573239357 seq $0,91000 ; Number of closed walks of length n on the Petersen graph. mul $0,2 sub $0,1
code/kernel/kernel.asm
yishiyu/YishiOS
1
99810
;======================================== ; 内核入口文件 ;======================================== ; 导入全局变量 extern disp_pos extern gdt_ptr extern idt_ptr extern k_reenter extern p_proc_ready_head extern tss ; 导入全局变量结束 ;导入c文件函数 extern init_gdt extern init_interupt extern irq_table extern sys_call_table extern exception_handler extern init_tss extern start_proc ;导入c文件函数结束 ;导出中断处理函数 global restart global divide_error global single_step_exception global nmi global breakpoint_exception global overflow global bounds_check global inval_opcode global copr_not_available global double_fault global copr_seg_overrun global inval_tss global segment_not_present global stack_exception global general_protection global page_fault global copr_error global hwint00 global hwint01 global hwint02 global hwint03 global hwint04 global hwint05 global hwint06 global hwint07 global hwint08 global hwint09 global hwint10 global hwint11 global hwint12 global hwint13 global hwint14 global hwint15 global sys_call ;导出中断处理函数结束 %include "kernel.inc" ;堆栈段 --------------------------------------------------------------------------------------------------------------------------------------------------------------- [SECTION .bss] ; resb 意为不初始化定义空间,单位为字节 ; 栈大小为2kb Kernel_Stack resb 2 * 1024 ; 栈空间 StackTop: ; 栈顶 ;堆栈段结束--------------------------------------------------------------------------------------------------------------------------------------------------------- ;代码段 --------------------------------------------------------------------------------------------------------------------------------------------------------------- [section .text] ; 导出程序的入口 global _start ; 注意! 在使用 C 代码的时候一定要保证 ds, es, ss 这几个段寄存器的值是一样的 ; 因为编译器有可能编译出使用它们的代码, 而编译器默认它们是一样的. 比如串拷贝操作会用到 ds 和 es. ; 在进入kernel的时候cs, ds, es, fs, ss中的选择子基地址为 00h _start: ; 1. 第一步,切换堆栈 mov esp, StackTop ; 堆栈在 bss 段中 ; 把当前指针位置恢复成左上角 mov dword [disp_pos], 0 ; 2. 第二步,切换gdt ; 因为原本的gdt位置在kernel中没有变量对应,且以后kernel的活动可能会覆盖掉原本的gdt sgdt [gdt_ptr] call init_gdt lgdt [gdt_ptr] ;3. 第三部,打开中断 call init_interupt lidt [idt_ptr] ;前面更换了gdtr和idtr,跳转语句强制使用他们 jmp SELECTOR_KERNEL_CS:kernel_init_done kernel_init_done: call init_tss xor eax, eax mov ax, SELECTOR_TSS ltr ax call start_proc jmp $ ; 系统调用入口,通过int 0x80调用 ; eax为系统调用号 ; ebx,ecx,edx为参数 ; 返回值为eax sys_call: call save sti push esi push dword [p_proc_ready_head] push edi push edx push ecx push ebx call [sys_call_table + eax * 4] add esp, 4*5 pop esi ; ; 如果是IPC系统调用,则需要注意返回的时候是否对原进程进行了阻塞 ; ; 如果对原进程进行了阻塞,则需要注意不能修改eax,否则会对新进程造成破坏 ; 啊当上面的东西没说,于渊大佬太秀了这个 ; 这个esi埋伏了一手,如果发生了上述情况,修改的eax是原进程的,转入的是新进程,互不相关 mov [esi+EAXREG - P_STACKBASE], eax cli ret ;改自Orange's OS by 于渊 ; 8259A 中断处理 ALIGN 16 hwint00: ; Interrupt routine for irq 0 (the clock). hwint_master 0 ALIGN 16 hwint01: ; Interrupt routine for irq 1 (keyboard) hwint_master 1 ALIGN 16 hwint02: ; Interrupt routine for irq 2 (cascade!) hwint_master 2 ALIGN 16 hwint03: ; Interrupt routine for irq 3 (second serial) hwint_master 3 ALIGN 16 hwint04: ; Interrupt routine for irq 4 (first serial) hwint_master 4 ALIGN 16 hwint05: ; Interrupt routine for irq 5 (XT winchester) hwint_master 5 ALIGN 16 hwint06: ; Interrupt routine for irq 6 (floppy) hwint_master 6 ALIGN 16 hwint07: ; Interrupt routine for irq 7 (printer) hwint_master 7 ALIGN 16 hwint08: ; Interrupt routine for irq 8 (realtime clock). hwint_slave 8 ALIGN 16 hwint09: ; Interrupt routine for irq 9 (irq 2 redirected) hwint_slave 9 ALIGN 16 hwint10: ; Interrupt routine for irq 10 hwint_slave 10 ALIGN 16 hwint11: ; Interrupt routine for irq 11 hwint_slave 11 ALIGN 16 hwint12: ; Interrupt routine for irq 12 hwint_slave 12 ALIGN 16 hwint13: ; Interrupt routine for irq 13 (FPU exception) hwint_slave 13 ALIGN 16 hwint14: ; Interrupt routine for irq 14 (AT winchester) hwint_slave 14 ALIGN 16 hwint15: ; Interrupt routine for irq 15 hwint_slave 15 ; 8259A 中断处理结束 ;改自Orange's OS by 于渊 ; CPU保留中断处理 divide_error: push 0xFFFFFFFF ; no err code push 0 ; vector_no = 0 jmp exception single_step_exception: push 0xFFFFFFFF ; no err code push 1 ; vector_no = 1 jmp exception nmi: push 0xFFFFFFFF ; no err code push 2 ; vector_no = 2 jmp exception breakpoint_exception: push 0xFFFFFFFF ; no err code push 3 ; vector_no = 3 jmp exception overflow: push 0xFFFFFFFF ; no err code push 4 ; vector_no = 4 jmp exception bounds_check: push 0xFFFFFFFF ; no err code push 5 ; vector_no = 5 jmp exception inval_opcode: push 0xFFFFFFFF ; no err code push 6 ; vector_no = 6 jmp exception copr_not_available: push 0xFFFFFFFF ; no err code push 7 ; vector_no = 7 jmp exception double_fault: push 8 ; vector_no = 8 jmp exception copr_seg_overrun: push 0xFFFFFFFF ; no err code push 9 ; vector_no = 9 jmp exception inval_tss: push 10 ; vector_no = A jmp exception segment_not_present: push 11 ; vector_no = B jmp exception stack_exception: push 12 ; vector_no = C jmp exception general_protection: push 13 ; vector_no = D jmp exception page_fault: push 14 ; vector_no = E jmp exception copr_error: push 0xFFFFFFFF ; no err code push 16 ; vector_no = 10h jmp exception exception: call exception_handler add esp, 4*2 ; 让栈顶指向 EIP,堆栈中从顶向下依次是:EIP、CS、EFLAGS hlt ; 这里直接停机会使得IF位仍然为0 即无法接收新中断 ; 会造成永久停机 ; CPU保留中断处理结束 ; 中断保存进程状态函数-------------------------------------------- save: ; 记录进程的状态 pushad push ds push es push fs push gs ; edx中可能存着系统调用的参数,先保护起来 mov esi, edx mov dx, ss mov ds, dx mov es, dx mov fs, dx ; 恢复edx mov edx, esi ; 记录进程表起始地址 mov esi, esp inc dword [k_reenter] cmp dword [k_reenter], 0 jne end_without_switch_stack ; 切换到内核栈 mov esp, StackTop push restart ; 回到中断处理中 jmp [esi + RETADR - P_STACKBASE] end_without_switch_stack: ; 之所以重入的中断不需要切换栈空间 ; 是因为本来就在栈空间 push restart_reenter ; 回到中断处理中 jmp [esi + RETADR - P_STACKBASE] ; 中断保存进程状态函数-------------------------------------------- ; 中断恢复函数--------------------------------------------------------------- ; 用于从中断恢复到进程中 ; 普通地从中断恢复到进程 restart: mov esp, [p_proc_ready_head] lldt [esp + P_LDT_SEL] lea eax, [esp + P_STACKTOP] mov dword [tss + TSS3_S_SP0], eax ; 从中断恢复到中断,不需要切换ldt和设置tss restart_reenter: dec dword [k_reenter] pop gs pop fs pop es pop ds popad add esp, 4 iretd
eurasia/services4/srvclient/devices/sgx/subtwiddled_eot.asm
shaqfu786/GFX_Linux_DDK
3
164499
/***************************************************************************** Name : subtwiddled_eot.asm Title : USE programs for TQ Author : PowerVR Copyright : 2008-2010 by Imagination Technologies Limited. All rights reserved. No part of this software, either material or conceptual may be copied or distributed, transmitted, transcribed, stored in a retrieval system or translated into any human or computer language in any form by any means, electronic, mechanical, manual or other-wise, or disclosed to third parties without the express written permission of Imagination Technologies Limited, HomePark Industrial Estate, King's Langley, Hertfordshire, WD4 8LZ, U.K. Description : USE End of tile program for sub tile twiddling Program Type : USE assembly language Version : $Revision: 1.29 $ Modifications : $Log: subtwiddled_eot.asm $ #3 --- Revision Logs Removed --- *****************************************************************************/ #include "sgxdefs.h" .export SubTwiddled; .export SubTwiddledEnd; .export PixelEventSubTwiddled_PBEState_Byte; #if defined(FIX_HW_BRN_30842) .export PixelEventSubTwiddled_Sideband_Byte; #else .export PixelEventSubTwiddled_Sideband_SinglePipe_Byte; .export PixelEventSubTwiddled_Sideband_2Pipes_First_Byte; .export PixelEventSubTwiddled_Sideband_2Pipes_Second_Byte; #endif .export PixelEventSubTwiddled_SubDim; #define HSH # #if ! defined(FIX_HW_BRN_30842) /* cross pipe boundary. ( we never need more than 2 pipes, as touching 4 would mean * not sub tile size */ #define PEST_2PIPE_MODE_MASK (1 << 31) /* if set texture goes through pipes in X otherwise in Y ( if bit 32 is also set )*/ #define PEST_DIRECTION_X_MASK (1 << 30) #define PEST_ADDR_SHIFT_MASK (0x0000ffff) #endif #if defined(SUPPORT_SGX_COMPLEX_GEOMETRY) #define WAITFOROTHERPIPE(label) \ /* flush the g1 by ldr*/ \ ldr r7, HSH(EUR_CR_USE_G1 >> 2), drc0; \ wdf drc0; \ label##_:; \ {; \ xor.testnz p0, g1, g17; \ p0 br label##_; \ }; #else /* SUPPORT_SGX_COMPLEX_GEOMETRY*/ #define WAITFOROTHERPIPE(label) \ label##_:; \ {; \ xor.testnz p0, g0, g17; \ p0 br label##_; \ }; #endif #if defined(SUPPORT_SGX_COMPLEX_GEOMETRY) #if (4 == EURASIA_TAPDSSTATE_PIPECOUNT) #define FLIPFLOP \ mov r7, g1; \ iadd32 r7, r7.low, HSH(1); \ and r7, r7, HSH(3); \ str HSH(EUR_CR_USE_G1 >> 2), r7; #else #define FLIPFLOP \ xor r7, g1, HSH(1); \ str HSH(EUR_CR_USE_G1 >> 2), r7; #endif #else #if (4 == EURASIA_TAPDSSTATE_PIPECOUNT) #define FLIPFLOP \ mov r7, g0; \ iadd32 r7, r7.low, HSH(1); \ and g0, r7, HSH(3); #else /* 2 == EURASIA_TAPDSSTATE_PIPECOUNT */ #define FLIPFLOP \ xor g0, g0, HSH(1); #endif #endif /* SUPPORT_SGX_COMPLEX_GEOMETRY*/ /* kicks off the tile and ends the program*/ #if defined(SGX_FEATURE_UNIFIED_STORE_64BITS) #define DUMMYTILEEMIT(fbaddr) \ mov r0, HSH(0) ; \ mov r4, fbaddr ; \ emitpix.end.freep r0, r2, r4, HSH(0) ; #else #define DUMMYTILEEMIT(fbaddr) \ mov r0, HSH(0) ; \ emitpix2.end.freep r0, fbaddr, HSH(0) ; #endif .align 2; .skipinvon; SubTwiddled: { #if defined(SGX_FEATURE_USE_UNLIMITED_PHASES) /* No following phase. */ phas #0, #0, pixel, end, perinstance; #endif /* load program state */ PixelEventSubTwiddled_SubDim: nop; /* mov r7, #UV*/ nop; /* mov r6, DstBytesPP*/ and r4, r7, #0xffff; shr r5, r7, #16; PixelEventSubTwiddled_PBEState_Byte: nop; /* mov r0, PBE 0*/ nop; /* mov r1, PBE 1 - noadvance must be on*/ nop; /* mov r2, PBE 2*/ nop; /* mov r3, PBE 3*/ #if defined(SGX_FEATURE_PIXELBE_32K_LINESTRIDE) || \ defined(SGX_FEATURE_UNIFIED_STORE_64BITS) nop; #endif #if defined(SGX_FEATURE_UNIFIED_STORE_64BITS) nop; #endif /* get tile number*/ mov r10, #0; xor.testnz p0, r5, #EURASIA_ISPREGION_SIZEX; p0 xor.testnz p0, r5, #(EURASIA_ISPREGION_SIZEX / 2); p0 br PEST_WidthLessThanHalfTileFirst; { #if defined(FIX_HW_BRN_23615) and r10, sa0, #~EURASIA_PDS_IR0_PDM_TILEX_CLRMSK; #else and r10, pa0, #~EURASIA_PDS_IR0_PDM_TILEX_CLRMSK; #endif shr r10, r10, #(1 + EURASIA_PDS_IR0_PDM_TILEX_SHIFT); br PEST_EndOfHalfTileTest; } PEST_WidthLessThanHalfTileFirst: { #if defined(FIX_HW_BRN_23615) and r10, sa0, #~EURASIA_PDS_IR0_PDM_TILEY_CLRMSK; #else and r10, pa0, #~EURASIA_PDS_IR0_PDM_TILEY_CLRMSK; #endif shr r10, r10, #(1 + EURASIA_PDS_IR0_PDM_TILEY_SHIFT); } PEST_EndOfHalfTileTest: /* jump if the pipe doesn't have pixels */ #if defined(FIX_HW_BRN_30842) xor.testnz p0, r5, #16; p0 and.testnz p0, #1, g17; p0 br PEST_EndOfAspectRatios; #else mov r7, #PEST_DIRECTION_X_MASK; #if (EURASIA_TAPDSSTATE_PIPECOUNT == 4) /* this assuming the follwing pipe order: * 01 * 23 */ and.testnz p0, r6, r7; p0 and.testnz p0, #2, g17; p0 br PEST_EndOfAspectRatios; #endif and.testz p0, r6, r7; p0 and.testnz p0, #1, g17; p0 br PEST_EndOfAspectRatios; #endif xor.testnz p0, r5, #EURASIA_ISPREGION_SIZEX; p0 xor.testnz p0, r5, #(EURASIA_ISPREGION_SIZEX / 2); p0 br PEST_WidthLessThanHalfTile; { xor.testz p0, r4, #1; p0 br PEST_EndOfAspectRatios; #if EURASIA_ISPREGION_SIZEX == 32 && EURASIA_ISPREGION_SIZEY == 32 #define HALFTILEWIDE_JUMP(i) \ xor.testz p0, r4, HSH(i); \ p0 br PEST_AspectRatio_16_x_##i; #else #define HALFTILEWIDE_JUMP(i) \ xor.testz p0, r4, HSH(i); \ p0 br PEST_AspectRatio_8_x_##i; #endif HALFTILEWIDE_JUMP(2); HALFTILEWIDE_JUMP(4); HALFTILEWIDE_JUMP(8); HALFTILEWIDE_JUMP(16); #if EURASIA_ISPREGION_SIZEY == 32 xor.testz p0, r4, #32; p0 br PEST_AspectRatio_16_x_16; #endif } PEST_WidthLessThanHalfTile: #if EURASIA_ISPREGION_SIZEX == 32 xor.testz p0, r5, #8; !p0 br PEST_WidthNot8; { xor.testz p0, r4, #1; p0 br PEST_EndOfAspectRatios; xor.testz p0, r4, #2; p0 br PEST_AspectRatio_8_x_2; xor.testz p0, r4, #4; p0 br PEST_AspectRatio_8_x_4; xor.testz p0, r4, #16; p0 br PEST_AspectRatio_8_x_16; } PEST_WidthNot8: #endif xor.testz p0, r5, #4; !p0 br PEST_WidthNot4; { xor.testz p0, r4, #1; p0 br PEST_EndOfAspectRatios; xor.testz p0, r4, #2; p0 br PEST_AspectRatio_4_x_2; xor.testz p0, r4, #16; #if EURASIA_ISPREGION_SIZEY == 32 (!p0) xor.testz p0, r4, #32; #endif p0 br PEST_AspectRatio_4_x_16; } PEST_WidthNot4: xor.testz p0, r5, #2; !p0 br PEST_WidthNot2; { xor.testz p0, r4, #1; p0 br PEST_EndOfAspectRatios; xor.testz p0, r4, #8; p0 br PEST_AspectRatio_2_x_8; xor.testz p0, r4, #16; #if EURASIA_ISPREGION_SIZEY == 32 (!p0) xor.testz p0, r4, #32; #endif p0 br PEST_AspectRatio_2_x_16; } PEST_WidthNot2: xor.testz p0, r5, #1; p0 br PEST_EndOfAspectRatios; lock; lock; /* dbg break*/ PEST_AspectRatio_2_x_8: { #if (32 == EURASIA_ISPREGION_SIZEX) && (32 == EURASIA_ISPREGION_SIZEY) mov r7, o1; mov o1, o2; mov o2, r7; mov r7, o17; mov o17, o18; mov o18, r7; mov r7, o65; mov o65, o66; mov o66, r7; mov r7, o81; mov o81, o82; mov o82, r7; #else mov r7, o1; mov o1, o2; mov o2, r7; mov r7, o17; mov o17, o18; mov o18, r7; mov r7, o33; mov o33, o34; mov o34, r7; mov r7, o49; mov o49, o50; mov o50, r7; #endif br PEST_EndOfAspectRatios; } PEST_AspectRatio_2_x_16: { #if (32 == EURASIA_ISPREGION_SIZEX) && (32 == EURASIA_ISPREGION_SIZEY) mov r7, o1; mov o1, o2; mov o2, r7; mov r7, o17; mov o17, o18; mov o18, r7; mov r7, o65; mov o65, o66; mov o66, r7; mov r7, o81; mov o81, o82; mov o82, r7; smbo #0, #0, #129, #0; mov r7, o80; smbo #129, #0, #129, #0; mov o80, o0; mov o0, o1; mov o1, o80; mov o80, o16; mov o16, o17; mov o17, o80; mov o80, o64; mov o64, o65; mov o65, o80; mov o80, o81; smbo #129, #0, #0, #0; mov o81, r7; #else mov r7, o1; mov o1, o2; mov o2, r7; mov r7, o17; mov o17, o18; mov o18, r7; mov r7, o33; mov o33, o34; mov o34, r7; mov r7, o49; mov o49, o50; mov o50, r7; mov r7, o65; mov o65, o66; mov o66, r7; mov r7, o81; mov o81, o82; mov o82, r7; mov r7, o97; mov o97, o98; mov o98, r7; mov r7, o113; mov o113, o114; mov o114, r7; #endif br PEST_EndOfAspectRatios; } PEST_AspectRatio_4_x_2: { #if (32 == EURASIA_ISPREGION_SIZEX) && (32 == EURASIA_ISPREGION_SIZEY) mov r7, o1; mov o1, o2; mov o2, o4; mov o4, r7; mov r7, o5; mov o5, o3; mov o3, o6; mov o6, r7; #else mov r7, o1; mov o1, o2; mov o2, o4; mov o4, r7; mov r7, o5; mov o5, o3; mov o3, o6; mov o6, r7; #endif br PEST_EndOfAspectRatios; } PEST_AspectRatio_4_x_16: { #if (32 == EURASIA_ISPREGION_SIZEX) && (32 == EURASIA_ISPREGION_SIZEY) mov r7, o1; mov o1, o2; mov o2, o16; mov o16, o4; mov o4, r7; mov r7, o5; mov o5, o3; mov o3, o18; mov o18, o20; mov o20, r7; mov r7, o6; mov o6, o17; mov o17, r7; mov r7, o7; mov o7, o19; mov o19, o22; mov o22, o21; mov o21, r7; mov r7, o65; mov o65, o66; mov o66, o80; mov o80, o68; mov o68, r7; mov r7, o69; mov o69, o67; mov o67, o82; mov o82, o84; mov o84, r7; mov r7, o70; mov o70, o81; mov o81, r7; mov r7, o71; mov o71, o83; mov o83, o86; mov o86, o85; mov o85, r7; smbo #0, #0, #129, #0; mov r7, o70; smbo #129, #0, #129, #0; mov o70, o0; mov o0, o1; mov o1, o15; mov o15, o3; mov o3, o70; mov o70, o4; mov o4, o2; mov o2, o17; mov o17, o19; mov o19, o70; mov o70, o5; mov o5, o16; mov o16, o70; mov o70, o6; mov o6, o18; mov o18, o21; mov o21, o20; mov o20, o70; mov o70, o64; mov o64, o65; mov o65, o79; mov o79, o67; mov o67, o70; mov o70, o68; mov o68, o66; mov o66, o81; mov o81, o83; mov o83, o70; mov o70, o69; mov o69, o80; mov o80, o70; mov o70, o82; mov o82, o85; mov o85, o84; smbo #129, #0, #0, #0; mov o84, r7; #else mov r7, o1; mov o1, o2; mov o2, o16; mov o16, o4; mov o4, r7; mov r7, o5; mov o5, o3; mov o3, o18; mov o18, o20; mov o20, r7; mov r7, o6; mov o6, o17; mov o17, r7; mov r7, o7; mov o7, o19; mov o19, o22; mov o22, o21; mov o21, r7; mov r7, o33; mov o33, o34; mov o34, o48; mov o48, o36; mov o36, r7; mov r7, o37; mov o37, o35; mov o35, o50; mov o50, o52; mov o52, r7; mov r7, o38; mov o38, o49; mov o49, r7; mov r7, o39; mov o39, o51; mov o51, o54; mov o54, o53; mov o53, r7; mov r7, o65; mov o65, o66; mov o66, o80; mov o80, o68; mov o68, r7; mov r7, o69; mov o69, o67; mov o67, o82; mov o82, o84; mov o84, r7; mov r7, o70; mov o70, o81; mov o81, r7; mov r7, o71; mov o71, o83; mov o83, o86; mov o86, o85; mov o85, r7; mov r7, o97; mov o97, o98; mov o98, o112; mov o112, o100; mov o100, r7; mov r7, o101; mov o101, o99; mov o99, o114; mov o114, o116; mov o116, r7; mov r7, o102; mov o102, o113; mov o113, r7; mov r7, o103; mov o103, o115; mov o115, o118; mov o118, o117; mov o117, r7; #endif br PEST_EndOfAspectRatios; } PEST_AspectRatio_8_x_2: { #if (32 == EURASIA_ISPREGION_SIZEX) && (32 == EURASIA_ISPREGION_SIZEY) mov r7, o1; mov o1, o2; mov o2, o8; mov o8, o4; mov o4, r7; mov r7, o5; mov o5, o3; mov o3, o10; mov o10, o12; mov o12, r7; mov r7, o9; mov o9, o6; mov o6, r7; mov r7, o13; mov o13, o7; mov o7, o11; mov o11, o14; mov o14, r7; #else mov r7, o1; mov o1, o2; mov o2, o8; mov o8, o4; mov o4, r7; mov r7, o5; mov o5, o3; mov o3, o10; mov o10, o12; mov o12, r7; mov r7, o9; mov o9, o6; mov o6, r7; mov r7, o13; mov o13, o7; mov o7, o11; mov o11, o14; mov o14, r7; #endif br PEST_EndOfAspectRatios; } PEST_AspectRatio_8_x_4: { #if (32 == EURASIA_ISPREGION_SIZEX) && (32 == EURASIA_ISPREGION_SIZEY) mov r7, o1; mov o1, o2; mov o2, o4; mov o4, r7; mov r7, o5; mov o5, o3; mov o3, o6; mov o6, r7; mov r7, o8; mov o8, o16; mov o16, r7; mov r7, o9; mov o9, o18; mov o18, o12; mov o12, o17; mov o17, o10; mov o10, o20; mov o20, r7; mov r7, o13; mov o13, o19; mov o19, o14; mov o14, o21; mov o21, o11; mov o11, o22; mov o22, r7; mov r7, o15; mov o15, o23; mov o23, r7; mov r7, o25; mov o25, o26; mov o26, o28; mov o28, r7; mov r7, o29; mov o29, o27; mov o27, o30; mov o30, r7; #else mov r7, o1; mov o1, o2; mov o2, o4; mov o4, r7; mov r7, o5; mov o5, o3; mov o3, o6; mov o6, r7; mov r7, o8; mov o8, o16; mov o16, r7; mov r7, o9; mov o9, o18; mov o18, o12; mov o12, o17; mov o17, o10; mov o10, o20; mov o20, r7; mov r7, o13; mov o13, o19; mov o19, o14; mov o14, o21; mov o21, o11; mov o11, o22; mov o22, r7; mov r7, o15; mov o15, o23; mov o23, r7; mov r7, o25; mov o25, o26; mov o26, o28; mov o28, r7; mov r7, o29; mov o29, o27; mov o27, o30; mov o30, r7; #endif br PEST_EndOfAspectRatios; } PEST_AspectRatio_8_x_8: { #if (32 == EURASIA_ISPREGION_SIZEX) && (32 == EURASIA_ISPREGION_SIZEY) mov r7, o1; mov o1, o2; mov o2, o4; mov o4, r7; mov r7, o5; mov o5, o3; mov o3, o6; mov o6, r7; mov r7, o8; mov o8, o16; mov o16, o64; mov o64, r7; mov r7, o9; mov o9, o18; mov o18, o68; mov o68, r7; mov r7, o12; mov o12, o17; mov o17, o66; mov o66, r7; mov r7, o13; mov o13, o19; mov o19, o70; mov o70, r7; mov r7, o10; mov o10, o20; mov o20, o65; mov o65, r7; mov r7, o11; mov o11, o22; mov o22, o69; mov o69, r7; mov r7, o14; mov o14, o21; mov o21, o67; mov o67, r7; mov r7, o15; mov o15, o23; mov o23, o71; mov o71, r7; mov r7, o24; mov o24, o80; mov o80, o72; mov o72, r7; mov r7, o25; mov o25, o82; mov o82, o76; mov o76, r7; mov r7, o28; mov o28, o81; mov o81, o74; mov o74, r7; mov r7, o29; mov o29, o83; mov o83, o78; mov o78, r7; mov r7, o26; mov o26, o84; mov o84, o73; mov o73, r7; mov r7, o27; mov o27, o86; mov o86, o77; mov o77, r7; mov r7, o30; mov o30, o85; mov o85, o75; mov o75, r7; mov r7, o31; mov o31, o87; mov o87, o79; mov o79, r7; mov r7, o89; mov o89, o90; mov o90, o92; mov o92, r7; mov r7, o93; mov o93, o91; mov o91, o94; mov o94, r7; #else mov r7, o1; mov o1, o2; mov o2, o4; mov o4, r7; mov r7, o5; mov o5, o3; mov o3, o6; mov o6, r7; mov r7, o8; mov o8, o16; mov o16, o32; mov o32, r7; mov r7, o9; mov o9, o18; mov o18, o36; mov o36, r7; mov r7, o12; mov o12, o17; mov o17, o34; mov o34, r7; mov r7, o13; mov o13, o19; mov o19, o38; mov o38, r7; mov r7, o10; mov o10, o20; mov o20, o33; mov o33, r7; mov r7, o11; mov o11, o22; mov o22, o37; mov o37, r7; mov r7, o14; mov o14, o21; mov o21, o35; mov o35, r7; mov r7, o15; mov o15, o23; mov o23, o39; mov o39, r7; mov r7, o24; mov o24, o48; mov o48, o40; mov o40, r7; mov r7, o25; mov o25, o50; mov o50, o44; mov o44, r7; mov r7, o28; mov o28, o49; mov o49, o42; mov o42, r7; mov r7, o29; mov o29, o51; mov o51, o46; mov o46, r7; mov r7, o26; mov o26, o52; mov o52, o41; mov o41, r7; mov r7, o27; mov o27, o54; mov o54, o45; mov o45, r7; mov r7, o30; mov o30, o53; mov o53, o43; mov o43, r7; mov r7, o31; mov o31, o55; mov o55, o47; mov o47, r7; mov r7, o57; mov o57, o58; mov o58, o60; mov o60, r7; mov r7, o61; mov o61, o59; mov o59, o62; mov o62, r7; #endif br PEST_EndOfAspectRatios; } PEST_AspectRatio_8_x_16: { #if (32 == EURASIA_ISPREGION_SIZEX) && (32 == EURASIA_ISPREGION_SIZEY) mov r7, o1; mov o1, o2; mov o2, o4; mov o4, r7; mov r7, o5; mov o5, o3; mov o3, o6; mov o6, r7; mov r7, o8; mov o8, o16; mov o16, o64; mov o64, r7; mov r7, o9; mov o9, o18; mov o18, o68; mov o68, r7; mov r7, o12; mov o12, o17; mov o17, o66; mov o66, r7; mov r7, o13; mov o13, o19; mov o19, o70; mov o70, r7; mov r7, o10; mov o10, o20; mov o20, o65; mov o65, r7; mov r7, o11; mov o11, o22; mov o22, o69; mov o69, r7; mov r7, o14; mov o14, o21; mov o21, o67; mov o67, r7; mov r7, o15; mov o15, o23; mov o23, o71; mov o71, r7; mov r7, o24; mov o24, o80; mov o80, o72; mov o72, r7; mov r7, o25; mov o25, o82; mov o82, o76; mov o76, r7; mov r7, o28; mov o28, o81; mov o81, o74; mov o74, r7; mov r7, o29; mov o29, o83; mov o83, o78; mov o78, r7; mov r7, o26; mov o26, o84; mov o84, o73; mov o73, r7; mov r7, o27; mov o27, o86; mov o86, o77; mov o77, r7; mov r7, o30; mov o30, o85; mov o85, o75; mov o75, r7; mov r7, o31; mov o31, o87; mov o87, o79; mov o79, r7; mov r7, o89; mov o89, o90; mov o90, o92; mov o92, r7; mov r7, o93; mov o93, o91; mov o91, o94; mov o94, r7; smbo #0, #0, #129, #0; mov r7, o92; smbo #129, #0, #129, #0; mov o92, o0; mov o0, o1; mov o1, o3; mov o3, o92; mov o92, o4; mov o4, o2; mov o2, o5; mov o5, o92; mov o92, o7; mov o7, o15; mov o15, o63; mov o63, o92; mov o92, o8; mov o8, o17; mov o17, o67; mov o67, o92; mov o92, o11; mov o11, o16; mov o16, o65; mov o65, o92; mov o92, o12; mov o12, o18; mov o18, o69; mov o69, o92; mov o92, o9; mov o9, o19; mov o19, o64; mov o64, o92; mov o92, o10; mov o10, o21; mov o21, o68; mov o68, o92; mov o92, o13; mov o13, o20; mov o20, o66; mov o66, o92; mov o92, o14; mov o14, o22; mov o22, o70; mov o70, o92; mov o92, o23; mov o23, o79; mov o79, o71; mov o71, o92; mov o92, o24; mov o24, o81; mov o81, o75; mov o75, o92; mov o92, o27; mov o27, o80; mov o80, o73; mov o73, o92; mov o92, o28; mov o28, o82; mov o82, o77; mov o77, o92; mov o92, o25; mov o25, o83; mov o83, o72; mov o72, o92; mov o92, o26; mov o26, o85; mov o85, o76; mov o76, o92; mov o92, o29; mov o29, o84; mov o84, o74; mov o74, o92; mov o92, o30; mov o30, o86; mov o86, o78; mov o78, o92; mov o92, o88; mov o88, o89; mov o89, o91; mov o91, o92; mov o92, o90; mov o90, o93; smbo #129, #0, #0, #0; mov o93, r7; #else mov r7, o1; mov o1, o2; mov o2, o4; mov o4, r7; mov r7, o5; mov o5, o3; mov o3, o6; mov o6, r7; mov r7, o8; mov o8, o16; mov o16, o32; mov o32, r7; mov r7, o9; mov o9, o18; mov o18, o36; mov o36, r7; mov r7, o12; mov o12, o17; mov o17, o34; mov o34, r7; mov r7, o13; mov o13, o19; mov o19, o38; mov o38, r7; mov r7, o10; mov o10, o20; mov o20, o33; mov o33, r7; mov r7, o11; mov o11, o22; mov o22, o37; mov o37, r7; mov r7, o14; mov o14, o21; mov o21, o35; mov o35, r7; mov r7, o15; mov o15, o23; mov o23, o39; mov o39, r7; mov r7, o24; mov o24, o48; mov o48, o40; mov o40, r7; mov r7, o25; mov o25, o50; mov o50, o44; mov o44, r7; mov r7, o28; mov o28, o49; mov o49, o42; mov o42, r7; mov r7, o29; mov o29, o51; mov o51, o46; mov o46, r7; mov r7, o26; mov o26, o52; mov o52, o41; mov o41, r7; mov r7, o27; mov o27, o54; mov o54, o45; mov o45, r7; mov r7, o30; mov o30, o53; mov o53, o43; mov o43, r7; mov r7, o31; mov o31, o55; mov o55, o47; mov o47, r7; mov r7, o57; mov o57, o58; mov o58, o60; mov o60, r7; mov r7, o61; mov o61, o59; mov o59, o62; mov o62, r7; mov r7, o65; mov o65, o66; mov o66, o68; mov o68, r7; mov r7, o69; mov o69, o67; mov o67, o70; mov o70, r7; mov r7, o72; mov o72, o80; mov o80, o96; mov o96, r7; mov r7, o73; mov o73, o82; mov o82, o100; mov o100, r7; mov r7, o76; mov o76, o81; mov o81, o98; mov o98, r7; mov r7, o77; mov o77, o83; mov o83, o102; mov o102, r7; mov r7, o74; mov o74, o84; mov o84, o97; mov o97, r7; mov r7, o75; mov o75, o86; mov o86, o101; mov o101, r7; mov r7, o78; mov o78, o85; mov o85, o99; mov o99, r7; mov r7, o79; mov o79, o87; mov o87, o103; mov o103, r7; mov r7, o88; mov o88, o112; mov o112, o104; mov o104, r7; mov r7, o89; mov o89, o114; mov o114, o108; mov o108, r7; mov r7, o92; mov o92, o113; mov o113, o106; mov o106, r7; mov r7, o93; mov o93, o115; mov o115, o110; mov o110, r7; mov r7, o90; mov o90, o116; mov o116, o105; mov o105, r7; mov r7, o91; mov o91, o118; mov o118, o109; mov o109, r7; mov r7, o94; mov o94, o117; mov o117, o107; mov o107, r7; mov r7, o95; mov o95, o119; mov o119, o111; mov o111, r7; mov r7, o121; mov o121, o122; mov o122, o124; mov o124, r7; mov r7, o125; mov o125, o123; mov o123, o126; mov o126, r7; #endif br PEST_EndOfAspectRatios; } #if (32 == EURASIA_ISPREGION_SIZEX) && (32 == EURASIA_ISPREGION_SIZEY) PEST_AspectRatio_16_x_2: { mov r7, o1; mov o1, o2; mov o2, o32; mov o32, o8; mov o8, o4; mov o4, r7; mov r7, o5; mov o5, o3; mov o3, o34; mov o34, o40; mov o40, o12; mov o12, r7; mov r7, o9; mov o9, o6; mov o6, o33; mov o33, o10; mov o10, o36; mov o36, r7; mov r7, o13; mov o13, o7; mov o7, o35; mov o35, o42; mov o42, o44; mov o44, r7; mov r7, o37; mov o37, o11; mov o11, o38; mov o38, o41; mov o41, o14; mov o14, r7; mov r7, o45; mov o45, o15; mov o15, o39; mov o39, o43; mov o43, o46; mov o46, r7; br PEST_EndOfAspectRatios; } PEST_AspectRatio_16_x_4: { mov r7, o1; mov o1, o2; mov o2, o8; mov o8, o16; mov o16, o32; mov o32, o4; mov o4, r7; mov r7, o5; mov o5, o3; mov o3, o10; mov o10, o24; mov o24, o48; mov o48, o36; mov o36, r7; mov r7, o9; mov o9, o18; mov o18, o40; mov o40, o20; mov o20, o33; mov o33, o6; mov o6, r7; mov r7, o12; mov o12, o17; mov o17, o34; mov o34, r7; mov r7, o13; mov o13, o19; mov o19, o42; mov o42, o28; mov o28, o49; mov o49, o38; mov o38, r7; mov r7, o37; mov o37, o7; mov o7, o11; mov o11, o26; mov o26, o56; mov o56, o52; mov o52, r7; mov r7, o41; mov o41, o22; mov o22, r7; mov r7, o44; mov o44, o21; mov o21, o35; mov o35, o14; mov o14, o25; mov o25, o50; mov o50, r7; mov r7, o45; mov o45, o23; mov o23, o43; mov o43, o30; mov o30, o57; mov o57, o54; mov o54, r7; mov r7, o15; mov o15, o27; mov o27, o58; mov o58, o60; mov o60, o53; mov o53, o39; mov o39, r7; mov r7, o46; mov o46, o29; mov o29, o51; mov o51, r7; mov r7, o47; mov o47, o31; mov o31, o59; mov o59, o62; mov o62, o61; mov o61, o55; mov o55, r7; br PEST_EndOfAspectRatios; } PEST_AspectRatio_16_x_8: { mov r7, o1; mov o1, o2; mov o2, o64; mov o64, o32; mov o32, o4; mov o4, r7; mov r7, o5; mov o5, o3; mov o3, o66; mov o66, o96; mov o96, o36; mov o36, r7; mov r7, o8; mov o8, o16; mov o16, r7; mov r7, o9; mov o9, o18; mov o18, o72; mov o72, o48; mov o48, o12; mov o12, o17; mov o17, o10; mov o10, o80; mov o80, o40; mov o40, o20; mov o20, r7; mov r7, o13; mov o13, o19; mov o19, o74; mov o74, o112; mov o112, o44; mov o44, o21; mov o21, o11; mov o11, o82; mov o82, o104; mov o104, o52; mov o52, r7; mov r7, o33; mov o33, o6; mov o6, o65; mov o65, o34; mov o34, o68; mov o68, r7; mov r7, o37; mov o37, o7; mov o7, o67; mov o67, o98; mov o98, o100; mov o100, r7; mov r7, o41; mov o41, o22; mov o22, o73; mov o73, o50; mov o50, o76; mov o76, o49; mov o49, o14; mov o14, o81; mov o81, o42; mov o42, o84; mov o84, r7; mov r7, o45; mov o45, o23; mov o23, o75; mov o75, o114; mov o114, o108; mov o108, o53; mov o53, o15; mov o15, o83; mov o83, o106; mov o106, o116; mov o116, r7; mov r7, o35; mov o35, o70; mov o70, o97; mov o97, o38; mov o38, o69; mov o69, r7; mov r7, o39; mov o39, o71; mov o71, o99; mov o99, o102; mov o102, o101; mov o101, r7; mov r7, o43; mov o43, o86; mov o86, o105; mov o105, o54; mov o54, o77; mov o77, o51; mov o51, o78; mov o78, o113; mov o113, o46; mov o46, o85; mov o85, r7; mov r7, o47; mov o47, o87; mov o87, o107; mov o107, o118; mov o118, o109; mov o109, o55; mov o55, o79; mov o79, o115; mov o115, o110; mov o110, o117; mov o117, r7; mov r7, o25; mov o25, o26; mov o26, o88; mov o88, o56; mov o56, o28; mov o28, r7; mov r7, o29; mov o29, o27; mov o27, o90; mov o90, o120; mov o120, o60; mov o60, r7; mov r7, o57; mov o57, o30; mov o30, o89; mov o89, o58; mov o58, o92; mov o92, r7; mov r7, o61; mov o61, o31; mov o31, o91; mov o91, o122; mov o122, o124; mov o124, r7; mov r7, o59; mov o59, o94; mov o94, o121; mov o121, o62; mov o62, o93; mov o93, r7; mov r7, o63; mov o63, o95; mov o95, o123; mov o123, o126; mov o126, o125; mov o125, r7; mov r7, o111; mov o111, o119; mov o119, r7; br PEST_EndOfAspectRatios; } PEST_AspectRatio_16_x_16: { smbo #1, #0, #1, #0; mov r6, o0; mov o0, o1; mov o1, o63; mov o63, o127; mov o127, o31; mov o31, o3; mov o3, r6; mov r6, o7; mov o7, o15; mov o15, r6; smbo #6, #0, #6, #0; mov r1, o27; mov o27, o0; mov o0, o59; mov o59, o124; mov o124, o90; mov o90, o126; mov o126, r1; mov r1, o28; mov o28, o62; mov o62, o123; mov o123, r1; smbo #0, #0, #10, #0; mov r7, o87; smbo #10, #0, #10, #0; mov o87, o2; mov o2, o7; mov o7, o0; mov o0, o70; mov o70, o126; mov o126, o38; mov o38, o87; mov o87, o124; smbo #10, #0, #0, #0; mov o124, r7; smbo #0, #0, #14, #0; mov r7, o0; smbo #14, #0, #14, #0; mov o0, o67; mov o67, o124; mov o124, o98; mov o98, o126; mov o126, o35; smbo #14, #0, #0, #0; mov o35, r7; smbo #0, #0, #22, #0; mov r7, o91; smbo #22, #0, #22, #0; mov o91, o19; mov o19, o0; mov o0, o51; mov o51, o124; mov o124, o82; mov o82, o126; mov o126, o91; mov o91, o20; mov o20, o62; mov o62, o115; mov o115, o28; mov o28, o54; mov o54, o123; mov o123, o91; mov o91, o120; smbo #22, #0, #0, #0; mov o120, r7; smbo #0, #0, #25, #0; mov r7, o80; smbo #25, #0, #25, #0; mov o80, o0; mov o0, o1; mov o1, o63; mov o63, o127; mov o127, o31; mov o31, o3; mov o3, o80; mov o80, o125; smbo #25, #0, #0, #0; mov o125, r7; smbo #0, #0, #30, #0; mov r7, o28; smbo #30, #0, #30, #0; mov o28, o27; mov o27, o0; mov o0, o59; mov o59, o124; mov o124, o90; mov o90, o126; mov o126, o28; mov o28, o62; mov o62, o123; smbo #30, #0, #0, #0; mov o123, r7; smbo #0, #0, #99, #0; mov r7, o27; smbo #99, #0, #99, #0; mov o27, o2; mov o2, o36; mov o36, o0; mov o0, o99; mov o99, o126; mov o126, o67; mov o67, o27; mov o27, o3; mov o3, o98; mov o98, o64; mov o64, o27; mov o27, o11; mov o11, o114; mov o114, o72; mov o72, o19; mov o19, o106; mov o106, o80; mov o80, o27; mov o27, o22; mov o22, o59; mov o59, o27; mov o27, o122; mov o122, o88; smbo #99, #0, #0, #0; mov o88, r7; smbo #0, #0, #103, #0; mov r7, o0; smbo #103, #0, #103, #0; mov o0, o96; mov o96, o124; mov o124, o127; mov o127, o126; mov o126, o64; smbo #103, #0, #0, #0; mov o64, r7; smbo #0, #0, #107, #0; mov r7, o2; smbo #107, #0, #107, #0; mov o2, o44; mov o44, o0; mov o0, o107; mov o107, o126; mov o126, o75; smbo #107, #0, #0, #0; mov o75, r7; smbo #0, #0, #115, #0; mov r7, o2; smbo #115, #0, #115, #0; mov o2, o28; mov o28, o0; mov o0, o91; mov o91, o126; mov o126, o59; smbo #115, #0, #0, #0; mov o59, r7; smbo #0, #0, #119, #0; mov r7, o0; smbo #119, #0, #119, #0; mov o0, o88; mov o88, o124; mov o124, o119; mov o119, o126; mov o126, o56; smbo #119, #0, #0, #0; mov o56, r7; smbo #0, #0, #123, #0; mov r7, o116; smbo #123, #0, #123, #0; mov o116, o2; mov o2, o36; mov o36, o0; mov o0, o99; mov o99, o126; mov o126, o67; mov o67, o116; mov o116, o124; smbo #123, #0, #0, #0; mov o124, r7; smbo #0, #0, #127, #0; mov r7, o0; smbo #127, #0, #127, #0; mov o0, o96; mov o96, o124; mov o124, o127; mov o127, o126; mov o126, o64; smbo #127, #0, #0, #0; mov o64, r7; smbo #3, #0, #3, #0; mov r4, o33; mov o33, o2; mov o2, o0; mov o0, o63; smbo #66, #0, #160, #0; mov o0, o32; mov o126, o0; smbo #160, #0, #7, #0; mov o0, r0; smbo #7, #0, #9, #0; mov r0, o0; mov o2, o9; mov o11, o63; smbo #20, #0, #20, #0; mov o52, o124; mov o124, o20; mov o20, o0; smbo #13, #0, #7, #0; mov o7, r0; smbo #7, #0, #13, #0; mov r0, o39; mov o45, o0; mov o6, o6; mov o12, o61; smbo #74, #0, #168, #0; mov o0, o40; smbo #168, #0, #168, #0; mov o40, o0; smbo #168, #0, #7, #0; mov o0, r0; smbo #7, #0, #7, #0; mov r0, o30; mov o30, o0; mov o0, o60; smbo #67, #0, #164, #0; mov o0, o30; mov o127, o60; smbo #164, #0, #164, #0; mov o60, o0; smbo #44, #0, #7, #0; mov o120, r0; smbo #7, #0, #11, #0; mov r0, o33; mov o37, o10; mov o14, o0; mov o4, o71; smbo #82, #0, #176, #0; mov o0, o24; mov o118, o0; smbo #176, #0, #7, #0; mov o0, r0; smbo #7, #0, #23, #0; mov r0, o22; mov o38, o0; mov o16, o52; smbo #75, #0, #180, #0; mov o0, o30; smbo #180, #0, #180, #0; mov o30, o52; mov o52, o0; smbo #53, #0, #7, #0; mov o127, r0; smbo #7, #0, #15, #0; mov r0, o38; mov o46, o0; mov o8, o68; smbo #83, #0, #172, #0; mov o0, o30; mov o119, o68; smbo #172, #0, #172, #0; mov o68, o0; smbo #172, #0, #7, #0; mov o0, r0; smbo #7, #0, #35, #0; mov r0, o0; mov o28, o35; smbo #70, #0, #100, #0; mov o0, o93; mov o123, o62; mov o92, o0; mov o30, o33; smbo #38, #0, #7, #0; mov o95, r0; smbo #7, #0, #38, #0; mov r0, o0; mov o31, o31; mov o62, o93; mov o124, o60; smbo #98, #0, #161, #0; mov o0, o35; mov o98, o0; smbo #39, #0, #7, #0; mov o122, r0; smbo #7, #0, #39, #0; mov r0, o0; mov o32, o32; smbo #71, #0, #165, #0; mov o0, o30; mov o124, o61; smbo #165, #0, #165, #0; mov o61, o63; mov o63, o0; smbo #43, #0, #7, #0; mov o122, r0; smbo #7, #0, #43, #0; mov r0, o0; mov o36, o43; smbo #86, #0, #108, #0; mov o0, o93; mov o115, o70; mov o92, o0; mov o22, o41; smbo #46, #0, #7, #0; mov o103, r0; smbo #7, #0, #46, #0; mov r0, o0; mov o39, o39; mov o78, o93; smbo #114, #0, #114, #0; mov o25, o0; mov o0, o90; mov o90, o63; smbo #177, #0, #7, #0; mov o0, r0; smbo #7, #0, #47, #0; mov r0, o0; mov o40, o40; smbo #87, #0, #181, #0; mov o0, o22; mov o116, o61; smbo #181, #0, #181, #0; mov o61, o55; mov o55, o0; smbo #60, #0, #7, #0; mov o121, r0; smbo #7, #0, #27, #0; mov r0, o33; mov o53, o2; mov o22, o0; mov o20, o63; smbo #90, #0, #184, #0; mov o0, o32; mov o126, o0; smbo #61, #0, #7, #0; mov o123, r0; smbo #7, #0, #31, #0; mov r0, o30; mov o54, o0; mov o24, o60; smbo #91, #0, #188, #0; mov o0, o30; mov o127, o60; smbo #188, #0, #188, #0; mov o60, o0; smbo #188, #0, #7, #0; mov o0, r0; smbo #7, #0, #51, #0; mov r0, o0; mov o44, o27; smbo #78, #0, #116, #0; mov o0, o93; smbo #116, #0, #116, #0; mov o93, o54; mov o54, o0; mov o0, o25; smbo #54, #0, #7, #0; mov o87, r0; smbo #7, #0, #54, #0; mov r0, o0; mov o47, o23; mov o70, o93; smbo #106, #0, #106, #0; mov o41, o0; mov o0, o106; mov o106, o63; smbo #55, #0, #7, #0; mov o114, r0; smbo #7, #0, #55, #0; mov r0, o0; mov o48, o24; smbo #79, #0, #173, #0; mov o0, o38; smbo #173, #0, #173, #0; mov o38, o61; mov o61, o71; mov o71, o0; smbo #59, #0, #7, #0; mov o114, r0; smbo #7, #0, #59, #0; mov r0, o0; mov o52, o35; smbo #94, #0, #124, #0; mov o0, o93; mov o123, o62; mov o92, o0; mov o30, o33; smbo #62, #0, #7, #0; mov o95, r0; smbo #7, #0, #62, #0; mov r0, o0; mov o55, o31; mov o86, o93; smbo #122, #0, #122, #0; mov o33, o0; mov o0, o98; mov o98, o63; smbo #63, #0, #7, #0; mov o122, r0; smbo #7, #0, #63, #0; mov r0, o0; mov o56, o32; smbo #95, #0, #189, #0; mov o0, o30; mov o124, o61; smbo #189, #0, #189, #0; mov o61, o63; mov o63, o0; smbo #111, #0, #7, #0; mov o78, r0; smbo #7, #0, #111, #0; mov r0, o0; mov o104, o104; smbo #183, #0, #183, #0; mov o32, o52; mov o52, o63; mov o63, o54; mov o54, o0; smbo #183, #0, #7, #0; mov o0, r0; br PEST_EndOfAspectRatios; } #endif PEST_EndOfAspectRatios: #if (32 == EURASIA_ISPREGION_SIZEX) && (32 == EURASIA_ISPREGION_SIZEY) /* setting the smbo back after the moves*/ smbo #0, #0, #0, #0; #endif /* r4: number of lines, * r5: num of pixels in each line * r6: dst bytes per pixel * r10: number of done tiles */ #if defined(FIX_HW_BRN_30842) /* the number of submited bytes per emit * this assuming 2 pipes per tile in X */ mov r7, #~(EURASIA_ISPREGION_SIZEX - 1); and.testnz p0, r5, r7; p0 mov r7, #(EURASIA_ISPREGION_SIZEX / 2); (!p0) mov r7, r5; imae r8, r7.low, r6.low, #0, u32; /* set the PBE count*/ #if defined(SGX_FEATURE_UNIFIED_STORE_64BITS) shl r7, r7, #EURASIA_PIXELBES0LO_COUNT_SHIFT; or r0, r0, r7; and r9, r1, #~EURASIA_PIXELBES0HI_FBADDR_CLRMSK; shr r9, r9, #EURASIA_PIXELBES0HI_FBADDR_SHIFT; shl r9, r9, #EURASIA_PIXELBE_FBADDR_ALIGNSHIFT; #else #if defined(SGX535) /* Round emit count to nearest 4 pixels (HW restriction) */ add r7, r7.low, #3; shr r7, r7, #2; shl r7, r7, #(EURASIA_PIXELBE2S0_COUNT_SHIFT + 2); #else shl r7, r7, #EURASIA_PIXELBE2S0_COUNT_SHIFT; #endif or r2, r2, r7; and r9, r3, #~EURASIA_PIXELBE2S1_FBADDR_CLRMSK; shr r9, r9, #EURASIA_PIXELBE2S1_FBADDR_SHIFT; shl r9, r9, #EURASIA_PIXELBE_FBADDR_ALIGNSHIFT; #endif mov r7, #((EURASIA_ISPREGION_SIZEX / 2) - 1); and.testnz p0, r5, r7; p0 br PEST_ThinnerThanHalfTile; { and.testz p0, r10, r10; p0 br PEST_FirstTile; { /* readjusting tile base this step should have no effect if * inside the first tile or if the strided (PBE) offset matches * the twiddled (SW). otherwise we step over the done tiles * compensating for the PBE doing the same in strided. */ mov r11, #~(EURASIA_ISPREGION_SIZEX - 1); and.testnz p0, r5, r11; p0 mov r11, #(EURASIA_ISPREGION_SIZEX / 2); (!p0) mov r11, r5; iadd32 r7, r4.low, #(-1); shl r7, r7, #1; imae r7, r11.low, r7.low, #0, u32; imae r7, r6.low, r7.low, #0, u32; imae r9, r10.low, r7.low, r9, u32; } PEST_FirstTile: and.testz p0, #1, g17; p0 br PEST_NotRightSide; { /* on odd pipes we step over the even pipe but compensate * for the PBE doing the same in strided mode hence r4 - 1 * on 4 pipes we musn't have pixels on pipe 3 so that shouldn't * matter */ iadd32 r7, r4.low, #(-1); imae r9, r7.low, r8.low, r9, u32; } PEST_NotRightSide: } PEST_ThinnerThanHalfTile: #if EURASIA_ISPREGION_SIZEY == 32 /* the real condition would be 2_USSE_PIPES_PER_Y */ xor.testz p0, r4, #EURASIA_ISPREGION_SIZEY; p0 shr r4, r4, #1; #endif mov r6, #0; mov r10, #0; PEST_EachLine: { #if defined(SGX_FEATURE_UNIFIED_STORE_64BITS) and r0, r0, #EURASIA_PIXELBES0LO_OOFF_CLRMSK; shl r7, r6, #EURASIA_PIXELBES0LO_OOFF_SHIFT; or r0, r0, r7; and r1, r1, #EURASIA_PIXELBES0HI_FBADDR_CLRMSK; shr r7, r9, #EURASIA_PIXELBE_FBADDR_ALIGNSHIFT; shl r7, r7, #EURASIA_PIXELBES0HI_FBADDR_SHIFT; or r1, r1, r7; #else and r2, r2, #EURASIA_PIXELBE2S0_OOFF_CLRMSK; shl r7, r6, #EURASIA_PIXELBE2S0_OOFF_SHIFT; or r2, r2, r7; and r3, r3, #EURASIA_PIXELBE2S1_FBADDR_CLRMSK; shr r7, r9, #EURASIA_PIXELBE_FBADDR_ALIGNSHIFT; shl r7, r7, #EURASIA_PIXELBE2S1_FBADDR_SHIFT; or r3, r3, r7; #endif WAITFOROTHERPIPE(PEST_WaitForPipe); #if ! defined(SGX_FEATURE_UNIFIED_STORE_64BITS) /* kick the PBE*/ emitpix1 r0, r1; #endif PixelEventSubTwiddled_Sideband_Byte: nop; /*emitpix2 or emitpix with 64 bit US*/ FLIPFLOP; iaddu32 r9, r8.low, r9; /* PBE - unswizzled jump to next line*/ #if (EURASIA_ISPREGION_SIZEX == 32 && EURASIA_ISPREGION_SIZEY == 32) and r7, #3, r10; /* ob offsets: 0, 2, 16, 18, !!64 ... (if 16 pix wide)*/ and.testz p0, r7, #1; p0 iaddu32 r6, r6.low, #2; p0 br PEST_Even; { and.testz p0, r7, #2; p0 iadd32 r6, r6.low, #(14); (!p0) iadd32 r6, r6.low, #(46); } PEST_Even: #else and.testz p0, r10, #1; /* ob offsets: 0, 2, 16, 18, ... (if 8 pix wide)*/ p0 iaddu32 r6, r6.low, #(2); (!p0) iaddu32 r6, r6.low, #(14); #endif iadd32 r10, r10.low, #1; xor.testnz p0, r4, r10; p0 br PEST_EachLine; } DUMMYTILEEMIT(r3); #else /* do we cross pipe boundary ? */ mov r7, #PEST_2PIPE_MODE_MASK; and.testnz p0, r6, r7; p0 br PEST_CrossesPipeBoundary; { /* fast path */ /* do a single emit that frees up the partitions and kicks off the tile*/ #if ! defined(SGX_FEATURE_UNIFIED_STORE_64BITS) /* kick the PBE*/ emitpix1 r0, r1; #endif PixelEventSubTwiddled_Sideband_SinglePipe_Byte: nop; /*emitpix2 or emitpix with 64 bit US*/ /* should be unreachable if previous had .end*/ nop.end; } PEST_CrossesPipeBoundary: /* set NOADVANCE */ #if defined(SGX_FEATURE_UNIFIED_STORE_64BITS) or r13, r13, #EURASIA_PIXELBES2HI_NOADVANCE; #else or r1, r1, #EURASIA_PIXELBE1S1_NOADVANCE; #endif mov r7, #PEST_DIRECTION_X_MASK; and.testnz p0, r6, r7; p0 br PEST_DirectionNotYFirst; { /* now move the clip, we assume 2 pipes in given direction for ISP tile*/ #if defined(SGX_FEATURE_UNIFIED_STORE_64BITS) /* YMIN */ and r7, r12, #~EURASIA_PIXELBES2LO_YMIN_CLRMSK; and r12, r12, #EURASIA_PIXELBES2LO_YMIN_CLRMSK; shr r7, r7, #EURASIA_PIXELBES2LO_YMIN_SHIFT; imae r7, r10.low, #EURASIA_ISPREGION_SIZEY, r7, u32; shl r7, r7, #EURASIA_PIXELBES2LO_YMIN_SHIFT; or r12, r12, r7; /* YMAX */ and r7, r13, #~EURASIA_PIXELBES2HI_YMAX_CLRMSK; and r13, r13, #EURASIA_PIXELBES2HI_YMAX_CLRMSK; shr r7, r7, #EURASIA_PIXELBES2HI_YMAX_SHIFT; imae r7, r10.low, #EURASIA_ISPREGION_SIZEY, r7, u32; shl r7, r7, #EURASIA_PIXELBES2HI_YMAX_SHIFT; or r13, r13, r7; #else /* YMIN */ and r7, r0, #~EURASIA_PIXELBE1S0_YMIN_CLRMSK; and r0, r0, #EURASIA_PIXELBE1S0_YMIN_CLRMSK; shr r7, r7, #EURASIA_PIXELBE1S0_YMIN_SHIFT; imae r7, r10.low, #EURASIA_ISPREGION_SIZEY, r7, u32; shl r7, r7, #EURASIA_PIXELBE1S0_YMIN_SHIFT; or r0, r0, r7; /* YMAX */ and r7, r1, #~EURASIA_PIXELBE1S1_YMAX_CLRMSK; and r1, r1, #EURASIA_PIXELBE1S1_YMAX_CLRMSK; shr r7, r7, #EURASIA_PIXELBE1S1_YMAX_SHIFT; imae r7, r10.low, #EURASIA_ISPREGION_SIZEY, r7, u32; shl r7, r7, #EURASIA_PIXELBE1S1_YMAX_SHIFT; or r1, r1, r7; #endif br PEST_EndDirectionsFirst; } PEST_DirectionNotYFirst: { /* move the fbaddr*/ #if defined(SGX_FEATURE_UNIFIED_STORE_64BITS) and r7, r1, #~EURASIA_PIXELBES0HI_FBADDR_CLRMSK; shr r7, r7, #EURASIA_PIXELBES0HI_FBADDR_SHIFT; #else and r7, r3, #~EURASIA_PIXELBE2S1_FBADDR_CLRMSK; shr r7, r7, #EURASIA_PIXELBE2S1_FBADDR_SHIFT; #endif shl r7, r7, #EURASIA_PIXELBE_FBADDR_ALIGNSHIFT; and r8, r6, #PEST_ADDR_SHIFT_MASK; imae r8, r8.low, r10.low, #0, u32; shl r8, r8, #1; iadd32 r7, r8.low, r7; shr r7, r7, #EURASIA_PIXELBE_FBADDR_ALIGNSHIFT; #if defined(SGX_FEATURE_UNIFIED_STORE_64BITS) shl r7, r7, #EURASIA_PIXELBES0HI_FBADDR_SHIFT; and r1, r1, #EURASIA_PIXELBES0HI_FBADDR_CLRMSK; or r1, r1, r7; #else shl r7, r7, #EURASIA_PIXELBE2S1_FBADDR_SHIFT; and r3, r3, #EURASIA_PIXELBE2S1_FBADDR_CLRMSK; or r3, r3, r7; #endif #if defined(SGX_FEATURE_UNIFIED_STORE_64BITS) /* XMIN */ and r7, r12, #~EURASIA_PIXELBES2LO_XMIN_CLRMSK; and r12, r12, #EURASIA_PIXELBES2LO_XMIN_CLRMSK; shr r7, r7, #EURASIA_PIXELBES2LO_XMIN_SHIFT; imae r7, r10.low, #EURASIA_ISPREGION_SIZEX, r7, u32; shl r7, r7, #EURASIA_PIXELBES2LO_XMIN_SHIFT; or r12, r12, r7; /* XMAX */ and r7, r13, #~EURASIA_PIXELBES2HI_XMAX_CLRMSK; and r13, r13, #EURASIA_PIXELBES2HI_XMAX_CLRMSK; shr r7, r7, #EURASIA_PIXELBES2HI_XMAX_SHIFT; imae r7, r10.low, #EURASIA_ISPREGION_SIZEX, r7, u32; shl r7, r7, #EURASIA_PIXELBES2HI_XMAX_SHIFT; or r13, r13, r7; #else /* XMIN */ and r7, r0, #~EURASIA_PIXELBE1S0_XMIN_CLRMSK; and r0, r0, #EURASIA_PIXELBE1S0_XMIN_CLRMSK; shr r7, r7, #EURASIA_PIXELBE1S0_XMIN_SHIFT; imae r7, r10.low, #EURASIA_ISPREGION_SIZEX, r7, u32; shl r7, r7, #EURASIA_PIXELBE1S0_XMIN_SHIFT; or r0, r0, r7; /* XMAX */ and r7, r1, #~EURASIA_PIXELBE1S1_XMAX_CLRMSK; and r1, r1, #EURASIA_PIXELBE1S1_XMAX_CLRMSK; shr r7, r7, #EURASIA_PIXELBE1S1_XMAX_SHIFT; imae r7, r10.low, #EURASIA_ISPREGION_SIZEX, r7, u32; shl r7, r7, #EURASIA_PIXELBE1S1_XMAX_SHIFT; or r1, r1, r7; #endif } PEST_EndDirectionsFirst: WAITFOROTHERPIPE(PEST_2Pipes_First); #if ! defined(SGX_FEATURE_UNIFIED_STORE_64BITS) /* kick the PBE*/ emitpix1 r0, r1; #endif PixelEventSubTwiddled_Sideband_2Pipes_First_Byte: nop; /*emitpix2 or emitpix with 64 bit US*/ FLIPFLOP; mov r7, #PEST_DIRECTION_X_MASK; and.testnz p0, r6, r7; p0 br PEST_DirectionNotY; { /* now move the clip, we assume 2 pipes in given direction for ISP tile*/ #if defined(SGX_FEATURE_UNIFIED_STORE_64BITS) /* YMIN */ and r7, r12, #~EURASIA_PIXELBES2LO_YMIN_CLRMSK; and r12, r12, #EURASIA_PIXELBES2LO_YMIN_CLRMSK; shr r7, r7, #EURASIA_PIXELBES2LO_YMIN_SHIFT; iadd32 r7, r7.low, #(EURASIA_ISPREGION_SIZEY / 2); shl r7, r7, #EURASIA_PIXELBES2LO_YMIN_SHIFT; or r12, r12, r7; /* YMAX */ and r7, r13, #~EURASIA_PIXELBES2HI_YMAX_CLRMSK; and r13, r13, #EURASIA_PIXELBES2HI_YMAX_CLRMSK; shr r7, r7, #EURASIA_PIXELBES2HI_YMAX_SHIFT; iadd32 r7, r7.low, #(EURASIA_ISPREGION_SIZEY / 2); shl r7, r7, #EURASIA_PIXELBES2HI_YMAX_SHIFT; or r13, r13, r7; #else /* YMIN */ and r7, r0, #~EURASIA_PIXELBE1S0_YMIN_CLRMSK; and r0, r0, #EURASIA_PIXELBE1S0_YMIN_CLRMSK; shr r7, r7, #EURASIA_PIXELBE1S0_YMIN_SHIFT; iadd32 r7, r7.low, #(EURASIA_ISPREGION_SIZEY / 2); shl r7, r7, #EURASIA_PIXELBE1S0_YMIN_SHIFT; or r0, r0, r7; /* YMAX */ and r7, r1, #~EURASIA_PIXELBE1S1_YMAX_CLRMSK; and r1, r1, #EURASIA_PIXELBE1S1_YMAX_CLRMSK; shr r7, r7, #EURASIA_PIXELBE1S1_YMAX_SHIFT; iadd32 r7, r7.low, #(EURASIA_ISPREGION_SIZEY / 2); shl r7, r7, #EURASIA_PIXELBE1S1_YMAX_SHIFT; or r1, r1, r7; #endif br PEST_EndDirections; } PEST_DirectionNotY: { /* move the fbaddr*/ #if defined(SGX_FEATURE_UNIFIED_STORE_64BITS) and r7, r1, #~EURASIA_PIXELBES0HI_FBADDR_CLRMSK; shr r7, r7, #EURASIA_PIXELBES0HI_FBADDR_SHIFT; #else and r7, r3, #~EURASIA_PIXELBE2S1_FBADDR_CLRMSK; shr r7, r7, #EURASIA_PIXELBE2S1_FBADDR_SHIFT; #endif shl r7, r7, #EURASIA_PIXELBE_FBADDR_ALIGNSHIFT; and r8, r6, #PEST_ADDR_SHIFT_MASK; imae r7, r8.low, #1, r7, u32; shr r7, r7, #EURASIA_PIXELBE_FBADDR_ALIGNSHIFT; #if defined(SGX_FEATURE_UNIFIED_STORE_64BITS) shl r7, r7, #EURASIA_PIXELBES0HI_FBADDR_SHIFT; and r1, r1, #EURASIA_PIXELBES0HI_FBADDR_CLRMSK; or r1, r1, r7; #else shl r7, r7, #EURASIA_PIXELBE2S1_FBADDR_SHIFT; and r3, r3, #EURASIA_PIXELBE2S1_FBADDR_CLRMSK; or r3, r3, r7; #endif #if defined(SGX_FEATURE_UNIFIED_STORE_64BITS) /* XMIN */ and r7, r12, #~EURASIA_PIXELBES2LO_XMIN_CLRMSK; and r12, r12, #EURASIA_PIXELBES2LO_XMIN_CLRMSK; shr r7, r7, #EURASIA_PIXELBES2LO_XMIN_SHIFT; iadd32 r7, r7.low, #(EURASIA_ISPREGION_SIZEX / 2); shl r7, r7, #EURASIA_PIXELBES2LO_XMIN_SHIFT; or r12, r12, r7; /* XMAX */ and r7, r13, #~EURASIA_PIXELBES2HI_XMAX_CLRMSK; and r13, r13, #EURASIA_PIXELBES2HI_XMAX_CLRMSK; shr r7, r7, #EURASIA_PIXELBES2HI_XMAX_SHIFT; iadd32 r7, r7.low, #(EURASIA_ISPREGION_SIZEX / 2); shl r7, r7, #EURASIA_PIXELBES2HI_XMAX_SHIFT; or r13, r13, r7; #else /* XMIN */ and r7, r0, #~EURASIA_PIXELBE1S0_XMIN_CLRMSK; and r0, r0, #EURASIA_PIXELBE1S0_XMIN_CLRMSK; shr r7, r7, #EURASIA_PIXELBE1S0_XMIN_SHIFT; iadd32 r7, r7.low, #(EURASIA_ISPREGION_SIZEX / 2); shl r7, r7, #EURASIA_PIXELBE1S0_XMIN_SHIFT; or r0, r0, r7; /* XMAX */ and r7, r1, #~EURASIA_PIXELBE1S1_XMAX_CLRMSK; and r1, r1, #EURASIA_PIXELBE1S1_XMAX_CLRMSK; shr r7, r7, #EURASIA_PIXELBE1S1_XMAX_SHIFT; iadd32 r7, r7.low, #(EURASIA_ISPREGION_SIZEX / 2); shl r7, r7, #EURASIA_PIXELBE1S1_XMAX_SHIFT; or r1, r1, r7; #endif } PEST_EndDirections: /* clear NOADVANCE */ #if defined(SGX_FEATURE_UNIFIED_STORE_64BITS) /* despite the name it's a CLRMSK*/ and r13, r13, #EURASIA_PIXELBES2HI_NOADVANCE_MASK; #else and r1, r1, #EURASIA_PIXELBE1S1_NOADVANCE_MASK; #endif /* now kick the PBE with noadvance low, .freep */ WAITFOROTHERPIPE(PEST_2Pipes_Second); #if ! defined(SGX_FEATURE_UNIFIED_STORE_64BITS) /* kick the PBE*/ emitpix1.freep r0, r1; #endif PixelEventSubTwiddled_Sideband_2Pipes_Second_Byte: nop; /*emitpix2 or emitpix with 64 bit US*/ /* flip the pipe mutex */ FLIPFLOP; nop.end; #endif } SubTwiddledEnd: /***************************************************************************** End of file (subtwiddled_eot.asm) *****************************************************************************/
test3.asm
astrellon/moss
0
5256
<reponame>astrellon/moss<gh_stars>0 ; Third test file #include "stdmath.asm" ; MMU setup ; Sets a 1 to 1 mapping up to 32 mmu_setup: #define PAGE_TABLE_SIZE 32 MOV r0 0 ; Page table index mmu_start: CMP r0 PAGE_TABLE_SIZE ;< MOV @r0 r0 INC r0 < JMP mmu_start RETURN ; Peripheral setup perf_setup: #define perf_index r0 #define perf_offset r1 #define perf_store r2 #define perf_store_base r6 MOV perf_index 0 ; Perf index MOV perf_store PAGE_TABLE_SIZE ; Index to store the results from the IO_ASSIGNs MOV perf_store_base perf_store MOV perf_offset 32 ; Perf memory offset ADD perf_offset 32 perf_start: ; Send general port status, returns: ; 1: Attached and assigned ; 0: Attached but not assigned ; -1: Nothing attached ; -2: Out of bounds for peripherals ; -3: Other error #define perf_result r3 IO_SEND perf_result perf_index 0 CMP perf_result 0 == JMP perf_assign ; Unassigned PRINT "Skippd jmp\n" INC perf_index > JMP perf_start ; Assigned CMP perf_result -1 ; Check if attached == JMP perf_start ; Not attached, skip < JMP perf_end ; At the end of the perfs perf_assign: #define perf_memory_result r4 IO_SEND perf_memory_result perf_index 1 ; Ask the peripheral how much memory it wants. MOV @perf_store perf_offset ; Store the memory offset of the perf INC perf_store MOV @perf_store perf_memory_result ; Store the amount of memory the perf wanted. INC perf_store IO_ASSIGN perf_index perf_offset perf_memory_result ADD perf_offset perf_memory_result INC perf_index JMP perf_start perf_end: RETURN ; Main program main: CALL mmu_setup CALL perf_setup REGI 0 func_double MOV r5 perf_store_base MOV r0 @r5 ; Grab the offset of the first perf INC r5 MOV r1 @r5 ; Grab the size of the first perf ; Write test MOV r2 0 MOV r3 5 mem_start: CMP r2 r1 >= JMP mem_end MOV @r0 r3 ADD r3 5 INC r2 INC r0 JMP mem_start mem_end: IO_SEND 0 0x12 MOV r0 0 start: CMP r0 0x00FFFFFF ;CMP r0 10 < INC r0 < JMP start end: PUSH 5 PUSH 8 CALL func_add POP r10 PRINT "Add result " PRINT r10 PRINT "\n" PUSH r10 INT 0 POP r9 PRINT "Double result " PRINT r9 PRINT "\n" PRINT "Finishing\n" HALT
src/stage1/boot.asm
Cc618/Os2020
3
98915
<filename>src/stage1/boot.asm ; Loads the second stage bootloader, switch to protected mode ; Os entry entry: ; Default drive id mov byte [defaultDrive], dl ; Setup stack mov bp, STAGE1_STACK_TOP mov sp, bp ; Load stage 2 with BIOS call loadStage2 ; Go to Protected Mode call switchPm ; Procedure which loads the second stage bootloader loadStage2: ; bx is the start offset of the chunk we load mov bx, 0 ; cx is the sector we read mov cx, 2 loadStage2.loadCurrentSector: ; Load the current sector push cx push bx call loadSector pop bx pop cx inc word [loadedSectors] ; Load possible end of stage2 push es add bx, 508 mov ax, STAGE2_OFFSET >> 4 mov es, ax mov ax, [es:bx] add bx, 2 mov dx, [es:bx] pop es ; Check end of stage 2 magic dword cmp ax, END_OF_STAGE2_LOW jne loadStage2.notLoaded cmp dx, END_OF_STAGE2_HIGH je loadStage2.loaded loadStage2.notLoaded: ; The start offset must be incremented of 512 = 508 + 2 + 2 add bx, 2 inc cx jmp loadStage2.loadCurrentSector loadStage2.loaded: ret ; Procedure to switch to the 32 bits protected mode switchPm: ; Disable interrupts cli ; Load the GDT lgdt [gdt_descriptor] ; Set the protected mode bit mov eax, cr0 or eax, 1 mov cr0, eax ; Far jump with the code segment to 32 bits jmp CODE_SEG:protectedMain ; --- Variables --- ; defaultDrive: db 0 ; 1 because the boot is already loaded loadedSectors: dw 1 ; --- Constants --- ; OK: db 'OK !', 0 ERR_LOAD: db "Can't read disk", 0
HO.asm
Mohamed-94/Group-of-Assembly-Programs-Samples--8086-85-Processors-family-
16
178105
TITLE SECOND: DISPLAY STRING .MODEL SMALL .STACK 100H .DATA userMsg DB 'Please enter a number: ' lenUserMsg equ $-userMsg dispMsg DB 'You have entered: ' lenDispMsg equ $-dispMsg section .bss num resb 5 section .text global main main: mov eax,4 mov ebx,1 mov ecx, userMsg mov edx, lenUserMsg int 80h mov eax, 3 mov ebx, 2 mov ecx, num mov edx, 5 int 80h mov eax, 4 mov ebx, 1 mov ecx, dispMsg mov edx, lenDispMsg int 80h mov eax, 4 mov ebx, 1 mov ecx, num mov edx, 5 int 80h mov eax, 1 mov ebx, 0 int 80h MAIN ENDP END MAIN
courses/fundamentals_of_ada/labs/solar_system/adv_240_tasking_protected_objects/answers/solar_system-graphics.adb
AdaCore/training_material
15
7177
with Ada.Real_Time; use Ada.Real_Time; package body Solar_System.Graphics is procedure Draw_Body (Object : Body_T; Canvas : Canvas_ID) is Tail_Color : RGBA_T; Dimmer : Color_Component_T := 30; function Dim (C : Color_Component_T) return Color_Component_T is begin if C < Dimmer then return 0; else return C - Dimmer; end if; end Dim; begin if Object.Visible then Draw_Sphere (Canvas => Canvas, Position => (Object.Pos.X, Object.Pos.Y, 0.0), Radius => Object.Radius, Color => Object.Color); if Object.With_Tail then Tail_Color := Object.Color; for I in reverse Tail_T'First .. Tail_T'Last loop Draw_Sphere (Canvas => Canvas, Position => (Object.Tail (I).X, Object.Tail (I).Y, 0.0), Radius => Object.Radius, Color => Tail_Color); Tail_Color.R := Dim (Tail_Color.R); Tail_Color.G := Dim (Tail_Color.G); Tail_Color.B := Dim (Tail_Color.B); end loop; end if; end if; end Draw_Body; end Solar_System.Graphics;
test/Fail/Issue1384.agda
cruhland/agda
1,989
1836
<gh_stars>1000+ -- {-# OPTIONS --no-coverage #-} -- {-# OPTIONS -v tc.cover:20 #-} open import Common.Bool open import Common.Equality _∨_ : Bool → Bool → Bool a ∨ b = if a then true else b module Works where data Term : Bool → Set where I : Term false App : ∀ a b c → a ∨ b ≡ c → Term a → Term b → Term c -- The following clause works for the coverage checker: test : Term false → Set test (App false false .false refl I x) = Bool module Fails where data Term : Bool -> Set where I : Term false App : ∀ a b c → Term a → Term b → a ∨ b ≡ c → Term c -- If we put the equality proof later in App, it fails: test : Term false → Set test (App false false .false I x refl) = Bool -- The following checks, until you split at p. -- test (App false false .false I x p) = {!p!}
Bank_C/3_gezneg.asm
ndf-zz/fv1testing
0
103258
; FV-1 Testing Bank ; ; Check behaviour of FV-1 against documentation ; ; Program 3 : Skip Flags ; POT0 : TESTMODE NEG|ZRO|GEZ ; ; - use pot to choose mode / extra flag: run, zro, gez, neg ; - confirm mode on DACR ; - note: assumes unconditional clr skp ZRO,target working ; ; neg | zro | gez equ mode0 -0.9 ; mode 0: * | | equ mode1 -0.6 ; mode 1: * | * | equ mode2 -0.3 ; mode 2: * | * | * equ mode3 0.0 ; mode 3: | * | equ mode4 0.3 ; mode 4: | * | * equ mode5 0.6 ; mode 5: * | | * equ mode6 0.9 ; mode 6: | | * equ CUR REG0 equ PREV REG1 equ MAX REG2 skp RUN,read clr or 0x7fffff wrax MAX,0.0 read: ldax ADCL and 0xfffff0 ; mask off low bits wrax CUR,0.0 ; use pot to determine which test to run: or 0x0000ff ; put small offset in ACC rdax POT0,-1.0 ; read pot0 inverted and add to ACC skp GEZ,test0 sof 1.0,0.125 skp GEZ,test1 sof 1.0,0.125 skp GEZ,test2 sof 1.0,0.125 skp GEZ,test3 sof 1.0,0.125 skp GEZ,test4 sof 1.0,0.125 skp GEZ,test5 ; test 6 GEZ only test6: clr or mode6 wrax DACR,0.0 ldax CUR skp GEZ,mark clr skp ZRO,space ; test 0 GEZ only test0: clr or mode0 wrax DACR,0.0 ldax CUR skp NEG,mark clr skp ZRO,space ; test 1 NEG|ZRO test1: clr or mode1 wrax DACR,0.0 ldax CUR skp NEG|ZRO,mark clr skp ZRO,space ; test 2 NEG|ZRO|GEZ test2: clr or mode2 wrax DACR,0.0 ldax CUR skp NEG|ZRO|GEZ,mark clr skp ZRO,space ; test 3 ZRO test3: clr or mode3 wrax DACR,0.0 ldax CUR skp ZRO,mark clr skp ZRO,space ; test 4 ZRO|GEZ test4: clr or mode4 wrax DACR,0.0 ldax CUR skp ZRO|GEZ,mark clr skp ZRO,space ; test 5 NEG|GEZ test5: clr or mode5 wrax DACR,0.0 ldax CUR skp NEG|GEZ,mark clr skp ZRO,space ; write a space to output - assumes ACC clear space: wrax DACL,0.0 skp ZRO,end ; write a mark to output mark: ldax MAX wrax DACL,0.0 ; save current sample for next iteration end: ldax CUR wrax PREV,0.0
programs/oeis/063/A063081.asm
neoneye/loda
22
103859
<filename>programs/oeis/063/A063081.asm ; A063081: Dimension of the space of weight 2n cusp forms for Gamma_0( 13 ). ; 0,3,5,7,9,13,13,17,19,21,23,27,27,31,33,35,37,41,41,45,47,49,51,55,55,59,61,63,65,69,69,73,75,77,79,83,83,87,89,91,93,97,97,101,103,105,107,111,111,115 mov $1,$0 mul $0,2 add $0,1 seq $1,63195 ; Dimension of the space of weight 2n cuspidal newforms for Gamma_0( 6 ). add $0,$1 sub $0,1
blink.asm
volodink/asmtest101
1
5345
.equ DDRB, 0x04 .equ PORTB, 0x05 .org 0x0000 reset: sbi DDRB, 5 main: sbi PORTB, 5 rcall wait cbi PORTB, 5 rcall wait rjmp main wait: ldi r16, 1 OUTER_LOOP: ldi r24, 1 ldi r25, 1 DELAY_LOOP: adiw r24, 1 brne DELAY_LOOP dec r16 nop nop brne OUTER_LOOP ret
data/mapObjects/PokemonTower4F.asm
AmateurPanda92/pokemon-rby-dx
9
170321
PokemonTower4F_Object: db $1 ; border block db 2 ; warps warp 3, 9, 0, POKEMON_TOWER_5F warp 18, 9, 1, POKEMON_TOWER_3F db 0 ; signs db 6 ; objects object SPRITE_MEDIUM, 5, 10, STAY, RIGHT, 1, OPP_CHANNELER, 9 object SPRITE_MEDIUM, 15, 7, STAY, DOWN, 2, OPP_CHANNELER, 10 object SPRITE_MEDIUM, 14, 12, STAY, LEFT, 3, OPP_CHANNELER, 12 object SPRITE_BALL, 12, 10, STAY, NONE, 4, ELIXER object SPRITE_BALL, 9, 10, STAY, NONE, 5, AWAKENING object SPRITE_BALL, 12, 16, STAY, NONE, 6, HP_UP ; warp-to warp_to 3, 9, POKEMON_TOWER_4F_WIDTH ; POKEMON_TOWER_5F warp_to 18, 9, POKEMON_TOWER_4F_WIDTH ; POKEMON_TOWER_3F
src/coreclr/nativeaot/Runtime/arm/GetThread.asm
pyracanda/runtime
9,402
16720
;; Licensed to the .NET Foundation under one or more agreements. ;; The .NET Foundation licenses this file to you under the MIT license. #include "AsmMacros.h" TEXTAREA ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; RhpGetThread ;; ;; ;; INPUT: none ;; ;; OUTPUT: r0: Thread pointer ;; ;; MUST PRESERVE ARGUMENT REGISTERS ;; @todo check the actual requirements here, r0 is both return and argument register ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LEAF_ENTRY RhpGetThread ;; r0 = GetThread(), TRASHES r12 INLINE_GETTHREAD r0, r12 bx lr LEAF_END FASTCALL_ENDFUNC INLINE_GETTHREAD_CONSTANT_POOL end
awa/plugins/awa-blogs/src/awa-blogs.ads
twdroeger/ada-awa
0
10010
----------------------------------------------------------------------- -- awa-blogs -- Blogs module -- Copyright (C) 2011, 2014, 2015, 2018 <NAME> -- Written by <NAME> (<EMAIL>) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- -- = Blogs Module = -- The `blogs` module is a small blog application which allows users to publish articles. -- A user may own several blogs, each blog having a name and its own base URI. Within a blog, -- the user may write articles and publish them. Once published, the articles are visible to -- anonymous users. -- -- The `blogs` module uses the [AWA_Tags] and [AWA_Comments] modules to allow to associate -- tags to a post and allow users to comment on the articles. -- -- @include awa-blogs-modules.ads -- -- @include awa-blogs-beans.ads -- @include-bean blogs.xml -- @include-bean blog-admin-post-list.xml -- @include-bean blog-post-list.xml -- @include-bean blog-comment-list.xml -- @include-bean blog-list.xml -- @include-bean blog-tags.xml -- -- == Queries == -- @include-query blog-admin-post-list.xml -- @include-query blog-post-list.xml -- @include-query blog-comment-list.xml -- @include-query blog-list.xml -- @include-query blog-tags.xml -- -- == Data model == -- [images/awa_blogs_model.png] -- package AWA.Blogs is pragma Pure; end AWA.Blogs;
archive/emails/mail.scpt
harrygxu/harryxu.github.io
0
3043
<reponame>harrygxu/harryxu.github.io<filename>archive/emails/mail.scpt<gh_stars>0 #!/usr/bin/osascript on run argv set msgSubject to "Your SoCal PLS 2015 talk proposal" set msgFile to item 1 of argv set email to (do shell script ("basename " & (msgFile as text))) set filename to (do shell script "pwd") & "/" & (msgFile as text) set msgContents to (read POSIX file filename) as «class utf8» tell application "Mail" set msg to make new outgoing message with properties {subject:msgSubject, content:msgContents} tell msg to make new to recipient at end of every to recipient with properties {address:email} end tell end run
restartApp.applescript
rcmdnk/AppleScript
11
898
<reponame>rcmdnk/AppleScript<filename>restartApp.applescript property DEF_APP_NAME : "HyperSwitch" property DEF_DIR : "/Applications" on restartApp(pars) set {appName, dir} to {DEF_APP_NAME, DEF_DIR} try set appName to appName of pars end try try set dir to dir of pars end try if application appName is running then tell application appName to quit repeat while application appName is running delay 0.1 end repeat end if tell application (dir & "/" & appName & ".app") activate end tell end restartApp on run restartApp({}) end run