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
Transynther/x86/_processed/NONE/_xt_sm_/i7-7700_9_0x48.log_34_1688.asm
ljhsiun2/medusa
9
1514
<gh_stars>1-10 .global s_prepare_buffers s_prepare_buffers: push %r13 push %r14 push %r9 push %rbp push %rcx push %rdi push %rsi lea addresses_D_ht+0x1ba61, %r13 nop nop nop cmp %r9, %r9 mov (%r13), %ebp add $5699, %r14 lea addresses_WT_ht+0x15c61, %rsi lea addresses_WT_ht+0x14a21, %rdi clflush (%rsi) nop nop sub %rbp, %rbp mov $83, %rcx rep movsw nop nop nop nop cmp %r13, %r13 lea addresses_A_ht+0x14f91, %rbp nop and $24313, %r9 and $0xffffffffffffffc0, %rbp movaps (%rbp), %xmm6 vpextrq $0, %xmm6, %rcx dec %r14 lea addresses_UC_ht+0x861, %rcx nop nop nop nop and %rbp, %rbp movw $0x6162, (%rcx) and %r13, %r13 pop %rsi pop %rdi pop %rcx pop %rbp pop %r9 pop %r14 pop %r13 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r12 push %r8 push %r9 push %rcx // Store lea addresses_WC+0x3861, %r9 nop nop nop nop sub %r11, %r11 mov $0x5152535455565758, %r10 movq %r10, %xmm3 vmovups %ymm3, (%r9) nop nop cmp %r11, %r11 // Faulty Load lea addresses_WC+0x3861, %rcx clflush (%rcx) nop nop nop add %r8, %r8 mov (%rcx), %r11 lea oracles, %r8 and $0xff, %r11 shlq $12, %r11 mov (%r8,%r11,1), %r11 pop %rcx pop %r9 pop %r8 pop %r12 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 6, 'size': 4, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': True, 'congruent': 3, 'size': 16, 'same': False, 'NT': True}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 11, 'size': 2, 'same': False, 'NT': True}} {'58': 34} 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 */
test-resources/ExamplesFromRoy/md_example2.ads
hergin/ada2fuml
0
16099
<reponame>hergin/ada2fuml<gh_stars>0 with Globals_Example1; package Md_Example2 is type Record_With_Integer_Rtype is record Attribute : Globals_Example1.Itype; end record; function Compute_An_Itype (The_Rtype : Record_With_Integer_Rtype) return Globals_Example1.Itype; end Md_Example2;
source/directories/machine-w64-mingw32/s-nadite.ads
ytomino/drake
33
22483
<filename>source/directories/machine-w64-mingw32/s-nadite.ads<gh_stars>10-100 pragma License (Unrestricted); -- implementation unit specialized for Windows package System.Native_Directories.Temporary is -- There are subprograms to create temporary file or directory. pragma Preelaborate; function Temporary_Directory return String; procedure Set_Temporary_Directory (Name : String); function Create_Temporary_File (Directory : String) return String; function Create_Temporary_Directory (Directory : String) return String; end System.Native_Directories.Temporary;
Irvine/Examples/ch16/TextWin.asm
alieonsido/ASM_TESTING
0
104731
TITLE Color Text Window (TextWin.asm) ; Displays a color window and writes text inside. ; Last update: 06/01/2006 INCLUDE Irvine16.inc .data message BYTE "Message in Window",0 .code main PROC mov ax,@data mov ds,ax ; Scroll a window. mov ax,0600h ; scroll window mov bh,(blue SHL 4) OR yellow ; attribute mov cx,050Ah ; upper-left corner mov dx,0A30h ; lower-right corner int 10h ; Position the cursor inside the window. mov ah,2 ; set cursor position mov dx,0714h ; row 7, col 20 mov bh,0 ; video page 0 int 10h ; Write some text in the window. mov dx,OFFSET message call WriteString ; Wait for a keypress. mov ah,10h int 16h exit main ENDP END main
src/MLib/Fin/Parts/Nat.agda
bch29/agda-matrices
0
889
module MLib.Fin.Parts.Nat where open import MLib.Prelude open import MLib.Fin.Parts.Core open Nat using (_*_; _+_; _<_) open Fin using (fromℕ≤) open Table module Impl where tryLookup : ∀ {n} {a} {A : Set a} → A → Table A n → ℕ → A tryLookup {n = zero} z t _ = z tryLookup {n = suc n} z t zero = lookup t zero tryLookup {n = suc n} z t (suc i) = tryLookup z (tail t) i tryLookup-prop : ∀ {n} {a} {A : Set a} {z : A} (t : Table A n) {i : Fin n} → lookup t i ≡ tryLookup z t (Fin.toℕ i) tryLookup-prop _ {i = zero} = ≡.refl tryLookup-prop t {i = suc i} = tryLookup-prop (tail t) data Ordering′ : ℕ → ℕ → Set where less : ∀ m k → Ordering′ m (suc (m + k)) gte : ∀ m k → Ordering′ (m + k) m compare′ : ∀ m n → Ordering′ m n compare′ zero zero = gte zero zero compare′ zero (suc n) = less zero n compare′ (suc m) zero = gte zero (suc m) compare′ (suc m) (suc n) with compare′ m n compare′ (suc m) (suc .(suc (m + k))) | less .m k = less (suc m) k compare′ (suc .(n + k)) (suc n) | gte .n k = gte (suc n) k -- Core lemmas lz-lem : ∀ a b c → a + b < a + c → b < c lz-lem zero b c p = p lz-lem (suc a) b c p = lz-lem a b c (Nat.+-cancelˡ-≤ 1 p) lz-lem₂ : ∀ a b → a < a + b → 0 < b lz-lem₂ zero b p = p lz-lem₂ (suc a) b p = lz-lem₂ a b (Nat.+-cancelˡ-≤ 1 p) fromℕ≤-cong′ : ∀ {a b m n} {p : a < m} {q : b < n} → m ≡ n → a ≡ b → fromℕ≤ {a} p ≅ fromℕ≤ {b} q fromℕ≤-cong′ {p = Nat.s≤s Nat.z≤n} {Nat.s≤s Nat.z≤n} ≡.refl ≡.refl = ≅.refl fromℕ≤-cong′ {p = Nat.s≤s (Nat.s≤s p)} {Nat.s≤s (Nat.s≤s q)} ≡.refl ≡.refl = ≅.cong suc (fromℕ≤-cong′ {p = Nat.s≤s p} {q = Nat.s≤s q} ≡.refl ≡.refl) fromℕ≤-cong : ∀ {a b n} {p : a < n} {q : b < n} → a ≡ b → fromℕ≤ {a} p ≡ fromℕ≤ {b} q fromℕ≤-cong = ≅.≅-to-≡ ∘ fromℕ≤-cong′ ≡.refl -- Core functions fromParts : {numParts : ℕ} (parts : Table ℕ numParts) → ℕ × ℕ → ℕ fromParts parts (zero , j) = j fromParts {zero} parts (suc i , j) = 0 fromParts {suc numParts} parts (suc i , j) = lookup parts zero + fromParts (tail parts) (i , j) toParts : {numParts : ℕ} (parts : Table ℕ numParts) (k : ℕ) → ℕ × ℕ toParts {zero} parts k = 0 , 0 toParts {suc n} parts k with lookup parts zero | compare′ k (lookup parts zero) toParts {suc n} parts k | .(suc (k + k₁)) | less .k k₁ = 0 , k toParts {suc n} parts .(lz + k) | lz | gte .lz k = let i , j = toParts (tail parts) k in (suc i , j) -- Property lemmas +-<-lem : ∀ {a b c} → b < c → a + b < a + c +-<-lem {zero} p = p +-<-lem {suc a} p = Nat.s≤s (+-<-lem p) fromℕ-suc-lem : ∀ {m n} (p : m < n) → suc (fromℕ≤ p) ≡ fromℕ≤ (Nat.s≤s p) fromℕ-suc-lem (Nat.s≤s p) = ≡.refl -- Properties fromParts-prop : ∀ {numParts} (parts : Table ℕ numParts) {i j} → i < numParts → j < tryLookup 0 parts i → fromParts parts (i , j) < sum parts fromParts-prop {suc numParts} _ {zero} (Nat.s≤s p) q = Nat.≤-trans q (Nat.m≤m+n _ _) fromParts-prop {suc numParts} parts {suc i} (Nat.s≤s p) q = +-<-lem (fromParts-prop (tail parts) p q) toParts-prop : ∀ {numParts : ℕ} (parts : Table ℕ numParts) {k} → k < sum parts → let i , j = toParts parts k in Σ (i < numParts) (λ q → j < lookup parts (fromℕ≤ {i} q)) toParts-prop {zero} parts {k} () toParts-prop {suc numParts} parts {k} p with lookup parts zero | compare′ k (lookup parts zero) | ≡.inspect (lookup parts) zero toParts-prop {suc numParts} parts {k} p | .(suc (k + k₁)) | less .k k₁ | ≡.[ eq ] = Nat.s≤s Nat.z≤n , Nat.≤-trans (Nat.s≤s (Nat.m≤m+n _ _)) (Nat.≤-reflexive (≡.sym eq)) toParts-prop {suc numParts} parts {.(lz + k)} p | lz | gte .lz k | insp = let q , r = toParts-prop (tail parts) {k} (lz-lem _ _ _ p) in Nat.s≤s q , Nat.≤-trans r (Nat.≤-reflexive (≡.cong (lookup parts) (fromℕ-suc-lem _))) toParts-fromParts : {numParts : ℕ} (parts : Table ℕ numParts) (i j : ℕ) (p : j < tryLookup 0 parts i) → toParts parts (fromParts parts (i , j)) ≡ (i , j) toParts-fromParts {zero} _ i j () toParts-fromParts {suc numParts} parts i j p with lookup parts zero | fromParts parts (i , j) | compare′ (fromParts parts (i , j)) (lookup parts zero) | ≡.inspect (lookup parts) zero | ≡.inspect (fromParts parts) (i , j) toParts-fromParts {suc numParts} parts zero .ipi p | .(suc (ipi + k)) | ipi | less .ipi k | insp₁ | ≡.[ ≡.refl ] = ≡.refl toParts-fromParts {suc numParts} parts zero .(lookup parts zero + k) p | .(lookup parts zero) | .(lookup parts zero + k) | gte .(lookup parts zero) k | ≡.[ ≡.refl ] | ≡.[ ≡.refl ] = ⊥-elim (Nat.n≮n _ (Nat.≤-trans p (Nat.m≤m+n _ k))) toParts-fromParts {suc numParts} parts (suc i) j p | .(suc (ipi + k)) | ipi | less .ipi k | ≡.[ eq ] | ≡.[ eq₁ ] = let y = lookup parts zero z = fromParts _ (i , j) in ⊥-elim (Nat.m≢1+m+n y {z + k} ( begin y ≡⟨ eq ⟩ suc (ipi + k) ≡⟨ ≡.cong (λ h → suc (h + k)) (≡.sym eq₁) ⟩ suc ((y + z) + k) ≡⟨ ≡.cong suc (Nat.+-assoc y z k) ⟩ suc (y + (z + k)) ∎)) where open ≡.Reasoning toParts-fromParts {suc numParts} parts (suc i) j p | .(lookup parts zero) | .(lookup parts zero + k) | gte .(lookup parts zero) k | ≡.[ ≡.refl ] | ≡.[ eq₁ ] with Nat.+-cancelˡ-≡ (lookup parts zero) eq₁ toParts-fromParts {suc numParts} parts (suc i) j p | .(lookup parts zero) | .(lookup parts zero + k) | gte .(lookup parts zero) k | ≡.[ ≡.refl ] | ≡.[ eq₁ ] | eq₂ rewrite ≡.sym eq₂ = let q , r = Σ.≡⇒Pointwise-≡ (toParts-fromParts (tail parts) i j p) in Σ.Pointwise-≡⇒≡ (≡.cong suc q , r) fromParts-toParts : {numParts : ℕ} (parts : Table ℕ numParts) (k : ℕ) (p : k < sum parts) → fromParts parts (toParts parts k) ≡ k fromParts-toParts {zero} parts k () fromParts-toParts {suc numParts} parts k p with lookup parts zero | compare′ k (lookup parts zero) | ≡.inspect (lookup parts) zero fromParts-toParts {suc numParts} parts k p | .(suc (k + k₁)) | less .k k₁ | insp = ≡.refl fromParts-toParts {suc numParts} parts .(lookup parts zero + k) p | .(lookup parts zero) | gte .(lookup parts zero) k | ≡.[ ≡.refl ] = ≡.cong₂ Nat._+_ ≡.refl (fromParts-toParts (tail parts) k (Nat.+-cancelˡ-≤ (lookup parts zero) (Nat.≤-trans (Nat.≤-reflexive (Nat.+-suc _ k)) p))) module Partsℕ {a} {A : Set a} {size : A → ℕ} (P : Parts A size) where open Parts P public fromParts : ℕ × ℕ → ℕ fromParts = Impl.fromParts partsizes toParts : ℕ → ℕ × ℕ toParts = Impl.toParts partsizes private tryLookup-lem : ∀ {i j} (p : i < numParts) → j < sizeAt (Fin.fromℕ≤ p) → j < Impl.tryLookup 0 partsizes i tryLookup-lem p q = Nat.≤-trans q (Nat.≤-reflexive (≡.trans (Impl.tryLookup-prop {z = 0} partsizes) (≡.cong (Impl.tryLookup 0 partsizes) (Fin.toℕ-fromℕ≤ _)))) fromParts-prop : ∀ {i j} (p : i < numParts) → j < sizeAt (Fin.fromℕ≤ p) → fromParts (i , j) < totalSize fromParts-prop p = Impl.fromParts-prop _ p ∘ tryLookup-lem p toParts-prop : ∀ {k} → k < totalSize → let i , j = toParts k in Σ (i < numParts) (λ q → j < lookup partsizes (fromℕ≤ q)) toParts-prop = Impl.toParts-prop _ abstract toParts-fromParts : ∀ {i j} (p : i < numParts) (q : j < sizeAt (Fin.fromℕ≤ p)) → toParts (fromParts (i , j)) ≡ (i , j) toParts-fromParts p = Impl.toParts-fromParts partsizes _ _ ∘ tryLookup-lem p fromParts-toParts : ∀ k (p : k < totalSize) → fromParts (toParts k) ≡ k fromParts-toParts = Impl.fromParts-toParts partsizes
attic/fb_rawshader/stencil_test_vs.asm
ilbers/etna_viv
121
172255
; very basic vertex shader ; z = (z+w)/2 ; 1 temporary register used (t0) ADD t0.__z_, t0.zzzz, void, t0.wwww MUL t0.__z_, t0.zzzz, u0.xxxx, void
src/tiny.ads
hgrodriguez/tiny_rp2040_bsp
0
4960
--=========================================================================== -- -- This package represents the definitions for -- all ports -- all standard definitions -- for the Tiny RP2040 board -- --=========================================================================== -- -- Copyright 2022 (C) <NAME> -- -- SPDX-License-Identifier: BSD-3-Clause -- with RP.GPIO; with RP.I2C_Master; with RP.Device; with RP.Clock; with RP.UART; with RP.SPI; package Tiny is -------------------------------------------------------------------------- -- Just the list of all GPIO pins for the RP2040 chip -- The commented lines do not have a board connection -------------------------------------------------------------------------- GP0 : aliased RP.GPIO.GPIO_Point := (Pin => 0); GP1 : aliased RP.GPIO.GPIO_Point := (Pin => 1); GP2 : aliased RP.GPIO.GPIO_Point := (Pin => 2); GP3 : aliased RP.GPIO.GPIO_Point := (Pin => 3); GP4 : aliased RP.GPIO.GPIO_Point := (Pin => 4); GP5 : aliased RP.GPIO.GPIO_Point := (Pin => 5); GP6 : aliased RP.GPIO.GPIO_Point := (Pin => 6); GP7 : aliased RP.GPIO.GPIO_Point := (Pin => 7); -- GP8 : aliased RP.GPIO.GPIO_Point := (Pin => 8); -- GP9 : aliased RP.GPIO.GPIO_Point := (Pin => 9); -- GP10 : aliased RP.GPIO.GPIO_Point := (Pin => 10); -- GP11 : aliased RP.GPIO.GPIO_Point := (Pin => 11); -- GP12 : aliased RP.GPIO.GPIO_Point := (Pin => 12); -- GP13 : aliased RP.GPIO.GPIO_Point := (Pin => 13); -- GP14 : aliased RP.GPIO.GPIO_Point := (Pin => 14); -- GP15 : aliased RP.GPIO.GPIO_Point := (Pin => 15); -- GP16 : aliased RP.GPIO.GPIO_Point := (Pin => 16); -- GP17 : aliased RP.GPIO.GPIO_Point := (Pin => 17); GP18 : aliased RP.GPIO.GPIO_Point := (Pin => 18); GP19 : aliased RP.GPIO.GPIO_Point := (Pin => 19); GP20 : aliased RP.GPIO.GPIO_Point := (Pin => 20); -- GP21 : aliased RP.GPIO.GPIO_Point := (Pin => 21); -- GP22 : aliased RP.GPIO.GPIO_Point := (Pin => 22); GP23 : aliased RP.GPIO.GPIO_Point := (Pin => 23); -- GP24 : aliased RP.GPIO.GPIO_Point := (Pin => 24); -- GP25 : aliased RP.GPIO.GPIO_Point := (Pin => 25); GP26 : aliased RP.GPIO.GPIO_Point := (Pin => 26); GP27 : aliased RP.GPIO.GPIO_Point := (Pin => 27); GP28 : aliased RP.GPIO.GPIO_Point := (Pin => 28); GP29 : aliased RP.GPIO.GPIO_Point := (Pin => 29); -------------------------------------------------------------------------- -- Order is counter clockwise around the chip, -- if you look at it holding the USB port top -- the identifiers are the ones on the board -------------------------------------------------------------------------- -------------------------------------------------------------------------- -- Left row of pins -------------------------------------------------------------------------- ADC3 : aliased RP.GPIO.GPIO_Point := GP29; ADC2 : aliased RP.GPIO.GPIO_Point := GP28; ADC1 : aliased RP.GPIO.GPIO_Point := GP27; ADC0 : aliased RP.GPIO.GPIO_Point := GP26; -- I2C block, device 1 SCL_1_27 : aliased RP.GPIO.GPIO_Point := GP27; SDA_1_26 : aliased RP.GPIO.GPIO_Point := GP26; -------------------------------------------------------------------------- -- Right row of pins -------------------------------------------------------------------------- -- UART block, device 1 RX_1 : aliased RP.GPIO.GPIO_Point := GP5; TX_1 : aliased RP.GPIO.GPIO_Point := GP4; -- UART block, device 0 RX_0 : aliased RP.GPIO.GPIO_Point := GP1; TX_0 : aliased RP.GPIO.GPIO_Point := GP0; -------------------------------------------------------------------------- -- I2C block, device 1 SCL_1_7 : aliased RP.GPIO.GPIO_Point := GP7; SDA_1_6 : aliased RP.GPIO.GPIO_Point := GP6; -- I2C block, device 0 SCL_0_5 : aliased RP.GPIO.GPIO_Point := GP5; SDA_0_4 : aliased RP.GPIO.GPIO_Point := GP4; -- I2C block, device 1 SCL_1_3 : aliased RP.GPIO.GPIO_Point := GP3; SDA_1_2 : aliased RP.GPIO.GPIO_Point := GP2; -- I2C block, device 0 SCL_0_1 : aliased RP.GPIO.GPIO_Point := GP1; SDA_0_0 : aliased RP.GPIO.GPIO_Point := GP0; -------------------------------------------------------------------------- -- SPI block: there is only one SPI port available -- this can be mapped to -- either GP7 - GP4 MOSI_0_7 : RP.GPIO.GPIO_Point renames Tiny.GP7; SCK_0_6 : RP.GPIO.GPIO_Point renames Tiny.GP6; NSS_0_5 : RP.GPIO.GPIO_Point renames Tiny.GP5; MISO_0_4 : RP.GPIO.GPIO_Point renames Tiny.GP4; -- or GP3 - GP0 MOSI_0_3 : RP.GPIO.GPIO_Point renames Tiny.GP3; SCK_0_2 : RP.GPIO.GPIO_Point renames Tiny.GP2; NSS_0_1 : RP.GPIO.GPIO_Point renames Tiny.GP1; MISO_0_0 : RP.GPIO.GPIO_Point renames Tiny.GP0; -------------------------------------------------------------------------- -- LEDs RGB -- IMPORTANT: those LEDs are active *LOW* -- => .Clear will switch the LED *ON* -------------------------------------------------------------------------- LED_Red : aliased RP.GPIO.GPIO_Point := GP18; LED_Green : aliased RP.GPIO.GPIO_Point := GP19; LED_Blue : aliased RP.GPIO.GPIO_Point := GP20; -------------------------------------------------------------------------- -- System frequency XOSC_Frequency : RP.Clock.XOSC_Hertz := 12_000_000; -------------------------------------------------------------------------- -- just convenient definitions for the ports SPI : RP.SPI.SPI_Port renames RP.Device.SPI_0; I2C_0 : RP.I2C_Master.I2C_Master_Port renames RP.Device.I2C_0; I2C_1 : RP.I2C_Master.I2C_Master_Port renames RP.Device.I2C_1; UART_0 : RP.UART.UART_Port renames RP.Device.UART_0; UART_1 : RP.UART.UART_Port renames RP.Device.UART_1; ------------------------------------------------------ -- Do the basic initialization procedure Initialize; ------------------------------------------------------ -- Switch on This LED procedure Switch_On (This : in out RP.GPIO.GPIO_Point); ------------------------------------------------------ -- Switch off This LED procedure Switch_Off (This : in out RP.GPIO.GPIO_Point); ------------------------------------------------------ -- Toggle This LED procedure Toggle (This : in out RP.GPIO.GPIO_Point); end Tiny;
Task/Read-a-configuration-file/Ada/read-a-configuration-file-2.ada
djgoku/RosettaCodeData
0
10401
<filename>Task/Read-a-configuration-file/Ada/read-a-configuration-file-2.ada with Ada.Text_IO; with Config; use Config; procedure Read_Config is use Ada.Text_IO; use Rosetta_Config; begin New_Line; Put_Line ("Reading Configuration File."); Put_Line ("Fullname := " & Get (Key => FULLNAME)); Put_Line ("Favorite Fruit := " & Get (Key => FAVOURITEFRUIT)); Put_Line ("Other Family := " & Get (Key => OTHERFAMILY)); if Has_Value (Key => NEEDSPEELING) then Put_Line ("NEEDSPEELLING := " & Get (Key => NEEDSPEELING)); else Put_Line ("NEEDSPEELLING := True"); end if; if Has_Value (Key => SEEDSREMOVED) then Put_Line ("SEEDSREMOVED := " & Get (Key => SEEDSREMOVED)); else Put_Line ("SEEDSREMOVED := True"); end if; end Read_Config;
yasm_x86-64_linux/test.asm
oceanwavechina/assembly
0
6658
<filename>yasm_x86-64_linux/test.asm ; 1. 用lea 指令获取变量的内存地址 section .data bVar1 db 22 bVar2 db 33 section .text global _start _start: lea rax, qword [bVar1] last: mov rax, 60 mov rdi, 0 syscall
Labs/1_simple_expression/1a_only_parser_no_evaluation/Expr.g4
MNXANL/GRAU-CL
0
2042
<reponame>MNXANL/GRAU-CL grammar Expr; s : e ; e : '(' e ')' | MINUS e | e (MULT|DIV) e | e (PLUS|MINUS) e | INT ; MULT = '*'; DIV = '/'; PLUS = '+'; MINUS = '-'; INT : [0-9]+ ; WS : [ \t\n]+ -> skip ;
programs/oeis/156/A156664.asm
neoneye/loda
22
82181
<filename>programs/oeis/156/A156664.asm<gh_stars>10-100 ; A156664: Binomial transform of A052551. ; 1,2,6,16,42,108,274,688,1714,4244,10458,25672,62826,153372,373666,908896,2207842,5357348,12988074,31464568,76179354,184347564,445923058,1078290832,2606699026,6300077492,15223631226,36780894376,88852528842,214620169788,518361303874,1251879648448,3023194342594,7300415817284,17628320944458,42565647640792,102776796095226,248153599569612,599152714711186,1446596467945456,3492620528509042,8432387280777428,20358494601691674,49151575507416328,118666043663035434,286492458926509404,691668553702098658,1669864750702795552,4031468423851867426,9732942335894885732,23497634570618349546,56728774427085006136,136956309324695204442,330643644876289100268,798248102676900775474,1927148857429345392208,4652563831934101041874,11232312550094566439924,27117260989717271849658,65466978644717185995112,158051506509527795551626,381570568124525080521852,921193795680082563442306,2223960465327699421100416,5369119338021499833031042,12962208364742735941938308,31293554514251045426459274,75549354286732974213960088,182392336874693288692585914,440334175610072141275544844,1063060983242742750596501458,2566456732391368001174199472,6195975628617099470356203826,14958410350808808376709213972,36112801052601199093419845466,87184021900744172302839332296,210480863743555475177679364842,508145787166786985615359771548,1226772513634993172322722327074,2961690965552500782089451263968,7150154746971449640158918531554,17262001063958309869721875680164,41674158083813888994231844598058,100610319649437727087443914288632,242894802218392621627636372000026,586399933757629527259750055938092,1415694689076464789981203279175026,3417789350596185334890290204885776,8251273467640087915098050870141842,19920336440618866075758926307559988,48091946658362829887960972210042874,116104230376314545494371008177207848,280300408648931960162083263463582794,676705050150058544389298084902621884 mov $2,$0 mov $4,2 lpb $4 mov $0,$2 sub $4,1 add $0,$4 trn $0,1 seq $0,106514 ; Expansion of (1-x)/((1-2*x)*(1-2*x-x^2)). mov $3,$0 mov $5,$4 mul $5,$0 add $1,$5 lpe min $2,1 mul $2,$3 sub $1,$2 mov $0,$1
assembler/tests/t_65ce02/t_65ce02.asm
paulscottrobson/RCA-Cosmac-VIP-III
0
103469
<reponame>paulscottrobson/RCA-Cosmac-VIP-III<gh_stars>0 cpu 65ce02 page 0 cle see phz plz inz dez tsy tys tab tba taz tza rtn #$ee aug stx $1234,y sty $1234,x jsr ($1234) irp instr,ora,and,eor,adc,sta,lda,cmp,sbc instr ($aa),z endm ldz $1234 ldz $1234,x ldz $12 ldz $12,x ldz #$55 cpz $12 cpz $1234 cpz #$55 bcc *+20 bcc *+200 bcc <*+20 bcc >*+20 ;bcc <*+200 bcc >*+200 bcs *+20 bcs *+200 bcs <*+20 bcs >*+20 ;bcs <*+200 bcs >*+200 beq *+20 beq *+200 beq <*+20 beq >*+20 ;beq <*+200 beq >*+200 bmi *+20 bmi *+200 bmi <*+20 bmi >*+20 ;bmi <*+200 bmi >*+200 bne *+20 bne *+200 bne <*+20 bne >*+20 ;bne <*+200 bne >*+200 bpl *+20 bpl *+200 bpl <*+20 bpl >*+20 ;bpl <*+200 bpl >*+200 bru *+20 bru *+200 bru <*+20 bru >*+20 ;bru <*+200 bru >*+200 bra *+20 bra *+200 bra <*+20 bra >*+20 ;bra <*+200 bra >*+200 bsr *+20 bsr *+200 ;bsr <*+20 bsr >*+20 ;bsr <*+200 bsr >*+200 bvc *+20 bvc *+200 bvc <*+20 bvc >*+20 ;bvc <*+200 bvc >*+200 bvs *+20 bvs *+200 bvs <*+20 bvs >*+20 ;bvs <*+200 bvs >*+200 jsr ($1234,x) neg neg a asr asr a asr $12 asr $12,x inw $12 dew $12 asw $12 asw $1234 row $12 row $1234 phw $12 phw $1234 phw #$1234 lda ($12,sp),y sta ($12,sp),y assume b:$80 lda <$8034 lda $34
Transynther/x86/_processed/US/_zr_/i9-9900K_12_0xa0_notsx.log_21829_889.asm
ljhsiun2/medusa
9
83766
.global s_prepare_buffers s_prepare_buffers: push %r13 push %r14 push %rbx push %rcx push %rdi push %rsi lea addresses_UC_ht+0x118ff, %rsi lea addresses_A_ht+0x1ed3f, %rdi clflush (%rsi) nop nop nop nop nop sub %r13, %r13 mov $50, %rcx rep movsb nop nop nop nop inc %rdi lea addresses_WC_ht+0x6b3f, %rbx clflush (%rbx) nop nop nop nop xor $53970, %r14 vmovups (%rbx), %ymm7 vextracti128 $1, %ymm7, %xmm7 vpextrq $1, %xmm7, %rsi nop nop inc %rsi pop %rsi pop %rdi pop %rcx pop %rbx pop %r14 pop %r13 ret .global s_faulty_load s_faulty_load: push %r12 push %r14 push %r8 push %rax push %rbp push %rdx push %rsi // Store lea addresses_WC+0x1bd3f, %rbp nop nop and %rdx, %rdx mov $0x5152535455565758, %r8 movq %r8, %xmm1 vmovups %ymm1, (%rbp) nop nop nop and %r12, %r12 // Store lea addresses_A+0x1e93f, %r14 nop nop cmp %rax, %rax mov $0x5152535455565758, %r12 movq %r12, %xmm5 vmovups %ymm5, (%r14) nop nop nop nop nop xor %rsi, %rsi // Store lea addresses_WC+0x986b, %r12 nop nop xor %rax, %rax mov $0x5152535455565758, %rbp movq %rbp, %xmm7 vmovups %ymm7, (%r12) nop inc %rax // Store lea addresses_normal+0xccaf, %r8 nop nop nop nop nop xor %r12, %r12 mov $0x5152535455565758, %rbp movq %rbp, %xmm1 vmovups %ymm1, (%r8) nop nop nop nop dec %rax // Store lea addresses_UC+0x973f, %r14 nop sub %rax, %rax movb $0x51, (%r14) add $48627, %rbp // Load lea addresses_US+0x3eff, %rsi nop nop add $57828, %r8 mov (%rsi), %rbp nop cmp $40847, %r12 // Store lea addresses_A+0x1457f, %r14 dec %rbp movb $0x51, (%r14) nop inc %r8 // Store lea addresses_WT+0xb93f, %r8 nop nop nop add $11714, %rbp movl $0x51525354, (%r8) nop nop cmp $29193, %r14 // Store mov $0x4678d5000000033f, %rbp nop nop add $48118, %r12 mov $0x5152535455565758, %rax movq %rax, %xmm3 movups %xmm3, (%rbp) nop nop xor $1158, %rdx // Faulty Load lea addresses_US+0x1a13f, %rdx nop nop nop cmp $64195, %rbp mov (%rdx), %r8 lea oracles, %r14 and $0xff, %r8 shlq $12, %r8 mov (%r14,%r8,1), %r8 pop %rsi pop %rdx pop %rbp pop %rax pop %r8 pop %r14 pop %r12 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_US', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 10}} {'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 11}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 1}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 4}} {'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': True, 'size': 1, 'NT': False, 'same': False, 'congruent': 9}} {'src': {'type': 'addresses_US', 'AVXalign': False, 'size': 8, 'NT': True, 'same': False, 'congruent': 6}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 6}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 11}} {'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 8}} [Faulty Load] {'src': {'type': 'addresses_US', 'AVXalign': False, 'size': 8, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}} {'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 8}, '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 */
test/test-verbose-mix.asm
rhargreaves/zx-spec
34
103735
<gh_stars>10-100 org 8000h zxspec_config_verbose_output equ $FF include src/zx-spec.asm spec_init describe 'assert_pass' it 'passes test' assert_pass describe 'assert_a_equal' it 'passes for same value' ld a,5 assert_a_equal 5 describe 'assert_a_equal' it 'fails for different value' ld a,5 assert_a_equal 255 it 'fails again' ld a,5 assert_a_equal 255 spec_end ret end 8000h
assembler/forth/dict.asm
MRebhan/RetroComputers-XC8010
2
19283
<reponame>MRebhan/RetroComputers-XC8010 dvar STATE,5,,, dvar DP,2,,,here_pos dcode HERE,4,, ; ( -- dp@ ) lda var_DP pha nxt dvar LATEST,6,,,name_marker dword >CFA,4,,TCFA .lit 2 .wp ADD .wp DUP .wp PEEK .lit F_LENMASK .wp AND .wp ADD .wp INCR .wp EXIT dword >DFA,4,,TDFA .wp TCFA .lit 3 .wp ADD .wp EXIT dword FIND,4,, ; ( word-address word-length -- address ) .wp LATEST .wp PEEK ; w-a w-l addr FIND_loop: .wp DUP .zbranch FIND_notfound .wp DUP ; w-a w-l addr addr .wp INCRTWO .wp PEEKBYTE ; w-a w-l addr flags .lit F_LENMASK .lit F_HIDDEN .wp OR ; w-a w-l addr flags mask .wp AND ; w-a w-l addr length .wp ROT ; w-a addr length w-l .wp DUP ; w-a addr length w-l w-l .wp ROT ; w-a addr w-l w-l length .wp EQU .zbranch FIND_notequal ; w-a addr w-l .wp TOR ; w-a addr .wp TWODUP ; w-a addr w-a addr .lit 3 .wp ADD .wp STRCMP ; w-a addr len .wp FROMR ; w-a addr len w-l .wp DUP ; w-a addr len w-l w-l .wp ROT ; w-a addr w-l w-l len .wp LE .zbranch FIND_notequal ; w-a addr w-l ; Found .wp DROP ; w-a addr .wp NIP ; addr .wp EXIT FIND_notequal: .wp SWAP .wp PEEK .branch FIND_loop .wp EXIT FIND_notfound: .wp DROP ; w-a w-l .wp TWODROP ; .wp ZERO .wp EXIT dword ('),3,,_HTICK .wp WORD .wp TWODUP .wp FIND .wp DUP .zbranch TICK_notfound .wp NIP .wp NIP .wp EXIT dword ',1,,_TICK .wp _HTICK .wp TCFA .wp EXIT TICK_notfound: .wp DROP .lit INTERPRET_texta .lit 15 .wp TYPE .wp TYPE .wp ABORT .wp EXIT dcode EXECUTE,7,, rts dword HIDE,4,, .wp _HTICK .wp INCRTWO .wp DUP .wp PEEKBYTE .lit F_HIDDEN .wp OR .wp SWAP .wp POKEBYTE .wp EXIT dword REVEAL,6,, .wp LATEST .wp PEEK .wp INCRTWO .wp DUP .wp PEEKBYTE .lit F_HIDDEN .wp INVERT .wp AND .wp SWAP .wp POKEBYTE .wp EXIT dword IMMEDIATE,9,F_IMMED, .wp LATEST .wp PEEK .wp INCRTWO .wp DUP .wp PEEKBYTE .lit F_IMMED .wp OR .wp SWAP .wp POKEBYTE .wp EXIT dword COMPILE-ONLY,12,F_IMMED,COMPILEONLY .wp LATEST .wp PEEK .wp INCRTWO .wp DUP .wp PEEKBYTE .lit F_COMPILEONLY .wp OR .wp SWAP .wp POKEBYTE .wp EXIT dword (HEADER),8,,IHEADER ; ( word-addr word-length -- ) .lit F_LENMASK .wp AND .wp HERE ; w-a w-l here .wp LATEST .wp PEEK ; w-a w-l here latest .wp COMMA ; w-a w-l here .wp LATEST .wp POKE ; w-a w-l .wp DUP ; w-a w-l w-l .lit F_HIDDEN .wp OR .wp CCOMMA ; w-a w-l .wp DUP ; w-a w-l w-l .wp ALLOT ; w-a w-l here .wp SWAP ; w-a here w-l .wp MEMCPY .wp EXIT dword HEADER,6,, .wp WORD ; w-a w-l .wp IHEADER .wp EXIT dword \,,1,,COMMA ; ( a -- ) .wp HERE .wp POKE .wp CELL .wp ALLOT .wp DROP .wp EXIT dword C\,,2,,CCOMMA ; ( a -- ) .wp HERE .wp POKEBYTE .wp ONE .wp ALLOT .wp DROP .wp EXIT dword CREATE,6,, .wp HEADER .wp REVEAL .lit $22 .wp CCOMMA .comp DOVAR .wp EXIT dword VARIABLE,8,, .wp CREATE .comp 0 .wp EXIT dword CONSTANT,8,, ; ( a -- ) .wp HEADER .wp REVEAL .compb $22 .comp DOCON .wp COMMA .wp EXIT dword (FORGET),8,,IFORGET ; ( word -- ) .wp DUP .wp PEEK .wp LATEST .wp POKE .wp DP .wp POKE .wp EXIT dword FORGET,6,, .wp _HTICK .wp IFORGET .wp EXIT dword ['],3,F_IMMED+F_COMPILEONLY,CLIT .comp LIT .wp EXIT dword WORDS,5,, .wp LATEST .wp PEEK ; addr WORDS_loop: .wp DUP ; addr addr .wp ZNEQU ; addr cond .zbranch WORDS_end ; addr .wp DUP ; addr addr .wp INCRTWO ; addr flagaddr .wp PEEKBYTE ; addr flags .wp DUP ; addr flags flags .lit F_HIDDEN .wp AND ; addr flags hidden .wp ZEQU .zbranch WORDS_hidden .lit F_LENMASK .wp AND ; addr length .wp OVER ; addr length addr .lit 3 .wp ADD ; addr length straddr .wp SWAP ; addr straddr length .wp TYPE .wp SPACE WORDS_hidden_return: .wp PEEK ; newaddr .branch WORDS_loop WORDS_end: .wp DROP .wp EXIT WORDS_hidden: .wp DROP ; addr .branch WORDS_hidden_return dword ?COMPILE-ONLY,13,,ISCOMPONLY ; ( address -- cond ) .wp INCRTWO .wp PEEK .lit F_COMPILEONLY .wp AND .wp ZNEQU .wp EXIT dword ?IMMEDIATE,10,,ISIMMEDIATE ; ( address -- cond ) .wp INCRTWO .wp PEEK .lit F_IMMED .wp AND .wp ZNEQU .wp EXIT .ifcflag defer .macro defer [name],namelen,flags=0,[label]=${name},pointer=EXIT dcode ${name},${namelen},${flags},${label} jsr defer_does .wp ${pointer} .endm dword DEFER,5,, .wp CREATE .lit EXIT .wp COMMA .wp NDOES .wp EXIT defer_does: ent DOCOL .wp PEEK .wp EXECUTE .wp EXIT dword DEFER!,6,,DEFER_SET .lit 3 .wp ADD .wp POKE .wp EXIT dword IS,2,, .wp _TICK .wp DEFER_SET .wp EXIT dword DEFER@,6,,DEFER_GET .lit 3 .wp ADD .wp PEEK .wp EXIT .endif
oeis/313/A313635.asm
neoneye/loda-programs
11
105518
; A313635: Coordination sequence Gal.4.54.2 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings. ; Submitted by <NAME> ; 1,5,10,14,20,26,30,35,40,45,50,54,60,66,70,75,80,85,90,94,100,106,110,115,120,125,130,134,140,146,150,155,160,165,170,174,180,186,190,195,200,205,210,214,220,226,230,235,240,245 mov $2,$0 mov $7,$0 mov $9,$0 lpb $9 mov $0,$7 mov $4,0 sub $9,1 sub $0,$9 mul $0,2 mov $3,$0 add $3,1 add $3,$0 add $8,$0 mov $0,$3 add $1,1 sub $3,1 mul $3,5 mov $5,16 mul $5,$8 sub $5,$8 add $10,$8 add $10,$5 mov $5,4 mov $6,$3 add $3,2 mul $6,$8 lpb $0 add $5,2 mov $0,$5 div $6,$10 sub $3,$6 lpe gcd $3,$5 add $4,$0 add $4,5 add $3,$4 mov $10,$3 sub $10,7 div $10,3 add $10,1 add $1,$10 lpe add $1,$2 mov $0,$1 add $0,1
Bloc2/Micro/Project 2/project6.asm
MrGunnery/Helha
1
176003
NB1 equ 0C NB2 equ 0D FSR equ 04 INDF equ 00 ;------------- Programme ------------- restart movlw d'10' movwf NB1 ; on met 10 dans NB1 movlw H'11' movwf FSR ; on dit l'adresse de debut de FSR movlw d'5' movwf NB2 movlw d'0' debut addlw d'5' movwf INDF ; on ajoute le w dans le fsr incf FSR,1 ; on augmente l'adresse de FSR de 1 decfsz NB1 ; on decrement nb1 goto debut ; retour au debut movlw H'11' ; retour au debut du FSR movwf FSR affiche movf INDF,W ; lecture du FSR movwf NB1 incf FSR,1 ; augmentation de l'adresse du FSR 2x incf FSR,1 decfsz NB2 goto affiche goto restart end
manuscript/cs/ch01-helloWorld-i386.asm
jasoncable/i-can-program-too
3
22339
; Hello World for Intel Assembler (MSDOS) mov ax,cs mov ds,ax mov ah,9 mov dx, offset Hello int 21h xor ax,ax int 21h Hello: db "Hello World!",13,10,"$"
core.agda
hazelgrove/hazelnat-myth-
1
8589
<reponame>hazelgrove/hazelnat-myth-<filename>core.agda open import Nat open import Prelude open import List open import contexts open import unions module core where -- types data typ : Set where _==>_ : typ → typ → typ ⟨⟩ : typ ⟨_×_⟩ : typ → typ → typ D[_] : Nat → typ -- arrow type constructors bind very tightly infixr 25 _==>_ -- type contexts, hole contexts, and datatype environments tctx = typ ctx hctx = (tctx ∧ typ) ctx denv = Σ[ dctx ∈ tctx ctx ] ∀{d1 d2 cctx1 cctx2 c} → d1 ≠ d2 → (d1 , cctx1) ∈ dctx → (d2 , cctx2) ∈ dctx → c # cctx1 ∨ c # cctx2 -- simple values data val : Set where ⟨⟩ : val ⟨_,_⟩ : val → val → val C[_]_ : Nat → val → val -- examples data ex : Set where ⟨⟩ : ex ⟨_,_⟩ : ex → ex → ex C[_]_ : Nat → ex → ex _↦_ : val → ex → ex ¿¿ : ex -- simple value typing data _⊢_::ⱽ_ : denv → val → typ → Set where VTUnit : ∀{Σ'} → Σ' ⊢ ⟨⟩ ::ⱽ ⟨⟩ VTPair : ∀{Σ' v1 v2 τ1 τ2} → Σ' ⊢ v1 ::ⱽ τ1 → Σ' ⊢ v2 ::ⱽ τ2 → Σ' ⊢ ⟨ v1 , v2 ⟩ ::ⱽ ⟨ τ1 × τ2 ⟩ VTCtor : ∀{Σ' d cctx c v τ} → (d , cctx) ∈ π1 Σ' → (c , τ) ∈ cctx → Σ' ⊢ v ::ⱽ τ → Σ' ⊢ C[ c ] v ::ⱽ D[ d ] -- example typing data _,_⊢_:·_ : hctx → denv → ex → typ → Set where XTUnit : ∀{Δ Σ'} → Δ , Σ' ⊢ ⟨⟩ :· ⟨⟩ XTPair : ∀{Δ Σ' ex1 ex2 τ1 τ2} → Δ , Σ' ⊢ ex1 :· τ1 → Δ , Σ' ⊢ ex2 :· τ2 → Δ , Σ' ⊢ ⟨ ex1 , ex2 ⟩ :· ⟨ τ1 × τ2 ⟩ XTCtor : ∀{Δ Σ' d cctx c ex τ} → (d , cctx) ∈ π1 Σ' → (c , τ) ∈ cctx → Δ , Σ' ⊢ ex :· τ → Δ , Σ' ⊢ C[ c ] ex :· D[ d ] XTTop : ∀{Δ Σ' τ} → Δ , Σ' ⊢ ¿¿ :· τ XTInOut : ∀{Δ Σ' v ex τ1 τ2} → Σ' ⊢ v ::ⱽ τ1 → Δ , Σ' ⊢ ex :· τ2 → Δ , Σ' ⊢ v ↦ ex :· τ1 ==> τ2 -- the two possible prj indices data prj-idx : Set where P1 : prj-idx P2 : prj-idx prj : {A : Set} → prj-idx → A → A → A prj P1 a1 a2 = a1 prj P2 a1 a2 = a2 mutual record rule : Set where inductive constructor |C_=>_ field parm : Nat branch : exp -- Expressions data exp : Set where fix_⦇·λ_=>_·⦈ : Nat → Nat → exp → exp _∘_ : exp → exp → exp X[_] : Nat → exp ⟨⟩ : exp ⟨_,_⟩ : exp → exp → exp prj[_]_ : prj-idx → exp → exp C[_]_ : Nat → exp → exp case_of⦃·_·⦄ : exp → rule ctx → exp ??[_] : Nat → exp PBE:assert : exp → exp → exp -- u is fresh in e data hole-name-new : (e : exp) → (u : Nat) → Set where HNNFix : ∀{x f e u} → hole-name-new e u → hole-name-new (fix f ⦇·λ x => e ·⦈) u HNNVar : ∀{x u} → hole-name-new (X[ x ]) u HNNAp : ∀{e1 e2 u} → hole-name-new e1 u → hole-name-new e2 u → hole-name-new (e1 ∘ e2) u HNNUnit : ∀{u} → hole-name-new ⟨⟩ u HNNPair : ∀{e1 e2 u} → hole-name-new e1 u → hole-name-new e2 u → hole-name-new ⟨ e1 , e2 ⟩ u HNNPrj : ∀{e i u} → hole-name-new e u → hole-name-new (prj[ i ] e) u HNNCtor : ∀{c e u} → hole-name-new e u → hole-name-new (C[ c ] e) u HNNCase : ∀{e rules u} → hole-name-new e u → (∀{c rule} → (c , rule) ∈ rules → hole-name-new (rule.branch rule) u) → hole-name-new (case e of⦃· rules ·⦄) u HNNHole : ∀{u' u} → u' ≠ u → hole-name-new (??[ u' ]) u HNNAsrt : ∀{e1 e2 u} → hole-name-new e1 u → hole-name-new e2 u → hole-name-new (PBE:assert e1 e2) u -- e1 and e2 do not have any hole names in common data holes-disjoint : (e1 : exp) → (e2 : exp) → Set where HDFix : ∀{x f e e'} → holes-disjoint e e' → holes-disjoint (fix f ⦇·λ x => e ·⦈) e' HDVar : ∀{x e'} → holes-disjoint (X[ x ]) e' HDAp : ∀{e1 e2 e'} → holes-disjoint e1 e' → holes-disjoint e2 e' → holes-disjoint (e1 ∘ e2) e' HDUnit : ∀{e'} → holes-disjoint ⟨⟩ e' HDPair : ∀{e1 e2 e'} → holes-disjoint e1 e' → holes-disjoint e2 e' → holes-disjoint ⟨ e1 , e2 ⟩ e' HDPrj : ∀{i e e'} → holes-disjoint e e' → holes-disjoint (prj[ i ] e) e' HDCtor : ∀{c e e'} → holes-disjoint e e' → holes-disjoint (C[ c ] e) e' HDCase : ∀{e rules e'} → holes-disjoint e e' → (∀{c rule} → (c , rule) ∈ rules → holes-disjoint (rule.branch rule) e') → holes-disjoint (case e of⦃· rules ·⦄) e' HDHole : ∀{u e'} → hole-name-new e' u → holes-disjoint (??[ u ]) e' HDAsrt : ∀{e1 e2 e'} → holes-disjoint e1 e' → holes-disjoint e2 e' → holes-disjoint (PBE:assert e1 e2) e' -- e ecomplete iff e contains no holes data _ecomplete : exp → Set where ECFix : ∀{f x e} → e ecomplete → fix f ⦇·λ x => e ·⦈ ecomplete ECVar : ∀{x} → X[ x ] ecomplete ECAp : ∀{e1 e2} → e1 ecomplete → e2 ecomplete → (e1 ∘ e2) ecomplete ECUnit : ⟨⟩ ecomplete ECPair : ∀{e1 e2} → e1 ecomplete → e2 ecomplete → ⟨ e1 , e2 ⟩ ecomplete ECPrj : ∀{i e} → e ecomplete → (prj[ i ] e) ecomplete ECCtor : ∀{c e} → e ecomplete → (C[ c ] e) ecomplete ECCase : ∀{e rules} → e ecomplete → (∀{c rule} → (c , rule) ∈ rules → (rule.branch rule) ecomplete) → case e of⦃· rules ·⦄ ecomplete ECAsrt : ∀{e1 e2} → e1 ecomplete → e2 ecomplete → (PBE:assert e1 e2) ecomplete -- type assignment for expressions data _,_,_⊢_::_ : hctx → denv → tctx → exp → typ → Set where TFix : ∀{Δ Σ' Γ f x e τ1 τ2} → Δ , Σ' , (Γ ,, (f , τ1 ==> τ2) ,, (x , τ1)) ⊢ e :: τ2 → Δ , Σ' , Γ ⊢ fix f ⦇·λ x => e ·⦈ :: τ1 ==> τ2 TVar : ∀{Δ Σ' Γ x τ} → (x , τ) ∈ Γ → Δ , Σ' , Γ ⊢ X[ x ] :: τ THole : ∀{Δ Σ' Γ u τ} → (u , (Γ , τ)) ∈ Δ → Δ , Σ' , Γ ⊢ ??[ u ] :: τ TUnit : ∀{Δ Σ' Γ} → Δ , Σ' , Γ ⊢ ⟨⟩ :: ⟨⟩ TPair : ∀{Δ Σ' Γ e1 e2 τ1 τ2} → holes-disjoint e1 e2 → Δ , Σ' , Γ ⊢ e1 :: τ1 → Δ , Σ' , Γ ⊢ e2 :: τ2 → Δ , Σ' , Γ ⊢ ⟨ e1 , e2 ⟩ :: ⟨ τ1 × τ2 ⟩ TCtor : ∀{Δ Σ' Γ d cctx c e τ} → (d , cctx) ∈ π1 Σ' → (c , τ) ∈ cctx → Δ , Σ' , Γ ⊢ e :: τ → Δ , Σ' , Γ ⊢ C[ c ] e :: D[ d ] TApp : ∀{Δ Σ' Γ f arg τ1 τ2} → holes-disjoint f arg → Δ , Σ' , Γ ⊢ f :: τ1 ==> τ2 → Δ , Σ' , Γ ⊢ arg :: τ1 → Δ , Σ' , Γ ⊢ f ∘ arg :: τ2 TPrj : ∀{Δ Σ' Γ i e τ1 τ2} → Δ , Σ' , Γ ⊢ e :: ⟨ τ1 × τ2 ⟩ → Δ , Σ' , Γ ⊢ prj[ i ] e :: prj i τ1 τ2 TCase : ∀{Δ Σ' Γ d cctx e rules τ} → (d , cctx) ∈ π1 Σ' → Δ , Σ' , Γ ⊢ e :: D[ d ] → -- There must be a rule for each constructor, i.e. case exhuastiveness (∀{c} → dom cctx c → dom rules c) → (∀{c xc ec} → (c , |C xc => ec) ∈ rules → holes-disjoint ec e ∧ (∀{c' xc' ec'} → (c' , |C xc' => ec') ∈ rules → c ≠ c' → holes-disjoint ec ec') ∧ -- The constructor of each rule must be of the right datatype, and the branch must type-check Σ[ τc ∈ typ ] ( (c , τc) ∈ cctx ∧ Δ , Σ' , (Γ ,, (xc , τc)) ⊢ ec :: τ)) → Δ , Σ' , Γ ⊢ case e of⦃· rules ·⦄ :: τ TAssert : ∀{Δ Σ' Γ e1 e2 τ} → holes-disjoint e1 e2 → Δ , Σ' , Γ ⊢ e1 :: τ → Δ , Σ' , Γ ⊢ e2 :: τ → Δ , Σ' , Γ ⊢ PBE:assert e1 e2 :: ⟨⟩ mutual env : Set env = result ctx -- results - evaluation takes expressions to results, but results aren't necessarily final data result : Set where [_]fix_⦇·λ_=>_·⦈ : env → Nat → Nat → exp → result ⟨⟩ : result ⟨_,_⟩ : result → result → result C[_]_ : Nat → result → result [_]??[_] : env → Nat → result _∘_ : result → result → result prj[_]_ : prj-idx → result → result [_]case_of⦃·_·⦄ : env → result → rule ctx → result C⁻¹[_]_ : Nat → result → result mutual data _env-final : env → Set where EFNone : ∅ env-final EFInd : ∀{E x r} → E env-final → r final → (E ,, (x , r)) env-final -- final results are those that cannot be evaluated further data _final : result → Set where FDet : ∀{r} → r det → r final FIndet : ∀{r} → r indet → r final -- final results that can be eliminated (or in the case of ⟨⟩, that don't need to be) data _det : result → Set where DFix : ∀{E f x e} → E env-final → [ E ]fix f ⦇·λ x => e ·⦈ det DUnit : ⟨⟩ det DPair : ∀{r1 r2} → r1 final → r2 final → ⟨ r1 , r2 ⟩ det DCtor : ∀{c r} → r final → (C[ c ] r) det -- indeterminate results are incomplete and cannot be further reduced except by resumption data _indet : result → Set where IDHole : ∀{E u} → E env-final → [ E ]??[ u ] indet IDApp : ∀{r1 r2} → r1 indet → r2 final → (r1 ∘ r2) indet IDPrj : ∀{i r} → r indet → (prj[ i ] r) indet IDCase : ∀{E r rules} → E env-final → r indet → [ E ]case r of⦃· rules ·⦄ indet mutual -- type assignment for environments data _,_,_⊢_ : hctx → denv → tctx → env → Set where EnvId : ∀{Δ Σ'} → Δ , Σ' , ∅ ⊢ ∅ EnvInd : ∀{Δ Σ' Γ E x τx rx} → Δ , Σ' , Γ ⊢ E → Δ , Σ' ⊢ rx ·: τx → Δ , Σ' , (Γ ,, (x , τx)) ⊢ (E ,, (x , rx)) -- type assignment for results data _,_⊢_·:_ : hctx → denv → result → typ → Set where RTFix : ∀{Δ Σ' Γ E f x e τ} → Δ , Σ' , Γ ⊢ E → Δ , Σ' , Γ ⊢ fix f ⦇·λ x => e ·⦈ :: τ → Δ , Σ' ⊢ [ E ]fix f ⦇·λ x => e ·⦈ ·: τ RTHole : ∀{Δ Σ' Γ E u τ} → (u , (Γ , τ)) ∈ Δ → Δ , Σ' , Γ ⊢ E → Δ , Σ' ⊢ [ E ]??[ u ] ·: τ RTUnit : ∀{Δ Σ'} → Δ , Σ' ⊢ ⟨⟩ ·: ⟨⟩ RTPair : ∀{Δ Σ' r1 r2 τ1 τ2} → Δ , Σ' ⊢ r1 ·: τ1 → Δ , Σ' ⊢ r2 ·: τ2 → Δ , Σ' ⊢ ⟨ r1 , r2 ⟩ ·: ⟨ τ1 × τ2 ⟩ RTCtor : ∀{Δ Σ' d cctx c r τ} → (d , cctx) ∈ π1 Σ' → (c , τ) ∈ cctx → Δ , Σ' ⊢ r ·: τ → Δ , Σ' ⊢ C[ c ] r ·: D[ d ] RTApp : ∀{Δ Σ' f arg τ1 τ2} → Δ , Σ' ⊢ f ·: τ1 ==> τ2 → Δ , Σ' ⊢ arg ·: τ1 → Δ , Σ' ⊢ f ∘ arg ·: τ2 RTPrj : ∀{Δ Σ' i r τ1 τ2} → Δ , Σ' ⊢ r ·: ⟨ τ1 × τ2 ⟩ → Δ , Σ' ⊢ prj[ i ] r ·: prj i τ1 τ2 RTCase : ∀{Δ Σ' Γ E d cctx r rules τ} → (d , cctx) ∈ π1 Σ' → Δ , Σ' , Γ ⊢ E → Δ , Σ' ⊢ r ·: D[ d ] → -- There must be a rule for each constructor, i.e. case exhaustiveness (∀{c} → dom cctx c → dom rules c) → (∀{c xc ec} → (c , |C xc => ec) ∈ rules → -- The constructor of each rule must be of the right datatype, and the branch must type-check Σ[ τc ∈ typ ] ( (c , τc) ∈ cctx ∧ Δ , Σ' , (Γ ,, (xc , τc)) ⊢ ec :: τ)) → Δ , Σ' ⊢ [ E ]case r of⦃· rules ·⦄ ·: τ RTUnwrapCtor : ∀{Δ Σ' d cctx c r τ} → (d , cctx) ∈ π1 Σ' → (c , τ) ∈ cctx → Δ , Σ' ⊢ r ·: D[ d ] → Δ , Σ' ⊢ C⁻¹[ c ] r ·: τ excon = env ∧ ex excons = List excon assertions = List (result ∧ val) hole-fillings = exp ctx constraints = hole-fillings ∧ excons ctx record goal : Set where inductive constructor _⊢??[_]:_⊨_ field g-tctx : tctx g-id : Nat g-typ : typ g-excons : excons goals = List goal -- value-to-example coercion ⌊_⌋ : val → ex ⌊ ⟨⟩ ⌋ = ⟨⟩ ⌊ ⟨ v1 , v2 ⟩ ⌋ = ⟨ ⌊ v1 ⌋ , ⌊ v2 ⌋ ⟩ ⌊ C[ c ] v ⌋ = C[ c ] ⌊ v ⌋ -- result-to-value coercion data ⌈_⌉:=_ : result → val → Set where CoerceUnit : ⌈ ⟨⟩ ⌉:= ⟨⟩ CoercePair : ∀{r1 r2 v1 v2} → ⌈ r1 ⌉:= v1 → ⌈ r2 ⌉:= v2 → ⌈ ⟨ r1 , r2 ⟩ ⌉:= ⟨ v1 , v2 ⟩ CoerceCtor : ∀{c r v} → ⌈ r ⌉:= v → ⌈ C[ c ] r ⌉:= C[ c ] v -- excons typing data _,_⊢_::ˣ_,_ : hctx → denv → excons → tctx → typ → Set where TXNil : ∀{Δ Σ' Γ τ} → Δ , Σ' ⊢ [] ::ˣ Γ , τ TXInd : ∀{Δ Σ' X E ex Γ τ} → Δ , Σ' ⊢ X ::ˣ Γ , τ → Δ , Σ' , Γ ⊢ E → Δ , Σ' ⊢ ex :· τ → Δ , Σ' ⊢ ((E , ex) :: X) ::ˣ Γ , τ -- type assignment for hole fillings data _,_⊢ᴴ_ : hctx → denv → hole-fillings → Set where TFNil : ∀{Δ Σ'} → Δ , Σ' ⊢ᴴ ∅ TFInd : ∀{Δ Σ' F u Γ τ e} → (u , Γ , τ) ∈ Δ → Δ , Σ' ⊢ᴴ F → Δ , Σ' , Γ ⊢ e :: τ → Δ , Σ' ⊢ᴴ (F ,, (u , e)) {- TODO - we have to decide between this version and the one prior _,_⊢ₕ_ : hctx → denv → hole-fillings → Set Δ , Σ' ⊢ₕ F = ∀{u e} → (u , e) ∈ F → Σ[ Γ ∈ tctx ] Σ[ τ ∈ typ ] ( (u , Γ , τ) ∈ Δ ∧ Δ , Σ' , Γ ⊢ e :: τ) -} -- these are used to determine the "order" in which result consistency rules are checked not-both-pair : (r r' : result) → Set not-both-pair r r' = (∀{r1 r2} → r ≠ ⟨ r1 , r2 ⟩) ∨ (∀{r1 r2} → r' ≠ ⟨ r1 , r2 ⟩) not-both-ctor : (r r' : result) → Set not-both-ctor r r' = (∀{c r''} → r ≠ (C[ c ] r'')) ∨ (∀{c r''} → r' ≠ (C[ c ] r'')) -- result consistency data _≡⌊_⌋_ : result → assertions → result → Set where RCRefl : ∀{r} → r ≡⌊ [] ⌋ r RCPair : ∀{r1 r2 r'1 r'2 A1 A2} → (_==_ {A = result} ⟨ r1 , r2 ⟩ ⟨ r'1 , r'2 ⟩ → ⊥) → r1 ≡⌊ A1 ⌋ r'1 → r2 ≡⌊ A2 ⌋ r'2 → ⟨ r1 , r2 ⟩ ≡⌊ A1 ++ A2 ⌋ ⟨ r'1 , r'2 ⟩ RCCtor : ∀{c r r' A} → (_==_ {A = result} (C[ c ] r) (C[ c ] r') → ⊥) → r ≡⌊ A ⌋ r' → (C[ c ] r) ≡⌊ A ⌋ (C[ c ] r') RCAssert1 : ∀{r1 r2 v2 A} → r1 ≠ r2 → not-both-pair r1 r2 → not-both-ctor r1 r2 → ⌈ r2 ⌉:= v2 → A == (r1 , v2) :: [] → r1 ≡⌊ A ⌋ r2 RCAssert2 : ∀{r1 r2 v1 A} → r1 ≠ r2 → not-both-pair r1 r2 → not-both-ctor r1 r2 → ⌈ r1 ⌉:= v1 → A == (r2 , v1) :: [] → r1 ≡⌊ A ⌋ r2 -- Generic result consistency failure - this goes through if results are not consistent data _≢_ : result → result → Set where RCFPair1 : ∀{r1 r2 r'1 r'2} → r1 ≢ r'1 → ⟨ r1 , r2 ⟩ ≢ ⟨ r'1 , r'2 ⟩ RCFPair2 : ∀{r1 r2 r'1 r'2} → r2 ≢ r'2 → ⟨ r1 , r2 ⟩ ≢ ⟨ r'1 , r'2 ⟩ RCFCtorMM : ∀{c c' r r'} → c ≠ c' → (C[ c ] r) ≢ (C[ c' ] r') RCFCtor : ∀{c r r'} → r ≢ r' → (C[ c ] r) ≢ (C[ c ] r') RCFNoCoerce : ∀{r r'} → r ≠ r' → not-both-pair r r' → not-both-ctor r r' → (∀{v} → ⌈ r ⌉:= v → ⊥) → (∀{v} → ⌈ r' ⌉:= v → ⊥) → r ≢ r' -- Various judgments accept "fuel", which defines whether or not they can recurse indefinitely, -- and, if not, then the numerical limit. The limit is not on the recursion depth, but rather -- on the number of "beta reductions", interpreted a bit loosely to include case evaluations. -- - If ⌊ ⛽ ⌋ is ∞, then there is no beta reduction limit, -- but the judgment will not be satisfied unless evaluation eventually terminates. -- - If ⌊ ⛽ ⌋ is ⛽⟨ n ⟩, then the beta reduction limit is at most n, -- but if the limit is reached, then "success" judgments will not go through, -- but "failure" judgments will be satisfied automatically. data Fuel : Set where ∞ : Fuel ⛽⟨_⟩ : Nat → Fuel -- fuel depletion data _⛽⇓_ : Fuel → Fuel → Set where CF∞ : ∞ ⛽⇓ ∞ CF⛽ : ∀{n} → ⛽⟨ 1+ n ⟩ ⛽⇓ ⛽⟨ n ⟩ -- TODO we need a theorem that h-constraints cannot generate spurious hole names. -- generally, all the steps from an exp to an something with holes should not contain hole names -- not in the original exp, and the process as a whole should also not produce spurious names -- this realization probably means there are other important theorems that have been missed -- NOTE the core theorem in completeness.agda will do the trick for evaluation itself -- TODO we should have theorems that constrain where don't cares and such can be found. -- Don't cares should only be generated in backprop and should not appear anywhere else. -- Generic big step evaluation data _⊢_⌊_⌋⇒_⊣_ : env → exp → Fuel → result → assertions → Set where EUnit : ∀{E ⛽} → E ⊢ ⟨⟩ ⌊ ⛽ ⌋⇒ ⟨⟩ ⊣ [] EPair : ∀{E ⛽ e1 e2 r1 r2 A1 A2} → E ⊢ e1 ⌊ ⛽ ⌋⇒ r1 ⊣ A1 → E ⊢ e2 ⌊ ⛽ ⌋⇒ r2 ⊣ A2 → E ⊢ ⟨ e1 , e2 ⟩ ⌊ ⛽ ⌋⇒ ⟨ r1 , r2 ⟩ ⊣ A1 ++ A2 ECtor : ∀{E ⛽ c e r A} → E ⊢ e ⌊ ⛽ ⌋⇒ r ⊣ A → E ⊢ C[ c ] e ⌊ ⛽ ⌋⇒ (C[ c ] r) ⊣ A EFix : ∀{E ⛽ f x e} → E ⊢ fix f ⦇·λ x => e ·⦈ ⌊ ⛽ ⌋⇒ [ E ]fix f ⦇·λ x => e ·⦈ ⊣ [] EVar : ∀{E ⛽ x r} → (x , r) ∈ E → E ⊢ X[ x ] ⌊ ⛽ ⌋⇒ r ⊣ [] EHole : ∀{E ⛽ u} → E ⊢ ??[ u ] ⌊ ⛽ ⌋⇒ [ E ]??[ u ] ⊣ [] EAppFix : ∀{E ⛽ ⛽↓ e1 e2 Ef f x ef r1 A1 r2 A2 r A} → ⛽ ⛽⇓ ⛽↓ → E ⊢ e1 ⌊ ⛽ ⌋⇒ r1 ⊣ A1 → r1 == [ Ef ]fix f ⦇·λ x => ef ·⦈ → E ⊢ e2 ⌊ ⛽ ⌋⇒ r2 ⊣ A2 → (Ef ,, (f , r1) ,, (x , r2)) ⊢ ef ⌊ ⛽↓ ⌋⇒ r ⊣ A → E ⊢ e1 ∘ e2 ⌊ ⛽ ⌋⇒ r ⊣ A1 ++ A2 ++ A EAppIndet : ∀{E ⛽ e1 e2 r1 A1 r2 A2} → E ⊢ e1 ⌊ ⛽ ⌋⇒ r1 ⊣ A1 → (∀{Ef f x ef} → r1 ≠ [ Ef ]fix f ⦇·λ x => ef ·⦈) → E ⊢ e2 ⌊ ⛽ ⌋⇒ r2 ⊣ A2 → E ⊢ e1 ∘ e2 ⌊ ⛽ ⌋⇒ (r1 ∘ r2) ⊣ A1 ++ A2 EPrj : ∀{E ⛽ i e r1 r2 A} → E ⊢ e ⌊ ⛽ ⌋⇒ ⟨ r1 , r2 ⟩ ⊣ A → E ⊢ prj[ i ] e ⌊ ⛽ ⌋⇒ prj i r1 r2 ⊣ A EPrjIndet : ∀{E ⛽ i e r A} → E ⊢ e ⌊ ⛽ ⌋⇒ r ⊣ A → (∀{r1 r2} → r ≠ ⟨ r1 , r2 ⟩) → E ⊢ prj[ i ] e ⌊ ⛽ ⌋⇒ prj[ i ] r ⊣ A ECase : ∀{E ⛽ ⛽↓ e rules c xc ec r A' rc A} → ⛽ ⛽⇓ ⛽↓ → (c , |C xc => ec) ∈ rules → E ⊢ e ⌊ ⛽ ⌋⇒ (C[ c ] r) ⊣ A → (E ,, (xc , r)) ⊢ ec ⌊ ⛽↓ ⌋⇒ rc ⊣ A' → E ⊢ case e of⦃· rules ·⦄ ⌊ ⛽ ⌋⇒ rc ⊣ A ++ A' ECaseIndet : ∀{E ⛽ e rules r A} → E ⊢ e ⌊ ⛽ ⌋⇒ r ⊣ A → (∀{c rc} → r ≠ (C[ c ] rc)) → E ⊢ case e of⦃· rules ·⦄ ⌊ ⛽ ⌋⇒ [ E ]case r of⦃· rules ·⦄ ⊣ A EAssert : ∀{E ⛽ e1 r1 A1 e2 r2 A2 A3} → E ⊢ e1 ⌊ ⛽ ⌋⇒ r1 ⊣ A1 → E ⊢ e2 ⌊ ⛽ ⌋⇒ r2 ⊣ A2 → r1 ≡⌊ A3 ⌋ r2 → E ⊢ PBE:assert e1 e2 ⌊ ⛽ ⌋⇒ ⟨⟩ ⊣ A1 ++ A2 ++ A3 -- Generic evaluation failure - this goes through if evaluation would fail due to failure -- of some assertion that occurs during evaluation, or if the fuel runs out. data _⊢_⌊_⌋⇒∅ : env → exp → Fuel → Set where EFPair1 : ∀{E ⛽ e1 e2} → E ⊢ e1 ⌊ ⛽ ⌋⇒∅ → E ⊢ ⟨ e1 , e2 ⟩ ⌊ ⛽ ⌋⇒∅ EFPair2 : ∀{E ⛽ e1 e2} → E ⊢ e2 ⌊ ⛽ ⌋⇒∅ → E ⊢ ⟨ e1 , e2 ⟩ ⌊ ⛽ ⌋⇒∅ EFCtor : ∀{E ⛽ c e} → E ⊢ e ⌊ ⛽ ⌋⇒∅ → E ⊢ C[ c ] e ⌊ ⛽ ⌋⇒∅ EFAppFun : ∀{E ⛽ e1 e2} → E ⊢ e1 ⌊ ⛽ ⌋⇒∅ → E ⊢ e1 ∘ e2 ⌊ ⛽ ⌋⇒∅ EFAppArg : ∀{E ⛽ e1 e2} → E ⊢ e2 ⌊ ⛽ ⌋⇒∅ → E ⊢ e1 ∘ e2 ⌊ ⛽ ⌋⇒∅ EFAppEval : ∀{E ⛽ ⛽↓ e1 e2 Ef f x ef r1 A1 r2 A2} → ⛽ ⛽⇓ ⛽↓ → E ⊢ e1 ⌊ ⛽ ⌋⇒ r1 ⊣ A1 → r1 == [ Ef ]fix f ⦇·λ x => ef ·⦈ → E ⊢ e2 ⌊ ⛽ ⌋⇒ r2 ⊣ A2 → (Ef ,, (f , r1) ,, (x , r2)) ⊢ ef ⌊ ⛽↓ ⌋⇒∅ → E ⊢ e1 ∘ e2 ⌊ ⛽ ⌋⇒∅ EFPrj : ∀{E ⛽ i e} → E ⊢ e ⌊ ⛽ ⌋⇒∅ → E ⊢ prj[ i ] e ⌊ ⛽ ⌋⇒∅ EFCaseScrut : ∀{E ⛽ e rules} → E ⊢ e ⌊ ⛽ ⌋⇒∅ → E ⊢ case e of⦃· rules ·⦄ ⌊ ⛽ ⌋⇒∅ EFCaseRule : ∀{E ⛽ ⛽↓ e rules c xc ec r A} → ⛽ ⛽⇓ ⛽↓ → (c , |C xc => ec) ∈ rules → E ⊢ e ⌊ ⛽ ⌋⇒ (C[ c ] r) ⊣ A → (E ,, (xc , r)) ⊢ ec ⌊ ⛽↓ ⌋⇒∅ → E ⊢ case e of⦃· rules ·⦄ ⌊ ⛽ ⌋⇒∅ EFAssert1 : ∀{E ⛽ e1 e2} → E ⊢ e1 ⌊ ⛽ ⌋⇒∅ → E ⊢ PBE:assert e1 e2 ⌊ ⛽ ⌋⇒∅ EFAssert2 : ∀{E ⛽ e1 e2} → E ⊢ e2 ⌊ ⛽ ⌋⇒∅ → E ⊢ PBE:assert e1 e2 ⌊ ⛽ ⌋⇒∅ EFAssert : ∀{E ⛽ e1 r1 A1 e2 r2 A2} → E ⊢ e1 ⌊ ⛽ ⌋⇒ r1 ⊣ A1 → E ⊢ e2 ⌊ ⛽ ⌋⇒ r2 ⊣ A2 → r1 ≢ r2 → E ⊢ PBE:assert e1 e2 ⌊ ⛽ ⌋⇒∅ EFLimit : ∀{E e} → E ⊢ e ⌊ ⛽⟨ 0 ⟩ ⌋⇒∅ -- resumption mutual data _⊢_⌊_⌋:⇨_:=_ : hole-fillings → env → Fuel → env → assertions → Set where RENil : ∀{⛽ F} → F ⊢ ∅ ⌊ ⛽ ⌋:⇨ ∅ := [] REInd : ∀{⛽ F E E' x r r' A A'} → F ⊢ E ⌊ ⛽ ⌋:⇨ E' := A → F ⊢ r ⌊ ⛽ ⌋⇨ r' := A' → F ⊢ E ,, (x , r) ⌊ ⛽ ⌋:⇨ (E' ,, (x , r')) := A ++ A' data _⊢_⌊_⌋⇨_:=_ : hole-fillings → result → Fuel → result → assertions → Set where RHoleResume : ∀{⛽ F E u r r' e A A'} → (u , e) ∈ F → E ⊢ e ⌊ ⛽ ⌋⇒ r ⊣ A → F ⊢ r ⌊ ⛽ ⌋⇨ r' := A' → F ⊢ [ E ]??[ u ] ⌊ ⛽ ⌋⇨ r' := A ++ A' RHoleIndet : ∀{⛽ F E E' u A} → u # F → F ⊢ E ⌊ ⛽ ⌋:⇨ E' := A → F ⊢ [ E ]??[ u ] ⌊ ⛽ ⌋⇨ [ E' ]??[ u ] := A RUnit : ∀{⛽ F} → F ⊢ ⟨⟩ ⌊ ⛽ ⌋⇨ ⟨⟩ := [] RPair : ∀{⛽ F r1 r2 r1' r2' A1 A2} → F ⊢ r1 ⌊ ⛽ ⌋⇨ r1' := A1 → F ⊢ r2 ⌊ ⛽ ⌋⇨ r2' := A2 → F ⊢ ⟨ r1 , r2 ⟩ ⌊ ⛽ ⌋⇨ ⟨ r1' , r2' ⟩ := A1 ++ A2 RCtor : ∀{⛽ F c r r' A} → F ⊢ r ⌊ ⛽ ⌋⇨ r' := A → F ⊢ C[ c ] r ⌊ ⛽ ⌋⇨ (C[ c ] r') := A RApp : ∀{⛽ ⛽↓ F r1 r2 r r' Ef f x ef r1' r2' A1 A2 Af A'} → ⛽ ⛽⇓ ⛽↓ → F ⊢ r1 ⌊ ⛽ ⌋⇨ r1' := A1 → r1' == [ Ef ]fix f ⦇·λ x => ef ·⦈ → F ⊢ r2 ⌊ ⛽ ⌋⇨ r2' := A2 → (Ef ,, (f , r1') ,, (x , r2')) ⊢ ef ⌊ ⛽↓ ⌋⇒ r ⊣ Af → F ⊢ r ⌊ ⛽↓ ⌋⇨ r' := A' → F ⊢ r1 ∘ r2 ⌊ ⛽ ⌋⇨ r' := A1 ++ A2 ++ Af ++ A' RAppIndet : ∀{⛽ F r1 r2 r1' r2' A1 A2} → F ⊢ r1 ⌊ ⛽ ⌋⇨ r1' := A1 → (∀{Ef f x ef} → r1' ≠ [ Ef ]fix f ⦇·λ x => ef ·⦈) → F ⊢ r2 ⌊ ⛽ ⌋⇨ r2' := A2 → F ⊢ r1 ∘ r2 ⌊ ⛽ ⌋⇨ (r1' ∘ r2') := A1 ++ A2 RFix : ∀{⛽ F E E' f x e A} → F ⊢ E ⌊ ⛽ ⌋:⇨ E' := A → F ⊢ [ E ]fix f ⦇·λ x => e ·⦈ ⌊ ⛽ ⌋⇨ [ E' ]fix f ⦇·λ x => e ·⦈ := A RPrj : ∀{⛽ F i r r1 r2 A} → F ⊢ r ⌊ ⛽ ⌋⇨ ⟨ r1 , r2 ⟩ := A → F ⊢ prj[ i ] r ⌊ ⛽ ⌋⇨ prj i r1 r2 := A RPrjIndet : ∀{⛽ F i r r' A} → F ⊢ r ⌊ ⛽ ⌋⇨ r' := A → (∀{r1 r2} → r' ≠ ⟨ r1 , r2 ⟩) → F ⊢ prj[ i ] r ⌊ ⛽ ⌋⇨ prj[ i ] r' := A RCase : ∀{⛽ F E r rules c xc ec r' rc A A'} → (c , |C xc => ec) ∈ rules → F ⊢ r ⌊ ⛽ ⌋⇨ (C[ c ] r') := A → F ⊢ [ E ]fix xc ⦇·λ xc => ec ·⦈ ∘ (C⁻¹[ c ] r) ⌊ ⛽ ⌋⇨ rc := A' → F ⊢ [ E ]case r of⦃· rules ·⦄ ⌊ ⛽ ⌋⇨ rc := A ++ A' RCaseIndet : ∀{⛽ F E E' r rules r' A A'} → F ⊢ r ⌊ ⛽ ⌋⇨ r' := A → (∀{c rc} → r' ≠ (C[ c ] rc)) → F ⊢ E ⌊ ⛽ ⌋:⇨ E' := A' → F ⊢ [ E ]case r of⦃· rules ·⦄ ⌊ ⛽ ⌋⇨ [ E' ]case r' of⦃· rules ·⦄ := A ++ A' RUnwrapCtor : ∀{⛽ F r c rc A} → F ⊢ r ⌊ ⛽ ⌋⇨ C[ c ] rc := A → F ⊢ C⁻¹[ c ] r ⌊ ⛽ ⌋⇨ rc := A RUnwrapIndet : ∀{⛽ F c r r' A} → F ⊢ r ⌊ ⛽ ⌋⇨ r' := A → (∀{rc} → r' ≠ (C[ c ] rc)) → F ⊢ C⁻¹[ c ] r ⌊ ⛽ ⌋⇨ C⁻¹[ c ] r' := A -- Generic resumption failure - this goes through if resumption would fail due to failure -- of some evaluation that occurs during resumption. mutual data _⊢_⌊_⌋:⇨∅ : hole-fillings → env → Fuel → Set where RFERes : ∀{⛽ F E x r} → F ⊢ r ⌊ ⛽ ⌋⇨∅ → F ⊢ (E ,, (x , r)) ⌊ ⛽ ⌋:⇨∅ RFEEnv : ∀{⛽ F E x r} → F ⊢ E ⌊ ⛽ ⌋:⇨∅ → F ⊢ (E ,, (x , r)) ⌊ ⛽ ⌋:⇨∅ {- TODO we must choose between this approach and the one prior RFE : ∀{⛽ F E x r} → (x , r) ∈ E → F ⊢ r ⌊ ⛽ ⌋⇨∅ → F ⊢ E ⌊ ⛽ ⌋:⇨∅ -} data _⊢_⌊_⌋⇨∅ : hole-fillings → result → Fuel → Set where RFHoleEval : ∀{⛽ F E u e} → (u , e) ∈ F → E ⊢ e ⌊ ⛽ ⌋⇒∅ → F ⊢ [ E ]??[ u ] ⌊ ⛽ ⌋⇨∅ RFHoleRes : ∀{⛽ F E u e r A} → (u , e) ∈ F → E ⊢ e ⌊ ⛽ ⌋⇒ r ⊣ A → F ⊢ r ⌊ ⛽ ⌋⇨∅ → F ⊢ [ E ]??[ u ] ⌊ ⛽ ⌋⇨∅ RFHoleIndet : ∀{⛽ F E u} → u # F → F ⊢ E ⌊ ⛽ ⌋:⇨∅ → F ⊢ [ E ]??[ u ] ⌊ ⛽ ⌋⇨∅ RFPair1 : ∀{⛽ F r1 r2} → F ⊢ r1 ⌊ ⛽ ⌋⇨∅ → F ⊢ ⟨ r1 , r2 ⟩ ⌊ ⛽ ⌋⇨∅ RFPair2 : ∀{⛽ F r1 r2} → F ⊢ r2 ⌊ ⛽ ⌋⇨∅ → F ⊢ ⟨ r1 , r2 ⟩ ⌊ ⛽ ⌋⇨∅ RFCtor : ∀{⛽ F c r} → F ⊢ r ⌊ ⛽ ⌋⇨∅ → F ⊢ C[ c ] r ⌊ ⛽ ⌋⇨∅ RFAppFun : ∀{⛽ F r1 r2} → F ⊢ r1 ⌊ ⛽ ⌋⇨∅ → F ⊢ r1 ∘ r2 ⌊ ⛽ ⌋⇨∅ RFAppArg : ∀{⛽ F r1 r2} → F ⊢ r2 ⌊ ⛽ ⌋⇨∅ → F ⊢ r1 ∘ r2 ⌊ ⛽ ⌋⇨∅ RFAppEval : ∀{⛽ ⛽↓ F r1 r2 Ef f x ef r1' r2' A1 A2} → ⛽ ⛽⇓ ⛽↓ → F ⊢ r1 ⌊ ⛽ ⌋⇨ r1' := A1 → r1' == [ Ef ]fix f ⦇·λ x => ef ·⦈ → F ⊢ r2 ⌊ ⛽ ⌋⇨ r2' := A2 → (Ef ,, (f , r1') ,, (x , r2')) ⊢ ef ⌊ ⛽↓ ⌋⇒∅ → F ⊢ r1 ∘ r2 ⌊ ⛽ ⌋⇨∅ RFAppRes : ∀{⛽ ⛽↓ F r1 r2 Ef f x ef r1' r2' r A1 A2 Af} → ⛽ ⛽⇓ ⛽↓ → F ⊢ r1 ⌊ ⛽ ⌋⇨ r1' := A1 → r1' == [ Ef ]fix f ⦇·λ x => ef ·⦈ → F ⊢ r2 ⌊ ⛽ ⌋⇨ r2' := A2 → (Ef ,, (f , r1') ,, (x , r2')) ⊢ ef ⌊ ⛽↓ ⌋⇒ r ⊣ Af → F ⊢ r ⌊ ⛽↓ ⌋⇨∅ → F ⊢ r1 ∘ r2 ⌊ ⛽ ⌋⇨∅ RFFix : ∀{⛽ F E f x e} → F ⊢ E ⌊ ⛽ ⌋:⇨∅ → F ⊢ [ E ]fix f ⦇·λ x => e ·⦈ ⌊ ⛽ ⌋⇨∅ RFPrj : ∀{⛽ F i r} → F ⊢ r ⌊ ⛽ ⌋⇨∅ → F ⊢ prj[ i ] r ⌊ ⛽ ⌋⇨∅ RFCaseScrut : ∀{⛽ F E r rules} → F ⊢ r ⌊ ⛽ ⌋⇨∅ → F ⊢ [ E ]case r of⦃· rules ·⦄ ⌊ ⛽ ⌋⇨∅ RFCase : ∀{⛽ F E r rules c xc ec r' A} → (c , |C xc => ec) ∈ rules → F ⊢ r ⌊ ⛽ ⌋⇨ (C[ c ] r') := A → F ⊢ [ E ]fix xc ⦇·λ xc => ec ·⦈ ∘ (C⁻¹[ c ] r) ⌊ ⛽ ⌋⇨∅ → F ⊢ [ E ]case r of⦃· rules ·⦄ ⌊ ⛽ ⌋⇨∅ RFCaseIndet : ∀{⛽ F E r rules r' A} → F ⊢ r ⌊ ⛽ ⌋⇨ r' := A → (∀{c rc} → r' ≠ (C[ c ] rc)) → F ⊢ E ⌊ ⛽ ⌋:⇨∅ → F ⊢ [ E ]case r of⦃· rules ·⦄ ⌊ ⛽ ⌋⇨∅ RFUnwrapCtor : ∀{⛽ F c r} → F ⊢ r ⌊ ⛽ ⌋⇨∅ → F ⊢ C⁻¹[ c ] r ⌊ ⛽ ⌋⇨∅ RFLimit : ∀{F r} → F ⊢ r ⌊ ⛽⟨ 0 ⟩ ⌋⇨∅ data Filter_:=_ : excons → excons → Set where FilterNil : Filter [] := [] FilterYes : ∀{X X' E ex} → Filter X := X' → ex ≠ ¿¿ → Filter (E , ex) :: X := ((E , ex) :: X') FilterNo : ∀{X X' E} → Filter X := X' → Filter (E , ¿¿) :: X := X' -- Assertion Satisfaction and Simplification data _⌊_⌋⊨ᴬ_ : hole-fillings → Fuel → assertions → Set where SANil : ∀{⛽ F} → F ⌊ ⛽ ⌋⊨ᴬ [] SAInd : ∀{⛽ F r v r' A A'} → F ⌊ ⛽ ⌋⊨ᴬ A → F ⊢ r ⌊ ⛽ ⌋⇨ r' := A' → F ⌊ ⛽ ⌋⊨ᴬ A' → ⌈ r' ⌉:= v → F ⌊ ⛽ ⌋⊨ᴬ ((r , v) :: A) -- Example Satisfaction (of Results) data _⊢_⌊_⌋⊨ᴿ_ : hole-fillings → result → Fuel → ex → Set where XSTop : ∀{⛽ F r} → F ⊢ r ⌊ ⛽ ⌋⊨ᴿ ¿¿ XSUnit : ∀{⛽ F} → F ⊢ ⟨⟩ ⌊ ⛽ ⌋⊨ᴿ ⟨⟩ XSPair : ∀{⛽ F r1 r2 ex1 ex2} → F ⊢ r1 ⌊ ⛽ ⌋⊨ᴿ ex1 → F ⊢ r2 ⌊ ⛽ ⌋⊨ᴿ ex2 → F ⊢ ⟨ r1 , r2 ⟩ ⌊ ⛽ ⌋⊨ᴿ ⟨ ex1 , ex2 ⟩ XSCtor : ∀{⛽ F r c ex} → F ⊢ r ⌊ ⛽ ⌋⊨ᴿ ex → F ⊢ C[ c ] r ⌊ ⛽ ⌋⊨ᴿ (C[ c ] ex) XSInOut : ∀{⛽ F r1 r2 v2 ex r A} → ⌈ r2 ⌉:= v2 → F ⊢ r1 ∘ r2 ⌊ ⛽ ⌋⇨ r := A → F ⊢ r ⌊ ⛽ ⌋⊨ᴿ ex → F ⌊ ⛽ ⌋⊨ᴬ A → F ⊢ r1 ⌊ ⛽ ⌋⊨ᴿ (v2 ↦ ex) -- Example Satisfaction (of Expressions) data _⊢_⌊_⌋⊨ᴱ_ : hole-fillings → exp → Fuel → excons → Set where SatNil : ∀{⛽ F e} → F ⊢ e ⌊ ⛽ ⌋⊨ᴱ [] SatTop : ∀{⛽ F e E X} → F ⊢ e ⌊ ⛽ ⌋⊨ᴱ X → F ⊢ e ⌊ ⛽ ⌋⊨ᴱ ((E , ¿¿) :: X) SatInd : ∀{⛽ F e E ex X r r' A A'} → ex ≠ ¿¿ → F ⊢ e ⌊ ⛽ ⌋⊨ᴱ X → E ⊢ e ⌊ ⛽ ⌋⇒ r ⊣ A → F ⊢ r ⌊ ⛽ ⌋⇨ r' := A' → F ⊢ r' ⌊ ⛽ ⌋⊨ᴿ ex → F ⌊ ⛽ ⌋⊨ᴬ A ++ A' → F ⊢ e ⌊ ⛽ ⌋⊨ᴱ ((E , ex) :: X) data _⌊_⌋⊨ᵁ_ : hole-fillings → Fuel → excons ctx → Set where CSNil : ∀{⛽ F} → F ⌊ ⛽ ⌋⊨ᵁ ∅ CSInd : ∀{⛽ F U u X} → F ⌊ ⛽ ⌋⊨ᵁ U → F ⊢ ??[ u ] ⌊ ⛽ ⌋⊨ᴱ X → F ⌊ ⛽ ⌋⊨ᵁ (U ,, (u , X)) -- Constraint Satisfaction _⌊_⌋⊨ᴷ_ : hole-fillings → Fuel → constraints → Set F ⌊ ⛽ ⌋⊨ᴷ (F0 , U) = (∀{u e} → (u , e) ∈ F0 → (u , e) ∈ F) ∧ F ⌊ ⛽ ⌋⊨ᵁ U -- constraints merge _⊕_:=_ : constraints → constraints → constraints → Set (F1 , U1) ⊕ (F2 , U2) := (F' , U') = F1 ≈ F2 ∧ F1 ∪ F2 == F' ∧ U1 ⊎ U2 == U' mutual -- example unevaluation data _,_,_⊢_⇐⌊_⌋_:=_ : hctx → denv → hole-fillings → result → Fuel → ex → constraints → Set where UTop : ∀{⛽ Δ Σ' F r} → Δ , Σ' , F ⊢ r ⇐⌊ ⛽ ⌋ ¿¿ := (∅ , ∅) UHole : ∀{⛽ Δ Σ' F E u ex} → ex ≠ ¿¿ → Δ , Σ' , F ⊢ [ E ]??[ u ] ⇐⌊ ⛽ ⌋ ex := (∅ , ■ (u , (E , ex) :: [])) UUnit : ∀{⛽ Δ Σ' F} → Δ , Σ' , F ⊢ ⟨⟩ ⇐⌊ ⛽ ⌋ ⟨⟩ := (∅ , ∅) UCtor : ∀{⛽ Δ Σ' F c r ex K} → Δ , Σ' , F ⊢ r ⇐⌊ ⛽ ⌋ ex := K → Δ , Σ' , F ⊢ C[ c ] r ⇐⌊ ⛽ ⌋ C[ c ] ex := K UPair : ∀{⛽ Δ Σ' F r1 r2 ex1 ex2 K1 K2 K'} → Δ , Σ' , F ⊢ r1 ⇐⌊ ⛽ ⌋ ex1 := K1 → Δ , Σ' , F ⊢ r2 ⇐⌊ ⛽ ⌋ ex2 := K2 → K1 ⊕ K2 := K' → Δ , Σ' , F ⊢ ⟨ r1 , r2 ⟩ ⇐⌊ ⛽ ⌋ ⟨ ex1 , ex2 ⟩ := K' UFix : ∀{⛽ ⛽↓ Δ Σ' F E f x e rf v r ex K} → ⛽ ⛽⇓ ⛽↓ → rf == [ E ]fix f ⦇·λ x => e ·⦈ → ⌈ r ⌉:= v → Δ , Σ' , F ⊢ e ⌊ ⛽ ⌋⇌ ((E ,, (f , rf) ,, (x , r)) , ex) :: [] := K → Δ , Σ' , F ⊢ rf ⇐⌊ ⛽ ⌋ v ↦ ex := K UApp : ∀{⛽ Δ Σ' F r1 r2 ex v2 K} → ex ≠ ¿¿ → ⌈ r2 ⌉:= v2 → Δ , Σ' , F ⊢ r1 ⇐⌊ ⛽ ⌋ v2 ↦ ex := K → Δ , Σ' , F ⊢ r1 ∘ r2 ⇐⌊ ⛽ ⌋ ex := K UPrj1 : ∀{⛽ Δ Σ' F r ex K} → ex ≠ ¿¿ → Δ , Σ' , F ⊢ r ⇐⌊ ⛽ ⌋ ⟨ ex , ¿¿ ⟩ := K → Δ , Σ' , F ⊢ prj[ P1 ] r ⇐⌊ ⛽ ⌋ ex := K UPrj2 : ∀{⛽ Δ Σ' F r ex K} → ex ≠ ¿¿ → Δ , Σ' , F ⊢ r ⇐⌊ ⛽ ⌋ ⟨ ¿¿ , ex ⟩ := K → Δ , Σ' , F ⊢ prj[ P2 ] r ⇐⌊ ⛽ ⌋ ex := K UCase : ∀{⛽ ⛽↓ Δ Σ' F E r rules ex c xc ec K1 K2 K'} → ex ≠ ¿¿ → ⛽ ⛽⇓ ⛽↓ → (c , |C xc => ec) ∈ rules → Δ , Σ' , F ⊢ r ⇐⌊ ⛽ ⌋ C[ c ] ¿¿ := K1 → Δ , Σ' , F ⊢ ec ⌊ ⛽↓ ⌋⇌ ((E ,, (xc , C⁻¹[ c ] r)) , ex) :: [] := K2 → K1 ⊕ K2 := K' → Δ , Σ' , F ⊢ [ E ]case r of⦃· rules ·⦄ ⇐⌊ ⛽ ⌋ ex := K' UCaseGuess : ∀{⛽ ⛽↓ Δ Σ' F F' E r rules ex c xc ec r' A K K' Kₘ₁ Kₘ₂} → ex ≠ ¿¿ → ⛽ ⛽⇓ ⛽↓ → (c , |C xc => ec) ∈ rules → Δ , Σ' ⊢ᴴ F' → F ## F' → F ∪ F' ⊢ r ⌊ ⛽ ⌋⇨ C[ c ] r' := A → Δ , Σ' ⊢Simplify A ⌊ ⛽ ⌋:= K → Δ , Σ' , F ∪ F' ⊢ ec ⌊ ⛽↓ ⌋⇌ ((E ,, (xc , r')) , ex) :: [] := K' → K ⊕ K' := Kₘ₁ → (F' , ∅) ⊕ Kₘ₁ := Kₘ₂ → Δ , Σ' , F ⊢ [ E ]case r of⦃· rules ·⦄ ⇐⌊ ⛽ ⌋ ex := Kₘ₂ UUnwrapCtor : ∀{⛽ Δ Σ' F c r ex K} → ex ≠ ¿¿ → Δ , Σ' , F ⊢ r ⇐⌊ ⛽ ⌋ C[ c ] ex := K → Δ , Σ' , F ⊢ C⁻¹[ c ] r ⇐⌊ ⛽ ⌋ ex := K -- Assertion Simplification data _,_⊢Simplify_⌊_⌋:=_ : hctx → denv → assertions → Fuel → constraints → Set where SNil : ∀{⛽ Δ Σ'} → Δ , Σ' ⊢Simplify [] ⌊ ⛽ ⌋:= (∅ , ∅) SInd : ∀{⛽ Δ Σ' r v A K K' K''} → Δ , Σ' ⊢Simplify A ⌊ ⛽ ⌋:= K → r final → Δ , Σ' , ∅ ⊢ r ⇐⌊ ⛽ ⌋ ⌊ v ⌋ := K' → K ⊕ K' := K'' → Δ , Σ' ⊢Simplify (r , v) :: A ⌊ ⛽ ⌋:= K'' -- Live Bidirectional Example Checking data _,_,_⊢_⌊_⌋⇌_:=_ : hctx → denv → hole-fillings → exp → Fuel → excons → constraints → Set where ChkNil : ∀{⛽ Δ Σ' F e} → Δ , Σ' , F ⊢ e ⌊ ⛽ ⌋⇌ [] := (∅ , ∅) ChkInd : ∀{⛽ Δ Σ' F e E ex X r r' A A' K K' K'' Kₘ₁ Kₘ₂} → Δ , Σ' , F ⊢ e ⌊ ⛽ ⌋⇌ X := K → E ⊢ e ⌊ ⛽ ⌋⇒ r ⊣ A → F ⊢ r ⌊ ⛽ ⌋⇨ r' := A' → Δ , Σ' , F ⊢ r' ⇐⌊ ⛽ ⌋ ex := K' → Δ , Σ' ⊢Simplify A ++ A' ⌊ ⛽ ⌋:= K'' → K' ⊕ K'' := Kₘ₁ → K ⊕ Kₘ₁ := Kₘ₂ → Δ , Σ' , F ⊢ e ⌊ ⛽ ⌋⇌ ((E , ex) :: X) := Kₘ₂ -- TODO theorems for all the things, including resumption, synthesis, solve, satisfaction, consistency, Group, and Filter -- Type-Directed Guessing data _⊢⦇_⊢●:_⦈:=ᴳ_ : denv → tctx → typ → exp → Set where GUnit : ∀{Σ' Γ} → Σ' ⊢⦇ Γ ⊢●: ⟨⟩ ⦈:=ᴳ ⟨⟩ GPair : ∀{Σ' Γ τ1 τ2 e1 e2} → Σ' ⊢⦇ Γ ⊢●: τ1 ⦈:=ᴳ e1 → Σ' ⊢⦇ Γ ⊢●: τ2 ⦈:=ᴳ e2 → Σ' ⊢⦇ Γ ⊢●: ⟨ τ1 × τ2 ⟩ ⦈:=ᴳ ⟨ e1 , e2 ⟩ GCtor : ∀{Σ' Γ d cctx c τ e} → (d , cctx) ∈ π1 Σ' → (c , τ) ∈ cctx → Σ' ⊢⦇ Γ ⊢●: τ ⦈:=ᴳ e → Σ' ⊢⦇ Γ ⊢●: D[ d ] ⦈:=ᴳ (C[ c ] e) GFix : ∀{Σ' Γ τ1 τ2 f x e} → Σ' ⊢⦇ Γ ,, (f , τ1 ==> τ2) ,, (x , τ1) ⊢●: τ2 ⦈:=ᴳ e → Σ' ⊢⦇ Γ ⊢●: τ1 ==> τ2 ⦈:=ᴳ fix f ⦇·λ x => e ·⦈ GCase : ∀{Σ' Γ τ e rules d cctx} → (d , cctx) ∈ π1 Σ' → (∀{c} → dom cctx c → dom rules c) → (∀{c} → dom rules c → dom cctx c) → Σ' ⊢⦇ Γ ⊢●: D[ d ] ⦈:=ᴳ e → (∀{c x-c e-c τ-c} → (c , |C x-c => e-c) ∈ rules → (c , τ-c) ∈ cctx → Σ' ⊢⦇ Γ ,, (x-c , τ-c) ⊢●: τ ⦈:=ᴳ e-c) → Σ' ⊢⦇ Γ ⊢●: τ ⦈:=ᴳ case e of⦃· rules ·⦄ GVar : ∀{Σ' Γ τ x} → (x , τ) ∈ Γ → Σ' ⊢⦇ Γ ⊢●: τ ⦈:=ᴳ X[ x ] GApp : ∀{Σ' Γ τ e1 e2 τ'} → Σ' ⊢⦇ Γ ⊢●: τ' ==> τ ⦈:=ᴳ e1 → Σ' ⊢⦇ Γ ⊢●: τ' ⦈:=ᴳ e2 → Σ' ⊢⦇ Γ ⊢●: τ ⦈:=ᴳ (e1 ∘ e2) GPrj : ∀{Σ' Γ τ1 τ2 i e} → Σ' ⊢⦇ Γ ⊢●: ⟨ τ1 × τ2 ⟩ ⦈:=ᴳ e → Σ' ⊢⦇ Γ ⊢●: prj i τ1 τ2 ⦈:=ᴳ (prj[ i ] e) -- TODO theorem that if u # Δ , then u is new in a type-checked exp or result -- TODO theorem that any hole in the exp produced by refinement is in the goals -- Type-and-Example-Directed Refinement data _⊢⦇_⊢●:_⊨_⦈:=ᴿ_⊣_ : denv → tctx → typ → excons → exp → goals → Set where RefUnit : ∀{Σ' Γ X Xf} → Filter X := Xf → (∀{i E ex} → Xf ⟦ i ⟧ == Some (E , ex) → ex == ⟨⟩) → Σ' ⊢⦇ Γ ⊢●: ⟨⟩ ⊨ X ⦈:=ᴿ ⟨⟩ ⊣ [] RefPair : ∀{Σ' Γ τ1 τ2 X u1 u2 G1 G2} {E-ex1-ex2s : List (env ∧ ex ∧ ex)} → Filter X := map (λ {(E , ex1 , ex2) → E , ⟨ ex1 , ex2 ⟩}) E-ex1-ex2s → G1 == Γ ⊢??[ u1 ]: τ1 ⊨ map (λ {(E , ex1 , ex2) → E , ex1}) E-ex1-ex2s → G2 == Γ ⊢??[ u2 ]: τ2 ⊨ map (λ {(E , ex1 , ex2) → E , ex2}) E-ex1-ex2s → Σ' ⊢⦇ Γ ⊢●: ⟨ τ1 × τ2 ⟩ ⊨ X ⦈:=ᴿ ⟨ ??[ u1 ] , ??[ u2 ] ⟩ ⊣ (G1 :: (G2 :: [])) RefCtor : ∀{Σ' Γ X X' d cctx c τ u G} → (d , cctx) ∈ π1 Σ' → (c , τ) ∈ cctx → Filter X := map (λ {(E , ex) → E , C[ c ] ex}) X' → G == Γ ⊢??[ u ]: τ ⊨ X' → Σ' ⊢⦇ Γ ⊢●: D[ d ] ⊨ X ⦈:=ᴿ C[ c ] ??[ u ] ⊣ (G :: []) RefFix : ∀{Σ' Γ X τ1 τ2 f x u X' G} {E-in-inᶜ-outs : List (env ∧ val ∧ result ∧ ex)} → (∀{i E-i v-i r-i ex-i} → E-in-inᶜ-outs ⟦ i ⟧ == Some (E-i , v-i , r-i , ex-i) → ⌈ r-i ⌉:= v-i) → Filter X := map (λ {(E , in' , _ , out) → E , in' ↦ out}) E-in-inᶜ-outs → X' == map (λ {(E , _ , in' , out) → (E ,, (f , [ E ]fix f ⦇·λ x => ??[ u ] ·⦈) ,, (x , in')) , out}) E-in-inᶜ-outs → G == (Γ ,, (f , τ1 ==> τ2) ,, (x , τ1)) ⊢??[ u ]: τ2 ⊨ X' → Σ' ⊢⦇ Γ ⊢●: τ1 ==> τ2 ⊨ X ⦈:=ᴿ fix f ⦇·λ x => ??[ u ] ·⦈ ⊣ (G :: []) -- Type-and-Example-Directed Branching data _⊢⦇_⊢●:_⊨_⦈⌊_⌋:=ᴮ_⊣_ : denv → tctx → typ → excons → Fuel → exp → goals → Set where BCase : ∀{⛽ Σ' Γ X Xf τ e rules d cctx x τ+u+X⁺-ctx Gs} → Filter X := Xf → -- choose one fresh variable name that will be used for all cases x # Γ → -- τ+u+X⁺-ctx is just cctx extended with hole names and excons cctx == ctxmap π1 τ+u+X⁺-ctx → -- the rules can be defined from x and the hole names in τ+u+X⁺-ctx rules == ctxmap (λ {(τ-c , u-c , X⁺-c) → |C x => ??[ u-c ]}) τ+u+X⁺-ctx → -- the following premises appear in the paper (d , cctx) ∈ π1 Σ' → Σ' ⊢⦇ Γ ⊢●: D[ d ] ⦈:=ᴳ e → Gs == map (λ {(τ-c , u-c , X⁺-c) → -- this corresponds to the goal definition in the paper (Γ ,, (x , τ-c)) ⊢??[ u-c ]: τ ⊨ -- this corresponds to the definition of each X_i in the paper map (λ {(E , ex , r) → (E ,, (x , r)) , ex}) X⁺-c}) (ctx⇒values τ+u+X⁺-ctx) → -- the following premise checks that every X⁺-c obeys the rules in the paper premise (∀{c τ-c u-c X⁺-c} → (c , τ-c , u-c , X⁺-c) ∈ τ+u+X⁺-ctx → -- for each excon (extended with a result r-j) of X⁺-c, ... (∀{j E-j ex-j r-j} → X⁺-c ⟦ j ⟧ == Some (E-j , ex-j , r-j) → -- the excon is an element of Filter X, and ... Σ[ k ∈ Nat ] (Xf ⟦ k ⟧ == Some (E-j , ex-j)) ∧ -- the scrutinee e will evaluate to constructor c applied to the specified argument r-j E-j ⊢ e ⌊ ⛽ ⌋⇒ C[ c ] r-j ⊣ [])) → -- the last premise in the paper - every excon in Filter X is an element of some X⁺-c for some c (∀{k E-k ex-k} → Xf ⟦ k ⟧ == Some (E-k , ex-k) → Σ[ c ∈ Nat ] Σ[ τ-c ∈ typ ] Σ[ u-c ∈ Nat ] Σ[ X⁺-c ∈ List (env ∧ ex ∧ result)] Σ[ j ∈ Nat ] Σ[ r-j ∈ result ] ( (c , τ-c , u-c , X⁺-c) ∈ τ+u+X⁺-ctx ∧ X⁺-c ⟦ j ⟧ == Some (E-k , ex-k , r-j))) → Σ' ⊢⦇ Γ ⊢●: τ ⊨ X ⦈⌊ ⛽ ⌋:=ᴮ case e of⦃· rules ·⦄ ⊣ Gs -- Hole Filling data _,_,_⊢⦇_⊢??[_]:_⊨_⦈⌊_⌋:=_,_ : hctx → denv → hole-fillings → tctx → Nat → typ → excons → Fuel → constraints → hctx → Set where HFRefBranch : ∀{⛽ Δ Σ' F Γ u τ X e Gs K Δ'} → -- this premise ensures that all holes are fresh (∀{i j g-i g-j} → Gs ⟦ i ⟧ == Some g-i → Gs ⟦ j ⟧ == Some g-j → goal.g-id g-i # Δ ∧ goal.g-id g-i ≠ u ∧ (i ≠ j → goal.g-id g-i ≠ goal.g-id g-j)) → (Σ' ⊢⦇ Γ ⊢●: τ ⊨ X ⦈:=ᴿ e ⊣ Gs ∨ Σ' ⊢⦇ Γ ⊢●: τ ⊨ X ⦈⌊ ⛽ ⌋:=ᴮ e ⊣ Gs) → K == (■ (u , e) , list⇒ctx (map (λ {(_ ⊢??[ u' ]: _ ⊨ X') → u' , X'}) Gs)) → Δ' == list⇒ctx (map (λ {(Γ' ⊢??[ u' ]: τ' ⊨ _) → u' , Γ' , τ'}) Gs) → Δ , Σ' , F ⊢⦇ Γ ⊢??[ u ]: τ ⊨ X ⦈⌊ ⛽ ⌋:= K , Δ' HFGuessChk : ∀{⛽ Δ Σ' F Γ u τ X e K K'} → Σ' ⊢⦇ Γ ⊢●: τ ⦈:=ᴳ e → Δ , Σ' , (F ,, (u , e)) ⊢ e ⌊ ⛽ ⌋⇌ X := K → (■ (u , e) , ∅) ⊕ K := K' → Δ , Σ' , F ⊢⦇ Γ ⊢??[ u ]: τ ⊨ X ⦈⌊ ⛽ ⌋:= K' , ∅ HFDefer : ∀{⛽ Δ Σ' F Γ u τ X} → X ≠ [] → Filter X := [] → Δ , Σ' , F ⊢⦇ Γ ⊢??[ u ]: τ ⊨ X ⦈⌊ ⛽ ⌋:= (■ (u , ??[ u ]) , ∅) , ∅ {- TODO - later, we need to fix this stuff up too data _,_IterSolve_,_⌊_⌋:=_,_ : hctx → denv → hole-fillings → excons ctx → Fuel → hole-fillings → hctx → Set where ISFin : ∀{⛽ Δ Σ' F-0 U F' Δ' u+F+Δs} → (∀{u} → dom U u → dom Δ u) → ∥ u+F+Δs ∥ == 1+ ∥ U ∥ → Σ[ u-0 ∈ Nat ] (u+F+Δs ⟦ 0 ⟧ == Some (u-0 , F-0 , Δ)) → (∀{u W} → (u , W) ∈ U → Σ[ i ∈ Nat ] Σ[ F-i ∈ hole-fillings ] Σ[ Δ-i ∈ hctx ] ( 1+ i < ∥ u+F+Δs ∥ ∧ u+F+Δs ⟦ i ⟧ == Some (u , F-i , Δ-i))) → (∀{i u-i u-i+1 W-i F-i F-i+1 Δ-i Δ-i+1 Γ-i τ-i} → 1+ i < ∥ u+F+Δs ∥ → u+F+Δs ⟦ i ⟧ == Some (u-i , F-i , Δ-i) → u+F+Δs ⟦ 1+ i ⟧ == Some (u-i+1 , F-i+1 , Δ-i+1) → (u-i , W-i) ∈ U → (u-i , Γ-i , τ-i) ∈ Δ → Σ[ F'-i ∈ hole-fillings ] Σ[ Δ'-i ∈ hctx ] ( (Δ-i , Σ' , F-i ⊢⦇ Γ-i ⊢??[ u-i ]: τ-i ⊨ W-i ⦈⌊ ⛽ ⌋:= (F'-i , ∅) , Δ'-i) ∧ F-i+1 == F-i ∪ F'-i ∧ Δ-i+1 == Δ-i ∪ Δ'-i)) → Σ[ u-n ∈ Nat ] (u+F+Δs ⟦ ∥ U ∥ ⟧ == Some (u-n , F' , Δ')) → Δ , Σ' IterSolve F-0 , U ⌊ ⛽ ⌋:= F' , Δ' ISInd : ∀{⛽ Δ Σ' F-0 U F' Δ' u+F+U+Δs U' Δ-n F-n} → (∀{u} → dom U u → dom Δ u) → ∥ u+F+U+Δs ∥ == 1+ ∥ U ∥ → Σ[ u-0 ∈ Nat ] (u+F+U+Δs ⟦ 0 ⟧ == Some (u-0 , F-0 , ∅ , Δ)) → (∀{u W} → (u , W) ∈ U → Σ[ i ∈ Nat ] Σ[ F-i ∈ hole-fillings ] Σ[ U-i ∈ excons ctx ] Σ[ Δ-i ∈ hctx ] ( 1+ i < ∥ u+F+U+Δs ∥ ∧ u+F+U+Δs ⟦ i ⟧ == Some (u , F-i , U-i , Δ-i))) → (∀{i u-i u-i+1 W-i F-i F-i+1 U-i U-i+1 Δ-i Δ-i+1 Γ-i τ-i} → 1+ i < ∥ u+F+U+Δs ∥ → u+F+U+Δs ⟦ i ⟧ == Some (u-i , F-i , U-i , Δ-i) → u+F+U+Δs ⟦ 1+ i ⟧ == Some (u-i+1 , F-i+1 , U-i+1 , Δ-i+1) → (u-i , W-i) ∈ U → (u-i , Γ-i , τ-i) ∈ Δ → Σ[ F'-i ∈ hole-fillings ] Σ[ Δ'-i ∈ hctx ] ( (Δ-i , Σ' , F-i ⊢⦇ Γ-i ⊢??[ u-i ]: τ-i ⊨ W-i ⦈⌊ ⛽ ⌋:= (F'-i , U-i+1) , Δ'-i) ∧ F-i+1 == F-i ∪ F'-i ∧ Δ-i+1 == Δ-i ∪ Δ'-i)) → U' == foldl _∪_ ∅ (map (π1 ⊙ (π2 ⊙ π2)) u+F+U+Δs) → U' ≠ ∅ → Σ[ u-n ∈ Nat ] Σ[ U-n ∈ excons ctx ] (u+F+U+Δs ⟦ ∥ U ∥ ⟧ == Some (u-n , F-n , U-n , Δ-n)) → Δ-n , Σ' IterSolve F-n , U' ⌊ ⛽ ⌋:= F' , Δ' → Δ , Σ' IterSolve F-0 , U ⌊ ⛽ ⌋:= F' , Δ' data _,_Solve_⌊_⌋:=_ : hctx → denv → constraints → Fuel → hole-fillings → Set where Solve : ∀{⛽ Δ Σ' F0 U F Δ'} → Δ , Σ' IterSolve F0 , U ⌊ ⛽ ⌋:= F , Δ' → Δ , Σ' Solve (F0 , U) ⌊ ⛽ ⌋:= F -} {- TODO -- those external expressions without holes data _ecomplete : hexp → Set where ECConst : c ecomplete ECAsc : ∀{τ e} → τ tcomplete → e ecomplete → (e ·: τ) ecomplete ECVar : ∀{x} → (X x) ecomplete ECLam1 : ∀{x e} → e ecomplete → (·λ x e) ecomplete ECLam2 : ∀{x e τ} → e ecomplete → τ tcomplete → (·λ x [ τ ] e) ecomplete ECAp : ∀{e1 e2} → e1 ecomplete → e2 ecomplete → (e1 ∘ e2) ecomplete ECFst : ∀{e} → e ecomplete → (fst e) ecomplete ECSnd : ∀{e} → e ecomplete → (snd e) ecomplete ECPair : ∀{e1 e2} → e1 ecomplete → e2 ecomplete → ⟨ e1 , e2 ⟩ ecomplete -- those internal expressions without holes data _dcomplete : ihexp → Set where DCVar : ∀{x} → (X x) dcomplete DCConst : c dcomplete DCLam : ∀{x τ d} → d dcomplete → τ tcomplete → (·λ x [ τ ] d) dcomplete DCAp : ∀{d1 d2} → d1 dcomplete → d2 dcomplete → (d1 ∘ d2) dcomplete DCCast : ∀{d τ1 τ2} → d dcomplete → τ1 tcomplete → τ2 tcomplete → (d ⟨ τ1 ⇒ τ2 ⟩) dcomplete DCFst : ∀{d} → d dcomplete → (fst d) dcomplete DCSnd : ∀{d} → d dcomplete → (snd d) dcomplete DCPair : ∀{d1 d2} → d1 dcomplete → d2 dcomplete → ⟨ d1 , d2 ⟩ dcomplete mutual -- substitution typing data _,_⊢_:s:_ : hctx → tctx → env → tctx → Set where STAId : ∀{Γ Γ' Δ} → ((x : Nat) (τ : htyp) → (x , τ) ∈ Γ' → (x , τ) ∈ Γ) → Δ , Γ ⊢ Id Γ' :s: Γ' STASubst : ∀{Γ Δ σ y Γ' d τ } → Δ , Γ ,, (y , τ) ⊢ σ :s: Γ' → Δ , Γ ⊢ d :: τ → Δ , Γ ⊢ Subst d y σ :s: Γ' -- type assignment data _,_⊢_::_ : (Δ : hctx) (Γ : tctx) (d : ihexp) (τ : htyp) → Set where TAConst : ∀{Δ Γ} → Δ , Γ ⊢ c :: b TAVar : ∀{Δ Γ x τ} → (x , τ) ∈ Γ → Δ , Γ ⊢ X x :: τ TALam : ∀{ Δ Γ x τ1 d τ2} → x # Γ → Δ , (Γ ,, (x , τ1)) ⊢ d :: τ2 → Δ , Γ ⊢ ·λ x [ τ1 ] d :: (τ1 ==> τ2) TAAp : ∀{ Δ Γ d1 d2 τ1 τ} → Δ , Γ ⊢ d1 :: τ1 ==> τ → Δ , Γ ⊢ d2 :: τ1 → Δ , Γ ⊢ d1 ∘ d2 :: τ TAEHole : ∀{ Δ Γ σ u Γ' τ} → (u , (Γ' , τ)) ∈ Δ → Δ , Γ ⊢ σ :s: Γ' → Δ , Γ ⊢ ⦇⦈⟨ u , σ ⟩ :: τ TANEHole : ∀ { Δ Γ d τ' Γ' u σ τ } → (u , (Γ' , τ)) ∈ Δ → Δ , Γ ⊢ d :: τ' → Δ , Γ ⊢ σ :s: Γ' → Δ , Γ ⊢ ⦇⌜ d ⌟⦈⟨ u , σ ⟩ :: τ TACast : ∀{ Δ Γ d τ1 τ2} → Δ , Γ ⊢ d :: τ1 → τ1 ~ τ2 → Δ , Γ ⊢ d ⟨ τ1 ⇒ τ2 ⟩ :: τ2 TAFailedCast : ∀{Δ Γ d τ1 τ2} → Δ , Γ ⊢ d :: τ1 → τ1 ground → τ2 ground → τ1 ≠ τ2 → Δ , Γ ⊢ d ⟨ τ1 ⇒⦇⦈⇏ τ2 ⟩ :: τ2 TAFst : ∀{Δ Γ d τ1 τ2} → Δ , Γ ⊢ d :: τ1 ⊗ τ2 → Δ , Γ ⊢ fst d :: τ1 TASnd : ∀{Δ Γ d τ1 τ2} → Δ , Γ ⊢ d :: τ1 ⊗ τ2 → Δ , Γ ⊢ snd d :: τ2 TAPair : ∀{Δ Γ d1 d2 τ1 τ2} → Δ , Γ ⊢ d1 :: τ1 → Δ , Γ ⊢ d2 :: τ2 → Δ , Γ ⊢ ⟨ d1 , d2 ⟩ :: τ1 ⊗ τ2 -- substitution [_/_]_ : ihexp → Nat → ihexp → ihexp [ d / y ] c = c [ d / y ] X x with natEQ x y [ d / y ] X .y | Inl refl = d [ d / y ] X x | Inr neq = X x [ d / y ] (·λ x [ x₁ ] d') with natEQ x y [ d / y ] (·λ .y [ τ ] d') | Inl refl = ·λ y [ τ ] d' [ d / y ] (·λ x [ τ ] d') | Inr x₁ = ·λ x [ τ ] ( [ d / y ] d') [ d / y ] ⦇⦈⟨ u , σ ⟩ = ⦇⦈⟨ u , Subst d y σ ⟩ [ d / y ] ⦇⌜ d' ⌟⦈⟨ u , σ ⟩ = ⦇⌜ [ d / y ] d' ⌟⦈⟨ u , Subst d y σ ⟩ [ d / y ] (d1 ∘ d2) = ([ d / y ] d1) ∘ ([ d / y ] d2) [ d / y ] (d' ⟨ τ1 ⇒ τ2 ⟩ ) = ([ d / y ] d') ⟨ τ1 ⇒ τ2 ⟩ [ d / y ] (d' ⟨ τ1 ⇒⦇⦈⇏ τ2 ⟩ ) = ([ d / y ] d') ⟨ τ1 ⇒⦇⦈⇏ τ2 ⟩ [ d / y ] ⟨ d1 , d2 ⟩ = ⟨ [ d / y ] d1 , [ d / y ] d2 ⟩ [ d / y ] (fst d') = fst ([ d / y ] d') [ d / y ] (snd d') = snd ([ d / y ] d') -- applying an environment to an expression apply-env : env → ihexp → ihexp apply-env (Id Γ) d = d apply-env (Subst d y σ) d' = [ d / y ] ( apply-env σ d') -- freshness mutual -- ... with respect to a hole context data envfresh : Nat → env → Set where EFId : ∀{x Γ} → x # Γ → envfresh x (Id Γ) EFSubst : ∀{x d σ y} → fresh x d → envfresh x σ → x ≠ y → envfresh x (Subst d y σ) -- ... for inernal expressions data fresh : Nat → ihexp → Set where FConst : ∀{x} → fresh x c FVar : ∀{x y} → x ≠ y → fresh x (X y) FLam : ∀{x y τ d} → x ≠ y → fresh x d → fresh x (·λ y [ τ ] d) FHole : ∀{x u σ} → envfresh x σ → fresh x (⦇⦈⟨ u , σ ⟩) FNEHole : ∀{x d u σ} → envfresh x σ → fresh x d → fresh x (⦇⌜ d ⌟⦈⟨ u , σ ⟩) FAp : ∀{x d1 d2} → fresh x d1 → fresh x d2 → fresh x (d1 ∘ d2) FCast : ∀{x d τ1 τ2} → fresh x d → fresh x (d ⟨ τ1 ⇒ τ2 ⟩) FFailedCast : ∀{x d τ1 τ2} → fresh x d → fresh x (d ⟨ τ1 ⇒⦇⦈⇏ τ2 ⟩) FFst : ∀{x d} → fresh x d → fresh x (fst d) FSnd : ∀{x d} → fresh x d → fresh x (snd d) FPair : ∀{x d1 d2} → fresh x d1 → fresh x d2 → fresh x ⟨ d1 , d2 ⟩ -- ... for external expressions data freshh : Nat → hexp → Set where FRHConst : ∀{x} → freshh x c FRHAsc : ∀{x e τ} → freshh x e → freshh x (e ·: τ) FRHVar : ∀{x y} → x ≠ y → freshh x (X y) FRHLam1 : ∀{x y e} → x ≠ y → freshh x e → freshh x (·λ y e) FRHLam2 : ∀{x τ e y} → x ≠ y → freshh x e → freshh x (·λ y [ τ ] e) FRHEHole : ∀{x u} → freshh x (⦇⦈[ u ]) FRHNEHole : ∀{x u e} → freshh x e → freshh x (⦇⌜ e ⌟⦈[ u ]) FRHAp : ∀{x e1 e2} → freshh x e1 → freshh x e2 → freshh x (e1 ∘ e2) FRHFst : ∀{x e} → freshh x e → freshh x (fst e) FRHSnd : ∀{x e} → freshh x e → freshh x (snd e) FRHPair : ∀{x e1 e2} → freshh x e1 → freshh x e2 → freshh x ⟨ e1 , e2 ⟩ -- with respect to all bindings in a context freshΓ : {A : Set} → (Γ : A ctx) → (e : hexp) → Set freshΓ {A} Γ e = (x : Nat) → dom Γ x → freshh x e -- x is not used in a binding site in d mutual data unbound-in-σ : Nat → env → Set where UBσId : ∀{x Γ} → unbound-in-σ x (Id Γ) UBσSubst : ∀{x d y σ} → unbound-in x d → unbound-in-σ x σ → x ≠ y → unbound-in-σ x (Subst d y σ) data unbound-in : (x : Nat) (d : ihexp) → Set where UBConst : ∀{x} → unbound-in x c UBVar : ∀{x y} → unbound-in x (X y) UBLam2 : ∀{x d y τ} → x ≠ y → unbound-in x d → unbound-in x (·λ_[_]_ y τ d) UBHole : ∀{x u σ} → unbound-in-σ x σ → unbound-in x (⦇⦈⟨ u , σ ⟩) UBNEHole : ∀{x u σ d } → unbound-in-σ x σ → unbound-in x d → unbound-in x (⦇⌜ d ⌟⦈⟨ u , σ ⟩) UBAp : ∀{ x d1 d2 } → unbound-in x d1 → unbound-in x d2 → unbound-in x (d1 ∘ d2) UBCast : ∀{x d τ1 τ2} → unbound-in x d → unbound-in x (d ⟨ τ1 ⇒ τ2 ⟩) UBFailedCast : ∀{x d τ1 τ2} → unbound-in x d → unbound-in x (d ⟨ τ1 ⇒⦇⦈⇏ τ2 ⟩) UBFst : ∀{x d} → unbound-in x d → unbound-in x (fst d) UBSnd : ∀{x d} → unbound-in x d → unbound-in x (snd d) UBPair : ∀{x d1 d2} → unbound-in x d1 → unbound-in x d2 → unbound-in x ⟨ d1 , d2 ⟩ mutual data binders-disjoint-σ : env → ihexp → Set where BDσId : ∀{Γ d} → binders-disjoint-σ (Id Γ) d BDσSubst : ∀{d1 d2 y σ} → binders-disjoint d1 d2 → binders-disjoint-σ σ d2 → binders-disjoint-σ (Subst d1 y σ) d2 -- two terms that do not share any binders data binders-disjoint : (d1 : ihexp) → (d2 : ihexp) → Set where BDConst : ∀{d} → binders-disjoint c d BDVar : ∀{x d} → binders-disjoint (X x) d BDLam : ∀{x τ d1 d2} → binders-disjoint d1 d2 → unbound-in x d2 → binders-disjoint (·λ_[_]_ x τ d1) d2 BDHole : ∀{u σ d2} → binders-disjoint-σ σ d2 → binders-disjoint (⦇⦈⟨ u , σ ⟩) d2 BDNEHole : ∀{u σ d1 d2} → binders-disjoint-σ σ d2 → binders-disjoint d1 d2 → binders-disjoint (⦇⌜ d1 ⌟⦈⟨ u , σ ⟩) d2 BDAp : ∀{d1 d2 d3} → binders-disjoint d1 d3 → binders-disjoint d2 d3 → binders-disjoint (d1 ∘ d2) d3 BDCast : ∀{d1 d2 τ1 τ2} → binders-disjoint d1 d2 → binders-disjoint (d1 ⟨ τ1 ⇒ τ2 ⟩) d2 BDFailedCast : ∀{d1 d2 τ1 τ2} → binders-disjoint d1 d2 → binders-disjoint (d1 ⟨ τ1 ⇒⦇⦈⇏ τ2 ⟩) d2 BDFst : ∀{d1 d2} → binders-disjoint d1 d2 → binders-disjoint (fst d1) d2 BDSnd : ∀{d1 d2} → binders-disjoint d1 d2 → binders-disjoint (snd d1) d2 BDPair : ∀{d1 d2 d3} → binders-disjoint d1 d3 → binders-disjoint d2 d3 → binders-disjoint ⟨ d1 , d2 ⟩ d3 mutual -- each term has to be binders unique, and they have to be pairwise -- disjoint with the collection of bound vars data binders-unique-σ : env → Set where BUσId : ∀{Γ} → binders-unique-σ (Id Γ) BUσSubst : ∀{d y σ} → binders-unique d → binders-unique-σ σ → binders-disjoint-σ σ d → binders-unique-σ (Subst d y σ) -- all the variable names in the term are unique data binders-unique : ihexp → Set where BUHole : binders-unique c BUVar : ∀{x} → binders-unique (X x) BULam : {x : Nat} {τ : htyp} {d : ihexp} → binders-unique d → unbound-in x d → binders-unique (·λ_[_]_ x τ d) BUEHole : ∀{u σ} → binders-unique-σ σ → binders-unique (⦇⦈⟨ u , σ ⟩) BUNEHole : ∀{u σ d} → binders-unique d → binders-unique-σ σ → binders-unique (⦇⌜ d ⌟⦈⟨ u , σ ⟩) BUAp : ∀{d1 d2} → binders-unique d1 → binders-unique d2 → binders-disjoint d1 d2 → binders-unique (d1 ∘ d2) BUCast : ∀{d τ1 τ2} → binders-unique d → binders-unique (d ⟨ τ1 ⇒ τ2 ⟩) BUFailedCast : ∀{d τ1 τ2} → binders-unique d → binders-unique (d ⟨ τ1 ⇒⦇⦈⇏ τ2 ⟩) BUFst : ∀{d} → binders-unique d → binders-unique (fst d) BUSnd : ∀{d} → binders-unique d → binders-unique (snd d) BUPair : ∀{d1 d2} → binders-unique d1 → binders-unique d2 → binders-disjoint d1 d2 → binders-unique ⟨ d1 , d2 ⟩ -}
src/hardware/hardware-pwm.ads
kisom/rover-mk1
0
24947
with AVR, AVR.MCU; use AVR; with Interfaces; use Interfaces; package Hardware.PWM is -- Set Servo_ISR as the TIMER1 COMPA handler. See page 101 of the -- ATmega2560 datasheet for more details. procedure Servo_ISR; pragma Machine_Attribute (Entity => Servo_ISR, Attribute_Name => "interrupt"); pragma Export (C, Servo_ISR, MCU.Sig_Timer1_COMPA_String); Max_Servos : constant := 4; -- Board has 4 PWM connectors. type Servo_Index is range 1 .. Max_Servos; procedure Connect (pin : in AVR.Bit_Number; which : out Servo_Index); procedure Trim (which : in Servo_Index; trim : in Integer_16); procedure Set (which : in Servo_Index; us : in Unsigned_16); private Duty_Cycle : constant := 20000; -- 20ms pulse width Update_Interval : constant := 40000; Update_Wait : constant := 5; -- Allow for minor interrupt delays. -- Specified in the servo datasheet and common to this hardware -- configuration. Min_Pulse : constant := 1300; Mid_Pulse : constant := 1500; Max_Pulse : constant := 1700; type Servo is record Pin : AVR.Bit_Number; Ticks : Unsigned_16; Min : Unsigned_16; Max : Unsigned_16; Trim : Integer_16; end record; type Servo_ptr is access Servo; Servos : array (1 .. Max_Servos) of Servo_ptr; -- 0 is used to indicate the refresh cycle has completed. Active_Servos : Integer range 0 .. Max_Servos := 0; Current_Servo : Integer range 0 .. Max_Servos := 1; end Hardware.PWM;
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_767.asm
ljhsiun2/medusa
9
91070
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r12 push %r8 push %rbx lea addresses_normal_ht+0x188f0, %r10 nop nop nop nop nop and $2511, %r12 mov $0x6162636465666768, %rbx movq %rbx, %xmm1 vmovups %ymm1, (%r10) nop nop cmp %r8, %r8 pop %rbx pop %r8 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r12 push %r13 push %r15 push %rcx push %rdx // Faulty Load lea addresses_normal+0x54b0, %rcx clflush (%rcx) nop nop add $54321, %r15 mov (%rcx), %r10d lea oracles, %r13 and $0xff, %r10 shlq $12, %r10 mov (%r13,%r10,1), %r10 pop %rdx pop %rcx pop %r15 pop %r13 pop %r12 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 6, 'size': 32, 'same': False, 'NT': False}} {'34': 21829} 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 */
21.asm
AsadKhalil/Assembly_x86
0
163320
[org 0x0100] mov AL, 3 mov [Table], AL add AL, 3 mov [Table + 1], AL add AL, 3 mov [Table + 2], AL add AL, 3 mov [Table + 3], AL add AL, 3 mov [Table + 4], AL int 0x21 Table: Times 5 db 0
Transynther/x86/_processed/NONE/_st_/i7-7700_9_0xca.log_10830_1857.asm
ljhsiun2/medusa
9
16229
.global s_prepare_buffers s_prepare_buffers: ret .global s_faulty_load s_faulty_load: push %r11 push %r13 push %r14 push %rax push %rbx push %rdi push %rdx // Store lea addresses_UC+0x18f65, %rbx nop dec %rdi movl $0x51525354, (%rbx) dec %r14 // Store mov $0x945, %rdx nop nop nop nop nop sub $25702, %rax movw $0x5152, (%rdx) nop nop nop nop nop cmp $18660, %r13 // Faulty Load lea addresses_A+0x1f65, %r14 nop nop nop nop nop and $36915, %r11 mov (%r14), %edx lea oracles, %r13 and $0xff, %rdx shlq $12, %rdx mov (%r13,%rdx,1), %rdx pop %rdx pop %rdi pop %rbx pop %rax pop %r14 pop %r13 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_A'}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'congruent': 11, 'AVXalign': False, 'same': True, 'size': 4, 'NT': False, 'type': 'addresses_UC'}} {'OP': 'STOR', 'dst': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_P'}} [Faulty Load] {'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 4, 'NT': False, 'type': 'addresses_A'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'54': 10830} 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 */
test/interaction/Issue4333/N1.agda
shlevy/agda
1,989
9746
<filename>test/interaction/Issue4333/N1.agda {-# OPTIONS --rewriting --confluence-check #-} module Issue4333.N1 where open import Issue4333.M {-# REWRITE p₁ #-} b₁' : B a₁' b₁' = b
tests/typing/bad/testfile-inout-1.adb
xuedong/mini-ada
0
29034
with Ada.Text_IO; use Ada.Text_IO; procedure Test is procedure P(X: in out Integer) is begin new_line; end; begin P(42); end;
data/jpred4/jp_batch_1613899824__Wv7Rrtp/jp_batch_1613899824__Wv7Rrtp.als
jonriege/predict-protein-structure
0
4923
SILENT_MODE BLOCK_FILE jp_batch_1613899824__Wv7Rrtp.concise.blc MAX_NSEQ 866 MAX_INPUT_LEN 868 OUTPUT_FILE jp_batch_1613899824__Wv7Rrtp.concise.ps PORTRAIT POINTSIZE 8 IDENT_WIDTH 12 X_OFFSET 2 Y_OFFSET 2 DEFINE_FONT 0 Helvetica DEFAULT DEFINE_FONT 1 Helvetica REL 0.75 DEFINE_FONT 7 Helvetica REL 0.6 DEFINE_FONT 3 Helvetica-Bold DEFAULT DEFINE_FONT 4 Times-Bold DEFAULT DEFINE_FONT 5 Helvetica-BoldOblique DEFAULT # DEFINE_COLOUR 3 1 0.62 0.67 # Turquiose DEFINE_COLOUR 4 1 1 0 # Yellow DEFINE_COLOUR 5 1 0 0 # Red DEFINE_COLOUR 7 1 0 1 # Purple DEFINE_COLOUR 8 0 0 1 # Blue DEFINE_COLOUR 9 0 1 0 # Green DEFINE_COLOUR 10 0.41 0.64 1.00 # Pale blue DEFINE_COLOUR 11 0.41 0.82 0.67 # Pale green DEFINE_COLOUR 50 0.69 0.18 0.37 # Pink (helix) DEFINE_COLOUR 51 1.00 0.89 0.00 # Gold (strand) NUMBER_INT 10 SETUP # # Highlight specific residues. # Avoid highlighting Lupas 'C' predictions by # limiting the highlighting to the alignments Scol_CHARS C 1 1 147 855 4 Ccol_CHARS H ALL 5 Ccol_CHARS P ALL 8 SURROUND_CHARS LIV ALL # # Replace known structure types with whitespace SUB_CHARS 1 856 147 865 H SPACE SUB_CHARS 1 856 147 865 E SPACE SUB_CHARS 1 856 147 865 - SPACE STRAND 3 859 8 COLOUR_TEXT_REGION 3 859 8 859 51 STRAND 32 859 36 COLOUR_TEXT_REGION 32 859 36 859 51 STRAND 51 859 56 COLOUR_TEXT_REGION 51 859 56 859 51 STRAND 87 859 91 COLOUR_TEXT_REGION 87 859 91 859 51 STRAND 118 859 119 COLOUR_TEXT_REGION 118 859 119 859 51 STRAND 123 859 125 COLOUR_TEXT_REGION 123 859 125 859 51 HELIX 13 859 27 COLOUR_TEXT_REGION 13 859 27 859 50 HELIX 68 859 77 COLOUR_TEXT_REGION 68 859 77 859 50 HELIX 99 859 113 COLOUR_TEXT_REGION 99 859 113 859 50 HELIX 133 859 145 COLOUR_TEXT_REGION 133 859 145 859 50 STRAND 3 864 8 COLOUR_TEXT_REGION 3 864 8 864 51 STRAND 32 864 35 COLOUR_TEXT_REGION 32 864 35 864 51 STRAND 51 864 56 COLOUR_TEXT_REGION 51 864 56 864 51 STRAND 86 864 91 COLOUR_TEXT_REGION 86 864 91 864 51 STRAND 123 864 125 COLOUR_TEXT_REGION 123 864 125 864 51 HELIX 12 864 27 COLOUR_TEXT_REGION 12 864 27 864 50 HELIX 67 864 76 COLOUR_TEXT_REGION 67 864 76 864 50 HELIX 99 864 113 COLOUR_TEXT_REGION 99 864 113 864 50 HELIX 133 864 145 COLOUR_TEXT_REGION 133 864 145 864 50 STRAND 3 865 8 COLOUR_TEXT_REGION 3 865 8 865 51 STRAND 32 865 36 COLOUR_TEXT_REGION 32 865 36 865 51 STRAND 52 865 57 COLOUR_TEXT_REGION 52 865 57 865 51 STRAND 117 865 119 COLOUR_TEXT_REGION 117 865 119 865 51 STRAND 123 865 126 COLOUR_TEXT_REGION 123 865 126 865 51 HELIX 14 865 27 COLOUR_TEXT_REGION 14 865 27 865 50 HELIX 71 865 78 COLOUR_TEXT_REGION 71 865 78 865 50 HELIX 102 865 113 COLOUR_TEXT_REGION 102 865 113 865 50 HELIX 133 865 145 COLOUR_TEXT_REGION 133 865 145 865 50
hello-multiple/Hello.g4
AlanHohn/antlr4-python
40
4276
<reponame>AlanHohn/antlr4-python<filename>hello-multiple/Hello.g4<gh_stars>10-100 // Define a grammar called Hello grammar Hello; // defines how the output code will be named prog : hi* EOF; // accept zero or more hello items followed by EOF hi : 'hello' ID ; // match keyword hello followed by an identifier ID : [a-z]+ ; // match lower-case identifiers WS : [ \t\r\n]+ -> skip ; // skip spaces, tabs, newlines
src/Data/List/First/Properties.agda
metaborg/mj.agda
10
460
module Data.List.First.Properties {ℓ}{A : Set ℓ} where open import Data.Product open import Data.List open import Data.List.Any open import Relation.Binary.PropositionalEquality open import Function open import Data.Empty open import Data.List.First open import Data.List.Membership.Propositional first⟶∈ : ∀ {B : A → Set} {x l} → First B x l → (x ∈ l × B x) first⟶∈ (here {x = x} p) = here refl , p first⟶∈ (there x' ¬px f) with (first⟶∈ f) first⟶∈ (there x' ¬px f) | x∈l , p = there x∈l , p first-unique : ∀ {P : A → Set}{x y v} → First P x v → First P y v → x ≡ y first-unique (here x) (here y) = refl first-unique (here {x = x} px) (there .x ¬px r) = ⊥-elim (¬px px) first-unique (there x ¬px l) (here {x = .x} px) = ⊥-elim (¬px px) first-unique (there x' _ l) (there .x' _ r) = first-unique l r
libsrc/_DEVELOPMENT/stdio/z80/asm_vprintf_unlocked.asm
jpoikela/z88dk
640
27823
<reponame>jpoikela/z88dk<filename>libsrc/_DEVELOPMENT/stdio/z80/asm_vprintf_unlocked.asm ; =============================================================== ; Jan 2014 ; =============================================================== ; ; int vprintf_unlocked(const char *format, void *arg) ; ; See C11 specification. ; ; =============================================================== SECTION code_clib SECTION code_stdio PUBLIC asm_vprintf_unlocked EXTERN _stdout EXTERN asm_vfprintf_unlocked asm_vprintf_unlocked: ; enter : de = char *format ; bc = void *stack_param = arg ; ; exit : ix = FILE *stdout ; de = char *format (next unexamined char) ; ; success ; ; hl = number of chars output on stream ; carry reset ; ; fail ; ; hl = - (chars output + 1) < 0 ; carry set, errno set as below ; ; enolck = stream lock could not be acquired ; eacces = stream not open for writing ; eacces = stream is in an error state ; erange = width or precision out of range ; einval = unknown printf conversion ; ; more errors may be set by underlying driver ; ; uses : all ld ix,(_stdout) jp asm_vfprintf_unlocked
programs/oeis/187/A187074.asm
jmorken/loda
1
84868
<reponame>jmorken/loda ; A187074: a(n) = 0 if and only if n is of the form 3*k or 4*k + 2, otherwise a(n) = 1. ; 1,0,0,1,1,0,1,1,0,0,1,0,1,0,0,1,1,0,1,1,0,0,1,0,1,0,0,1,1,0,1,1,0,0,1,0,1,0,0,1,1,0,1,1,0,0,1,0,1,0,0,1,1,0,1,1,0,0,1,0,1,0,0,1,1,0,1,1,0,0,1,0,1,0,0,1,1,0,1,1,0,0,1,0,1,0,0,1,1,0,1,1,0,0,1,0,1,0,0,1,1,0,1,1,0 sub $0,5 gcd $0,384 sub $0,2 mov $1,1 mov $2,1 lpb $0 sub $0,$2 sub $1,$1 lpe
lex/PMLLexer.g4
zergos/pantra
0
5834
<reponame>zergos/pantra<filename>lex/PMLLexer.g4<gh_stars>0 // Pantra component definition lexer grammar PMLLexer; // comments COMMENT : '<!--' .*? '-->' -> skip; // CDATA just for XML compliance, not needed at the moment CDATA : '<![CDATA[' .*? ']]>' -> skip; // DTD not needed DTD : '<!' .*? '>' -> skip ; // tags with raw inner text RAW_TAG : ('<style' | '<python') ' '* -> pushMode(RAW_BLOCK); // open TAG OPEN_BEGIN : '<' -> pushMode(TAG_PROPERTIES); OPEN_END : '</' -> pushMode(TAG_PROPERTIES); // macro command OPEN_MACRO_BEGIN : '{{#' -> pushMode(MACRO); OPEN_MACRO_END : '{{/' -> pushMode(MACRO); INLINE_MACRO: '{{' -> pushMode(MACRO); // text other content inside tags TEXT : (~[<{] | [{] ~[<{#/] )+ ; mode TAG_PROPERTIES; // close TAG CLOSE : '>' -> popMode; SLASH_CLOSE : '/>' -> popMode; EQ : '=' ; COLON : ':' ; STRING : '"' ~["]* '"' | '\'' ~[']* '\''; NAME : NameStartChar NameChar* ; WS : [ \t\r\n] -> skip; fragment DIGIT : [0-9] ; fragment NameChar : NameStartChar | '-' | '.' | DIGIT | '\u00B7' | '\u0300'..'\u036F' | '\u203F'..'\u2040' ; fragment NameStartChar : [a-zA-Z_] | '\u2070'..'\u218F' | '\u2C00'..'\u2FEF' | '\u3001'..'\uD7FF' | '\uF900'..'\uFDCF' | '\uFDF0'..'\uFFFD' ; /* mode MACRO; CLOSE_MACRO : '}' -> popMode; COMMAND : ~[}]+ ; */ mode MACRO; CLOSE_MACRO : '}}' -> popMode; COMMAND : (~[}] | [}] ~[}])+ ; mode RAW_BLOCK; RAW_CLOSE : '>' -> mode(RAW_TEXT_MODE); RAW_EQ : EQ ; RAW_STRING : STRING ; RAW_NAME : NAME ; RAW_WS : [ \t\r\n] -> skip; mode RAW_TEXT_MODE; CLOSE_TAG : ('</style>' | '</python>') -> popMode; RAW_TEXT : (~[<] | [<] ~[/] | '</' ~[ps] | '</p' ~[y] | '</s' ~[t])+ ; //RAW_TEXT : (~[<] | [<] ~[/] | '</' )+ ;
programs/oeis/206/A206417.asm
karttu/loda
0
98558
; A206417: (5*F(n)+3*L(n)-8)/2. ; 0,3,7,14,25,43,72,119,195,318,517,839,1360,2203,3567,5774,9345,15123,24472,39599,64075,103678,167757,271439,439200,710643,1149847,1860494,3010345,4870843,7881192,12752039,20633235,33385278,54018517,87403799,141422320,228826123,370248447,599074574,969323025,1568397603,2537720632,4106118239,6643838875,10749957118,17393795997,28143753119,45537549120,73681302243,119218851367,192900153614,312119004985,505019158603,817138163592,1322157322199,2139295485795,3461452807998,5600748293797,9062201101799,14662949395600,23725150497403,38388099893007,62113250390414,100501350283425,162614600673843,263115950957272,425730551631119,688846502588395,1114577054219518,1803423556807917,2918000611027439,4721424167835360,7639424778862803 mov $1,12 mov $2,9 lpb $0,1 sub $0,1 mov $3,$2 mov $2,$1 add $1,$3 lpe sub $1,12 div $1,3
Project-Einstein/src/E-Assembly/src/vectorMean.nasm
FelixLuciano/Elements-of-Computing-Systems
0
12256
; ------------------------------------ ; Calcule a média dos valores de um vetor ; que possui inicio em RAM[5] e tamanho ; defindo em RAM[4], ; ; 1. Salve a soma em RAM[1] ; 2. Salve a média em RAM[0] ; ; ------------------------------------ ; antes | depois ; | ; RAM[0]: | RAM[0]: 2 : média ; RAM[1]: | RAM[1]: 8 : soma ; RAM[2]: | RAM[2]: ; RAM[3]: | RAM[3]: ; RAM[4]: 4 | RAM[4]: 4 ; RAM[5]: 1 | RAM[5]: 1 - ; RAM[6]: 2 | RAM[6]: 2 | vetor ; RAM[7]: 1 | RAM[7]: 1 | ; RAM[8]: 4 | RAM[8]: 4 - ; ------------------------------------
oeis/119/A119697.asm
neoneye/loda-programs
11
80795
<filename>oeis/119/A119697.asm ; A119697: Fib(n)*n*binomial(2*n, n)/(n+1). ; Submitted by <NAME>(s1) ; 0,1,4,30,168,1050,6336,39039,240240,1487772,9237800,57551494,359444736,2250244100,14115694320,88707831750,558368324640,3519726403710,22215931214400,140389620550410,888125492826000,5623962934819320 mov $1,$0 mul $0,2 sub $1,1 bin $0,$1 add $1,1 seq $1,45 ; Fibonacci numbers: F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1. mul $0,$1
fizzbuzz.asm
asmblah/fizzbuzz.asm
0
5008
<filename>fizzbuzz.asm ; ; FizzBuzz in NASM x86 assembly for OSX ; ; Copyright (c) <NAME> (<EMAIL>) ; https://github.com/asmblah/fizzbuzz.asm ; ; Released under the MIT license ; https://github.com/asmblah/fizzbuzz.asm/raw/master/MIT-LICENSE.txt ; section .text global start ; Program entry point start: ; Print start message push dword startMessageLength push dword startMessage push dword 1 ; File descriptor (stdout) mov eax, 4 ; System call number (sys_write) sub esp, 4 ; OS X system calls need extra space on the stack int 0x80 ; Call kernel mov [counter], byte 1 next_number: mov al, [counter] xor ah, ah mov bl, 3 div bl cmp ah, 0 ; Check remainder (modulo 3) jne not_fizz ; Handle "FizzBuzz" mov al, [counter] xor ah, ah mov bl, 5 div bl cmp ah, 0 ; Check remainder (modulo 5) jne not_fizzbuzz ; Print "FizzBuzz" push dword 9 push dword fizzBuzzMessage push dword 1 ; File descriptor (stdout) mov eax, 4 ; System call number (sys_write) sub esp, 4 ; OS X system calls need extra space on the stack int 0x80 ; Call kernel jmp finished_this_number not_fizzbuzz: ; Print "Fizz" push dword 5 push dword fizzMessage push dword 1 ; File descriptor (stdout) mov eax, 4 ; System call number (sys_write) sub esp, 4 ; OS X system calls need extra space on the stack int 0x80 ; Call kernel jmp finished_this_number not_fizz: mov al, [counter] xor ah, ah mov bl, 5 div bl cmp ah, 0 ; Check remainder (modulo 5) jne not_fizz_or_buzz ; Print "Buzz" push dword 5 push dword buzzMessage push dword 1 ; File descriptor (stdout) mov eax, 4 ; System call number (sys_write) sub esp, 4 ; OS X system calls need extra space on the stack int 0x80 ; Call kernel jmp finished_this_number not_fizz_or_buzz: ; Build second & third chars of number string mov al, [counter] xor ah, ah mov bl, 10 div bl cmp al, 0 ; Check remainder (modulo 10) to see whether we have a 2-digit decimal number je skip_padding add al, 48 ; Add ASCII index of char "0" to byte mov [counterMessage], al skip_padding: add ah, 48 ; Add ASCII index of char "0" to byte mov [counterMessage+1], ah ; Print number string push dword 3 ; Use a string of 3 bytes to allow up to 98 + newline char push dword counterMessage push dword 1 ; File descriptor (stdout) mov eax, 4 ; System call number (sys_write) sub esp, 4 ; OS X system calls need extra space on the stack int 0x80 ; Call kernel finished_this_number: add [counter], byte 1 cmp [counter], byte 100 jle next_number ; Print end message push dword endMessageLength push dword endMessage push dword 1 ; File descriptor (stdout) mov eax, 4 ; System call number (sys_write) sub esp, 4 ; OS X system calls need extra space on the stack int 0x80 ; Call kernel quit: mov eax, 1 ; System call number (sys_exit) sub esp, 4 ; OS X system calls need extra space on the stack int 0x80 ; Call kernel section .data counter db 0 ; NB: 0xa char at the end of each string terminates it with a newline ; 3 bytes - 2 spaces to be populated with number + 1 for the newline counterMessage db ' ', 0xa startMessage db 'FizzBuzz test', 0xa startMessageLength equ $ - startMessage fizzMessage db 'Fizz', 0xa buzzMessage db 'Buzz', 0xa fizzBuzzMessage db 'FizzBuzz', 0xa endMessage db 'Done!', 0xa endMessageLength equ $ - endMessage
3-mid/physics/interface/source/private/bullet/bullet_physics-space.adb
charlie5/lace-alire
1
24973
with bullet_c.Binding, bullet_c.ray_Collision, c_math_c.Vector_3, c_math_c.Conversion, c_math_c.Pointers, bullet_physics.Shape, bullet_physics.Joint, Swig, lace.Any, interfaces.C, ada.unchecked_Conversion; package body bullet_Physics.Space is use bullet_c.Binding, bullet_c.Pointers, c_math_c.Conversion, Interfaces; function to_Object_view is new ada.unchecked_Conversion (swig.void_ptr, physics.Object.view); ---------- --- Forge -- function to_Space return Item is begin return Self : Item do Self.C := bullet_c.Binding.b3d_new_Space; end return; end to_Space; overriding procedure destruct (Self : in out Item) is begin bullet_c.Binding.b3d_free_Space (Self.C); end destruct; --------- --- Shape -- overriding function new_Shape (Self : access Item; Model : in physics.Model.view) return physics.Shape.view is begin raise Error with "TODO"; return null; end new_Shape; overriding function new_sphere_Shape (Self : access Item; Radius : in Real := 0.5) return physics.Shape.view is pragma unreferenced (Self); the_Sphere : constant physics.Shape .view := bullet_physics.Shape.new_sphere_Shape (Radius); begin return the_Sphere; end new_sphere_Shape; overriding function new_box_Shape (Self : access Item; half_Extents : in Vector_3 := (0.5, 0.5, 0.5)) return physics.Shape.view is pragma Unreferenced (Self); the_Box : constant physics.Shape.view := bullet_physics.Shape.new_box_Shape (half_Extents); begin return the_Box; end new_box_Shape; overriding function new_capsule_Shape (Self : access Item; Radius : in Real := 0.5; Height : in Real) return physics.Shape.view is pragma unreferenced (Self); the_Capsule : constant physics.Shape .view := bullet_physics.Shape.new_capsule_Shape (Radii => (Radius, Radius), Height => Height); begin return the_Capsule; end new_capsule_Shape; overriding function new_cone_Shape (Self : access Item; Radius : in Real := 0.5; Height : in Real := 1.0) return physics.Shape.view is pragma unreferenced (Self); the_Cone : constant physics.Shape.view := bullet_physics.Shape.new_cone_Shape (Radius, Height); begin return the_Cone; end new_cone_Shape; overriding function new_cylinder_Shape (Self : access Item; half_Extents : in Vector_3 := (0.5, 0.5, 0.5)) return physics.Shape.view is pragma unreferenced (Self); the_Cylinder : constant physics.Shape.view := bullet_physics.Shape.new_cylinder_Shape (half_Extents); begin return the_Cylinder; end New_Cylinder_Shape; overriding function new_heightfield_Shape (Self : access Item; Heightfield : in out physics.Heightfield; Scale : in Vector_3) return physics.Shape.view is pragma unreferenced (Self); function height_Extent (Self : in physics.Heightfield) return Vector_2 is Min : Real := Real'Last; Max : Real := Real'First; begin for Row in Self'Range (1) loop for Col in Self'Range (2) loop Min := Real'Min (Min, Self (Row, Col)); Max := Real'Max (Max, Self (Row, Col)); end loop; end loop; return (Min, Max); end height_Extent; function convert is new ada.unchecked_Conversion (physics.Space.Real_view, c_math_c.Pointers.Real_Pointer); the_height_Extent : constant Vector_2 := height_Extent (Heightfield); the_Heightfield : constant physics.Shape.view := bullet_physics.Shape.new_heightfield_Shape (Heightfield'Length (1), Heightfield'Length (2), convert (Heightfield (1, 1)'unchecked_Access), the_height_Extent (1), the_height_Extent (2), Scale); begin return the_Heightfield; end new_heightfield_Shape; overriding function new_multisphere_Shape (Self : access Item; Sites : in physics.vector_3_array; Radii : in Vector) return physics.Shape.view is pragma unreferenced (Self); the_multi_Sphere : constant physics.Shape.view := bullet_physics.Shape.new_multisphere_Shape (Sites, Radii); begin return the_multi_Sphere; end new_multisphere_Shape; overriding function new_plane_Shape (Self : access Item; Normal : in Vector_3 := (0.0, 1.0, 0.0); Offset : in Real := 0.0) return physics.Shape .view is pragma unreferenced (Self); the_Plane : constant physics.Shape.view := bullet_physics.Shape.new_plane_Shape (Normal, Offset); begin return the_Plane; end new_plane_Shape; overriding function new_convex_hull_Shape (Self : access Item; Points : in physics.vector_3_array) return physics.Shape.view is pragma unreferenced (Self); the_Hull : constant physics.Shape.view := bullet_physics.Shape.new_convex_hull_Shape (Points); begin return the_Hull; end new_convex_hull_Shape; overriding function new_mesh_Shape (Self : access Item; Points : access Physics.Geometry_3D.a_Model) return physics.Shape.view is pragma unreferenced (Self); the_Mesh : constant physics.Shape.view := bullet_physics.Shape.new_mesh_Shape (Points); begin return the_Mesh; end new_mesh_Shape; -- 2D -- overriding function new_circle_Shape (Self : access Item; Radius : in Real := 0.5) return physics.Shape.view is begin raise physics.Space.unsupported_Shape with "Circle shape not allowed in bullet physics."; return null; end new_circle_Shape; overriding function new_polygon_Shape (Self : access Item; Vertices : in physics.Space.polygon_Vertices) return physics.Shape.view is begin raise physics.Space.unsupported_Shape with "Polygon shape not allowed in bullet physics."; return null; end new_polygon_Shape; ------------ --- Objects -- function Hash (the_C_Object : in bullet_c.Pointers.Object_pointer) return ada.Containers.Hash_type is function convert is new ada.unchecked_Conversion (bullet_c.Pointers.Object_pointer, ada.Containers.Hash_type); begin return convert (the_C_Object); end Hash; overriding function new_Object (Self : access Item; of_Shape : in physics.Shape .view; of_Mass : in Real; Friction : in Real; Restitution : in Real; at_Site : in Vector_3; is_Kinematic : in Boolean) return physics.Object.view is pragma unreferenced (Self); the_b3d_Object : constant bullet_Physics.Object.view := bullet_physics.Object.new_Object (Shape => of_Shape, Mass => of_Mass, Friction => Friction, Restitution => Restitution, at_Site => at_Site); the_Object : constant physics.Object.view := physics.Object.view (the_b3d_Object); begin return the_Object; end new_Object; overriding function object_Count (Self : in Item) return Natural is begin raise Error with "TODO"; return 0; end object_Count; ----------- --- Joints -- overriding function new_hinge_Joint (Self : access Item; Object_A, Object_B : in physics.Object.view; Anchor_in_A, Anchor_in_B : in Vector_3; pivot_Axis : in Vector_3; low_Limit, high_Limit : in Real; collide_Connected : in Boolean) return physics.Joint.hinge.view is begin raise Error with "TODO"; return null; end new_hinge_Joint; overriding function new_hinge_Joint (Self : access Item; Object_A : in physics.Object.view; Frame_A : in Matrix_4x4) return physics.Joint.hinge.view is pragma unreferenced (Self); the_Joint : constant physics.Joint.hinge.view := bullet_physics.Joint.new_hinge_Joint (Object_A, Frame_A); begin return the_Joint; end new_hinge_Joint; overriding function new_hinge_Joint (Self : access Item; Object_A, Object_B : in physics.Object.view; Frame_A, Frame_B : in Matrix_4x4; low_Limit, high_Limit : in Real; collide_Connected : in Boolean) return physics.Joint.hinge.view is pragma unreferenced (Self); the_Joint : constant physics.Joint.hinge.view := bullet_physics.Joint.new_hinge_Joint (Object_A, Object_B, Frame_A, Frame_B); begin return the_Joint; end new_hinge_Joint; overriding function new_DoF6_Joint (Self : access Item; Object_A, Object_B : in physics.Object.view; Frame_A, Frame_B : in Matrix_4x4) return physics.Joint.DoF6.view is pragma Unreferenced (Self); the_Joint : constant physics.Joint.DoF6.view := bullet_physics.Joint.new_DoF6_Joint (Object_A, Object_B, Frame_A, Frame_B); begin return the_Joint; end new_DoF6_Joint; overriding function new_ball_Joint (Self : access Item; Object_A, Object_B : in physics.Object.view; Pivot_in_A, Pivot_in_B : in Vector_3) return physics.Joint.ball.view is pragma unreferenced (Self); the_Joint : constant physics.Joint.ball.view := Standard.bullet_physics.Joint.new_ball_Joint (Object_A, Object_B, Pivot_in_A, Pivot_in_B); begin return the_Joint; end new_ball_Joint; overriding function new_slider_Joint (Self : access Item; Object_A, Object_B : in physics.Object.view; Frame_A, Frame_B : in Matrix_4x4) return physics.Joint.slider.view is pragma unreferenced (Self); the_Joint : constant physics.Joint.slider.view := bullet_physics.Joint.new_slider_Joint (Object_A, Object_B, Frame_A, Frame_B); begin return the_Joint; end new_slider_Joint; overriding function new_cone_twist_Joint (Self : access Item; Object_A, Object_B : in physics.Object.view; Frame_A, Frame_B : in Matrix_4x4) return physics.Joint.cone_twist.view is pragma unreferenced (Self); the_Joint : constant physics.Joint.cone_twist.view := bullet_physics.Joint.new_cone_twist_Joint (Object_A, Object_B, Frame_A, Frame_B); begin return the_Joint; end new_cone_twist_Joint; --------------- --- Operations -- overriding procedure update_Bounds (Self : in out Item; of_Obect : in physics.Object.view) is the_c_Object : constant access bullet_c.Object := bullet_physics.Object.view (of_Obect).C; pragma Unreferenced (the_c_Object); begin raise Error with "TODO"; end update_Bounds; overriding procedure add (Self : in out Item; Object : in physics.Object.view) is the_c_Object : constant Object_Pointer := bullet_physics.Object.view (Object).C; begin b3d_Space_add_Object (Self.C, the_c_Object); end add; overriding procedure rid (Self : in out Item; Object : in physics.Object.view) is the_c_Object : constant Object_Pointer := bullet_physics.Object.view (Object).C; begin b3d_Space_rid_Object (Self.C, the_c_Object); end rid; overriding function cast_Ray (Self : access Item; From, To : in Vector_3) return physics.Space.ray_Collision is c_From : aliased c_math_c.Vector_3.item := +From; c_To : aliased c_math_c.Vector_3.item := +To; the_Collision : physics.Space.ray_Collision; the_c_Collision : constant bullet_c.ray_Collision.item := b3d_Space_cast_Ray (Self.C, c_From'unchecked_Access, c_To 'unchecked_Access); begin if the_c_Collision.near_Object /= null then the_Collision.near_Object := to_Object_view (b3d_Object_user_Data (the_c_Collision.near_Object)); end if; the_Collision.hit_Fraction := Real (the_c_Collision.hit_Fraction); the_Collision.Normal_world := +the_c_Collision.Normal_world; the_Collision.Site_world := +the_c_Collision.Site_world; return the_Collision; end cast_Ray; overriding procedure evolve (Self : in out Item; By : in Duration) is begin bullet_c.Binding.b3d_Space_evolve (Self.C, C.C_float (By)); -- Update each objects dynamics. -- declare use c_Object_Maps_of_Object; Cursor : c_Object_Maps_of_Object.Cursor := Self.object_Map.First; the_Object : bullet_Physics.Object.view; begin while has_Element (Cursor) loop the_Object := Element (Cursor); the_Object.update_Dynamics; next (Cursor); end loop; end; end evolve; overriding function Gravity (Self : in Item) return Vector_3 is begin raise Error with "TODO"; return (0.0, 0.0, 0.0); end Gravity; overriding procedure Gravity_is (Self : in out Item; Now : in Vector_3) is c_Now : aliased c_math_c.Vector_3.item := +Now; begin bullet_c.Binding.b3d_Space_Gravity_is (Self.C, c_Now'unchecked_Access); end Gravity_is; overriding procedure add (Self : in out Item; Joint : in physics.Joint.view) is the_c_Joint : constant Joint_Pointer := bullet_physics.Joint.view (Joint).C; begin b3d_Space_add_Joint (Self.C, the_c_Joint); end add; overriding procedure rid (Self : in out Item; Joint : in physics.Joint.view) is begin raise Error with "TODO"; end rid; overriding function manifold_Count (Self : in Item) return Natural is begin raise Error with "TODO"; return 0; end manifold_Count; overriding function Manifold (Self : access Item; Index : in Positive) return physics.space.a_Manifold is type Any_limited_view is access all lace.Any.limited_item'Class; pragma Unreferenced (Any_limited_view); the_Manifold : physics.space.a_Manifold; begin raise Error with "TODO"; return the_Manifold; end Manifold; overriding procedure set_Joint_local_Anchor (Self : in out Item; the_Joint : in physics.Joint.view; is_Anchor_A : in Boolean; local_Anchor : in Vector_3) is begin raise Error with "TODO"; end set_Joint_local_Anchor; ----------------- --- Joint Cursors -- overriding procedure next (Cursor : in out joint_Cursor) is begin raise Error with "TODO"; end next; overriding function has_Element (Cursor : in joint_Cursor) return Boolean is begin raise Error with "TODO"; return False; end has_Element; overriding function Element (Cursor : in joint_Cursor) return physics.Joint.view is begin raise Error with "TODO"; return null; end Element; overriding function first_Joint (Self : in Item) return physics.Space.joint_Cursor'Class is begin raise Error with "TODO"; return joint_Cursor' (others => <>); end first_Joint; end bullet_Physics.Space;
commands/apps/hazeover/hazeover-set-intensity.applescript
afrazkhan/script-commands
5
4112
<gh_stars>1-10 #!/usr/bin/osascript # Required parameters: # @raycast.schemaVersion 1 # @raycast.title Set Intensity # @raycast.mode silent # @raycast.packageName HazeOver # @raycast.argument1 { "type": "text", "placeholder": "Intensity (0-100)" } # Optional parameters: # @raycast.icon images/hazeover.png # Documentation: # @raycast.author <NAME> # @raycast.authorURL https://github.com/thomaspaulmann # @raycast.description Set dimming intensity of background windows. on run argv tell application "HazeOver" set newIntensity to item 1 of argv as integer if newIntensity < 0 then newIntensity = 0 else if newIntensity > 100 then newIntensity = 100 end if set intensity to newIntensity log "Set intensity to " & newIntensity & "%" end tell end run
src/grammar/FooLexer.g4
buptkt/demo-antlr4-llvm
12
1209
lexer grammar FooLexer; // Operators Add: '+'; Sub: '-'; Mul: '*'; Div: '/'; Mod: '%'; Gt: '>'; Gte: '>='; Lt: '<'; Lte: '<='; Eq: '=='; Ne: '!='; Equal: '='; // Pairs OpeningParen: '('; ClosingParen: ')'; OpeningBrace: '{'; ClosingBrace: '}'; OpeningBracket: '['; ClosingBracket: ']'; // Variable VariableDeclarator: 'let'; // Print Print: 'print'; // Statements If: 'if'; While: 'while'; // Others Comma: ','; InstructionsSeparator: ';'+; VariableName: Name; fragment Name: [a-zA-Z_] [a-zA-Z0-9_]*; // Literals StringLiteral: '"' StringChar* '"'; CharLiteral: '\'' CharChar+ '\''; fragment StringChar: ~ ["\r\n] | Escape; fragment CharChar: ~ ['\r\n] | Escape; DecimalLiteral: NONZERODIGIT DIGIT*; ZeroLiteral: '0'; HexadecimalLiteral: ('0x' | '0X') HEXADECIMALDIGIT+; BinaryLiteral: ('0b' | '0B') BINARYDIGIT+; // Comments Comment: '//' CommentLine* -> skip; fragment CommentLine: ~ [\\\r\n] | Escape; // Specials WhiteSpace: [ \t]+ -> skip; LineTerminator: [\r\n] -> channel(HIDDEN); fragment Escape: '\\\'' | '\\"' | '\\\\' | '\\n' | '\\r'; fragment NONDIGIT: [a-zA-Z_]; fragment DIGIT: [0-9]; fragment NONZERODIGIT: [1-9]; fragment HEXADECIMALDIGIT: [0-9a-fA-F]; fragment BINARYDIGIT: [01];
src/print.asm
SHARPENTIERS/z80test
2
6165
<reponame>SHARPENTIERS/z80test ; Simple printing module. ; ; Copyright (C) 2012 <NAME> (<EMAIL>) ; ; This source code is released under the MIT license, see included license.txt. ; Modified for SHARP MZ-80K series. ; call アドレスの次の内容を print / Print the following contents of the call address print: ex (sp),hl call printhl ex (sp),hl ret ; HL の示すアドレスの内容を print / Print the contents of the address indicated by HL printhl: .loop ld a,(hl) inc hl or a ret z call printchr jr .loop ; A の内容を 10 進表示 / Decimal representation of the contents of A printdeca: ld h,a ld b,-100 call .digit ld b,-10 call .digit ld b,-1 .digit ld a,h ld l,'0'-1 .loop inc l add a,b jr c,.loop sub b ld h,a ld a,l jr printchr printcrc: ld b,4 ; HL の挿す内容を 16進表示 / Hexadecimal display of HL insertion contents printhexs: .loop ld a,(hl) inc hl call printhexa djnz .loop ret printhexa: push af rrca rrca rrca rrca call .nibble pop af .nibble or 0xf0 daa add a,0xa0 adc a,0x40 ; 1 文字表示 / Print one character ; in: a = ascii code printchr: push iy push bc push de push hl call 0x0012 ; print 1char pop hl pop de pop bc pop iy ret ; EOF ;
unicode-normalization-quick_check-kc.adb
annexi-strayline/ASAP-Unicode
1
15967
------------------------------------------------------------------------------ -- -- -- Unicode Utilities -- -- -- -- Normalization Form Utilities -- -- Quick Check Query Facilities -- -- -- -- ------------------------------------------------------------------------ -- -- -- -- Copyright (C) 2019, ANNEXI-STRAYLINE Trans-Human Ltd. -- -- All rights reserved. -- -- -- -- Original Contributors: -- -- * <NAME> (ANNEXI-STRAYLINE) -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- -- -- * Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -- -- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- Generated: 2019-08-18 -- DerivedNormalizationProps.txt source -- https://www.unicode.org/Public/UCD/latest/ucd/DerivedNormalizationProps.txt -- ************* THIS FILE IS AUTOMATICALLY GENERATED ************ -- -- - See Unicode.UCD.Generate_Normalization_Quick_Check_Body.adb - -- -- DerivedNormalizationProps.txt -- -- Records loaded (NFKC_QC) = 428 function Unicode.Normalization.Quick_Check.KC (C: Wide_Wide_Character) return Quick_Check_Result is type Codepoint is mod 2**24; function Plane_00_Lookup (C: Codepoint) return Quick_Check_Result is (case C is when 16#0000A0# => NO, when 16#0000A8# => NO, when 16#0000AA# => NO, when 16#0000AF# => NO, when 16#0000B2# .. 16#0000B3# => NO, when 16#0000B4# => NO, when 16#0000B5# => NO, when 16#0000B8# => NO, when 16#0000B9# => NO, when 16#0000BA# => NO, when 16#0000BC# .. 16#0000BE# => NO, when 16#000132# .. 16#000133# => NO, when 16#00013F# .. 16#000140# => NO, when 16#000149# => NO, when 16#00017F# => NO, when 16#0001C4# .. 16#0001CC# => NO, when 16#0001F1# .. 16#0001F3# => NO, when 16#0002B0# .. 16#0002B8# => NO, when 16#0002D8# .. 16#0002DD# => NO, when 16#0002E0# .. 16#0002E4# => NO, when 16#000340# .. 16#000341# => NO, when 16#000343# .. 16#000344# => NO, when 16#000374# => NO, when 16#00037A# => NO, when 16#00037E# => NO, when 16#000384# .. 16#000385# => NO, when 16#000387# => NO, when 16#0003D0# .. 16#0003D6# => NO, when 16#0003F0# .. 16#0003F2# => NO, when 16#0003F4# .. 16#0003F5# => NO, when 16#0003F9# => NO, when 16#000587# => NO, when 16#000675# .. 16#000678# => NO, when 16#000958# .. 16#00095F# => NO, when 16#0009DC# .. 16#0009DD# => NO, when 16#0009DF# => NO, when 16#000A33# => NO, when 16#000A36# => NO, when 16#000A59# .. 16#000A5B# => NO, when 16#000A5E# => NO, when 16#000B5C# .. 16#000B5D# => NO, when 16#000E33# => NO, when 16#000EB3# => NO, when 16#000EDC# .. 16#000EDD# => NO, when 16#000F0C# => NO, when 16#000F43# => NO, when 16#000F4D# => NO, when 16#000F52# => NO, when 16#000F57# => NO, when 16#000F5C# => NO, when 16#000F69# => NO, when 16#000F73# => NO, when 16#000F75# .. 16#000F79# => NO, when 16#000F81# => NO, when 16#000F93# => NO, when 16#000F9D# => NO, when 16#000FA2# => NO, when 16#000FA7# => NO, when 16#000FAC# => NO, when 16#000FB9# => NO, when 16#0010FC# => NO, when 16#001D2C# .. 16#001D2E# => NO, when 16#001D30# .. 16#001D3A# => NO, when 16#001D3C# .. 16#001D4D# => NO, when 16#001D4F# .. 16#001D6A# => NO, when 16#001D78# => NO, when 16#001D9B# .. 16#001DBF# => NO, when 16#001E9A# .. 16#001E9B# => NO, when 16#001F71# => NO, when 16#001F73# => NO, when 16#001F75# => NO, when 16#001F77# => NO, when 16#001F79# => NO, when 16#001F7B# => NO, when 16#001F7D# => NO, when 16#001FBB# => NO, when 16#001FBD# => NO, when 16#001FBE# => NO, when 16#001FBF# .. 16#001FC1# => NO, when 16#001FC9# => NO, when 16#001FCB# => NO, when 16#001FCD# .. 16#001FCF# => NO, when 16#001FD3# => NO, when 16#001FDB# => NO, when 16#001FDD# .. 16#001FDF# => NO, when 16#001FE3# => NO, when 16#001FEB# => NO, when 16#001FED# .. 16#001FEF# => NO, when 16#001FF9# => NO, when 16#001FFB# => NO, when 16#001FFD# .. 16#001FFE# => NO, when 16#002000# .. 16#00200A# => NO, when 16#002011# => NO, when 16#002017# => NO, when 16#002024# .. 16#002026# => NO, when 16#00202F# => NO, when 16#002033# .. 16#002034# => NO, when 16#002036# .. 16#002037# => NO, when 16#00203C# => NO, when 16#00203E# => NO, when 16#002047# .. 16#002049# => NO, when 16#002057# => NO, when 16#00205F# => NO, when 16#002070# => NO, when 16#002071# => NO, when 16#002074# .. 16#002079# => NO, when 16#00207A# .. 16#00207C# => NO, when 16#00207D# => NO, when 16#00207E# => NO, when 16#00207F# => NO, when 16#002080# .. 16#002089# => NO, when 16#00208A# .. 16#00208C# => NO, when 16#00208D# => NO, when 16#00208E# => NO, when 16#002090# .. 16#00209C# => NO, when 16#0020A8# => NO, when 16#002100# .. 16#002101# => NO, when 16#002102# => NO, when 16#002103# => NO, when 16#002105# .. 16#002106# => NO, when 16#002107# => NO, when 16#002109# => NO, when 16#00210A# .. 16#002113# => NO, when 16#002115# => NO, when 16#002116# => NO, when 16#002119# .. 16#00211D# => NO, when 16#002120# .. 16#002122# => NO, when 16#002124# => NO, when 16#002126# => NO, when 16#002128# => NO, when 16#00212A# .. 16#00212D# => NO, when 16#00212F# .. 16#002131# => NO, when 16#002133# .. 16#002134# => NO, when 16#002135# .. 16#002138# => NO, when 16#002139# => NO, when 16#00213B# => NO, when 16#00213C# .. 16#00213F# => NO, when 16#002140# => NO, when 16#002145# .. 16#002149# => NO, when 16#002150# .. 16#00215F# => NO, when 16#002160# .. 16#00217F# => NO, when 16#002189# => NO, when 16#00222C# .. 16#00222D# => NO, when 16#00222F# .. 16#002230# => NO, when 16#002329# => NO, when 16#00232A# => NO, when 16#002460# .. 16#00249B# => NO, when 16#00249C# .. 16#0024E9# => NO, when 16#0024EA# => NO, when 16#002A0C# => NO, when 16#002A74# .. 16#002A76# => NO, when 16#002ADC# => NO, when 16#002C7C# .. 16#002C7D# => NO, when 16#002D6F# => NO, when 16#002E9F# => NO, when 16#002EF3# => NO, when 16#002F00# .. 16#002FD5# => NO, when 16#003000# => NO, when 16#003036# => NO, when 16#003038# .. 16#00303A# => NO, when 16#00309B# .. 16#00309C# => NO, when 16#00309F# => NO, when 16#0030FF# => NO, when 16#003131# .. 16#00318E# => NO, when 16#003192# .. 16#003195# => NO, when 16#003196# .. 16#00319F# => NO, when 16#003200# .. 16#00321E# => NO, when 16#003220# .. 16#003229# => NO, when 16#00322A# .. 16#003247# => NO, when 16#003250# => NO, when 16#003251# .. 16#00325F# => NO, when 16#003260# .. 16#00327E# => NO, when 16#003280# .. 16#003289# => NO, when 16#00328A# .. 16#0032B0# => NO, when 16#0032B1# .. 16#0032BF# => NO, when 16#0032C0# .. 16#0033FF# => NO, when 16#00A69C# .. 16#00A69D# => NO, when 16#00A770# => NO, when 16#00A7F8# .. 16#00A7F9# => NO, when 16#00AB5C# .. 16#00AB5F# => NO, when 16#00F900# .. 16#00FA0D# => NO, when 16#00FA10# => NO, when 16#00FA12# => NO, when 16#00FA15# .. 16#00FA1E# => NO, when 16#00FA20# => NO, when 16#00FA22# => NO, when 16#00FA25# .. 16#00FA26# => NO, when 16#00FA2A# .. 16#00FA6D# => NO, when 16#00FA70# .. 16#00FAD9# => NO, when 16#00FB00# .. 16#00FB06# => NO, when 16#00FB13# .. 16#00FB17# => NO, when 16#00FB1D# => NO, when 16#00FB1F# .. 16#00FB28# => NO, when 16#00FB29# => NO, when 16#00FB2A# .. 16#00FB36# => NO, when 16#00FB38# .. 16#00FB3C# => NO, when 16#00FB3E# => NO, when 16#00FB40# .. 16#00FB41# => NO, when 16#00FB43# .. 16#00FB44# => NO, when 16#00FB46# .. 16#00FBB1# => NO, when 16#00FBD3# .. 16#00FD3D# => NO, when 16#00FD50# .. 16#00FD8F# => NO, when 16#00FD92# .. 16#00FDC7# => NO, when 16#00FDF0# .. 16#00FDFB# => NO, when 16#00FDFC# => NO, when 16#00FE10# .. 16#00FE16# => NO, when 16#00FE17# => NO, when 16#00FE18# => NO, when 16#00FE19# => NO, when 16#00FE30# => NO, when 16#00FE31# .. 16#00FE32# => NO, when 16#00FE33# .. 16#00FE34# => NO, when 16#00FE35# => NO, when 16#00FE36# => NO, when 16#00FE37# => NO, when 16#00FE38# => NO, when 16#00FE39# => NO, when 16#00FE3A# => NO, when 16#00FE3B# => NO, when 16#00FE3C# => NO, when 16#00FE3D# => NO, when 16#00FE3E# => NO, when 16#00FE3F# => NO, when 16#00FE40# => NO, when 16#00FE41# => NO, when 16#00FE42# => NO, when 16#00FE43# => NO, when 16#00FE44# => NO, when 16#00FE47# => NO, when 16#00FE48# => NO, when 16#00FE49# .. 16#00FE4C# => NO, when 16#00FE4D# .. 16#00FE4F# => NO, when 16#00FE50# .. 16#00FE52# => NO, when 16#00FE54# .. 16#00FE57# => NO, when 16#00FE58# => NO, when 16#00FE59# => NO, when 16#00FE5A# => NO, when 16#00FE5B# => NO, when 16#00FE5C# => NO, when 16#00FE5D# => NO, when 16#00FE5E# => NO, when 16#00FE5F# .. 16#00FE61# => NO, when 16#00FE62# => NO, when 16#00FE63# => NO, when 16#00FE64# .. 16#00FE66# => NO, when 16#00FE68# => NO, when 16#00FE69# => NO, when 16#00FE6A# .. 16#00FE6B# => NO, when 16#00FE70# .. 16#00FE72# => NO, when 16#00FE74# => NO, when 16#00FE76# .. 16#00FEFC# => NO, when 16#00FF01# .. 16#00FF03# => NO, when 16#00FF04# => NO, when 16#00FF05# .. 16#00FF07# => NO, when 16#00FF08# => NO, when 16#00FF09# => NO, when 16#00FF0A# => NO, when 16#00FF0B# => NO, when 16#00FF0C# => NO, when 16#00FF0D# => NO, when 16#00FF0E# .. 16#00FF0F# => NO, when 16#00FF10# .. 16#00FF19# => NO, when 16#00FF1A# .. 16#00FF1B# => NO, when 16#00FF1C# .. 16#00FF1E# => NO, when 16#00FF1F# .. 16#00FF20# => NO, when 16#00FF21# .. 16#00FF3A# => NO, when 16#00FF3B# => NO, when 16#00FF3C# => NO, when 16#00FF3D# => NO, when 16#00FF3E# => NO, when 16#00FF3F# => NO, when 16#00FF40# => NO, when 16#00FF41# .. 16#00FF5A# => NO, when 16#00FF5B# => NO, when 16#00FF5C# => NO, when 16#00FF5D# => NO, when 16#00FF5E# => NO, when 16#00FF5F# => NO, when 16#00FF60# => NO, when 16#00FF61# => NO, when 16#00FF62# => NO, when 16#00FF63# => NO, when 16#00FF64# .. 16#00FF65# => NO, when 16#00FF66# .. 16#00FF6F# => NO, when 16#00FF70# => NO, when 16#00FF71# .. 16#00FF9D# => NO, when 16#00FF9E# .. 16#00FF9F# => NO, when 16#00FFA0# .. 16#00FFBE# => NO, when 16#00FFC2# .. 16#00FFC7# => NO, when 16#00FFCA# .. 16#00FFCF# => NO, when 16#00FFD2# .. 16#00FFD7# => NO, when 16#00FFDA# .. 16#00FFDC# => NO, when 16#00FFE0# .. 16#00FFE1# => NO, when 16#00FFE2# => NO, when 16#00FFE3# => NO, when 16#00FFE4# => NO, when 16#00FFE5# .. 16#00FFE6# => NO, when 16#00FFE8# => NO, when 16#00FFE9# .. 16#00FFEC# => NO, when 16#00FFED# .. 16#00FFEE# => NO, when 16#000300# .. 16#000304# => MAYBE, when 16#000306# .. 16#00030C# => MAYBE, when 16#00030F# => MAYBE, when 16#000311# => MAYBE, when 16#000313# .. 16#000314# => MAYBE, when 16#00031B# => MAYBE, when 16#000323# .. 16#000328# => MAYBE, when 16#00032D# .. 16#00032E# => MAYBE, when 16#000330# .. 16#000331# => MAYBE, when 16#000338# => MAYBE, when 16#000342# => MAYBE, when 16#000345# => MAYBE, when 16#000653# .. 16#000655# => MAYBE, when 16#00093C# => MAYBE, when 16#0009BE# => MAYBE, when 16#0009D7# => MAYBE, when 16#000B3E# => MAYBE, when 16#000B56# => MAYBE, when 16#000B57# => MAYBE, when 16#000BBE# => MAYBE, when 16#000BD7# => MAYBE, when 16#000C56# => MAYBE, when 16#000CC2# => MAYBE, when 16#000CD5# .. 16#000CD6# => MAYBE, when 16#000D3E# => MAYBE, when 16#000D57# => MAYBE, when 16#000DCA# => MAYBE, when 16#000DCF# => MAYBE, when 16#000DDF# => MAYBE, when 16#00102E# => MAYBE, when 16#001161# .. 16#001175# => MAYBE, when 16#0011A8# .. 16#0011C2# => MAYBE, when 16#001B35# => MAYBE, when 16#003099# .. 16#00309A# => MAYBE, when others => YES) with Inline; function Plane_01_Lookup (C: Codepoint) return Quick_Check_Result is (case C is when 16#01D15E# .. 16#01D164# => NO, when 16#01D1BB# .. 16#01D1C0# => NO, when 16#01D400# .. 16#01D454# => NO, when 16#01D456# .. 16#01D49C# => NO, when 16#01D49E# .. 16#01D49F# => NO, when 16#01D4A2# => NO, when 16#01D4A5# .. 16#01D4A6# => NO, when 16#01D4A9# .. 16#01D4AC# => NO, when 16#01D4AE# .. 16#01D4B9# => NO, when 16#01D4BB# => NO, when 16#01D4BD# .. 16#01D4C3# => NO, when 16#01D4C5# .. 16#01D505# => NO, when 16#01D507# .. 16#01D50A# => NO, when 16#01D50D# .. 16#01D514# => NO, when 16#01D516# .. 16#01D51C# => NO, when 16#01D51E# .. 16#01D539# => NO, when 16#01D53B# .. 16#01D53E# => NO, when 16#01D540# .. 16#01D544# => NO, when 16#01D546# => NO, when 16#01D54A# .. 16#01D550# => NO, when 16#01D552# .. 16#01D6A5# => NO, when 16#01D6A8# .. 16#01D6C0# => NO, when 16#01D6C1# => NO, when 16#01D6C2# .. 16#01D6DA# => NO, when 16#01D6DB# => NO, when 16#01D6DC# .. 16#01D6FA# => NO, when 16#01D6FB# => NO, when 16#01D6FC# .. 16#01D714# => NO, when 16#01D715# => NO, when 16#01D716# .. 16#01D734# => NO, when 16#01D735# => NO, when 16#01D736# .. 16#01D74E# => NO, when 16#01D74F# => NO, when 16#01D750# .. 16#01D76E# => NO, when 16#01D76F# => NO, when 16#01D770# .. 16#01D788# => NO, when 16#01D789# => NO, when 16#01D78A# .. 16#01D7A8# => NO, when 16#01D7A9# => NO, when 16#01D7AA# .. 16#01D7C2# => NO, when 16#01D7C3# => NO, when 16#01D7C4# .. 16#01D7CB# => NO, when 16#01D7CE# .. 16#01D7FF# => NO, when 16#01EE00# .. 16#01EE03# => NO, when 16#01EE05# .. 16#01EE1F# => NO, when 16#01EE21# .. 16#01EE22# => NO, when 16#01EE24# => NO, when 16#01EE27# => NO, when 16#01EE29# .. 16#01EE32# => NO, when 16#01EE34# .. 16#01EE37# => NO, when 16#01EE39# => NO, when 16#01EE3B# => NO, when 16#01EE42# => NO, when 16#01EE47# => NO, when 16#01EE49# => NO, when 16#01EE4B# => NO, when 16#01EE4D# .. 16#01EE4F# => NO, when 16#01EE51# .. 16#01EE52# => NO, when 16#01EE54# => NO, when 16#01EE57# => NO, when 16#01EE59# => NO, when 16#01EE5B# => NO, when 16#01EE5D# => NO, when 16#01EE5F# => NO, when 16#01EE61# .. 16#01EE62# => NO, when 16#01EE64# => NO, when 16#01EE67# .. 16#01EE6A# => NO, when 16#01EE6C# .. 16#01EE72# => NO, when 16#01EE74# .. 16#01EE77# => NO, when 16#01EE79# .. 16#01EE7C# => NO, when 16#01EE7E# => NO, when 16#01EE80# .. 16#01EE89# => NO, when 16#01EE8B# .. 16#01EE9B# => NO, when 16#01EEA1# .. 16#01EEA3# => NO, when 16#01EEA5# .. 16#01EEA9# => NO, when 16#01EEAB# .. 16#01EEBB# => NO, when 16#01F100# .. 16#01F10A# => NO, when 16#01F110# .. 16#01F12E# => NO, when 16#01F130# .. 16#01F14F# => NO, when 16#01F16A# .. 16#01F16C# => NO, when 16#01F190# => NO, when 16#01F200# .. 16#01F202# => NO, when 16#01F210# .. 16#01F23B# => NO, when 16#01F240# .. 16#01F248# => NO, when 16#01F250# .. 16#01F251# => NO, when 16#0110BA# => MAYBE, when 16#011127# => MAYBE, when 16#01133E# => MAYBE, when 16#011357# => MAYBE, when 16#0114B0# => MAYBE, when 16#0114BA# => MAYBE, when 16#0114BD# => MAYBE, when 16#0115AF# => MAYBE, when others => YES) with Inline; function Plane_02_Lookup (C: Codepoint) return Quick_Check_Result is (case C is when 16#02F800# .. 16#02FA1D# => NO, when others => YES) with Inline; function Plane_03_Lookup (C: Codepoint) return Quick_Check_Result is (YES) with Inline; function Plane_04_Lookup (C: Codepoint) return Quick_Check_Result is (YES) with Inline; function Plane_05_Lookup (C: Codepoint) return Quick_Check_Result is (YES) with Inline; function Plane_06_Lookup (C: Codepoint) return Quick_Check_Result is (YES) with Inline; function Plane_07_Lookup (C: Codepoint) return Quick_Check_Result is (YES) with Inline; function Plane_08_Lookup (C: Codepoint) return Quick_Check_Result is (YES) with Inline; function Plane_09_Lookup (C: Codepoint) return Quick_Check_Result is (YES) with Inline; function Plane_0A_Lookup (C: Codepoint) return Quick_Check_Result is (YES) with Inline; function Plane_0B_Lookup (C: Codepoint) return Quick_Check_Result is (YES) with Inline; function Plane_0C_Lookup (C: Codepoint) return Quick_Check_Result is (YES) with Inline; function Plane_0D_Lookup (C: Codepoint) return Quick_Check_Result is (YES) with Inline; function Plane_0E_Lookup (C: Codepoint) return Quick_Check_Result is (YES) with Inline; function Plane_0F_Lookup (C: Codepoint) return Quick_Check_Result is (YES) with Inline; function Plane_10_Lookup (C: Codepoint) return Quick_Check_Result is (YES) with Inline; CP: constant Codepoint := Codepoint (Wide_Wide_Character'Pos(C)); begin return (case CP is when 16#000000# .. 16#00FFFF# => Plane_00_Lookup (CP), when 16#010000# .. 16#01FFFF# => Plane_01_Lookup (CP), when 16#020000# .. 16#02FFFF# => Plane_02_Lookup (CP), when 16#030000# .. 16#03FFFF# => Plane_03_Lookup (CP), when 16#040000# .. 16#04FFFF# => Plane_04_Lookup (CP), when 16#050000# .. 16#05FFFF# => Plane_05_Lookup (CP), when 16#060000# .. 16#06FFFF# => Plane_06_Lookup (CP), when 16#070000# .. 16#07FFFF# => Plane_07_Lookup (CP), when 16#080000# .. 16#08FFFF# => Plane_08_Lookup (CP), when 16#090000# .. 16#09FFFF# => Plane_09_Lookup (CP), when 16#0A0000# .. 16#0AFFFF# => Plane_0A_Lookup (CP), when 16#0B0000# .. 16#0BFFFF# => Plane_0B_Lookup (CP), when 16#0C0000# .. 16#0CFFFF# => Plane_0C_Lookup (CP), when 16#0D0000# .. 16#0DFFFF# => Plane_0D_Lookup (CP), when 16#0E0000# .. 16#0EFFFF# => Plane_0E_Lookup (CP), when 16#0F0000# .. 16#0FFFFF# => Plane_0F_Lookup (CP), when 16#100000# .. 16#10FFFF# => Plane_10_Lookup (CP), when others => YES); end Unicode.Normalization.Quick_Check.KC;
oeis/158/A158764.asm
neoneye/loda-programs
11
162624
; A158764: 38*(38*n^2-1). ; Submitted by <NAME> ; 1406,5738,12958,23066,36062,51946,70718,92378,116926,144362,174686,207898,243998,282986,324862,369626,417278,467818,521246,577562,636766,698858,763838,831706,902462,976106,1052638,1132058,1214366,1299562,1387646,1478618,1572478,1669226,1768862,1871386,1976798,2085098,2196286,2310362,2427326,2547178,2669918,2795546,2924062,3055466,3189758,3326938,3467006,3609962,3755806,3904538,4056158,4210666,4368062,4528346,4691518,4857578,5026526,5198362,5373086,5550698,5731198,5914586,6100862,6290026,6482078 add $0,1 pow $0,2 mul $0,38 sub $0,1 mul $0,38
Library/SSMeta/ssmetaUtils.asm
steakknife/pcgeos
504
97487
<reponame>steakknife/pcgeos COMMENT @----------------------------------------------------------------------- Copyright (c) Geoworks 1992 -- All Rights Reserved PROJECT: PC GEOS MODULE: FILE: ssmetaUtils.asm AUTHOR: Cheng, 8/92 ROUTINES: Name Description ---- ----------- REVISION HISTORY: Name Date Description ---- ---- ----------- Cheng 8/92 Initial revision DESCRIPTION: FATAL ERRORS: SSMETA_INVALID_RESULT $Id: ssmetaUtils.asm,v 1.1 97/04/07 10:44:04 newdeal Exp $ -------------------------------------------------------------------------------@ SSMetaCode segment resource COMMENT @----------------------------------------------------------------------- FUNCTION: GetDataArrayRecord DESCRIPTION: Utility routine. Returns pointer to a SSMetaDataArrayRecord. CALLED BY: INTERNAL (InitSSMetaDataArrayRecord, SSMetaDataArrayAddEntry, SSMetaDataArrayGetNumEntries, SSMetaDataArrayGetFirstEntry, SSMetaDataArrayGetNthEntry) PASS: es:bp - SSMetaStruc with these fields initialized: SSMDAS_vmFileHan * SSMDAS_hdrBlkVMHan * SSMDAS_dataArraySpecifier ** * = initilization done by SSMetaGetClipboardTransferItem ** = caller initializes this RETURN: ds:si - SSMetaDataArrayRecord bx - mem handle of locked header block DESTROYED: nothing REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Cheng 8/92 Initial version -------------------------------------------------------------------------------@ GetDataArrayRecord proc near uses ax,di .enter EC< call ECCheckSSMetaStruc > call MapSpecifierToHeaderOffset ; si <- offset call LockHeaderBlk ; ds:si <- SSMetaDataArrayRecord ; bx <- mem handle mov es:[bp].SSMDAS_dataArrayRecordPtr.segment, ds mov es:[bp].SSMDAS_dataArrayRecordPtr.offset, si ; ; retrieve huge array handle for data array ; mov di, ds:[si].SSMDAR_dataArrayLinkOffset ; di <- offset mov di, ds:[di].high ; deref to get blk han mov es:[bp].SSMDAS_dataArrayBlkHan, di ; used by LockDataArrayEntry mov es:[bp].SSMDAS_hdrBlkMemHan, bx .leave ret GetDataArrayRecord endp COMMENT @----------------------------------------------------------------------- FUNCTION: MapSpecifierToHeaderOffset DESCRIPTION: Maps a DataArraySpecifier into an offset to the corresponding SSMetaDataArrayRecord. CALLED BY: INTERNAL () PASS: es:bp - SSMetaStruc RETURN: si - offset into header to the SSMetaDataArrayRecord DESTROYED: nothing REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Cheng 8/92 Initial version -------------------------------------------------------------------------------@ MapSpecifierToHeaderOffset proc near uses ax,dx .enter EC< call ECCheckSSMetaStruc > clr ah mov al, es:[bp].SSMDAS_dataArraySpecifier mov dx, size SSMetaDataArrayRecord mul dx ; dx:ax <- ax * record size EC< tst dx > EC< ERROR_NE SSMETA_INVALID_RESULT > add ax, offset SSMHB_startArrayRecords mov si, ax .leave ret MapSpecifierToHeaderOffset endp COMMENT @----------------------------------------------------------------------- FUNCTION: LockDataArrayEntry DESCRIPTION: Lock the entry in the current data array. CALLED BY: INTERNAL (SSMetaDataArrayGetFirstEntry, SSMetaDataArrayGetNthEntry) PASS: dx:ax - element number in huge array es:bp - SSMetaStruc with these fields initialized: SSMDAS_vmFileHan SSMDAR_dataArrayListOffset RETURN: carry clear if entry present ds:si - pointer to requested entry cx - size of entry carry set otherwise DESTROYED: nothing REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Cheng 8/92 Initial version -------------------------------------------------------------------------------@ LockDataArrayEntry proc near uses ax,bx,dx,di .enter EC< call ECCheckSSMetaStruc > mov bx, es:[bp].SSMDAS_vmFileHan mov di, es:[bp].SSMDAS_dataArrayBlkHan call HugeArrayLock ; ds:si <- entry ; dx <- entry size ; ax - 0 if ds:si invalid ; cx - ignore mov cx, dx ; cx <- size tst ax ; valid ptr? clc ; assume so jne done ; done if assumption correct stc ; else flag invalid done: .leave ret LockDataArrayEntry endp COMMENT @----------------------------------------------------------------------- FUNCTION: LockHeaderBlk DESCRIPTION: CALLED BY: INTERNAL () PASS: es:bp - SSMetaStruc RETURN: bx - mem handle of locked VM block ds - seg addr of locked block DESTROYED: nothing REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Cheng 8/92 Initial version -------------------------------------------------------------------------------@ LockHeaderBlk proc near uses ax .enter EC< call ECCheckSSMetaStruc > mov bx, es:[bp].SSMDAS_vmFileHan mov ax, es:[bp].SSMDAS_hdrBlkVMHan call SSMetaVMLock ; bx <- mem han, ax <- seg mov ds, ax .leave ret LockHeaderBlk endp COMMENT @----------------------------------------------------------------------- FUNCTION: SSMetaVMLock DESCRIPTION: CALLED BY: INTERNAL () PASS: bx - VM file handle ax - VM block handle RETURN: ax - segment of locked VM block bx - handle of locked VM block DESTROYED: REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Cheng 8/92 Initial version -------------------------------------------------------------------------------@ SSMetaVMLock proc near uses bp .enter call VMLock ; ax <- segment, bp <- mem han mov bx, bp .leave ret SSMetaVMLock endp COMMENT @----------------------------------------------------------------------- FUNCTION: SSMetaVMUnlock DESCRIPTION: Unlocks the VM block corresponding to the passed mem handle. CALLED BY: INTERNAL () PASS: bx - mem handle of locked VM block RETURN: nothing DESTROYED: nothing REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Cheng 8/92 Initial version -------------------------------------------------------------------------------@ SSMetaVMUnlock proc near uses bp .enter mov bp, bx call VMUnlock .leave ret SSMetaVMUnlock endp COMMENT @----------------------------------------------------------------------- FUNCTION: SSMetaVMDirty DESCRIPTION: Dirties the VM block corresponding to the passed mem handle. CALLED BY: INTERNAL () PASS: bx - mem handle of locked VM block RETURN: nothing DESTROYED: nothing REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Ted 3/93 Initial version -------------------------------------------------------------------------------@ SSMetaVMDirty proc near uses bp .enter mov bp, bx call VMDirty .leave ret SSMetaVMDirty endp SSMetaCode ends
oeis/244/A244725.asm
neoneye/loda-programs
11
6431
<filename>oeis/244/A244725.asm ; A244725: a(n) = 5*n^3. ; 0,5,40,135,320,625,1080,1715,2560,3645,5000,6655,8640,10985,13720,16875,20480,24565,29160,34295,40000,46305,53240,60835,69120,78125,87880,98415,109760,121945,135000,148955,163840,179685,196520,214375,233280,253265,274360,296595,320000,344605,370440,397535,425920,455625,486680,519115,552960,588245,625000,663255,703040,744385,787320,831875,878080,925965,975560,1026895,1080000,1134905,1191640,1250235,1310720,1373125,1437480,1503815,1572160,1642545,1715000,1789555,1866240,1945085,2026120,2109375 pow $0,3 mul $0,5
FormalAnalyzer/models/apps/BonVoyage.als
Mohannadcse/IoTCOM_BehavioralRuleExtractor
0
2085
<gh_stars>0 module app_BonVoyage open IoTBottomUp as base open cap_runIn open cap_now open cap_presenceSensor open cap_location one sig app_BonVoyage extends IoTApp { location : one cap_location, people : some cap_presenceSensor, newMode : one cap_location_attr_mode_val, state : one cap_state, } { rules = r //capabilities = people + state } one sig cap_state extends cap_runIn {} { attributes = cap_state_attr + cap_runIn_attr } abstract sig cap_state_attr extends Attribute {} abstract sig r extends Rule {} one sig r0 extends r {}{ triggers = r0_trig conditions = r0_cond commands = r0_comm } abstract sig r0_trig extends Trigger {} one sig r0_trig0 extends r0_trig {} { capabilities = app_BonVoyage.people attribute = cap_presenceSensor_attr_presence no value } abstract sig r0_cond extends Condition {} one sig r0_cond0 extends r0_cond {} { capabilities = app_BonVoyage.location attribute = cap_location_attr_mode value = cap_location_attr_mode_val - app_BonVoyage.newMode } one sig r0_cond1 extends r0_cond {} { capabilities = app_BonVoyage.people attribute = cap_presenceSensor_attr_presence value = cap_presenceSensor_attr_presence_val_not_present } abstract sig r0_comm extends Command {} one sig r0_comm0 extends r0_comm {} { capability = app_BonVoyage.state attribute = cap_runIn_attr_runIn value = cap_runIn_attr_runIn_val_on } one sig r1 extends r {}{ no triggers conditions = r1_cond commands = r1_comm } abstract sig r1_cond extends Condition {} one sig r1_cond0 extends r1_cond {} { capabilities = app_BonVoyage.state attribute = cap_runIn_attr_runIn value = cap_runIn_attr_runIn_val_on } abstract sig r1_comm extends Command {} one sig r1_comm0 extends r1_comm {} { capability = app_BonVoyage.location attribute = cap_location_attr_mode value = app_BonVoyage.newMode }
Userland/shell/loader.asm
saques/x64-Kernel
0
241838
GLOBAL loader EXTERN shell_main section .text loader: call shell_main ret
source/league/matreshka-internals-calendars-clocks__windows.adb
svn2github/matreshka
24
3296
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-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 is implementation of the package for Windows operation system. ------------------------------------------------------------------------------ with Interfaces.C; with Matreshka.Internals.Calendars.Gregorian; with Matreshka.Internals.Calendars.Times; package body Matreshka.Internals.Calendars.Clocks is type WORD is new Interfaces.C.unsigned_short; type SYSTEMTIME is record wYear : WORD; wMonth : WORD; wDayOfWeek : WORD; wDay : WORD; wHour : WORD; wMinute : WORD; wSecond : WORD; wMilliseconds : WORD; end record; pragma Convention (C, SYSTEMTIME); procedure GetSystemTime (lpSystemTime : not null access SYSTEMTIME); pragma Import (Stdcall, GetSystemTime, "GetSystemTime"); ----------- -- Clock -- ----------- function Clock return Absolute_Time is Current_Time : aliased SYSTEMTIME; begin GetSystemTime (Current_Time'Access); return Times.Create (Matreshka.Internals.Calendars.UTC_Time_Zone'Access, Gregorian.Julian_Day (Integer (Current_Time.wYear), Integer (Current_Time.wMonth), Integer (Current_Time.wDay)), Integer (Current_Time.wHour), Integer (Current_Time.wMinute), Integer (Current_Time.wSecond), Integer (Current_Time.wMilliseconds) * 10_000); end Clock; end Matreshka.Internals.Calendars.Clocks;
test/succeed/Issue552.agda
asr/agda-kanso
1
6689
module Issue552 where data Id3 {A : Set} : A -> A -> A -> Set where refl3 : {x : A} -> Id3 x x x -- These work: ok1 : {A : Set}(a b c : A) -> Id3 a b c -> Id3 a b c ok1 ._ ._ ._ (refl3 {_}) = refl3 ok2 : {A : Set}(a b c : A) -> Id3 a b c -> Id3 a b c ok2 _ ._ ._ (refl3) = refl3 ok3 : {A : Set}(a b c : A) -> Id3 a b c -> Id3 a b c ok3 _ ._ ._ (refl3 {._}) = refl3 -- These work after the fix: bad4 : {A : Set}(a b c : A) -> Id3 a b c -> Id3 a b c bad4 ._ ._ _ (refl3 {._}) = refl3 bad3 : {A : Set}(a b c : A) -> Id3 a b c -> Id3 a b c bad3 ._ _ ._ (refl3 {._}) = refl3 -- This still doesn't work: -- bad1 : {A : Set}(a b c : A) -> Id3 a b c -> Id3 a b c -- bad1 ._ ._ ._ (refl3) = refl3
libsrc/_DEVELOPMENT/l/z80/l_outi_loop.asm
ahjelm/z88dk
640
12766
INCLUDE "config_private.inc" IF !__CPU_RABBIT__ SECTION code_clib SECTION code_l PUBLIC l_outi_loop IF __SMS PUBLIC l_outi_loop_smc defc l_outi_loop_smc = l_outi_loop ;; smc not possible for SMS because the ;; SMS's outi block is too big ENDIF IF (__SMS = 0) && (__CLIB_OPT_UNROLL & 0x80) EXTERN l_outi_loop_smc defc l_outi_loop = l_outi_loop_smc ELSE EXTERN l_outi EXTERN l_outi_256, l_outi_128 EXTERN l_outi_64, l_outi_32, l_outi_16 l_outi_loop: ld a,b cp 16 jp c, sub_16 rla call c, l_outi_128 rla call c, l_outi_64 rla call c, l_outi_32 rla call c, l_outi_16 ret z otir ret sub_16: or a jp z, l_outi_256 otir ret ENDIF ENDIF
src/test/ref/pointer-const.asm
jbrandwood/kickc
2
175549
// Test pointer to const and const pointer // Commodore 64 PRG executable file .file [name="pointer-const.prg", type="prg", segments="Program"] .segmentdef Program [segments="Basic, Code, Data"] .segmentdef Basic [start=$0801] .segmentdef Code [start=$80d] .segmentdef Data [startAfter="Code"] .segment Basic :BasicUpstart(main) // Const pointer .label SCREEN = $400 // Const pointer to const .label BASIC = $a004 .segment Code main: { ldx #0 __b1: // while(MSG[i]) lda MSG,x cmp #0 bne __b2 ldx #0 __b3: // while(BASIC[i]!='0') lda BASIC,x cmp #'0' bne __b4 // } rts __b4: // BASIC[i]&0x3f lda #$3f and BASIC,x // SCREEN[40+i] = BASIC[i]&0x3f sta SCREEN+$28,x // i++; inx jmp __b3 __b2: // SCREEN[i] = MSG[i] lda MSG,x sta SCREEN,x // i++; inx jmp __b1 } .segment Data // Pointer to const MSG: .text "hello world!" .byte 0
software/hal/boards/pixhawk/hil/hil-devices.ads
TUM-EI-RCS/StratoX
12
9823
<gh_stars>10-100 -- Institution: Technische Universität München -- Department: Realtime Computer Systems (RCS) -- Project: StratoX -- Module: Software Configuration -- -- Authors: <NAME> (<EMAIL>) -- @summary -- Target-specific types for the devices that are exposed -- in hil-i2c et. al in Pixhawk. package HIL.Devices with SPARK_Mode is type Device_Type_I2C is (UNKNOWN, MAGNETOMETER); type Device_Type_SPI is (Barometer, Magneto, MPU6000, FRAM, Extern); type Device_Type_UART is (GPS, Console, PX4IO); type Device_Type_GPIO is (RED_LED, SPI_CS_BARO, SPI_CS_MPU6000, SPI_CS_LSM303D, SPI_CS_L3GD20H, SPI_CS_FRAM, SPI_CS_EXT ); -- INTERRUPT PRIOS, ALL AT ONE PLACE. Must decide who wins here. IRQ_PRIO_UART4 : constant := 251; -- must be higher, because too low could result in loss of data IRQ_PRIO_UART_LOG : constant := 249; IRQ_PRIO_SDIO : constant := 250; -- sdcard: can be lower. only affects throughput, not data integrity. end HIL.Devices;
FormalAnalyzer/models/apps/WalkGentleIntoThatGoodNight.als
Mohannadcse/IoTCOM_BehavioralRuleExtractor
0
4230
<gh_stars>0 module app_WalkGentleIntoThatGoodNight open IoTBottomUp as base open cap_switch open cap_app one sig app_WalkGentleIntoThatGoodNight extends IoTApp { app : one cap_app, state : one cap_state, switches : set cap_switch, } { rules = r } one sig cap_state extends Capability {} { attributes = cap_state_attr } abstract sig cap_state_attr extends Attribute {} one sig cap_state_attr_mode extends cap_state_attr {} { values = cap_state_attr_mode_val } abstract sig cap_state_attr_mode_val extends AttrValue {} one sig cap_state_attr_mode_val_newMode extends cap_state_attr_mode_val {} // application rules base class abstract sig r extends Rule {} one sig r0 extends r {}{ triggers = r0_trig conditions = r0_cond commands = r0_comm } abstract sig r0_trig extends Trigger {} one sig r0_trig0 extends r0_trig {} { capabilities = app_WalkGentleIntoThatGoodNight.app attribute = cap_app_attr_app value = cap_app_attr_app_val_appTouch } abstract sig r0_cond extends Condition {} abstract sig r0_comm extends Command {} one sig r0_comm0 extends r0_comm {} { capability = app_WalkGentleIntoThatGoodNight.switches attribute = cap_switch_attr_switch value = cap_switch_attr_switch_val }
oeis/083/A083086.asm
neoneye/loda-programs
11
9475
<reponame>neoneye/loda-programs ; A083086: a(n) (2*2^n + (-4)^n)/3. ; 1,0,8,-16,96,-320,1408,-5376,22016,-87040,350208,-1396736,5595136,-22364160,89489408,-357892096,1431699456,-5726535680,22906667008,-91625619456,366504574976,-1466014105600,5864064811008,-23456242466816,93825003421696,-375299946577920,1501199920529408,-6004799413682176,24019198191599616,-96076791692656640,384307168918110208,-1537228671377473536,6148914694099828736,-24595658759219445760,98382635071237521408,-393530540216230608896,1574122161002361389056,-6296488643734567649280 mov $2,-2 pow $2,$0 gcd $1,$2 add $2,2 mul $1,$2 div $1,3 mov $0,$1
src/compiling/ANTLR/grammar/PrimitiveTerminals.g4
jecassis/VSCode-SystemVerilog
75
5872
grammar PrimitiveTerminals; import PrimitiveGateAndSwitchTypes; enable_terminal : expression ; inout_terminal : net_lvalue ; input_terminal : expression ; ncontrol_terminal : expression ; output_terminal : net_lvalue ; pcontrol_terminal : expression ;
libsrc/stdio_new/file/printf.asm
andydansby/z88dk-mk2
1
177763
; int printf(const char *fmt, ...) ; 05.2008 aralbrec XLIB printf LIB vfprintf_callee, stdio_varg XREF ASMDISP_VFPRINTF_CALLEE XREF _stdout .printf call stdio_varg ; de = char *fmt ld c,l ld b,h ; bc = top of parameter list ld ix,(_stdout) jp vfprintf_callee + ASMDISP_VFPRINTF_CALLEE
source/numerics/required/s-fatlfl.adb
ytomino/drake
33
22173
<filename>source/numerics/required/s-fatlfl.adb package body System.Fat_Lflt is function frexp (value : Long_Float; exp : access Integer) return Long_Float with Import, Convention => Intrinsic, External_Name => "__builtin_frexp"; function inf return Long_Float with Import, Convention => Intrinsic, External_Name => "__builtin_inf"; function isfinite (X : Long_Float) return Integer with Import, Convention => Intrinsic, External_Name => "__builtin_isfinite"; pragma Warnings (Off, isfinite); -- [gcc 4.6] excessive prototype checking package body Attr_Long_Float is function Compose (Fraction : Long_Float; Exponent : Integer) return Long_Float is begin return Scaling (Attr_Long_Float.Fraction (Fraction), Exponent); end Compose; function Exponent (X : Long_Float) return Integer is Result : aliased Integer; Dummy : Long_Float; begin Dummy := frexp (X, Result'Access); return Result; end Exponent; function Fraction (X : Long_Float) return Long_Float is Dummy : aliased Integer; begin return frexp (X, Dummy'Access); end Fraction; function Leading_Part (X : Long_Float; Radix_Digits : Integer) return Long_Float is S : constant Integer := Radix_Digits - Exponent (X); begin return Scaling (Truncation (Scaling (X, S)), -S); end Leading_Part; function Machine (X : Long_Float) return Long_Float is begin return Long_Float (Long_Long_Float (X)); -- ??? end Machine; function Pred (X : Long_Float) return Long_Float is begin return Adjacent (X, -inf); end Pred; function Succ (X : Long_Float) return Long_Float is begin return Adjacent (X, inf); end Succ; function Unbiased_Rounding (X : Long_Float) return Long_Float is begin return X - Remainder (X, 1.0); end Unbiased_Rounding; function Valid (X : not null access Long_Float) return Boolean is begin return isfinite (X.all) /= 0; end Valid; end Attr_Long_Float; end System.Fat_Lflt;
programs/oeis/076/A076368.asm
neoneye/loda
22
101795
<reponame>neoneye/loda<filename>programs/oeis/076/A076368.asm ; A076368: a(1) = 1; for n > 1, a(n) = prime(n) - prime(n-1) + 1. ; 1,2,3,3,5,3,5,3,5,7,3,7,5,3,5,7,7,3,7,5,3,7,5,7,9,5,3,5,3,5,15,5,7,3,11,3,7,7,5,7,7,3,11,3,5,3,13,13,5,3,5,7,3,11,7,7,7,3,7,5,3,11,15,5,3,5,15,7,11,3,5,7,9,7,7,5,7,9,5,9,11,3,11,3,7,5,7,9,5,3,5,13,9,5,9,5,7,13,3,19 mov $2,$0 seq $0,75526 ; A008578(n+2) - A008578(n+1). lpb $0 mov $0,$2 lpe add $0,1
programs/oeis/043/A043094.asm
neoneye/loda
22
90745
; A043094: Every string of 2 consecutive base 8 digits contains exactly 2 distinct numbers. ; 0,1,2,3,4,5,6,7,8,10,11,12,13,14,15,16,17,19,20,21,22,23,24,25,26,28,29,30,31,32,33,34,35,37,38,39,40,41,42,43,44,46,47,48,49,50,51,52,53,55,56,57,58,59,60,61,62,65,66,67,68,69,70 add $0,6 mov $1,$0 mod $1,2 add $1,$0 lpb $1 div $1,8 sub $1,1 add $0,$1 bin $1,5 lpe sub $0,6
Ejercicio Repaso 3/Ejercicio Repaso 3.asm
alfreedom/Z80-ASM-Programs
0
96443
;Programa que simula un cronometro que ;cuenta en decimas de segundo, al inicio ;muestra ceros y el conteo comienza cuando ;se presione el push button conectado al ;PA0 (bit 0 del PA del PPI), y termina de ;contar cuando se presione el push button ;conectado al PA1 (bit 1 del PA del PPI). ; ;El retardo de conteo se hace mediante una ;subrutina de delay, la cual demora los ;milisegundos definidos en el registro C, ;cada 100 milisegundos se incrementa un ;contador de 16 bits, al presionar el boton ;de parada, el conteo se guarda en memoria, ;y la variable de conteo se reinicia a 0. TIEMPO .EQU 6800H ORG 0000h LD SP,67FFH; LD A,90h ;SE PROGRAMA EL PPI OUT (03H),A INICIO: IN A,(00H) BIT 0,A JP Z,INICIO LD D,25 CALL Delay_ms SUELTAI: IN A,(00H) BIT 0,A JP NZ,SUELTAI LD D,25 CALL Delay_ms LD HL,0000H CALL CUENTA JP INICIO CUENTA: INC HL LD D,100 CALL Delay_ms IN A,(00H) BIT 1,A JP Z,CUENTA LD D,25 CALL Delay_ms SUELTAF: IN A,(00H) BIT 0,A JP NZ,SUELTAF LD D,25 CALL Delay_ms LD (TIEMPO),HL RET ;*************************RUTINA DE DELAY************************************ Delay_ms: PUSH DE ;guardamos el par de reigstros DE en la pila EXX ;Respaldamos todos los registros, en los ;registros complementarios. EX AF,AF' ;guardamos el registro A y el registro de banderas ;en los registros A' y F'. POP DE ;restauramos los registros DE, sacandolo de la pila CICLO: LD BC,0067h ;cargamos BC con 0067h, para demorar 1ms CICLO2: DEC BC ;decrementamos BC LD A,C ;cargamos C en A para para compara si BC es 0 OR B ;comparamos a con B JP NZ,CICLO2 ;si no es cero, saltamos a ciclo 2; DEC D ;decrementamos D (contador de milisegundos) JP NZ,CICLO ;si no es cero, saltamos a ciclo1 EX AF,AF' ;restauramos el acumulador y el registro de ;banderas EXX ;restauramos todos los registros guardados en ;los registros complementariso. RET HALT
oeis/004/A004167.asm
neoneye/loda-programs
11
160935
; A004167: Powers of 3 written backwards. ; Submitted by <NAME>(s4) ; 1,3,9,72,18,342,927,7812,1656,38691,94095,741771,144135,3234951,9692874,70984341,12764034,361041921,984024783,7641622611,1044876843,30235306401,90695018313,72887134149,184635924282,344906882748,9238285681452,7894847955267,16945429767822,38846377303686,946490231198502,749382693376716,1481588810203581,3255556650609555,96566699618177661,70799989054513005,121999692536490051,363799098509382054,9802992767171580531,7626798103515552504,10882965095456675121,30468707177369927463,902953215131989814901 mov $4,$0 mov $0,3 pow $0,$4 lpb $0 mov $2,$0 div $0,10 mod $2,10 mul $3,10 add $3,$2 lpe mov $0,$3
45/beef/drv/csd/inc/csd_save.asm
minblock/msdos
0
5448
<reponame>minblock/msdos ;* ;* CW : Character Windows ;* ;* csd_save.asm : stub routines for screen saving (not supported ;* by default) ;* ifndef CbSizeVidsCsd_NonDefault ;***************************************************************************** ;********** CbSizeVidsCsd ********** ;* * CSD entry point (see documentation for interface) cProc CbSizeVidsCsd, <FAR, PUBLIC, ATOMIC> cBegin CbSizeVidsCsd xor ax,ax ;* return 0 => not available cEnd CbSizeVidsCsd ;***************************************************************************** endif ;* CbSizeVidsCsd_NonDefault ifndef FSaveVidsCsd_NonDefault ;***************************************************************************** ;********** FSaveVidsCsd ******** ;* * CSD entry point (see documentation for interface) cProc FSaveVidsCsd, <FAR, PUBLIC, ATOMIC> parmDP pvidsSave parmDP pinst cBegin FSaveVidsCsd xor ax,ax ;* failure cEnd FSaveVidsCsd ;***************************************************************************** endif ;* FSaveVidsCsd_NonDefault ifndef FRestoreVidsCsd_NonDefault ;***************************************************************************** ;********** FRestoreVidsCsd ******** ;* * CSD entry point (see documentation for interface) cProc FRestoreVidsCsd, <FAR, PUBLIC, ATOMIC> parmDP pvidsRestore cBegin FRestoreVidsCsd xor ax,ax ;* failure cEnd FRestoreVidsCsd ;***************************************************************************** endif ;* FRestoreVidsCsd_NonDefault ifndef SaveVidDataCsd_NonDefault ;***************************************************************************** ;********** SaveVidDataCsd ******** ;* * CSD entry point (see documentation for interface) cProc SaveVidDataCsd, <FAR, PUBLIC, ATOMIC> parmDP pvidsSaveData parmD lpwBuffer cBegin SaveVidDataCsd cEnd SaveVidsDataCsd ;***************************************************************************** endif ;* SaveVidsDataCsd_NonDefault ifndef RestoreVidDataCsd_NonDefault ;***************************************************************************** ;********** RestoreVidDataCsd ******** ;* * CSD entry point (see documentation for interface) cProc RestoreVidDataCsd, <FAR, PUBLIC, ATOMIC> parmDP pvidsRestoreData parmD lpwBuffer cBegin RestoreVidDataCsd cEnd RestoreVidDataCsd ;***************************************************************************** endif ;* RestoreVidDataCsd_NonDefault ifndef EnableVidsMonitorCsd_NonDefault ;***************************************************************************** ;********** EnableVidsMonitorCsd ******** ;* entry: fMonitorOn => monitor should be on ;* * enable/disable INT 10 monitor ;* exit: n/a cProc EnableVidsMonitorCsd, <FAR, PUBLIC, ATOMIC> parmW fMonitorOn cBegin EnableVidsMonitorCsd cEnd EnableVidsMonitorCsd ;***************************************************************************** endif ;* EnableVidsMonitorCsd_NonDefault
source/xml/dom/matreshka-dom_lists.adb
svn2github/matreshka
24
3167
<reponame>svn2github/matreshka<gh_stars>10-100 ------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- XML Processor -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, <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 <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 -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with Matreshka.DOM_Documents; with Matreshka.DOM_Elements; package body Matreshka.DOM_Lists is use type Matreshka.DOM_Nodes.Node_Access; ---------------------------- -- Insert_Into_Attributes -- ---------------------------- procedure Insert_Into_Attributes (Element : not null Matreshka.DOM_Nodes.Element_Access; Attribute : not null Matreshka.DOM_Nodes.Node_Access) is begin Attribute.Parent := Matreshka.DOM_Nodes.Node_Access (Element); if Element.First_Attribute = null then Attribute.Previous := null; Attribute.Next := null; Element.First_Attribute := Attribute; Element.Last_Attribute := Attribute; else Attribute.Previous := Element.Last_Attribute; Attribute.Next := null; Element.Last_Attribute.Next := Attribute; Element.Last_Attribute := Attribute; end if; end Insert_Into_Attributes; -------------------------- -- Insert_Into_Children -- -------------------------- procedure Insert_Into_Children (Parent : not null Matreshka.DOM_Nodes.Node_Access; Node : not null Matreshka.DOM_Nodes.Node_Access) is begin Node.Parent := Parent; if Parent.First = null then Node.Previous := null; Node.Next := null; Parent.First := Node; Parent.Last := Node; else Node.Previous := Parent.Last; Node.Next := null; Parent.Last.Next := Node; Parent.Last := Node; end if; end Insert_Into_Children; -------------------------- -- Insert_Into_Detached -- -------------------------- procedure Insert_Into_Detached (Node : not null Matreshka.DOM_Nodes.Node_Access) is Document : constant Matreshka.DOM_Nodes.Document_Access := Node.Document; begin if Document.First_Detached = null then Node.Previous := null; Node.Next := null; Document.First_Detached := Node; Document.Last_Detached := Node; else Node.Previous := Document.Last_Detached; Node.Next := null; Document.Last_Detached.Next := Node; Document.Last_Detached := Node; end if; end Insert_Into_Detached; ---------------------------- -- Remove_From_Attributes -- ---------------------------- procedure Remove_From_Attributes (Attribute : not null Matreshka.DOM_Nodes.Node_Access) is Element : constant Matreshka.DOM_Nodes.Element_Access := Matreshka.DOM_Nodes.Element_Access (Attribute.Parent); begin if Element.First_Attribute = Attribute then Element.First_Attribute := Attribute.Next; end if; if Element.Last_Attribute = Attribute then Element.Last_Attribute := Attribute.Previous; end if; if Attribute.Previous /= null then Attribute.Previous.Next := Attribute.Next; end if; if Attribute.Next /= null then Attribute.Next.Previous := Attribute.Previous; end if; Attribute.Parent := null; Attribute.Previous := null; Attribute.Next := null; end Remove_From_Attributes; -------------------------- -- Remove_From_Children -- -------------------------- procedure Remove_From_Children (Node : not null Matreshka.DOM_Nodes.Node_Access) is Parent : constant Matreshka.DOM_Nodes.Node_Access := Node.Parent; begin if Parent /= null then if Parent.First = Node then Parent.First := Node.Next; end if; if Parent.Last = Node then Parent.Last := Node.Previous; end if; if Node.Previous /= null then Node.Previous.Next := Node.Next; end if; if Node.Next /= null then Node.Next.Previous := Node.Previous; end if; Node.Parent := null; Node.Previous := null; Node.Next := null; end if; end Remove_From_Children; -------------------------- -- Remove_From_Detached -- -------------------------- procedure Remove_From_Detached (Node : not null Matreshka.DOM_Nodes.Node_Access) is Document : constant Matreshka.DOM_Nodes.Document_Access := Node.Document; begin if Document.First_Detached = Node then Document.First_Detached := Node.Next; end if; if Document.Last_Detached = Node then Document.Last_Detached := Node.Previous; end if; if Node.Previous /= null then Node.Previous.Next := Node.Next; end if; if Node.Next /= null then Node.Next.Previous := Node.Previous; end if; end Remove_From_Detached; end Matreshka.DOM_Lists;
test/Succeed/Issue3640.agda
cruhland/agda
1,989
10036
-- Andreas, 2019-03-25, issue #3640, reported by gallais {-# OPTIONS --sized-types #-} -- {-# OPTIONS -v tc.polarity:40 #-} module _ where open import Agda.Builtin.Size module M (_ : Set) where data U : Size → Set where node : ∀ {i} → U (↑ i) module L (A B : Set) where open M A -- WAS: crash because of number of parameters in size-index checki -- of L.U was wrongly calculated. -- Should succeed.
z80sbcFiles/source/dstat80.asm
roberts7531/z80Computer
0
243791
; .8080 ;; TITLE DISKSTAT DISK STATISTICS ;; NAME ('DISKST') ;------------------------------------------------------------------ ; Utility to display disc characteristics and file allocation ; ; Copyright 1983 <NAME> ; Author: <NAME>, MML Systems Ltd., London ; Date: 20th June 1983 ; ;------------------------------------------------------------------ ; Revisions ; ========= ; ; 2015-05-08 <NAME>: Started with the published 1.0 source and ; altered it until it builds the version distributed by PCW PD, ; which I have called 1.1. ; ; 2015-05-09 <NAME>: Converted to 8080 mnemonics (RMAC syntax) using ; XZI, and tidied up by hand. Added a header preventing DISKSTAT ; from being run under DOS, plus configurable escape codes. ; ;------------------------------------------------------------------ ;------------------------------------------------------------------------ PAGE PUBLIC DEF$DSK,DPB,DPH2,DPH3,DPB$PTR,DPH$PTR,VERS,VERS$REL,VERS$OS PUBLIC SAVESP PUBLIC BADSEL,SELMSG,BADVERS,VERMSG,BIOS,BADBIOS,JMPMSG PUBLIC BIOSPB,BIOS$FUNC,BIOS$AREG,BIOS$BCREG,BIOS$DEREG,BIOS$HLREG PUBLIC WAITCR,WAITBUFF,WAITLEN,FETCHDP PUBLIC CLEARSCRN,CSNMSG,SCREEN1,S1MSG,S1DSK PUBLIC OPTION,OPTQUIT,OPTMSG,OPTBUF,OPTLEN,OPTCHR PUBLIC MAKEHEX,WRDHEX,DBLHEX,BYTHEX,NBLHEX,TESTHEX,NEXTHEX PUBLIC HEXCHR,HEXTXT PUBLIC MAKEDEC,DEC2,ERRDEC,GIGDEC,MEGDEC,WRDDEC,BYTDEC,TXTDEC,ZROBCD PUBLIC TOBCD,BCD,TESTDEC,NEXTDEC,DECCHR,DECTXT PUBLIC MAKEMAX,MAKEM1,MAKEM2,MAKEM3,MAKEM4,MAKEM5,MAKEM6,MAKEM8 PUBLIC MAKEM7,MAKEM9,MAKE01,MAKE02,MAKE03,MAKE04,MAKEM0 PUBLIC MAKEDIR,DIRDB,DBSIZE,MAKED0,MAKED1,MAKED2,MAKED3,MAKED4 PUBLIC MAKEDAT,MAKED5,MAKED6 PUBLIC MAKETOT,MAKED7,MAKED8 PUBLIC MMEGX8,MMEGX4,MMEGX2,MGIGX8,MGIGX4,MGIGX2,MGIGX128 PUBLIC SHOWBLK,POSN,SDBMSG,SDBDSK,SDBHEX,SDBDEC,SDBMAX PUBLIC SDBDIR,SDBDAT,SDBTOT PUBLIC SHOWHDR PUBLIC SHOWALV,SALMSG,SALDSK PUBLIC SHOWFIL,SFLMSG,SFLDSK PUBLIC SHOWDIR,SDRMSG,SDRDSK PUBLIC GOODVERS,USECCP,MAIN,TASK1,TABLE1,RETURN ;------------------------------------------------------------------------ PAGE ; =============== ; DISC DATA AREAS ; =============== ;-------------------------------------------------------------- ; ; CP/M disc parameters ; ;-------------------------------------------------------------- DSEG DEF$DSK:DB 0 ; Selected disc DPB: ; Drive disk parameter block DPB$SPT:DS 2 DPB$BSH:DS 1 DPB$BLM:DS 1 DPB$EXM:DS 1 DPB$DSM:DS 2 DPB$DRM:DS 2 DPB$AL0:DS 1 DPB$AL1:DS 1 DPB$CKS:DS 2 DPB$OFF:DS 2 LEN$DPB2 EQU $-DPB ; length of CP/M 2 dpb DPB$PSH:DS 1 DPB$PHM:DS 1 LEN$DPB3 EQU $-DPB ; length of CP/M + dpb DPH2: ; CP/M 2 disk parameter header DPH2$XLT: DS 2 DPH2$ZRO: DS 6 DPH2$DIR: DS 2 DPH2$DPB: DS 2 DPH2$CSV: DS 2 DPH2$ALV: DS 2 LEN$DPH2 EQU $-DPH2 ; length of CP/M 2 dph DPH3: ; CP/M + disk parameter header DPH3$XLT: DS 2 DPH3$ZRO: DS 9 DPH3$MF:DS 1 DPH3$DPB: DS 2 DPH3$CSV: DS 2 DPH3$ALV: DS 2 DPH3$DIR: DS 2 DPH3$DAT: DS 2 DPH3$HSH: DS 2 DPH3$BNK: DS 1 LEN$DPH3 EQU $-DPH3 ; length of CP/M + dph DW 0,0,0,0,0 DB 0 DPB$PTR:DW 0 ; address of dpb DPH$PTR:DW 0 ; address of dph VERS: ; O.S. Version number VERS$REL: DS 1 ; O.S. Version/Release number VERS$OS:DS 1 ; O.S. number POSN: DW 0 ; pointer to text string ; ------; ; stack ; ; ------; DS 64 ; dont know how much stack BIOS requires SAVESP: DW 0 ; ----------------; ; address equates ; ; ----------------; BDOS EQU 5 ; BDOS entry point DEFFCB EQU 5CH ; CCP puts default FCB here DEFDMA EQU 80H ; CCP sets default DMA here ; -----------------; ; constant equates ; ; -----------------; BS EQU 08H ; <BACK SPACE> CR EQU 0DH ; <RETURN> LF EQU 0AH ; <LINE FEED> JUMP EQU 0C3H ; JP instruction CSEG ;-------------------------------------------------------------------------; PAGE ;-------; ; start ; ;-------; CSEG ; ; [1.2] Add a header to terminate gracefully if run under DOS. ; DB 0EBh, 04h ; JMPS +04 XCHG JMP ENTRY DB 0B4h, 09h ; MOV AH, C_WRITESTR DB 0BAh ; MOV DX, DW VERMSG ; VERMSG DB 0CDh, 021h ; INT 21h DB 0CDh, 020h ; INT 20h DB CR,'MML DISKSTAT 1.2 (8080)',cr,lf DB 'Date: 2015-05-09',cr,lf DB 1Ah ; ; Terminal customisation area ; DOT: DB '.' ; Empty space BLOCK: DB '#' ; Directory block SOLID: DB '+' ; Data block HOLLOW: DB '-' ; Erased block CLS: DB '$',0,0,0,0,0,0,0 ; Clear screen string ; ENTRY: LDA DOT STA DOT1 LDA BLOCK STA BLOCK1 LDA HOLLOW STA HOLLO1 LDA SOLID STA SOLID1 LXI D,CLS ; If there is a clear-screen message, LXI H,CSNMSG ; copy it over csnmsg LDAX D CPI '$' ; If it's blank (first character is $) JZ CCLS1 ; then don't. CPYCLS: LDAX D MOV M,A CPI '$' JZ CCLS1 INX H INX D JMP CPYCLS CCLS1: ; ; If this is run on a Z80, optimise LDIR. ; SUB A JPE IS080 LXI H,0B0EDh ; Replace the LDIR subroutine SHLD LDIR ; with LDIR ; RET MVI A,0C9h STA LDIR+2 IS080: ; ; End of 1.2 initialisation code ; MVI C,12 ; BDOS: RETURN VERSION NUMBER CALL BDOS SHLD VERS MOV A,H CPI 00H ; check for CP/M JNZ NOTCPM ; [1.1] Check for MP/M ; MOV A,L CPI 22H JZ GOODVERS ; MOV A,L CPI 31H JZ GOODVERS JMP BADVERS ; NOTCPM: CPI 1 ; [1.1] MP/M? JNZ BADVERS MOV A,L CPI 30H ; MP/M II? JZ GOODVERS JMP BADVERS ; PAGE ; ================= ; ; various utilities ; ; ================= ; ; -------------- ; ; Error routines ; ; -------------- ; BADSEL: LXI D,SELMSG MVI C,9 ; BDOS: PRINT STRING CALL BDOS MVI C,0 ; BDOS: SYSTEM RESET JMP BDOS ; and crash out DSEG SELMSG: DB 'FATAL ERROR - Unable to select drive','$' CSEG BADVERS: LXI D,VERMSG MVI C,9 ; BDOS: PRINT STRING JMP BDOS ; & RETURN DSEG VERMSG: DB 'MUST USE CP/M 2.2, MP/M 3.0 OR CP/M 3.1','$' ; [1.1] CSEG ; ; Emulate the Z80's LDIR instruction ; LDIR: PUSH PSW LDIR1: MOV A,M STAX D INX H INX D DCX B MOV A,B ORA C JNZ LDIR1 POP PSW RET ; ; --------------------------- ; ; Direct calls to CP/M 2 BIOS ; ; --------------------------- ; BIOS: PUSH D ; must save DE as sometimes passed to BIOS XCHG LHLD 1 ; pointer to BIOS WARM BOOT MOV A,M CPI JUMP ; check actually pointing to BIOS (not XSUB) JNZ BADBIOS DAD D ; DE = offset from WARM BOOT to BIOS function POP D MOV A,M CPI JUMP ; check actually pointing to BIOS (not XSUB) JNZ BADBIOS PCHL BADBIOS: ; (NOTE DE may be on stack) LXI D,JMPMSG MVI C,9 ; BDOS: PRINT STRING CALL BDOS MVI C,0 ; BDOS: SYSTEM RESET JMP BDOS ; and crash out DSEG JMPMSG: DB 'FATAL ERROR - Unable to find BIOS','$' CSEG ; --------------------------- ; ; Direct calls to CP/M 3 BIOS ; ; --------------------------- ; DSEG BIOSPB: BIOS$FUNC: DS 1 ; BIOS function number (WARM BOOT = 1) BIOS$AREG: DS 1 ; A register contents BIOS$BCREG: DS 2 ; BC register contents BIOS$DEREG: DS 2 ; DE register contents BIOS$HLREG: DS 2 ; HL register contents CSEG PAGE ; ------------------------------ ; ; Conversion into HEX characters ; ; ------------------------------ ; ;-----------------------------------------------------------------------; ; HEXBYT ; ; Input: <B> = Count of bytes to be converted ; ; <HL> -> first byte to be translated ; ; POSN = pointer to text field ; ; Destroys: All registers ; ; Function: Converts <B> bytes starting at <HL> into 2 digit ; ; hexadecimal characters which are added to next ; ; hexadecimal field in the text string. POSN is updated ; ; to point to the end of this hexadecimal field. ; ;-----------------------------------------------------------------------; ;-----; HEXBYT: ;-----; PUSH H PUSH B MOV A,M CALL BYTHEX POP B POP H INX H DCR B JNZ HEXBYT ; # DJNZ HEXBYT RET ;-----------------------------------------------------------------------; ; HEXTBL ; ; Input: <B> = Count of bytes to be converted ; ; <HL> -> start of array of <B> byte to be translated ; ; <DE> -> start of table of conversion formats ; ; 1 = single byte ; ; 2 = pair of bytes to be combined as one word ; ; 3 = pair of bytes to reversed in text fields ; ; POSN = pointer to text field ; ; Destroys: All registers ; ; Function: Converts <B> bytes starting at <HL> according to ; ; format type in table pointed at by <DE>. Each entry ; ; in the table <DE> corresponds to field positions. ; ;-----------------------------------------------------------------------; ;-----; HEXTBL: ;-----; LDAX D PUSH D CPI 2 JZ HEXTBL2 CPI 3 JZ HEXTBL3 ; byte MOV A,M PUSH B PUSH H CALL BYTHEX JMP NXTTBL ; word HEXTBL2: DCR B ; decrement <B> as using two bytes PUSH B MOV E,M INX H MOV D,M PUSH H XCHG CALL WRDHEX ; <HL> -> text JMP NXTTBL ; double byte HEXTBL3: DCR B ; decrement <B> as using two bytes PUSH B INX H MOV A,M ; display 2nd byte first DCX H PUSH H CALL BYTHEX POP H MOV A,M ; display 1st byte next INX H PUSH H CALL BYTHEX NXTTBL: POP H POP B POP D INX D INX H DCR B JNZ HEXTBL ; # DJNZ HEXTBL RET ;-----------------------------------------------------------------------; ; WRDHEX ; ; Input: <HL> = word to converted into hexadecimal text ; ; POSN = pointer to text field ; ; Destroys: All registers ; ; Function: Converts word in <HL> into four hexadecimal characters ; ; which are added to next hexadecimal field in the ; ; text string. POSN is updated to point to the end ; ; of this hexadecimal field. ; ;-----------------------------------------------------------------------; ;-----; WRDHEX: ; display hex word in <HL> into text ;-----; PUSH H ; must preserve HL CALL NEXTHEX ; returns DE -> 'h' DCX D DCX D DCX D DCX D POP H PUSH H MOV A,H CALL OUTNBL POP H MOV A,L CALL OUTNBL RET ;-----------------------------------------------------------------------; ; DBLHEX ; ; Input: <HL> = word to converted into hexadecimal text ; ; POSN = pointer to text field ; ; Destroys: All registers ; ; Function: Converts word in <HL> into two pairs of hexadecimal ; ; characters with the high byte displayed first. Each is ; ; added to the next hexadecimal field in the text string. ; ; POSN is updated to point to the end of the second ; ; is hexadecimal field. ; ;-----------------------------------------------------------------------; ;-----; DBLHEX: ; display high hex byte into text ;-----; MOV A,H PUSH H CALL BYTHEX POP H ; display high hex byte into text MOV A,L JMP BYTHEX ;-----------------------------------------------------------------------; ; BYTHEX ; ; Input: <A> = byte to converted into hexadecimal text ; ; POSN = pointer to text field ; ; Destroys: All registers ; ; Function: Converts byte in <A> into two hexadecimal characters ; ; which are added to next hexadecimal field in the ; ; text string. POSN is updated to point to the end ; ; of this hexadecimal field. ; ;-----------------------------------------------------------------------; ;-----; BYTHEX: ; converts byte in <A> into hexadecimal text ;-----; PUSH PSW CALL NEXTHEX ; returns DE -> 'h' DCX D DCX D POP PSW CALL OUTNBL RET ;-----; OUTNBL: ; convert byte in <A> into two hex chars at <DE> ;-----; PUSH PSW RRC RRC RRC RRC CALL NBLHEX POP PSW ;-----; NBLHEX: ; convert nibble in A into hex char in (DE) ;-----; ANI 0FH MOV C,A MVI B,0 LXI H,HEXTXT DAD B MOV A,M STAX D INX D RET ;-----------------------------------------------------------------------; ; NEXTHEX ; ; Input: POSN = pointer to text field ; ; Returns: <DE> -> to end of hexadecimal filed ; ; Destroys: <A>, <BC>, <HL> ; ; Function: Starting at location (POSN), scans text for hexadecimal ; ; field of the form ??h or ????h where ? is any valid ; ; hexadecimal character (0123456789ABCDEF). POSN is ; ; updated to point to the end of this hexadecimal field. ; ;-----------------------------------------------------------------------; TESTHEX: CPI CR ; check if end of line, as must not pass this RZ ; even if this means overwriting text. ;------; NEXTHEX: ; find next hex location in text ;------; CALL HEXCHR ; find first hex character JNZ TESTHEX CALL HEXCHR ; find second hex character JNZ TESTHEX INX D LDAX D CPI 'h' JNZ TESTHEX RET HEXCHR: LHLD POSN INX H MOV A,M MOV D,H MOV E,L CPI CR ; test for end of line RZ SHLD POSN ; update POSN LXI H,HEXTXT MVI B,16 NXT1: CMP M RZ INX H ; # DJNZ NXT1 DCR B JNZ NXT1 ORI -1 RET DSEG HEXTXT: DB '0123456789ABCDEF' CSEG PAGE ; ================= ; ; various functions ; ; ================= ; ; ------------------------------ ; ; Wait for <RETURN> for keyboard ; ; ------------------------------ ; WAITCR: LXI D,CRMSG MVI C,9 ; BDOS: PRINT STRING CALL BDOS MVI C,10 ; DIRECT CONSOLE BUFFER LXI D,WAITBUFF CALL BDOS LDA WAITLEN ORA A RZ JMP WAITCR DSEG CRMSG: DB CR,LF,'Hit <RETURN> to continue ','$' WAITBUFF: DB 1 WAITLEN: DS 1 DS 1 CSEG ; ---------------------------- ; ; Fetch DPH and DPB for device ; ; ---------------------------- ; FETCHDP: CALL GETDPB LDA VERS$REL CPI 22H CZ GETDPH2 LDA VERS$REL CPI 31H CZ GETDPH3 RET ; ---------------- ; ; Fetch CP/M 2 DPH ; ; ---------------- ; GETDPH2: LDA DEF$DSK ; Current selected disk MOV C,A ; BIOS: Disk drive to select MVI E,-1 ; Not first time login LXI H,001BH-0003H ; offset from WARM BOOT to select function CALL BIOS MOV A,L ORA H JZ BADSEL SHLD DPH$PTR ; save address of DPH LXI D,DPH2 LXI B,LEN$DPH2 ;;; # LDIR CALL LDIR RET ; ---------------- ; ; Fetch CP/M + DPH ; ; ---------------- ; GETDPH3: LDA DEF$DSK ; Current selected disk STA BIOS$BCREG ; save in BIOSPB LXI H,-1 ; Not first time login XCHG ; XXX No need for XCHG here SHLD BIOS$DEREG ; save in BIOSPB XCHG ; XXX No need for XCHG here MVI A,9 ; BIOS: select the sepcified disk drive STA BIOS$FUNC ; save in BIOSPB MVI C,50 ; BDOS: DIRECT BIOS CALL LXI D,BIOSPB ; BIOS parameter block CALL BDOS ; IMPORTANT: dont trace this as BDOS ; copies DPH into keyboard character buffer MOV A,L ; BDOS returns address of its copy of DPH ORA H JZ BADSEL SHLD DPH$PTR ; save address of DPH but this is of no value LXI D,DPH3 LXI B,LEN$DPH3 ;;; # LDIR CALL LDIR RET ; --------- ; ; Fetch DPB ; ; --------- ; GETDPB: MVI C,31 ; BDOS: GET ADDR (DPB PARMS) CALL BDOS SHLD DPB$PTR ; save address of DPB LXI D,DPB LXI B,LEN$DPB3 ; copy maximum length regardless ;;; # LDIR CALL LDIR RET ;--------; CLEARSCRN: ; clear screen ;--------; LXI D,CSNMSG MVI C,9 ; BDOS: PRINT STRING JMP BDOS ; & RETURN DSEG CSNMSG: DB CR,LF,LF,LF,LF,LF,LF,LF,LF,LF,LF DB CR,LF,LF,LF,LF,LF,LF,LF,LF,LF,LF DB CR,LF,LF,LF,LF,LF,'$' ; 25 line feeds CSEG ;------; SCREEN1: ; display menu ;------; LDA DEF$DSK ADI 'A' STA S1DSK LXI D,S1MSG MVI C,9 ; BDOS: PRINT STRING JMP BDOS ; & RETURN DSEG S1MSG: DB CR,'MML:DISKSTAT DRIVE ' S1DSK: DB 'A: CHARACTERISTICS ' DB CR,LF,LF,LF,LF,LF,LF,LF,LF,LF,LF ; 10 line feeds DB CR,LF,' 1 Display DPB statistics ' DB CR,LF,' 2 Display DPH statistics ' DB CR,LF,' 3 Display disk ALLOCATION ' DB CR,LF ; Later,' 4 Display file ALLOCATION ' DB CR,LF ; Later,' 5 Display directory ALLOCATION ' DB CR,LF,' 9 Select new disk ' DB CR,LF,LF,LF,LF,'$' ; 5 line feeds CSEG ;-----; OPTION: ; request option ;-----; LXI D,OPTMSG MVI C,9 ; BDOS: PRINT STRING CALL BDOS LXI D,OPTBUF MVI C,10 ; BDOS: READ CONSOLE BUFFER CALL BDOS LDA OPTLEN CPI 0 JZ OPTQUIT CPI 1 JNZ OPTION LDA OPTCHR CPI '1' JC OPTION CPI '9'+1 JNC OPTION ; value in range 1 to 9 SUI '0' RET OPTQUIT: ORI -1 RET DSEG OPTMSG: DB CR,' Enter your choice, or <RETURN> ',BS,BS,'$' OPTBUF: DB 2 ; maximum length of buffer OPTLEN: DS 1 ; number of characters returned OPTCHR: DS 2 ; space for up to 2 characters CSEG ;------; MAKEHEX: ; module in showblk ;------; ; ' 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ' ;sdbbyt ' 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h' ; ' SPT BSH BLM EXM DSM DRM AL0-AL1 CKS OFF PSH PHM' ;sdbhex ' 0000h 00h 00h 00h 0000h 0000h 00h 00h 0000h 0000h 00h 00h' LXI H,SDBBYT SHLD POSN LDA VERS$REL CPI 31H JZ MAKEH3 XRA A ; CP/M 2 does not have PSH & PHM STA DPB$PSH ; - set to zero STA DPB$PHM MAKEH3: LXI H,DPB MVI B,17 CALL HEXBYT LXI H,SDBHEX SHLD POSN LXI H,DPB MVI B,17 LXI D,HBTYPE CALL HEXTBL RET DSEG HBTYPE: DB 2,1,1,1,2,2,1,1,2,2,1,1 CSEG ;------; MAKEDEC: ; module in showblk ;------; LXI H,SDBDEC SHLD POSN LHLD DPB$SPT CALL WRDDEC ; <HL> -> text LDA DPB$BSH CALL BYTDEC ; <A> -> text LDA DPB$BLM CALL BYTDEC ; <A> -> text LDA DPB$EXM CALL BYTDEC ; <A> -> text LHLD DPB$DSM CALL WRDDEC ; <HL> -> text LHLD DPB$DRM CALL WRDDEC ; <HL> -> text LDA DPB$AL0 CALL BYTDEC ; <A> -> text LDA DPB$AL1 CALL BYTDEC ; <A> -> text LHLD DPB$CKS CALL WRDDEC ; <HL> -> text LHLD DPB$OFF CALL WRDDEC ; <HL> -> text LDA VERS$REL CPI 31H JNZ DEC2 LDA DPB$PSH CALL BYTDEC ; <A> -> text LDA DPB$PHM CALL BYTDEC ; <A> -> text RET DEC2: XRA A CALL BYTDEC ; <A> -> text XRA A CALL BYTDEC ; <A> -> text RET ERRDEC: ; fill display with 3 asterisks as error CALL NEXTDEC ; <DE> -> leftmost digit XCHG LHLD POSN ; [1.1] MVI A,'*' ; set 1st 3 digits to '*' MOV M, A DCX H MOV M, A DCX H MOV M, A XCHG RET BYTDEC: ; display byte in A as decimal characters MVI H,0 MOV L,A WRDDEC: ; display word in HL as decimal characters LXI B,0 JMP TXTDEC MEGDEC: ; display byte,word in C & HL as decimal characters MVI B,0 GIGDEC: ; display double word in BC & HL as decimal characters TXTDEC: XCHG PUSH D ; save 4 bytes of binary number PUSH B CALL NEXTDEC ; <DE> -> leftmost digit POP B POP D CALL TOBCD ; converts <B>, <C>, <D>, <E> into bcd at BCD LHLD POSN XCHG ; recover <DE> -> leftmost digit MVI A,'0' ; initialise 1st digit to a zero STAX D ; (just to make sure ) LXI H,BCDLSB ; start with least significent digit TXTDEC1: CALL TXTBCD RZ DCX H JMP TXTDEC1 ; continue till all 10 digits done TXTBCD: ; HL -> bcd digit, <DE> -> txt postion CALL ZROBCD ; zero when no more BCD digits (destroys <A>, <BC>) RZ MOV A,M ADI '0' STAX D DCX D XRA A MOV M,A ; zero BCD byte ESSENTIAL to exit when done ORI -1 RET ZROBCD: ; test for all bytes of BCD being zero ; this is important as eventually all bytes ; will be set to zero during transfer to text PUSH H LXI H,BCD XRA A MVI B,10 NXTZRO: ORA M JNZ NXTZ1 INX H DCR B JNZ NXTZRO ; # DJNZ NXTZRO NXTZ1: POP H RET ;----; TOBCD: ; print binary number 0-65535 from <HL> ;----; LXI H,BINARY MOV M,E ; least significant digit INX H MOV M,D INX H MOV M,C INX H MOV M,B ; most significent digit PUSH B LXI H,BCD MVI B,10 XRA A SETBCD: MOV M,A INX H ;;; # DJNZ SETBCD ; first zero all digits DCR B JNZ SETBCD POP B MOV A,B ORA A JNZ UPGIG ORA C JNZ UPMEG ORA D JNZ UPWRD ORA E JNZ UPBYT RET ; number is zero so return UPBYT: LXI B,BCDBYT ; start of BCD pointer LXI H,BYT10 JMP UPNXT UPWRD: LXI B,BCDWRD ; start of BCD pointer LXI H,WRD10 JMP UPNXT UPMEG: LXI B,BCDMEG ; start of BCD pointer LXI H,MEG10 JMP UPNXT UPGIG: LXI B,BCDGIG ; start of BCD pointer LXI H,GIG10 ; UPNXT: LXI D,BINARY ; binary number to be converted PUSH B ; save BCD pointer MVI C,-1 PDECL: PUSH H PUSH D INR C XRA A MVI B,4 PUSH PSW ; DJNZ preserved flags, but the 8080's NDECL: POP PSW ; DCR / JNZ doesn't, so we have to maintain LDAX D ; the flags manually. ADC M STAX D ; and reduce count INX D INX H ;;; # DJNZ NDECL ; this doesnt effect any flags PUSH PSW DCR B JNZ NDECL POP PSW POP D POP H JC PDECL ; repeatedly subtract amount till carry set PUSH H PUSH D XRA A MVI B,4 NINCL: LDAX D SBB M STAX D ; and increase INX D INX H ;;; # DJNZ NINCL ; this doesnt effect any flags DCR B JNZ NINCL POP D INX SP INX SP ; loose <HL> (digits) saved on stack MOV A,C POP B ; pointer to BCD STAX B INX B MOV A,M INX H ; [1.1] Check both bytes of the word at (HL) ORA M ; not just the low one. DCX H JNZ UPNXT RET DSEG BCD: ; 10 bytes, 10 digits of BCD text BCDGIG: ; max number is 4294967295 BCD$0: DB 4 BCD$1: DB 2 BCDMEG: ; max number is 16777215 BCD$2: DB 9 BCD$3: DB 4 BCD$4: DB 9 BCDWRD: ; max number is 65535 BCD$5: DB 6 BCD$6: DB 7 BCDBYT: ; max number is 255 BCD$7: DB 2 BCD$8: DB 9 BCDLSB: BCD$9: DB 5 GIG10: DW 13824,-15259 ; -1000000000 (C465 3600H) DW 7936, -1526 ; -100000000 (FA0A 1F00H) MEG10: DW 27008, -153 ; -10000000 (FF67 6980H) DW -16960, -16 ; -1000000 (FFF0 BDC0H) DW 31072, -2 ; -100000 (FFFE 7960H) WRD10: DW -10000, -1 ; -10000 (FFFF D8F0H) DW -1000, -1 ; -1000 (FFFF FC18H) BYT10: DW -100, -1 ; -100 (FFFF FF9CH) DW -10, -1 ; -10 (FFFF FFF6H) DW -1, -1 ; -1 (FFFF FFFFH) DW 0, 0 ; 0 (0000 0000H) this terminates all BINARY: DB 0,0,0,0 ; binary number filled from E, D, C, & B CSEG TESTDEC: CPI CR RZ NEXTDEC: ; find next dec location in text and convert to space ; and return DE -> to end of 00h string CALL DECCHR ; find first dec character JNZ TESTDEC NXT3: MVI A,' ' ; erase each digit as we go STAX D CALL DECCHR ; scan subsequent dec characters JZ NXT3 DCX D MVI A,'0' STAX D ; initialise 1st digit to a zero XCHG SHLD POSN XCHG ; [1.1] Bring DE back RET DECCHR: LHLD POSN INX H MOV A,M MOV D,H MOV E,L CPI CR RZ SHLD POSN LXI H,DECTXT MVI B,12 ; [1.1] Check 12 chars, not 11. NXT2: CMP M RZ INX H ;;; # DJNZ NXT2 DCR B JNZ NXT2 ORI -1 RET DSEG DECTXT: DB '0123456789+*' ; + used for bit flag, * used for errors CSEG ;------; MAKEMAX: ; module in showblk ;------; ;' BLOCK EXTENT MAX DISK DIRECTORY CHECK SUM SECTOR' ;' SIZE (K) FOLDS SIZE (K) ENTRIES ENTRIES SIZE' ;'DPB(DEC): 16K 15 1048576 65536 65536 32768' LXI H,SDBMAX SHLD POSN LDA DPB$BSH LXI H,128 ORA A JZ MAKEM2 MAKEM1: DAD H DCR A JNZ MAKEM1 MAKEM2: MOV A,H ; /256 RRC ; /512 RRC ; /1024 PUSH PSW LDA DPB$BLM LXI B,-128 ORA A JZ MAKEM4 MAKEM3: DAD B DCR A JNZ MAKEM3 MAKEM4: DAD B POP PSW ; recover K MOV B,A ; and save MOV A,H ORA L MOV A,B PUSH PSW CNZ ERRDEC POP PSW CZ BYTDEC ; <A> -> text LDA DPB$BLM ADI 1 ; +1 RAR RAR RAR ; /8 MOV B,A ; save EXM+1 LHLD DPB$DSM XRA A ; (there must be an easier way) SUB H DCR A CMC ADC H ; a = 0 if H = 0, else a = -1 ANA B ADD B ADI -1 ; -1 (convert into EXM) MOV B,A ; and save LDA DPB$EXM CMP B PUSH PSW CNZ ERRDEC POP PSW CZ BYTDEC ; <A> -> text XRA A LHLD DPB$DSM LXI B,1 DAD B ; increment dsm by 1 ACI 0 MOV C,A ; and save in C LDA DPB$BSH ADI -3 MOV B,A ORA A MOV A,C ; giga byte JZ MAKEM6 MAKEM5: DAD H ACI 0 DCR B JNZ MAKEM5 ;;; # DJNZ MAKEM5 MAKEM6: MOV C,A CALL MEGDEC ; <C> & <HL> -> text XRA A LHLD DPB$DRM LXI B,1 DAD B ; increment drm by 1 ACI 0 MOV C,A CALL MEGDEC ; <C> & <HL> -> text LHLD DPB$DRM MOV A,H ANA A RAR MOV H,A MOV A,L RAR MOV L,A ; /2 MOV A,H ANA A RAR MOV H,A MOV A,L RAR MOV L,A ; /4 MOV D,H MOV E,L INX D ; DE=HL+1 LHLD DPB$CKS MOV A,H ORA L JZ MAKEM8 ; no check sum MOV A,H ANI 7FH ORA L JZ MAKEM7 ; bit 15 set for non removable ;;; # SBC HL,DE MOV A,L SUB E MOV L,A MOV A,H SBB D MOV H,A ORA L ; Set the Z based on HL XCHG JZ MAKEM8 CALL ERRDEC JMP MAKEM9 MAKEM8: MVI C,0 CALL MMEGX4 ; <C>, <HL> * 4 CALL MEGDEC ; <C> & <HL> -> text JMP MAKEM9 MAKEM7: XRA A CALL NEXTDEC ;;; # LD DE,(POSN) ; [1.1] XCHG LHLD POSN DCX H MVI M,'+' INX H INX H XCHG MAKEM9: LDA VERS$REL CPI 31H JNZ MAKEM0 LDA DPB$PSH LXI H,128 ORA A JZ MAKE02 MAKE01: DAD H DCR A JNZ MAKE01 MAKE02: PUSH H LDA DPB$PHM LXI B,-128 ORA A JZ MAKE04 MAKE03: DAD B DCR A JNZ MAKE03 MAKE04: DAD B MOV A,H ORA L POP H PUSH PSW CNZ ERRDEC POP PSW CZ WRDDEC ; <HL> -> text RET MAKEM0: LXI H,128 ; CP/M 2 sector size CALL WRDDEC ; <HL> -> text RET ;--------; MAKEDIR: ; module in showblk ;--------; ;' Data 1K 128 byte ' ;' Blocks Blocks Records Capacity' ;' Directory 65535 16777215 16777215 16777215 Entries' ;' Data 65535 16777215 16777215 4294967296 Bytes' ;' 65000 16777215 16777215' DSEG DIRDB: DB 0 ; save number of director blocks DBSIZE: DB 0 ; save data block size in K CSEG LXI H,SDBDIR SHLD POSN LHLD DPB$AL0 XRA A MVI B,16 MAKED0: DAD H ACI 0 ;;; # DJNZ MAKED0 ; number of directory data blocks DCR B JNZ MAKED0 STA DIRDB CALL BYTDEC ; <A> -> text LDA DPB$BSH LXI H,128 ORA A JZ MAKED2 MAKED1: DAD H DCR A JNZ MAKED1 MAKED2: MOV A,H ; /256 RRC ; /512 RRC ; /1024 STA DBSIZE ; save data block size in K MOV C,A MVI B,0 LDA DIRDB LXI H,0 ORA A JZ MAKED4 MAKED3: DAD B DCR A JNZ MAKED3 MAKED4: PUSH H CALL WRDDEC ; <HL> -> text POP H MVI C,0 CALL MMEGX8 ; multiply by 8 PUSH H PUSH B CALL MEGDEC ; number of records (<C> & <HL> -> text) POP B POP H CALL MMEGX4 ; multiply by 4 CALL MEGDEC ; number of entries (<C> & <HL> -> text) RET ;--------; MAKEDAT: ; module in showblk ;--------; ;' Data 1K 128 byte ' ;' Blocks Blocks Records Capacity' ;' Directory 65535 16777215 16777215 16777215 Entries' ;' Data 65535 16777215 16777215 4294967296 Bytes' ;' 65000 16777215 16777215' LXI H,SDBDAT SHLD POSN LHLD DPB$DSM ; total disk blocks LDA DIRDB ; blocks reserved for directory DCR A MOV C,A MVI B,0 ;;; # SBC HL,BC ; leaving number of data blocks MOV A,L SUB C MOV L,A MOV A,H SBB B MOV H,A PUSH H CALL WRDDEC ; <HL> -> text POP H XRA A MOV B,A MOV C,A ; BC = 0 LDA DPB$BLM INR A RRC RRC RRC ; /8 MAKED5: RRC ; [1.1] This loop rewritten ... JC MAKED6 PUSH PSW CALL MGIGX2 POP PSW JMP MAKED5 ; [1.1] ... to here MAKED6: PUSH B PUSH H CALL GIGDEC ; 1K blocks (<BC> & <HL> -> text) POP H POP B CALL MGIGX8 ; multiply B,C,H,& L by 8 PUSH H PUSH B CALL GIGDEC ; number of records (<BC> & <HL> -> text) POP B POP H CALL MGIGX128 ; multiply B,C,H,& L by 128 CALL GIGDEC ; number of bytes (<BC> & <HL> -> text) RET ;--------; MAKETOT: ; module in showblk ;--------; ;' Data 1K 128 byte ' ;' Blocks Blocks Records Capacity' ;' Directory 65535 16777215 16777215 16777215 Entries' ;' Data 65535 16777215 16777215 4294967296 Bytes' ;' 65000 16777215 16777215' LXI H,SDBTOT SHLD POSN XRA A LXI B,1 LHLD DPB$DSM ; total disk blocks DAD B ADC A MOV C,A PUSH B PUSH H CALL WRDDEC ; <HL> -> text POP H POP B LDA DPB$BLM INR A RRC RRC RRC ; /8 MAKED7: RRC ; [1.1] Rewritten to match maked5/maked6 JC MAKED8 PUSH PSW CALL MGIGX2 POP PSW JMP MAKED7 ; MAKED8: PUSH B PUSH H CALL GIGDEC ; 1K blocks (<BC> & <HL> -> text) POP H POP B CALL MGIGX8 ; multiply B,C,H,& L by 8 CALL GIGDEC ; number of records (<BC> & <HL> -> text) RET MMEGX8: CALL MMEGX2 ; multiply C,H,& L by 8 MMEGX4: CALL MMEGX2 ; multiply C,H,& L by 4 MMEGX2: MOV A,L ; multiply C,H,& L by 2 ADD A MOV L,A MOV A,H ADC A MOV H,A MOV A,C ADC A MOV C,A RET MGIGX8: CALL MGIGX2 ; multiply B,C,H,& L by 8 MGIGX4: CALL MGIGX2 ; multiply B,C,H,& L by 4 MGIGX2: MOV A,L ; multiply B,C,H,& L by 2 ADD A MOV L,A MOV A,H ADC A MOV H,A MOV A,C ADC A MOV C,A MOV A,B ADC A MOV B,A RET MGIGX128: ; multipy B,C,H,& L by 128 MOV A,B ANA A RAR ; we can only use lowest bit MOV A,C RAR MOV B,A MOV A,H RAR MOV C,A MOV A,L RAR MOV H,A MVI A,0 RAR MOV L,A RET ;------; SHOWBLK: ; menu 1 option 1 Display DPB statistics ;------; LDA DEF$DSK ADI 'A' STA SDBDSK CALL MAKEHEX CALL MAKEDEC CALL MAKEMAX CALL MAKEDIR CALL MAKEDAT CALL MAKETOT LXI D,SDBMSG MVI C,9 ; BDOS: PRINT STRING CALL BDOS CALL WAITCR RET DSEG SDBMSG: DB CR, ' DRIVE ' SDBDSK: DB 'A: DISC PARAMETER BLOCK' DB CR,LF DB CR,LF,' ' DB ' 0 1 2 3 4 5 6 7 8' DB ' 9 10 11 12 13 14 15 16 ' DB CR,LF,'DPB: ' SDBBYT: DB ' 00h 00h 00h 00h 00h 00h 00h 00h 00h' DB ' 00h 00h 00h 00h 00h 00h 00h 00h' DB CR,LF DB CR,LF,' ' DB ' SPT BSH BLM EXM DSM DRM ' DB 'AL0-AL1 CKS OFF PSH PHM' DB CR,LF,'DPB(HEX):' SDBHEX: DB ' 0000h 00h 00h 00h 0000h 0000h ' DB '00h 00h 0000h 0000h 00h 00h' DB CR,LF,'DPB(DEC):' SDBDEC: DB ' 65535 255 255 255 65535 65535 ' DB '255 255 65535 65535 255 255' DB CR,LF DB CR,LF,' BLOCK EXTENT ' DB ' MAX DISK DIRECTORY CHECK SUM SECTOR' DB CR,LF,' ' DB 'SIZE (K) FOLDS SIZE (K) ENTRIES' DB ' ENTRIES SIZE' DB CR,LF,'DPB(DEC): ' SDBMAX: DB ' 16K 15 1048576 65536 ' DB ' 65536 32768' SDBERR: DB CR,LF,'' DB CR,LF DB CR,LF,'ALLOCATION OF DISK BLOCKS' DB CR,LF,' Data 1K 128 byte ' DB CR,LF,' Blocks Blocks Records ' DB ' Capacity' DB LF SDBDIR: DB CR,LF,' Directory 65535 16777215 16777215 ' DB ' 16777215 Entries' SDBDAT: DB CR,LF,' Data 65535 16777215 16777215 ' DB '4294967296 Bytes' DB CR,LF,' -------- -------- --------' SDBTOT: DB CR,LF,' 65000 16777215 16777215' DB LF DB '$' CSEG ;------; MAKEDPH3: ; menu 1 option 2 Display DPH statistics ;------; ; ' 0 1 2 3 4 5 6 7 8 9 10 11 ' ;s3byt1 ' 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h ' ; ' 12 13 14 15 16 17 18 19 20 21 22 23 24 ' ;s3byt2 ' 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h ' ; ' XLT -0- -0- -0- -0- -0- -0- -0- -0- -0- MF ' ;s3hex1 ' 0000h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h ' ; ' DPB CSV ALV DIRBCB DTABCB HASH HBANK' ;s3hex2 ' 0000h 0000h 0000h 0000h 0000h 0000h 00h ' LXI H,S3BYT1 SHLD POSN LXI H,DPH3 MVI B,12 CALL HEXBYT PUSH H LXI H,S3BYT2 SHLD POSN POP H MVI B,13 CALL HEXBYT LXI H,S3HEX1 SHLD POSN LXI H,DPH3 LXI D,H3TYPE MVI B,12 CALL HEXTBL PUSH H LXI H,S3HEX2 SHLD POSN POP H MVI B,13 CALL HEXTBL RET DSEG H3TYPE: DB 2,1,1,1,1,1,1,1,1,1,1 DB 2,2,2,2,2,2,1 CSEG ;------; MAKEDPH2: ; menu 1 option 2 Display DPH statistics ;------; ; ' 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ' ;s2byt ' 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h ' ; ' XLT -0- -0- -0- -0- -0- -0- DIRBCB DPB CSV ALV ' ;s2hex ' 0000h 00h 00h 00h 00h 00h 00h 0000h 0000h 0000h 0000h ' LXI H,S2BYT SHLD POSN LXI H,DPH2 MVI B,16 CALL HEXBYT LXI H,S2HEX SHLD POSN LXI H,DPH2 LXI D,H2TYPE MVI B,16 CALL HEXTBL RET DSEG H2TYPE: DB 2,1,1,1,1,1,1,2,2,2,2 ; 11 fields CSEG RET ;------; SHOWHDR: ; menu 1 option 2 Display DPH statistics ;------; LDA VERS$REL CPI 31H CZ OUTDPH3 LDA VERS$REL CPI 22H CZ OUTDPH2 LDA VERS$REL ; [1.1] Add a stub for MP/M. CPI 30H CZ OUTDPHM RET ;------; OUTDPH3: ; menu 1 option 2 Display DPH statistics ;------; LDA DEF$DSK ADI 'A' STA SH3DSK CALL MAKEDPH3 LXI D,SH3MSG MVI C,9 ; BDOS: PRINT STRING CALL BDOS CALL WAITCR RET DSEG SH3MSG: DB CR,' DRIVE ' SH3DSK: DB 'A: DISK PARAMETER HEADER' DB CR,LF DB CR,LF,' ' DB ' 0 1 2 3 4 5 6 7 8 9 10 11 ' DB CR,LF,'DPH(HEX):' S3BYT1: DB ' 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h ' DB CR,LF DB CR,LF,' ' DB ' 12 13 14 15 16 17 18 19 20 21 22 23 24 ' DB CR,LF,'DPH(HEX):' S3BYT2: DB ' 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h ' DB CR,LF DB CR,LF,' ' DB ' XLT -0- -0- -0- -0- -0- -0- -0- -0- -0- MF ' DB CR,LF,'DPH(HEX):' S3HEX1: DB ' 0000h 00h 00h 00h 00h 00h 00h 00h 00h 00h 00h ' DB CR,LF DB CR,LF,' ' DB ' DPB CSV ALV DIRBCB DTABCB HASH HBANK' DB CR,LF,'DPH(HEX):' S3HEX2: DB ' 0000h 0000h 0000h 0000h 0000h 0000h 00h ' DB CR,LF DB LF,LF,LF,LF,LF,LF,LF,LF DB '$' CSEG ;------; OUTDPH2: ; menu 1 option 2 Display DPH statistics ;------; LDA DEF$DSK ADI 'A' STA SH2DSK CALL MAKEDPH2 LXI D,SH2MSG MVI C,9 ; BDOS: PRINT STRING CALL BDOS CALL WAITCR RET DSEG SH2MSG: DB CR,' DRIVE ' SH2DSK: DB 'A: DISK PARAMETER HEADER' DB CR,LF DB CR,LF,' ' DB ' 0 1 2 3 4 5 6 7' DB ' 8 9 10 11 12 13 14 15 ' DB CR,LF,'DPH(HEX):' S2BYT: DB ' 00h 00h 00h 00h 00h 00h 00h 00h ' DB '00h 00h 00h 00h 00h 00h 00h 00h ' DB CR,LF DB CR,LF,' ' DB ' XLT -0- -0- -0- -0- -0- -0- DIRBCB DPB CSV ' DB 'ALV ' DB CR,LF,'DPH(HEX):' S2HEX: DB ' 0000h 00h 00h 00h 00h 00h 00h 0000h 0000h 0000h ' DB '0000h ' DB CR,LF,LF,LF,LF,LF,LF,LF DB LF,LF,LF,LF,LF,LF,LF,LF DB '$' CSEG ;------; OUTDPHM: ; menu 1 option 2 Display DPH statistics ;------; LDA DEF$DSK ADI 'A' STA SHMDSK LXI D,SHMMSG MVI C,9 ; BDOS: PRINT STRING CALL BDOS CALL WAITCR RET DSEG SHMMSG: DB CR,' DRIVE ' SHMDSK: DB 'A: DISK PARAMETER HEADER' DB CR,LF DB CR,LF DB ' ', CR,LF DB ' * * * U N A B L E T O D I S P L A Y ' DB 'U N D E R M P / M II * * *' DB CR,LF DB CR,LF DB ' ' DB CR,LF DB CR,LF DB LF,LF,LF,LF,LF,LF,LF DB LF,LF,LF,LF,LF,LF,LF DB '$' CSEG PAGE ; -------------------------------------------- ; ; utilities used in allocation vector analysis ; ; -------------------------------------------- ; DSEG LENALV: DS 2 ; length of allocation vector in bytes ALVDIR: DS 2 ; datablocks allocated to directory ALVDAT: DS 2 ; datablocks allocated to data ALVZRO: DS 2 ; datablocks not allocated ALVERA: DS 2 ; datablocks allocated to erased data ALVLST: DS 2 ; datablocks allocated to overwritten data ALVBAD: DS 2 ; datablocks with duplicated data access ALVRNG: DS 2 ; datablocks outside maximum number ALVLEN EQU $-LENALV USER: DB 0 ; save user number CSEG ;--; ALV: ; return <HL> = <HL>/8, & <C> = <HL> mod 7 ;--; MVI C,0 CALL ALV1 ; /2 CALL ALV1 ; /4 CALL ALV1 ; /8 MOV A,C RLC RLC RLC MOV C,A RET ALV1: MOV A,H ANA A RAR MOV H,A MOV A,L RAR MOV L,A ; <HL> = <HL> / 2 MOV A,C RAR MOV C,A ; C contains lost bits RET TSTBIT: ; tst bit number <C> at offset <HL> from ALLOC ; return CF=NZ if bit already set PUSH B PUSH H LXI H,BITMAP MVI B,0 DAD B MOV A,M ; bit to set LXI B,ALLOC POP H PUSH H DAD B MOV B,A ; save bit to set MOV A,M ANA B ; test if bit set POP H POP B RET ; 0 = if not set, > 0 if set SETBIT: ; set bit number <C> at offset <HL> from ALLOC ; return CF=NZ if bit already set PUSH B PUSH H LXI H,BITMAP MVI B,0 DAD B MOV A,M ; bit to set LXI B,ALLOC POP H PUSH H DAD B MOV B,A ; save bit to set MOV A,M MOV C,A ; save byte before setting bit ORA B MOV M,A ; set bit MOV A,C ANA B ; test if bit set POP H POP B RET ; 0 = if not set, > 0 if set BITMAP: DB 10000000B ; 0 DB 01000000B ; 1 DB 00100000B ; 2 DB 00010000B ; 3 DB 00001000B ; 4 DB 00000100B ; 5 DB 00000010B ; 6 DB 00000001B ; 7 UPDAT: JNZ ERRBIT ; bit already set PUSH H LHLD ALVDAT INX H SHLD ALVDAT ; increment count of data POP H RET ERRBIT: ; flag bit already set PUSH H LHLD ALVBAD INX H SHLD ALVBAD ; increment count of duplicate data POP H RET UPERA: JNZ LSTBIT ; bit already set PUSH H LHLD ALVERA INX H SHLD ALVERA ; increment count of erased data POP H RET LSTBIT: PUSH H LHLD ALVLST INX H SHLD ALVLST ; increment count of overwritten data POP H RET UPRNG: PUSH H LHLD ALVRNG INX H SHLD ALVRNG ; increment count of blocks outside range POP H RET ; ; [1.1] Ability to render the first 256 bytes of the allocation vector ; graphically ; RENDER$ALV: PUSH PSW CALL ALV$LENGTH MOV B,C ; B = length of ALV LXI H,0 ; RENDER$ALV$LOOP: PUSH H CALL ALV ; Locate the bit CALL TSTBIT ; Read it POP H JZ ALV$NEXT ; If the bit is zero, don't paint XCHG MOV A,E ANI 0C0H RLC RLC RLC ; A = row number, 0-3 LXI H,ALV$TXT ADD L MOV L,A MVI A,0 ADC H MOV H,A ; ADD HL,A MOV A,M INX H MOV H,M MOV L,A ; LD HL,(HL) MOV A,E ANI 3FH ; A = column number, 0-63 ADD L MOV L,A MVI A,0 ADC H MOV H,A LDA DOT ; If there isn't a dot there, it must have CMP M ; been populated by a previous pass XCHG JNZ ALV$NEXT POP PSW STAX D ; Write the character requested PUSH PSW ALV$NEXT: INX H DCR B JNZ RENDER$ALV$LOOP ;;; # DJNZ RENDER$ALV_LOOP POP PSW RET ; ; The four lines of the graphical ALV map ; ALV$TXT: DW ALV11 DW ALV12 DW ALV13 DW ALV14 ; ; Initialise the graphical display of the allocation vector. ; ALV$BLANK: LXI H, ALV11 ; Zap the first line CALL BLANK64 LXI H, ALV12 ; Second line CALL BLANK64 LXI H, ALV13 ; Third line CALL BLANK64 LXI H, ALV14 ; Fourth line CALL BLANK64 LHLD DPB$DSM CALL ALV$LENGTH ; Fill up to the number of blocks LXI H, ALV11 ; on the disk with '.' LDA DOT CALL ALV$FILL RZ LXI H, ALV12 CALL ALV$FILL RZ LXI H, ALV13 CALL ALV$FILL RZ LXI H, ALV14 CALL ALV$FILL RET ; ; Blank one row of the ALV display buffer: 64 characters at HL. ; BLANK64: MVI B,64 ; Write 64 blanks at HL. BLANK64A: MVI M,' ' INX H ;;; # DJNZ BLANK64A DCR B JNZ BLANK64A RET ; ; Write the lesser of C and 64 copies of A at HL. ; ALV$FILL: MVI B,64 ALV$FILL1: MOV M,A INX H DCR C RZ ;;; # DJNZ ALV$FILL1 DCR B JNZ ALV$FILL1 ORA A RET ; ; Given HL = (number of blocks on the disk - 1), return C = number of blocks ; to display (with 0 => 256). ; ALV$LENGTH: MOV A,H MVI C,0 ORA A ; If H is nonzero return C = 0 RNZ MOV C,L ; Otherwise return C = L+1 INR C RET ; ; [End of 1.1 helper functions] ; ;------; SHOWALV: ; menu 1 option 3 Display disk ALLOCATION ;------; LDA DEF$DSK ADI 'A' STA SALDSK LXI H,LENALV ; start of datablock counts MOV D,H MOV E,L INX D LXI B,ALVLEN-1 ; length of datablock counts MVI M,0 ;;; # LDIR CALL LDIR ; and zero all LHLD DPB$DSM ; number of data blocks less 1 CALL ALV ; return <HL> = <HL>/8, & <C> = <HL> mod 7 INX H SHLD LENALV ; length of ALV in bytes LXI D,ALLOC ; start of ALV DAD D ; end of ALV XCHG LHLD BDOS+1 ; base of BDOS DCX H ANA A ;;; # SBC HL,DE ; <HL> = top of TPA - top of ALLOC MOV A,L SUB E MOV L,A MOV A,H SBB D MOV H,A JNC ALVOK LXI D,ALVERR MVI C,9 ; BDOS: PRINT STRING CALL BDOS JMP WAITCR ; wait for <RETURN> then return DSEG ALVERR: DB CR,LF,'TPA too small for allocation vector','$' CSEG ; ---------------------------- ; ; initialise allocation vector ; ; ---------------------------- ; ALVOK: CALL ALV$BLANK ; [1.1] Initialise ALV map LHLD LENALV MOV B,H MOV C,L LXI H,ALLOC MOV D,H MOV E,L INX D DCX B MVI M,0 ;;; # LDIR ; set allocation vector to 0 CALL LDIR LHLD DPB$AL0 ; directory ALV0 and ALV1 SHLD ALLOC ; and fill alloc bits with these LXI H,7 ; ??? render_alv overwrites HL LDA BLOCK CALL RENDER$ALV ; Fill graphical ALV with directory blocks ; ----------------------- ; ; count directory entries ; ; ----------------------- ; MVI B,16 LXI D,0 CNTALV: DAD H JNC NOCNT INX D NOCNT: DCR B JNZ CNTALV ;;; # DJNZ CNTALV XCHG SHLD ALVDIR ; number of directory entries ; -------------- ; ; scan directory ; ; -------------- ; LXI D,DEFFCB MVI A,'?' STAX D MVI C,17 ; BDOS: SEARCH FOR FIRST CALL BDOS NEXTDIR: CPI -1 JZ DOERA MOV L,A MVI H,0 DAD H DAD H DAD H DAD H DAD H LXI D,DEFDMA DAD D MOV A,M ANI NOT 00011111B ; test for high bits set JNZ NXTDCB LXI D,16 DAD D XCHG ; <DE> -> first data block allocation LHLD DPB$DSM MOV A,H ORA A JNZ WRDALV ; test 16 file data block bytes MVI B,16 ; byte wide data blocks NXTDB: PUSH H LDAX D ORA A JZ NULDB CMP L ; check range JZ UPDB JNC ERRDB UPDB: MOV L,A MVI H,0 CALL ALV ; return <HL> = <HL>/8, <C>=MOD(<HL>,7) CALL SETBIT ; returns CF=NZ if bit already set CALL UPDAT JMP NULDB ERRDB: CALL UPRNG ; data block outside range NULDB: POP H ; recover DSM INX D ; increment to next data block allocation DCR B JNZ NXTDB ;;; # DJNZ NXTDB JMP NXTDCB ; test 8 file data block words WRDALV: XCHG ; move back to HL MVI B,8 NXTDW: PUSH H MOV E,M INX H MOV D,M MOV A,E ORA D JZ NULDW LHLD DPB$DSM XRA A ;;; # SBC HL,DE MOV A,L SUB E MOV L,A MOV A,H SBB D MOV H,A JC ERRDW XCHG CALL ALV ; return <HL> = <HL>/8, <C>=MOD(<HL>,7) CALL SETBIT ; returns CF=NZ if bit already set CALL UPDAT JMP NULDW ERRDW: CALL UPRNG ; data block outside range NULDW: POP H ; recover data block pointer INX H INX H ; increment to next data block allocation ;;; # DJNZ NXTDW DCR B JNZ NXTDW JMP NXTDCB NXTDCB: LXI D,DEFFCB XRA A STAX D ; set default drive MVI C,18 ; BDOS: SEARCH FOR NEXT CALL BDOS JMP NEXTDIR ; -------------- ; ; scan era files ; ; -------------- ; ERABYT EQU 0E5H ; CP/M byte for erased file DOERA: LHLD DPB$DSM ; Populate data blocks with '+' LDA SOLID CALL RENDER$ALV MVI E,-1 ; to fetch user code MVI C,32 ; BDOS: SET/GET USER CODE CALL BDOS STA USER ; save user number MVI E,5 ; set user = 5 MVI C,32 ; BDOS: SET/GET USER CODE CALL BDOS LXI D,DEFFCB MVI A,'?' STAX D MVI C,17 ; BDOS: SEARCH FOR FIRST CALL BDOS NEXTERA: CPI -1 JZ ERASED MOV L,A MVI H,0 DAD H DAD H DAD H DAD H DAD H LXI D,DEFDMA DAD D MOV A,M ANI NOT 00011111B ; test for high bits set JZ NXTERA MOV A,M CPI ERABYT JNZ NXTERA PUSH H MVI B,32 TSTERA: MOV A,M CPI ERABYT JNZ NOTERA INX H DCR B JNZ TSTERA ;;;# DJNZ TSTERA ; (doesnt change flags) NOTERA: POP H JZ ERASED1 ; as all 0e5's must be at end LXI D,16 DAD D XCHG ; <DE> -> first data block allocation LHLD DPB$DSM MOV A,H ORA A JNZ WRDERA ; test 16 erased file data block bytes MVI B,16 NXTEDB: PUSH H ; save DSM LDAX D ORA A JZ NULEDB CMP L ; check range JZ UPEDB JNC ERREDB UPEDB: MOV L,A MVI H,0 CALL ALV ; return <HL> = <HL>/8, <C>=MOD(<HL>,7) CALL SETBIT ; returns CF=NZ if bit already set CALL UPERA JMP NULEDB ERREDB: CALL UPRNG ; data block outside range NULEDB: POP H ; recover DSM INX D ; increment to next data block byte ;;; # DJNZ NXTEDB DCR B JNZ NXTEDB JMP NXTERA ; test 8 erased file data block words WRDERA: XCHG ; move back to HL MVI B,8 NXTEDW: PUSH H MOV E,M INX H MOV D,M MOV A,E ORA D JZ NULEDW LHLD DPB$DSM XRA A MOV A,L SUB E MOV L,A MOV A,H SBB D MOV H,A ;;; # SBC HL,DE JC ERREDW XCHG CALL ALV ; return <HL> = <HL>/8, <C>=MOD(<HL>,7) CALL SETBIT ; returns CF=NZ if bit already set CALL UPERA JMP NULEDW ERREDW: CALL UPRNG ; data block outside range NULEDW: POP H ; recover data block pointer INX H INX H ; increment to next data block word ;;; # DJNZ NXTEDW DCR B JNZ NXTEDW NXTERA: LXI D,DEFFCB MVI A,ERABYT AND 11100000B ; ignore water mark, STAX D ; (only works when user=5) MVI C,18 ; BDOS: SEARCH FOR NEXT CALL BDOS JMP NEXTERA ERASED: ; reached end of file LHLD DPB$DSM ; Populate erased blocks with '+' LDA HOLLOW CALL RENDER$ALV ERASED1: LDA USER ; recover user number MOV E,A MVI C,32 ; BDOS: SET/GET USER CODE CALL BDOS ; --------------------------- ; ; calculate unused datablocks ; ; --------------------------- ; LHLD LENALV MOV B,H MOV C,L LHLD DPB$DSM LXI D,ALLOC NXTCNT: PUSH B LDAX D MVI B,8 NEXT8: ADD A JNC NOTALC DCX H ; reduce count by 1 NOTALC: DCR B JNZ NEXT8 ;;; # DJNZ NEXT8 INX D POP B DCX B MOV A,B ORA C JNZ NXTCNT INX H ; as started with dsm, not dsm+1 SHLD ALVZRO ; ---------------------- ; ; fill text with results ; ; ---------------------- ; LXI H,ALV01 SHLD POSN XRA A LHLD DPB$DSM LXI D,1 DAD D ACI 0 MVI C,0 CALL MEGDEC ; write total number of datablocks LXI H,ALV02 SHLD POSN LHLD ALVDIR ; datablocks allocated to directory CALL WRDDEC LXI H,ALV03 SHLD POSN LHLD ALVDAT ; datablocks allocated to data CALL WRDDEC LXI H,ALV04 SHLD POSN LHLD ALVERA ; datablocks allocated to erased data CALL WRDDEC LXI H,ALV05 SHLD POSN LHLD ALVLST ; datablocks allocated to overwritten data CALL WRDDEC LXI H,ALV06 SHLD POSN LHLD ALVBAD ; datablocks with duplicated data access CALL WRDDEC LXI H,ALV07 SHLD POSN LHLD ALVZRO ; datablocks not allocated CALL WRDDEC LXI H,ALV08 SHLD POSN LHLD ALVDIR XRA A MOV C,A XCHG LHLD ALVDAT DAD D ADC C XCHG LHLD ALVERA DAD D ADC C XCHG LHLD ALVZRO DAD D ADC C MOV C,A CALL MEGDEC LXI H,ALV09 SHLD POSN LHLD ALVRNG ; datablocks with duplicated data access CALL WRDDEC ; ------------ ; ; display text ; ; ------------ ; LXI D,SALMSG MVI C,9 ; BDOS: PRINT STRING CALL BDOS JMP WAITCR ; wait for <RETURN> then return DSEG SALMSG: DB CR,' DRIVE ' SALDSK: DB 'A: DISK ALLOCATION' DB CR,LF ; ; [1.1] Reformatted into two columns to make room for the graphical ; allocation map. ; DB CR,LF,' DATA BLOCKS ' DB CR,LF DB CR,LF,' TOTAL (DRM+1) ' ALV01: DB ' 65536 ' DB CR,LF DB CR,LF,' Directory ' ALV02: DB ' 16 ' DB CR,LF,' Data ' ALV03: DB ' 65535 ' DB ' Duplicated data ' ALV06: DB ' 65535 ' DB CR,LF,' Erased and recoverable ' ALV04: DB ' 65535 ' DB ' Erased and reused ' ALV05: DB ' 65535 ' DB CR,LF,' Unused ' ALV07: DB ' 65535 ' DB ' Blocks outside range ' ALV09: DB ' 65535 ' DB CR,LF,' ' DB ' ----- ' DB CR,LF, ' ' ALV08: DB ' 65536 ' DB CR,LF,LF ; ; [1.1] Display allocation ; DB ' ---- Display of data block allocation ' DB '(first 256 bits only) ----' DB CR,LF,' ' DB '0....5...10...15...20...25...30...35...40...45...50...55...60...' DB CR,LF DB ' 0 ' ALV11: DB ' ' DB ' ' DB CR,LF DB ' 64 ' ALV12: DB ' ' DB ' ' DB CR,LF DB '128 ' ALV13: DB ' ' DB ' ' DB CR,LF DB '196 ' ALV14: DB ' ' DB ' ' DB CR,LF DB '256 ' BLOCK1: DB '# Directory ' SOLID1: DB '+ Data block ' HOLLO1: DB '- Erased block ' DOT1: DB '. Unused ' DB CR,LF,LF,LF DB '$' CSEG ;------; SHOWFIL: ; menu 1 option 4 Display file ALLOCATION ;------; LDA DEF$DSK ADI 'A' STA SFLDSK LXI D,SFLMSG MVI C,9 ; BDOS: PRINT STRING JMP BDOS ; & RETURN DSEG SFLMSG: DB CR,' DRIVE ' SFLDSK: DB 'A: FILE ALLOCATION' DB LF DB CR,LF,LF,LF,LF,LF,'$' ; 10 line feeds CSEG ;------; SHOWDIR: ; menu 1 option 5 Display directory ALLOCATION ;------; LDA DEF$DSK ADI 'A' STA SDRDSK LXI D,SDRMSG MVI C,9 ; BDOS: PRINT STRING JMP BDOS ; & RETURN DSEG SDRMSG: DB CR,' DRIVE ' SDRDSK: DB 'A: DIRECTORY ALLOCATION' DB LF DB CR,LF,LF,LF,LF,LF,'$' ; 10 line feeds CSEG PAGE ;-----; SELECT: ; menu 1 option 9 Select new disk ;-----; LDA DEF$DSK STA OLDDSK ; save in case of error CALL CLEARSCRN LXI D,SLDMSG MVI C,9 ; BDOS: PRINT STRING CALL BDOS ; ---------------------- ; ; Request new drive name ; ; ---------------------- ; SEL0: LXI D,LOGMSG MVI C,9 ; BDOS: PRINT STRING CALL BDOS LXI D,SELBUFF MVI C,10 ; BDOS: DIRECT CONSOLE BUFFER CALL BDOS LDA SELLEN ORA A RZ ; nothing selected CPI 1 JZ SEL1 CPI 2 JNZ SEL0 LDA SELDB2 CPI ':' JNZ SEL0 SEL1: LDA SELDB1 CPI 'a' JC SEL2 CPI 'z'+1 JNC SEL0 ADI 'A'-'a' ; convert to lower case SEL2: SUI 'A' CPI 15+1 JNC SEL0 ; outside range 0-15 STA DEF$DSK ; Current selected disk MVI C,13 ; BDOS: RESET DISK SYSTEM CALL BDOS LDA DEF$DSK MOV E,A MVI C,14 ; BDOS: SELECT DISK CALL BDOS ORA A JNZ SELERR CALL FETCHDP ; fetch dpb and dph for drive RET SELERR: LDA OLDDSK ; recover previously selecte disk STA DEF$DSK MOV E,A MVI C,14 ; BDOS: SELECT DISK CALL BDOS ORA A JNZ BADSEL CALL FETCHDP ; fetch dpb and dph for drive LXI D,OLDMSG MVI C,9 ; BDOS: PRINT STRING CALL BDOS CALL WAITCR RET DSEG SLDMSG: DB CR,' SELECT NEW DISK' DB LF DB CR,LF,LF,LF,LF,LF,'$' ; 5 line feeds OLDDSK: DB 0 LOGMSG: DB CR,'Enter drive name (A:, B:, etc ) ? ',BS,BS,BS,'$' SELBUFF: DB 3 SELLEN: DS 1 SELDB1: DS 1 SELDB2: DS 2 OLDMSG: DB CR,LF,'--- Unable to select new disk ---' DB CR,LF,LF,LF,LF,LF,'$' ; 5 line feeds CSEG PAGE ;-------; GOODVERS: ;-------; LDA DEFFCB DCR A CPI -1 JNZ USECCP ; use ccp disk MVI C,25 ; BDOS: RETURN CURRENT DISK CALL BDOS USECCP: STA DEF$DSK ; Current selected disk MVI C,13 ; BDOS: RESET DISK SYSTEM CALL BDOS LDA DEF$DSK MOV E,A MVI C,14 ; BDOS: SELECT DISK CALL BDOS ORA A JNZ BADSEL ;;; # LD (SAVESP),SP ; must use local stack as BIOS may be hungry LXI H,0 DAD SP SHLD SAVESP LXI SP,SAVESP CALL FETCHDP ; fetch dpb and dph for drive CALL MAIN ; now display as requested ;;; # LD SP,(SAVESP) LHLD SAVESP SPHL MVI C,0 ; BDOS: SYSTEM RESET JMP BDOS ; & exit ;---; MAIN: ;---; CALL CLEARSCRN ; clear screen CALL SCREEN1 ; display menu CALL OPTION ; request option CPI -1 RZ CALL TASK1 JMP MAIN ;----; TASK1: ;----; MOV C,A MVI B,0 DCX B LXI H,TABLE1 DAD B DAD B MOV A,M INX H MOV H,M MOV L,A PCHL TABLE1: DW SHOWBLK ; menu 1 option 1 Display DPB statistics DW SHOWHDR ; menu 1 option 2 Display DPH statistics DW SHOWALV ; menu 1 option 3 Display disk ALLOCATION DW SHOWFIL ; menu 1 option 4 Display file ALLOCATION DW SHOWDIR ; menu 1 option 5 Display directory ALLOCATION DW RETURN DW RETURN DW RETURN DW SELECT ; menu 1 option 9 Select new disk RETURN: RET DSEG ALLOC EQU $ ; allocation vector placed at end of program END ; ; ; ; ; Line numbers containing untranslated opcodes: ; ; 00277 00344 00488 00563 00593 00609 00847 00869 00917 00930 ; 01014 01099 01138 01149 01215 01276 01863 01895 01941 01954 ; 01986 02000 02027 02045 02101 02117 02128 02191 02221 02237 ; 02248 02283 02601 02608 ; 
programs/oeis/277/A277808.asm
karttu/loda
1
100357
<reponame>karttu/loda<filename>programs/oeis/277/A277808.asm ; A277808: a(n) = number of iterations of map k -> A003188(A006068(k)/2) that are required (when starting from k = n) until k is an odious number. ; 0,0,1,0,1,2,0,0,1,2,0,3,0,0,1,0,1,2,0,3,0,0,1,4,0,0,1,0,1,2,0,0,1,2,0,3,0,0,1,4,0,0,1,0,1,2,0,5,0,0,1,0,1,2,0,0,1,2,0,3,0,0,1,0,1,2,0,3,0,0,1,4,0,0,1,0,1,2,0,5,0,0,1,0,1,2,0,0,1,2,0,3,0,0,1,6,0,0,1,0,1,2,0,0,1,2,0,3,0,0,1,0,1,2,0,3,0,0,1,4,0,0,1,0,1,2,0,0,1,2,0,3,0,0,1,4,0,0,1,0,1,2,0,5,0,0,1,0,1,2,0,0,1,2,0,3,0,0,1,6,0,0,1,0,1,2,0,0,1,2,0,3,0,0,1,0,1,2,0,3,0,0,1,4,0,0,1,0,1,2,0,7,0,0,1,0,1,2,0,0,1,2,0,3,0,0,1,0,1,2,0,3,0,0,1,4,0,0,1,0,1,2,0,0,1,2,0,3,0,0,1,4,0,0,1,0,1,2,0,5,0,0,1,0,1,2,0,0,1,2 add $0,1 mov $1,$0 cal $1,277822 ; a(n) = index of the column where n is located in array A277880. sub $1,1
aspects/karabiner/files/bin/karabiner-kill.applescript
humpangle/dotfile-wincent
0
3635
<reponame>humpangle/dotfile-wincent<filename>aspects/karabiner/files/bin/karabiner-kill.applescript -- Workaround to enable karabiner-kill to be called from a Karabiner shell_command: -- https://github.com/tekezo/Karabiner-Elements/issues/1573 tell application "Terminal" activate do script "/bin/sh ~/bin/karabiner-kill" end tell
Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_528.asm
ljhsiun2/medusa
9
94477
<filename>Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_528.asm .global s_prepare_buffers s_prepare_buffers: push %r10 push %r12 push %r15 push %rax push %rbp push %rdi push %rdx lea addresses_normal_ht+0x8c50, %r10 nop nop inc %r12 movl $0x61626364, (%r10) nop nop nop xor %rax, %rax lea addresses_normal_ht+0x1c20, %rdi sub $42733, %r12 mov (%rdi), %rdx nop nop nop nop nop mfence lea addresses_WT_ht+0x160db, %rdx nop nop nop nop nop add %r15, %r15 mov (%rdx), %r12w nop sub $45148, %rbp lea addresses_D_ht+0x1da20, %rbp sub $28310, %rax movb (%rbp), %r10b nop nop nop nop cmp %rbp, %rbp pop %rdx pop %rdi pop %rbp pop %rax pop %r15 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r15 push %r9 push %rbx // Faulty Load lea addresses_WC+0x1ae20, %r15 nop nop add $48272, %r10 mov (%r15), %rbx lea oracles, %r11 and $0xff, %rbx shlq $12, %rbx mov (%r11,%rbx,1), %rbx pop %rbx pop %r9 pop %r15 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 32, 'NT': True, 'type': 'addresses_WC'}, 'OP': 'LOAD'} [Faulty Load] {'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 8, 'NT': False, 'type': 'addresses_WC'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_normal_ht'}} {'src': {'congruent': 8, 'AVXalign': False, 'same': False, 'size': 8, 'NT': True, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'} {'src': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
NatTry.agda
divipp/agda-intro-prezi
2
9984
-- Long version, the final version is Nat.agda module NatTry where data ℕ : Set where zero : ℕ suc : ℕ → ℕ one two three four : ℕ one = suc zero two = suc one three = suc two four = suc three _+_ : ℕ → ℕ → ℕ zero + b = b suc a + b = suc (a + b) data Bool : Set where true : Bool false : Bool _≟_ : ℕ → ℕ → Bool zero ≟ zero = true suc a ≟ suc b = a ≟ b _ ≟ _ = false infix 4 _≟_ assocProp : ℕ → ℕ → ℕ → Bool assocProp a b c = (a + b) + c ≟ a + (b + c) reflProp : ℕ → Bool reflProp n = n ≟ n module isTrue-direct where data isTrue : Bool → Set where ok : isTrue true unitTest : isTrue (assocProp one one two) unitTest = ok refl-True : (n : ℕ) → isTrue (reflProp n) refl-True zero = ok refl-True (suc n) = refl-True n assocProp-zero-True : (n m : ℕ) → isTrue (assocProp zero n m) assocProp-zero-True n m = refl-True (n + m) assocProp-True : (n m k : ℕ) → isTrue (assocProp n m k) assocProp-True zero m k = assocProp-zero-True m k assocProp-True (suc n) m k = assocProp-True n m k -------- switch to _≡_ module ≡-Bool where -- propositional equalitiy on Bool data _≡_ : Bool → Bool → Set where refl : {a : Bool} → a ≡ a -- the Bool paramter is hidden infix 4 _≡_ isTrue : Bool → Set isTrue x = x ≡ true -- generic propositional equality data _≡_ {A : Set} : A → A → Set where refl : {a : A} → a ≡ a infix 4 _≡_ -- This is the type of the refl constructor -- The parameters are hidden refl′ : {A : Set} {a : A} → a ≡ a refl′ = refl isTrue : Bool → Set isTrue x = x ≡ true refl-True : (n : ℕ) → isTrue (reflProp n) refl-True zero = refl refl-True (suc n) = refl-True n unitTest : isTrue (assocProp one one two) unitTest = refl assocProp-zero-True : (n m : ℕ) → isTrue (assocProp zero n m) assocProp-zero-True n m = refl-True (n + m) assocProp-True : (n m k : ℕ) → isTrue (assocProp n m k) assocProp-True zero m k = assocProp-zero-True m k assocProp-True (suc n) m k = assocProp-True n m k ---- switch from _≟_ cong : {A B : Set} {a b : A} (f : A → B) → a ≡ b → f a ≡ f b cong f refl = refl cong-suc : {a b : ℕ} → a ≡ b → suc a ≡ suc b cong-suc = cong suc ≡-to-≟ : {a b : ℕ} → a ≡ b → isTrue (a ≟ b) ≡-to-≟ {a} refl = refl-True a ≟-to-≡ : (a b : ℕ) → isTrue (a ≟ b) → a ≡ b ≟-to-≡ zero zero i = refl ≟-to-≡ zero (suc b) () ≟-to-≡ (suc a) zero () ≟-to-≡ (suc a) (suc b) i = cong-suc (≟-to-≡ a b i) -- the rest is in Nat.agda
Bve5_Parsing/ScenarioGrammar/ANTLR_SyntaxDefinitions/ScenarioGrammarParser.g4
aoisupersix/IronyTest
5
5470
/* * ScenarioGrammarのANTLR構文定義ファイルです */ parser grammar ScenarioGrammarParser; options{ tokenVocab=ScenarioGrammarLexer; } root : BVETS SCENARIO VERSION ( SELECT_ENCODE encoding ENCODE_END?)? statement* EOF ; statement : stateName=ROUTE PATH_EQUAL (weight_path (SECTION weight_path)*)? (INPUT_PATH_END | PATH_END)? #routeState | stateName=VEHICLE PATH_EQUAL (weight_path (SECTION weight_path)*)? (INPUT_PATH_END | PATH_END)? #vehicleState | stateName=TITLE EQUAL string INPUT_TEXT_END? #titleState | stateName=IMAGE EQUAL string INPUT_TEXT_END? #imageState | stateName=ROUTETITLE EQUAL string INPUT_TEXT_END? #routeTitleState | stateName=VEHICLETITLE EQUAL string INPUT_TEXT_END? #vehicleTitleState | stateName=AUTHOR EQUAL string INPUT_TEXT_END? #authorState | stateName=COMMENT EQUAL string INPUT_TEXT_END? #commentState ; encoding returns [string text]: v=encode_string {$text = $v.text; } ; encode_string : ENCODE_CHAR* ; weight_path : path=FILE_PATH (ASTERISK NUM)? ; string : INPUT_TEXT_CHAR* ;
Listas/00 - Assembly/ex04.asm
LFMP/ARQ1
2
17132
<gh_stars>1-10 BITS 64 extern printf section .data fmt1 db "Somatorio = %d", 10, 0 section .text global main main: mov rbp, rsp; for correct debugging push 2 call somatorio add rsp, 8 jmp end somatorio: push rbp mov rbp, rsp sub rsp,8 mov qword [RBP-8],1 mov qword [RBP-16],1 ; "i" mov rax,0 mov rbx,1 jmp comp multip: add rax,rbx inc rbx mov [RBP-8], rax mov [RBP-16], rbx comp: cmp rbx, [RBP+16] jbe multip mov rsp, rbp pop rbp ret end: mov rsi, rax mov rdi, fmt1 xor rax, rax call printf ret
oeis/142/A142316.asm
neoneye/loda-programs
11
95547
<reponame>neoneye/loda-programs<filename>oeis/142/A142316.asm ; A142316: Primes congruent to 8 mod 45. ; Submitted by <NAME> ; 53,233,503,593,683,773,863,953,1223,1493,1583,2213,2393,2663,2753,2843,3023,3203,3833,3923,4013,4283,4373,4463,4643,4733,5003,5273,5813,5903,6173,6263,6353,6803,6983,7253,7433,7523,7703,7793,7883,8243,8423,8513,8693,8783,8963,9323,9413,10133,10223,10313,10853,11213,11393,11483,11933,12113,12203,12473,12653,12743,12923,13103,13463,13553,13913,14543,14633,14723,14813,15083,15173,15263,15443,15803,16073,16253,16433,16703,16883,17333,17783,18143,18233,18413,18503,18593,18773,19403,19583,19763,19853 mov $1,42 mov $2,$0 add $2,2 pow $2,2 lpb $2 sub $1,16 sub $2,1 mov $3,$1 mul $3,2 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 add $1,61 mov $4,$0 max $4,0 cmp $4,$0 mul $2,$4 lpe mov $0,$1 mul $0,2 sub $0,121
oeis/054/A054479.asm
neoneye/loda-programs
11
1579
; A054479: Number of sets of cycle graphs of 2n nodes where the 2-colored edges alternate colors. ; Submitted by <NAME> ; 1,0,6,120,6300,514080,62785800,10676746080,2413521910800,700039083744000,253445583029839200,112033456760809584000,59382041886244720843200,37175286835046004765120000,27139206193305890195912400000,22852066417535931447551359680000,21984366159341876104806521930400000,23963575910509477418542728468986880000,29379981392583633602701598994301195200000,40251317123869351796050991861633360352000000,61263473877255310326718109418194151779260800000,103046571401941392676693120885308478646101632000000 mov $1,1 lpb $0 mov $2,$3 add $3,$1 mov $1,$0 sub $0,1 add $1,$0 mul $3,2 mul $3,$1 mul $1,$2 mul $3,$0 lpe mov $0,$1
programs/oeis/167/A167562.asm
neoneye/loda
22
14106
; A167562: The fifth row of the ED2 array A167560. ; 120,480,1344,3072,6144,11160,18840,30024,45672,66864,94800,130800,176304,232872,302184,386040,486360,605184,744672,907104,1094880,1310520,1556664,1836072,2151624,2506320,2903280,3345744,3837072,4380744,4980360,5639640,6362424,7152672,8014464,8952000,9969600,11071704,12262872,13547784,14931240,16418160,18013584,19722672,21550704,23503080,25585320,27803064,30162072,32668224,35327520,38146080,41130144,44286072,47620344,51139560,54850440,58759824,62874672,67202064,71749200,76523400,81532104,86782872,92283384,98041440,104064960,110361984,116940672,123809304,130976280,138450120,146239464,154353072,162799824,171588720,180728880,190229544,200100072,210349944,220988760,232026240,243472224,255336672,267629664,280361400,293542200,307182504,321292872,335883984,350966640,366551760,382650384,399273672,416432904,434139480,452404920,471240864,490659072,510671424 mov $7,$0 mul $0,2 add $0,9 mov $4,$0 sub $0,3 mov $1,1 sub $4,1 lpb $0 sub $0,1 trn $2,5 add $2,$1 add $1,$4 add $2,2 lpe add $1,$2 sub $1,44 mov $3,56 mov $8,$7 lpb $3 add $1,$8 sub $3,1 lpe mov $5,$7 lpb $5 sub $5,1 add $6,$8 lpe mov $3,85 mov $8,$6 lpb $3 add $1,$8 sub $3,1 lpe mov $5,$7 mov $6,0 lpb $5 sub $5,1 add $6,$8 lpe mov $3,26 mov $8,$6 lpb $3 add $1,$8 sub $3,1 lpe mov $5,$7 mov $6,0 lpb $5 sub $5,1 add $6,$8 lpe mov $3,5 mov $8,$6 lpb $3 add $1,$8 sub $3,1 lpe mov $0,$1
MuCalculus.g4
LuukvH/ModelChecker
0
5970
grammar MuCalculus; formulae : mfalse | mtrue | endrecursion | conjunction | disjunction | diamond | box | leastfixpoint | greatestfixpoint; conjunction : '(' left '&&' right ')'; disjunction : '(' left '||' right ')'; diamond : '<' label '>' formulae; box : '[' label ']' formulae; leastfixpoint : 'mu' startrecursion '.' formulae; greatestfixpoint : 'nu' startrecursion '.' formulae; left : formulae; right : formulae; label : STRING; mfalse : FALSE; mtrue : TRUE; startrecursion : RECURSIONVARIABLE; endrecursion : RECURSIONVARIABLE; FALSE : 'false'; TRUE : 'true'; NUMBER : [0-9]+; STRING : [a-z0-9]+; RECURSIONVARIABLE : [A-Z]; WHITESPACE : ( '\t' | ' ' | '\r' | '\n'| '\u000C' )+ -> skip;
libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_iy/log10.asm
meesokim/z88dk
0
7572
SECTION code_fp_math48 PUBLIC _log10 EXTERN cm48_sdcciy_log10 defc _log10 = cm48_sdcciy_log10
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_119.asm
ljhsiun2/medusa
9
173677
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r12 push %rax push %rcx push %rdi push %rsi lea addresses_UC_ht+0x1286e, %r11 clflush (%r11) nop cmp %r12, %r12 mov $0x6162636465666768, %rax movq %rax, %xmm0 movups %xmm0, (%r11) inc %rax lea addresses_UC_ht+0x12b2e, %rsi lea addresses_UC_ht+0x13b2e, %rdi nop nop and %r10, %r10 mov $1, %rcx rep movsw nop inc %r10 lea addresses_A_ht+0x1392e, %r11 nop nop cmp $29819, %rdi mov $0x6162636465666768, %r12 movq %r12, %xmm4 and $0xffffffffffffffc0, %r11 movntdq %xmm4, (%r11) nop add %rsi, %rsi lea addresses_normal_ht+0x67c6, %rdi xor %r11, %r11 mov (%rdi), %r12w nop nop inc %rcx pop %rsi pop %rdi pop %rcx pop %rax pop %r12 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r13 push %r14 push %r9 push %rbp push %rbx push %rcx // Store lea addresses_PSE+0x84c6, %r13 nop nop nop add %r11, %r11 mov $0x5152535455565758, %rbp movq %rbp, %xmm2 movups %xmm2, (%r13) nop nop nop nop nop add %r13, %r13 // Store lea addresses_PSE+0x82d6, %r11 nop nop nop nop nop and $10801, %rcx mov $0x5152535455565758, %rbp movq %rbp, (%r11) nop sub %rcx, %rcx // Store lea addresses_WC+0x12e, %rcx nop sub $22334, %rbp mov $0x5152535455565758, %r9 movq %r9, %xmm4 movups %xmm4, (%rcx) nop nop nop nop nop xor $5438, %r11 // Faulty Load lea addresses_WC+0xeb2e, %r11 nop nop nop nop nop inc %rcx mov (%r11), %r13 lea oracles, %rbp and $0xff, %r13 shlq $12, %r13 mov (%rbp,%r13,1), %r13 pop %rcx pop %rbx pop %rbp pop %r9 pop %r14 pop %r13 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_WC', 'congruent': 0}} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_PSE', 'congruent': 3}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_PSE', 'congruent': 2}, 'OP': 'STOR'} {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_WC', 'congruent': 9}, 'OP': 'STOR'} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_WC', 'congruent': 0}} <gen_prepare_buffer> {'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_UC_ht', 'congruent': 6}, 'OP': 'STOR'} {'dst': {'same': False, 'congruent': 11, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_UC_ht'}} {'dst': {'same': False, 'NT': True, 'AVXalign': False, 'size': 16, 'type': 'addresses_A_ht', 'congruent': 7}, 'OP': 'STOR'} {'OP': 'LOAD', 'src': {'same': True, 'NT': True, 'AVXalign': False, 'size': 2, 'type': 'addresses_normal_ht', 'congruent': 2}} {'38': 21829} 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 */
programs/oeis/007/A007680.asm
neoneye/loda
22
241545
; A007680: a(n) = (2n+1)*n!. ; 1,3,10,42,216,1320,9360,75600,685440,6894720,76204800,918086400,11975040000,168129561600,2528170444800,40537905408000,690452066304000,12449059983360000,236887827111936000,4744158915944448000,99748982335242240000,2196910513383505920000,50580032749992345600000,1215044786727593902080000,30401971684928732528640000,791071712209880285184000000,21374447439710098685952000000,598887819773009368842240000000,17378635642867690048585728000000,521663957630642415318073344000000,16180424448543654576814817280000000,518038835213209137516710461440000000 mov $1,$0 mul $0,2 add $0,1 mov $2,$1 seq $2,142 ; Factorial numbers: n! = 1*2*3*4*...*n (order of symmetric group S_n, number of permutations of n letters). mul $0,$2
src/config.ads
thindil/steamsky
80
27282
<reponame>thindil/steamsky -- Copyright 2016-2021 <NAME> -- -- This file is part of Steam Sky. -- -- Steam Sky is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- Steam Sky is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with Steam Sky. If not, see <http://www.gnu.org/licenses/>. with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ships; use Ships; -- ****h* Config/Config -- FUNCTION -- Provide code for load and save the game configuration -- SOURCE package Config is -- **** -- ****t* Config/Config.Bonus_Type -- FUNCTION -- Used to store the game difficulty settings -- SOURCE subtype Bonus_Type is Float range 0.0 .. 5.0; -- **** -- ****t* Config/Config.Difficulty_Type -- FUNCTION -- Used to set the game difficulty level -- SOURCE type Difficulty_Type is (VERY_EASY, EASY, NORMAL, HARD, VERY_HARD, CUSTOM) with Default_Value => NORMAL; -- **** -- ****d* Config/Config.Default_Difficulty_Type -- FUNCTION -- Default difficulty level for the game -- SOURCE Default_Difficulty_Type: constant Difficulty_Type := NORMAL; -- **** -- ****s* Config/Config.New_Game_Record -- FUNCTION -- Data for new game settings -- PARAMETERS -- Player_Name - Default player name -- Player_Gender - Default player gender -- Ship_Name - Default ship name -- Player_Faction - Default player faction index -- Player_Career - Default player career index -- Starting_Base - Default starting base type -- Enemy_Damage_Bonus - Default bonus for enemy ship to damage -- Player_Damage_Bonus - Default bonus for player ship to damage -- Enemy_Melee_Damage_Bonus - Default bonus for enemy to damage in melee -- combat -- Player_Melee_Damage_Bonus - Default bonus for player and player's ship -- crew to damage in melee combat -- Experience_Bonus - Default bonus to gained experience -- Reputation_Bonus - Default bonus to gained or lost reputation in -- bases -- Upgrade_Cost_Bonus - Default bonus to amount of materials needed for -- player's ship upgrades. -- Prices_Bonus - Default bonus to prices for services in bases -- Difficulty_Level - Default the game difficulty level -- SOURCE type New_Game_Record is record Player_Name: Unbounded_String; Player_Gender: Character; Ship_Name: Unbounded_String; Player_Faction: Unbounded_String; Player_Career: Unbounded_String; Starting_Base: Unbounded_String; Enemy_Damage_Bonus: Bonus_Type; Player_Damage_Bonus: Bonus_Type; Enemy_Melee_Damage_Bonus: Bonus_Type; Player_Melee_Damage_Bonus: Bonus_Type; Experience_Bonus: Bonus_Type; Reputation_Bonus: Bonus_Type; Upgrade_Cost_Bonus: Bonus_Type; Prices_Bonus: Bonus_Type; Difficulty_Level: Difficulty_Type; end record; -- **** -- ****d* Config/Config.Default_New_Game_Settings -- FUNCTION -- Default settings for the new game -- SOURCE Default_New_Game_Settings: constant New_Game_Record := (Player_Name => To_Unbounded_String(Source => "Laeran"), Player_Gender => 'M', Ship_Name => To_Unbounded_String(Source => "Anaria"), Player_Faction => To_Unbounded_String(Source => "POLEIS"), Player_Career => To_Unbounded_String(Source => "general"), Starting_Base => To_Unbounded_String(Source => "Any"), Enemy_Damage_Bonus => 1.0, Player_Damage_Bonus => 1.0, Enemy_Melee_Damage_Bonus => 1.0, Player_Melee_Damage_Bonus => 1.0, Experience_Bonus => 1.0, Reputation_Bonus => 1.0, Upgrade_Cost_Bonus => 1.0, Prices_Bonus => 1.0, Difficulty_Level => Default_Difficulty_Type); -- **** -- ****t* Config/Config.Auto_Move_Break -- FUNCTION -- Options when stop auto move of player ship -- SOURCE type Auto_Move_Break is (NEVER, ANY, FRIENDLY, ENEMY) with Default_Value => NEVER; -- **** -- ****d* Config/Config.Default_Auto_Move_Stop -- FUNCTION -- Default setting for stop automovement of the player ship -- SOURCE Default_Auto_Move_Stop: constant Auto_Move_Break := NEVER; -- **** -- ****t* Config/Config.Messages_Order_Type -- FUNCTION -- Options to set showing messages order -- SOURCE type Messages_Order_Type is (OLDER_FIRST, NEWER_FIRST) with Default_Value => OLDER_FIRST; -- **** -- ****d* Config/Config.Default_Messages_Order -- FUNCTION -- Default order of show the last messages -- SOURCE Default_Messages_Order: constant Messages_Order_Type := OLDER_FIRST; -- **** -- ****t* Config/Config.Auto_Save_Type -- FUNCTION -- Type used to set how often autosave is done -- SOURCE type Auto_Save_Type is (NONE, DOCK, UNDOCK, DAILY, MONTHLY, YEARLY) with Default_Value => NONE; -- **** -- ****d* Config/Config.Default_Auto_Save_Time -- FUNCTION -- Default time when to auto save the game -- SOURCE Default_Auto_Save_Time: constant Auto_Save_Type := NONE; -- **** -- ****s* Config/Config.Game_Settings_Record -- FUNCTION -- Data for game settings -- PARAMETERS -- Auto_Rest - If true, rest when pilot/engineer need rest -- Undock_Speed - Default player ship speed after undock -- Auto_Center - If true, back to ship after sets destination for -- it -- Auto_Return - If true, set base as destination for ship after -- finished mission -- Auto_Finish - If true, complete mission if ship is near -- corresponding base -- Low_Fuel - Amount of fuel below which warning about low -- level is show -- Low_Drinks - Amount of drinkis below which warning about low -- level is show -- Low_Food - Amount of food below which warning about low -- level is show -- Auto_Move_Stop - When stop automoving of player ship -- Window_Width - Game window default width -- Window_Height - Game window default height -- Messages_Limit - Max amount of messages showed in game -- Saved_Messages - Max amount fo messages saved to file -- Help_Font_Size - Size of font used in help -- Map_Font_Size - Size of font used in map -- Interface_Font_Size - Size of font used in interface -- Interface_Theme - Name of current user interface theme -- Messages_Order - Order of showing messages -- Auto_Ask_For_Bases - If true, auto ask for new bases when ship docked -- Auto_Ask_For_Events - If true, auto ask for new events in bases when -- ship docked -- Show_Tooltips - If true, show tooltips to player -- Show_Last_Messages - If true, show last messages window everywhere -- Messages_Position - Height of last messages window in pixels from -- bottom of the game window -- Full_Screen - If true, set the game window in full screen mode -- Auto_Close_Messages_Time - Amount of seconds after which message box is -- auto closed -- Auto_Save - How often game is autosaved -- Topic_Position - Position of help topics window in pixels from -- top of the help window -- Show_Numbers - If true, show numbers values instead of text for -- various things (like weapon strength, etc) -- Right_Button - If true, use right mouse button for show various -- in game menus. Otherwise use the left button -- Lists_Limit - The amount of items displayed in various lists -- SOURCE type Game_Settings_Record is record Auto_Rest: Boolean; Undock_Speed: Ship_Speed; Auto_Center: Boolean; Auto_Return: Boolean; Auto_Finish: Boolean; Low_Fuel: Positive range 1 .. 10_000; Low_Drinks: Positive range 1 .. 10_000; Low_Food: Positive range 1 .. 10_000; Auto_Move_Stop: Auto_Move_Break; Window_Width: Positive := 800; Window_Height: Positive := 600; Messages_Limit: Positive range 10 .. 5_000; Saved_Messages: Positive range 5 .. 200; Help_Font_Size: Positive range 2 .. 51; Map_Font_Size: Positive range 2 .. 51; Interface_Font_Size: Positive range 2 .. 51; Interface_Theme: Unbounded_String; Messages_Order: Messages_Order_Type; Auto_Ask_For_Bases: Boolean; Auto_Ask_For_Events: Boolean; Show_Tooltips: Boolean; Show_Last_Messages: Boolean; Messages_Position: Natural; Full_Screen: Boolean; Auto_Close_Messages_Time: Positive range 1 .. 60; Auto_Save: Auto_Save_Type; Topics_Position: Natural; Show_Numbers: Boolean; Right_Button: Boolean; Lists_Limit: Positive range 5 .. 100; end record; -- **** -- ****d* Config/Config.Default_Game_Settings -- FUNCTION -- Default setting for the game -- SOURCE Default_Game_Settings: constant Game_Settings_Record := (Auto_Rest => True, Undock_Speed => FULL_SPEED, Auto_Center => True, Auto_Return => True, Auto_Finish => True, Low_Fuel => 100, Low_Drinks => 50, Low_Food => 25, Auto_Move_Stop => Default_Auto_Move_Stop, Window_Width => 800, Window_Height => 600, Messages_Limit => 500, Saved_Messages => 10, Help_Font_Size => 14, Map_Font_Size => 16, Interface_Font_Size => 14, Interface_Theme => To_Unbounded_String(Source => "steamsky"), Messages_Order => Default_Messages_Order, Auto_Ask_For_Bases => False, Auto_Ask_For_Events => False, Show_Tooltips => True, Show_Last_Messages => True, Messages_Position => 213, Full_Screen => False, Auto_Close_Messages_Time => 6, Auto_Save => Default_Auto_Save_Time, Topics_Position => 200, Show_Numbers => False, Right_Button => False, Lists_Limit => 25); -- **** -- ****v* Config/Config.New_Game_Settings -- FUNCTION -- Settings for the new game -- SOURCE New_Game_Settings: New_Game_Record; -- **** -- ****v* Config/Config.Game_Settings -- FUNCTION -- General settings for the game -- SOURCE Game_Settings: Game_Settings_Record; -- **** -- ****f* Config/Config.Load_Config -- FUNCTION -- Load game configuration from file -- SOURCE procedure Load_Config; -- **** -- ****f* Config/Config.SaveConfig -- FUNCTION -- Save game configuration to file -- SOURCE procedure Save_Config; -- **** end Config;
agda-stdlib/README/Data.agda
DreamLinuxer/popl21-artifact
5
16073
------------------------------------------------------------------------ -- The Agda standard library -- -- An explanation about how data types are laid out in the standard -- library. ------------------------------------------------------------------------ module README.Data where -- The top-level folder `Data` contains all the definitions of datatypes -- and their associated properties. -- Datatypes can broadly split into two categories -- i) "Basic" datatypes which do not take other datatypes as generic -- arguments (Nat, String, Fin, Bool, Char etc.) -- ii) "Container" datatypes which take other generic datatypes as -- arguments, (List, Vec, Sum, Product, Maybe, AVL trees etc.) ------------------------------------------------------------------------ -- Basic datatypes ------------------------------------------------------------------------ -- Basic datatypes are usually organised as follows: -- 1. A `Base` module which either contains the definition of the -- datatype or reimports it from the builtin modules, along with common -- functions, operations and relations over elements of the datatype. import Data.Nat.Base import Data.Integer.Base import Data.Char.Base import Data.String.Base import Data.Bool.Base -- Commonly these modules don't need to be imported directly as their -- contents is re-exported by the top level module (see below). -- 2. A `Properties` module which contains the basic properties of the -- functions, operations and relations contained in the base module. import Data.Nat.Properties import Data.Integer.Properties import Data.Char.Properties import Data.String.Properties import Data.Bool.Properties -- 3. A top-level module which re-exports the contents of the base -- module as well as various queries (i.e. decidability proofs) from the -- properties file. import Data.Nat import Data.Integer import Data.Char import Data.String import Data.Bool -- 4. A `Solver` module (for those datatypes that have an algebraic solver) -- which can be used to automatically solve equalities over the basic datatype. import Data.Nat.Solver import Data.Integer.Solver import Data.Bool.Solver -- 5. More complex operations and relations are commonly found in their -- own module beneath the top-level directory. For example: import Data.Nat.DivMod import Data.Integer.Coprimality -- Note that eventually there is a plan to re-organise the library to -- have the top-level module export a far wider range of properties and -- additional operations in order to minimise the number of imports -- needed. Currently it is necessary to import each of these separately -- however. ------------------------------------------------------------------------ -- Container datatypes ------------------------------------------------------------------------ -- 1. As with basic datatypes, a `Base` module which contains the -- definition of the datatype, along with common functions and -- operations over that data. Unlike basic datatypes, the `Base` module -- for container datatypes does not export any relations or predicates -- over the datatype (see the `Relation` section below). import Data.List.Base import Data.Maybe.Base import Data.Sum.Base -- Commonly these modules don't need to be imported directly as their -- contents is re-exported by the top level module (see below). -- 2. As with basic datatypes, a `Properties` module which contains the -- basic properties of the functions, operations and contained in the -- base module. import Data.List.Properties import Data.Maybe.Properties import Data.Sum.Properties -- 3. As with basic datatypes, a top-level module which re-exports the -- contents of the base module. In some cases this may also contain -- additional functions which could not be placed into the corresponding -- Base module because of cyclic dependencies. import Data.List import Data.Maybe import Data.Sum -- 4. A `Relation.Binary` folder where binary relations over the datatypes -- are stored. Because relations over container datatypes often depend on -- relations over the parameter datatype, this differs from basic datatypes -- where the binary relations are usually defined in the `Base` module, e.g. -- equality over the type `List A` depends on equality over type `A`. -- For example the `Pointwise` relation that takes a relation over the -- underlying type A and lifts it to the container parameterised can be found -- as follows: import Data.List.Relation.Binary.Pointwise import Data.Maybe.Relation.Binary.Pointwise import Data.Sum.Relation.Binary.Pointwise -- Another useful subfolder in the `Data.X.Relation.Binary` folders is the -- `Data.X.Relation.Binary.Equality` folder which contains various forms of -- equality over the datatype. -- 5. A `Relation.Unary` folder where unary relations, or predicates, -- over the datatypes are stored. These can be viewed as properties -- over a single list. -- For example a common, useful example is `Data.X.Relation.Unary.Any` -- that contains the types of proofs that at least one element in the -- container satisfies some predicate/property. import Data.List.Relation.Unary.Any import Data.Vec.Relation.Unary.Any import Data.Maybe.Relation.Unary.Any -- Alternatively the `Data.X.Relation.Unary.All` module contains the -- type of proofs that all elements in the container satisfy some -- property. import Data.List.Relation.Unary.All import Data.Vec.Relation.Unary.All import Data.Maybe.Relation.Unary.All -- 6. A `Categorical` module/folder that contains categorical -- interpretations of the datatype. import Data.List.Categorical import Data.Maybe.Categorical import Data.Sum.Categorical.Left import Data.Sum.Categorical.Right -- 7. A `Function` folder that contains lifting of various types of -- functions (e.g. injections, surjections, bijections, inverses) to -- the datatype. import Data.Sum.Function.Propositional import Data.Sum.Function.Setoid import Data.Product.Function.Dependent.Propositional import Data.Product.Function.Dependent.Setoid ------------------------------------------------------------------------ -- Full list of documentation for the Data folder ------------------------------------------------------------------------ -- Some examples showing where the natural numbers/integers and some -- related operations and properties are defined, and how they can be -- used: import README.Data.Nat import README.Data.Nat.Induction import README.Data.Integer -- Some examples showing how the AVL tree module can be used. import README.Data.AVL -- Some examples showing how List module can be used. import README.Data.List -- Some examples showing how the Fresh list can be used. import README.Data.List.Fresh -- Using List's Interleaving to define a fully certified filter function. import README.Data.Interleaving -- Example of an encoding of record types with manifest fields and "with". import README.Data.Record -- Example use case for a trie: a wee generic lexer import README.Data.Trie.NonDependent -- Examples how (indexed) containers and constructions over them (free -- monad, least fixed point, etc.) can be used import README.Data.Container.FreeMonad import README.Data.Container.Indexed
sound/sfxasm/40.asm
NatsumiFox/Sonic-3-93-Nov-03
7
172878
40_Header: sHeaderInit ; Z80 offset is $C2D1 sHeaderPatch 40_Patches sHeaderTick $01 sHeaderCh $01 sHeaderSFX $80, $05, 40_FM5, $FC, $04 40_Patches: ; Patch $00 ; $32 ; $05, $02, $13, $31, $0B, $1C, $10, $0D ; $00, $00, $04, $00, $00, $00, $00, $0C ; $0F, $0F, $1F, $0F, $0B, $17, $0C, $80 spAlgorithm $02 spFeedback $06 spDetune $00, $01, $00, $03 spMultiple $05, $03, $02, $01 spRateScale $00, $00, $00, $00 spAttackRt $0B, $10, $1C, $0D spAmpMod $00, $00, $00, $00 spSustainRt $00, $04, $00, $00 spSustainLv $00, $01, $00, $00 spDecayRt $00, $00, $00, $0C spReleaseRt $0F, $0F, $0F, $0F spTotalLv $0B, $0C, $17, $00 ; 40_FM5 at $C28D ($44 before start of file) can not be converted, because the data does not exist.
Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0x84_notsx.log_56_506.asm
ljhsiun2/medusa
9
100638
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r12 push %r15 push %rbx lea addresses_UC_ht+0x1e3a1, %r12 nop sub %r15, %r15 movb $0x61, (%r12) xor $42716, %rbx pop %rbx pop %r15 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r12 push %rax push %rcx push %rdi push %rsi // Store mov $0xbec6800000000ad, %rsi nop nop nop add $45116, %rdi movb $0x51, (%rsi) nop nop nop dec %rax // Store lea addresses_D+0x1ca1d, %r10 nop nop nop xor $55272, %r11 movb $0x51, (%r10) nop nop nop nop nop add %r11, %r11 // Load lea addresses_A+0x1b71d, %r12 clflush (%r12) nop dec %rcx movb (%r12), %r11b nop nop and $58855, %rsi // Store lea addresses_D+0x1ca1d, %rcx cmp $20280, %rax mov $0x5152535455565758, %rsi movq %rsi, %xmm3 vmovups %ymm3, (%rcx) nop nop nop add $13910, %r11 // Faulty Load lea addresses_D+0x1ca1d, %rsi nop nop nop inc %r11 mov (%rsi), %r12 lea oracles, %r10 and $0xff, %r12 shlq $12, %r12 mov (%r10,%r12,1), %r12 pop %rsi pop %rdi pop %rcx pop %rax pop %r12 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_D', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_NC', 'same': False, 'size': 1, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} {'dst': {'type': 'addresses_D', 'same': True, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'} {'src': {'type': 'addresses_A', 'same': False, 'size': 1, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} {'dst': {'type': 'addresses_D', 'same': True, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'} [Faulty Load] {'src': {'type': 'addresses_D', 'same': True, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 1, 'congruent': 1, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'} {'58': 56} 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 */
test/examples/string_sequences_test.adb
fintatarta/protypo
0
1635
with Ada.Text_IO; use Ada.Text_IO; with Readable_Sequences.String_Sequences; procedure String_Sequences_Test is use Readable_Sequences.String_Sequences; S : Sequence := Empty_Sequence; A : constant String := "pippo pluto e paperino"; b : constant string := " al<NAME> e giacomo"; begin S.Append (A); S.Append (B); Put_Line (Boolean'Image (S.Length = A'Length + B'Length)); Put_Line (S.Dump); end String_Sequences_Test;
test/succeed/RecordInMutual.agda
asr/agda-kanso
0
15322
<filename>test/succeed/RecordInMutual.agda -- Records are allowed in mutual blocks. module RecordInMutual where mutual record A : Set where field x : B record B : Set where field x : A
programs/oeis/317/A317527.asm
neoneye/loda
22
88304
; A317527: Number of edges in the n-alternating group graph. ; 0,0,3,24,180,1440,12600,120960,1270080,14515200,179625600,2395008000,34248614400,523069747200,8499883392000,146459529216000,2667655710720000,51218989645824000,1033983353475072000,21896118073589760000,485363950631239680000,11240007277776076800000 trn $0,1 seq $0,90672 ; a(n) = (n^2-1)*n!/3. div $0,2 mul $0,3
_build/dispatcher/jmp_ippsRSA_InitPrivateKeyType1_e9ce5264.asm
zyktrcn/ippcp
1
246709
<reponame>zyktrcn/ippcp<filename>_build/dispatcher/jmp_ippsRSA_InitPrivateKeyType1_e9ce5264.asm extern m7_ippsRSA_InitPrivateKeyType1:function extern n8_ippsRSA_InitPrivateKeyType1:function extern y8_ippsRSA_InitPrivateKeyType1:function extern e9_ippsRSA_InitPrivateKeyType1:function extern l9_ippsRSA_InitPrivateKeyType1:function extern n0_ippsRSA_InitPrivateKeyType1:function extern k0_ippsRSA_InitPrivateKeyType1:function extern ippcpJumpIndexForMergedLibs extern ippcpSafeInit:function segment .data align 8 dq .Lin_ippsRSA_InitPrivateKeyType1 .Larraddr_ippsRSA_InitPrivateKeyType1: dq m7_ippsRSA_InitPrivateKeyType1 dq n8_ippsRSA_InitPrivateKeyType1 dq y8_ippsRSA_InitPrivateKeyType1 dq e9_ippsRSA_InitPrivateKeyType1 dq l9_ippsRSA_InitPrivateKeyType1 dq n0_ippsRSA_InitPrivateKeyType1 dq k0_ippsRSA_InitPrivateKeyType1 segment .text global ippsRSA_InitPrivateKeyType1:function (ippsRSA_InitPrivateKeyType1.LEndippsRSA_InitPrivateKeyType1 - ippsRSA_InitPrivateKeyType1) .Lin_ippsRSA_InitPrivateKeyType1: db 0xf3, 0x0f, 0x1e, 0xfa call ippcpSafeInit wrt ..plt align 16 ippsRSA_InitPrivateKeyType1: db 0xf3, 0x0f, 0x1e, 0xfa mov rax, qword [rel ippcpJumpIndexForMergedLibs wrt ..gotpc] movsxd rax, dword [rax] lea r11, [rel .Larraddr_ippsRSA_InitPrivateKeyType1] mov r11, qword [r11+rax*8] jmp r11 .LEndippsRSA_InitPrivateKeyType1:
demo/joypad.asm
stoneface86/tbengine
6
8888
<reponame>stoneface86/tbengine INCLUDE "hardware.inc" SECTION "joypad", ROM0 debounce: MACRO REPT 4 ; increase if debouncing occurs ld a, [rP1] ENDR ENDM ; pressed: ~prev | current ; released: ~(~prev & current) joypad_init:: push hl ld a, $FF ld hl, wJoypadState REPT 3 ld [hl+], a ENDR pop hl ret joypad_read:: ld c, $F0 ; mask to set the upper bits to 1 ld a, P1F_GET_BTN ; read button states ld [rP1], a debounce or a, c ; mask ld b, a ; save for later swap b ; button states are in the upper bits ld a, P1F_GET_DPAD ; read dpad state ld [rP1], a debounce or a, c ; mask and b ; combine dpad states with button states ld b, a ; b = current joypad state ld a, [wJoypadState] ; a = last joypad state cpl ; compliment and OR with the current ld c, a ; c = ~previous or b ld [wJoypadPressed], a ; store into pressed variable ld a, c ; a = ~previous and b ; and it with the current state cpl ; compliment again ld [wJoypadReleased], a ; store into released ld a, b ld [wJoypadState], a ; store current in wram variable ret SECTION "joypad_wram", WRAM0 ; these variables are active LOW, meaning that 0 = down/pressed/released ; layout ; bit 7: start ; bit 6: select ; bit 5: b ; bit 4: a ; bit 3: down ; bit 2: up ; bit 1: left ; bit 0: right ; contains the states of all buttons currently held down wJoypadState:: DS 1 ; contains which buttons were pressed (up -> down) for the current frame wJoypadPressed:: DS 1 ; contains which buttons were released (down -> up) for the current frame wJoypadReleased:: DS 1
oeis/070/A070825.asm
neoneye/loda-programs
11
29700
<gh_stars>10-100 ; A070825: One half of product of first n+1 Lucas numbers A000032. ; Submitted by <NAME> ; 1,1,3,12,84,924,16632,482328,22669416,1722875616,211913700768,42170826452832,13579006117811904,7074662187380001984,5963940223961341672512,8134814465483270041306368,17953535525321576981163154176,64112075360923351399733623562496,370439571435415124387660876944101888,3463239553349695997900241538550408550912,52388424723520851360236953753652030149645824,1282259083532896357893159680074387089942731188224,50781306485153294461642802809985951923001983247235072 mov $1,1 mov $2,2 mov $3,1 lpb $0 sub $0,1 add $4,$3 mul $1,$4 mov $3,$2 mov $2,$4 lpe mov $0,$1
oeis/295/A295127.asm
neoneye/loda-programs
11
245824
; A295127: Numerator of Sum_{d|n} mu(n/d)/d, where mu is the Möbius function A008683. ; Submitted by <NAME> ; 1,-1,-2,-1,-4,1,-6,-1,-2,2,-10,1,-12,3,8,-1,-16,1,-18,1,4,5,-22,1,-4,6,-2,3,-28,-4,-30,-1,20,8,24,1,-36,9,8,1,-40,-2,-42,5,8,11,-46,1,-6,2,32,3,-52,1,8,3,12,14,-58,-2,-60,15,4,-1,48,-10,-66,4,44,-12,-70,1,-72,18,8,9,60,-4,-78,1,-2,20,-82,-1,64,21,56,5,-88,-4,72,11,20,23,72,1,-96,3,20,1 mov $2,$0 seq $0,23900 ; Dirichlet inverse of Euler totient function (A000010). mov $1,$0 add $2,1 gcd $1,$2 div $0,$1
private/windows/shell/accesory/paintbrs/qutil.asm
King0987654/windows2000
11
166285
<filename>private/windows/shell/accesory/paintbrs/qutil.asm ;****************************Module*Header******************************* ; Copyright (c) 1987 - 1991 Microsoft Corporation * ;************************************************************************ title qutil.asm ;****************************************************************/ ;* assembly code utilities */ ;****************************************************************/ .xlist ?MEDIUM equ 1 ?WIN = 1 ?PLM = 0 include cmacros.inc .list time struc hour dw ? hour12 dw ? hour24 dw ? minute dw ? second dw ? ampm dw ? time ends date struc month dw ? day dw ? year dw ? dayofweek dw ? date ends sBegin DATA sEnd DATA sBegin CODE assumes CS,CODE assumes DS,DATA extrn DOS3Call : far ;--------------------------------------------- ; RepeatMove - very fast repeat move with long args ; Syntax RepeatMove(char far *dest, char far *src, cnt) ;--------------------------------------------- cProc RepeatMove,<PUBLIC,FAR>,<di,si> parmD lpDest parmD lpSrc parmW cnt cBegin push ds les di,lpDest lds si,lpSrc mov cx,cnt mov BX,CX ;see which is bigger cmp SI,DI ;is source bigger than dest? ja repm1 ;this is only a 16 bit guess, but... ;if they differ in segments it should be ;irrelevant std add si,cx add di,cx dec si dec di shr BX,1 jnc repm0a movsb repm0a: shr CX,1 jcxz repm2 dec si dec di rep movsw jmp short repm2 ;move upwards repm1: cld shr CX,1 jcxz repm1a rep movsw repm1a: shr BX,1 jnc repm2 movsb repm2: cld pop ds cEnd ;--------------------------------------------- ; RepeatFill - very fast repeat fill with long dest ; Syntax RepeatFill(char far *dest, databyte, cnt) ;--------------------------------------------- cProc RepeatFill,<PUBLIC,FAR>,<di> parmD lpDest parmB bData parmW cnt cBegin les di,lpDest mov CX,cnt mov AL,bData cld mov AH,AL mov BX,CX shr CX,1 jcxz rpf1 rep stosw rpf1: shr BX,1 jnc rpf2 stosb rpf2: cEnd ;--------------------------------------------- ; DeleteFile delete a file ; syntax: DeleteFile(LPSTR filename) ; returns 0 or DOS error number ;--------------------------------------------- cProc DeleteFile,<PUBLIC,FAR>,<si,di> parmD src cBegin push ds lds dx,src mov ah,41h call DOS3Call jc @F xor ax,ax @@: pop ds cEnd ;--------------------------------------------- ; SetCurrentDrive set the current drive ; syntax: SetCurrentDrive(int drive_number) ; returns 0 or DOS error number ;--------------------------------------------- cProc SetCurrentDrive,<PUBLIC,FAR>,<si,di> parmW drive cBegin mov dl, byte ptr drive mov ah,0Eh call DOS3Call jc @F xor ax,ax @@: cEnd ;--------------------------------------------- ; chdir set current directory ; syntax: chdir(LPSTR path) ; returns 0 or DOS error number ;--------------------------------------------- cProc chdir,<PUBLIC,FAR>,<si,di> parmD src cBegin push ds lds dx,src mov ah,3Bh call DOS3Call jc @F xor ax,ax @@: pop ds cEnd ;--------------------------------------------- ; getcwd get current directory ; syntax: getcwd(LPSTR path, int path_length) ; returns 0 or DOS error number ;--------------------------------------------- cProc getcwd,<PUBLIC,FAR>,<si,di> parmD path parmW len localV temppath, 67 cBegin push ds push es cld ; we use forward string ops cmp len, 4 ; will at least x:\ fit? jb @F ; nope mov ax, ss ; point ds & es to stack mov ds, ax mov es, ax lea di, temppath ; fill in drive mov si, di mov ah, 19h call DOS3Call jc @F add al, 'A' ; convert to ascii stosb mov al, ':' stosb mov al, '\' stosb mov si, di ; get current working directory xor dl, dl ; current drive mov ah,47h call DOS3Call jc @F mov byte ptr [di+63], 0 ; make sure string is null-terminated les di, path ; copy string to caller's buffer lea si, temppath mov cx, len rep movsb xor ax,ax @@: pop es pop ds cEnd cProc GetTime, <PUBLIC>,<si,di> parmW pTime ; pointer to the structure to fill cBegin mov ax, 2c00h ; get time int 21h mov bx, pTime xor ax,ax mov al,ch mov [bx].hour24, ax mov al,cl mov [bx].minute, ax mov al,dh mov [bx].second, ax cEnd cProc GetDate, <PUBLIC>,<si,di> parmW pDate ; pointer to the structure to fill cBegin mov ax, 2a00h ; get date int 21h mov bx, pDate mov [bx].year, cx xor ah, ah mov [bx].dayofweek, ax mov al,dh mov [bx].month, ax mov al,dl mov [bx].day, ax cEnd sEnd CODE end 
asm/showtext/main.asm
BoKoIsMe/J1900_FreeBSD
0
244387
.286 .model small,stdcall include showtext.inc includelib showtext.lib drawChar proto,location:WORD,char:BYTE,color:BYTE .data currentPosition COORD <0,0> szString db "Welcom to the ASM world.",0dh,0ah,0 LENSTRING EQU $ - szString .stack 200h .code .startup push ds pop es mov ah,0002h int 10h mov ax,10 mov currentPosition.X,ax mov ax,12 mov currentPosition.Y,ax mov si,offset szString mov cx,LENSTRING - 3 @@: invoke drawChar,offset currentPosition,[si],foreGroundYellow or highlight or backGroundBlue inc currentPosition.X .IF currentPosition.X == 79 mov currentPosition.X,0 inc currentPosition.Y .ENDIF .IF currentPosition.Y == 24 mov currentPosition.Y,0 .ENDIF inc si loop @B .exit end
.emacs.d/elpa/wisi-3.1.3/wisitoken-bnf-output_elisp_common.adb
caqg/linux-home
0
10359
<filename>.emacs.d/elpa/wisi-3.1.3/wisitoken-bnf-output_elisp_common.adb -- Abstract : -- -- See spec -- -- Copyright (C) 2012, 2013, 2015, 2017 - 2019 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or -- modify it under terms of the GNU General Public License as -- published by the Free Software Foundation; either version 3, or (at -- your option) any later version. This program is distributed in the -- hope that it will be useful, but WITHOUT ANY WARRANTY; without even -- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -- PURPOSE. See the GNU General Public License for more details. You -- should have received a copy of the GNU General Public License -- distributed with this program; see file COPYING. If not, write to -- the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, -- MA 02110-1335, USA. pragma License (GPL); with Ada.Text_IO; with WisiToken.Generate; package body WisiToken.BNF.Output_Elisp_Common is function Find_Elisp_ID (List : in String_Lists.List; Elisp_Name : in String) return Integer is I : Integer := 0; -- match elisp array begin for Name of List loop if Name = Elisp_Name then return I; end if; I := I + 1; end loop; raise Not_Found with "unknown elisp name: '" & Elisp_Name & "'"; end Find_Elisp_ID; function Elisp_Name_To_Ada (Elisp_Name : in String; Append_ID : in Boolean; Trim : in Integer) return String is Result : String := Elisp_Name (Elisp_Name'First + Trim .. Elisp_Name'Last); begin Result (Result'First) := To_Upper (Result (Result'First)); for I in Result'Range loop if Result (I) = '-' then Result (I) := '_'; Result (I + 1) := To_Upper (Result (I + 1)); elsif Result (I) = '_' then Result (I + 1) := To_Upper (Result (I + 1)); end if; end loop; if Append_ID then return Result & "_ID"; -- Some elisp names may be Ada reserved words; else return Result; end if; end Elisp_Name_To_Ada; procedure Indent_Keyword_Table (Output_File_Root : in String; Label : in String; Keywords : in String_Pair_Lists.List; Image : access function (Name : in Ada.Strings.Unbounded.Unbounded_String) return String) is use Ada.Text_IO; use WisiToken.Generate; begin Indent_Line ("(defconst " & Output_File_Root & "-" & Label & "-keyword-table-raw"); Indent_Line (" '("); Indent := Indent + 3; for Pair of Keywords loop Indent_Line ("(" & (-Pair.Value) & " . " & Image (Pair.Name) & ")"); end loop; Indent_Line ("))"); Indent := Indent - 3; end Indent_Keyword_Table; procedure Indent_Token_Table (Output_File_Root : in String; Label : in String; Tokens : in Token_Lists.List; Image : access function (Name : in Ada.Strings.Unbounded.Unbounded_String) return String) is use Ada.Strings.Unbounded; use Ada.Text_IO; use WisiToken.Generate; function To_Double_Quotes (Item : in String) return String is Result : String := Item; begin if Result (Result'First) = ''' then Result (Result'First) := '"'; end if; if Result (Result'Last) = ''' then Result (Result'Last) := '"'; end if; return Result; end To_Double_Quotes; begin Indent_Line ("(defconst " & Output_File_Root & "-" & Label & "-token-table-raw"); Indent_Line (" '("); Indent := Indent + 3; for Kind of Tokens loop if not (-Kind.Kind = "line_comment" or -Kind.Kind = "whitespace") then Indent_Line ("(""" & (-Kind.Kind) & """"); Indent := Indent + 1; for Token of Kind.Tokens loop if 0 = Length (Token.Value) then Indent_Line ("(" & Image (Token.Name) & ")"); else if -Kind.Kind = "number" then -- allow for (<token> <number-p> <require>) Indent_Line ("(" & Image (Token.Name) & " " & (-Token.Value) & ")"); elsif -Kind.Kind = "symbol" or -Kind.Kind = "string-double" or -Kind.Kind = "string-single" then -- value not used by elisp Indent_Line ("(" & Image (Token.Name) & " . """")"); else Indent_Line ("(" & Image (Token.Name) & " . " & To_Double_Quotes (-Token.Value) & ")"); end if; end if; end loop; Indent_Line (")"); Indent := Indent - 1; end if; end loop; Indent_Line ("))"); Indent := Indent - 3; end Indent_Token_Table; procedure Indent_Name_Table (Output_File_Root : in String; Label : in String; Names : in String_Lists.List) is use Ada.Text_IO; use WisiToken.Generate; begin Indent_Line ("(defconst " & Output_File_Root & "-" & Label); Indent_Line (" ["); Indent := Indent + 3; for Name of Names loop Indent_Line (Name); end loop; Indent_Line ("])"); Indent := Indent - 3; end Indent_Name_Table; procedure Indent_Repair_Image (Output_File_Root : in String; Label : in String; Tokens : in WisiToken.BNF.Tokens) is use all type Ada.Text_IO.Count; use Ada.Strings.Unbounded; use WisiToken.Generate; function re2c_To_Elisp (Item : in String) return String is Result : String (1 .. Item'Length * 2); Last : Integer := Result'First - 1; begin -- Convert re2c case-insensitive string '...' to elisp string "...", -- with '"' escaped. if Item (Item'First) /= ''' then return Item; end if; for C of Item loop if C = ''' then Result (Last + 1) := '"'; Last := Last + 1; elsif C = '"' then Result (Last + 1) := '\'; Result (Last + 2) := '"'; Last := Last + 2; else Result (Last + 1) := C; Last := Last + 1; end if; end loop; return Result (1 .. Last); end re2c_To_Elisp; begin Indent_Line ("(defconst " & Output_File_Root & "-" & Label & "-repair-image"); Indent_Line (" '("); Indent := Indent + 3; for Pair of Tokens.Keywords loop Indent_Line ("(" & (-Pair.Name) & " . " & (-Pair.Value) & ")"); end loop; for Kind of Tokens.Tokens loop for Token of Kind.Tokens loop if Length (Token.Repair_Image) > 0 then Indent_Line ("(" & (-Token.Name) & " . " & re2c_To_Elisp (-Token.Repair_Image) & ")"); else Indent_Line ("(" & (-Token.Name) & " . " & (-Token.Value) & ")"); end if; end loop; end loop; Indent_Line ("))"); Indent := Indent - 3; end Indent_Repair_Image; end WisiToken.BNF.Output_Elisp_Common;
src/main/fragment/mos6502-common/_deref_qvoc1=qvoc2_derefidx_vbuxx.asm
jbrandwood/kickc
2
84587
<gh_stars>1-10 lda {c2},x sta {c1} lda {c2}+1,x sta {c1}+1
gcc-gcc-7_3_0-release/gcc/ada/a-cfdlli.ads
best08618/asylo
7
30902
------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- ADA.CONTAINERS.FORMAL_DOUBLY_LINKED_LISTS -- -- -- -- S p e c -- -- -- -- Copyright (C) 2004-2015, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- -- apply solely to the contents of the part following the private keyword. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- ------------------------------------------------------------------------------ -- This spec is derived from Ada.Containers.Bounded_Doubly_Linked_Lists in the -- Ada 2012 RM. The modifications are meant to facilitate formal proofs by -- making it easier to express properties, and by making the specification of -- this unit compatible with SPARK 2014. Note that the API of this unit may be -- subject to incompatible changes as SPARK 2014 evolves. -- The modifications are: -- A parameter for the container is added to every function reading the -- contents of a container: Next, Previous, Query_Element, Has_Element, -- Iterate, Reverse_Iterate, Element. This change is motivated by the need -- to have cursors which are valid on different containers (typically a -- container C and its previous version C'Old) for expressing properties, -- which is not possible if cursors encapsulate an access to the underlying -- container. -- There are three new functions: -- function Strict_Equal (Left, Right : List) return Boolean; -- function First_To_Previous (Container : List; Current : Cursor) -- return List; -- function Current_To_Last (Container : List; Current : Cursor) -- return List; -- See subprogram specifications that follow for details generic type Element_Type is private; with function "=" (Left, Right : Element_Type) return Boolean is <>; package Ada.Containers.Formal_Doubly_Linked_Lists with Pure, SPARK_Mode is pragma Annotate (GNATprove, External_Axiomatization); pragma Annotate (CodePeer, Skip_Analysis); type List (Capacity : Count_Type) is private with Iterable => (First => First, Next => Next, Has_Element => Has_Element, Element => Element), Default_Initial_Condition => Is_Empty (List); pragma Preelaborable_Initialization (List); type Cursor is private; pragma Preelaborable_Initialization (Cursor); Empty_List : constant List; No_Element : constant Cursor; function "=" (Left, Right : List) return Boolean with Global => null; function Length (Container : List) return Count_Type with Global => null; function Is_Empty (Container : List) return Boolean with Global => null; procedure Clear (Container : in out List) with Global => null; procedure Assign (Target : in out List; Source : List) with Global => null, Pre => Target.Capacity >= Length (Source); function Copy (Source : List; Capacity : Count_Type := 0) return List with Global => null, Pre => Capacity = 0 or else Capacity >= Source.Capacity; function Element (Container : List; Position : Cursor) return Element_Type with Global => null, Pre => Has_Element (Container, Position); procedure Replace_Element (Container : in out List; Position : Cursor; New_Item : Element_Type) with Global => null, Pre => Has_Element (Container, Position); procedure Move (Target : in out List; Source : in out List) with Global => null, Pre => Target.Capacity >= Length (Source); procedure Insert (Container : in out List; Before : Cursor; New_Item : Element_Type; Count : Count_Type := 1) with Global => null, Pre => Length (Container) + Count <= Container.Capacity and then (Has_Element (Container, Before) or else Before = No_Element); procedure Insert (Container : in out List; Before : Cursor; New_Item : Element_Type; Position : out Cursor; Count : Count_Type := 1) with Global => null, Pre => Length (Container) + Count <= Container.Capacity and then (Has_Element (Container, Before) or else Before = No_Element); procedure Insert (Container : in out List; Before : Cursor; Position : out Cursor; Count : Count_Type := 1) with Global => null, Pre => Length (Container) + Count <= Container.Capacity and then (Has_Element (Container, Before) or else Before = No_Element); procedure Prepend (Container : in out List; New_Item : Element_Type; Count : Count_Type := 1) with Global => null, Pre => Length (Container) + Count <= Container.Capacity; procedure Append (Container : in out List; New_Item : Element_Type; Count : Count_Type := 1) with Global => null, Pre => Length (Container) + Count <= Container.Capacity; procedure Delete (Container : in out List; Position : in out Cursor; Count : Count_Type := 1) with Global => null, Pre => Has_Element (Container, Position); procedure Delete_First (Container : in out List; Count : Count_Type := 1) with Global => null; procedure Delete_Last (Container : in out List; Count : Count_Type := 1) with Global => null; procedure Reverse_Elements (Container : in out List) with Global => null; procedure Swap (Container : in out List; I, J : Cursor) with Global => null, Pre => Has_Element (Container, I) and then Has_Element (Container, J); procedure Swap_Links (Container : in out List; I, J : Cursor) with Global => null, Pre => Has_Element (Container, I) and then Has_Element (Container, J); procedure Splice (Target : in out List; Before : Cursor; Source : in out List) with Global => null, Pre => Length (Source) + Length (Target) <= Target.Capacity and then (Has_Element (Target, Before) or else Before = No_Element); procedure Splice (Target : in out List; Before : Cursor; Source : in out List; Position : in out Cursor) with Global => null, Pre => Length (Source) + Length (Target) <= Target.Capacity and then (Has_Element (Target, Before) or else Before = No_Element) and then Has_Element (Source, Position); procedure Splice (Container : in out List; Before : Cursor; Position : Cursor) with Global => null, Pre => 2 * Length (Container) <= Container.Capacity and then (Has_Element (Container, Before) or else Before = No_Element) and then Has_Element (Container, Position); function First (Container : List) return Cursor with Global => null; function First_Element (Container : List) return Element_Type with Global => null, Pre => not Is_Empty (Container); function Last (Container : List) return Cursor with Global => null; function Last_Element (Container : List) return Element_Type with Global => null, Pre => not Is_Empty (Container); function Next (Container : List; Position : Cursor) return Cursor with Global => null, Pre => Has_Element (Container, Position) or else Position = No_Element; procedure Next (Container : List; Position : in out Cursor) with Global => null, Pre => Has_Element (Container, Position) or else Position = No_Element; function Previous (Container : List; Position : Cursor) return Cursor with Global => null, Pre => Has_Element (Container, Position) or else Position = No_Element; procedure Previous (Container : List; Position : in out Cursor) with Global => null, Pre => Has_Element (Container, Position) or else Position = No_Element; function Find (Container : List; Item : Element_Type; Position : Cursor := No_Element) return Cursor with Global => null, Pre => Has_Element (Container, Position) or else Position = No_Element; function Reverse_Find (Container : List; Item : Element_Type; Position : Cursor := No_Element) return Cursor with Global => null, Pre => Has_Element (Container, Position) or else Position = No_Element; function Contains (Container : List; Item : Element_Type) return Boolean with Global => null; function Has_Element (Container : List; Position : Cursor) return Boolean with Global => null; generic with function "<" (Left, Right : Element_Type) return Boolean is <>; package Generic_Sorting with SPARK_Mode is function Is_Sorted (Container : List) return Boolean with Global => null; procedure Sort (Container : in out List) with Global => null; procedure Merge (Target, Source : in out List) with Global => null; end Generic_Sorting; function Strict_Equal (Left, Right : List) return Boolean with Ghost, Global => null; -- Strict_Equal returns True if the containers are physically equal, i.e. -- they are structurally equal (function "=" returns True) and that they -- have the same set of cursors. function First_To_Previous (Container : List; Current : Cursor) return List with Ghost, Global => null, Pre => Has_Element (Container, Current) or else Current = No_Element; function Current_To_Last (Container : List; Current : Cursor) return List with Ghost, Global => null, Pre => Has_Element (Container, Current) or else Current = No_Element; -- First_To_Previous returns a container containing all elements preceding -- Current (excluded) in Container. Current_To_Last returns a container -- containing all elements following Current (included) in Container. -- These two new functions can be used to express invariant properties in -- loops which iterate over containers. First_To_Previous returns the part -- of the container already scanned and Current_To_Last the part not -- scanned yet. private pragma SPARK_Mode (Off); type Node_Type is record Prev : Count_Type'Base := -1; Next : Count_Type; Element : Element_Type; end record; function "=" (L, R : Node_Type) return Boolean is abstract; type Node_Array is array (Count_Type range <>) of Node_Type; function "=" (L, R : Node_Array) return Boolean is abstract; type List (Capacity : Count_Type) is record Free : Count_Type'Base := -1; Length : Count_Type := 0; First : Count_Type := 0; Last : Count_Type := 0; Nodes : Node_Array (1 .. Capacity) := (others => <>); end record; type Cursor is record Node : Count_Type := 0; end record; Empty_List : constant List := (0, others => <>); No_Element : constant Cursor := (Node => 0); end Ada.Containers.Formal_Doubly_Linked_Lists;
data/maps/objects/Route13.asm
opiter09/ASM-Machina
1
14603
Route13_Object: db $43 ; border block def_warps def_signs sign 15, 13, 11 ; Route13Text11 sign 33, 5, 12 ; Route13Text12 sign 31, 11, 13 ; Route13Text13 def_objects object SPRITE_COOLTRAINER_M, 49, 10, STAY, RIGHT, 1, OPP_BIRD_KEEPER, 1 object SPRITE_COOLTRAINER_F, 48, 10, STAY, DOWN, 2, OPP_JR_TRAINER_F, 12 object SPRITE_COOLTRAINER_F, 27, 9, STAY, DOWN, 3, OPP_JR_TRAINER_F, 13 object SPRITE_COOLTRAINER_F, 23, 10, STAY, LEFT, 4, OPP_JR_TRAINER_F, 14 object SPRITE_COOLTRAINER_F, 50, 5, STAY, DOWN, 5, OPP_JR_TRAINER_F, 15 object SPRITE_COOLTRAINER_M, 12, 4, STAY, RIGHT, 6, OPP_BIRD_KEEPER, 2 object SPRITE_BEAUTY, 33, 6, STAY, DOWN, 7, OPP_BEAUTY, 4 object SPRITE_BEAUTY, 32, 6, STAY, DOWN, 8, OPP_BEAUTY, 5 object SPRITE_BIKER, 10, 7, STAY, UP, 9, OPP_BIKER, 1 object SPRITE_COOLTRAINER_M, 7, 13, STAY, UP, 10, OPP_BIRD_KEEPER, 3 def_warps_to ROUTE_13
bin/morning.applescript
Phixyn/dotfiles
1
4282
<filename>bin/morning.applescript tell application "iTerm" to activate tell application "System Events" tell process "iTerm2" click menu item "phix-dev-1" of menu of menu item "Restore Window Arrangement" of menu "Window" of menu bar 1 end tell end tell delay 1 -- Start internal wiki on detached Screen tell application "iTerm2" tell first tab of current window to select tell first session of first tab of current window write text "screen -S journal -t simiki" write text "cd $HOME/Documents/Journal" write text "source .env/bin/activate" write text "./start.sh" end tell end tell -- Detach from Screen tell application "System Events" keystroke "a" using {control down} keystroke "d" end tell delay 1 -- Start 'URL Markify' on detached Screen tell application "iTerm2" tell first tab of current window to select tell first session of first tab of current window write text "screen -S markify -t markify" write text "cd $HOME/Documents/Development/personal/python-scripts" write text "source .env/bin/activate" write text "./url_markify.py" end tell end tell tell application "System Events" keystroke "a" using {control down} keystroke "d" end tell delay 1 tell application "Spotify" activate play track "spotify:playlist:6hMBOevTHPxI9gzcMrcjHk" pause end tell delay 1 -- Start 'Spotify Now Playing' script tell application "iTerm2" activate tell first tab of current window to select tell second session of first tab of current window select write text "screen -S now-playing -t Spotify" write text "clear ; $HOME/bin/mac-spotify-now-playing.sh" end tell end tell -- Start rest of applications tell application "Slack" to activate tell application "Firefox" to activate tell application "RoboForm" to activate tell application "Thunderbird" to activate
src/tcl.ads
thindil/tashy2
2
13052
<filename>src/tcl.ads -- Copyright (c) 2020-2021 <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 System; -- ****h* Tcl/Tcl -- FUNCTION -- Provides binding to Tcl API -- SOURCE package Tcl is -- **** --## rule off REDUCEABLE_SCOPE -- ****t* Tcl/Tcl.Tcl_Interpreter -- FUNCTION -- Pointer to the selected Tcl interpreter -- HISTORY -- 8.6.0 - Added -- SOURCE type Tcl_Interpreter is new System.Address; -- **** -- ****d* Tcl/Tcl.Null_Interpreter -- FUNCTION -- Not set Tcl interterpreter -- HISTORY -- 8.6.0 - Added -- SOURCE Null_Interpreter: constant Tcl_Interpreter := Tcl_Interpreter(System.Null_Address); -- **** -------------------------------- -- Initialization of Tcl binding -------------------------------- -- ****f* Tcl/Tcl.Create_Interpreter -- FUNCTION -- Create a new Tcl interpreter -- RESULT -- Pointer to the newly created Tcl interpreter -- HISTORY -- 8.6.0 - Added -- EXAMPLE -- -- Create a new Tcl interpreter -- My_Interpreter: constant Tcl_Interpreter := Create_Interpreter; -- SOURCE function Create_Interpreter return Tcl_Interpreter with Global => null, Import, Convention => C, External_Name => "Tcl_CreateInterp"; -- **** --## rule off REDUCEABLE_SCOPE -- ****f* Tcl/Set_Interpreter -- FUNCTION -- Set the default Tcl interpreter to the selected interpreter -- PARAMETERS -- Interpreter - The Tcl interpreter which will be set as default. If -- is Null_Interpreter. The dafault interpreter will remain -- unchanged -- HISTORY -- 8.6.0 - Added -- EXAMPLE -- -- Set My_Interpreter as the default Tcl interpreter -- Set_Interpreter(My_Interpreter); -- SOURCE procedure Set_Interpreter(Interpreter: Tcl_Interpreter) with Pre => Interpreter /= Null_Interpreter; -- **** -- ****f* Tcl/Tcl.Get_Interpreter -- FUNCTION -- Get the default Tcl interpreter -- HISTORY -- 8.6.0 - Added -- EXAMPLE -- -- Get the default Tcl interpreter -- My_Interpreter: constant Tcl_Interpreter := Get_Interpreter; -- SOURCE function Get_Interpreter return Tcl_Interpreter; -- **** -- ****f* Tcl/Tcl.Tcl_Init -- FUNCTION -- Initialize Tcl -- PARAMETERS -- Interpreter - Tcl interpreter to initialize -- HISTORY -- 8.6.0 - Added -- EXAMPLE -- -- Initialize Tcl on the new Tcl interpreter -- Is_Initialized: constant Boolean := Tcl_Init(Create_Interpreter); -- SOURCE function Tcl_Init(Interpreter: Tcl_Interpreter) return Boolean with Pre => Interpreter /= Null_Interpreter; -- **** ------------------------- -- Evaluation of Tcl code ------------------------- --## rule off TYPE_INITIAL_VALUES -- ****t* Tcl/Tcl.Tcl_Results -- FUNCTION -- Used as return Tcl result for commands -- OPTIONS -- TCL_OK - Used when a command finished successfuly. Standard result -- TCL_ERROR - Used when a command meet a problem -- TCL_RETURN - Used when a command want to emulate Tcl command return -- TCL_BREAK - Used when a command want to emulate Tcl command break -- TCL_CONTINUE - Used when a command want to emulate Tcl command continue -- HISTORY -- 8.6.0 - Added -- SOURCE type Tcl_Results is (TCL_OK, TCL_ERROR, TCL_RETURN, TCL_BREAK, TCL_CONTINUE) with Default_Value => TCL_OK; -- **** --## rule off TYPE_INITIAL_VALUES -- ****t* Tcl/Tcl.Tcl_Boolean_Result -- FUNCTION -- Used to store result of evaluation of Tcl command -- PARAMETERS -- Message_Length - The length of the error message returned by Tcl -- command. By most time it should be 0 -- Return_Code - The Tcl_Result returned by the Tcl command -- Message - If Return_Code is Tcl_Error it contains message -- returned by the Tcl command -- Result - The result of the Tcl command -- HISTORY -- 8.6.0 - Added -- SOURCE type Tcl_Boolean_Result(Message_Length: Natural) is record Return_Code: Tcl_Results; Message: String(1 .. Message_Length); Result: Boolean; end record; -- **** -- ****t* Tcl/Tcl.Tcl_String_Result -- FUNCTION -- Used to store result of evaluation of Tcl command -- PARAMETERS -- Message_Length - The length of the error message returned by Tcl -- command. By most time it should be 0 -- Result_Length - The length of the result string returned by Tcl -- command -- Return_Code - The Tcl_Result returned by the Tcl command -- Message - If Return_Code is Tcl_Error it contains message -- returned by the Tcl command -- Result - The result of the Tcl command -- HISTORY -- 8.6.0 - Added -- SOURCE type Tcl_String_Result(Message_Length, Result_Length: Natural) is record Return_Code: Tcl_Results; Message: String(1 .. Message_Length); Result: String(1 .. Result_Length); end record; -- **** -- ****t* Tcl/Tcl.Tcl_Integer_Result -- FUNCTION -- Used to store result of evaluation of Tcl command -- PARAMETERS -- Message_Length - The length of the error message returned by Tcl -- command. By most time it should be 0 -- Return_Code - The Tcl_Result returned by the Tcl command -- Message - If Return_Code is Tcl_Error it contains message -- returned by the Tcl command -- Result - The result of the Tcl command -- HISTORY -- 8.6.0 - Added -- SOURCE type Tcl_Integer_Result(Message_Length: Natural) is record Return_Code: Tcl_Results; Message: String(1 .. Message_Length); Result: Integer; end record; -- **** -- ****t* Tcl/Tcl.Tcl_Float_Result -- FUNCTION -- Used to store result of evaluation of Tcl command -- PARAMETERS -- Message_Length - The length of the error message returned by Tcl -- command. By most time it should be 0 -- Return_Code - The Tcl_Result returned by the Tcl command -- Message - If Return_Code is Tcl_Error it contains message -- returned by the Tcl command -- Result - The result of the Tcl command -- HISTORY -- 8.6.0 - Added -- SOURCE type Tcl_Float_Result(Message_Length: Natural) is record Return_Code: Tcl_Results; Message: String(1 .. Message_Length); Result: Float; end record; -- **** -- ****f* Tcl/Tcl.Tcl_Eval_(procedure) -- FUNCTION -- Evaluate the selected Tcl script on the selected Tcl intepreter -- PARAMETERS -- Tcl_Script - Tcl script to evaluate -- Interpreter - Tcl interpreter on which the script will be evaluated. -- By default it is current default Tcl interpreter -- HISTORY -- 8.6.0 - Added -- EXAMPLE -- -- Print hello world on default Tcl interpreter -- Tcl_Eval("puts {hello world}"); -- SEE ALSO -- Tcl.Tcl_Eval_(function) -- SOURCE procedure Tcl_Eval (Tcl_Script: String; Interpreter: Tcl_Interpreter := Get_Interpreter) with Pre => Tcl_Script'Length > 0 and Interpreter /= Null_Interpreter, Test_Case => (Name => "Test_Tcl_Eval", Mode => Nominal); -- **** -- ****f* Tcl/Tcl.Tcl_Eval_(function_string_result) -- FUNCTION -- Evaluate the selected Tcl script on the selected Tcl intepreter and -- return its result as String -- PARAMETERS -- Tcl_Script - Tcl script to evaluate -- Interpreter - Tcl interpreter on which the script will be evaluated. -- By default it is current default Tcl interpreter -- RESULT -- Tcl_String_Result with the result of the evaluation of Tcl_Script -- HISTORY -- 8.6.0 - Added -- EXAMPLE -- -- Get result of expresion on default Tcl interpreter -- Result: constant Tcl_String_Result := Tcl_Eval("expr 2 + 2"); -- SEE ALSO -- Tcl.Tcl_Eval_(procedure), Tcl.Tcl_Eval(function_boolean_result), -- Tcl.Tcl_Eval(function_integer_result), Tcl.Tcl_Eval(function_float_result) -- SOURCE function Tcl_Eval (Tcl_Script: String; Interpreter: Tcl_Interpreter := Get_Interpreter) return Tcl_String_Result with Pre => Tcl_Script'Length > 0 and Interpreter /= Null_Interpreter, Test_Case => (Name => "Test_Tcl_Eval2", Mode => Nominal); -- **** -- ****f* Tcl/Tcl.Tcl_Eval_(function_boolean_result) -- FUNCTION -- Evaluate the selected Tcl script on the selected Tcl intepreter and -- return its result as Tcl_Boolean_Result -- PARAMETERS -- Tcl_Script - Tcl script to evaluate -- Interpreter - Tcl interpreter on which the script will be evaluated. -- By default it is current default Tcl interpreter -- RESULT -- Tcl_Boolean_Result record with the result of the evaluation of Tcl_Script -- HISTORY -- 8.6.0 - Added -- EXAMPLE -- -- Get result of Tcl command on default Tcl interpreter -- Result: constant Tcl_Boolean_Result := Tcl_Eval("info exists myvar"); -- SEE ALSO -- Tcl.Tcl_Eval_(procedure), Tcl.Tcl_Eval(function_string_result), -- Tcl.Tcl_Eval(function_integer_result), Tcl.Tcl_Eval(function_float_result) -- SOURCE function Tcl_Eval (Tcl_Script: String; Interpreter: Tcl_Interpreter := Get_Interpreter) return Tcl_Boolean_Result with Pre => Tcl_Script'Length > 0 and Interpreter /= Null_Interpreter, Test_Case => (Name => "Test_Tcl_Eval3", Mode => Nominal); -- **** -- ****f* Tcl/Tcl.Tcl_Eval_(function_integer_result) -- FUNCTION -- Evaluate the selected Tcl script on the selected Tcl intepreter and -- return its result as Tcl_Integer_Result -- PARAMETERS -- Tcl_Script - Tcl script to evaluate -- Interpreter - Tcl interpreter on which the script will be evaluated. -- By default it is current default Tcl interpreter -- RESULT -- Tcl_Boolean_Result record with the result of the evaluation of Tcl_Script -- HISTORY -- 8.6.0 - Added -- EXAMPLE -- -- Get result of Tcl command on default Tcl interpreter -- Result: constant Tcl_Integer_Result := Tcl_Eval("expr 2 + 2"); -- SEE ALSO -- Tcl.Tcl_Eval_(procedure), Tcl.Tcl_Eval(function_string_result), -- Tcl.Tcl_Eval(function_boolean_result), Tcl.Tcl_Eval(function_float_result) -- SOURCE function Tcl_Eval (Tcl_Script: String; Interpreter: Tcl_Interpreter := Get_Interpreter) return Tcl_Integer_Result with Pre => Tcl_Script'Length > 0 and Interpreter /= Null_Interpreter, Test_Case => (Name => "Test_Tcl_Eval4", Mode => Nominal); -- **** -- ****f* Tcl/Tcl.Tcl_Eval_(function_float_result) -- FUNCTION -- Evaluate the selected Tcl script on the selected Tcl intepreter and -- return its result as Tcl_Float_Result -- PARAMETERS -- Tcl_Script - Tcl script to evaluate -- Interpreter - Tcl interpreter on which the script will be evaluated. -- By default it is current default Tcl interpreter -- RESULT -- Tcl_Boolean_Result record with the result of the evaluation of Tcl_Script -- HISTORY -- 8.6.0 - Added -- EXAMPLE -- -- Get result of Tcl command on default Tcl interpreter -- Result: constant Tcl_Float_Result := Tcl_Eval("expr 2.5 + 2.2"); -- SEE ALSO -- Tcl.Tcl_Eval_(procedure), Tcl.Tcl_Eval(function_string_result), -- Tcl.Tcl_Eval(function_boolean_result), Tcl.Tcl_Eval(function_integer_result) -- SOURCE function Tcl_Eval (Tcl_Script: String; Interpreter: Tcl_Interpreter := Get_Interpreter) return Tcl_Float_Result with Pre => Tcl_Script'Length > 0 and Interpreter /= Null_Interpreter, Test_Case => (Name => "Test_Tcl_Eval5", Mode => Nominal); -- **** -- ****f* Tcl/Tcl.Tcl_Eval_File -- FUNCTION -- Evaluate the selected file as Tcl script on the selected Tcl intepreter -- PARAMETERS -- File_Name - The path (absolute or relative) to the file which will -- be evaluated -- Interpreter - Tcl interpreter on which the file will be evaluated. -- By default it is current default Tcl interpreter -- RESULT -- Tcl_Result of evaluation of the selected file -- HISTORY -- 8.6.0 - Added -- EXAMPLE -- -- Evaluate file myscript.tcl on the default Tcl interpreter -- if Tcl_Eval_File("myscript.tcl") = TCL_ERROR then -- Ada.Text_IO.Put_Line("failed to evaluate myscript.tcl file."); -- end if; -- SEE ALSO -- Tcl.Tcl_Eval_(function) -- SOURCE function Tcl_Eval_File (File_Name: String; Interpreter: Tcl_Interpreter := Get_Interpreter) return Tcl_Results with Pre => File_Name'Length > 0 and Interpreter /= Null_Interpreter, Test_Case => (Name => "Test_Tcl_Eval_File", Mode => Nominal); -- **** --------------------------------------- -- Manipulating the Tcl commands result --------------------------------------- -- ****t* Tcl/Tcl.Result_Types -- FUNCTION -- Type of the Tcl commands result -- OPTIONS -- TCL_STATIC - The result string will not be changed by the code -- TCL_VOLATILE - The result string is volatile -- TCL_DYNAMIC - The result string will be changed by the code -- HISTORY -- 8.6.0 - Added -- SOURCE type Result_Types is (TCL_STATIC, TCL_VOLATILE, TCL_DYNAMIC) with Default_Value => TCL_STATIC; for Result_Types use (TCL_STATIC => 0, TCL_VOLATILE => 1, TCL_DYNAMIC => 3); -- **** -- ****d* Tcl/Default_Result_Type -- FUNCTION -- The default type of Tcl result -- HISTORY -- 8.6.0 - Added -- SOURCE Default_Result_Type: constant Result_Types := TCL_STATIC; -- **** -- ****f* Tcl/Tcl.Tcl_Get_Result_(string) -- FUNCTION -- Get the result of last Tcl command as string -- PARAMETERS -- Interpreter - Tcl interpreter from which the result will be taken. By -- default it is current default Tcl interpreter. -- RESULT -- String with the result of the last Tcl command -- HISTORY -- 8.6.0 - Added -- EXAMPLE -- -- Print the result of the last Tcl command on the default Tcl interpreter -- Ada.Text_IO.Put_Line(Tcl_Get_Result); -- SEE ALSO -- Tcl.Tcl_Get_Result_(integer), Tcl.Tcl_Get_Result_(float) -- SOURCE function Tcl_Get_Result (Interpreter: Tcl_Interpreter := Get_Interpreter) return String with Pre => Interpreter /= Null_Interpreter, Test_Case => (Name => "Test_Tcl_GetResult", Mode => Nominal); -- **** -- ****f* Tcl/Tcl.Tcl_Get_Result_(integer) -- FUNCTION -- Get the result of last Tcl command as integer -- PARAMETERS -- Interpreter - Tcl interpreter from which the result will be taken. By -- default it is current default Tcl interpreter. -- RESULT -- Integer value of the result of the last Tcl command, or 0 if no result -- is set or result cannot be converted to Integer -- HISTORY -- 8.6.0 - Added -- EXAMPLE -- -- Get the result of the last Tcl command on the default Tcl interpreter -- My_Result: constant Integer := Tcl_Get_Result; -- SEE ALSO -- Tcl.Tcl_Get_Result_(string), Tcl.Tcl_Get_Result_(float) -- SOURCE function Tcl_Get_Result (Interpreter: Tcl_Interpreter := Get_Interpreter) return Integer with Pre => Interpreter /= Null_Interpreter, Test_Case => (Name => "Test_Tcl_GetResult2", Mode => Nominal); -- **** -- ****f* Tcl/Tcl.Tcl_Get_Result_(float) -- FUNCTION -- Get the result of last Tcl command as float -- PARAMETERS -- Interpreter - Tcl interpreter from which the result will be taken. By -- default it is current default Tcl interpreter. -- RESULT -- Float value of the result of the last Tcl command -- HISTORY -- 8.6.0 - Added -- EXAMPLE -- -- Get the result of the last Tcl command on the default Tcl interpreter -- My_Result: constant Float := Tcl_Get_Result; -- SEE ALSO -- Tcl.Tcl_Get_Result_(string), Tcl.Tcl_Get_Result_(integer) -- SOURCE function Tcl_Get_Result (Interpreter: Tcl_Interpreter := Get_Interpreter) return Float is (Float'Value(Tcl_Get_Result(Interpreter => Interpreter))) with Pre => Interpreter /= Null_Interpreter, Test_Case => (Name => "Test_Tcl_GetResult3", Mode => Nominal); -- **** -- ****f* Tcl/Tcl.Tcl_Set_Result -- FUNCTION -- Set Tcl result value -- PARAMETERS -- Tcl_Result - String which will be set as Tcl result -- Result_Type - Type of the result. Can be only TCL_STATIC, TCL_VOLATILE -- or TCL_DYNAMIC -- Interpreter - Tcl interpreter on which the result will be set. By -- default it is current default Tcl interpreter. -- HISTORY -- 8.6.0 - Added -- EXAMPLE -- -- Set the Tcl result on the default Tcl interpreter to OK as static result -- Tcl_Set_Result("OK"); -- SOURCE procedure Tcl_Set_Result (Tcl_Result: String; Result_Type: Result_Types := Default_Result_Type; Interpreter: Tcl_Interpreter := Get_Interpreter) with Pre => Tcl_Result'Length > 0 and Interpreter /= Null_Interpreter, Test_Case => (Name => "Test_Tcl_SetResult", Mode => Nominal); -- **** ------------------- -- Various commands ------------------- -- ****f* Tcl/Tcl.Tcl_Update -- FUNCTION -- Process pending Tcl events and idle callbacks -- PARAMETERS -- Interpreter - Tcl interpreter on which events will be processed -- Idle_Tasks_Only - If true, process only idle events and callbacks, no -- new errors or events are processed. Default value -- is False: process everythings. -- HISTORY -- 8.6.0 - Added -- EXAMPLE -- -- Process all events and callbacks on the default Tcl interpreter -- Tcl_Update; -- SOURCE procedure Tcl_Update (Interpreter: Tcl_Interpreter := Get_Interpreter; Idle_Tasks_Only: Boolean := False) with Pre => Interpreter /= Null_Interpreter, Test_Case => (Name => "Test_Tcl_Update", Mode => Nominal); -- **** end Tcl;
programs/oeis/290/A290988.asm
neoneye/loda
22
5881
<reponame>neoneye/loda ; A290988: The arithmetic function v+-(n,3). ; 1,1,2,1,3,1,4,3,5,3,6,3,7,5,8,5,9,5,10,7,11,7,12,7,13,9,14,9,15,9,16,11,17,11,18,11,19,13,20,13,21,13,22,15,23,15,24,15,25,17,26,17,27,17,28,19,29,19,30,19,31,21,32,21,33,21,34,23,35 mov $2,$0 mod $0,2 mov $1,$2 mov $3,4 lpb $0 sub $0,1 div $1,6 mul $1,$3 lpe div $1,2 add $1,1 mov $0,$1
src/main/fragment/mos6502-common/vbsaa=pbsc1_derefidx_vbuxx_plus_pbsc1_derefidx_vbuyy.asm
jbrandwood/kickc
2
28299
clc lda {c1},x adc {c1},y
src/compiling/ANTLR/grammar/Primaries.g4
jecassis/VSCode-SystemVerilog
75
5297
<gh_stars>10-100 grammar Primaries; import ExpressionLeftsideValues; constant_primary : primary_literal | ps_parameter_identifier constant_select | specparam_identifier ( '[' constant_range_expression ']' )? | genvar_identifier | formal_port_identifier constant_select | ( package_scope | class_scope )? enum_identifier | constant_concatenation ( '[' constant_range_expression ']' )? | constant_multiple_concatenation ( '[' constant_range_expression ']' )? | subroutine_call | constant_let_expression | '(' constant_mintypmax_expression ')' | ( simple_type | signing | 'string' | 'const' ) APOSTROPHE '(' constant_expression ')' | constant_primary APOSTROPHE '(' constant_expression ')' | constant_assignment_pattern_expression | type_reference | 'null' ; primary : primary_literal | ( class_qualifier | package_scope )? hierarchical_identifier select | empty_unpacked_array_concatenation | concatenation ( '[' range_expression ']' )? | multiple_concatenation ( '[' range_expression ']' )? | function_subroutine_call | let_expression | '(' mintypmax_expression ')' | ( simple_type | constant_primary | signing | 'string' | 'const' ) APOSTROPHE '(' expression ')' | assignment_pattern_expression | streaming_concatenation | sequence_method_call | 'this' | '$' | 'null' ; module_path_primary : number | identifier | module_path_concatenation | module_path_multiple_concatenation | function_subroutine_call | '(' module_path_mintypmax_expression ')' ; class_qualifier : ( 'local' '::' )? ( implicit_class_handle '.' | class_scope )? ; range_expression : expression | part_select_range ; primary_literal : number | time_literal | unbased_unsized_literal | string_literal ; time_literal : unsigned_number time_unit | fixed_point_number time_unit ; time_unit : LOWER_S | LOWER_MS | LOWER_US | LOWER_NS | LOWER_PS | LOWER_FS ; implicit_class_handle : 'this' | 'super' | 'this' '.' 'super' ; bit_select : ( '[' expression ']' )* ; select : ( ( '.' member_identifier bit_select )* '.' member_identifier )? bit_select ( '[' part_select_range ']' )? ; nonrange_select : ( ( '.' member_identifier bit_select )* '.' member_identifier )? bit_select ; constant_bit_select : ( '[' constant_expression ']' )* ; constant_select : ( ( '.' member_identifier constant_bit_select )* '.' member_identifier )? constant_bit_select ( '[' constant_part_select_range ']' )? ; constant_let_expression : let_expression ;
1-base/lace/source/text/lace-text-utility.ads
charlie5/lace-alire
1
16904
<filename>1-base/lace/source/text/lace-text-utility.ads package lace.Text.utility -- -- Provides utility subprograms. -- is function replace (Self : in Text.item; Pattern : in String; By : in String) return Text.item; -- -- If the replacement exceeds the capacity of 'Self', the result will be expanded. procedure replace (Self : in out Text.item; Pattern : in String; By : in String); -- -- 'Text.Error' will be raised if the replacement exceeds the capacity of 'Self'. end lace.Text.utility;
OlderBasicILP/Indirect.agda
mietek/hilbert-gentzen
29
4264
<filename>OlderBasicILP/Indirect.agda module OlderBasicILP.Indirect where open import Common.Context public -- Propositions of intuitionistic logic of proofs, without ∨, ⊥, or +. infixr 10 _⦂_ infixl 9 _∧_ infixr 7 _▻_ data Ty (X : Set) : Set where α_ : Atom → Ty X _▻_ : Ty X → Ty X → Ty X _⦂_ : X → Ty X → Ty X _∧_ : Ty X → Ty X → Ty X ⊤ : Ty X module _ {X : Set} where infix 7 _▻◅_ _▻◅_ : Ty X → Ty X → Ty X A ▻◅ B = (A ▻ B) ∧ (B ▻ A) -- Additional useful propositions. _⦂⋆_ : ∀ {n} → VCx X n → VCx (Ty X) n → Cx (Ty X) ∅ ⦂⋆ ∅ = ∅ (TS , T) ⦂⋆ (Ξ , A) = (TS ⦂⋆ Ξ) , (T ⦂ A)