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 |
|---|---|---|---|---|
src/cups-conversions.ads | persan/a-cups | 0 | 28509 | <gh_stars>0
private package Cups.Conversions is
end Cups.Conversions;
|
programs/oeis/117/A117573.asm | karttu/loda | 0 | 246773 | <gh_stars>0
; A117573: Expansion of (1+2x^2)/((1-x)(1-x^2)(1-x^3)).
; 1,1,4,5,8,11,15,18,24,28,34,40,47,53,62,69,78,87,97,106,118,128,140,152,165,177,192,205,220,235,251,266,284,300,318,336,355,373,394,413,434,455,477,498,522,544,568,592,617,641,668
mov $2,$0
add $2,1
lpb $2,1
add $1,1
trn $2,2
mov $3,2
mov $4,$2
lpb $4,1
add $1,3
trn $4,$3
lpe
trn $2,1
lpe
|
libsrc/sprites/software/sp1/ts2068hr/tiles/sp1_GetTiles_callee.asm | andydansby/z88dk-mk2 | 1 | 97963 | <filename>libsrc/sprites/software/sp1/ts2068hr/tiles/sp1_GetTiles_callee.asm
; void __CALLEE__ sp1_GetTiles_callee(struct sp1_Rect *r, struct sp1_tp *dest)
; 01.2008 aralbrec, Sprite Pack v3.0
; ts2068 hi-res version
XLIB sp1_GetTiles_callee
XDEF ASMDISP_SP1_GETTILES_CALLEE
LIB sp1_GetUpdateStruct_callee
XREF ASMDISP_SP1_GETUPDATESTRUCT_CALLEE, SP1V_DISPWIDTH
.sp1_GetTiles_callee
pop af
pop hl
ex (sp),hl
ld d,(hl)
inc hl
ld e,(hl)
inc hl
ld b,(hl)
inc hl
ld c,(hl)
pop hl
push af
.asmentry
; Copy colour and tile from background into destination array. Can
; be printed to screen as a macro by SP1PutTiles.
;
; enter : hl = & struct sp1_tp[] destination array to store tile info
; d = row coord
; e = col coord
; b = width
; c = height
; uses : af, bc, de, hl, ixl
.SP1GetTiles
push hl
call sp1_GetUpdateStruct_callee + ASMDISP_SP1_GETUPDATESTRUCT_CALLEE ; hl = & struct sp1_update
pop de ; de = dest address
inc hl
ld ixl,c ; ixl = height
ld c,$ff
.rowloop
push bc ; save b = width
push hl ; save update position
.colloop
ldi
ldi
ld a,7
add a,l
ld l,a
jp nc, noinc
inc h
.noinc
djnz colloop
pop hl ; hl = & struct sp1_update in same row leftmost column
ld bc,9*SP1V_DISPWIDTH
add hl,bc ; hl = & struct sp1_update in next row leftmost column
pop bc
dec ixl
jp nz, rowloop
ret
DEFC ASMDISP_SP1_GETTILES_CALLEE = asmentry - sp1_GetTiles_callee
|
Structure/Relator/Equivalence.agda | Lolirofle/stuff-in-agda | 6 | 931 | <gh_stars>1-10
module Structure.Relator.Equivalence where
import Lvl
open import Logic
open import Logic.Propositional
open import Structure.Relator.Properties
hiding (reflexivity ; symmetry ; transitivity)
open import Type
private variable ℓ₁ ℓ₂ : Lvl.Level
-- An equivalence relation is a reflexive, symmetric and transitive relation.
record Equivalence {T : Type{ℓ₁}} (_≡_ : T → T → Stmt{ℓ₂}) : Stmt{ℓ₁ Lvl.⊔ ℓ₂} where
instance constructor intro
field
instance ⦃ reflexivity ⦄ : Reflexivity (_≡_)
instance ⦃ symmetry ⦄ : Symmetry (_≡_)
instance ⦃ transitivity ⦄ : Transitivity (_≡_)
|
nasm-8086-assembly-course/0x01-hello/hello.asm | ailtonbsj/buffer-overflow-studies | 0 | 161593 | <reponame>ailtonbsj/buffer-overflow-studies
section .data
msg db 'Hello World!', 0xa
tam equ $- msg ; Count length of bytes in msg
section .text
global _start
_start:
; send data to standard output
mov eax, 0x4 ; Write data code
mov ebx, 0x1 ; On standard output
mov ecx, msg
mov edx, tam
int 0x80 ; call OS interrupt vector
; Finish program correctly
mov eax, 0x1 ; had to finish program
mov ebx, 0x0 ; return value 0
int 0x80 ; call OS interrupt vector |
ANTLRTestProjects/freeform/GrammarsAdhoc/grammar/imports/basics.g4 | timboudreau/ANTLR4-Plugins-for-NetBeans | 1 | 2655 | lexer grammar basics;
fragment WORDS
: INLINE_WHITESPACE? ( WORD_LIKE | NUMBER_LIKE ) SAFE_PUNCTUATION?
INLINE_WHITESPACE??;
// allow a single underscore or asterisk in a word, i.e. _FOO_BAR_ is "FOO_BAR" italicized,
// but "_FOO_BAR" is "FOO_BAR" with FOO italicized.
// Note the first alternative must not allow trailing punctuation, or for example,
// a sentence like "Make the wheel _rounder_." will get the first _ parsed as an
// opending italic token, and then "rounder_." treated as a word.
fragment WORD_LIKE
: (( LETTER )+ ( LETTER | DIGIT | SAFE_PUNCTUATION )* ( LETTER | DIGIT |
SAFE_PUNCTUATION | UNDERSCORE+ | ASTERISK+ )( LETTER | DIGIT )+ )
| ( LETTER DIGIT )
| ( LETTER )( LETTER | DIGIT | SAFE_PUNCTUATION )*;
fragment WORD_OR_NUMBER_LIKE
: ( LETTER | DIGIT | PUNCTUATION )+;
fragment NUMBER_LIKE
: DIGIT+;
fragment SAFE_PUNCTUATION
: [><{}/\\:;,+!@.$%^&\-='"?¿¡]
| '\\`'
| '\\*';
fragment NON_BACKTICK
:~[`]+;
fragment PUNCTUATION
: [\p{Punctuation}];
fragment LETTER
: [\p{Alphabetic}];
fragment DIGIT
: [\p{Digit}];
fragment NON_HR
:~[ -*];
fragment ALL_WS
: INLINE_WHITESPACE
| NEWLINE;
fragment DOUBLE_NEWLINE
: NEWLINE NEWLINE NEWLINE*?;
fragment NEWLINE
: '\n';
fragment SPECIAL_CHARS
: ASTERISK
| STRIKE
| BACKTICK
| POUND
| STRIKE;
fragment NON_WHITESPACE
:~[ \r\n\t];
// :~[\p{White_Space}];
fragment LINK_TEXT
: [a-zA-Z0-9\-_$/\\.!?+=&^%#];
fragment PRE
: '```';
fragment INLINE_WHITESPACE
: [ \r\t];
fragment SPACE
: ' ';
fragment TAB
: '\t';
fragment CARRIAGE_RETURN
: '\r';
fragment BACKSLASH
: '\\';
fragment SQUOTE
: '\'';
fragment DQUOTE
: '"';
fragment OPEN_PAREN
: '(';
fragment CLOSE_PAREN
: ')';
fragment OPEN_BRACE
: '{';
fragment CLOSE_BRACE
: '}';
fragment OPEN_BRACKET
: '[';
fragment CLOSE_BRACKET
: ']';
fragment COLON
: ':';
fragment AMPERSAND
: '&';
fragment COMMA
: ',';
fragment PLUS
: '+';
fragment DOLLARS
: '$';
fragment PERCENT
: '%';
fragment CAREN
: '^';
fragment AT
: '@';
fragment BANG
: '!';
fragment GT
: '>';
fragment LT
: '<';
fragment QUESTION
: '?';
fragment SEMICOLON
: ';';
fragment SLASH
: '/';
fragment UNDERSCORE
: '_';
fragment STRIKE
: '~~';
fragment BACKTICK
: '`';
fragment DASH
: '-';
fragment EQUALS
: '=';
fragment ASTERISK
: '*';
fragment POUND
: '#';
fragment DOT
: '.';
|
Tests/Antlr4Tests/LexerB.g4 | LuizZak/Antlr4-Swift | 5 | 4678 | lexer grammar LexerB;
ID : 'a'..'z'+;
INT : '0'..'9'+;
SEMI : ';';
MUL : '*';
PLUS : '+';
ASSIGN : '=';
WS : ' '+;
|
util/testdata/applescript.scpt | QuantumGhost/awgo | 736 | 2029 | on run(argv)
return first item of argv
end run |
Task/Sort-disjoint-sublist/AppleScript/sort-disjoint-sublist-2.applescript | mullikine/RosettaCodeData | 1 | 2801 | {7, 0, 5, 4, 3, 2, 1, 6}
|
oeis/260/A260222.asm | neoneye/loda-programs | 11 | 178100 | <reponame>neoneye/loda-programs
; A260222: a(n)=gcd(n,F(n-1)), where F(n) is the n-th Fibonacci number.
; Submitted by <NAME>(s2)
; 1,1,1,2,1,1,1,1,3,2,11,1,1,1,1,2,1,1,19,1,3,2,1,1,1,1,1,2,29,1,31,1,3,2,1,1,1,1,1,2,41,1,1,1,3,2,1,1,7,1,1,2,1,1,1,1,3,2,59,1,61,1,1,2,1,1,1,1,3,2,71,1,1,1,1,2,1,13,79,1,3,2,1,1,1,1,1,2,89,1,1,1,3,2,1,1,1,1,1,2
mov $2,$0
seq $0,45 ; Fibonacci numbers: F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1.
add $2,1
gcd $2,$0
mov $0,$2
|
src/sm/rewards.asm | TarThoron/alttp_sm_combo_randomizer_rom | 0 | 29672 | <reponame>TarThoron/alttp_sm_combo_randomizer_rom
; $A7:C831 9F 28 D8 7E STA $7ED828,x[$7E:D828] ; Set Kraid as dead
; $A7:DB85 9F 28 D8 7E STA $7ED828,x[$7E:D82B] ; Set Phantoon as dead
; $A5:92DE 9F 28 D8 7E STA $7ED828,x[$7E:D82C] ; Set Draygon as dead
; $A6:C5E2 22 A6 81 80 JSL $8081A6[$80:81A6] ; Set Ridley as dead
; Hook Kraid death
org $e7c831
jsl boss_death_kraid
org $e7db85
jsl boss_death_phantoon
org $e592de
jsl boss_death_draygon
org $e6c5e2
jsl boss_death_ridley
org $cfa68f
dw $91d6 ; Disable G4 Statue Animations
; G4 opening is only triggered by the new event flags
org $d9f000
base $99f000
boss_death_kraid:
sta $7ed828,x ; Store actual boss kill flag
lda #$0000
jsr boss_death_reward
rtl
boss_death_phantoon:
sta $7ed828,x ; Store actual boss kill flag
lda #$0008
jsr boss_death_reward
rtl
boss_death_draygon:
sta $7ed828,x ; Store actual boss kill flag
lda #$0010
jsr boss_death_reward
rtl
boss_death_ridley:
jsl $8081a6 ; Store actual boss kill flag
lda #$0018
jsr boss_death_reward
rtl
boss_death_reward:
phx : php : tax
; Load boss reward type from table
%a8()
lda.l boss_rewards, x
sta $c7
beq .pendant
cmp #$40
beq .crystal
bra .smboss
.pendant
lda.l boss_rewards+$2, x
sta $c9
ora.l !SRAM_ALTTP_ITEM_BUF+$74
sta.l !SRAM_ALTTP_ITEM_BUF+$74
bra .exit
.crystal
lda.l boss_rewards+$2, x
sta $c9
ora.l !SRAM_ALTTP_ITEM_BUF+$7A
sta.l !SRAM_ALTTP_ITEM_BUF+$7A
bra .exit
.smboss
; Save to special event bits for boss tokens (not the actual boss kill flags that opens doors)
; Although in a future update adding the option of this also setting those flags should be a possibility
lda.l boss_rewards+$2, x
sta $c9
ora.l $7ed832
sta.l $7ed832
bra .exit
.exit
%ai16()
; Show message box
lda #$0063
jsl $858080
plp : plx
rts
rewards_draw_map_icons:
phx : phy : phb
pea $8282 : plb : plb
lda !SRAM_ALTTP_ITEM_BUF+$7A : bit #$0002 : beq +
ldy.w #BlueCrystal_Icon_Spritemap
lda #$0020 : sta $12
lda #$0002 : sta $14
lda #$3e00 : sta $16
jsl $81879f
+
lda !SRAM_ALTTP_ITEM_BUF+$7A : bit #$0010 : beq +
ldy.w #BlueCrystal_Icon_Spritemap
lda #$0020 : sta $12
lda #$000A : sta $14
lda #$3e00 : sta $16
jsl $81879f
+
lda !SRAM_ALTTP_ITEM_BUF+$7A : bit #$0040 : beq +
ldy.w #BlueCrystal_Icon_Spritemap
lda #$0020 : sta $12
lda #$0012 : sta $14
lda #$3e00 : sta $16
jsl $81879f
+
lda !SRAM_ALTTP_ITEM_BUF+$7A : bit #$0020 : beq +
ldy.w #BlueCrystal_Icon_Spritemap
lda #$0020 : sta $12
lda #$001A : sta $14
lda #$3e00 : sta $16
jsl $81879f
+
lda !SRAM_ALTTP_ITEM_BUF+$7A : bit #$0004 : beq +
ldy.w #RedCrystal_Icon_Spritemap
lda #$0020 : sta $12
lda #$0022 : sta $14
lda #$3e00 : sta $16
jsl $81879f
+
lda !SRAM_ALTTP_ITEM_BUF+$7A : bit #$0001 : beq +
ldy.w #RedCrystal_Icon_Spritemap
lda #$0020 : sta $12
lda #$002A : sta $14
lda #$3e00 : sta $16
jsl $81879f
+
lda !SRAM_ALTTP_ITEM_BUF+$7A : bit #$0008 : beq +
ldy.w #BlueCrystal_Icon_Spritemap
lda #$0020 : sta $12
lda #$0032 : sta $14
lda #$3e00 : sta $16
jsl $81879f
+
lda !SRAM_ALTTP_ITEM_BUF+$74 : bit #$0004 : beq +
ldy.w #GreenPendant_Icon_Spritemap
lda #$0020 : sta $12
lda #$003A : sta $14
lda #$3e00 : sta $16
jsl $81879f
+
lda !SRAM_ALTTP_ITEM_BUF+$74 : bit #$0002 : beq +
ldy.w #BluePendant_Icon_Spritemap
lda #$0020 : sta $12
lda #$0042 : sta $14
lda #$3e00 : sta $16
jsl $81879f
+
lda !SRAM_ALTTP_ITEM_BUF+$74 : bit #$0001 : beq +
ldy.w #RedPendant_Icon_Spritemap
lda #$0020 : sta $12
lda #$004A : sta $14
lda #$3e00 : sta $16
jsl $81879f
+
lda $7ed832 : bit #$0001 : beq +
ldy.w #BossKraid_Icon_Spritemap
lda #$0020 : sta $12
lda #$00DE : sta $14
lda #$3e00 : sta $16
jsl $81879f
+
lda $7ed832 : bit #$0002 : beq +
ldy.w #BossPhantoon_Icon_Spritemap
lda #$0020 : sta $12
lda #$00E6 : sta $14
lda #$3e00 : sta $16
jsl $81879f
+
lda $7ed832 : bit #$0004 : beq +
ldy.w #BossDraygon_Icon_Spritemap
lda #$0020 : sta $12
lda #$00EE : sta $14
lda #$3e00 : sta $16
jsl $81879f
+
lda $7ed832 : bit #$0008 : beq +
ldy.w #BossRidley_Icon_Spritemap
lda #$0020 : sta $12
lda #$00F6 : sta $14
lda #$3e00 : sta $16
jsl $81879f
+
plb : ply : plx
rtl |
contrib/boringssl-cmake/win-x86_64/crypto/test/trampoline-x86_64.asm | pdv-ru/ClickHouse | 15,577 | 93994 | ; This file is generated from a similarly-named Perl script in the BoringSSL
; source tree. Do not edit by hand.
default rel
%define XMMWORD
%define YMMWORD
%define ZMMWORD
%ifdef BORINGSSL_PREFIX
%include "boringssl_prefix_symbols_nasm.inc"
%endif
section .text code align=64
global abi_test_trampoline
ALIGN 16
abi_test_trampoline:
$L$abi_test_trampoline_seh_begin:
sub rsp,344
$L$abi_test_trampoline_seh_prolog_alloc:
mov QWORD[112+rsp],rbx
$L$abi_test_trampoline_seh_prolog_rbx:
mov QWORD[120+rsp],rbp
$L$abi_test_trampoline_seh_prolog_rbp:
mov QWORD[128+rsp],rdi
$L$abi_test_trampoline_seh_prolog_rdi:
mov QWORD[136+rsp],rsi
$L$abi_test_trampoline_seh_prolog_rsi:
mov QWORD[144+rsp],r12
$L$abi_test_trampoline_seh_prolog_r12:
mov QWORD[152+rsp],r13
$L$abi_test_trampoline_seh_prolog_r13:
mov QWORD[160+rsp],r14
$L$abi_test_trampoline_seh_prolog_r14:
mov QWORD[168+rsp],r15
$L$abi_test_trampoline_seh_prolog_r15:
movdqa XMMWORD[176+rsp],xmm6
$L$abi_test_trampoline_seh_prolog_xmm6:
movdqa XMMWORD[192+rsp],xmm7
$L$abi_test_trampoline_seh_prolog_xmm7:
movdqa XMMWORD[208+rsp],xmm8
$L$abi_test_trampoline_seh_prolog_xmm8:
movdqa XMMWORD[224+rsp],xmm9
$L$abi_test_trampoline_seh_prolog_xmm9:
movdqa XMMWORD[240+rsp],xmm10
$L$abi_test_trampoline_seh_prolog_xmm10:
movdqa XMMWORD[256+rsp],xmm11
$L$abi_test_trampoline_seh_prolog_xmm11:
movdqa XMMWORD[272+rsp],xmm12
$L$abi_test_trampoline_seh_prolog_xmm12:
movdqa XMMWORD[288+rsp],xmm13
$L$abi_test_trampoline_seh_prolog_xmm13:
movdqa XMMWORD[304+rsp],xmm14
$L$abi_test_trampoline_seh_prolog_xmm14:
movdqa XMMWORD[320+rsp],xmm15
$L$abi_test_trampoline_seh_prolog_xmm15:
$L$abi_test_trampoline_seh_prolog_end:
mov rbx,QWORD[rdx]
mov rbp,QWORD[8+rdx]
mov rdi,QWORD[16+rdx]
mov rsi,QWORD[24+rdx]
mov r12,QWORD[32+rdx]
mov r13,QWORD[40+rdx]
mov r14,QWORD[48+rdx]
mov r15,QWORD[56+rdx]
movdqa xmm6,XMMWORD[64+rdx]
movdqa xmm7,XMMWORD[80+rdx]
movdqa xmm8,XMMWORD[96+rdx]
movdqa xmm9,XMMWORD[112+rdx]
movdqa xmm10,XMMWORD[128+rdx]
movdqa xmm11,XMMWORD[144+rdx]
movdqa xmm12,XMMWORD[160+rdx]
movdqa xmm13,XMMWORD[176+rdx]
movdqa xmm14,XMMWORD[192+rdx]
movdqa xmm15,XMMWORD[208+rdx]
mov QWORD[88+rsp],rcx
mov QWORD[96+rsp],rdx
mov r10,r8
mov r11,r9
dec r11
js NEAR $L$args_done
mov rcx,QWORD[r10]
add r10,8
dec r11
js NEAR $L$args_done
mov rdx,QWORD[r10]
add r10,8
dec r11
js NEAR $L$args_done
mov r8,QWORD[r10]
add r10,8
dec r11
js NEAR $L$args_done
mov r9,QWORD[r10]
add r10,8
lea rax,[32+rsp]
$L$args_loop:
dec r11
js NEAR $L$args_done
mov QWORD[104+rsp],r11
mov r11,QWORD[r10]
mov QWORD[rax],r11
mov r11,QWORD[104+rsp]
add r10,8
add rax,8
jmp NEAR $L$args_loop
$L$args_done:
mov rax,QWORD[88+rsp]
mov r10,QWORD[384+rsp]
test r10,r10
jz NEAR $L$no_unwind
pushfq
or QWORD[rsp],0x100
popfq
nop
global abi_test_unwind_start
abi_test_unwind_start:
call rax
global abi_test_unwind_return
abi_test_unwind_return:
pushfq
and QWORD[rsp],-0x101
popfq
global abi_test_unwind_stop
abi_test_unwind_stop:
jmp NEAR $L$call_done
$L$no_unwind:
call rax
$L$call_done:
mov rdx,QWORD[96+rsp]
mov QWORD[rdx],rbx
mov QWORD[8+rdx],rbp
mov QWORD[16+rdx],rdi
mov QWORD[24+rdx],rsi
mov QWORD[32+rdx],r12
mov QWORD[40+rdx],r13
mov QWORD[48+rdx],r14
mov QWORD[56+rdx],r15
movdqa XMMWORD[64+rdx],xmm6
movdqa XMMWORD[80+rdx],xmm7
movdqa XMMWORD[96+rdx],xmm8
movdqa XMMWORD[112+rdx],xmm9
movdqa XMMWORD[128+rdx],xmm10
movdqa XMMWORD[144+rdx],xmm11
movdqa XMMWORD[160+rdx],xmm12
movdqa XMMWORD[176+rdx],xmm13
movdqa XMMWORD[192+rdx],xmm14
movdqa XMMWORD[208+rdx],xmm15
mov rbx,QWORD[112+rsp]
mov rbp,QWORD[120+rsp]
mov rdi,QWORD[128+rsp]
mov rsi,QWORD[136+rsp]
mov r12,QWORD[144+rsp]
mov r13,QWORD[152+rsp]
mov r14,QWORD[160+rsp]
mov r15,QWORD[168+rsp]
movdqa xmm6,XMMWORD[176+rsp]
movdqa xmm7,XMMWORD[192+rsp]
movdqa xmm8,XMMWORD[208+rsp]
movdqa xmm9,XMMWORD[224+rsp]
movdqa xmm10,XMMWORD[240+rsp]
movdqa xmm11,XMMWORD[256+rsp]
movdqa xmm12,XMMWORD[272+rsp]
movdqa xmm13,XMMWORD[288+rsp]
movdqa xmm14,XMMWORD[304+rsp]
movdqa xmm15,XMMWORD[320+rsp]
add rsp,344
DB 0F3h,0C3h ;repret
$L$abi_test_trampoline_seh_end:
global abi_test_clobber_rax
ALIGN 16
abi_test_clobber_rax:
xor rax,rax
DB 0F3h,0C3h ;repret
global abi_test_clobber_rbx
ALIGN 16
abi_test_clobber_rbx:
xor rbx,rbx
DB 0F3h,0C3h ;repret
global abi_test_clobber_rcx
ALIGN 16
abi_test_clobber_rcx:
xor rcx,rcx
DB 0F3h,0C3h ;repret
global abi_test_clobber_rdx
ALIGN 16
abi_test_clobber_rdx:
xor rdx,rdx
DB 0F3h,0C3h ;repret
global abi_test_clobber_rdi
ALIGN 16
abi_test_clobber_rdi:
xor rdi,rdi
DB 0F3h,0C3h ;repret
global abi_test_clobber_rsi
ALIGN 16
abi_test_clobber_rsi:
xor rsi,rsi
DB 0F3h,0C3h ;repret
global abi_test_clobber_rbp
ALIGN 16
abi_test_clobber_rbp:
xor rbp,rbp
DB 0F3h,0C3h ;repret
global abi_test_clobber_r8
ALIGN 16
abi_test_clobber_r8:
xor r8,r8
DB 0F3h,0C3h ;repret
global abi_test_clobber_r9
ALIGN 16
abi_test_clobber_r9:
xor r9,r9
DB 0F3h,0C3h ;repret
global abi_test_clobber_r10
ALIGN 16
abi_test_clobber_r10:
xor r10,r10
DB 0F3h,0C3h ;repret
global abi_test_clobber_r11
ALIGN 16
abi_test_clobber_r11:
xor r11,r11
DB 0F3h,0C3h ;repret
global abi_test_clobber_r12
ALIGN 16
abi_test_clobber_r12:
xor r12,r12
DB 0F3h,0C3h ;repret
global abi_test_clobber_r13
ALIGN 16
abi_test_clobber_r13:
xor r13,r13
DB 0F3h,0C3h ;repret
global abi_test_clobber_r14
ALIGN 16
abi_test_clobber_r14:
xor r14,r14
DB 0F3h,0C3h ;repret
global abi_test_clobber_r15
ALIGN 16
abi_test_clobber_r15:
xor r15,r15
DB 0F3h,0C3h ;repret
global abi_test_clobber_xmm0
ALIGN 16
abi_test_clobber_xmm0:
pxor xmm0,xmm0
DB 0F3h,0C3h ;repret
global abi_test_clobber_xmm1
ALIGN 16
abi_test_clobber_xmm1:
pxor xmm1,xmm1
DB 0F3h,0C3h ;repret
global abi_test_clobber_xmm2
ALIGN 16
abi_test_clobber_xmm2:
pxor xmm2,xmm2
DB 0F3h,0C3h ;repret
global abi_test_clobber_xmm3
ALIGN 16
abi_test_clobber_xmm3:
pxor xmm3,xmm3
DB 0F3h,0C3h ;repret
global abi_test_clobber_xmm4
ALIGN 16
abi_test_clobber_xmm4:
pxor xmm4,xmm4
DB 0F3h,0C3h ;repret
global abi_test_clobber_xmm5
ALIGN 16
abi_test_clobber_xmm5:
pxor xmm5,xmm5
DB 0F3h,0C3h ;repret
global abi_test_clobber_xmm6
ALIGN 16
abi_test_clobber_xmm6:
pxor xmm6,xmm6
DB 0F3h,0C3h ;repret
global abi_test_clobber_xmm7
ALIGN 16
abi_test_clobber_xmm7:
pxor xmm7,xmm7
DB 0F3h,0C3h ;repret
global abi_test_clobber_xmm8
ALIGN 16
abi_test_clobber_xmm8:
pxor xmm8,xmm8
DB 0F3h,0C3h ;repret
global abi_test_clobber_xmm9
ALIGN 16
abi_test_clobber_xmm9:
pxor xmm9,xmm9
DB 0F3h,0C3h ;repret
global abi_test_clobber_xmm10
ALIGN 16
abi_test_clobber_xmm10:
pxor xmm10,xmm10
DB 0F3h,0C3h ;repret
global abi_test_clobber_xmm11
ALIGN 16
abi_test_clobber_xmm11:
pxor xmm11,xmm11
DB 0F3h,0C3h ;repret
global abi_test_clobber_xmm12
ALIGN 16
abi_test_clobber_xmm12:
pxor xmm12,xmm12
DB 0F3h,0C3h ;repret
global abi_test_clobber_xmm13
ALIGN 16
abi_test_clobber_xmm13:
pxor xmm13,xmm13
DB 0F3h,0C3h ;repret
global abi_test_clobber_xmm14
ALIGN 16
abi_test_clobber_xmm14:
pxor xmm14,xmm14
DB 0F3h,0C3h ;repret
global abi_test_clobber_xmm15
ALIGN 16
abi_test_clobber_xmm15:
pxor xmm15,xmm15
DB 0F3h,0C3h ;repret
global abi_test_bad_unwind_wrong_register
ALIGN 16
abi_test_bad_unwind_wrong_register:
$L$abi_test_bad_unwind_wrong_register_seh_begin:
push r12
$L$abi_test_bad_unwind_wrong_register_seh_push_r13:
nop
pop r12
DB 0F3h,0C3h ;repret
$L$abi_test_bad_unwind_wrong_register_seh_end:
global abi_test_bad_unwind_temporary
ALIGN 16
abi_test_bad_unwind_temporary:
$L$abi_test_bad_unwind_temporary_seh_begin:
push r12
$L$abi_test_bad_unwind_temporary_seh_push_r12:
mov rax,r12
inc rax
mov QWORD[rsp],rax
mov QWORD[rsp],r12
pop r12
DB 0F3h,0C3h ;repret
$L$abi_test_bad_unwind_temporary_seh_end:
global abi_test_get_and_clear_direction_flag
abi_test_get_and_clear_direction_flag:
pushfq
pop rax
and rax,0x400
shr rax,10
cld
DB 0F3h,0C3h ;repret
global abi_test_set_direction_flag
abi_test_set_direction_flag:
std
DB 0F3h,0C3h ;repret
global abi_test_bad_unwind_epilog
ALIGN 16
abi_test_bad_unwind_epilog:
$L$abi_test_bad_unwind_epilog_seh_begin:
push r12
$L$abi_test_bad_unwind_epilog_seh_push_r12:
nop
pop r12
nop
DB 0F3h,0C3h ;repret
$L$abi_test_bad_unwind_epilog_seh_end:
section .pdata rdata align=4
ALIGN 4
DD $L$abi_test_trampoline_seh_begin wrt ..imagebase
DD $L$abi_test_trampoline_seh_end wrt ..imagebase
DD $L$abi_test_trampoline_seh_info wrt ..imagebase
DD $L$abi_test_bad_unwind_wrong_register_seh_begin wrt ..imagebase
DD $L$abi_test_bad_unwind_wrong_register_seh_end wrt ..imagebase
DD $L$abi_test_bad_unwind_wrong_register_seh_info wrt ..imagebase
DD $L$abi_test_bad_unwind_temporary_seh_begin wrt ..imagebase
DD $L$abi_test_bad_unwind_temporary_seh_end wrt ..imagebase
DD $L$abi_test_bad_unwind_temporary_seh_info wrt ..imagebase
DD $L$abi_test_bad_unwind_epilog_seh_begin wrt ..imagebase
DD $L$abi_test_bad_unwind_epilog_seh_end wrt ..imagebase
DD $L$abi_test_bad_unwind_epilog_seh_info wrt ..imagebase
section .xdata rdata align=8
ALIGN 8
$L$abi_test_trampoline_seh_info:
DB 1
DB $L$abi_test_trampoline_seh_prolog_end-$L$abi_test_trampoline_seh_begin
DB 38
DB 0
DB $L$abi_test_trampoline_seh_prolog_xmm15-$L$abi_test_trampoline_seh_begin
DB 248
DW 20
DB $L$abi_test_trampoline_seh_prolog_xmm14-$L$abi_test_trampoline_seh_begin
DB 232
DW 19
DB $L$abi_test_trampoline_seh_prolog_xmm13-$L$abi_test_trampoline_seh_begin
DB 216
DW 18
DB $L$abi_test_trampoline_seh_prolog_xmm12-$L$abi_test_trampoline_seh_begin
DB 200
DW 17
DB $L$abi_test_trampoline_seh_prolog_xmm11-$L$abi_test_trampoline_seh_begin
DB 184
DW 16
DB $L$abi_test_trampoline_seh_prolog_xmm10-$L$abi_test_trampoline_seh_begin
DB 168
DW 15
DB $L$abi_test_trampoline_seh_prolog_xmm9-$L$abi_test_trampoline_seh_begin
DB 152
DW 14
DB $L$abi_test_trampoline_seh_prolog_xmm8-$L$abi_test_trampoline_seh_begin
DB 136
DW 13
DB $L$abi_test_trampoline_seh_prolog_xmm7-$L$abi_test_trampoline_seh_begin
DB 120
DW 12
DB $L$abi_test_trampoline_seh_prolog_xmm6-$L$abi_test_trampoline_seh_begin
DB 104
DW 11
DB $L$abi_test_trampoline_seh_prolog_r15-$L$abi_test_trampoline_seh_begin
DB 244
DW 21
DB $L$abi_test_trampoline_seh_prolog_r14-$L$abi_test_trampoline_seh_begin
DB 228
DW 20
DB $L$abi_test_trampoline_seh_prolog_r13-$L$abi_test_trampoline_seh_begin
DB 212
DW 19
DB $L$abi_test_trampoline_seh_prolog_r12-$L$abi_test_trampoline_seh_begin
DB 196
DW 18
DB $L$abi_test_trampoline_seh_prolog_rsi-$L$abi_test_trampoline_seh_begin
DB 100
DW 17
DB $L$abi_test_trampoline_seh_prolog_rdi-$L$abi_test_trampoline_seh_begin
DB 116
DW 16
DB $L$abi_test_trampoline_seh_prolog_rbp-$L$abi_test_trampoline_seh_begin
DB 84
DW 15
DB $L$abi_test_trampoline_seh_prolog_rbx-$L$abi_test_trampoline_seh_begin
DB 52
DW 14
DB $L$abi_test_trampoline_seh_prolog_alloc-$L$abi_test_trampoline_seh_begin
DB 1
DW 43
ALIGN 8
$L$abi_test_bad_unwind_wrong_register_seh_info:
DB 1
DB $L$abi_test_bad_unwind_wrong_register_seh_push_r13-$L$abi_test_bad_unwind_wrong_register_seh_begin
DB 1
DB 0
DB $L$abi_test_bad_unwind_wrong_register_seh_push_r13-$L$abi_test_bad_unwind_wrong_register_seh_begin
DB 208
ALIGN 8
$L$abi_test_bad_unwind_temporary_seh_info:
DB 1
DB $L$abi_test_bad_unwind_temporary_seh_push_r12-$L$abi_test_bad_unwind_temporary_seh_begin
DB 1
DB 0
DB $L$abi_test_bad_unwind_temporary_seh_push_r12-$L$abi_test_bad_unwind_temporary_seh_begin
DB 192
ALIGN 8
$L$abi_test_bad_unwind_epilog_seh_info:
DB 1
DB $L$abi_test_bad_unwind_epilog_seh_push_r12-$L$abi_test_bad_unwind_epilog_seh_begin
DB 1
DB 0
DB $L$abi_test_bad_unwind_epilog_seh_push_r12-$L$abi_test_bad_unwind_epilog_seh_begin
DB 192
|
oeis/078/A078509.asm | neoneye/loda-programs | 11 | 93804 | <reponame>neoneye/loda-programs
; A078509: Number of permutations p of {1,2,...,n} such that p(i)-i != 1 and p(i)-i != 2 for all i.
; Submitted by <NAME>
; 1,1,1,1,5,23,131,883,6859,60301,591605,6405317,75843233,974763571,13512607303,200949508327,3190881283415,53880906258521,964039575154409,18217997734199113,362584510633666621,7580578211464070863,166099466140519353035,3806162403831340850651,91037404655283210049571,2268799384077227059257061,58817651071406021653417309,1583801150479065295621069069,44235341139103990750163554649,1279827199458438844712380743275,38310926796201013312209078599567,1185207200812005791008969182353359
sub $0,1
mov $3,1
lpb $0
mul $2,$0
sub $0,1
sub $2,$1
add $3,$2
mov $1,$3
sub $1,$2
add $4,$3
mov $3,$2
mov $2,$4
add $3,1
lpe
mov $0,$3
sub $0,1
mul $0,2
add $0,1
|
lib/types/Flattening.agda | UlrikBuchholtz/HoTT-Agda | 1 | 1011 | <gh_stars>1-10
{-# OPTIONS --without-K #-}
open import lib.Basics
open import lib.types.Pi
open import lib.types.Paths
open import lib.types.Sigma
module lib.types.Flattening {i j k}
(A : Type i) (B : Type j) (f g : B → A)
(C : A → Type k) (D : (b : B) → C (f b) ≃ C (g b)) where
{- The base HIT -}
import lib.types.Generic1HIT as Generic1HIT
module W = Generic1HIT A B f g
open W public using (cc; pp)
renaming (T to W)
module P = W.RecType C D
open P public -- using (↓-pp-in; ↓-pp-out; ↓-pp-β)
renaming (f to P)
{- The flattened HIT -}
At : Type _
At = Σ A C
Bt : Type _
Bt = Σ B (C ∘ f)
ft : Bt → At
ft (b , d) = (f b , d)
gt : Bt → At
gt (b , d) = (g b , –> (D b) d)
module Wt = Generic1HIT At Bt ft gt
open Wt public using ()
renaming (T to Wt)
cct = curry Wt.cc
ppt = curry Wt.pp
private
{- Flattening -}
module _ where
paths-flatten :
(b : B) → (cct (f b) == cct (g b) [ (λ w → (P w → Wt)) ↓ pp b ])
paths-flatten b =
↓-app→cst-in (λ q → ppt b _ ∙' ap (cct (g b)) (↓-pp-out q))
module FlattenCurried = W.Elim cct paths-flatten
flatten-curried : (w : W) → (P w → Wt)
flatten-curried = W.Elim.f cct paths-flatten
flatten : Σ W P → Wt
flatten (w , x) = flatten-curried w x
{- Unflattening -}
unflatten-cc : (ac : At) → Σ W P
unflatten-cc (a , c) = (cc a , c)
unflatten-pp : (bd : Bt) → unflatten-cc (ft bd) == unflatten-cc (gt bd)
unflatten-pp (b , d) = pair= (pp b) (↓-pp-in idp)
module Unflatten = Wt.Rec unflatten-cc unflatten-pp
unflatten : Wt → Σ W P
unflatten = Unflatten.f
{- First composition -}
flatten-unflatten : (w : Wt) → flatten (unflatten w) == w
flatten-unflatten = Wt.elim
(λ _ → idp)
(λ bd → let (b , d) = bd in
↓-∘=idf-in flatten unflatten
(ap flatten (ap unflatten (ppt b d))
=⟨ Unflatten.pp-β bd |in-ctx ap flatten ⟩
ap flatten (pair= (pp b) (↓-pp-in idp))
=⟨ split-ap2 flatten (pp b) (↓-pp-in idp) ⟩
↓-app→cst-out (apd flatten-curried (pp b)) (↓-pp-in idp)
=⟨ FlattenCurried.pp-β b
|in-ctx (λ u → ↓-app→cst-out u (↓-pp-in idp)) ⟩
↓-app→cst-out (paths-flatten b) (↓-pp-in idp)
=⟨ idp ⟩
↓-app→cst-out (↓-app→cst-in
(λ q → ppt b _ ∙' ap (cct (g b)) (↓-pp-out q))) (↓-pp-in idp)
=⟨ ↓-app→cst-β (λ q → ppt b _ ∙' ap (cct (g b)) (↓-pp-out q))
(↓-pp-in idp) ⟩
ppt b d ∙' ap (cct (g b)) (↓-pp-out (↓-pp-in idp))
=⟨ ↓-pp-β idp |in-ctx (λ u → ppt b d ∙' ap (cct (g b)) u) ⟩
ppt b d ∎))
{- Second composition -}
unflatten-flatten-curried : (w : W) (x : P w)
→ unflatten (flatten-curried w x) == (w , x)
unflatten-flatten-curried = W.elim
(λ a x → idp)
(λ b → ↓-Π-in
(λ q → ↓-∘=idf-in unflatten flatten
(ap unflatten (ap flatten (pair= (pp b) q))
=⟨ split-ap2 flatten (pp b) q |in-ctx ap unflatten ⟩
ap unflatten (↓-app→cst-out (apd flatten-curried (pp b)) q)
=⟨ FlattenCurried.pp-β b
|in-ctx (λ u → ap unflatten (↓-app→cst-out u q)) ⟩
ap unflatten (↓-app→cst-out (paths-flatten b) q)
=⟨ idp ⟩
ap unflatten (↓-app→cst-out (↓-app→cst-in (λ qq → ppt b _ ∙' ap (cct (g b)) (↓-pp-out qq))) q)
=⟨ ↓-app→cst-β (λ qq → ppt b _ ∙' ap (cct (g b)) (↓-pp-out qq)) q |in-ctx ap unflatten ⟩
ap unflatten (ppt b _ ∙' ap (cct (g b)) (↓-pp-out q))
=⟨ ap-∙' unflatten (ppt b _) (ap (cct (g b)) (↓-pp-out q)) ⟩
ap unflatten (ppt b _) ∙' ap unflatten (ap (cct (g b)) (↓-pp-out q))
=⟨ Unflatten.pp-β (b , _) |in-ctx (λ u → u ∙' ap unflatten (ap (cct (g b)) (↓-pp-out q))) ⟩
pair= (pp b) (↓-pp-in idp) ∙' ap unflatten (ap (cct (g b)) (↓-pp-out q))
=⟨ ∘-ap unflatten (cct (g b)) (↓-pp-out q) |in-ctx (λ u → (pair= (pp b) (↓-pp-in idp) ∙' u)) ⟩
pair= (pp b) (↓-pp-in idp) ∙' ap (unflatten ∘ cct (g b)) (↓-pp-out q)
=⟨ idp ⟩
pair= (pp b) (↓-pp-in idp) ∙' ap (λ x → (cc (g b), x)) (↓-pp-out q)
=⟨ ap-cst,id P (↓-pp-out q) |in-ctx (λ u → pair= (pp b) (↓-pp-in idp) ∙' u) ⟩
pair= (pp b) (↓-pp-in idp) ∙' pair= idp (↓-pp-out q)
=⟨ Σ-∙' (↓-pp-in idp) (↓-pp-out q) ⟩
pair= (pp b) (↓-pp-in idp ∙'ᵈ ↓-pp-out q)
=⟨ to-transp-weird q (coe-pp-β _ _) |in-ctx pair= (pp b) ⟩
pair= (pp b) q ∎)))
unflatten-flatten : (wx : Σ W P) → unflatten (flatten wx) == wx
unflatten-flatten (w , x) = unflatten-flatten-curried w x
{- The equivalence -}
abstract
flattening-equiv : Σ W P ≃ Wt
flattening-equiv = equiv flatten unflatten flatten-unflatten unflatten-flatten
|
fastmodel-parser/src/main/antlr4/imports/DomainParser.g4 | alibaba/fast-modeling-language | 9 | 7498 | parser grammar DomainParser;
domainStatements:
createDomainStatement
| setDomainComment
| setDomainProperties
| unSetDomainProperties
| renameDomain
| dropDomainStatement
| setDomainAliasedName
;
createDomainStatement
:KW_CREATE replace? KW_DOMAIN ifNotExists?
qualifiedName alias? comment?
(KW_WITH setProperties)?
;
setDomainComment
:KW_ALTER KW_DOMAIN qualifiedName alterStatementSuffixSetComment
;
setDomainAliasedName
: KW_ALTER KW_DOMAIN qualifiedName setAliasedName
;
setDomainProperties
:KW_ALTER KW_DOMAIN qualifiedName KW_SET setProperties
;
unSetDomainProperties
: KW_ALTER KW_DOMAIN qualifiedName KW_UNSET unSetProperties
;
renameDomain
: KW_ALTER KW_DOMAIN qualifiedName alterStatementSuffixRename
;
dropDomainStatement
: KW_DROP KW_DOMAIN qualifiedName
;
|
tools-src/gnu/gcc/gcc/ada/s-tasdeb.ads | enfoTek/tomato.linksys.e2000.nvram-mod | 80 | 27117 | ------------------------------------------------------------------------------
-- --
-- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . T A S K I N G . D E B U G --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 1997-2001, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNARL; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package encapsulates all direct interfaces to task debugging services
-- that are needed by gdb with gnat mode (1.17 and higher)
with Interfaces.C;
with System.Tasking;
with System.OS_Interface;
package System.Tasking.Debug is
subtype int is Interfaces.C.int;
subtype unsigned_long is Interfaces.C.unsigned_long;
package ST renames System.Tasking;
Known_Tasks : array (0 .. 999) of Task_ID;
-- Global array of tasks read by gdb, and updated by
-- Create_Task and Finalize_TCB
procedure Task_Creation_Hook (Thread : OS_Interface.Thread_Id);
-- This procedure is used to notify VxGdb of task's creation.
-- It must be called by the task's creator.
procedure Task_Termination_Hook;
-- This procedure is used to notify VxGdb of task's termination.
function Self return Task_ID;
-- return system ID of current task
procedure List_Tasks;
-- Print a list of all the known Ada tasks with abbreviated state
-- information, one-per-line, to the standard output file
procedure Print_Current_Task;
procedure Print_Task_Info_Header;
procedure Print_Task_Info (T : Task_ID);
-- Write TASK_ID of current task, in hexadecimal, as one line, to
-- the standard output file
--
-- Beware that Print_Current_Task may print garbage during an early
-- stage of activation. There is a small window where a task is just
-- initializing itself and has not yet recorded its own task Id.
--
-- Beware that Print_Current_Task will either not work at all or print
-- garbage if it has interrupted a thread of control that does not
-- correspond to any Ada task. For example, this is could happen if
-- the debugger interrupts a signal handler that is using an alternate
-- stack, or interrupts the dispatcher in the underlying thread
-- implementation.
procedure Set_User_State (Value : Integer);
procedure Print_Accept_Info (T : Task_ID);
procedure Trace
(Self_ID : Task_ID;
Msg : String;
Other_ID : Task_ID;
Flag : Character);
procedure Trace
(Self_ID : Task_ID;
Msg : String;
Flag : Character);
procedure Trace
(Msg : String;
Flag : Character);
procedure Trace
(Msg : String;
Other_ID : Task_ID;
Flag : Character);
procedure Set_Trace
(Flag : Character;
Value : Boolean := True);
function Image (T : Task_ID) return String;
procedure Suspend_All_Tasks (Thread_Self : OS_Interface.Thread_Id);
-- Suspend all the tasks except the one whose associated thread is
-- Thread_Self by traversing All_Tasks_Lists and calling
-- System.Task_Primitives.Operations.Suspend_Task
-- Such functionality is needed by gdb on some targets (e.g VxWorks)
-- Warning: for efficiency purposes, there is no locking.
procedure Resume_All_Tasks (Thread_Self : OS_Interface.Thread_Id);
-- Resume all the tasks except the one whose associated thread is
-- Thread_Self by traversing All_Tasks_Lists and calling
-- System.Task_Primitives.Operations.Continue_Task
-- Such functionality is needed by gdb on some targets (e.g VxWorks)
-- Warning: for efficiency purposes, there is no locking.
end System.Tasking.Debug;
-----------------------------
-- Use of These Functions --
-----------------------------
-- Calling complicated functions from the debugger is generally pretty
-- risky, especially in a multithreaded program.
-- The debugger may interrupt something that is not an Ada task,
-- within the thread implementation, and which is not async-safe.
-- For example, under Solaris, it can interrupt code in "_dynamiclwps",
-- which seems to serve as dispatcher when all the user threads are
-- suspended. By experience, we have found that one cannot safely
-- do certain things, apparently including calls to thread primitives
-- from the debugger if the debugger has interrupted at one of these
-- unsafe points. In general, if you interrupt a running program
-- asynchronously (e.g. via control-C), it will not be safe to
-- call the subprograms in this package.
-----------------
-- Future work --
-----------------
-- It would be nice to be able to tell whether execution has been
-- interrupted in an Ada task. A heuristic way of checking this would
-- be if we added to the Ada TCB a component that always contains a
-- constant value that is unlikely to occur accidentally in code or
-- data. We could then check this in the debugger-callable subprograms,
-- and simply return an error code if it looks unsafe to proceed.
-- ???
-- Recently we have added such a marker as a local variable of the
-- task-wrapper routine. This allows Self to generate a fake ATCB for
-- non-Ada threads of control. Given this capability, it is probably
-- time to revisit the issue above.
-- DEADLOCK
-- We follow a simple rule here to avoid deadlock:
-- We do not use any locks in functions called by gdb, and we do not
-- traverse linked lists.
--
-- The use of an array (Known_Tasks) has many advantages:
-- - Easy and fast to examine;
-- - No risk of dangling references (to the next element) when traversing
-- the array.
|
libsrc/graphics/vg5k/swapgfxbk.asm | teknoplop/z88dk | 0 | 17374 | ;
; Philips VG-5000 Graphics Functions
;
; swapgfxbk () -- foo routine for fake swapping
;
; <NAME> - 2015
;
;
; $Id: swapgfxbk.asm,v 1.1 2015/10/09 13:02:43 stefano Exp $
;
PUBLIC swapgfxbk
PUBLIC swapgfxbk1
.swapgfxbk
ld ix,$47FA
ret
.swapgfxbk1
ret
|
src/boot/vga.asm | robey/funos | 5 | 9535 | ;
; simple routines for drawing a status line during early boot.
;
%define module vga
%include "api.macro"
%include "io.macro"
%define VGA_SCREEN_BUFFER 0xb8000
%define VGA_BOTTOM_LINE (VGA_SCREEN_BUFFER + (2 * 80 * 24))
%define VGA_REGISTER_A (VGA_BOTTOM_LINE + (62 * 2))
%define VGA_REGISTER_B (VGA_BOTTOM_LINE + (71 * 2))
%define VGA_BLANK (0x5f20)
%define VGA_HIGHLIGHT (0x5e)
%define VGA_SCROLLBACK_SIZE 16384
%define VGA_PORT_SELECT 0x3d4
%define VGA_PORT_DATA 0x3d5
%define VGA_REGISTER_CURSOR_START 0x0a
%define VGA_REGISTER_CURSOR_END 0x0b
%define VGA_REGISTER_CURSOR_HIGH 0x0e
%define VGA_REGISTER_CURSOR_LOW 0x0f
global \
vga_dump_eax, \
vga_highlight, \
vga_put_small, \
vga_scrollback_buffer, \
vga_scrollback_size, \
vga_status_update
section .text
global vga_init
vga_init:
call vga_show_cursor
call vga_blank_status_line
mov esi, loading_message
call vga_display
ret
vga_blank_status_line:
push eax
mov eax, 24
call vga_blank_line
pop eax
ret
; eax = line #
global vga_blank_line
vga_blank_line:
push eax
push ecx
push edx
mov edx, eax
shl edx, 8
call vga_compute
; let's start blankin'.
mov ecx, 80
mov eax, VGA_BLANK
cld
rep stosw
pop edx
pop ecx
pop eax
ret
; esi = string ptr
vga_display:
push eax
push ecx
mov edi, VGA_BOTTOM_LINE + 2
mov ecx, 0
.loop:
mov ax, [edi]
and ax, 0xff00
mov al, [esi + ecx]
cmp al, 0
je .out
stosw
inc ecx
jnz .loop
.out:
add edi, 2
mov [vga_status_cursor], edi
pop ecx
pop eax
ret
; edi = where in vga buffer (in/out)
; ecx = LSB string of up to 4 bytes to write.
vga_put_small:
push eax
push ecx
.loop:
cmp cl, 0
je .out
mov ax, [edi]
mov al, cl
stosw
shr ecx, 8
jnz .loop
.out:
pop ecx
pop eax
ret
; highlight some chars.
; edi = where in vga buffer
; ecx = count
vga_highlight:
push eax
push edi
.loop:
mov ax, [edi]
mov ah, VGA_HIGHLIGHT
stosw
dec ecx
jnz .loop
pop edi
pop eax
ret
; edx YYXX -> edi
global vga_compute
vga_compute:
push eax
push ecx
mov eax, edx
and eax, 0xff00
; mulitply Y by 160 by shift magic (it starts out as Y * 256).
shr eax, 1
mov ecx, eax
shr eax, 2
add ecx, eax
mov edi, VGA_SCREEN_BUFFER
add edi, ecx
; add in X
and edx, 0xff
shl edx, 1
add edi, edx
pop ecx
pop eax
ret
; update the current status letter and display it.
; this goes (A -> B -> C -> ...) as the boot progresses, so that if it dies,
; you can see roughly where it happened.
vga_status_update:
inc byte [vga_status_letter]
mov edi, [vga_status_cursor]
mov ax, VGA_BLANK
and ax, 0xff00
mov al, [vga_status_letter]
mov [edi], ax
ret
; display eax as hex, at edi (an address of the VGA screen)
vga_dump_eax:
push eax
push ebx
push ecx
push edx
mov ecx, 16
.loop:
sub ecx, 2
mov bl, al
and bl, 15
add bl, 0x30
cmp bl, 0x3a
jl .digit
; hex letter
add bl, 0x61 - 0x3a
.digit:
mov dx, [edi + ecx]
and dx, 0xff00
or dl, bl
mov [edi + ecx], dx
shr eax, 4
cmp ecx, 0
jne .loop
add edi, 16
pop edx
pop ecx
pop ebx
pop eax
ret
; display eax at the "register A" field of the status line.
global vga_display_register_a
vga_display_register_a:
mov edi, VGA_REGISTER_A
jmp vga_dump_eax
; display eax at the "register B" field of the status line.
global vga_display_register_b
vga_display_register_b:
mov edi, VGA_REGISTER_B
jmp vga_dump_eax
; (external) put blinking cursor at linear offset from (0, 0)
global vga_set_cursor
vga_set_cursor:
push ebp
mov ebp, esp
push eax
push edx
outio VGA_PORT_SELECT, VGA_REGISTER_CURSOR_LOW
mov eax, [ebp + 8]
outioa VGA_PORT_DATA
outio VGA_PORT_SELECT, VGA_REGISTER_CURSOR_HIGH
mov eax, [ebp + 8]
shr eax, 8
outioa VGA_PORT_DATA
pop edx
pop eax
pop ebp
ret
global vga_show_cursor
vga_show_cursor:
push eax
push edx
; set big blocky cursor.
outio VGA_PORT_SELECT, VGA_REGISTER_CURSOR_START
outio VGA_PORT_DATA, 0
outio VGA_PORT_SELECT, VGA_REGISTER_CURSOR_END
outio VGA_PORT_DATA, 15
pop edx
pop eax
ret
global vga_hide_cursor
vga_hide_cursor:
push eax
push edx
; set invisible cursor.
outio VGA_PORT_SELECT, VGA_REGISTER_CURSOR_START
outio VGA_PORT_DATA, 0x20
outio VGA_PORT_SELECT, VGA_REGISTER_CURSOR_END
outio VGA_PORT_DATA, 0x20
pop edx
pop eax
ret
section .data
align 4
vga_status_cursor:
dd 0
vga_status_letter:
db '@'
loading_message:
db 'Loading FunOS...', 0
vga_scrollback_size:
dd VGA_SCROLLBACK_SIZE
; for the (later) terminal phase, allocate a 16KB scrollback buffer
section .bss
align 4096
vga_scrollback_buffer:
resb VGA_SCROLLBACK_SIZE
|
kern/i686/gdt/gdt.asm | greck2908/LudOS | 44 | 81190 | global gdt_flush
gdt_flush:
mov eax, [esp+4] ; get address of gdt table
lgdt [eax] ; load it
jmp 0x08:.flush ; 0x08 is the offset to our code segment: Far jump! Update the segment register
.flush:
mov ax, 0x10 ; 0x10 points at the new data selector
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
ret
|
testsuite/tests/NA17-007__copyright/g-md5.ads | AdaCore/style_checker | 2 | 9548 | ------------------------------------------------------------------------------
-- --
-- GNAT LIBRARY COMPONENTS --
-- --
-- G N A T . M D 5 --
-- --
-- S p e c --
-- --
-- XXXXXXXXX (C) 2002-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package implements the MD5 Message-Digest Algorithm as described in
-- RFC 1321. The complete text of RFC 1321 can be found at:
--
-- http://www.ietf.org/rfc/rfc1321.txt
--
-- The implementation is derived from the RSA Data Security, Inc. MD5
-- Message-Digest Algorithm, as described in RFC 1321.
with Ada.Streams;
with Interfaces;
package GNAT.MD5 is
type Context is private;
-- This type is the four-word (16 byte) MD buffer, as described in
-- RFC 1321 (3.3). Its initial value is Initial_Context below.
Initial_Context : constant Context;
-- Initial value of a Context object. May be used to reinitialize
-- a Context value by simple assignment of this value to the object.
procedure Update
(C : in out Context;
Input : String);
procedure Wide_Update
(C : in out Context;
Input : Wide_String);
procedure Update
(C : in out Context;
Input : Ada.Streams.Stream_Element_Array);
-- Modify the Context C. If C has the initial value Initial_Context,
-- then, after a call to one of these procedures, Digest (C) will return
-- the Message-Digest of Input.
--
-- These procedures may be called successively with the same context and
-- different inputs, and these several successive calls will produce
-- the same final context as a call with the concatenation of the inputs.
subtype Message_Digest is String (1 .. 32);
-- The string type returned by function Digest
function Digest (C : Context) return Message_Digest;
-- Extracts the Message-Digest from a context. This function should be
-- used after one or several calls to Update.
function Digest (S : String) return Message_Digest;
function Wide_Digest (W : Wide_String) return Message_Digest;
function Digest
(A : Ada.Streams.Stream_Element_Array)
return Message_Digest;
-- These functions are equivalent to the corresponding Update (or
-- Wide_Update) on a default initialized Context, followed by Digest
-- on the resulting Context.
private
-- Magic numbers
Initial_A : constant := 16#67452301#;
Initial_B : constant := 16#EFCDAB89#;
Initial_C : constant := 16#98BADCFE#;
Initial_D : constant := 16#10325476#;
type Context is record
A : Interfaces.Unsigned_32 := Initial_A;
B : Interfaces.Unsigned_32 := Initial_B;
C : Interfaces.Unsigned_32 := Initial_C;
D : Interfaces.Unsigned_32 := Initial_D;
Buffer : String (1 .. 64) := (others => ASCII.NUL);
Last : Natural := 0;
Length : Natural := 0;
end record;
Initial_Context : constant Context :=
(A => Initial_A, B => Initial_B, C => Initial_C, D => Initial_D,
Buffer => (others => ASCII.NUL), Last => 0, Length => 0);
end GNAT.MD5;
|
src/Implicits/Resolution/Deterministic/Incomplete.agda | metaborg/ts.agda | 4 | 2586 | open import Prelude hiding (id; Bool)
module Implicits.Resolution.Deterministic.Incomplete where
open import Implicits.Syntax
open import Implicits.WellTyped
open import Implicits.Substitutions
open import Data.Product
open import Data.List hiding ([_])
open import Data.List.Any
open Membership-≡
open import Extensions.ListFirst
Bool : Type 0
Bool = simpl $ tc 0
Int : Type 0
Int = simpl $ tc 1
-- We'll proof incompleteness with a simple example that we'll be able to resolve
-- using the ambigous resolution rules, but not with the deterministic rules.
-- This proofs that the ambiguous rules are stronger, such that together with Oliveira's
-- proof that determinstic resolution is sound w.r.t. ambiguous resolution, we have the
-- result that deterministic resolution is incomplete (or ambiguous resolution is strictly stronger)
Δ : ICtx 0
Δ = (Int ⇒ Bool) ∷ Bool List.∷ List.[]
open import Implicits.Resolution.Deterministic.Resolution as D
open import Implicits.Resolution.Ambiguous.Resolution as A
open import Extensions.ListFirst
private
-- proof that Bool is not derivable under the deterministic resolution rules
deterministic-cant : ¬ (Δ D.⊢ᵣ Bool)
deterministic-cant (r-simp fst fst↓bool) with
FirstLemmas.first-unique (here (m-iabs m-simp) (Bool List.∷ List.[])) fst
deterministic-cant (r-simp fst (i-iabs (r-simp r _) b)) | refl = ¬r◁Int (, r)
where
¬r◁Int : ¬ (∃ λ r → Δ ⟨ tc 1 ⟩= r)
¬r◁Int (._ , here (m-iabs ()) ._)
¬r◁Int (._ , there _ _ (here () .List.[]))
¬r◁Int ( _ , there _ _ (there _ _ ()))
-- proof that Bool is derivable under the "Ambiguous" resolution rules
ambiguous-can : Δ A.⊢ᵣ Bool
ambiguous-can = r-ivar (there (here refl))
incomplete : ∃ λ ν → ∃₂ λ (Δ : ICtx ν) r → (Δ A.⊢ᵣ r) × (¬ Δ D.⊢ᵣ r)
incomplete = , (Δ , (Bool , (ambiguous-can , deterministic-cant)))
|
Data/Nat/Reasoning.agda | oisdk/agda-binary | 1 | 11695 | <reponame>oisdk/agda-binary
{-# OPTIONS --without-K --safe #-}
module Data.Nat.Reasoning where
open import Data.Nat
import Data.Nat.Properties as ℕ-Prop
open import Relation.Binary.PropositionalEquality
infixr 3 _*≫_ _≪*_ _+≫_ _≪+_
_*≫_ : ∀ {x y} z → x ≡ y → z * x ≡ z * y
_*≫_ _ = cong _
_+≫_ : ∀ {x y} z → x ≡ y → z + x ≡ z + y
_+≫_ _ = cong _
_≪*_ : ∀ {x y} z → x ≡ y → x * z ≡ y * z
_≪*_ _ = cong _
_≪+_ : ∀ {x y} z → x ≡ y → x + z ≡ y + z
_≪+_ _ = cong _
|
InterpreterWithConstants.agda | sseefried/well-typed-agda-interpreter | 3 | 16406 | {-# OPTIONS --without-K --safe --overlapping-instances #-}
-- Reference to check out
--
-- Simply Typed Lambda Calculus in Agda, without Shortcuts
-- https://gergo.erdi.hu/blog/2013-05-01-simply_typed_lambda_calculus_in_agda,_without_shortcuts/
module InterpreterWithConstants where
open import Data.Char hiding (_≤_)
open import Data.Bool hiding (_≤_)
open import Data.Nat hiding (_≤_)
open import Data.Unit
import Data.Nat as N
open import Data.Product
open import Data.Sum
open import Relation.Binary.PropositionalEquality
open import Relation.Nullary
import Data.String as Str
open import Data.Nat.Show
import Data.List as List
open import Data.Empty
infix 3 _:::_,_
infix 2 _∈_
infix 2 _∉_
infix 1 _⊢_
data `Set : Set where
`Bool : `Set
_`⇨_ : `Set → `Set → `Set
`⊤ : `Set
_`×_ : `Set → `Set → `Set
infixr 2 _`⇨_
data Var : Set where
x' : Var
y' : Var
z' : Var
-- Inequality proofs on variables
data _≠_ : Var → Var → Set where
x≠y : x' ≠ y'
x≠z : x' ≠ z'
y≠x : y' ≠ x'
y≠z : y' ≠ z'
z≠x : z' ≠ x'
z≠y : z' ≠ y'
instance
xy : x' ≠ y'
xy = x≠y
xz : x' ≠ z'
xz = x≠z
yx : y' ≠ x'
yx = y≠x
yz : y' ≠ z'
yz = y≠z
zx : z' ≠ x'
zx = z≠x
zy : z' ≠ y'
zy = z≠y
⟦_⟧ : `Set → Set
⟦ `Bool ⟧ = Bool
⟦ (t `⇨ s) ⟧ = ⟦ t ⟧ → ⟦ s ⟧
⟦ `⊤ ⟧ = ⊤
⟦ (t `× s) ⟧ = ⟦ t ⟧ × ⟦ s ⟧
data Γ : Set where
· : Γ
_:::_,_ : Var → `Set → Γ → Γ
data _∈_ : Var → Γ → Set where
H : ∀ {x Δ t } → x ∈ x ::: t , Δ
TH : ∀ {x y Δ t} → ⦃ prf : x ∈ Δ ⦄ → ⦃ neprf : x ≠ y ⦄ → x ∈ y ::: t , Δ
instance
∈_type₁ : ∀ {x Δ t} → x ∈ x ::: t , Δ
∈_type₁ = H
∈_type₂ : ∀ {x y Δ t} → ⦃ prf : x ∈ Δ ⦄ → ⦃ x ≠ y ⦄ → x ∈ y ::: t , Δ
∈_type₂ = TH
data _∉_ : Var → Γ → Set where
H : ∀ {x} → x ∉ ·
TH : ∀ {x y Δ t} → ⦃ prf : x ∉ Δ ⦄ → ⦃ neprf : x ≠ y ⦄ → x ∉ y ::: t , Δ
instance
∉_type₁ : ∀ {x} → x ∉ ·
∉_type₁ = H
∉_type₂ : ∀ {x y Δ t} → ⦃ prf : x ∉ Δ ⦄ → ⦃ x ≠ y ⦄ → x ∉ y ::: t , Δ
∉_type₂ = TH
!Γ_[_] : ∀ {x} → (Δ : Γ) → x ∈ Δ → `Set
!Γ_[_] · ()
!Γ _ ::: t , Δ [ H ] = t
!Γ _ ::: _ , Δ [ TH ⦃ prf = i ⦄ ] = !Γ Δ [ i ]
infix 30 `v_
infix 30 `c_
infix 24 _`,_
infixl 22 _`₋_
data Constant : `Set → Set where
`not : Constant (`Bool `⇨ `Bool)
`∧ : Constant (`Bool `× `Bool `⇨ `Bool)
`∨ : Constant (`Bool `× `Bool `⇨ `Bool)
`xor : Constant (`Bool `× `Bool `⇨ `Bool)
data _⊢_ : Γ → `Set → Set where
`false : ∀ {Δ} → Δ ⊢ `Bool
`true : ∀ {Δ} → Δ ⊢ `Bool
`v_ : ∀ {Δ} → (x : Var) → ⦃ i : x ∈ Δ ⦄ → Δ ⊢ !Γ Δ [ i ]
`c_ : ∀ {Δ t} → Constant t → Δ ⊢ t
_`₋_ : ∀ {Δ t s} → Δ ⊢ t `⇨ s → Δ ⊢ t → Δ ⊢ s --application
`λ_`:_⇨_ : ∀ {Δ tr} → (x : Var) → (tx : `Set)
→ x ::: tx , Δ ⊢ tr → Δ ⊢ tx `⇨ tr
_`,_ : ∀ {Δ t s} → Δ ⊢ t → Δ ⊢ s → Δ ⊢ t `× s
`fst : ∀ {Δ t s} → Δ ⊢ t `× s → Δ ⊢ t
`snd : ∀ {Δ t s} → Δ ⊢ t `× s → Δ ⊢ s
`tt : ∀ {Δ} → Δ ⊢ `⊤
data ⟨_⟩ : Γ → Set₁ where
[] : ⟨ · ⟩
_∷_ : ∀ {x t Δ} → ⟦ t ⟧ → ⟨ Δ ⟩ → ⟨ x ::: t , Δ ⟩
!_[_] : ∀ {x Δ} → ⟨ Δ ⟩ → (i : x ∈ Δ) → ⟦ !Γ Δ [ i ] ⟧
!_[_] [] ()
!_[_] (val ∷ env) H = val
!_[_] (val ∷ env) (TH ⦃ prf = i ⦄) = ! env [ i ]
interpretConstant : ∀ {t} → Constant t → ⟦ t ⟧
interpretConstant `not = not
interpretConstant `∧ = uncurry _∧_
interpretConstant `∨ = uncurry _∨_
interpretConstant `xor = uncurry _xor_
interpret : ∀ {t} → · ⊢ t → ⟦ t ⟧
interpret = interpret' []
where interpret' : ∀ {Δ t} → ⟨ Δ ⟩ → Δ ⊢ t → ⟦ t ⟧
interpret' env `true = true
interpret' env `false = false
interpret' env `tt = tt
interpret' env ((`v x) ⦃ i = idx ⦄) = ! env [ idx ]
interpret' env (f `₋ x) = (interpret' env f) (interpret' env x)
interpret' env (`λ _ `: tx ⇨ body) = λ (x : ⟦ tx ⟧) → interpret' (x ∷ env) body
interpret' env (`c f) = interpretConstant f
interpret' env (f `, s) = interpret' env f ,′ interpret' env s
interpret' env (`fst p) with interpret' env p
interpret' env (`fst p) | f , s = f
interpret' env (`snd p) with interpret' env p
interpret' env (`snd p) | f , s = s
-----
and₁ : · ⊢ `Bool `× `Bool `⇨ `Bool
and₁ = `λ x' `: `Bool `× `Bool ⇨ `c `∧ `₋ `v x'
and₂ : · ⊢ `Bool `× `Bool `⇨ `Bool
and₂ = `c `∧
{-
I want to write a function called eta-reduce that one could prove the following:
pf : eta-reduce and₁ ≡ and₂
pf = refl
This function will eta-reduce when it can, and do nothing when it can't.
For instance the following should be true:
eta-reduce-constant : ∀ {c} → eta-reduce (`c c) ≡ `c c
However, I get stuck even on this case. Uncomment the definition below and try to
type check this module:
-}
-- eta-reduce : ∀ {t₁ t₂} → · ⊢ t₁ `⇨ t₂ → · ⊢ t₁ `⇨ t₂
-- eta-reduce (`c c) = ?
{-
You will get the following error message:
I'm not sure if there should be a case for the constructor `v_,
because I get stuck when trying to solve the following unification
problems (inferred index ≟ expected index):
Δ ≟ ·
!Γ Δ [ i ] ≟ t₁ `⇨ t₂
when checking the definition of eta-reduce
I did a bit of searching on the Internet and the only source I could find
that I could understand was this one: https://doisinkidney.com/posts/2018-09-20-agda-tips.html
It seems to be suggesting that one of the indices for a type is not in constructor form but is,
rather, a function.
Looking at the definition of _⊢_ we see that the `v_` constructor is most likely at fault:
`v_ : ∀ {Δ} → (x : Var) → ⦃ i : x ∈ Δ ⦄ → Δ ⊢ !Γ Δ [ i ]
The result type is `Δ ⊢ !Γ Δ [ i ]`. Clearly the index `!Γ Δ [ i ]` is referring to a
user-defined function.
My question is, "how can I fix this?". How would I modify the _⊢_ data structure
- I would be open to an alternative interpreter for the Simply Typed Lambda Calculus
- This interpreter is a modified form of this code base. ttps://github.com/ahmadsalim/well-typed-agda-interpreter
It has had instance declarations added and the syntactic form of terms has changed a little. I pulled out
the constant functions into their own data structure called `Constant` and changed their types a little to work
on products (_×_) instead of a curried form.
-}
{-
The instance based searching for _∈_ proofs might be a problem. I'm uncomfortable
with the use of --overlapping-instances
-}
-- eta-reduce : ∀ {t₁ t₂} → · ⊢ t₁ `⇨ t₂ → · ⊢ t₁ `⇨ t₂
-- eta-reduce (`λ x `: _ ⇨ f `₋ y) = {!!}
-- eta-reduce t = t
|
src/Categories/Diagram/Colimit/Lan.agda | Trebor-Huang/agda-categories | 279 | 2979 | {-# OPTIONS --without-K --safe #-}
module Categories.Diagram.Colimit.Lan where
open import Level
open import Categories.Category
open import Categories.Category.Cocomplete
open import Categories.Diagram.Duality
open import Categories.Diagram.Limit.Ran
open import Categories.Functor
open import Categories.Kan
open import Categories.Kan.Duality
private
variable
o ℓ e : Level
C D E : Category o ℓ e
module _ {o ℓ e o′ ℓ′ e′} {C : Category o′ ℓ′ e′} {D : Category o ℓ e}
(F : Functor C D) (X : Functor C E) (Com : Cocomplete (o′ ⊔ ℓ) (ℓ′ ⊔ e) e′ E) where
private
module F = Functor F
module X = Functor X
colimit-is-lan : Lan F X
colimit-is-lan = coRan⇒Lan (limit-is-ran F.op X.op λ G → Colimit⇒coLimit E (Com (Functor.op G)))
|
programs/oeis/239/A239278.asm | neoneye/loda | 22 | 171157 | <reponame>neoneye/loda
; A239278: Smallest k > 1 such that n*(n+1)*...*(n+k-1) / (n+(n+1)+...+(n+k-1)) is an integer.
; 3,5,3,3,5,3,3,7,3,3,5,3,3,5,3,3,5,3,3,5,3,3,7,3,3,5,3,3,5,3,3,5,3,3,5,3,3,7,3,3,5,3,3,5,3,3,5,3,3,5,3,3,9,3,3,5,3,3,5,3,3,5,3,3,5,3,3,7,3,3,5,3,3,5,3,3,5,3,3,5,3,3,7,3,3,5,3,3,5,3,3,5,3,3,5,3,3,7,3
mul $0,2
seq $0,284723 ; Smallest odd prime that is relatively prime to n.
|
tests/emra/RA_MODE/asm/RA02_core2.asm | ilebedev/stacktool | 1 | 80751 | <gh_stars>1-10
#*****************************************
#
# EM^2 basic testbench
#
# THREAD 2 (CORE 2)
#
# RA02
# - under RA-only mode
# - 3 threads, each running on core 0, 1 and 2
# (main0, main1 and main2, respectively)
# - Test remote access contention
#
#*****************************************
# EXPECTED RESULT (MEMORY) AFTER EXECUTION
#----------------------------------------
#...
#0x02000000 : 10 (updated by thread 0)
#0x02000001 : 10 (updated by thread 1)
#0x02000002 : 10 (updated by thread 2)
#...
#---------------------------------------
#(RA)
#@BB_entry
PUSH 0;
PUSH 2;
SETHI 0x0200;
ST_RA;
PUSH 0;
#J_REL @BB_condition # not needed
#(0,RA)
#(i,RA)
#@BB_condition
PULL_CP 0;
#(i,i,RA)
PUSH 10;
COMP_ULE;
#(b,i,RA)
B_Z 2; #@BB_for.body;
#J_REL @BB_return; # not needed
#(i,RA)
#(i,RA)
#@BB_return[]{
DROP 0;
#(RA)
HALT;
#()
#(i,RA)
#@BB_for.body
PUSH 2;
SETHI 0x0200;
LD_RA;
#(M,i,RA)
PUSH 1;
ADD;
#(M++,i,RA)
PUSH 2;
SETHI 0x0200;
ST_RA;
#(i,RA)
#J_REL @BB_for.post; # not needed
#(i,RA)
#(i,RA)
#@BB_for.post[]
PUSH 1;
ADD;
#(i++,RA)
J_REL -17; #@BB_condition;
#(i++,RA)
|
src/vulkan-math/gentype/vulkan-math-genitype.adb | zrmyers/VulkanAda | 1 | 13721 | --------------------------------------------------------------------------------
-- MIT License
--
-- Copyright (c) 2020 <NAME>
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in all
-- copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-- SOFTWARE.
--------------------------------------------------------------------------------
package body Vulkan.Math.GenIType is
function Apply_Func_IVI_IVI_IVB_RVI(
IVI1, IVI2 : in Vkm_GenIType;
IVB1 : in Vkm_GenBType) return Vkm_GenIType is
result : Vkm_GenIType := (last_index => IVI1.last_index, others => <>);
begin
for index in result.data'Range loop
result.data(index) := Func(IVI1.data(index),
IVI2.data(index),
IVB1.data(index));
end loop;
return result;
end Apply_Func_IVI_IVI_IVB_RVI;
----------------------------------------------------------------------------
function Apply_Func_IVI_IVI_RVB(
IVI1, IVI2 : in Vkm_GenIType) return Vkm_GenBType is
result : Vkm_GenBType := (last_index => IVI1.last_index, others => <>);
begin
for index in result.data'Range loop
result.data(index) := Func(IVI1.data(index),IVI2.data(index));
end loop;
return result;
end Apply_Func_IVI_IVI_RVB;
----------------------------------------------------------------------------
function Apply_Func_IVU_RVI(
IVU1 : in Vkm_GenUType) return Vkm_GenIType is
result : Vkm_GenIType := (last_index => IVU1.last_index, others => <>);
begin
for index in result.data'Range loop
result.data(index) := Func(IVU1.data(index));
end loop;
return result;
end Apply_Func_IVU_RVI;
end Vulkan.Math.GenIType;
|
bb-runtimes/src/s-bbarat.ads | JCGobbi/Nucleo-STM32G474RE | 0 | 27617 | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- Copyright (C) 2018, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package implements some intrinsic not provided by GCC for the armv6m
-- architecture.
with Interfaces;
with Interfaces.C;
with System;
package System.BB.Armv6m_Atomic is
generic
type T is mod <>;
function Sync_Lock_Test_And_Set (Addr : System.Address;
Value : T)
return T;
function Sync_Lock_Test_And_Set_1 is
new Sync_Lock_Test_And_Set (Interfaces.Unsigned_8);
pragma Export (C, Sync_Lock_Test_And_Set_1,
"__sync_lock_test_and_set_1");
generic
type T is mod <>;
function Sync_Bool_Compare_And_Swap (Addr : System.Address;
Old_Value : T;
New_Value : T)
return Interfaces.C.char;
function Sync_Bool_Compare_And_Swap_4 is
new Sync_Bool_Compare_And_Swap (Interfaces.Unsigned_32);
pragma Export (C, Sync_Bool_Compare_And_Swap_4,
"__sync_bool_compare_and_swap_4");
private
function PRIMASK return Interfaces.Unsigned_32
with Inline_Always;
function Interrupt_Disabled return Boolean
with Inline_Always;
procedure Disable_Interrupts
with Inline_Always;
procedure Enable_Interrupts
with Inline_Always;
end System.BB.Armv6m_Atomic;
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_2105.asm | ljhsiun2/medusa | 9 | 552 | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r12
push %r9
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0x10cae, %rsi
lea addresses_A_ht+0x146ee, %rdi
nop
add %r12, %r12
mov $2, %rcx
rep movsq
nop
nop
nop
nop
nop
dec %rdx
lea addresses_UC_ht+0x5b5a, %r10
nop
xor %rdx, %rdx
movb $0x61, (%r10)
nop
nop
nop
sub %rcx, %rcx
lea addresses_WT_ht+0xee2e, %rsi
nop
nop
nop
nop
nop
cmp $32152, %rcx
vmovups (%rsi), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $0, %xmm6, %r12
xor %rsi, %rsi
lea addresses_WC_ht+0x15aae, %rsi
lea addresses_UC_ht+0x54ae, %rdi
nop
nop
nop
nop
nop
cmp %r11, %r11
mov $126, %rcx
rep movsl
nop
sub %rdx, %rdx
lea addresses_normal_ht+0x322e, %rdi
nop
sub $58536, %r10
vmovups (%rdi), %ymm4
vextracti128 $1, %ymm4, %xmm4
vpextrq $0, %xmm4, %rsi
nop
nop
nop
nop
nop
and $34341, %r10
lea addresses_D_ht+0x3f76, %rsi
nop
nop
nop
nop
xor %r11, %r11
mov $0x6162636465666768, %rdx
movq %rdx, %xmm7
movups %xmm7, (%rsi)
nop
nop
nop
and $34795, %rdx
lea addresses_WC_ht+0x156ae, %rsi
lea addresses_normal_ht+0x6cf6, %rdi
nop
nop
cmp $39631, %r12
mov $66, %rcx
rep movsb
nop
nop
nop
nop
nop
add %r12, %r12
lea addresses_D_ht+0x1b12e, %rsi
lea addresses_WC_ht+0x3dae, %rdi
nop
nop
xor $9890, %r9
mov $3, %rcx
rep movsw
nop
nop
inc %r9
lea addresses_WC_ht+0x1aae, %rsi
lea addresses_D_ht+0x137ce, %rdi
nop
cmp %rdx, %rdx
mov $21, %rcx
rep movsq
sub %rsi, %rsi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r9
pop %r12
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r14
push %r8
push %rax
push %rsi
// Faulty Load
lea addresses_PSE+0x126ae, %rax
nop
nop
nop
nop
nop
add $40683, %r8
movb (%rax), %r14b
lea oracles, %rsi
and $0xff, %r14
shlq $12, %r14
mov (%rsi,%r14,1), %r14
pop %rsi
pop %rax
pop %r8
pop %r14
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_PSE', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_PSE', 'same': True, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 1, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 32, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 32, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 16, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM'}
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
|
Z80/lloader2/llhw.asm | BleuLlama/LlamaVampireDrive | 4 | 22608 | <reponame>BleuLlama/LlamaVampireDrive<filename>Z80/lloader2/llhw.asm
; llhw
; RC2014LL-specific hardware support
;
; 2017-01-30 <NAME>
;
; This code is free for any use. MIT License, etc.
.module llhw
.if( Emulation )
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; 'quit' - quit out of the emulation
cQuit: .asciz "quit"
cQuit2: .asciz "q"
iQuit: .asciz "Exit the emulator"
fQuit:
;;;;;;;;;;;;;;;
; quit from the rom (halt)
ld a, #0xF0 ; F0 = flag to exit
out (EmulatorControl), a
halt ; rc2014sim will exit on a halt
.endif
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; DisableROM
; set the ROM disable flag
cRomDis: .asciz "romdis"
iRomDis: .asciz "Disable the ROM ($0000 RAM is R/W)"
fRomDis:
DisableROM:
ld a, #01
out (RomDisable), a
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; EnableROM
; clear the ROM disable flag
cRomEn: .asciz "romen"
iRomEn: .asciz "Enable the ROM ($0000 RAM is write-only)"
fRomEn:
EnableROM:
xor a
out (RomDisable), a
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; CopyROMToRAM
; copies $0000 thru $2000 to itself
; seems like it would do nothing but it's reading from
; the ROM and writing to the RAM
; Not sure if this is useful, but it's a good test.
cRom2Ram: .asciz "rom2ram"
iRom2Ram: .asciz "Copy the $0000 ROM to RAM"
fRom2Ram:
CopyROMToRAM:
ld hl, #str_Working
call Print
xor a
ld h, a
ld l, a ; HL = $0000
CR2Ra:
ld a, (hl)
ld (hl), a ; RAM[ hl ] = ROM[ hl ]
inc hl ; hl++
ld a, h ; a = h
cp #0x20 ; is HL == 0x20 0x00?
jr nz, CR2Ra
; now patch the RAM image of the ROM so if we reset, it will
; continue to be in RAM mode...
ld hl, #ColdBoot ; 0x3E (ld a, )
inc hl ; 0x00 ( , #0x00)
ld a, #0x01 ; disable RAM value
ld (hl), a ; change the opcode to "ld a, #0x01"
; we're done. return
ld hl, #str_Done
call Print
ret
|
PJ Grammar/statements.g4 | Diolor/PJ | 0 | 6899 | parser grammar statements;
statement
: block # simpleBlockStatement
| statementsCommaless # commalessStatement
| ifRule parExpression statement (elseRule statement)? # ifStatement
| forRule forControl statement # forStatement
| 'while' parExpression statement # whileStatement
| tryRule block (catchClause+ finallyBlock? | finallyBlock) # tryStatement
| tryRule resourceSpecification block catchClause* finallyBlock? # tryStatement
| 'switch' parExpression '{' switchBlockStatementGroup* switchLabel* '}' # switchStatement
| synchronizedRule parExpression block # synchronizedStatement
| identifierRule ':' statement # identifierStament
;
statementsCommaless
: expression
| returnRule expression?
| throwRule expression
| breakRule identifierRule?
| continueRule identifierRule?
| assertRule expression (':' expression)?
| doRule statement whileRule parExpression
;
parExpression
//todo
: expression
;
catchClause
: catchRule catchDeclaration block
;
catchDeclaration
: variableModifier* catchType identifierRule
;
catchType
: qualifiedName ('|' qualifiedName)*
;
finallyBlock
: finallyRule block
;
resourceSpecification
: '(' resources ';'? ')'
;
resources
: resource (';' resource)*
;
resource
: variableModifier* classOrInterfaceType variableDeclaratorId '=' expression
;
/** Matches cases then statements, both of which are mandatory.
* To handle empty cases at the end, we add switchLabel* to statement.
*/
switchBlockStatementGroup
: switchLabel+ blockStatement+
;
switchLabel
: 'case' constantExpression ':'
| 'case' enumConstantName ':'
| 'default' ':'
;
constantExpression
: expression
;
enumConstantName
: Identifier
;
forControl
: enhancedForControl
| forInit? ';' expression? ';' forUpdate?
;
forInit
: localVariableDeclaration
| expressionList
;
enhancedForControl
: variableModifier* type variableDeclaratorId colonRule expression
;
forUpdate
: expressionList
; |
Gas/Prism/GIC/GIL.asm | Gabidal/GAS_Pack | 1 | 100599 | ;LEXER
Lexer:
call getWord ;next word please
mov bx, 0 ;it has to start from 0
;GET NEXT COMMAND TO COMPARE
compare:
mov si, word savePoint[2] ;load the save
lea ax, commands[si] ;ax points to table + si
add si, 12 ;be ready for next table content
mov savePoint[2], si ;save si
mov si, ax ;si now points to commnd table + index
lea di, [words] ;di points to word from main.g
mov cx, 12 ;tell the loop to stop at 12 round
inc bx ;what instruction it is if true
repz cmpsb ;compare them
je Parser ;parser handles what to do
jne compare ;if not this then compare next
cmpCycle:
jmp Lexer ;to compare with next imput word |
Irvine/Examples/ch11/ReadCharTest.asm | alieonsido/ASM_TESTING | 0 | 176320 | ; Testing ReadChar (ReadCharTest.asm)
INCLUDE Irvine32.inc
.code
main PROC
call ReadChar
call DumpRegs
exit
main ENDP
END main |
oeis/089/A089111.asm | neoneye/loda-programs | 11 | 82039 | <filename>oeis/089/A089111.asm<gh_stars>10-100
; A089111: Convoluted convolved Fibonacci numbers G_6^(r).
; 8,19,37,64,102,154,222,309,418,552,715,910,1141,1412,1727,2091,2508,2983,3521,4127,4807,5566,6410,7345,8377,9513,10759,12122,13609,15227,16984,18887,20944,23163,25552,28120,30875,33826,36982,40352,43946,47773,51843,56166,60752,65612,70756,76195,81940,88002,94393,101124,108207,115654,123477,131689,140302,149329,158783,168677,179025,189840,201136,212927,225227,238051,251413,265328,279811,294877,310542,326821,343730,361285,379502,398398,417989,438292,459324,481102,503644,526967,551089,576028
mov $2,1
add $2,$0
seq $0,139798 ; Coefficient of x^5 in (1-x-x^2)^(-n).
div $0,$2
|
programs/oeis/065/A065081.asm | neoneye/loda | 22 | 92598 | <reponame>neoneye/loda
; A065081: Alternating bit sum (A065359) for n-th prime p: replace 2^k with (-1)^k in binary expansion of p.
; -1,0,2,1,-1,1,2,1,2,2,1,1,-1,-2,-1,2,-1,1,1,2,1,1,2,2,1,2,1,-1,1,2,1,-1,-1,-2,2,1,1,-2,-1,-1,-1,1,-1,1,2,1,1,1,-1,1,-1,-1,1,-1,2,2,2,1,4,2,1,2,1,2,1,2,1,4,2,4,2,2,1,4,1,2,2,1,2,1,-1,1,-1,1,1,-1,2,1,2,1,2,2,1,-1,1,2,2,-1,-2,1
seq $0,40 ; The prime numbers.
seq $0,65359 ; Alternating bit sum for n: replace 2^k with (-1)^k in binary expansion of n.
|
echo.asm | kishan1468/memory-management-in-xv6 | 0 | 13669 |
_echo: file format elf32-i386
Disassembly of section .text:
00001000 <main>:
#include "stat.h"
#include "user.h"
int
main(int argc, char *argv[])
{
1000: f3 0f 1e fb endbr32
1004: 8d 4c 24 04 lea 0x4(%esp),%ecx
1008: 83 e4 f0 and $0xfffffff0,%esp
100b: ff 71 fc pushl -0x4(%ecx)
100e: 55 push %ebp
100f: 89 e5 mov %esp,%ebp
1011: 56 push %esi
1012: 53 push %ebx
1013: 51 push %ecx
1014: 83 ec 0c sub $0xc,%esp
1017: 8b 01 mov (%ecx),%eax
1019: 8b 51 04 mov 0x4(%ecx),%edx
int i;
for(i = 1; i < argc; i++)
101c: 83 f8 01 cmp $0x1,%eax
101f: 7e 4b jle 106c <main+0x6c>
1021: 8d 5a 04 lea 0x4(%edx),%ebx
1024: 8d 34 82 lea (%edx,%eax,4),%esi
printf(1, "%s%s", argv[i], i+1 < argc ? " " : "\n");
1027: 83 c3 04 add $0x4,%ebx
102a: 8b 43 fc mov -0x4(%ebx),%eax
102d: 39 f3 cmp %esi,%ebx
102f: 74 26 je 1057 <main+0x57>
1031: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
1038: 68 f8 17 00 00 push $0x17f8
103d: 83 c3 04 add $0x4,%ebx
1040: 50 push %eax
1041: 68 fa 17 00 00 push $0x17fa
1046: 6a 01 push $0x1
1048: e8 03 04 00 00 call 1450 <printf>
for(i = 1; i < argc; i++)
104d: 8b 43 fc mov -0x4(%ebx),%eax
printf(1, "%s%s", argv[i], i+1 < argc ? " " : "\n");
1050: 83 c4 10 add $0x10,%esp
1053: 39 f3 cmp %esi,%ebx
1055: 75 e1 jne 1038 <main+0x38>
1057: 68 ff 17 00 00 push $0x17ff
105c: 50 push %eax
105d: 68 fa 17 00 00 push $0x17fa
1062: 6a 01 push $0x1
1064: e8 e7 03 00 00 call 1450 <printf>
1069: 83 c4 10 add $0x10,%esp
exit();
106c: e8 72 02 00 00 call 12e3 <exit>
1071: 66 90 xchg %ax,%ax
1073: 66 90 xchg %ax,%ax
1075: 66 90 xchg %ax,%ax
1077: 66 90 xchg %ax,%ax
1079: 66 90 xchg %ax,%ax
107b: 66 90 xchg %ax,%ax
107d: 66 90 xchg %ax,%ax
107f: 90 nop
00001080 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, char *t)
{
1080: f3 0f 1e fb endbr32
1084: 55 push %ebp
char *os;
os = s;
while((*s++ = *t++) != 0)
1085: 31 c0 xor %eax,%eax
{
1087: 89 e5 mov %esp,%ebp
1089: 53 push %ebx
108a: 8b 4d 08 mov 0x8(%ebp),%ecx
108d: 8b 5d 0c mov 0xc(%ebp),%ebx
while((*s++ = *t++) != 0)
1090: 0f b6 14 03 movzbl (%ebx,%eax,1),%edx
1094: 88 14 01 mov %dl,(%ecx,%eax,1)
1097: 83 c0 01 add $0x1,%eax
109a: 84 d2 test %dl,%dl
109c: 75 f2 jne 1090 <strcpy+0x10>
;
return os;
}
109e: 89 c8 mov %ecx,%eax
10a0: 5b pop %ebx
10a1: 5d pop %ebp
10a2: c3 ret
10a3: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
10aa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
000010b0 <strcmp>:
int
strcmp(const char *p, const char *q)
{
10b0: f3 0f 1e fb endbr32
10b4: 55 push %ebp
10b5: 89 e5 mov %esp,%ebp
10b7: 53 push %ebx
10b8: 8b 4d 08 mov 0x8(%ebp),%ecx
10bb: 8b 55 0c mov 0xc(%ebp),%edx
while(*p && *p == *q)
10be: 0f b6 01 movzbl (%ecx),%eax
10c1: 0f b6 1a movzbl (%edx),%ebx
10c4: 84 c0 test %al,%al
10c6: 75 19 jne 10e1 <strcmp+0x31>
10c8: eb 26 jmp 10f0 <strcmp+0x40>
10ca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
10d0: 0f b6 41 01 movzbl 0x1(%ecx),%eax
p++, q++;
10d4: 83 c1 01 add $0x1,%ecx
10d7: 83 c2 01 add $0x1,%edx
while(*p && *p == *q)
10da: 0f b6 1a movzbl (%edx),%ebx
10dd: 84 c0 test %al,%al
10df: 74 0f je 10f0 <strcmp+0x40>
10e1: 38 d8 cmp %bl,%al
10e3: 74 eb je 10d0 <strcmp+0x20>
return (uchar)*p - (uchar)*q;
10e5: 29 d8 sub %ebx,%eax
}
10e7: 5b pop %ebx
10e8: 5d pop %ebp
10e9: c3 ret
10ea: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
10f0: 31 c0 xor %eax,%eax
return (uchar)*p - (uchar)*q;
10f2: 29 d8 sub %ebx,%eax
}
10f4: 5b pop %ebx
10f5: 5d pop %ebp
10f6: c3 ret
10f7: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
10fe: 66 90 xchg %ax,%ax
00001100 <strlen>:
uint
strlen(char *s)
{
1100: f3 0f 1e fb endbr32
1104: 55 push %ebp
1105: 89 e5 mov %esp,%ebp
1107: 8b 55 08 mov 0x8(%ebp),%edx
int n;
for(n = 0; s[n]; n++)
110a: 80 3a 00 cmpb $0x0,(%edx)
110d: 74 21 je 1130 <strlen+0x30>
110f: 31 c0 xor %eax,%eax
1111: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
1118: 83 c0 01 add $0x1,%eax
111b: 80 3c 02 00 cmpb $0x0,(%edx,%eax,1)
111f: 89 c1 mov %eax,%ecx
1121: 75 f5 jne 1118 <strlen+0x18>
;
return n;
}
1123: 89 c8 mov %ecx,%eax
1125: 5d pop %ebp
1126: c3 ret
1127: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
112e: 66 90 xchg %ax,%ax
for(n = 0; s[n]; n++)
1130: 31 c9 xor %ecx,%ecx
}
1132: 5d pop %ebp
1133: 89 c8 mov %ecx,%eax
1135: c3 ret
1136: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
113d: 8d 76 00 lea 0x0(%esi),%esi
00001140 <memset>:
void*
memset(void *dst, int c, uint n)
{
1140: f3 0f 1e fb endbr32
1144: 55 push %ebp
1145: 89 e5 mov %esp,%ebp
1147: 57 push %edi
1148: 8b 55 08 mov 0x8(%ebp),%edx
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" :
114b: 8b 4d 10 mov 0x10(%ebp),%ecx
114e: 8b 45 0c mov 0xc(%ebp),%eax
1151: 89 d7 mov %edx,%edi
1153: fc cld
1154: f3 aa rep stos %al,%es:(%edi)
stosb(dst, c, n);
return dst;
}
1156: 89 d0 mov %edx,%eax
1158: 5f pop %edi
1159: 5d pop %ebp
115a: c3 ret
115b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
115f: 90 nop
00001160 <strchr>:
char*
strchr(const char *s, char c)
{
1160: f3 0f 1e fb endbr32
1164: 55 push %ebp
1165: 89 e5 mov %esp,%ebp
1167: 8b 45 08 mov 0x8(%ebp),%eax
116a: 0f b6 4d 0c movzbl 0xc(%ebp),%ecx
for(; *s; s++)
116e: 0f b6 10 movzbl (%eax),%edx
1171: 84 d2 test %dl,%dl
1173: 75 16 jne 118b <strchr+0x2b>
1175: eb 21 jmp 1198 <strchr+0x38>
1177: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
117e: 66 90 xchg %ax,%ax
1180: 0f b6 50 01 movzbl 0x1(%eax),%edx
1184: 83 c0 01 add $0x1,%eax
1187: 84 d2 test %dl,%dl
1189: 74 0d je 1198 <strchr+0x38>
if(*s == c)
118b: 38 d1 cmp %dl,%cl
118d: 75 f1 jne 1180 <strchr+0x20>
return (char*)s;
return 0;
}
118f: 5d pop %ebp
1190: c3 ret
1191: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
return 0;
1198: 31 c0 xor %eax,%eax
}
119a: 5d pop %ebp
119b: c3 ret
119c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
000011a0 <gets>:
char*
gets(char *buf, int max)
{
11a0: f3 0f 1e fb endbr32
11a4: 55 push %ebp
11a5: 89 e5 mov %esp,%ebp
11a7: 57 push %edi
11a8: 56 push %esi
int i, cc;
char c;
for(i=0; i+1 < max; ){
11a9: 31 f6 xor %esi,%esi
{
11ab: 53 push %ebx
11ac: 89 f3 mov %esi,%ebx
11ae: 83 ec 1c sub $0x1c,%esp
11b1: 8b 7d 08 mov 0x8(%ebp),%edi
for(i=0; i+1 < max; ){
11b4: eb 33 jmp 11e9 <gets+0x49>
11b6: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
11bd: 8d 76 00 lea 0x0(%esi),%esi
cc = read(0, &c, 1);
11c0: 83 ec 04 sub $0x4,%esp
11c3: 8d 45 e7 lea -0x19(%ebp),%eax
11c6: 6a 01 push $0x1
11c8: 50 push %eax
11c9: 6a 00 push $0x0
11cb: e8 2b 01 00 00 call 12fb <read>
if(cc < 1)
11d0: 83 c4 10 add $0x10,%esp
11d3: 85 c0 test %eax,%eax
11d5: 7e 1c jle 11f3 <gets+0x53>
break;
buf[i++] = c;
11d7: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
11db: 83 c7 01 add $0x1,%edi
11de: 88 47 ff mov %al,-0x1(%edi)
if(c == '\n' || c == '\r')
11e1: 3c 0a cmp $0xa,%al
11e3: 74 23 je 1208 <gets+0x68>
11e5: 3c 0d cmp $0xd,%al
11e7: 74 1f je 1208 <gets+0x68>
for(i=0; i+1 < max; ){
11e9: 83 c3 01 add $0x1,%ebx
11ec: 89 fe mov %edi,%esi
11ee: 3b 5d 0c cmp 0xc(%ebp),%ebx
11f1: 7c cd jl 11c0 <gets+0x20>
11f3: 89 f3 mov %esi,%ebx
break;
}
buf[i] = '\0';
return buf;
}
11f5: 8b 45 08 mov 0x8(%ebp),%eax
buf[i] = '\0';
11f8: c6 03 00 movb $0x0,(%ebx)
}
11fb: 8d 65 f4 lea -0xc(%ebp),%esp
11fe: 5b pop %ebx
11ff: 5e pop %esi
1200: 5f pop %edi
1201: 5d pop %ebp
1202: c3 ret
1203: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
1207: 90 nop
1208: 8b 75 08 mov 0x8(%ebp),%esi
120b: 8b 45 08 mov 0x8(%ebp),%eax
120e: 01 de add %ebx,%esi
1210: 89 f3 mov %esi,%ebx
buf[i] = '\0';
1212: c6 03 00 movb $0x0,(%ebx)
}
1215: 8d 65 f4 lea -0xc(%ebp),%esp
1218: 5b pop %ebx
1219: 5e pop %esi
121a: 5f pop %edi
121b: 5d pop %ebp
121c: c3 ret
121d: 8d 76 00 lea 0x0(%esi),%esi
00001220 <stat>:
int
stat(char *n, struct stat *st)
{
1220: f3 0f 1e fb endbr32
1224: 55 push %ebp
1225: 89 e5 mov %esp,%ebp
1227: 56 push %esi
1228: 53 push %ebx
int fd;
int r;
fd = open(n, O_RDONLY);
1229: 83 ec 08 sub $0x8,%esp
122c: 6a 00 push $0x0
122e: ff 75 08 pushl 0x8(%ebp)
1231: e8 ed 00 00 00 call 1323 <open>
if(fd < 0)
1236: 83 c4 10 add $0x10,%esp
1239: 85 c0 test %eax,%eax
123b: 78 2b js 1268 <stat+0x48>
return -1;
r = fstat(fd, st);
123d: 83 ec 08 sub $0x8,%esp
1240: ff 75 0c pushl 0xc(%ebp)
1243: 89 c3 mov %eax,%ebx
1245: 50 push %eax
1246: e8 f0 00 00 00 call 133b <fstat>
close(fd);
124b: 89 1c 24 mov %ebx,(%esp)
r = fstat(fd, st);
124e: 89 c6 mov %eax,%esi
close(fd);
1250: e8 b6 00 00 00 call 130b <close>
return r;
1255: 83 c4 10 add $0x10,%esp
}
1258: 8d 65 f8 lea -0x8(%ebp),%esp
125b: 89 f0 mov %esi,%eax
125d: 5b pop %ebx
125e: 5e pop %esi
125f: 5d pop %ebp
1260: c3 ret
1261: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
return -1;
1268: be ff ff ff ff mov $0xffffffff,%esi
126d: eb e9 jmp 1258 <stat+0x38>
126f: 90 nop
00001270 <atoi>:
int
atoi(const char *s)
{
1270: f3 0f 1e fb endbr32
1274: 55 push %ebp
1275: 89 e5 mov %esp,%ebp
1277: 53 push %ebx
1278: 8b 55 08 mov 0x8(%ebp),%edx
int n;
n = 0;
while('0' <= *s && *s <= '9')
127b: 0f be 02 movsbl (%edx),%eax
127e: 8d 48 d0 lea -0x30(%eax),%ecx
1281: 80 f9 09 cmp $0x9,%cl
n = 0;
1284: b9 00 00 00 00 mov $0x0,%ecx
while('0' <= *s && *s <= '9')
1289: 77 1a ja 12a5 <atoi+0x35>
128b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
128f: 90 nop
n = n*10 + *s++ - '0';
1290: 83 c2 01 add $0x1,%edx
1293: 8d 0c 89 lea (%ecx,%ecx,4),%ecx
1296: 8d 4c 48 d0 lea -0x30(%eax,%ecx,2),%ecx
while('0' <= *s && *s <= '9')
129a: 0f be 02 movsbl (%edx),%eax
129d: 8d 58 d0 lea -0x30(%eax),%ebx
12a0: 80 fb 09 cmp $0x9,%bl
12a3: 76 eb jbe 1290 <atoi+0x20>
return n;
}
12a5: 89 c8 mov %ecx,%eax
12a7: 5b pop %ebx
12a8: 5d pop %ebp
12a9: c3 ret
12aa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
000012b0 <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
12b0: f3 0f 1e fb endbr32
12b4: 55 push %ebp
12b5: 89 e5 mov %esp,%ebp
12b7: 57 push %edi
12b8: 8b 45 10 mov 0x10(%ebp),%eax
12bb: 8b 55 08 mov 0x8(%ebp),%edx
12be: 56 push %esi
12bf: 8b 75 0c mov 0xc(%ebp),%esi
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
12c2: 85 c0 test %eax,%eax
12c4: 7e 0f jle 12d5 <memmove+0x25>
12c6: 01 d0 add %edx,%eax
dst = vdst;
12c8: 89 d7 mov %edx,%edi
12ca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
*dst++ = *src++;
12d0: a4 movsb %ds:(%esi),%es:(%edi)
while(n-- > 0)
12d1: 39 f8 cmp %edi,%eax
12d3: 75 fb jne 12d0 <memmove+0x20>
return vdst;
}
12d5: 5e pop %esi
12d6: 89 d0 mov %edx,%eax
12d8: 5f pop %edi
12d9: 5d pop %ebp
12da: c3 ret
000012db <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
12db: b8 01 00 00 00 mov $0x1,%eax
12e0: cd 40 int $0x40
12e2: c3 ret
000012e3 <exit>:
SYSCALL(exit)
12e3: b8 02 00 00 00 mov $0x2,%eax
12e8: cd 40 int $0x40
12ea: c3 ret
000012eb <wait>:
SYSCALL(wait)
12eb: b8 03 00 00 00 mov $0x3,%eax
12f0: cd 40 int $0x40
12f2: c3 ret
000012f3 <pipe>:
SYSCALL(pipe)
12f3: b8 04 00 00 00 mov $0x4,%eax
12f8: cd 40 int $0x40
12fa: c3 ret
000012fb <read>:
SYSCALL(read)
12fb: b8 05 00 00 00 mov $0x5,%eax
1300: cd 40 int $0x40
1302: c3 ret
00001303 <write>:
SYSCALL(write)
1303: b8 10 00 00 00 mov $0x10,%eax
1308: cd 40 int $0x40
130a: c3 ret
0000130b <close>:
SYSCALL(close)
130b: b8 15 00 00 00 mov $0x15,%eax
1310: cd 40 int $0x40
1312: c3 ret
00001313 <kill>:
SYSCALL(kill)
1313: b8 06 00 00 00 mov $0x6,%eax
1318: cd 40 int $0x40
131a: c3 ret
0000131b <exec>:
SYSCALL(exec)
131b: b8 07 00 00 00 mov $0x7,%eax
1320: cd 40 int $0x40
1322: c3 ret
00001323 <open>:
SYSCALL(open)
1323: b8 0f 00 00 00 mov $0xf,%eax
1328: cd 40 int $0x40
132a: c3 ret
0000132b <mknod>:
SYSCALL(mknod)
132b: b8 11 00 00 00 mov $0x11,%eax
1330: cd 40 int $0x40
1332: c3 ret
00001333 <unlink>:
SYSCALL(unlink)
1333: b8 12 00 00 00 mov $0x12,%eax
1338: cd 40 int $0x40
133a: c3 ret
0000133b <fstat>:
SYSCALL(fstat)
133b: b8 08 00 00 00 mov $0x8,%eax
1340: cd 40 int $0x40
1342: c3 ret
00001343 <link>:
SYSCALL(link)
1343: b8 13 00 00 00 mov $0x13,%eax
1348: cd 40 int $0x40
134a: c3 ret
0000134b <mkdir>:
SYSCALL(mkdir)
134b: b8 14 00 00 00 mov $0x14,%eax
1350: cd 40 int $0x40
1352: c3 ret
00001353 <chdir>:
SYSCALL(chdir)
1353: b8 09 00 00 00 mov $0x9,%eax
1358: cd 40 int $0x40
135a: c3 ret
0000135b <dup>:
SYSCALL(dup)
135b: b8 0a 00 00 00 mov $0xa,%eax
1360: cd 40 int $0x40
1362: c3 ret
00001363 <getpid>:
SYSCALL(getpid)
1363: b8 0b 00 00 00 mov $0xb,%eax
1368: cd 40 int $0x40
136a: c3 ret
0000136b <sbrk>:
SYSCALL(sbrk)
136b: b8 0c 00 00 00 mov $0xc,%eax
1370: cd 40 int $0x40
1372: c3 ret
00001373 <sleep>:
SYSCALL(sleep)
1373: b8 0d 00 00 00 mov $0xd,%eax
1378: cd 40 int $0x40
137a: c3 ret
0000137b <uptime>:
SYSCALL(uptime)
137b: b8 0e 00 00 00 mov $0xe,%eax
1380: cd 40 int $0x40
1382: c3 ret
00001383 <shm_open>:
SYSCALL(shm_open)
1383: b8 16 00 00 00 mov $0x16,%eax
1388: cd 40 int $0x40
138a: c3 ret
0000138b <shm_close>:
SYSCALL(shm_close)
138b: b8 17 00 00 00 mov $0x17,%eax
1390: cd 40 int $0x40
1392: c3 ret
1393: 66 90 xchg %ax,%ax
1395: 66 90 xchg %ax,%ax
1397: 66 90 xchg %ax,%ax
1399: 66 90 xchg %ax,%ax
139b: 66 90 xchg %ax,%ax
139d: 66 90 xchg %ax,%ax
139f: 90 nop
000013a0 <printint>:
write(fd, &c, 1);
}
static void
printint(int fd, int xx, int base, int sgn)
{
13a0: 55 push %ebp
13a1: 89 e5 mov %esp,%ebp
13a3: 57 push %edi
13a4: 56 push %esi
13a5: 53 push %ebx
13a6: 83 ec 3c sub $0x3c,%esp
13a9: 89 4d c4 mov %ecx,-0x3c(%ebp)
uint x;
neg = 0;
if(sgn && xx < 0){
neg = 1;
x = -xx;
13ac: 89 d1 mov %edx,%ecx
{
13ae: 89 45 b8 mov %eax,-0x48(%ebp)
if(sgn && xx < 0){
13b1: 85 d2 test %edx,%edx
13b3: 0f 89 7f 00 00 00 jns 1438 <printint+0x98>
13b9: f6 45 08 01 testb $0x1,0x8(%ebp)
13bd: 74 79 je 1438 <printint+0x98>
neg = 1;
13bf: c7 45 bc 01 00 00 00 movl $0x1,-0x44(%ebp)
x = -xx;
13c6: f7 d9 neg %ecx
} else {
x = xx;
}
i = 0;
13c8: 31 db xor %ebx,%ebx
13ca: 8d 75 d7 lea -0x29(%ebp),%esi
13cd: 8d 76 00 lea 0x0(%esi),%esi
do{
buf[i++] = digits[x % base];
13d0: 89 c8 mov %ecx,%eax
13d2: 31 d2 xor %edx,%edx
13d4: 89 cf mov %ecx,%edi
13d6: f7 75 c4 divl -0x3c(%ebp)
13d9: 0f b6 92 08 18 00 00 movzbl 0x1808(%edx),%edx
13e0: 89 45 c0 mov %eax,-0x40(%ebp)
13e3: 89 d8 mov %ebx,%eax
13e5: 8d 5b 01 lea 0x1(%ebx),%ebx
}while((x /= base) != 0);
13e8: 8b 4d c0 mov -0x40(%ebp),%ecx
buf[i++] = digits[x % base];
13eb: 88 14 1e mov %dl,(%esi,%ebx,1)
}while((x /= base) != 0);
13ee: 39 7d c4 cmp %edi,-0x3c(%ebp)
13f1: 76 dd jbe 13d0 <printint+0x30>
if(neg)
13f3: 8b 4d bc mov -0x44(%ebp),%ecx
13f6: 85 c9 test %ecx,%ecx
13f8: 74 0c je 1406 <printint+0x66>
buf[i++] = '-';
13fa: c6 44 1d d8 2d movb $0x2d,-0x28(%ebp,%ebx,1)
buf[i++] = digits[x % base];
13ff: 89 d8 mov %ebx,%eax
buf[i++] = '-';
1401: ba 2d 00 00 00 mov $0x2d,%edx
while(--i >= 0)
1406: 8b 7d b8 mov -0x48(%ebp),%edi
1409: 8d 5c 05 d7 lea -0x29(%ebp,%eax,1),%ebx
140d: eb 07 jmp 1416 <printint+0x76>
140f: 90 nop
1410: 0f b6 13 movzbl (%ebx),%edx
1413: 83 eb 01 sub $0x1,%ebx
write(fd, &c, 1);
1416: 83 ec 04 sub $0x4,%esp
1419: 88 55 d7 mov %dl,-0x29(%ebp)
141c: 6a 01 push $0x1
141e: 56 push %esi
141f: 57 push %edi
1420: e8 de fe ff ff call 1303 <write>
while(--i >= 0)
1425: 83 c4 10 add $0x10,%esp
1428: 39 de cmp %ebx,%esi
142a: 75 e4 jne 1410 <printint+0x70>
putc(fd, buf[i]);
}
142c: 8d 65 f4 lea -0xc(%ebp),%esp
142f: 5b pop %ebx
1430: 5e pop %esi
1431: 5f pop %edi
1432: 5d pop %ebp
1433: c3 ret
1434: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
neg = 0;
1438: c7 45 bc 00 00 00 00 movl $0x0,-0x44(%ebp)
143f: eb 87 jmp 13c8 <printint+0x28>
1441: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
1448: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
144f: 90 nop
00001450 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
1450: f3 0f 1e fb endbr32
1454: 55 push %ebp
1455: 89 e5 mov %esp,%ebp
1457: 57 push %edi
1458: 56 push %esi
1459: 53 push %ebx
145a: 83 ec 2c sub $0x2c,%esp
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
145d: 8b 75 0c mov 0xc(%ebp),%esi
1460: 0f b6 1e movzbl (%esi),%ebx
1463: 84 db test %bl,%bl
1465: 0f 84 b4 00 00 00 je 151f <printf+0xcf>
ap = (uint*)(void*)&fmt + 1;
146b: 8d 45 10 lea 0x10(%ebp),%eax
146e: 83 c6 01 add $0x1,%esi
write(fd, &c, 1);
1471: 8d 7d e7 lea -0x19(%ebp),%edi
state = 0;
1474: 31 d2 xor %edx,%edx
ap = (uint*)(void*)&fmt + 1;
1476: 89 45 d0 mov %eax,-0x30(%ebp)
1479: eb 33 jmp 14ae <printf+0x5e>
147b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
147f: 90 nop
1480: 89 55 d4 mov %edx,-0x2c(%ebp)
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
state = '%';
1483: ba 25 00 00 00 mov $0x25,%edx
if(c == '%'){
1488: 83 f8 25 cmp $0x25,%eax
148b: 74 17 je 14a4 <printf+0x54>
write(fd, &c, 1);
148d: 83 ec 04 sub $0x4,%esp
1490: 88 5d e7 mov %bl,-0x19(%ebp)
1493: 6a 01 push $0x1
1495: 57 push %edi
1496: ff 75 08 pushl 0x8(%ebp)
1499: e8 65 fe ff ff call 1303 <write>
149e: 8b 55 d4 mov -0x2c(%ebp),%edx
} else {
putc(fd, c);
14a1: 83 c4 10 add $0x10,%esp
for(i = 0; fmt[i]; i++){
14a4: 0f b6 1e movzbl (%esi),%ebx
14a7: 83 c6 01 add $0x1,%esi
14aa: 84 db test %bl,%bl
14ac: 74 71 je 151f <printf+0xcf>
c = fmt[i] & 0xff;
14ae: 0f be cb movsbl %bl,%ecx
14b1: 0f b6 c3 movzbl %bl,%eax
if(state == 0){
14b4: 85 d2 test %edx,%edx
14b6: 74 c8 je 1480 <printf+0x30>
}
} else if(state == '%'){
14b8: 83 fa 25 cmp $0x25,%edx
14bb: 75 e7 jne 14a4 <printf+0x54>
if(c == 'd'){
14bd: 83 f8 64 cmp $0x64,%eax
14c0: 0f 84 9a 00 00 00 je 1560 <printf+0x110>
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
14c6: 81 e1 f7 00 00 00 and $0xf7,%ecx
14cc: 83 f9 70 cmp $0x70,%ecx
14cf: 74 5f je 1530 <printf+0xe0>
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
14d1: 83 f8 73 cmp $0x73,%eax
14d4: 0f 84 d6 00 00 00 je 15b0 <printf+0x160>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
14da: 83 f8 63 cmp $0x63,%eax
14dd: 0f 84 8d 00 00 00 je 1570 <printf+0x120>
putc(fd, *ap);
ap++;
} else if(c == '%'){
14e3: 83 f8 25 cmp $0x25,%eax
14e6: 0f 84 b4 00 00 00 je 15a0 <printf+0x150>
write(fd, &c, 1);
14ec: 83 ec 04 sub $0x4,%esp
14ef: c6 45 e7 25 movb $0x25,-0x19(%ebp)
14f3: 6a 01 push $0x1
14f5: 57 push %edi
14f6: ff 75 08 pushl 0x8(%ebp)
14f9: e8 05 fe ff ff call 1303 <write>
putc(fd, c);
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
14fe: 88 5d e7 mov %bl,-0x19(%ebp)
write(fd, &c, 1);
1501: 83 c4 0c add $0xc,%esp
1504: 6a 01 push $0x1
1506: 83 c6 01 add $0x1,%esi
1509: 57 push %edi
150a: ff 75 08 pushl 0x8(%ebp)
150d: e8 f1 fd ff ff call 1303 <write>
for(i = 0; fmt[i]; i++){
1512: 0f b6 5e ff movzbl -0x1(%esi),%ebx
putc(fd, c);
1516: 83 c4 10 add $0x10,%esp
}
state = 0;
1519: 31 d2 xor %edx,%edx
for(i = 0; fmt[i]; i++){
151b: 84 db test %bl,%bl
151d: 75 8f jne 14ae <printf+0x5e>
}
}
}
151f: 8d 65 f4 lea -0xc(%ebp),%esp
1522: 5b pop %ebx
1523: 5e pop %esi
1524: 5f pop %edi
1525: 5d pop %ebp
1526: c3 ret
1527: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
152e: 66 90 xchg %ax,%ax
printint(fd, *ap, 16, 0);
1530: 83 ec 0c sub $0xc,%esp
1533: b9 10 00 00 00 mov $0x10,%ecx
1538: 6a 00 push $0x0
153a: 8b 5d d0 mov -0x30(%ebp),%ebx
153d: 8b 45 08 mov 0x8(%ebp),%eax
1540: 8b 13 mov (%ebx),%edx
1542: e8 59 fe ff ff call 13a0 <printint>
ap++;
1547: 89 d8 mov %ebx,%eax
1549: 83 c4 10 add $0x10,%esp
state = 0;
154c: 31 d2 xor %edx,%edx
ap++;
154e: 83 c0 04 add $0x4,%eax
1551: 89 45 d0 mov %eax,-0x30(%ebp)
1554: e9 4b ff ff ff jmp 14a4 <printf+0x54>
1559: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
printint(fd, *ap, 10, 1);
1560: 83 ec 0c sub $0xc,%esp
1563: b9 0a 00 00 00 mov $0xa,%ecx
1568: 6a 01 push $0x1
156a: eb ce jmp 153a <printf+0xea>
156c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
putc(fd, *ap);
1570: 8b 5d d0 mov -0x30(%ebp),%ebx
write(fd, &c, 1);
1573: 83 ec 04 sub $0x4,%esp
putc(fd, *ap);
1576: 8b 03 mov (%ebx),%eax
write(fd, &c, 1);
1578: 6a 01 push $0x1
ap++;
157a: 83 c3 04 add $0x4,%ebx
write(fd, &c, 1);
157d: 57 push %edi
157e: ff 75 08 pushl 0x8(%ebp)
putc(fd, *ap);
1581: 88 45 e7 mov %al,-0x19(%ebp)
write(fd, &c, 1);
1584: e8 7a fd ff ff call 1303 <write>
ap++;
1589: 89 5d d0 mov %ebx,-0x30(%ebp)
158c: 83 c4 10 add $0x10,%esp
state = 0;
158f: 31 d2 xor %edx,%edx
1591: e9 0e ff ff ff jmp 14a4 <printf+0x54>
1596: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
159d: 8d 76 00 lea 0x0(%esi),%esi
putc(fd, c);
15a0: 88 5d e7 mov %bl,-0x19(%ebp)
write(fd, &c, 1);
15a3: 83 ec 04 sub $0x4,%esp
15a6: e9 59 ff ff ff jmp 1504 <printf+0xb4>
15ab: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
15af: 90 nop
s = (char*)*ap;
15b0: 8b 45 d0 mov -0x30(%ebp),%eax
15b3: 8b 18 mov (%eax),%ebx
ap++;
15b5: 83 c0 04 add $0x4,%eax
15b8: 89 45 d0 mov %eax,-0x30(%ebp)
if(s == 0)
15bb: 85 db test %ebx,%ebx
15bd: 74 17 je 15d6 <printf+0x186>
while(*s != 0){
15bf: 0f b6 03 movzbl (%ebx),%eax
state = 0;
15c2: 31 d2 xor %edx,%edx
while(*s != 0){
15c4: 84 c0 test %al,%al
15c6: 0f 84 d8 fe ff ff je 14a4 <printf+0x54>
15cc: 89 75 d4 mov %esi,-0x2c(%ebp)
15cf: 89 de mov %ebx,%esi
15d1: 8b 5d 08 mov 0x8(%ebp),%ebx
15d4: eb 1a jmp 15f0 <printf+0x1a0>
s = "(null)";
15d6: bb 01 18 00 00 mov $0x1801,%ebx
while(*s != 0){
15db: 89 75 d4 mov %esi,-0x2c(%ebp)
15de: b8 28 00 00 00 mov $0x28,%eax
15e3: 89 de mov %ebx,%esi
15e5: 8b 5d 08 mov 0x8(%ebp),%ebx
15e8: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
15ef: 90 nop
write(fd, &c, 1);
15f0: 83 ec 04 sub $0x4,%esp
s++;
15f3: 83 c6 01 add $0x1,%esi
15f6: 88 45 e7 mov %al,-0x19(%ebp)
write(fd, &c, 1);
15f9: 6a 01 push $0x1
15fb: 57 push %edi
15fc: 53 push %ebx
15fd: e8 01 fd ff ff call 1303 <write>
while(*s != 0){
1602: 0f b6 06 movzbl (%esi),%eax
1605: 83 c4 10 add $0x10,%esp
1608: 84 c0 test %al,%al
160a: 75 e4 jne 15f0 <printf+0x1a0>
160c: 8b 75 d4 mov -0x2c(%ebp),%esi
state = 0;
160f: 31 d2 xor %edx,%edx
1611: e9 8e fe ff ff jmp 14a4 <printf+0x54>
1616: 66 90 xchg %ax,%ax
1618: 66 90 xchg %ax,%ax
161a: 66 90 xchg %ax,%ax
161c: 66 90 xchg %ax,%ax
161e: 66 90 xchg %ax,%ax
00001620 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
1620: f3 0f 1e fb endbr32
1624: 55 push %ebp
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
1625: a1 f8 1a 00 00 mov 0x1af8,%eax
{
162a: 89 e5 mov %esp,%ebp
162c: 57 push %edi
162d: 56 push %esi
162e: 53 push %ebx
162f: 8b 5d 08 mov 0x8(%ebp),%ebx
1632: 8b 10 mov (%eax),%edx
bp = (Header*)ap - 1;
1634: 8d 4b f8 lea -0x8(%ebx),%ecx
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
1637: 39 c8 cmp %ecx,%eax
1639: 73 15 jae 1650 <free+0x30>
163b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
163f: 90 nop
1640: 39 d1 cmp %edx,%ecx
1642: 72 14 jb 1658 <free+0x38>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
1644: 39 d0 cmp %edx,%eax
1646: 73 10 jae 1658 <free+0x38>
{
1648: 89 d0 mov %edx,%eax
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
164a: 8b 10 mov (%eax),%edx
164c: 39 c8 cmp %ecx,%eax
164e: 72 f0 jb 1640 <free+0x20>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
1650: 39 d0 cmp %edx,%eax
1652: 72 f4 jb 1648 <free+0x28>
1654: 39 d1 cmp %edx,%ecx
1656: 73 f0 jae 1648 <free+0x28>
break;
if(bp + bp->s.size == p->s.ptr){
1658: 8b 73 fc mov -0x4(%ebx),%esi
165b: 8d 3c f1 lea (%ecx,%esi,8),%edi
165e: 39 fa cmp %edi,%edx
1660: 74 1e je 1680 <free+0x60>
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
1662: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
1665: 8b 50 04 mov 0x4(%eax),%edx
1668: 8d 34 d0 lea (%eax,%edx,8),%esi
166b: 39 f1 cmp %esi,%ecx
166d: 74 28 je 1697 <free+0x77>
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
166f: 89 08 mov %ecx,(%eax)
freep = p;
}
1671: 5b pop %ebx
freep = p;
1672: a3 f8 1a 00 00 mov %eax,0x1af8
}
1677: 5e pop %esi
1678: 5f pop %edi
1679: 5d pop %ebp
167a: c3 ret
167b: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
167f: 90 nop
bp->s.size += p->s.ptr->s.size;
1680: 03 72 04 add 0x4(%edx),%esi
1683: 89 73 fc mov %esi,-0x4(%ebx)
bp->s.ptr = p->s.ptr->s.ptr;
1686: 8b 10 mov (%eax),%edx
1688: 8b 12 mov (%edx),%edx
168a: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
168d: 8b 50 04 mov 0x4(%eax),%edx
1690: 8d 34 d0 lea (%eax,%edx,8),%esi
1693: 39 f1 cmp %esi,%ecx
1695: 75 d8 jne 166f <free+0x4f>
p->s.size += bp->s.size;
1697: 03 53 fc add -0x4(%ebx),%edx
freep = p;
169a: a3 f8 1a 00 00 mov %eax,0x1af8
p->s.size += bp->s.size;
169f: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
16a2: 8b 53 f8 mov -0x8(%ebx),%edx
16a5: 89 10 mov %edx,(%eax)
}
16a7: 5b pop %ebx
16a8: 5e pop %esi
16a9: 5f pop %edi
16aa: 5d pop %ebp
16ab: c3 ret
16ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
000016b0 <malloc>:
return freep;
}
void*
malloc(uint nbytes)
{
16b0: f3 0f 1e fb endbr32
16b4: 55 push %ebp
16b5: 89 e5 mov %esp,%ebp
16b7: 57 push %edi
16b8: 56 push %esi
16b9: 53 push %ebx
16ba: 83 ec 1c sub $0x1c,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
16bd: 8b 45 08 mov 0x8(%ebp),%eax
if((prevp = freep) == 0){
16c0: 8b 3d f8 1a 00 00 mov 0x1af8,%edi
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
16c6: 8d 70 07 lea 0x7(%eax),%esi
16c9: c1 ee 03 shr $0x3,%esi
16cc: 83 c6 01 add $0x1,%esi
if((prevp = freep) == 0){
16cf: 85 ff test %edi,%edi
16d1: 0f 84 a9 00 00 00 je 1780 <malloc+0xd0>
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
16d7: 8b 07 mov (%edi),%eax
if(p->s.size >= nunits){
16d9: 8b 48 04 mov 0x4(%eax),%ecx
16dc: 39 f1 cmp %esi,%ecx
16de: 73 6d jae 174d <malloc+0x9d>
16e0: 81 fe 00 10 00 00 cmp $0x1000,%esi
16e6: bb 00 10 00 00 mov $0x1000,%ebx
16eb: 0f 43 de cmovae %esi,%ebx
p = sbrk(nu * sizeof(Header));
16ee: 8d 0c dd 00 00 00 00 lea 0x0(,%ebx,8),%ecx
16f5: 89 4d e4 mov %ecx,-0x1c(%ebp)
16f8: eb 17 jmp 1711 <malloc+0x61>
16fa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
1700: 8b 10 mov (%eax),%edx
if(p->s.size >= nunits){
1702: 8b 4a 04 mov 0x4(%edx),%ecx
1705: 39 f1 cmp %esi,%ecx
1707: 73 4f jae 1758 <malloc+0xa8>
1709: 8b 3d f8 1a 00 00 mov 0x1af8,%edi
170f: 89 d0 mov %edx,%eax
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
1711: 39 c7 cmp %eax,%edi
1713: 75 eb jne 1700 <malloc+0x50>
p = sbrk(nu * sizeof(Header));
1715: 83 ec 0c sub $0xc,%esp
1718: ff 75 e4 pushl -0x1c(%ebp)
171b: e8 4b fc ff ff call 136b <sbrk>
if(p == (char*)-1)
1720: 83 c4 10 add $0x10,%esp
1723: 83 f8 ff cmp $0xffffffff,%eax
1726: 74 1b je 1743 <malloc+0x93>
hp->s.size = nu;
1728: 89 58 04 mov %ebx,0x4(%eax)
free((void*)(hp + 1));
172b: 83 ec 0c sub $0xc,%esp
172e: 83 c0 08 add $0x8,%eax
1731: 50 push %eax
1732: e8 e9 fe ff ff call 1620 <free>
return freep;
1737: a1 f8 1a 00 00 mov 0x1af8,%eax
if((p = morecore(nunits)) == 0)
173c: 83 c4 10 add $0x10,%esp
173f: 85 c0 test %eax,%eax
1741: 75 bd jne 1700 <malloc+0x50>
return 0;
}
}
1743: 8d 65 f4 lea -0xc(%ebp),%esp
return 0;
1746: 31 c0 xor %eax,%eax
}
1748: 5b pop %ebx
1749: 5e pop %esi
174a: 5f pop %edi
174b: 5d pop %ebp
174c: c3 ret
if(p->s.size >= nunits){
174d: 89 c2 mov %eax,%edx
174f: 89 f8 mov %edi,%eax
1751: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
if(p->s.size == nunits)
1758: 39 ce cmp %ecx,%esi
175a: 74 54 je 17b0 <malloc+0x100>
p->s.size -= nunits;
175c: 29 f1 sub %esi,%ecx
175e: 89 4a 04 mov %ecx,0x4(%edx)
p += p->s.size;
1761: 8d 14 ca lea (%edx,%ecx,8),%edx
p->s.size = nunits;
1764: 89 72 04 mov %esi,0x4(%edx)
freep = prevp;
1767: a3 f8 1a 00 00 mov %eax,0x1af8
}
176c: 8d 65 f4 lea -0xc(%ebp),%esp
return (void*)(p + 1);
176f: 8d 42 08 lea 0x8(%edx),%eax
}
1772: 5b pop %ebx
1773: 5e pop %esi
1774: 5f pop %edi
1775: 5d pop %ebp
1776: c3 ret
1777: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
177e: 66 90 xchg %ax,%ax
base.s.ptr = freep = prevp = &base;
1780: c7 05 f8 1a 00 00 fc movl $0x1afc,0x1af8
1787: 1a 00 00
base.s.size = 0;
178a: bf fc 1a 00 00 mov $0x1afc,%edi
base.s.ptr = freep = prevp = &base;
178f: c7 05 fc 1a 00 00 fc movl $0x1afc,0x1afc
1796: 1a 00 00
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
1799: 89 f8 mov %edi,%eax
base.s.size = 0;
179b: c7 05 00 1b 00 00 00 movl $0x0,0x1b00
17a2: 00 00 00
if(p->s.size >= nunits){
17a5: e9 36 ff ff ff jmp 16e0 <malloc+0x30>
17aa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
prevp->s.ptr = p->s.ptr;
17b0: 8b 0a mov (%edx),%ecx
17b2: 89 08 mov %ecx,(%eax)
17b4: eb b1 jmp 1767 <malloc+0xb7>
17b6: 66 90 xchg %ax,%ax
17b8: 66 90 xchg %ax,%ax
17ba: 66 90 xchg %ax,%ax
17bc: 66 90 xchg %ax,%ax
17be: 66 90 xchg %ax,%ax
000017c0 <uacquire>:
#include "uspinlock.h"
#include "x86.h"
void
uacquire(struct uspinlock *lk)
{
17c0: f3 0f 1e fb endbr32
17c4: 55 push %ebp
xchg(volatile uint *addr, uint newval)
{
uint result;
// The + in "+m" denotes a read-modify-write operand.
asm volatile("lock; xchgl %0, %1" :
17c5: b9 01 00 00 00 mov $0x1,%ecx
17ca: 89 e5 mov %esp,%ebp
17cc: 8b 55 08 mov 0x8(%ebp),%edx
17cf: 90 nop
17d0: 89 c8 mov %ecx,%eax
17d2: f0 87 02 lock xchg %eax,(%edx)
// The xchg is atomic.
while(xchg(&lk->locked, 1) != 0)
17d5: 85 c0 test %eax,%eax
17d7: 75 f7 jne 17d0 <uacquire+0x10>
;
// Tell the C compiler and the processor to not move loads or stores
// past this point, to ensure that the critical section's memory
// references happen after the lock is acquired.
__sync_synchronize();
17d9: f0 83 0c 24 00 lock orl $0x0,(%esp)
}
17de: 5d pop %ebp
17df: c3 ret
000017e0 <urelease>:
void urelease (struct uspinlock *lk) {
17e0: f3 0f 1e fb endbr32
17e4: 55 push %ebp
17e5: 89 e5 mov %esp,%ebp
17e7: 8b 45 08 mov 0x8(%ebp),%eax
__sync_synchronize();
17ea: f0 83 0c 24 00 lock orl $0x0,(%esp)
// Release the lock, equivalent to lk->locked = 0.
// This code can't use a C assignment, since it might
// not be atomic. A real OS would use C atomics here.
asm volatile("movl $0, %0" : "+m" (lk->locked) : );
17ef: c7 00 00 00 00 00 movl $0x0,(%eax)
}
17f5: 5d pop %ebp
17f6: c3 ret
|
src/main.adb | psyomn/afile | 2 | 21333 | <reponame>psyomn/afile<gh_stars>1-10
-- Copyright 2017-2019 <NAME> (psyomn)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.with Interfaces; use Interfaces;
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Command_Line; use Ada.Command_Line;
with Ada.Exceptions; use Ada.Exceptions;
with Identify;
procedure Main is
Argument_Error : exception;
Arg_Count : constant Natural := Argument_Count;
procedure Print_Help;
procedure Print_Help is
begin
Put_Line ("usage: ");
Put_Line (" afile <file>+");
end Print_Help;
begin
if Arg_Count < 1 then
raise Argument_Error with "you need to provide more than one parameter";
else
for I in 1 .. Arg_Count loop
Identify.Identify_File (Argument (I));
end loop;
end if;
exception
when E : Argument_Error =>
Put_Line ("Error: " & Exception_Name (E) &
": " & Exception_Message (E));
Print_Help;
when E : others =>
Put_Line ("Unknown Error: " & Exception_Name (E) &
": " & Exception_Message (E));
end Main;
|
oeis/294/A294608.asm | neoneye/loda-programs | 11 | 8177 | <gh_stars>10-100
; A294608: a(n) = Sum_{d|n} d^(d + 1 + n/d).
; Submitted by <NAME>
; 1,17,244,4129,78126,1680410,40353608,1073758337,31381061797,1000000390882,34522712143932,1283918474699170,51185893014090758,2177953338091847410,98526125335695332184,4722366482878235412481,239072435685151324847154,12748236216396360664503179,714209495693373205673756420,41943040000000010000010822394,2576580875108218291931053373552,165251092644282266159726847814282,11045767571919545466173812409689944,768231807465763655698078019019633650,55511151231257827021181583404589843751
add $0,1
mov $2,$0
lpb $0
mov $3,$2
dif $3,$0
mov $4,$3
cmp $3,$2
cmp $3,0
mul $3,$0
sub $0,1
add $4,$0
add $4,2
pow $3,$4
add $1,$3
lpe
add $1,1
mov $0,$1
|
libsrc/target/pc88/__brksave.asm | ahjelm/z88dk | 640 | 168181 | <reponame>ahjelm/z88dk
SECTION data_clib
PUBLIC __brksave
__brksave: defb 1 ;; Keeping the BREAK enable flag, used by pc88_break, etc..
|
libsrc/_DEVELOPMENT/adt/wv_priority_queue/z80/asm_wv_priority_queue_destroy.asm | jpoikela/z88dk | 640 | 168773 | <reponame>jpoikela/z88dk
; ===============================================================
; Mar 2014
; ===============================================================
;
; void wv_priority_queue_destroy(wv_priority_queue_t *q)
;
; Zero the queue structure and release memory.
;
; ===============================================================
PUBLIC asm_wv_priority_queue_destroy
EXTERN asm_bv_priority_queue_destroy
defc asm_wv_priority_queue_destroy = asm_bv_priority_queue_destroy
; enter : hl = priority_queue *
;
; uses : af, de, hl
|
.build/ada/asis-gela-elements-pathes.adb | faelys/gela-asis | 4 | 7389 | <gh_stars>1-10
------------------------------------------------------------------------------
-- Copyright (c) 2006-2013, <NAME>
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
--
-- * Redistributions of source code must retain the above copyright notice,
-- this list of conditions and the following disclaimer.
-- * Redistributions in binary form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in the
-- documentation and/or other materials provided with the distribution.
-- * Neither the name of the Maxim Reznik, IE nor the names of its
-- contributors may be used to endorse or promote products derived from
-- this software without specific prior written permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-- POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------
package body Asis.Gela.Elements.Pathes is
function Condition_Expression
(Element : If_Path_Node) return Asis.Expression is
begin
return Element.Condition_Expression;
end Condition_Expression;
procedure Set_Condition_Expression
(Element : in out If_Path_Node;
Value : in Asis.Expression) is
begin
Element.Condition_Expression := Value;
end Set_Condition_Expression;
function New_If_Path_Node
(The_Context : ASIS.Context)
return If_Path_Ptr
is
Result : If_Path_Ptr :=
new If_Path_Node;
begin
Set_Enclosing_Compilation_Unit
(Result.all, Current_Unit (The_Context.all));
return Result;
end New_If_Path_Node;
function Path_Kind (Element : If_Path_Node)
return Asis.Path_Kinds is
begin
return An_If_Path;
end;
function Children (Element : access If_Path_Node)
return Traverse_List is
begin
return ((False, Element.Condition_Expression'Access),
(True, Asis.Element (Element.Sequence_Of_Statements)));
end Children;
function Clone
(Element : If_Path_Node;
Parent : Asis.Element)
return Asis.Element
is
Result : constant If_Path_Ptr := new If_Path_Node;
begin
Result.Enclosing_Element := Parent;
Result.Is_Part_Of_Implicit := Element.Is_Part_Of_Implicit;
Result.Is_Part_Of_Inherited := Element.Is_Part_Of_Inherited;
Result.Is_Part_Of_Instance := Element.Is_Part_Of_Instance;
Result.Start_Position := Element.Start_Position;
Result.End_Position := Element.End_Position;
Result.Enclosing_Compilation_Unit :=
Enclosing_Compilation_Unit (Parent.all);
Result.Hash := Element.Hash;
return Asis.Element (Result);
end Clone;
procedure Copy
(Source : in Asis.Element;
Target : access If_Path_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element)
is
begin
Target.Condition_Expression :=
Copy (Cloner, Condition_Expression (Source.all), Asis.Element (Target));
Set_Sequence_Of_Statements
(Target.all,
Primary_Statement_Lists.Deep_Copy
(Sequence_Of_Statements (Source.all), Cloner, Asis.Element (Target)));
end Copy;
function New_Elsif_Path_Node
(The_Context : ASIS.Context)
return Elsif_Path_Ptr
is
Result : Elsif_Path_Ptr :=
new Elsif_Path_Node;
begin
Set_Enclosing_Compilation_Unit
(Result.all, Current_Unit (The_Context.all));
return Result;
end New_Elsif_Path_Node;
function Path_Kind (Element : Elsif_Path_Node)
return Asis.Path_Kinds is
begin
return An_Elsif_Path;
end;
function Clone
(Element : Elsif_Path_Node;
Parent : Asis.Element)
return Asis.Element
is
Result : constant Elsif_Path_Ptr := new Elsif_Path_Node;
begin
Result.Enclosing_Element := Parent;
Result.Is_Part_Of_Implicit := Element.Is_Part_Of_Implicit;
Result.Is_Part_Of_Inherited := Element.Is_Part_Of_Inherited;
Result.Is_Part_Of_Instance := Element.Is_Part_Of_Instance;
Result.Start_Position := Element.Start_Position;
Result.End_Position := Element.End_Position;
Result.Enclosing_Compilation_Unit :=
Enclosing_Compilation_Unit (Parent.all);
Result.Hash := Element.Hash;
return Asis.Element (Result);
end Clone;
procedure Copy
(Source : in Asis.Element;
Target : access Elsif_Path_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element)
is
begin
Target.Condition_Expression :=
Copy (Cloner, Condition_Expression (Source.all), Asis.Element (Target));
Set_Sequence_Of_Statements
(Target.all,
Primary_Statement_Lists.Deep_Copy
(Sequence_Of_Statements (Source.all), Cloner, Asis.Element (Target)));
end Copy;
function New_Else_Path_Node
(The_Context : ASIS.Context)
return Else_Path_Ptr
is
Result : Else_Path_Ptr :=
new Else_Path_Node;
begin
Set_Enclosing_Compilation_Unit
(Result.all, Current_Unit (The_Context.all));
return Result;
end New_Else_Path_Node;
function Path_Kind (Element : Else_Path_Node)
return Asis.Path_Kinds is
begin
return An_Else_Path;
end;
function Clone
(Element : Else_Path_Node;
Parent : Asis.Element)
return Asis.Element
is
Result : constant Else_Path_Ptr := new Else_Path_Node;
begin
Result.Enclosing_Element := Parent;
Result.Is_Part_Of_Implicit := Element.Is_Part_Of_Implicit;
Result.Is_Part_Of_Inherited := Element.Is_Part_Of_Inherited;
Result.Is_Part_Of_Instance := Element.Is_Part_Of_Instance;
Result.Start_Position := Element.Start_Position;
Result.End_Position := Element.End_Position;
Result.Enclosing_Compilation_Unit :=
Enclosing_Compilation_Unit (Parent.all);
Result.Hash := Element.Hash;
return Asis.Element (Result);
end Clone;
procedure Copy
(Source : in Asis.Element;
Target : access Else_Path_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element)
is
begin
Set_Sequence_Of_Statements
(Target.all,
Primary_Statement_Lists.Deep_Copy
(Sequence_Of_Statements (Source.all), Cloner, Asis.Element (Target)));
end Copy;
function Case_Statement_Alternative_Choices
(Element : Case_Path_Node;
Include_Pragmas : in Boolean := False) return Asis.Element_List is
begin
return Primary_Choise_Lists.To_Element_List
(Element.Case_Statement_Alternative_Choices, Include_Pragmas);
end Case_Statement_Alternative_Choices;
procedure Set_Case_Statement_Alternative_Choices
(Element : in out Case_Path_Node;
Value : in Asis.Element) is
begin
Element.Case_Statement_Alternative_Choices := Primary_Choise_Lists.List (Value);
end Set_Case_Statement_Alternative_Choices;
function Case_Statement_Alternative_Choices_List
(Element : Case_Path_Node) return Asis.Element is
begin
return Asis.Element (Element.Case_Statement_Alternative_Choices);
end Case_Statement_Alternative_Choices_List;
function Pragmas
(Element : Case_Path_Node;
Include_Pragmas : in Boolean := False) return Asis.Element_List is
begin
return Primary_Pragma_Lists.To_Element_List
(Element.Pragmas, Include_Pragmas);
end Pragmas;
procedure Set_Pragmas
(Element : in out Case_Path_Node;
Value : in Asis.Element) is
begin
Element.Pragmas := Primary_Pragma_Lists.List (Value);
end Set_Pragmas;
function Pragmas_List
(Element : Case_Path_Node) return Asis.Element is
begin
return Asis.Element (Element.Pragmas);
end Pragmas_List;
function New_Case_Path_Node
(The_Context : ASIS.Context)
return Case_Path_Ptr
is
Result : Case_Path_Ptr :=
new Case_Path_Node;
begin
Set_Enclosing_Compilation_Unit
(Result.all, Current_Unit (The_Context.all));
return Result;
end New_Case_Path_Node;
function Path_Kind (Element : Case_Path_Node)
return Asis.Path_Kinds is
begin
return A_Case_Path;
end;
function Children (Element : access Case_Path_Node)
return Traverse_List is
begin
return ((True, Asis.Element (Element.Case_Statement_Alternative_Choices)),
(True, Asis.Element (Element.Pragmas)),
(True, Asis.Element (Element.Sequence_Of_Statements)));
end Children;
function Clone
(Element : Case_Path_Node;
Parent : Asis.Element)
return Asis.Element
is
Result : constant Case_Path_Ptr := new Case_Path_Node;
begin
Result.Enclosing_Element := Parent;
Result.Is_Part_Of_Implicit := Element.Is_Part_Of_Implicit;
Result.Is_Part_Of_Inherited := Element.Is_Part_Of_Inherited;
Result.Is_Part_Of_Instance := Element.Is_Part_Of_Instance;
Result.Start_Position := Element.Start_Position;
Result.End_Position := Element.End_Position;
Result.Enclosing_Compilation_Unit :=
Enclosing_Compilation_Unit (Parent.all);
Result.Hash := Element.Hash;
return Asis.Element (Result);
end Clone;
procedure Copy
(Source : in Asis.Element;
Target : access Case_Path_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element)
is
begin
Set_Case_Statement_Alternative_Choices
(Target.all,
Primary_Choise_Lists.Deep_Copy
(Case_Statement_Alternative_Choices (Source.all), Cloner, Asis.Element (Target)));
Set_Pragmas
(Target.all,
Primary_Pragma_Lists.Deep_Copy
(Pragmas (Source.all), Cloner, Asis.Element (Target)));
Set_Sequence_Of_Statements
(Target.all,
Primary_Statement_Lists.Deep_Copy
(Sequence_Of_Statements (Source.all), Cloner, Asis.Element (Target)));
end Copy;
function Guard
(Element : Select_Path_Node) return Asis.Expression is
begin
return Element.Guard;
end Guard;
procedure Set_Guard
(Element : in out Select_Path_Node;
Value : in Asis.Expression) is
begin
Element.Guard := Value;
end Set_Guard;
function Pragmas
(Element : Select_Path_Node;
Include_Pragmas : in Boolean := False) return Asis.Element_List is
begin
return Primary_Pragma_Lists.To_Element_List
(Element.Pragmas, Include_Pragmas);
end Pragmas;
procedure Set_Pragmas
(Element : in out Select_Path_Node;
Value : in Asis.Element) is
begin
Element.Pragmas := Primary_Pragma_Lists.List (Value);
end Set_Pragmas;
function Pragmas_List
(Element : Select_Path_Node) return Asis.Element is
begin
return Asis.Element (Element.Pragmas);
end Pragmas_List;
function New_Select_Path_Node
(The_Context : ASIS.Context)
return Select_Path_Ptr
is
Result : Select_Path_Ptr :=
new Select_Path_Node;
begin
Set_Enclosing_Compilation_Unit
(Result.all, Current_Unit (The_Context.all));
return Result;
end New_Select_Path_Node;
function Path_Kind (Element : Select_Path_Node)
return Asis.Path_Kinds is
begin
return A_Select_Path;
end;
function Children (Element : access Select_Path_Node)
return Traverse_List is
begin
return ((False, Element.Guard'Access),
(True, Asis.Element (Element.Pragmas)),
(True, Asis.Element (Element.Sequence_Of_Statements)));
end Children;
function Clone
(Element : Select_Path_Node;
Parent : Asis.Element)
return Asis.Element
is
Result : constant Select_Path_Ptr := new Select_Path_Node;
begin
Result.Enclosing_Element := Parent;
Result.Is_Part_Of_Implicit := Element.Is_Part_Of_Implicit;
Result.Is_Part_Of_Inherited := Element.Is_Part_Of_Inherited;
Result.Is_Part_Of_Instance := Element.Is_Part_Of_Instance;
Result.Start_Position := Element.Start_Position;
Result.End_Position := Element.End_Position;
Result.Enclosing_Compilation_Unit :=
Enclosing_Compilation_Unit (Parent.all);
Result.Hash := Element.Hash;
return Asis.Element (Result);
end Clone;
procedure Copy
(Source : in Asis.Element;
Target : access Select_Path_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element)
is
begin
Target.Guard :=
Copy (Cloner, Guard (Source.all), Asis.Element (Target));
Set_Pragmas
(Target.all,
Primary_Pragma_Lists.Deep_Copy
(Pragmas (Source.all), Cloner, Asis.Element (Target)));
Set_Sequence_Of_Statements
(Target.all,
Primary_Statement_Lists.Deep_Copy
(Sequence_Of_Statements (Source.all), Cloner, Asis.Element (Target)));
end Copy;
function New_Or_Path_Node
(The_Context : ASIS.Context)
return Or_Path_Ptr
is
Result : Or_Path_Ptr :=
new Or_Path_Node;
begin
Set_Enclosing_Compilation_Unit
(Result.all, Current_Unit (The_Context.all));
return Result;
end New_Or_Path_Node;
function Path_Kind (Element : Or_Path_Node)
return Asis.Path_Kinds is
begin
return An_Or_Path;
end;
function Clone
(Element : Or_Path_Node;
Parent : Asis.Element)
return Asis.Element
is
Result : constant Or_Path_Ptr := new Or_Path_Node;
begin
Result.Enclosing_Element := Parent;
Result.Is_Part_Of_Implicit := Element.Is_Part_Of_Implicit;
Result.Is_Part_Of_Inherited := Element.Is_Part_Of_Inherited;
Result.Is_Part_Of_Instance := Element.Is_Part_Of_Instance;
Result.Start_Position := Element.Start_Position;
Result.End_Position := Element.End_Position;
Result.Enclosing_Compilation_Unit :=
Enclosing_Compilation_Unit (Parent.all);
Result.Hash := Element.Hash;
return Asis.Element (Result);
end Clone;
procedure Copy
(Source : in Asis.Element;
Target : access Or_Path_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element)
is
begin
Target.Guard :=
Copy (Cloner, Guard (Source.all), Asis.Element (Target));
Set_Pragmas
(Target.all,
Primary_Pragma_Lists.Deep_Copy
(Pragmas (Source.all), Cloner, Asis.Element (Target)));
Set_Sequence_Of_Statements
(Target.all,
Primary_Statement_Lists.Deep_Copy
(Sequence_Of_Statements (Source.all), Cloner, Asis.Element (Target)));
end Copy;
function New_Then_Abort_Path_Node
(The_Context : ASIS.Context)
return Then_Abort_Path_Ptr
is
Result : Then_Abort_Path_Ptr :=
new Then_Abort_Path_Node;
begin
Set_Enclosing_Compilation_Unit
(Result.all, Current_Unit (The_Context.all));
return Result;
end New_Then_Abort_Path_Node;
function Path_Kind (Element : Then_Abort_Path_Node)
return Asis.Path_Kinds is
begin
return A_Then_Abort_Path;
end;
function Clone
(Element : Then_Abort_Path_Node;
Parent : Asis.Element)
return Asis.Element
is
Result : constant Then_Abort_Path_Ptr := new Then_Abort_Path_Node;
begin
Result.Enclosing_Element := Parent;
Result.Is_Part_Of_Implicit := Element.Is_Part_Of_Implicit;
Result.Is_Part_Of_Inherited := Element.Is_Part_Of_Inherited;
Result.Is_Part_Of_Instance := Element.Is_Part_Of_Instance;
Result.Start_Position := Element.Start_Position;
Result.End_Position := Element.End_Position;
Result.Enclosing_Compilation_Unit :=
Enclosing_Compilation_Unit (Parent.all);
Result.Hash := Element.Hash;
return Asis.Element (Result);
end Clone;
procedure Copy
(Source : in Asis.Element;
Target : access Then_Abort_Path_Node;
Cloner : in Cloner_Class;
Parent : in Asis.Element)
is
begin
Set_Sequence_Of_Statements
(Target.all,
Primary_Statement_Lists.Deep_Copy
(Sequence_Of_Statements (Source.all), Cloner, Asis.Element (Target)));
end Copy;
end Asis.Gela.Elements.Pathes;
|
src/common/keccak-generic_hash.adb | damaki/libkeccak | 26 | 15749 | -------------------------------------------------------------------------------
-- Copyright (c) 2019, <NAME>
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
-- * Redistributions of source code must retain the above copyright
-- notice, this list of conditions and the following disclaimer.
-- * Redistributions in binary form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in the
-- documentation and/or other materials provided with the distribution.
-- * The name of the copyright holder may not 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 BE LIABLE FOR ANY
-- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------------
package body Keccak.Generic_Hash
is
------------
-- Init --
------------
procedure Init (Ctx : out Context)
is
begin
Hash_Sponge.Init (Ctx.Sponge_Ctx, Capacity, Permutation_Initial_Value);
Ctx.Update_Complete := False;
end Init;
--------------
-- Update --
--------------
procedure Update (Ctx : in out Context;
Message : in Byte_Array;
Bit_Length : in Natural)
is
Num_Bytes : constant Natural := (Bit_Length + 7) / 8;
begin
pragma Assert (Num_Bytes <= Message'Length);
if Num_Bytes > 0 then
if Bit_Length mod 8 = 0 then
Hash_Sponge.Absorb (Ctx.Sponge_Ctx,
Message (Message'First ..
Message'First + (Num_Bytes - 1)),
Bit_Length);
else
-- Last invocation of Update; append suffix now
Hash_Sponge.Absorb_With_Suffix (Ctx.Sponge_Ctx,
Message (Message'First ..
Message'First + (Num_Bytes - 1)),
Bit_Length,
Suffix,
Suffix_Size);
Ctx.Update_Complete := True;
end if;
end if;
end Update;
--------------
-- Update --
--------------
procedure Update (Ctx : in out Context;
Message : in Byte_Array)
is
Max_Chunk_Len : constant := (Natural'Last / 8) - 1;
Remaining : Natural := Message'Length;
Offset : Natural := 0;
begin
while Remaining >= Max_Chunk_Len loop
pragma Loop_Variant (Decreases => Remaining);
pragma Loop_Invariant (Remaining + Offset = Message'Length
and State_Of (Ctx) = Updating);
Update (Ctx,
Message (Message'First + Offset .. Message'First + Offset + (Max_Chunk_Len - 1)),
Max_Chunk_Len * 8);
Remaining := Remaining - Max_Chunk_Len;
Offset := Offset + Max_Chunk_Len;
end loop;
if Remaining > 0 then
pragma Assert_And_Cut (Remaining < Natural'Last / 8
and Offset + Remaining = Message'Length
and State_Of (Ctx) = Updating);
Update (Ctx,
Message (Message'First + Offset .. Message'Last),
Remaining * 8);
pragma Assert (State_Of (Ctx) = Updating);
end if;
end Update;
-------------
-- Final --
-------------
procedure Final (Ctx : in out Context;
Digest : out Digest_Type)
is
Empty : constant Keccak.Types.Byte_Array (0 .. -1) := (others => 0);
begin
if State_Of (Ctx) = Updating then
-- Need to add the suffix bits
Hash_Sponge.Absorb_With_Suffix (Ctx.Sponge_Ctx,
Empty,
0,
Suffix,
Suffix_Size);
end if;
Hash_Sponge.Squeeze (Ctx.Sponge_Ctx, Digest);
end Final;
end Keccak.Generic_Hash;
|
drivers/drivers-rfm69.ads | ekoeppen/STM32_Generic_Ada_Drivers | 1 | 12927 | <filename>drivers/drivers-rfm69.ads
with STM32_SVD; use STM32_SVD;
with Drivers.Text_IO;
with HAL;
generic
with package Chip_Select is new HAL.Pin (<>);
with package IRQ is new HAL.Pin (<>);
with package SPI is new HAL.SPI (<>);
AES_Enabled : Boolean := False;
Frequency : Positive;
TX_PA_Boost : Boolean := False;
Channel : Byte := 0;
package Drivers.RFM69 is
subtype Address_Type is Byte;
type Sync_Word_Type is array (Byte range <>) of Byte
with Dynamic_Predicate => Sync_Word_Type'Length <= 8;
type Packet_Type is array (Byte range <>) of Byte;
type AES_Key_Type is array (Byte range 1 .. 16) of Byte;
type Raw_Register_Array is array (0 .. 16#4D#) of Byte;
procedure Init;
procedure Set_Sync_Word (Sync_Word : Sync_Word_Type);
procedure Get_Sync_Word (Sync_Word : out Sync_Word_Type);
procedure Set_Frequency (Frequency : Positive);
procedure Set_Bitrate (Bitrate : Positive);
procedure Set_Broadcast_Address (Address : Address_Type);
procedure Set_RX_Address (Address : Address_Type);
procedure Set_TX_Address (Address : Address_Type);
procedure TX_Mode;
procedure RX_Mode;
procedure TX (Packet: Packet_Type);
procedure TX (Packet: Packet_Type; Length: Byte);
function RX_Available return Boolean;
function RX_Available_Reg return Boolean;
function TX_Complete return Boolean;
function Wait_For_RX return Boolean;
procedure RX (Packet : out Packet_Type; Length : out Byte);
procedure Clear_IRQ;
procedure Power_Down;
procedure Cancel;
procedure Read_Registers (Registers : out Raw_Register_Array);
generic
with procedure Put_Line (Line: in string);
procedure Print_Registers;
end Drivers.RFM69;
|
src/tk/tk-bind.adb | thindil/tashy2 | 2 | 12045 | <gh_stars>1-10
-- Copyright (c) 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 Ada.Characters.Handling; use Ada.Characters.Handling;
with Ada.Strings;
with Ada.Strings.Fixed;
with Ada.Strings.Unbounded;
package body Tk.Bind is
function Modifier_Type_Image(Modifier: Modifiers_Type) return String is
Image: String := To_Lower(Item => Modifiers_Type'Image(Modifier));
begin
Image(1) := To_Upper(Item => Image(1));
if Image(Image'Last - 1) = '_' then
Image(Image'Last - 1) := '-';
end if;
return Image;
end Modifier_Type_Image;
function Key_Syms_Type_Image(Key: Key_Syms) return String is
use Ada.Strings;
use Ada.Strings.Fixed;
Image: String := To_Lower(Item => Key_Syms'Image(Key));
Start_Index: Positive := 1;
begin
Image(1) := To_Upper(Item => Image(1));
if Image(1 .. 3) = "Key" then
Image(4) := '-';
elsif Image(1 .. 3) = "Shi" then
Image(6 .. 7) := "-K";
Image(10 .. 11) := '-' & To_Upper(Item => Image(11));
end if;
case Key is
when SHIFT_KEY_AE =>
return "Key-AE";
when SHIFT_KEY_ENG =>
return "Key-ENG";
when SHIFT_KEY_KANA_WO =>
return "Key-kana_WO";
when SHIFT_KEY_KANA_A .. SHIFT_KEY_KANA_N =>
Start_Index :=
Index(Source => Image, Pattern => "_", Going => Backward);
return
"Key-kana" & To_Upper(Item => Image(Start_Index .. Image'Last));
when KEY_ARABIC_COMMA .. KEY_SERBIAN_DZE |
KEY_CYRILLIC_YU .. KEY_CYRILLIC_HARDSIGN |
KEY_GREEK_ALPHAACCENT .. KEY_GREEK_OMEGAACCENT |
KEY_BACKSPACE .. KEY_PAUSE | KEY_ESCAPE | KEY_KANJI .. KEY_BEGIN =>
Image(5) := To_Upper(Item => Image(5));
when SHIFT_KEY_SERBIAN_DJE .. SHIFT_KEY_SERBIAN_DZE |
SHIFT_KEY_CYRILLIC_YU .. SHIFT_KEY_CYRILLIC_HARDSIGN |
SHIFT_KEY_GREEK_ALPHA .. SHIFT_KEY_GREEK_OMEGA =>
Image(11) := To_Upper(Item => Image(11));
Start_Index :=
Index(Source => Image, Pattern => "_", Going => Backward);
Image(Start_Index .. Image'Last) :=
To_Upper(Item => Image(Start_Index .. Image'Last));
when SHIFT_KEY_GREEK_ALPHAACCENT =>
return "Key-Greek_ALPHAaccent";
when SHIFT_KEY_GREEK_EPSILONACCENT =>
return "Key-Greek_EPSILONaccent";
when SHIFT_KEY_GREEK_ETAACCENT =>
return "Key-Greek_ETAaccent";
when SHIFT_KEY_GREEK_IOTAACCENT =>
return "Key-Greek_IOTAAaccent";
when SHIFT_KEY_GREEK_IOTADIAERESIS =>
return "Key-Greek_IOTAdiaeresis";
when SHIFT_KEY_GREEK_IOTAACCENTDIAERESIS =>
return "Key-Greek_IOTAaccentdiaeresis";
when SHIFT_KEY_GREEK_OMICRONACCENT =>
return "Key-Greek_OMICRONaccent";
when SHIFT_KEY_GREEK_UPSILONACCENT =>
return "Key-Greek_UPSILONAaccent";
when SHIFT_KEY_GREEK_UPSILONDIERESIS =>
return "Key-Greek_UPSILONdieresis";
when SHIFT_KEY_GREEK_UPSILONACCENTDIERESIS =>
return "Key-Greek_UPSILONaccentdieresis";
when SHIFT_KEY_GREEK_OMEGAACCENT =>
return "Key-Greek_OMEGAaccent";
when KEY_SCROLL_LOCK | KEY_SYS_REQ | KEY_MULTI_KEY =>
Start_Index :=
Index(Source => Image, Pattern => "_", Going => Backward);
Image(5) := To_Upper(Item => Image(5));
Image(Start_Index + 1) := To_Upper(Item => Image(Start_Index + 1));
when others =>
null;
end case;
if Image(1 .. 3) = "Shi" then
return Image(7 .. Image'Last);
end if;
return Image;
end Key_Syms_Type_Image;
procedure Tk_Bind
(Window: Tk_Widget; Sequence: Modifiers_Type; Script: Tcl_String;
Append: Boolean := False) is
begin
Tcl_Eval
(Tcl_Script =>
"bind " & Tk_Path_Name(Widgt => Window) & " <" &
Modifier_Type_Image(Modifier => Sequence) & "> " &
(if Append then "+" else "") & To_String(Source => Script),
Interpreter => Tk_Interp(Widgt => Window));
end Tk_Bind;
procedure Tk_Bind
(Window: Tk_Widget; Sequence: Modifiers_Array; Script: Tcl_String;
Append: Boolean := False) is
use Ada.Strings.Unbounded;
Modifier: Unbounded_String := Null_Unbounded_String;
begin
Array_To_String_Loop :
for I in Sequence'Range loop
Modifier := Modifier & Modifier_Type_Image(Modifier => Sequence(I));
if I < Sequence'Last then
Modifier := Modifier & "-";
end if;
end loop Array_To_String_Loop;
Tcl_Eval
(Tcl_Script =>
"bind " & Tk_Path_Name(Widgt => Window) & " <" &
To_String(Source => Modifier) & "> " &
(if Append then "+" else "") & To_String(Source => Script),
Interpreter => Tk_Interp(Widgt => Window));
end Tk_Bind;
end Tk.Bind;
|
source/s-stpoov.adb | ytomino/drake | 33 | 25004 | with System.Runtime_Context;
package body System.Storage_Pools.Overlaps is
pragma Suppress (All_Checks);
-- implementation
procedure Set_Address (Storage_Address : Address) is
TLS : constant not null Runtime_Context.Task_Local_Storage_Access :=
Runtime_Context.Get_Task_Local_Storage;
begin
TLS.Overlaid_Allocation := Storage_Address;
end Set_Address;
overriding procedure Allocate (
Pool : in out Overlay_Pool;
Storage_Address : out Address;
Size_In_Storage_Elements : Storage_Elements.Storage_Count;
Alignment : Storage_Elements.Storage_Count)
is
pragma Unreferenced (Pool);
pragma Unreferenced (Size_In_Storage_Elements);
pragma Unreferenced (Alignment);
TLS : constant not null Runtime_Context.Task_Local_Storage_Access :=
Runtime_Context.Get_Task_Local_Storage;
begin
Storage_Address := TLS.Overlaid_Allocation;
TLS.Overlaid_Allocation := Null_Address;
end Allocate;
overriding procedure Deallocate (
Pool : in out Overlay_Pool;
Storage_Address : Address;
Size_In_Storage_Elements : Storage_Elements.Storage_Count;
Alignment : Storage_Elements.Storage_Count)
is
pragma Unreferenced (Pool);
pragma Unreferenced (Size_In_Storage_Elements);
pragma Unreferenced (Alignment);
TLS : constant not null Runtime_Context.Task_Local_Storage_Access :=
Runtime_Context.Get_Task_Local_Storage;
begin
pragma Assert (Storage_Address = TLS.Overlaid_Allocation);
TLS.Overlaid_Allocation := Null_Address;
end Deallocate;
end System.Storage_Pools.Overlaps;
|
source/nodes/program-nodes-attribute_definition_clauses.ads | reznikmm/gela | 0 | 27434 | <gh_stars>0
-- SPDX-FileCopyrightText: 2019 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
with Program.Lexical_Elements;
with Program.Elements.Expressions;
with Program.Elements.Attribute_Definition_Clauses;
with Program.Element_Visitors;
package Program.Nodes.Attribute_Definition_Clauses is
pragma Preelaborate;
type Attribute_Definition_Clause is
new Program.Nodes.Node
and Program.Elements.Attribute_Definition_Clauses
.Attribute_Definition_Clause
and Program.Elements.Attribute_Definition_Clauses
.Attribute_Definition_Clause_Text
with private;
function Create
(For_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Expressions.Expression_Access;
Use_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Expression : not null Program.Elements.Expressions.Expression_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return Attribute_Definition_Clause;
type Implicit_Attribute_Definition_Clause is
new Program.Nodes.Node
and Program.Elements.Attribute_Definition_Clauses
.Attribute_Definition_Clause
with private;
function Create
(Name : not null Program.Elements.Expressions
.Expression_Access;
Expression : not null Program.Elements.Expressions
.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return Implicit_Attribute_Definition_Clause
with Pre =>
Is_Part_Of_Implicit or Is_Part_Of_Inherited or Is_Part_Of_Instance;
private
type Base_Attribute_Definition_Clause is
abstract new Program.Nodes.Node
and Program.Elements.Attribute_Definition_Clauses
.Attribute_Definition_Clause
with record
Name : not null Program.Elements.Expressions.Expression_Access;
Expression : not null Program.Elements.Expressions.Expression_Access;
end record;
procedure Initialize (Self : in out Base_Attribute_Definition_Clause'Class);
overriding procedure Visit
(Self : not null access Base_Attribute_Definition_Clause;
Visitor : in out Program.Element_Visitors.Element_Visitor'Class);
overriding function Name
(Self : Base_Attribute_Definition_Clause)
return not null Program.Elements.Expressions.Expression_Access;
overriding function Expression
(Self : Base_Attribute_Definition_Clause)
return not null Program.Elements.Expressions.Expression_Access;
overriding function Is_Attribute_Definition_Clause
(Self : Base_Attribute_Definition_Clause)
return Boolean;
overriding function Is_Representation_Clause
(Self : Base_Attribute_Definition_Clause)
return Boolean;
overriding function Is_Clause
(Self : Base_Attribute_Definition_Clause)
return Boolean;
type Attribute_Definition_Clause is
new Base_Attribute_Definition_Clause
and Program.Elements.Attribute_Definition_Clauses
.Attribute_Definition_Clause_Text
with record
For_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Use_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
end record;
overriding function To_Attribute_Definition_Clause_Text
(Self : in out Attribute_Definition_Clause)
return Program.Elements.Attribute_Definition_Clauses
.Attribute_Definition_Clause_Text_Access;
overriding function For_Token
(Self : Attribute_Definition_Clause)
return not null Program.Lexical_Elements.Lexical_Element_Access;
overriding function Use_Token
(Self : Attribute_Definition_Clause)
return not null Program.Lexical_Elements.Lexical_Element_Access;
overriding function Semicolon_Token
(Self : Attribute_Definition_Clause)
return not null Program.Lexical_Elements.Lexical_Element_Access;
type Implicit_Attribute_Definition_Clause is
new Base_Attribute_Definition_Clause
with record
Is_Part_Of_Implicit : Boolean;
Is_Part_Of_Inherited : Boolean;
Is_Part_Of_Instance : Boolean;
end record;
overriding function To_Attribute_Definition_Clause_Text
(Self : in out Implicit_Attribute_Definition_Clause)
return Program.Elements.Attribute_Definition_Clauses
.Attribute_Definition_Clause_Text_Access;
overriding function Is_Part_Of_Implicit
(Self : Implicit_Attribute_Definition_Clause)
return Boolean;
overriding function Is_Part_Of_Inherited
(Self : Implicit_Attribute_Definition_Clause)
return Boolean;
overriding function Is_Part_Of_Instance
(Self : Implicit_Attribute_Definition_Clause)
return Boolean;
end Program.Nodes.Attribute_Definition_Clauses;
|
Transynther/x86/_processed/AVXALIGN/_st_zr_sm_/i3-7100_9_0x84_notsx.log_21829_2025.asm | ljhsiun2/medusa | 9 | 100870 | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r14
push %r8
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x183e8, %rsi
lea addresses_WT_ht+0x1a6e8, %rdi
clflush (%rsi)
nop
nop
add %r14, %r14
mov $103, %rcx
rep movsw
nop
nop
cmp %r14, %r14
lea addresses_WC_ht+0xee8, %r11
add $60828, %rdi
vmovups (%r11), %ymm6
vextracti128 $0, %ymm6, %xmm6
vpextrq $1, %xmm6, %r14
nop
nop
nop
nop
nop
add $25480, %rsi
lea addresses_A_ht+0x13efc, %rsi
lea addresses_normal_ht+0x1a1e8, %rdi
nop
nop
nop
add %rbx, %rbx
mov $27, %rcx
rep movsq
nop
nop
nop
and $5284, %rsi
lea addresses_WT_ht+0x94e8, %rdi
nop
xor %r8, %r8
mov $0x6162636465666768, %rsi
movq %rsi, %xmm0
movups %xmm0, (%rdi)
nop
nop
nop
nop
xor $65064, %rbx
lea addresses_A_ht+0x1aa68, %rbx
nop
nop
nop
cmp %r8, %r8
mov (%rbx), %rsi
nop
nop
inc %rbx
lea addresses_WT_ht+0x1c674, %r14
nop
nop
xor %r8, %r8
movl $0x61626364, (%r14)
nop
nop
dec %r11
lea addresses_D_ht+0xc4fc, %rsi
lea addresses_WC_ht+0x42e8, %rdi
nop
nop
cmp %rdx, %rdx
mov $66, %rcx
rep movsw
nop
nop
sub %r11, %r11
lea addresses_D_ht+0xf028, %r8
nop
cmp $62855, %rsi
vmovups (%r8), %ymm1
vextracti128 $0, %ymm1, %xmm1
vpextrq $0, %xmm1, %rcx
nop
xor %rbx, %rbx
lea addresses_A_ht+0x9fe8, %rsi
lea addresses_WC_ht+0x53a8, %rdi
nop
nop
nop
nop
nop
sub $13518, %r11
mov $33, %rcx
rep movsb
dec %r8
lea addresses_D_ht+0x15a38, %rsi
lea addresses_WC_ht+0x19be8, %rdi
xor $22396, %r14
mov $10, %rcx
rep movsq
nop
nop
nop
inc %rsi
lea addresses_D_ht+0xc3e8, %r11
xor %rdi, %rdi
vmovups (%r11), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $1, %xmm4, %rcx
nop
nop
nop
nop
sub $56795, %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r8
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r14
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
// Store
lea addresses_WT+0x866c, %rdi
nop
nop
nop
nop
nop
and $16554, %rax
mov $0x5152535455565758, %rsi
movq %rsi, (%rdi)
add $21036, %rdi
// REPMOV
lea addresses_A+0x15a46, %rsi
lea addresses_WC+0x139e8, %rdi
sub %rbp, %rbp
mov $97, %rcx
rep movsq
nop
nop
nop
nop
cmp %rsi, %rsi
// Store
lea addresses_UC+0x147b0, %rbp
nop
nop
nop
nop
and %rcx, %rcx
mov $0x5152535455565758, %r10
movq %r10, %xmm3
movaps %xmm3, (%rbp)
nop
nop
and %rcx, %rcx
// Store
lea addresses_RW+0xf686, %rcx
nop
add %rsi, %rsi
mov $0x5152535455565758, %rbp
movq %rbp, %xmm0
vmovups %ymm0, (%rcx)
nop
nop
nop
nop
and %r14, %r14
// Store
mov $0x2cc52900000007e8, %r14
nop
nop
sub $4059, %rbp
movw $0x5152, (%r14)
xor %rcx, %rcx
// Store
lea addresses_WC+0xbe8, %rdi
clflush (%rdi)
nop
xor $39487, %rcx
mov $0x5152535455565758, %rbp
movq %rbp, %xmm5
movups %xmm5, (%rdi)
nop
nop
nop
nop
xor %rbp, %rbp
// Faulty Load
lea addresses_WC+0xbe8, %r12
nop
nop
add $56089, %rdi
movaps (%r12), %xmm6
vpextrq $0, %xmm6, %rsi
lea oracles, %rax
and $0xff, %rsi
shlq $12, %rsi
mov (%rax,%rsi,1), %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r14
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_WC', 'same': False, 'size': 2, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WT', 'same': False, 'size': 8, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_A', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_WC', 'congruent': 8, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_UC', 'same': False, 'size': 16, 'congruent': 3, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_RW', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_NC', 'same': False, 'size': 2, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_WC', 'same': True, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_WC', 'same': True, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_A_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 32, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 16, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_A_ht', 'same': False, 'size': 8, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 4, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_D_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_D_ht', 'same': False, 'size': 32, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': True}, 'OP': 'REPM'}
{'src': {'type': 'addresses_D_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_D_ht', 'same': False, 'size': 32, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'00': 778, '58': 20978, '35': 73}
58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 35 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 35 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 35 58 58 58 58 58 58 58 58 58 58 58 00 00 58 58 58 58 58 58 58 00 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 00 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
|
source/oasis/program-elements-procedure_declarations.ads | optikos/oasis | 0 | 11948 | <gh_stars>0
-- Copyright (c) 2019 <NAME> <<EMAIL>>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Program.Elements.Declarations;
with Program.Lexical_Elements;
with Program.Elements.Defining_Names;
with Program.Elements.Parameter_Specifications;
with Program.Elements.Aspect_Specifications;
package Program.Elements.Procedure_Declarations is
pragma Pure (Program.Elements.Procedure_Declarations);
type Procedure_Declaration is
limited interface and Program.Elements.Declarations.Declaration;
type Procedure_Declaration_Access is access all Procedure_Declaration'Class
with Storage_Size => 0;
not overriding function Name
(Self : Procedure_Declaration)
return not null Program.Elements.Defining_Names.Defining_Name_Access
is abstract;
not overriding function Parameters
(Self : Procedure_Declaration)
return Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access is abstract;
not overriding function Aspects
(Self : Procedure_Declaration)
return Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access is abstract;
not overriding function Has_Not
(Self : Procedure_Declaration)
return Boolean is abstract;
not overriding function Has_Overriding
(Self : Procedure_Declaration)
return Boolean is abstract;
not overriding function Has_Abstract
(Self : Procedure_Declaration)
return Boolean is abstract;
type Procedure_Declaration_Text is limited interface;
type Procedure_Declaration_Text_Access is
access all Procedure_Declaration_Text'Class with Storage_Size => 0;
not overriding function To_Procedure_Declaration_Text
(Self : aliased in out Procedure_Declaration)
return Procedure_Declaration_Text_Access is abstract;
not overriding function Not_Token
(Self : Procedure_Declaration_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Overriding_Token
(Self : Procedure_Declaration_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Procedure_Token
(Self : Procedure_Declaration_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function Left_Bracket_Token
(Self : Procedure_Declaration_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Right_Bracket_Token
(Self : Procedure_Declaration_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Is_Token
(Self : Procedure_Declaration_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Abstract_Token
(Self : Procedure_Declaration_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function With_Token
(Self : Procedure_Declaration_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Semicolon_Token
(Self : Procedure_Declaration_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
end Program.Elements.Procedure_Declarations;
|
programs/oeis/007/A007696.asm | neoneye/loda | 22 | 96535 | ; A007696: Quartic (or 4-fold) factorial numbers: a(n) = Product_{k = 0..n-1} (4*k + 1).
; 1,1,5,45,585,9945,208845,5221125,151412625,4996616625,184874815125,7579867420125,341094033905625,16713607661375625,885821206052908125,50491808745015763125,3080000333445961550625,200200021673987500790625,13813801495505137554553125,1008407509171875041482378125,77647378206234378194143115625,6289437634704984633725592365625,534602198949923693866675351078125,47579595706543208754134106245953125
sub $0,1
mov $1,1
mov $2,1
lpb $0
sub $0,1
add $2,4
mul $1,$2
lpe
mov $0,$1
|
source/numerics/machine-pc-freebsd/s-llelfu.ads | ytomino/drake | 33 | 2345 | <reponame>ytomino/drake<filename>source/numerics/machine-pc-freebsd/s-llelfu.ads<gh_stars>10-100
pragma License (Unrestricted);
-- implementation unit specialized for FreeBSD
package System.Long_Long_Elementary_Functions is
pragma Pure;
-- Long_Float
function log (x : Long_Float) return Long_Float
with Import, Convention => Intrinsic, External_Name => "__builtin_log";
function Fast_Log (X : Long_Float) return Long_Float
renames log;
function exp (x : Long_Float) return Long_Float
with Import, Convention => Intrinsic, External_Name => "__builtin_exp";
function Fast_Exp (X : Long_Float) return Long_Float
renames exp;
function pow (x, y : Long_Float) return Long_Float
with Import, Convention => Intrinsic, External_Name => "__builtin_pow";
function Fast_Pow (Left, Right : Long_Float) return Long_Float
renames pow;
function sinh (x : Long_Float) return Long_Float
with Import, Convention => Intrinsic, External_Name => "__builtin_sinh";
function Fast_Sinh (X : Long_Float) return Long_Float
renames sinh;
function cosh (x : Long_Float) return Long_Float
with Import, Convention => Intrinsic, External_Name => "__builtin_cosh";
function Fast_Cosh (X : Long_Float) return Long_Float
renames cosh;
function tanh (x : Long_Float) return Long_Float
with Import, Convention => Intrinsic, External_Name => "__builtin_tanh";
function Fast_Tanh (X : Long_Float) return Long_Float
renames tanh;
function asinh (x : Long_Float) return Long_Float
with Import, Convention => Intrinsic, External_Name => "__builtin_asinh";
function Fast_Arcsinh (X : Long_Float) return Long_Float
renames asinh;
function acosh (x : Long_Float) return Long_Float
with Import, Convention => Intrinsic, External_Name => "__builtin_acosh";
function Fast_Arccosh (X : Long_Float) return Long_Float
renames acosh;
function atanh (x : Long_Float) return Long_Float
with Import, Convention => Intrinsic, External_Name => "__builtin_atanh";
function Fast_Arctanh (X : Long_Float) return Long_Float
renames atanh;
-- Long_Long_Float
function Fast_Log (X : Long_Long_Float) return Long_Long_Float;
pragma Inline (Fast_Log);
function Fast_Exp (X : Long_Long_Float) return Long_Long_Float;
pragma Inline (Fast_Exp);
function Fast_Pow (Left, Right : Long_Long_Float) return Long_Long_Float;
pragma Inline (Fast_Pow);
function sinl (x : Long_Long_Float) return Long_Long_Float
with Import, Convention => Intrinsic, External_Name => "__builtin_sinl";
function Fast_Sin (X : Long_Long_Float) return Long_Long_Float
renames sinl;
function cosl (x : Long_Long_Float) return Long_Long_Float
with Import, Convention => Intrinsic, External_Name => "__builtin_cosl";
function Fast_Cos (X : Long_Long_Float) return Long_Long_Float
renames cosl;
function atan2l (y, x : Long_Long_Float) return Long_Long_Float
with Import,
Convention => Intrinsic, External_Name => "__builtin_atan2l";
function Fast_Arctan (Y : Long_Long_Float; X : Long_Long_Float := 1.0)
return Long_Long_Float
renames atan2l;
function Fast_Sinh (X : Long_Long_Float) return Long_Long_Float;
pragma Inline (Fast_Sinh);
function Fast_Cosh (X : Long_Long_Float) return Long_Long_Float;
pragma Inline (Fast_Cosh);
function Fast_Tanh (X : Long_Long_Float) return Long_Long_Float;
pragma Inline (Fast_Tanh);
function Fast_Arcsinh (X : Long_Long_Float) return Long_Long_Float;
pragma Inline (Fast_Arcsinh);
function Fast_Arccosh (X : Long_Long_Float) return Long_Long_Float;
pragma Inline (Fast_Arccosh);
function Fast_Arctanh (X : Long_Long_Float) return Long_Long_Float;
pragma Inline (Fast_Arctanh);
end System.Long_Long_Elementary_Functions;
|
mac/doubleNoteLengths.applescript | jsphweid/.finale-macros | 2 | 987 | -- Halve Note Lengths
-- version 1.0 on 2015-07-09 in Freund's office
-- This took like 6-10 hours trying to figure out this stupid language...
-- I took the time to make helper files for my sanity. DAMN!
-- #firstRealApplescriptScript
-- load helper file
property Helpers : load script POSIX file "helpers.scpt"
-- set theFinale
tell application id "sevs"
try
set theFinale to name of first process whose name begins with "Finale"
on error number -1719
display dialog "Finale doesn't appear to be running."
return
end try
end tell
----------------ACTUAL SCRIPT----------------
tell Helpers
activate_window(theFinale)
menu_click({theFinale, "Utilities", "Change", "Note Durations…"})
win_wait_active("Change Note Durations", theFinale)
check_it("Include Tuplets", "Change Note Durations", theFinale)
check_it("Rebar Music", "Change Note Durations", theFinale)
basic_dropdown("200%", 1, 1, "Change Note Durations", theFinale)
click_button("OK", "Change Note Durations", theFinale)
end tell
--tell button "OK" to click
|
test/filters-cases/bug-577_clang.asm | OfekShilon/compiler-explorer | 4,668 | 179731 | .text
.file "example.cpp"
.globl _Z6squarei
.p2align 4, 0x90
.type _Z6squarei,@function
_Z6squarei: # @_Z6squarei
.Lfunc_begin0:
.file 1 "" "example.cpp"
.loc 1 2 0 # example.cpp:2:0
.cfi_startproc
# BB#0:
pushq %rbp
.Lcfi0:
.cfi_def_cfa_offset 16
.Lcfi1:
.cfi_offset %rbp, -16
movq %rsp, %rbp
.Lcfi2:
.cfi_def_cfa_register %rbp
movl %edi, -4(%rbp)
.Ltmp0:
.loc 1 3 5 prologue_end # example.cpp:3:5
#APP
label:
#NO_APP
.loc 1 4 12 # example.cpp:4:12
movl -4(%rbp), %edi
.loc 1 4 16 is_stmt 0 # example.cpp:4:16
imull -4(%rbp), %edi
.loc 1 4 5 # example.cpp:4:5
movl %edi, %eax
popq %rbp
retq
.Ltmp1:
.Lfunc_end0:
.size _Z6squarei, .Lfunc_end0-_Z6squarei
.cfi_endproc
.section .debug_str,"MS",@progbits,1
.Linfo_string0:
.asciz "clang version 4.0.0-1ubuntu1 (tags/RELEASE_400/rc1)" # string offset=0
.Linfo_string1:
.asciz "example.cpp" # string offset=52
.Linfo_string2:
.asciz "/home/partouf/compiler-explorer" # string offset=122
.Linfo_string3:
.asciz "_Z6squarei" # string offset=154
.Linfo_string4:
.asciz "square" # string offset=165
.Linfo_string5:
.asciz "int" # string offset=172
.Linfo_string6:
.asciz "num" # string offset=176
.section .debug_loc,"",@progbits
.section .debug_abbrev,"",@progbits
.Lsection_abbrev:
.byte 1 # Abbreviation Code
.byte 17 # DW_TAG_compile_unit
.byte 1 # DW_CHILDREN_yes
.byte 37 # DW_AT_producer
.byte 14 # DW_FORM_strp
.byte 19 # DW_AT_language
.byte 5 # DW_FORM_data2
.byte 3 # DW_AT_name
.byte 14 # DW_FORM_strp
.byte 16 # DW_AT_stmt_list
.byte 23 # DW_FORM_sec_offset
.byte 27 # DW_AT_comp_dir
.byte 14 # DW_FORM_strp
.byte 17 # DW_AT_low_pc
.byte 1 # DW_FORM_addr
.byte 18 # DW_AT_high_pc
.byte 6 # DW_FORM_data4
.byte 0 # EOM(1)
.byte 0 # EOM(2)
.byte 2 # Abbreviation Code
.byte 46 # DW_TAG_subprogram
.byte 1 # DW_CHILDREN_yes
.byte 17 # DW_AT_low_pc
.byte 1 # DW_FORM_addr
.byte 18 # DW_AT_high_pc
.byte 6 # DW_FORM_data4
.byte 64 # DW_AT_frame_base
.byte 24 # DW_FORM_exprloc
.byte 110 # DW_AT_linkage_name
.byte 14 # DW_FORM_strp
.byte 3 # DW_AT_name
.byte 14 # DW_FORM_strp
.byte 58 # DW_AT_decl_file
.byte 11 # DW_FORM_data1
.byte 59 # DW_AT_decl_line
.byte 11 # DW_FORM_data1
.byte 73 # DW_AT_type
.byte 19 # DW_FORM_ref4
.byte 63 # DW_AT_external
.byte 25 # DW_FORM_flag_present
.byte 0 # EOM(1)
.byte 0 # EOM(2)
.byte 3 # Abbreviation Code
.byte 5 # DW_TAG_formal_parameter
.byte 0 # DW_CHILDREN_no
.byte 2 # DW_AT_location
.byte 24 # DW_FORM_exprloc
.byte 3 # DW_AT_name
.byte 14 # DW_FORM_strp
.byte 58 # DW_AT_decl_file
.byte 11 # DW_FORM_data1
.byte 59 # DW_AT_decl_line
.byte 11 # DW_FORM_data1
.byte 73 # DW_AT_type
.byte 19 # DW_FORM_ref4
.byte 0 # EOM(1)
.byte 0 # EOM(2)
.byte 4 # Abbreviation Code
.byte 36 # DW_TAG_base_type
.byte 0 # DW_CHILDREN_no
.byte 3 # DW_AT_name
.byte 14 # DW_FORM_strp
.byte 62 # DW_AT_encoding
.byte 11 # DW_FORM_data1
.byte 11 # DW_AT_byte_size
.byte 11 # DW_FORM_data1
.byte 0 # EOM(1)
.byte 0 # EOM(2)
.byte 0 # EOM(3)
.section .debug_info,"",@progbits
.Lsection_info:
.Lcu_begin0:
.long 90 # Length of Unit
.short 4 # DWARF version number
.long .Lsection_abbrev # Offset Into Abbrev. Section
.byte 8 # Address Size (in bytes)
.byte 1 # Abbrev [1] 0xb:0x53 DW_TAG_compile_unit
.long .Linfo_string0 # DW_AT_producer
.short 4 # DW_AT_language
.long .Linfo_string1 # DW_AT_name
.long .Lline_table_start0 # DW_AT_stmt_list
.long .Linfo_string2 # DW_AT_comp_dir
.quad .Lfunc_begin0 # DW_AT_low_pc
.long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
.byte 2 # Abbrev [2] 0x2a:0x2c DW_TAG_subprogram
.quad .Lfunc_begin0 # DW_AT_low_pc
.long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
.byte 1 # DW_AT_frame_base
.byte 86
.long .Linfo_string3 # DW_AT_linkage_name
.long .Linfo_string4 # DW_AT_name
.byte 1 # DW_AT_decl_file
.byte 2 # DW_AT_decl_line
.long 86 # DW_AT_type
# DW_AT_external
.byte 3 # Abbrev [3] 0x47:0xe DW_TAG_formal_parameter
.byte 2 # DW_AT_location
.byte 145
.byte 124
.long .Linfo_string6 # DW_AT_name
.byte 1 # DW_AT_decl_file
.byte 2 # DW_AT_decl_line
.long 86 # DW_AT_type
.byte 0 # End Of Children Mark
.byte 4 # Abbrev [4] 0x56:0x7 DW_TAG_base_type
.long .Linfo_string5 # DW_AT_name
.byte 5 # DW_AT_encoding
.byte 4 # DW_AT_byte_size
.byte 0 # End Of Children Mark
.section .debug_ranges,"",@progbits
.Ldebug_range:
.section .debug_macinfo,"",@progbits
.Ldebug_macinfo:
.Lcu_macro_begin0:
.byte 0 # End Of Macro List Mark
.section .debug_pubnames,"",@progbits
.long .LpubNames_end0-.LpubNames_begin0 # Length of Public Names Info
.LpubNames_begin0:
.short 2 # DWARF Version
.long .Lcu_begin0 # Offset of Compilation Unit Info
.long 94 # Compilation Unit Length
.long 42 # DIE offset
.asciz "square" # External Name
.long 0 # End Mark
.LpubNames_end0:
.section .debug_pubtypes,"",@progbits
.long .LpubTypes_end0-.LpubTypes_begin0 # Length of Public Types Info
.LpubTypes_begin0:
.short 2 # DWARF Version
.long .Lcu_begin0 # Offset of Compilation Unit Info
.long 94 # Compilation Unit Length
.long 86 # DIE offset
.asciz "int" # External Name
.long 0 # End Mark
.LpubTypes_end0:
.ident "clang version 4.0.0-1ubuntu1 (tags/RELEASE_400/rc1)"
.section ".note.GNU-stack","",@progbits
.section .debug_line,"",@progbits
.Lline_table_start0: |
gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/c6/c64106c.ada | best08618/asylo | 7 | 22042 | <gh_stars>1-10
-- C64106C.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- CHECK THAT ASSIGNMENTS TO FORMAL PARAMETERS OF UNCONSTRAINED
-- RECORD, PRIVATE, AND LIMITED PRIVATE TYPES WITH DEFAULT
-- CONSTRAINTS RAISE CONSTRAINT_ERROR IF THE ACTUAL PARAMETER IS
-- CONSTRAINED AND THE CONSTRAINT VALUES OF THE OBJECT BEING
-- ASSIGNED TO DO NOT SATISFY THOSE OF THE ACTUAL PARAMETER.
-- SUBTESTS ARE:
-- (A) CONSTRAINED ACTUAL PARAMETERS OF RECORD TYPE.
-- (B) CONSTRAINED ACTUAL PARAMETERS OF PRIVATE TYPE.
-- (C) CONSTRAINED ACTUAL PARAMETERS OF LIMITED PRIVATE TYPE.
-- DAS 1/16/81
-- VKG 1/7/83
-- CPP 8/9/84
WITH REPORT;
PROCEDURE C64106C IS
USE REPORT;
BEGIN
TEST ("C64106C", "CHECK ASSIGNMENTS TO FORMAL PARAMETERS OF " &
"UNCONSTRAINED TYPES (WITH DEFAULTS)");
--------------------------------------------------
DECLARE -- (A)
PACKAGE PKG IS
SUBTYPE INTRANGE IS INTEGER RANGE 0..31;
TYPE RECTYPE (CONSTRAINT : INTRANGE := 15) IS
RECORD
INTFLD : INTRANGE;
STRFLD : STRING(1..CONSTRAINT);
END RECORD;
REC91,REC92,REC93 : RECTYPE(9);
REC_OOPS : RECTYPE(4);
PROCEDURE P (REC1 : IN RECTYPE; REC2 : IN OUT RECTYPE;
REC3 : OUT RECTYPE);
END PKG;
PACKAGE BODY PKG IS
PROCEDURE P (REC1 : IN RECTYPE; REC2 : IN OUT RECTYPE;
REC3 : OUT RECTYPE) IS
PROCEDURE P1 (REC11 : IN RECTYPE;
REC12 : IN OUT RECTYPE;
REC13 : OUT RECTYPE) IS
BEGIN
IF (NOT REC11'CONSTRAINED) OR
(REC11.CONSTRAINT /= IDENT_INT(9)) THEN
FAILED ("CONSTRAINT ON RECORD " &
"TYPE IN PARAMETER " &
"NOT RECOGNIZED");
END IF;
BEGIN -- ASSIGNMENT TO IN OUT PARAMETER
REC12 := REC_OOPS;
FAILED ("CONSTRAINT ERROR NOT RAISED - " &
"A.1");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED - " &
"A.1");
END;
BEGIN -- ASSIGNMENT TO OUT PARAMETER
REC13 := REC_OOPS;
FAILED ("CONSTRAINT_ERROR NOT RAISED - " &
"A.2");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED - " &
"A.2");
END;
END P1;
BEGIN
P1 (REC1, REC2, REC3);
END P;
BEGIN
REC91 := (9, 9, "123456789");
REC92 := REC91;
REC93 := REC91;
REC_OOPS := (4, 4, "OOPS");
END PKG;
BEGIN -- (A)
PKG.P (PKG.REC91, PKG.REC92, PKG.REC93);
END; -- (A)
--------------------------------------------------
DECLARE -- (B)
PACKAGE PKG IS
SUBTYPE INTRANGE IS INTEGER RANGE 0..31;
TYPE RECTYPE (CONSTRAINT : INTRANGE := 15) IS PRIVATE;
PROCEDURE P (REC1 : IN RECTYPE; REC2 : IN OUT RECTYPE;
REC3 : OUT RECTYPE);
PRIVATE
TYPE RECTYPE (CONSTRAINT : INTRANGE := 15) IS
RECORD
INTFLD : INTRANGE;
STRFLD : STRING(1..CONSTRAINT);
END RECORD;
END PKG;
REC91, REC92, REC93 : PKG.RECTYPE(9);
REC_OOPS : PKG.RECTYPE(4);
PACKAGE BODY PKG IS
PROCEDURE P (REC1 : IN RECTYPE; REC2 : IN OUT RECTYPE;
REC3 : OUT RECTYPE) IS
PROCEDURE P1 (REC11 : IN RECTYPE;
REC12 : IN OUT RECTYPE;
REC13 : OUT RECTYPE) IS
BEGIN
IF (NOT REC11'CONSTRAINED) OR
(REC11.CONSTRAINT /= IDENT_INT(9)) THEN
FAILED ("CONSTRAINT ON PRIVATE " &
"TYPE IN PARAMETER " &
"NOT RECOGNIZED");
END IF;
BEGIN -- ASSIGNMENT TO IN OUT PARAMETER
REC12 := REC_OOPS;
FAILED ("CONSTRAINT ERROR NOT RAISED - " &
"B.1");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED - " &
"B.1");
END;
BEGIN -- ASSIGNMENT TO OUT PARAMETER
REC13 := REC_OOPS;
FAILED ("CONSTRAINT_ERROR NOT RAISED - " &
"B.2");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED - " &
"B.2");
END;
END P1;
BEGIN
P1 (REC1, REC2, REC3);
END P;
BEGIN
REC91 := (9, 9, "123456789");
REC92 := REC91;
REC93 := REC91;
REC_OOPS := (4, 4, "OOPS");
END PKG;
BEGIN -- (B)
PKG.P (REC91, REC92, REC93);
END; -- (B)
--------------------------------------------------
DECLARE -- (C)
PACKAGE PKG IS
SUBTYPE INTRANGE IS INTEGER RANGE 0..31;
TYPE RECTYPE (CONSTRAINT : INTRANGE := 15) IS
LIMITED PRIVATE;
PROCEDURE P (REC1 : IN RECTYPE; REC2 : IN OUT RECTYPE;
REC3 : OUT RECTYPE);
PRIVATE
TYPE RECTYPE (CONSTRAINT : INTRANGE := 15) IS
RECORD
INTFLD : INTRANGE;
STRFLD : STRING(1..CONSTRAINT);
END RECORD;
END PKG;
REC91,REC92,REC93 : PKG.RECTYPE(9);
REC_OOPS : PKG.RECTYPE(4);
PACKAGE BODY PKG IS
PROCEDURE P (REC1 : IN RECTYPE; REC2 : IN OUT RECTYPE;
REC3 : OUT RECTYPE) IS
PROCEDURE P1 (REC11 : IN RECTYPE;
REC12 : IN OUT RECTYPE;
REC13 : OUT RECTYPE) IS
BEGIN
IF (NOT REC11'CONSTRAINED) OR
(REC11.CONSTRAINT /= 9) THEN
FAILED ("CONSTRAINT ON LIMITED PRIVATE " &
"TYPE IN PARAMETER " &
"NOT RECOGNIZED");
END IF;
BEGIN -- ASSIGNMENT TO IN OUT PARAMETER
REC12 := REC_OOPS;
FAILED ("CONSTRAINT ERROR NOT RAISED - " &
"C.1");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED - " &
"C.1");
END;
BEGIN -- ASSIGNMENT TO OUT PARAMETER
REC13 := REC_OOPS;
FAILED ("CONSTRAINT_ERROR NOT RAISED - " &
"C.2");
EXCEPTION
WHEN CONSTRAINT_ERROR =>
NULL;
WHEN OTHERS =>
FAILED ("WRONG EXCEPTION RAISED - " &
"C.2");
END;
END P1;
BEGIN
P1 (REC1, REC2, REC3);
END P;
BEGIN
REC91 := (9, 9, "123456789");
REC92 := REC91;
REC93 := REC91;
REC_OOPS := (4, 4, "OOPS");
END PKG;
BEGIN -- (C)
PKG.P (REC91, REC92, REC93);
END; -- (C)
--------------------------------------------------
RESULT;
END C64106C;
|
src/sparknacl-stream.adb | yannickmoy/SPARKNaCl | 76 | 17907 | package body SPARKNaCl.Stream
with SPARK_Mode => On
is
pragma Warnings (GNATProve, Off, "pragma * ignored (not yet supported)");
--------------------------------------------------------
-- Local subprogram declarations
--------------------------------------------------------
procedure Salsa20_Xor_Local
(C : out Byte_Seq;
M : in Byte_Seq;
Xor_M : in Boolean; -- If True then xor M against Stream
-- If False then return Stream unmodified
N : in Salsa20_Nonce; -- Nonce
K : in Salsa20_Key) -- Key
with Global => null,
Pre => M'First = 0 and then
C'First = 0 and then
(if Xor_M then (C'Last = M'Last)) and then
(if not Xor_M then M'Last = 0);
--------------------------------------------------------
-- Local subprogram bodies
--------------------------------------------------------
procedure Salsa20_Xor_Local
(C : out Byte_Seq;
M : in Byte_Seq;
Xor_M : in Boolean; -- If True then xor M against Stream
-- If False then return Stream unmodified
N : in Salsa20_Nonce; -- Nonce
K : in Salsa20_Key) -- Key
is
Full_Block_Count : constant I32 := C'Last / 64;
subtype Offset_Range is I32 range 0 .. (Full_Block_Count * 64);
subtype Natural_64 is I64 range 0 .. I64'Last;
Offset : Offset_Range;
Final_Offset : I32;
Z : Bytes_16;
X : Bytes_64;
U : U32;
B : Natural_64;
begin
B := C'Length;
C := (others => 0);
if B = 0 then
return;
end if;
Offset := 0;
Z := (others => 0);
Z (0 .. 7) := Bytes_8 (N);
if B >= 64 then
loop
pragma Loop_Optimize (No_Unroll);
pragma Loop_Invariant
((B + I64 (Offset) = C'Length) and then
(I64 (Offset) <= (C'Length - B)) and then
((C'Length - B) <= I64 (C'Last) - 63));
Core.Salsa20 (X, Z, K, Sigma);
for I in Index_64 loop
pragma Loop_Optimize (No_Unroll);
pragma Loop_Invariant
((Offset + I) in C'Range and
(if Xor_M then (Offset + I) in M'Range));
C (Offset + I) :=
(if Xor_M then M (Offset + I) else 0) xor
X (I);
end loop;
U := 1;
for I in I32 range 8 .. 15 loop
pragma Loop_Optimize (No_Unroll);
U := U + U32 (Z (I));
Z (I) := Byte (U mod 256);
U := Shift_Right (U, 8);
end loop;
B := B - 64;
-- Exit here to prevent subsequent overflow of Offset + 64
-- on the final iteration
exit when B < 64;
Offset := Offset + 64;
end loop;
if B > 0 then
-- Final block is non-empty but incomplete. It starts
-- at Offset C'Length - B
Final_Offset := I32 (C'Length - B);
else
-- B = 0 so final block is empty, so nothing more to do.
-- Set Final_Offset here to avoid a data-flow error.
Final_Offset := 0;
end if;
else
-- Only a single, incomplete block to process, so it must
-- start at Offset 0
Final_Offset := 0;
end if;
if B > 0 then
Core.Salsa20 (X, Z, K, Sigma);
for I in I32 range 0 .. I32 (B - 1) loop
pragma Loop_Optimize (No_Unroll);
pragma Loop_Invariant
((Final_Offset + I) in C'Range and
(if Xor_M then (Final_Offset + I) in M'Range));
C (Final_Offset + I) :=
(if Xor_M then
M (Final_Offset + I) else 0) xor
X (I);
end loop;
end if;
pragma Warnings (GNATProve, Off, "statement has no effect");
Sanitize (X);
Sanitize (Z);
pragma Unreferenced (X, Z);
end Salsa20_Xor_Local;
--------------------------------------------------------
-- Exported subprogram bodies
--------------------------------------------------------
procedure Salsa20 (C : out Byte_Seq; -- Output stream
N : in Salsa20_Nonce; -- Nonce
K : in Salsa20_Key) -- Key
is
Null_M : Byte_Seq (0 .. 0);
begin
Null_M := (others => 0);
Salsa20_Xor_Local (C, Null_M, False, N, K);
end Salsa20;
procedure Salsa20_Xor (C : out Byte_Seq; -- Output stream
M : in Byte_Seq; -- Input message
N : in Salsa20_Nonce; -- Nonce
K : in Salsa20_Key) -- Key
is
begin
Salsa20_Xor_Local (C, M, True, N, K);
end Salsa20_Xor;
procedure HSalsa20 (C : out Byte_Seq; -- Output stream
N : in HSalsa20_Nonce; -- Nonce
K : in Salsa20_Key) -- Key
is
S : Bytes_32;
begin
Core.HSalsa20 (S, Bytes_16 (N (0 .. 15)), K, Sigma);
Salsa20 (C, Salsa20_Nonce (N (16 .. 23)), Core.Construct (S));
Sanitize (S);
pragma Unreferenced (S);
end HSalsa20;
procedure HSalsa20_Xor (C : out Byte_Seq; -- Output ciphertext
M : in Byte_Seq; -- Input message
N : in HSalsa20_Nonce; -- Nonce
K : in Salsa20_Key) -- Key
is
S : Bytes_32;
begin
Core.HSalsa20 (S, Bytes_16 (N (0 .. 15)), K, Sigma);
Salsa20_Xor_Local (C => C,
M => M,
Xor_M => True,
N => Salsa20_Nonce (N (16 .. 23)),
K => Core.Construct (S));
Sanitize (S);
pragma Unreferenced (S);
end HSalsa20_Xor;
end SPARKNaCl.Stream;
|
alloy4fun_models/trashltl/models/7/dBsGLeC8Wcb5NfYae.als | Kaixi26/org.alloytools.alloy | 0 | 3589 | open main
pred iddBsGLeC8Wcb5NfYae_prop8 {
eventually File.link in Trash
}
pred __repair { iddBsGLeC8Wcb5NfYae_prop8 }
check __repair { iddBsGLeC8Wcb5NfYae_prop8 <=> prop8o } |
stm32f1/stm32gd-usart.ads | ekoeppen/STM32_Generic_Ada_Drivers | 1 | 2745 | package STM32GD.USART is
pragma Preelaborate;
type USART_Instance is (USART_1, USART_2, USART_3);
end STM32GD.USART;
|
Ada/inc/Problem_30.ads | Tim-Tom/project-euler | 0 | 11378 | package Problem_30 is
procedure Solve;
end Problem_30;
|
test/main_si_units_test.adb | HeisenbugLtd/si_units | 6 | 19630 | --------------------------------------------------------------------------------
-- Copyright (C) 2020 by Heisenbug Ltd. (<EMAIL>)
--
-- This work is free. You can redistribute it and/or modify it under the
-- terms of the Do What The Fuck You Want To Public License, Version 2,
-- as published by Sam Hocevar. See the LICENSE file for more details.
--------------------------------------------------------------------------------
pragma License (Unrestricted);
with Ada.Command_Line;
with Ada.Text_IO;
with SI_Units.Binary.Scaling;
pragma Unreferenced (SI_Units.Binary.Scaling);
with SI_Units.Metric.Scaling;
with SI_Units.Names;
--------------------------------------------------------------------------------
-- SI_Units - Test run.
--------------------------------------------------------------------------------
procedure Main_SI_Units_Test is
type Scalar is delta 1.0 / 2 ** 32 range
-2.0 ** 31 .. 2.0 ** 31 - 1.0 / 2 ** 32;
type Modular is mod 2 ** 64;
function Modular_BI is new SI_Units.Binary.Image (Item => Modular,
Default_Aft => 3,
Unit => "Mod");
function Modular_MI is new SI_Units.Metric.Mod_Image (Item => Modular,
Default_Aft => 3,
Unit => "Mod");
function Fixed_MI is
new SI_Units.Metric.Fixed_Image (Item => Scalar,
Default_Aft => 6,
Unit => SI_Units.Names.Ampere);
function Float_MI is
new SI_Units.Metric.Float_Image (Item => Long_Float,
Default_Aft => 3,
Unit => SI_Units.Names.Volt);
function Scale_Float is
new SI_Units.Metric.Scaling.Float_Scale (Item => Long_Float);
package Test_Cases is
procedure Add (Passed : in Boolean;
Message : in String);
function Num_Total return Natural;
function Num_Passed return Natural;
end Test_Cases;
package body Test_Cases is
Num_Test_Cases : Natural := 0;
Num_Succeeded : Natural := 0;
procedure Add (Passed : in Boolean;
Message : in String) is
begin
Num_Test_Cases := Num_Test_Cases + 1;
if Passed then
Num_Succeeded := Num_Succeeded + 1;
else
Ada.Text_IO.Put_Line
(Item =>
"Test_Case" & Num_Test_Cases'Image & " failed: " & Message);
end if;
end Add;
function Num_Passed return Natural is (Num_Succeeded);
function Num_Total return Natural is (Num_Test_Cases);
end Test_Cases;
Micro_Sign : constant String :=
Character'Val (16#C2#) & Character'Val (16#B5#);
No_Break_Space : constant String :=
Character'Val (16#C2#) & Character'Val (16#A0#);
type String_Access is not null access String;
begin
Test_Cases.Add
(Passed => Modular_BI (-1) = "16.000" & No_Break_Space & "EiMod",
Message => "Modular_BI (-1)");
Test_Cases.Add
(Passed => Modular_MI (-1) = "18.447" & No_Break_Space & "EMod",
Message => "Modular_MI (-1)");
Test_Cases.Add
(Passed => Modular_BI (1023) = "1023.000" & No_Break_Space & "Mod",
Message => "Modular_BI (1023)");
Test_Cases.Add
(Passed => Modular_MI (1023) = "1.023" & No_Break_Space & "kMod",
Message => "Modular_MI (1023)");
Test_Cases.Add
(Passed => Modular_BI (1024) = "1.000" & No_Break_Space & "KiMod",
Message => "Modular_BI (1024)");
Test_Cases.Add
(Passed => Modular_MI (1024) = "1.024" & No_Break_Space & "kMod",
Message => "Modular_MI (1024)");
Test_Cases.Add
(Passed => Modular_BI (1025) = "1.001" & No_Break_Space & "KiMod",
Message => "Modular_BI (1025)");
Test_Cases.Add
(Passed => Modular_MI (1025) = "1.025" & No_Break_Space & "kMod",
Message => "Modular_MI (1025)");
Test_Cases.Add
(Passed =>
Fixed_MI (0.0) = "0.000000" & No_Break_Space & SI_Units.Names.Ampere,
Message => "Fixed_MI (0.0)");
Test_Cases.Add
(Passed =>
Fixed_MI (Scalar'Small) = "232.830644" & No_Break_Space & "p" &
SI_Units.Names.Ampere,
Message => "Fixed_MI (Scalar'Small)");
Test_Cases.Add
(Passed =>
Fixed_MI (Scalar'First) = "-2.147484" & No_Break_Space & "G" &
SI_Units.Names.Ampere,
Message => "Fixed_MI (Scalar'First)");
Test_Cases.Add
(Passed =>
Fixed_MI (Scalar'Last) = "2.147484" & No_Break_Space & "G" &
SI_Units.Names.Ampere,
Message => "Fixed_MI (Scalar'Last)");
declare
Normal_Suffix : constant String := No_Break_Space & SI_Units.Names.Ampere;
Kilo_Suffix : constant String :=
No_Break_Space & "k" & SI_Units.Names.Ampere;
type Loop_Iteration is range 1 .. 32;
type Expected_List is array (Loop_Iteration) of String_Access;
Median : constant Scalar := 1000.0;
Operand : Scalar := 1.0;
begin
declare
-- Known memory leak due to string creation. As this is a test program
-- only run once we don't care.
Expected_Results : constant Expected_List :=
(32 => new String'("999.000000" & Normal_Suffix),
31 => new String'("999.500000" & Normal_Suffix),
30 => new String'("999.750000" & Normal_Suffix),
29 => new String'("999.875000" & Normal_Suffix),
28 => new String'("999.937500" & Normal_Suffix),
27 => new String'("999.968750" & Normal_Suffix),
26 => new String'("999.984375" & Normal_Suffix),
25 => new String'("999.992188" & Normal_Suffix),
24 => new String'("999.996094" & Normal_Suffix),
23 => new String'("999.998047" & Normal_Suffix),
22 => new String'("999.999023" & Normal_Suffix),
21 => new String'("999.999512" & Normal_Suffix),
20 => new String'("999.999756" & Normal_Suffix),
19 => new String'("999.999878" & Normal_Suffix),
18 => new String'("999.999939" & Normal_Suffix),
17 => new String'("999.999969" & Normal_Suffix),
16 => new String'("999.999985" & Normal_Suffix),
15 => new String'("999.999992" & Normal_Suffix),
14 => new String'("999.999996" & Normal_Suffix),
13 => new String'("999.999998" & Normal_Suffix),
12 => new String'("999.999999" & Normal_Suffix),
1 .. 11 => new String'("1.000000" & Kilo_Suffix));
begin
for Exponent in reverse Loop_Iteration loop
Test_Cases.Add
(Passed =>
Fixed_MI (Median - Operand) = Expected_Results (Exponent).all,
Message => "Fixed_MI (Median - Operand)/" & Exponent'Image);
Operand := Operand / 2.0;
end loop;
end;
Test_Cases.Add
(Passed =>
Fixed_MI (Median) = "1.000000" & No_Break_Space & "k" &
SI_Units.Names.Ampere,
Message => "Fixed_MI (Median)");
declare
-- Known memory leak due to string creation. As this is a test program
-- only run once we don't care.
Expected_Results : constant Expected_List :=
(1 .. 22 => new String'("1.000000" & Kilo_Suffix),
23 => new String'("1.000001" & Kilo_Suffix),
24 => new String'("1.000002" & Kilo_Suffix),
25 => new String'("1.000004" & Kilo_Suffix),
26 => new String'("1.000008" & Kilo_Suffix),
27 => new String'("1.000016" & Kilo_Suffix),
28 => new String'("1.000031" & Kilo_Suffix),
29 => new String'("1.000062" & Kilo_Suffix),
30 => new String'("1.000125" & Kilo_Suffix),
31 => new String'("1.000250" & Kilo_Suffix),
32 => new String'("1.000500" & Kilo_Suffix));
begin
for Exponent in Loop_Iteration loop
Test_Cases.Add
(Passed =>
Fixed_MI (Median + Operand) = Expected_Results (Exponent).all,
Message => "Fixed_MI (Median + Operand)/" & Exponent'Image);
Operand := Operand * 2.0;
end loop;
end;
end;
declare
subtype Loop_Iteration is Natural range 1 .. 18;
type Less_Equal_Greater is (LT, EQ, GT);
type Expected_List is array (Loop_Iteration,
Less_Equal_Greater) of String_Access;
Median : constant Scalar := 1000.0;
LT_Median : constant Scalar := Median - Scalar'Small;
GT_Median : constant Scalar := Median + Scalar'Small;
Normal_Suffix : constant String := No_Break_Space & SI_Units.Names.Ampere;
Kilo_Suffix : constant String :=
No_Break_Space & "k" & SI_Units.Names.Ampere;
Expected_Results : constant Expected_List :=
(01 => (LT => new String'("1.0" & Kilo_Suffix),
EQ => new String'("1.0" & Kilo_Suffix),
GT => new String'("1.0" & Kilo_Suffix)),
02 => (LT => new String'("1.00" & Kilo_Suffix),
EQ => new String'("1.00" & Kilo_Suffix),
GT => new String'("1.00" & Kilo_Suffix)),
03 => (LT => new String'("1.000" & Kilo_Suffix),
EQ => new String'("1.000" & Kilo_Suffix),
GT => new String'("1.000" & Kilo_Suffix)),
04 => (LT => new String'("1.0000" & Kilo_Suffix),
EQ => new String'("1.0000" & Kilo_Suffix),
GT => new String'("1.0000" & Kilo_Suffix)),
05 => (LT => new String'("1.00000" & Kilo_Suffix),
EQ => new String'("1.00000" & Kilo_Suffix),
GT => new String'("1.00000" & Kilo_Suffix)),
06 => (LT => new String'("1.000000" & Kilo_Suffix),
EQ => new String'("1.000000" & Kilo_Suffix),
GT => new String'("1.000000" & Kilo_Suffix)),
07 => (LT => new String'("1.0000000" & Kilo_Suffix),
EQ => new String'("1.0000000" & Kilo_Suffix),
GT => new String'("1.0000000" & Kilo_Suffix)),
08 => (LT => new String'("1.00000000" & Kilo_Suffix),
EQ => new String'("1.00000000" & Kilo_Suffix),
GT => new String'("1.00000000" & Kilo_Suffix)),
09 => (LT => new String'("1.000000000" & Kilo_Suffix),
EQ => new String'("1.000000000" & Kilo_Suffix),
GT => new String'("1.000000000" & Kilo_Suffix)),
10 => (LT => new String'("999.9999999998" & Normal_Suffix),
EQ => new String'("1.0000000000" & Kilo_Suffix),
GT => new String'("1.0000000000" & Kilo_Suffix)),
11 => (LT => new String'("999.99999999977" & Normal_Suffix),
EQ => new String'("1.00000000000" & Kilo_Suffix),
GT => new String'("1.00000000000" & Kilo_Suffix)),
12 => (LT => new String'("999.999999999767" & Normal_Suffix),
EQ => new String'("1.000000000000" & Kilo_Suffix),
GT => new String'("1.000000000000" & Kilo_Suffix)),
13 => (LT => new String'("999.9999999997672" & Normal_Suffix),
EQ => new String'("1.0000000000000" & Kilo_Suffix),
GT => new String'("1.0000000000002" & Kilo_Suffix)),
14 => (LT => new String'("999.99999999976717" & Normal_Suffix),
EQ => new String'("1.00000000000000" & Kilo_Suffix),
GT => new String'("1.00000000000023" & Kilo_Suffix)),
15 => (LT => new String'("999.999999999767169" & Normal_Suffix),
EQ => new String'("1.000000000000000" & Kilo_Suffix),
GT => new String'("1.000000000000233" & Kilo_Suffix)),
16 => (LT => new String'("999.9999999997671690" & Normal_Suffix),
EQ => new String'("1.0000000000000000" & Kilo_Suffix),
GT => new String'("1.0000000000002328" & Kilo_Suffix)),
17 => (LT => new String'("999.99999999976716900" & Normal_Suffix),
EQ => new String'("1.00000000000000000" & Kilo_Suffix),
GT => new String'("1.00000000000023283" & Kilo_Suffix)),
18 => (LT => new String'("999.999999999767169000" & Normal_Suffix),
EQ => new String'("1.000000000000000000" & Kilo_Suffix),
GT => new String'("1.000000000000232830" & Kilo_Suffix)));
begin
for Aft in Loop_Iteration loop
Test_Cases.Add
(Passed => Fixed_MI (Value => LT_Median,
Aft => Aft) = Expected_Results (Aft, LT).all,
Message =>
"Fixed_MI (Value => LT_Median, Aft =>" & Aft'Image & ")");
Test_Cases.Add
(Passed => Fixed_MI (Value => Median,
Aft => Aft) = Expected_Results (Aft, EQ).all,
Message => "Fixed_MI (Value => Median, Aft =>" & Aft'Image & ")");
Test_Cases.Add
(Passed => Fixed_MI (Value => GT_Median,
Aft => Aft) = Expected_Results (Aft, GT).all,
Message =>
"Fixed_MI (Value => GT_Median, Aft =>" & Aft'Image & ")");
end loop;
end;
Test_Cases.Add
(Passed =>
Float_MI (0.0) = "0.000" & No_Break_Space & SI_Units.Names.Volt,
Message => "Float_MI (0.0)");
Test_Cases.Add
(Passed =>
Float_MI (Long_Float'Safe_Small) = "0.000" &
No_Break_Space & SI_Units.Names.Volt,
Message => "Float_MI (Long_Float'Safe_Small)");
Test_Cases.Add
(Passed =>
Float_MI (Long_Float'Safe_First) = "-inf " & No_Break_Space &
SI_Units.Names.Volt,
Message => "Float_MI (Long_Float'Safe_First)");
Test_Cases.Add
(Passed =>
Float_MI (Long_Float'Safe_Last) = "+inf " &
No_Break_Space & SI_Units.Names.Volt,
Message => "Float_MI (Long_Float'Safe_Last)");
Test_Cases.Add
(Passed =>
Float_MI (-9.999_999_49E27) = "-inf " & No_Break_Space &
SI_Units.Names.Volt,
Message => "Float_MI (-9.999_999_49E27)");
Test_Cases.Add
(Passed =>
Float_MI (9.999_999_49E27) = "9999.999" & No_Break_Space & "Y" &
SI_Units.Names.Volt,
Message => "Float_MI (9.999_999_49E27)");
-- "infinity"
Test_Cases.Add
(Passed =>
Float_MI (-1.0E27) = "-inf " & No_Break_Space & SI_Units.Names.Volt,
Message => "Float_MI (-1.0E27)");
Test_Cases.Add
(Passed =>
Float_MI (1.0E27) = "1000.000" & No_Break_Space & "Y" &
SI_Units.Names.Volt,
Message => "Float_MI (1.0E27)");
-- Yotta
Test_Cases.Add
(Passed =>
Float_MI (-1.0E24) = "-1.000" & No_Break_Space & "Y" &
SI_Units.Names.Volt,
Message => "Float_MI (-1.0E24)");
Test_Cases.Add
(Passed =>
Float_MI (1.0E24) = "1.000" & No_Break_Space & "Y" &
SI_Units.Names.Volt,
Message => "Float_MI (1.0E24)");
-- Zeta
Test_Cases.Add
(Passed =>
Float_MI (-1.0E21) = "-1.000" & No_Break_Space & "Z" &
SI_Units.Names.Volt,
Message => "Float_MI (-1.0E21)");
Test_Cases.Add
(Passed =>
Float_MI (1.0E21) = "1.000" & No_Break_Space & "Z" &
SI_Units.Names.Volt,
Message => "Float_MI (1.0E21)");
-- Exa
Test_Cases.Add
(Passed =>
Float_MI (-1.0E18) = "-1.000" & No_Break_Space & "E" &
SI_Units.Names.Volt,
Message => "Float_MI (-1.0E18)");
Test_Cases.Add
(Passed =>
Float_MI (1.0E18) = "1.000" & No_Break_Space & "E" &
SI_Units.Names.Volt,
Message => "Float_MI (1.0E18)");
-- Peta
Test_Cases.Add
(Passed =>
Float_MI (-1.0E15) = "-1.000" & No_Break_Space & "P" &
SI_Units.Names.Volt,
Message => "Float_MI (-1.0E15)");
Test_Cases.Add
(Passed =>
Float_MI (1.0E15) = "1.000" & No_Break_Space & "P" &
SI_Units.Names.Volt,
Message => "Float_MI (1.0E15)");
-- Tera
Test_Cases.Add
(Passed =>
Float_MI (-1.0E12) = "-1.000" & No_Break_Space & "T" &
SI_Units.Names.Volt,
Message => "Float_MI (-1.0E12)");
Test_Cases.Add
(Passed =>
Float_MI (1.0E12) = "1.000" & No_Break_Space & "T" &
SI_Units.Names.Volt,
Message => "Float_MI (1.0E12)");
-- Giga
Test_Cases.Add
(Passed =>
Float_MI (-1.0E9) = "-1.000" & No_Break_Space & "G" &
SI_Units.Names.Volt,
Message => "Float_MI (-1.0E9)");
Test_Cases.Add
(Passed =>
Float_MI (1.0E9) = "1.000" & No_Break_Space & "G" &
SI_Units.Names.Volt,
Message => "Float_MI (1.0E9)");
-- Mega
Test_Cases.Add
(Passed =>
Float_MI (-1.0E6) = "-1.000" & No_Break_Space & "M" &
SI_Units.Names.Volt,
Message => "Float_MI (-1.0E6)");
Test_Cases.Add
(Passed =>
Float_MI (1.0E6) = "1.000" & No_Break_Space & "M" & SI_Units.Names.Volt,
Message => "Float_MI (1.0E6)");
-- kilo
Test_Cases.Add
(Passed =>
Float_MI (-1.0E3) = "-1.000" & No_Break_Space & "k" &
SI_Units.Names.Volt,
Message => "Float_MI (-1.0E3)");
Test_Cases.Add
(Passed =>
Float_MI (1.0E3) = "1.000" & No_Break_Space & "k" & SI_Units.Names.Volt,
Message => "Float_MI (1.0E3)");
-- None
Test_Cases.Add
(Passed =>
Float_MI (-1.0E0) = "-1.000" & No_Break_Space & SI_Units.Names.Volt,
Message => "Float_MI (-1.0E0)");
Test_Cases.Add
(Passed =>
Float_MI (1.0E0) = "1.000" & No_Break_Space & SI_Units.Names.Volt,
Message => "Float_MI (1.0E0)");
-- milli
Test_Cases.Add
(Passed =>
Float_MI (-1.0E-3) = "-1.000" & No_Break_Space & "m" &
SI_Units.Names.Volt,
Message => "Float_MI (-1.0E-3)");
Test_Cases.Add
(Passed =>
Float_MI (1.0E-3) = "1.000" & No_Break_Space & "m" &
SI_Units.Names.Volt,
Message => "Float_MI (1.0E-3)");
-- micro
Test_Cases.Add
(Passed =>
Float_MI (-1.0E-6) = "-1.000" & No_Break_Space & Micro_Sign &
SI_Units.Names.Volt,
Message => "Float_MI (-1.0E-6)");
Test_Cases.Add
(Passed =>
Float_MI (1.0E-6) = "1.000" & No_Break_Space & Micro_Sign &
SI_Units.Names.Volt,
Message => "Float_MI (1.0E-6)");
-- nano
Test_Cases.Add
(Passed =>
Float_MI (-1.0E-9) = "-1.000" & No_Break_Space & "n" &
SI_Units.Names.Volt,
Message => "Float_MI (-1.0E-9)");
Test_Cases.Add
(Passed =>
Float_MI (1.0E-9) = "1.000" & No_Break_Space & "n" &
SI_Units.Names.Volt,
Message => "Float_MI (1.0E-9)");
-- pico
Test_Cases.Add
(Passed =>
Float_MI (-1.0E-12) = "-1.000" & No_Break_Space & "p" &
SI_Units.Names.Volt,
Message => "Float_MI (-1.0E-12)");
Test_Cases.Add
(Passed =>
Float_MI (1.0E-12) = "1.000" & No_Break_Space & "p" &
SI_Units.Names.Volt,
Message => "Float_MI (1.0E-12)");
-- femto
Test_Cases.Add
(Passed =>
Float_MI (-1.0E-15) = "-1.000" & No_Break_Space & "f" &
SI_Units.Names.Volt,
Message => "Float_MI (-1.0E-15)");
Test_Cases.Add
(Passed =>
Float_MI (1.0E-15) = "1.000" & No_Break_Space & "f" &
SI_Units.Names.Volt,
Message => "Float_MI (1.0E-15)");
-- atto
Test_Cases.Add
(Passed =>
Float_MI (-1.0E-18) = "-1.000" & No_Break_Space & "a" &
SI_Units.Names.Volt,
Message => "Float_MI (-1.0E-18)");
Test_Cases.Add
(Passed =>
Float_MI (1.0E-18) = "1.000" & No_Break_Space & "a" &
SI_Units.Names.Volt,
Message => "Float_MI (1.0E-18)");
-- zepto
Test_Cases.Add
(Passed =>
Float_MI (-1.0E-21) = "-1.000" & No_Break_Space & "z" &
SI_Units.Names.Volt,
Message => "Float_MI (-1.0E-21)");
Test_Cases.Add
(Passed =>
Float_MI (1.0E-21) = "1.000" & No_Break_Space & "z" &
SI_Units.Names.Volt,
Message => "Float_MI (1.0E-21)");
-- yocto
Test_Cases.Add
(Passed =>
Float_MI (-1.0E-24) = "-1.000" & No_Break_Space & "y" &
SI_Units.Names.Volt,
Message => "Float_MI (-1.0E-24)");
Test_Cases.Add
(Passed =>
Float_MI (1.0E-24) = "1.000" & No_Break_Space & "y" &
SI_Units.Names.Volt,
Message => "Float_MI (1.0E-24)");
-- almost zero, still with (smallest) prefix
Test_Cases.Add
(Passed =>
Float_MI (-5.0E-28) = "-0.001" & No_Break_Space & "y" &
SI_Units.Names.Volt,
Message => "Float_MI (-5.0E-28)");
Test_Cases.Add
(Passed =>
Float_MI (5.0E-28) = "0.001" & No_Break_Space & "y" &
SI_Units.Names.Volt,
Message => "Float_MI (5.0E-28)");
-- virtually zero, no prefix
Test_Cases.Add
(Passed =>
Float_MI (-4.999_999_999_999_999E-28) = "-0.000" & No_Break_Space &
SI_Units.Names.Volt,
Message => "Float_MI (-4.999_999_999_999_999E-28)");
Test_Cases.Add
(Passed =>
Float_MI (4.999_999_999_999_999E-28) = "0.000" & No_Break_Space &
SI_Units.Names.Volt,
Message => "Float_MI (4.999_999_999_999_999E-28)");
-- Scaling tests
for From_Prefix in SI_Units.Metric.Scaling.Prefixes loop
for To_Prefix in SI_Units.Metric.Scaling.Prefixes loop
Build_Lookup : -- Calculate expected value by hand.
declare
type Prefix_Matrix is
array (SI_Units.Metric.Scaling.Prefixes,
SI_Units.Metric.Scaling.Prefixes) of Long_Float;
use all type SI_Units.Metric.Scaling.Prefixes;
Scale_Lookup : constant Prefix_Matrix :=
(yocto => (yocto => 1.0E0,
zepto => 1.0E-3,
atto => 1.0E-6,
femto => 1.0E-9,
pico => 1.0E-12,
nano => 1.0E-15,
micro => 1.0E-18,
milli => 1.0E-21,
centi => 1.0E-22,
deci => 1.0E-23,
None => 1.0E-24,
Deka => 1.0E-25,
Hecto => 1.0E-26,
kilo => 1.0E-27,
Mega => 1.0E-30,
Giga => 1.0E-33,
Tera => 1.0E-36,
Peta => 1.0E-39,
Exa => 1.0E-42,
Zetta => 1.0E-45,
Yotta => 1.0E-48),
zepto => (yocto => 1.0E3,
zepto => 1.0E0,
atto => 1.0E-3,
femto => 1.0E-6,
pico => 1.0E-9,
nano => 1.0E-12,
micro => 1.0E-15,
milli => 1.0E-18,
centi => 1.0E-19,
deci => 1.0E-20,
None => 1.0E-21,
Deka => 1.0E-22,
Hecto => 1.0E-23,
kilo => 1.0E-24,
Mega => 1.0E-27,
Giga => 1.0E-30,
Tera => 1.0E-33,
Peta => 1.0E-36,
Exa => 1.0E-39,
Zetta => 1.0E-42,
Yotta => 1.0E-45),
atto => (yocto => 1.0E6,
zepto => 1.0E3,
atto => 1.0E0,
femto => 1.0E-3,
pico => 1.0E-6,
nano => 1.0E-9,
micro => 1.0E-12,
milli => 1.0E-15,
centi => 1.0E-16,
deci => 1.0E-17,
None => 1.0E-18,
Deka => 1.0E-19,
Hecto => 1.0E-20,
kilo => 1.0E-21,
Mega => 1.0E-24,
Giga => 1.0E-27,
Tera => 1.0E-30,
Peta => 1.0E-33,
Exa => 1.0E-36,
Zetta => 1.0E-39,
Yotta => 1.0E-42),
femto => (yocto => 1.0E9,
zepto => 1.0E6,
atto => 1.0E3,
femto => 1.0E0,
pico => 1.0E-3,
nano => 1.0E-6,
micro => 1.0E-9,
milli => 1.0E-12,
centi => 1.0E-13,
deci => 1.0E-14,
None => 1.0E-15,
Deka => 1.0E-16,
Hecto => 1.0E-17,
kilo => 1.0E-18,
Mega => 1.0E-21,
Giga => 1.0E-24,
Tera => 1.0E-27,
Peta => 1.0E-30,
Exa => 1.0E-33,
Zetta => 1.0E-36,
Yotta => 1.0E-39),
pico => (yocto => 1.0E12,
zepto => 1.0E9,
atto => 1.0E6,
femto => 1.0E3,
pico => 1.0E0,
nano => 1.0E-3,
micro => 1.0E-6,
milli => 1.0E-9,
centi => 1.0E-10,
deci => 1.0E-11,
None => 1.0E-12,
Deka => 1.0E-13,
Hecto => 1.0E-14,
kilo => 1.0E-15,
Mega => 1.0E-18,
Giga => 1.0E-21,
Tera => 1.0E-24,
Peta => 1.0E-27,
Exa => 1.0E-30,
Zetta => 1.0E-33,
Yotta => 1.0E-36),
nano => (yocto => 1.0E15,
zepto => 1.0E12,
atto => 1.0E9,
femto => 1.0E6,
pico => 1.0E3,
nano => 1.0E0,
micro => 1.0E-3,
milli => 1.0E-6,
centi => 1.0E-7,
deci => 1.0E-8,
None => 1.0E-9,
Deka => 1.0E-10,
Hecto => 1.0E-11,
kilo => 1.0E-12,
Mega => 1.0E-15,
Giga => 1.0E-18,
Tera => 1.0E-21,
Peta => 1.0E-24,
Exa => 1.0E-27,
Zetta => 1.0E-30,
Yotta => 1.0E-33),
micro => (yocto => 1.0E18,
zepto => 1.0E15,
atto => 1.0E12,
femto => 1.0E9,
pico => 1.0E6,
nano => 1.0E3,
micro => 1.0E0,
milli => 1.0E-3,
centi => 1.0E-4,
deci => 1.0E-5,
None => 1.0E-6,
Deka => 1.0E-7,
Hecto => 1.0E-8,
kilo => 1.0E-9,
Mega => 1.0E-12,
Giga => 1.0E-15,
Tera => 1.0E-18,
Peta => 1.0E-21,
Exa => 1.0E-24,
Zetta => 1.0E-27,
Yotta => 1.0E-30),
milli => (yocto => 1.0E21,
zepto => 1.0E18,
atto => 1.0E15,
femto => 1.0E12,
pico => 1.0E9,
nano => 1.0E6,
micro => 1.0E3,
milli => 1.0E0,
centi => 1.0E-1,
deci => 1.0E-2,
None => 1.0E-3,
Deka => 1.0E-4,
Hecto => 1.0E-5,
kilo => 1.0E-6,
Mega => 1.0E-9,
Giga => 1.0E-12,
Tera => 1.0E-15,
Peta => 1.0E-18,
Exa => 1.0E-21,
Zetta => 1.0E-24,
Yotta => 1.0E-27),
centi => (yocto => 1.0E22,
zepto => 1.0E19,
atto => 1.0E16,
femto => 1.0E13,
pico => 1.0E10,
nano => 1.0E7,
micro => 1.0E4,
milli => 1.0E1,
centi => 1.0E0,
deci => 1.0E-1,
None => 1.0E-2,
Deka => 1.0E-3,
Hecto => 1.0E-4,
kilo => 1.0E-5,
Mega => 1.0E-8,
Giga => 1.0E-11,
Tera => 1.0E-14,
Peta => 1.0E-17,
Exa => 1.0E-20,
Zetta => 1.0E-23,
Yotta => 1.0E-26),
deci => (yocto => 1.0E23,
zepto => 1.0E20,
atto => 1.0E17,
femto => 1.0E14,
pico => 1.0E11,
nano => 1.0E8,
micro => 1.0E5,
milli => 1.0E2,
centi => 1.0E1,
deci => 1.0E0,
None => 1.0E-1,
Deka => 1.0E-2,
Hecto => 1.0E-3,
kilo => 1.0E-4,
Mega => 1.0E-7,
Giga => 1.0E-10,
Tera => 1.0E-13,
Peta => 1.0E-16,
Exa => 1.0E-19,
Zetta => 1.0E-22,
Yotta => 1.0E-25),
None => (yocto => 1.0E24,
zepto => 1.0E21,
atto => 1.0E18,
femto => 1.0E15,
pico => 1.0E12,
nano => 1.0E9,
micro => 1.0E6,
milli => 1.0E3,
centi => 1.0E2,
deci => 1.0E1,
None => 1.0E0,
Deka => 1.0E-1,
Hecto => 1.0E-2,
kilo => 1.0E-3,
Mega => 1.0E-6,
Giga => 1.0E-9,
Tera => 1.0E-12,
Peta => 1.0E-15,
Exa => 1.0E-18,
Zetta => 1.0E-21,
Yotta => 1.0E-24),
Deka => (yocto => 1.0E25,
zepto => 1.0E22,
atto => 1.0E19,
femto => 1.0E16,
pico => 1.0E13,
nano => 1.0E10,
micro => 1.0E7,
milli => 1.0E4,
centi => 1.0E3,
deci => 1.0E2,
None => 1.0E1,
Deka => 1.0E0,
Hecto => 1.0E-1,
kilo => 1.0E-2,
Mega => 1.0E-5,
Giga => 1.0E-8,
Tera => 1.0E-11,
Peta => 1.0E-14,
Exa => 1.0E-17,
Zetta => 1.0E-20,
Yotta => 1.0E-23),
Hecto => (yocto => 1.0E26,
zepto => 1.0E23,
atto => 1.0E20,
femto => 1.0E17,
pico => 1.0E14,
nano => 1.0E11,
micro => 1.0E8,
milli => 1.0E5,
centi => 1.0E4,
deci => 1.0E3,
None => 1.0E2,
Deka => 1.0E1,
Hecto => 1.0E0,
kilo => 1.0E-1,
Mega => 1.0E-4,
Giga => 1.0E-7,
Tera => 1.0E-10,
Peta => 1.0E-13,
Exa => 1.0E-16,
Zetta => 1.0E-19,
Yotta => 1.0E-22),
kilo => (yocto => 1.0E27,
zepto => 1.0E24,
atto => 1.0E21,
femto => 1.0E18,
pico => 1.0E15,
nano => 1.0E12,
micro => 1.0E9,
milli => 1.0E6,
centi => 1.0E5,
deci => 1.0E4,
None => 1.0E3,
Deka => 1.0E2,
Hecto => 1.0E1,
kilo => 1.0E0,
Mega => 1.0E-3,
Giga => 1.0E-6,
Tera => 1.0E-9,
Peta => 1.0E-12,
Exa => 1.0E-15,
Zetta => 1.0E-18,
Yotta => 1.0E-21),
Mega => (yocto => 1.0E30,
zepto => 1.0E27,
atto => 1.0E24,
femto => 1.0E21,
pico => 1.0E18,
nano => 1.0E15,
micro => 1.0E12,
milli => 1.0E9,
centi => 1.0E8,
deci => 1.0E7,
None => 1.0E6,
Deka => 1.0E5,
Hecto => 1.0E4,
kilo => 1.0E3,
Mega => 1.0E0,
Giga => 1.0E-3,
Tera => 1.0E-6,
Peta => 1.0E-9,
Exa => 1.0E-12,
Zetta => 1.0E-15,
Yotta => 1.0E-18),
Giga => (yocto => 1.0E33,
zepto => 1.0E30,
atto => 1.0E27,
femto => 1.0E24,
pico => 1.0E21,
nano => 1.0E18,
micro => 1.0E15,
milli => 1.0E12,
centi => 1.0E11,
deci => 1.0E10,
None => 1.0E9,
Deka => 1.0E8,
Hecto => 1.0E7,
kilo => 1.0E6,
Mega => 1.0E3,
Giga => 1.0E0,
Tera => 1.0E-3,
Peta => 1.0E-6,
Exa => 1.0E-9,
Zetta => 1.0E-12,
Yotta => 1.0E-15),
Tera => (yocto => 1.0E36,
zepto => 1.0E33,
atto => 1.0E30,
femto => 1.0E27,
pico => 1.0E24,
nano => 1.0E21,
micro => 1.0E18,
milli => 1.0E15,
centi => 1.0E14,
deci => 1.0E13,
None => 1.0E12,
Deka => 1.0E11,
Hecto => 1.0E10,
kilo => 1.0E9,
Mega => 1.0E6,
Giga => 1.0E3,
Tera => 1.0E0,
Peta => 1.0E-3,
Exa => 1.0E-6,
Zetta => 1.0E-9,
Yotta => 1.0E-12),
Peta => (yocto => 1.0E39,
zepto => 1.0E36,
atto => 1.0E33,
femto => 1.0E30,
pico => 1.0E27,
nano => 1.0E24,
micro => 1.0E21,
milli => 1.0E18,
centi => 1.0E17,
deci => 1.0E16,
None => 1.0E15,
Deka => 1.0E14,
Hecto => 1.0E13,
kilo => 1.0E12,
Mega => 1.0E9,
Giga => 1.0E6,
Tera => 1.0E3,
Peta => 1.0E0,
Exa => 1.0E-3,
Zetta => 1.0E-6,
Yotta => 1.0E-9),
Exa => (yocto => 1.0E42,
zepto => 1.0E39,
atto => 1.0E36,
femto => 1.0E33,
pico => 1.0E30,
nano => 1.0E27,
micro => 1.0E24,
milli => 1.0E21,
centi => 1.0E20,
deci => 1.0E19,
None => 1.0E18,
Deka => 1.0E17,
Hecto => 1.0E16,
kilo => 1.0E15,
Mega => 1.0E12,
Giga => 1.0E9,
Tera => 1.0E6,
Peta => 1.0E3,
Exa => 1.0E0,
Zetta => 1.0E-3,
Yotta => 1.0E-6),
Zetta => (yocto => 1.0E45,
zepto => 1.0E42,
atto => 1.0E39,
femto => 1.0E36,
pico => 1.0E33,
nano => 1.0E30,
micro => 1.0E27,
milli => 1.0E24,
centi => 1.0E23,
deci => 1.0E22,
None => 1.0E21,
Deka => 1.0E20,
Hecto => 1.0E19,
kilo => 1.0E18,
Mega => 1.0E15,
Giga => 1.0E12,
Tera => 1.0E9,
Peta => 1.0E6,
Exa => 1.0E3,
Zetta => 1.0E0,
Yotta => 1.0E-3),
Yotta => (yocto => 1.0E48,
zepto => 1.0E45,
atto => 1.0E42,
femto => 1.0E39,
pico => 1.0E36,
nano => 1.0E33,
micro => 1.0E30,
milli => 1.0E27,
centi => 1.0E26,
deci => 1.0E25,
None => 1.0E24,
Deka => 1.0E23,
Hecto => 1.0E22,
kilo => 1.0E21,
Mega => 1.0E18,
Giga => 1.0E15,
Tera => 1.0E12,
Peta => 1.0E9,
Exa => 1.0E6,
Zetta => 1.0E3,
Yotta => 1.0E0));
begin
for X in -10 .. 10 loop
Calculate_Expected :
declare
Origin_Value : constant Long_Float := 2.0 ** X;
Expected : constant Long_Float :=
Origin_Value * Scale_Lookup (From_Prefix, To_Prefix);
begin
if Expected /= 0.0 then
Test_Cases.Add
(Passed =>
Scale_Float (Value => Origin_Value,
From_Prefix => From_Prefix,
To_Prefix => To_Prefix) = Expected,
Message =>
"Scale_Float (Value => " & Origin_Value'Image &
", From_Prefix => " & From_Prefix'Image &
", To_Prefix => " & To_Prefix'Image & ")");
end if;
end Calculate_Expected;
end loop;
end Build_Lookup;
end loop;
end loop;
pragma Warnings (Off, "static fixed-point value is not a multiple of Small");
Test_Cases.Add
(Passed =>
Fixed_MI (Value => 0.55, Aft => 0) = "550.0" & No_Break_Space & "m" &
SI_Units.Names.Ampere,
Message => "Fixed_MI (0.55)");
Test_Cases.Add
(Passed =>
Fixed_MI (Value => 0.55, Aft => 1) = "550.0" & No_Break_Space & "m" &
SI_Units.Names.Ampere,
Message => "Fixed_MI (0.55)");
pragma Warnings (On, "static fixed-point value is not a multiple of Small");
Print_Test_Summary :
declare
Total : constant Natural := Test_Cases.Num_Total;
Passed : constant Natural := Test_Cases.Num_Passed;
begin
Ada.Text_IO.Put_Line
(Item =>
"Test results:" & Passed'Image & " out of" & Total'Image &
" succeeded.");
Ada.Text_IO.Put_Line
(Item => (if Passed = Total then "<OK>" else "<FAILED>"));
Ada.Command_Line.Set_Exit_Status
(Code => (if Passed = Total
then Ada.Command_Line.Success
else Ada.Command_Line.Failure));
end Print_Test_Summary;
end Main_SI_Units_Test;
|
src/ui/knowledge-stories.adb | thindil/steamsky | 80 | 18326 | <reponame>thindil/steamsky
-- Copyright (c) 2020-2021 <NAME> <<EMAIL>>
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
with Ada.Characters.Latin_1; use Ada.Characters.Latin_1;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Interfaces.C.Strings; use Interfaces.C.Strings;
with GNAT.String_Split; use GNAT.String_Split;
with CArgv; use CArgv;
with Tcl.Tk.Ada; use Tcl.Tk.Ada;
with Tcl.Tk.Ada.Font; use Tcl.Tk.Ada.Font;
with Tcl.Tk.Ada.Grid;
with Tcl.Tk.Ada.Widgets; use Tcl.Tk.Ada.Widgets;
with Tcl.Tk.Ada.Widgets.Text; use Tcl.Tk.Ada.Widgets.Text;
with Tcl.Tk.Ada.Widgets.TtkButton; use Tcl.Tk.Ada.Widgets.TtkButton;
with Tcl.Tk.Ada.Widgets.TtkEntry.TtkComboBox;
use Tcl.Tk.Ada.Widgets.TtkEntry.TtkComboBox;
with Tcl.Tk.Ada.Winfo; use Tcl.Tk.Ada.Winfo;
with Bases; use Bases;
with CoreUI; use CoreUI;
with Factions; use Factions;
with Items; use Items;
with Ships; use Ships;
with Stories; use Stories;
with Utils.UI; use Utils.UI;
package body Knowledge.Stories is
-- ****o* KStories/KStories.Show_Story_Command
-- FUNCTION
-- Show the current story information
-- PARAMETERS
-- ClientData - Custom data send to the command. Unused
-- Interp - Tcl interpreter in which command was executed.
-- Argc - Number of arguments passed to the command. Unused
-- Argv - Values of arguments passed to the command. Unused
-- RESULT
-- This function always return TCL_OK
-- COMMANDS
-- ShowStory
-- SOURCE
function Show_Story_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with
Convention => C;
-- ****
function Show_Story_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int is
pragma Unreferenced(ClientData, Argc, Argv);
FrameName: constant String :=
Main_Paned & ".knowledgeframe.stories.canvas.frame";
StoryView: constant Tk_Text := Get_Widget(FrameName & ".view", Interp);
StoryText: Unbounded_String;
Tokens: Slice_Set;
Step: Step_Data;
StoryIndex: Positive;
StoriesBox: constant Ttk_ComboBox :=
Get_Widget(FrameName & ".options.titles", Interp);
Button: Ttk_Button := Get_Widget(FrameName & ".options.show", Interp);
Rows: Positive := 1;
LineWidth: constant Positive :=
(Positive'Value(Winfo_Get(StoriesBox, "reqwidth")) +
Positive'Value(Winfo_Get(Button, "reqwidth"))) /
Positive'Value(Measure("InterfaceFont", "{ }"));
begin
StoryIndex := Natural'Value(Current(StoriesBox)) + 1;
configure(StoryView, "-state normal -width" & Positive'Image(LineWidth));
Delete(StoryView, "1.0", "end");
Story_Steps_Info_Loop :
for StepText of FinishedStories(StoryIndex).StepsTexts loop
Append(StoryText, StepText & LF);
Rows := Rows + (Length(StepText) / LineWidth) + 1;
end loop Story_Steps_Info_Loop;
if Natural(FinishedStories(StoryIndex).StepsTexts.Length) <
FinishedStories(StoryIndex).StepsAmount then
Append(StoryText, GetCurrentStoryText & LF);
Rows := Rows + (Length(GetCurrentStoryText & LF) / LineWidth) + 1;
if CurrentStory.Data /= Null_Unbounded_String then
Step :=
(if CurrentStory.CurrentStep = 0 then
Stories_List(CurrentStory.Index).StartingStep
elsif CurrentStory.CurrentStep > 0 then
Stories_List(CurrentStory.Index).Steps
(CurrentStory.CurrentStep)
else Stories_List(CurrentStory.Index).FinalStep);
Create(Tokens, To_String(CurrentStory.Data), ";");
case Step.FinishCondition is
when ASKINBASE =>
if Slice_Count(Tokens) < 2 then
Append
(StoryText,
"You must travel to base " & CurrentStory.Data &
" at X:");
Base_Location_Loop :
for I in Sky_Bases'Range loop
if Sky_Bases(I).Name = CurrentStory.Data then
Append
(StoryText, Positive'Image(Sky_Bases(I).Sky_X));
Append(StoryText, " Y:");
Append
(StoryText, Positive'Image(Sky_Bases(I).Sky_Y));
exit Base_Location_Loop;
end if;
end loop Base_Location_Loop;
else
Append(StoryText, "You can ask in any base. ");
end if;
when DESTROYSHIP =>
Append
(StoryText,
"You must find " &
Proto_Ships_List(To_Unbounded_String(Slice(Tokens, 3)))
.Name &
" at X:" & Slice(Tokens, 1) & " Y:" & Slice(Tokens, 2));
when EXPLORE =>
Append
(StoryText,
"You must travel to X:" & Slice(Tokens, 1) & " Y:" &
Slice(Tokens, 2));
when LOOT =>
Append
(StoryText,
"You must loot: " &
Items_List(To_Unbounded_String((Slice(Tokens, 1)))).Name &
" from ");
if Slice(Tokens, 2) = "any" then
Append(StoryText, "any ");
if Factions_Container.Contains
(Factions_List,
GetStepData(Step.FinishData, "faction")) then
Append
(StoryText,
Factions_List
(GetStepData(Step.FinishData, "faction"))
.Name);
end if;
Append(StoryText, " ship.");
else
Find_Proto_Ship_Loop :
for I in Proto_Ships_List.Iterate loop
if Proto_Ships_Container.Key(I) =
To_Unbounded_String(Slice(Tokens, 2)) then
Append(StoryText, Proto_Ships_List(I).Name);
Append(StoryText, ".");
exit Find_Proto_Ship_Loop;
end if;
end loop Find_Proto_Ship_Loop;
end if;
when ANY =>
null;
end case;
end if;
Insert(StoryView, "end", "{" & To_String(StoryText) & "}");
Tcl.Tk.Ada.Grid.Grid(Button);
Button.Name := New_String(FrameName & ".options.set");
Tcl.Tk.Ada.Grid.Grid(Button);
else
Tcl.Tk.Ada.Grid.Grid_Remove(Button);
Button.Name := New_String(FrameName & ".options.set");
Tcl.Tk.Ada.Grid.Grid_Remove(Button);
end if;
configure(StoryView, "-state disabled -height" & Positive'Image(Rows));
return TCL_OK;
end Show_Story_Command;
-- ****o* KStories/KStories.Show_Story_Location_Command
-- FUNCTION
-- Show the current story event on map
-- PARAMETERS
-- ClientData - Custom data send to the command.
-- Interp - Tcl interpreter in which command was executed.
-- Argc - Number of arguments passed to the command. Unused
-- Argv - Values of arguments passed to the command.
-- RESULT
-- This function always return TCL_OK
-- COMMANDS
-- ShowStoryLocation
-- SOURCE
function Show_Story_Location_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with
Convention => C;
-- ****
function Show_Story_Location_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int is
pragma Unreferenced(Argc);
NewX, NewY: Positive := 1;
begin
GetStoryLocation(NewX, NewY);
return
Show_On_Map_Command
(ClientData, Interp, 3,
CArgv.Empty & CArgv.Arg(Argv, 0) & Positive'Image(NewX) &
Positive'Image(NewY));
end Show_Story_Location_Command;
-- ****o* KStories/KStories.Set_Story_Command
-- FUNCTION
-- Set the current story event as the player's ship destination
-- PARAMETERS
-- ClientData - Custom data send to the command.
-- Interp - Tcl interpreter in which command was executed.
-- Argc - Number of arguments passed to the command. Unused
-- Argv - Values of arguments passed to the command.
-- RESULT
-- This function always return TCL_OK
-- COMMANDS
-- SetStory
-- SOURCE
function Set_Story_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int with
Convention => C;
-- ****
function Set_Story_Command
(ClientData: Integer; Interp: Tcl.Tcl_Interp; Argc: Interfaces.C.int;
Argv: CArgv.Chars_Ptr_Ptr) return Interfaces.C.int is
pragma Unreferenced(Argc);
NewX, NewY: Positive := 1;
begin
GetStoryLocation(NewX, NewY);
return
Set_Destination_Command
(ClientData, Interp, 3,
CArgv.Empty & CArgv.Arg(Argv, 0) & Positive'Image(NewX) &
Positive'Image(NewY));
end Set_Story_Command;
procedure AddCommands is
begin
Add_Command("ShowStory", Show_Story_Command'Access);
Add_Command("ShowStoryLocation", Show_Story_Location_Command'Access);
Add_Command("SetStory", Set_Story_Command'Access);
end AddCommands;
end Knowledge.Stories;
|
programs/oeis/325/A325909.asm | neoneye/loda | 22 | 95350 | <gh_stars>10-100
; A325909: Lexicographically earliest sequence of distinct positive terms such that for any n > 0, n divides Sum_{k = 1..n} (-1)^k * a(k).
; 1,3,2,4,9,5,7,15,8,10,21,11,13,27,14,16,33,17,19,39,20,22,45,23,25,51,26,28,57,29,31,63,32,34,69,35,37,75,38,40,81,41,43,87,44,46,93,47,49,99,50,52,105,53,55,111,56,58,117,59,61,123,62,64,129,65
sub $1,$0
add $0,1
mov $2,9
lpb $0
mod $0,3
pow $0,$2
lpe
sub $0,$1
|
oeis/091/A091055.asm | neoneye/loda-programs | 11 | 23932 | ; A091055: Expansion of x*(1-2*x)/((1-x)*(1+2*x)*(1-6*x)).
; 0,1,3,23,127,783,4655,28015,167919,1007855,6046447,36280047,217677551,1306070767,7836413679,47018503919,282110979823,1692665966319,10155995623151,60935974088431,365615843831535,2193695064387311,13162170383527663,78973022306758383,473838133829365487,2843028802998562543,17058172817946636015,102349036907769294575,614094221446436810479,3684565328678978776815,22107391972073156833007,132644351832440372653807,795866110994639372611311,4775196665967841962290927,28651179995807040320499439
lpb $0
sub $0,1
mov $2,$0
max $2,0
seq $2,141317 ; a(n) = A000244(n) - A010684(n).
add $3,1
add $2,$3
add $3,$2
lpe
mov $0,$3
div $0,2
|
ada-blinky-zfp/src/leds.adb | hfegran/efx32_ada_examples | 0 | 18657 | <reponame>hfegran/efx32_ada_examples
with Leds; use Leds;
with Interfaces.EFM32; use Interfaces.EFM32;
package body Leds is
procedure Led_Init is
begin
CMU_Periph.CTRL.HFPERCLKEN := 1;
CMU_Periph.HFBUSCLKEN0.GPIO := 1;
GPIO_Periph.PA_MODEH.Arr(12) := PUSHPULL;
GPIO_Periph.PA_MODEH.Arr(13) := PUSHPULL;
GPIO_Periph.PA_MODEH.Arr(14) := PUSHPULL;
GPIO_Periph.PD_MODEL.Arr(6) := PUSHPULL;
GPIO_Periph.PF_MODEH.Arr(12) := PUSHPULL;
GPIO_Periph.PE_MODEH.Arr(12) := PUSHPULL;
Led_Set(LED0, Blue);
Led_Set(LED1, Green);
end Led_Init;
procedure GPIO_Set_Pin(Port : Port_Type; Pin : Pin_Type) is
begin
case Port is
when PA =>
GPIO_Periph.PA_DOUT.DOUT := GPIO_Periph.PA_DOUT.DOUT or
Shift_Left(16#0001#, Pin_Type'Pos(Pin));
when PB =>
GPIO_Periph.PB_DOUT.DOUT := GPIO_Periph.PB_DOUT.DOUT or
Shift_Left(16#0001#, Pin_Type'Pos(Pin));
when PC =>
GPIO_Periph.PC_DOUT.DOUT := GPIO_Periph.PC_DOUT.DOUT or
Shift_Left(16#0001#, Pin_Type'Pos(Pin));
when PD =>
GPIO_Periph.PD_DOUT.DOUT := GPIO_Periph.PD_DOUT.DOUT or
Shift_Left(16#0001#, Pin_Type'Pos(Pin));
when PE =>
GPIO_Periph.PE_DOUT.DOUT := GPIO_Periph.PE_DOUT.DOUT or
Shift_Left(16#0001#, Pin_Type'Pos(Pin));
when PF =>
GPIO_Periph.PF_DOUT.DOUT := GPIO_Periph.PF_DOUT.DOUT or
Shift_Left(16#0001#, Pin_Type'Pos(Pin));
end case;
end GPIO_Set_Pin;
procedure GPIO_Clr_Pin(Port : Port_Type; Pin : Pin_Type) is
begin
case Port is
when PA =>
GPIO_Periph.PA_DOUT.DOUT := GPIO_Periph.PA_DOUT.DOUT and
not Shift_Left(16#0001#, Pin_Type'Pos(Pin));
when PB =>
GPIO_Periph.PB_DOUT.DOUT := GPIO_Periph.PB_DOUT.DOUT and
not Shift_Left(16#0001#, Pin_Type'Pos(Pin));
when PC =>
GPIO_Periph.PC_DOUT.DOUT := GPIO_Periph.PC_DOUT.DOUT and
not Shift_Left(16#0001#, Pin_Type'Pos(Pin));
when PD =>
GPIO_Periph.PD_DOUT.DOUT := GPIO_Periph.PD_DOUT.DOUT and
not Shift_Left(16#0001#, Pin_Type'Pos(Pin));
when PE =>
GPIO_Periph.PE_DOUT.DOUT := GPIO_Periph.PE_DOUT.DOUT and
not Shift_Left(16#0001#, Pin_Type'Pos(Pin));
when PF =>
GPIO_Periph.PF_DOUT.DOUT := GPIO_Periph.PF_DOUT.DOUT and
not Shift_Left(16#0001#, Pin_Type'Pos(Pin));
end case;
end GPIO_Clr_Pin;
Procedure GPIO_Tgl_Pin(Port : Port_Type; Pin : Pin_Type) is
begin
case Port is
when PA =>
GPIO_Periph.PA_DOUTTGL.DOUTTGL := Shift_Left(16#0001#, Pin_Type'Pos(Pin));
when PB =>
GPIO_Periph.PB_DOUTTGL.DOUTTGL := Shift_Left(16#0001#, Pin_Type'Pos(Pin));
when PC =>
GPIO_Periph.PC_DOUTTGL.DOUTTGL := Shift_Left(16#0001#, Pin_Type'Pos(Pin));
when PD =>
GPIO_Periph.PD_DOUTTGL.DOUTTGL := Shift_Left(16#0001#, Pin_Type'Pos(Pin));
when PE =>
GPIO_Periph.PE_DOUTTGL.DOUTTGL := Shift_Left(16#0001#, Pin_Type'Pos(Pin));
when PF =>
GPIO_Periph.PF_DOUTTGL.DOUTTGL := Shift_Left(16#0001#, Pin_Type'Pos(Pin));
end case;
end GPIO_Tgl_Pin;
procedure Led_Set (LED : Led_No; Led_Color : Color) is
begin
case Led_Color is
when Blue =>
case LED is
when LED0 =>
GPIO_Set_Pin(PA, P12);
GPIO_Set_Pin(PA, P14);
GPIO_Clr_Pin(PA, P13);
when LED1 =>
GPIO_Set_Pin(PD, P6);
GPIO_Set_Pin(PF, P12);
GPIO_Clr_Pin(PE, P12);
end case;
when Green =>
case LED is
when LED0 =>
GPIO_Set_Pin(PA, P12);
GPIO_Clr_Pin(PA, P14);
GPIO_Set_Pin(PA, P13);
when LED1 =>
GPIO_Set_Pin(PD, P6);
GPIO_Clr_Pin(PF, P12);
GPIO_Set_Pin(PE, P12);
end case;
when Cyan =>
case LED is
when LED0 =>
GPIO_Set_Pin(PA, P12);
GPIO_Clr_Pin(PA, P14);
GPIO_Clr_Pin(PA, P13);
when LED1 =>
GPIO_Set_Pin(PD, P6);
GPIO_Clr_Pin(PF, P12);
GPIO_Clr_Pin(PE, P12);
end case;
when Red =>
case LED is
when LED0 =>
GPIO_Clr_Pin(PA, P12);
GPIO_Set_Pin(PA, P14);
GPIO_Set_Pin(PA, P13);
when LED1 =>
GPIO_Clr_Pin(PD, P6);
GPIO_Set_Pin(PF, P12);
GPIO_Set_Pin(PE, P12);
end case;
when Magenta =>
case LED is
when LED0 =>
GPIO_Clr_Pin(PA, P12);
GPIO_Set_Pin(PA, P14);
GPIO_Clr_Pin(PA, P13);
when LED1 =>
GPIO_Clr_Pin(PD, P6);
GPIO_Set_Pin(PF, P12);
GPIO_Clr_Pin(PE, P12);
end case;
when Yellow =>
case LED is
when LED0 =>
GPIO_Clr_Pin(PA, P12);
GPIO_Clr_Pin(PA, P14);
GPIO_Set_Pin(PA, P13);
when LED1 =>
GPIO_Clr_Pin(PD, P6);
GPIO_Clr_Pin(PF, P12);
GPIO_Set_Pin(PE, P12);
end case;
when White =>
case LED is
when LED0 =>
GPIO_Clr_Pin(PA, P12);
GPIO_Clr_Pin(PA, P14);
GPIO_Clr_Pin(PA, P13);
when LED1 =>
GPIO_Clr_Pin(PD, P6);
GPIO_Clr_Pin(PF, P12);
GPIO_Clr_Pin(PE, P12);
end case;
when Black =>
case LED is
when LED0 =>
GPIO_Set_Pin(PA, P12);
GPIO_Set_Pin(PA, P14);
GPIO_Set_Pin(PA, P13);
when LED1 =>
GPIO_Set_Pin(PD, P6);
GPIO_Set_Pin(PF, P12);
GPIO_Set_Pin(PE, P12);
end case;
end case;
end Led_Set;
procedure Blink(LED: Led_No; Led_Color : Color) is
Iterator : Integer := 0;
begin
Led_Set(LED, Led_Color);
Iterator := 0;
while Iterator < 200000 loop
Iterator := Iterator + 1;
end loop;
Led_Set(LED, Black);
Iterator := 0;
while Iterator < 100000 loop
Iterator := Iterator + 1;
end loop;
end Blink;
end Leds;
|
Tests/yasm-regression/iret.asm | 13xforever/x86-assembly-textmate-bundle | 69 | 240041 | [bits 16]
iret ; out: cf
iretw ; out: cf
iretd ; out: 66 cf
[bits 32]
iret ; out: cf
iretw ; out: 66 cf
iretd ; out: cf
[bits 64]
iret ; out: cf
iretw ; out: 66 cf
iretd ; out: cf
iretq ; out: 48 cf
|
src/presets/14speed_data.asm | cout/sm_practice_hack | 0 | 84676 |
preset_14speed_crateria_ceres_elevator:
dw #$0000
dw $078D, $AB58 ; DDB
dw $079B, $DF45 ; MDB
dw $07F3, $002D ; Music Bank
dw $07F5, $0006 ; Music Track
dw $090F, $0000 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $0000 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0917, $0000 ; Layer 2 X position
dw $0919, $0000 ; Layer 2 Y position
dw $093F, $0000 ; Ceres escape flag
dw $09A2, $0000 ; Equipped Items
dw $09A4, $0000 ; Collected Items
dw $09A6, $0000 ; Beams
dw $09A8, $0000 ; Beams
dw $09C0, $0000 ; Manual/Auto reserve tank
dw $09C2, $0063 ; Health
dw $09C4, $0063 ; Max health
dw $09C6, $0000 ; Missiles
dw $09C8, $0000 ; Max missiles
dw $09CA, $0000 ; Supers
dw $09CC, $0000 ; Max supers
dw $09CE, $0000 ; Pbs
dw $09D0, $0000 ; Max pbs
dw $09D2, $0000 ; Currently selected item
dw $09D4, $0000 ; Max reserves
dw $09D6, $0000 ; Reserves
dw $0A1C, $0000 ; Samus position/state
dw $0A1E, $0000 ; More position/state
dw $0A68, $0000 ; Flash suit
dw $0A76, $0000 ; Hyper beam
dw $0AF6, $0080 ; Samus X
dw $0AF8, $0000 ; Samus subpixel X
dw $0AFA, $0048 ; Samus Y
dw $0AFC, $0000 ; Samus subpixel Y
dw $0B3F, $0000 ; Blue suit
dw $D820, $0000 ; Events
dw $D822, $0000 ; Events
dw $D828, $0000 ; Bosses
dw $D82A, $0000 ; Bosses
dw $D82C, $0000 ; Bosses
dw $D82E, $0000 ; Bosses
dw $D870, $0000 ; Items
dw $D872, $0000 ; Items
dw $D874, $0000 ; Items
dw $D876, $0000 ; Items
dw $D878, $0000 ; Items
dw $D87A, $0000 ; Items
dw $D87C, $0000 ; Items
dw $D87E, $0000 ; Items
dw $D880, $0000 ; Items
dw $D882, $0000 ; Items
dw $D8B0, $0000 ; Doors
dw $D8B2, $0000 ; Doors
dw $D8B4, $0000 ; Doors
dw $D8B6, $0000 ; Doors
dw $D8B8, $0000 ; Doors
dw $D8BA, $0000 ; Doors
dw $D8BC, $0000 ; Doors
dw $D8BE, $0000 ; Doors
dw $D8C0, $0000 ; Doors
dw $D8C2, $0000 ; Doors
dw $D8C4, $0000 ; Doors
dw $D908, $0000 ; Map Stations
dw $D90A, $0000 ; Map Stations
dw $D90C, $0000 ; Map Stations
dw #$FFFF
preset_14speed_crateria_ceres_escape:
dw #preset_14speed_crateria_ceres_elevator ; Crateria: Ceres Elevator
dw $078D, $ABAC ; DDB
dw $079B, $E0B5 ; MDB
dw $07F3, $0024 ; Music Bank
dw $07F5, $0007 ; Music Track
dw $090F, $8000 ; Screen subpixel X position
dw $0913, $9400 ; Screen subpixel Y position
dw $093F, $0002 ; Ceres escape flag
dw $09C2, $0018 ; Health
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $0033 ; Samus X
dw $0AF8, $B000 ; Samus subpixel X
dw $0AFA, $008B ; Samus Y
dw $0AFC, $FFFF ; Samus subpixel Y
dw $D82E, $0001 ; Bosses
dw #$FFFF
preset_14speed_crateria_ceres_last_3_rooms:
dw #preset_14speed_crateria_ceres_escape ; Crateria: Ceres Escape
dw $078D, $ABA0 ; DDB
dw $079B, $E021 ; MDB
dw $090F, $7400 ; Screen subpixel X position
dw $0913, $F000 ; Screen subpixel Y position
dw $0AF6, $004E ; Samus X
dw $0AFA, $00A2 ; Samus Y
dw #$FFFF
preset_14speed_crateria_ship:
dw #preset_14speed_crateria_ceres_last_3_rooms ; Crateria: Ceres Last 3 Rooms
dw $078D, $88FE ; DDB
dw $079B, $91F8 ; MDB
dw $07F3, $0006 ; Music Bank
dw $07F5, $0005 ; Music Track
dw $090F, $8000 ; Screen subpixel X position
dw $0911, $0400 ; Screen X position in pixels
dw $0913, $0000 ; Screen subpixel Y position
dw $0915, $0400 ; Screen Y position in pixels
dw $0917, $0200 ; Layer 2 X position
dw $093F, $0000 ; Ceres escape flag
dw $09C2, $0063 ; Health
dw $0A1C, $0000 ; Samus position/state
dw $0A1E, $0000 ; More position/state
dw $0AF6, $0481 ; Samus X
dw $0AF8, $0000 ; Samus subpixel X
dw $0AFA, $0471 ; Samus Y
dw $0AFC, $8000 ; Samus subpixel Y
dw #$FFFF
preset_14speed_crateria_parlor:
dw #preset_14speed_crateria_ship ; Crateria: Ship
dw $090F, $0000 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $1400 ; Screen subpixel Y position
dw $0915, $0400 ; Screen Y position in pixels
dw $0917, $0000 ; Layer 2 X position
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $0079 ; Samus X
dw $0AFA, $049B ; Samus Y
dw $0AFC, $FFFF ; Samus subpixel Y
dw #$FFFF
preset_14speed_crateria_climb_down:
dw #preset_14speed_crateria_parlor ; Crateria: Parlor
dw $078D, $8916 ; DDB
dw $079B, $92FD ; MDB
dw $0911, $0100 ; Screen X position in pixels
dw $0913, $7BFF ; Screen subpixel Y position
dw $0915, $03F2 ; Screen Y position in pixels
dw $0917, $00C0 ; Layer 2 X position
dw $0919, $02F5 ; Layer 2 Y position
dw $0A1C, $0018 ; Samus position/state
dw $0A1E, $0204 ; More position/state
dw $0AF6, $0199 ; Samus X
dw $0AF8, $8000 ; Samus subpixel X
dw $0AFA, $048A ; Samus Y
dw $0AFC, $0000 ; Samus subpixel Y
dw #$FFFF
preset_14speed_crateria_pit_room:
dw #preset_14speed_crateria_climb_down ; Crateria: Climb Down
dw $078D, $898E ; DDB
dw $079B, $96BA ; MDB
dw $090F, $6FFF ; Screen subpixel X position
dw $0913, $3800 ; Screen subpixel Y position
dw $0915, $0800 ; Screen Y position in pixels
dw $0919, $0600 ; Layer 2 Y position
dw $0A1C, $0001 ; Samus position/state
dw $0A1E, $0008 ; More position/state
dw $0AF6, $01DB ; Samus X
dw $0AF8, $FFFF ; Samus subpixel X
dw $0AFA, $088B ; Samus Y
dw $0AFC, $FFFF ; Samus subpixel Y
dw #$FFFF
preset_14speed_crateria_morph:
dw #preset_14speed_crateria_pit_room ; Crateria: Pit Room
dw $078D, $8B9E ; DDB
dw $079B, $9E9F ; MDB
dw $07F5, $0007 ; Music Track
dw $090F, $6000 ; Screen subpixel X position
dw $0911, $0500 ; Screen X position in pixels
dw $0913, $0000 ; Screen subpixel Y position
dw $0915, $0200 ; Screen Y position in pixels
dw $0917, $03C0 ; Layer 2 X position
dw $0919, $0180 ; Layer 2 Y position
dw $0A1C, $0000 ; Samus position/state
dw $0A1E, $0000 ; More position/state
dw $0AF6, $0580 ; Samus X
dw $0AFA, $02A8 ; Samus Y
dw #$FFFF
preset_14speed_crateria_construction_zone_down:
dw #preset_14speed_crateria_morph ; Crateria: Morph
dw $090F, $2000 ; Screen subpixel X position
dw $0911, $0700 ; Screen X position in pixels
dw $0913, $E400 ; Screen subpixel Y position
dw $0917, $0540 ; Layer 2 X position
dw $09A2, $0004 ; Equipped Items
dw $09A4, $0004 ; Collected Items
dw $0A1C, $0001 ; Samus position/state
dw $0A1E, $0008 ; More position/state
dw $0AF6, $07AC ; Samus X
dw $0AFA, $028B ; Samus Y
dw $D872, $0400 ; Items
dw #$FFFF
preset_14speed_crateria_construction_zone_up:
dw #preset_14speed_crateria_construction_zone_down ; Crateria: Construction Zone Down
dw $078D, $8EDA ; DDB
dw $079B, $A107 ; MDB
dw $090F, $D000 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $6800 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0917, $0001 ; Layer 2 X position
dw $0919, $0000 ; Layer 2 Y position
dw $09C6, $0005 ; Missiles
dw $09C8, $0005 ; Max missiles
dw $0AF6, $0055 ; Samus X
dw $0AFA, $008B ; Samus Y
dw $D874, $0004 ; Items
dw #$FFFF
preset_14speed_crateria_pit_room_revisit:
dw #preset_14speed_crateria_construction_zone_up ; Crateria: Construction Zone Up
dw $078D, $8EB6 ; DDB
dw $079B, $97B5 ; MDB
dw $07F5, $0003 ; Music Track
dw $090F, $0000 ; Screen subpixel X position
dw $0913, $0000 ; Screen subpixel Y position
dw $0917, $0000 ; Layer 2 X position
dw $0A1C, $0000 ; Samus position/state
dw $0A1E, $0000 ; More position/state
dw $0AF6, $0080 ; Samus X
dw $0AFA, $0088 ; Samus Y
dw #$FFFF
preset_14speed_crateria_climb_up:
dw #preset_14speed_crateria_pit_room_revisit ; Crateria: Pit Room Revisit
dw $078D, $8B92 ; DDB
dw $079B, $975C ; MDB
dw $07F3, $0009 ; Music Bank
dw $07F5, $0005 ; Music Track
dw $090F, $4000 ; Screen subpixel X position
dw $0913, $CC00 ; Screen subpixel Y position
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $0083 ; Samus X
dw $0AFA, $008B ; Samus Y
dw $D820, $0001 ; Events
dw $D8B2, $0400 ; Doors
dw #$FFFF
preset_14speed_crateria_parlor_revisit:
dw #preset_14speed_crateria_climb_up ; Crateria: Climb Up
dw $078D, $8B7A ; DDB
dw $079B, $96BA ; MDB
dw $090F, $0000 ; Screen subpixel X position
dw $0911, $0100 ; Screen X position in pixels
dw $0913, $C000 ; Screen subpixel Y position
dw $0917, $00C0 ; Layer 2 X position
dw $0AF6, $01A0 ; Samus X
dw $0AFA, $005B ; Samus Y
dw #$FFFF
preset_14speed_crateria_flyway:
dw #preset_14speed_crateria_parlor_revisit ; Crateria: Parlor Revisit
dw $078D, $8B3E ; DDB
dw $079B, $92FD ; MDB
dw $090F, $C000 ; Screen subpixel X position
dw $0911, $0300 ; Screen X position in pixels
dw $0913, $2BFF ; Screen subpixel Y position
dw $0915, $01E6 ; Screen Y position in pixels
dw $0917, $0240 ; Layer 2 X position
dw $0919, $016C ; Layer 2 Y position
dw $09D2, $0001 ; Currently selected item
dw $0A1C, $0001 ; Samus position/state
dw $0A1E, $0008 ; More position/state
dw $0AF6, $0369 ; Samus X
dw $0AFA, $026B ; Samus Y
dw #$FFFF
preset_14speed_crateria_bomb_torizo:
dw #preset_14speed_crateria_flyway ; Crateria: Flyway
dw $078D, $8982 ; DDB
dw $079B, $9879 ; MDB
dw $090F, $4000 ; Screen subpixel X position
dw $0911, $0200 ; Screen X position in pixels
dw $0913, $D000 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0917, $0180 ; Layer 2 X position
dw $0919, $0000 ; Layer 2 Y position
dw $09C6, $0000 ; Missiles
dw $09D2, $0000 ; Currently selected item
dw $0AF6, $02BE ; Samus X
dw $0AFA, $008B ; Samus Y
dw $D8B2, $2400 ; Doors
dw #$FFFF
preset_14speed_crateria_alcatraz:
dw #preset_14speed_crateria_bomb_torizo ; Crateria: Bomb Torizo
dw $078D, $8BAA ; DDB
dw $090F, $2001 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0917, $0000 ; Layer 2 X position
dw $09A2, $1004 ; Equipped Items
dw $09A4, $1004 ; Collected Items
dw $09C6, $0005 ; Missiles
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $0040 ; Samus X
dw $D828, $0004 ; Bosses
dw $D870, $0080 ; Items
dw $D8B2, $2C00 ; Doors
dw #$FFFF
preset_14speed_crateria_terminator:
dw #preset_14speed_crateria_alcatraz ; Crateria: Alcatraz
dw $078D, $8BB6 ; DDB
dw $079B, $92FD ; MDB
dw $090F, $6000 ; Screen subpixel X position
dw $0911, $0100 ; Screen X position in pixels
dw $0913, $5800 ; Screen subpixel Y position
dw $0917, $00C0 ; Layer 2 X position
dw $0A1C, $0041 ; Samus position/state
dw $0A1E, $0404 ; More position/state
dw $0AF6, $0115 ; Samus X
dw $0AFA, $0099 ; Samus Y
dw #$FFFF
preset_14speed_crateria_green_pirate_shaft:
dw #preset_14speed_crateria_terminator ; Crateria: Terminator
dw $078D, $895E ; DDB
dw $079B, $990D ; MDB
dw $090F, $9F00 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $0000 ; Screen subpixel Y position
dw $0915, $01FC ; Screen Y position in pixels
dw $0917, $0000 ; Layer 2 X position
dw $0919, $017D ; Layer 2 Y position
dw $09C2, $00C7 ; Health
dw $09C4, $00C7 ; Max health
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $0063 ; Samus X
dw $0AFA, $029B ; Samus Y
dw $D870, $0180 ; Items
dw #$FFFF
preset_14speed_brinstar_green_brinstar_elevator:
dw #preset_14speed_crateria_green_pirate_shaft ; Crateria: Green Pirate Shaft
dw $078D, $8C22 ; DDB
dw $079B, $9938 ; MDB
dw $07F5, $0003 ; Music Track
dw $090F, $4000 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $A800 ; Screen subpixel Y position
dw $0919, $0000 ; Layer 2 Y position
dw $09C2, $00C7 ; Health
dw $09C4, $00C7 ; Max health
dw $09C6, $0002 ; Missiles
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $0082 ; Samus X
dw $0AFA, $008B ; Samus Y
dw $D870, $0180 ; Items
dw #$FFFF
preset_14speed_brinstar_big_pink:
dw #preset_14speed_brinstar_green_brinstar_elevator ; Brinstar: Green Brinstar Elevator
dw $078D, $8CE2 ; DDB
dw $079B, $9CB3 ; MDB
dw $07F3, $000F ; Music Bank
dw $07F5, $0005 ; Music Track
dw $090F, $6000 ; Screen subpixel X position
dw $0911, $0600 ; Screen X position in pixels
dw $0913, $C000 ; Screen subpixel Y position
dw $0917, $0480 ; Layer 2 X position
dw $09C6, $0000 ; Missiles
dw $09CA, $0004 ; Supers
dw $09CC, $0005 ; Max supers
dw $0A1C, $0001 ; Samus position/state
dw $0A1E, $0008 ; More position/state
dw $0AF6, $06AD ; Samus X
dw $D872, $0401 ; Items
dw $D8B4, $0006 ; Doors
dw #$FFFF
preset_14speed_brinstar_red_tower:
dw #preset_14speed_brinstar_big_pink ; Brinstar: Big Pink
dw $078D, $8E92 ; DDB
dw $079B, $9FBA ; MDB
dw $090F, $3000 ; Screen subpixel X position
dw $0911, $0500 ; Screen X position in pixels
dw $0913, $E800 ; Screen subpixel Y position
dw $0917, $03C0 ; Layer 2 X position
dw $09A6, $1000 ; Beams
dw $09A8, $1000 ; Beams
dw $0AF6, $05C1 ; Samus X
dw $D872, $0481 ; Items
dw $D8B4, $0206 ; Doors
dw $D8B6, $0008 ; Doors
dw #$FFFF
preset_14speed_brinstar_hellway:
dw #preset_14speed_brinstar_red_tower ; Brinstar: Red Tower
dw $078D, $8F0A ; DDB
dw $079B, $A253 ; MDB
dw $07F3, $0012 ; Music Bank
dw $090F, $5FFF ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $A400 ; Screen subpixel Y position
dw $0915, $000B ; Screen Y position in pixels
dw $0917, $0000 ; Layer 2 X position
dw $0919, $0008 ; Layer 2 Y position
dw $0AF6, $0098 ; Samus X
dw #$FFFF
preset_14speed_brinstar_caterpillar_room:
dw #preset_14speed_brinstar_hellway ; Brinstar: Hellway
dw $078D, $901E ; DDB
dw $079B, $A2F7 ; MDB
dw $090F, $D000 ; Screen subpixel X position
dw $0911, $0200 ; Screen X position in pixels
dw $0913, $4400 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0917, $0180 ; Layer 2 X position
dw $0919, $0000 ; Layer 2 Y position
dw $09C2, $00B7 ; Health
dw $09C6, $0002 ; Missiles
dw $0AF6, $0298 ; Samus X
dw #$FFFF
preset_14speed_brinstar_leaving_power_bombs:
dw #preset_14speed_brinstar_caterpillar_room ; Brinstar: Caterpillar Room
dw $078D, $9096 ; DDB
dw $079B, $A3AE ; MDB
dw $07F5, $0003 ; Music Track
dw $090F, $0001 ; Screen subpixel X position
dw $0911, $0100 ; Screen X position in pixels
dw $0913, $0C00 ; Screen subpixel Y position
dw $0917, $00C0 ; Layer 2 X position
dw $09C2, $00AD ; Health
dw $09CA, $0003 ; Supers
dw $09CE, $0005 ; Pbs
dw $09D0, $0005 ; Max pbs
dw $09D2, $0003 ; Currently selected item
dw $0AF6, $0157 ; Samus X
dw $0AFA, $00AB ; Samus Y
dw $D874, $0104 ; Items
dw $D8B6, $2008 ; Doors
dw #$FFFF
preset_14speed_brinstar_kihunter_room:
dw #preset_14speed_brinstar_leaving_power_bombs ; Brinstar: Leaving Power Bombs
dw $078D, $90BA ; DDB
dw $079B, $962A ; MDB
dw $090F, $C000 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $5000 ; Screen subpixel Y position
dw $0917, $0000 ; Layer 2 X position
dw $09C2, $009E ; Health
dw $09CA, $0005 ; Supers
dw $09CE, $0003 ; Pbs
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $008A ; Samus X
dw $0AFA, $005B ; Samus Y
dw $D8B2, $2C01 ; Doors
dw $D8B6, $3008 ; Doors
dw #$FFFF
preset_14speed_brinstar_moat:
dw #preset_14speed_brinstar_kihunter_room ; Brinstar: Kihunter Room
dw $078D, $8AF6 ; DDB
dw $079B, $948C ; MDB
dw $07F5, $0005 ; Music Track
dw $090F, $5C00 ; Screen subpixel X position
dw $0911, $0200 ; Screen X position in pixels
dw $0913, $4800 ; Screen subpixel Y position
dw $0917, $0180 ; Layer 2 X position
dw $09CE, $0001 ; Pbs
dw $0A1C, $0001 ; Samus position/state
dw $0A1E, $0008 ; More position/state
dw $0AF6, $02DB ; Samus X
dw $0AFA, $008B ; Samus Y
dw $D8B0, $6000 ; Doors
dw #$FFFF
preset_14speed_brinstar_ocean:
dw #preset_14speed_brinstar_moat ; Brinstar: Moat
dw $078D, $8A36 ; DDB
dw $079B, $95FF ; MDB
dw $090F, $2000 ; Screen subpixel X position
dw $0911, $0100 ; Screen X position in pixels
dw $0913, $0000 ; Screen subpixel Y position
dw $0917, $00C0 ; Layer 2 X position
dw $09C6, $0007 ; Missiles
dw $09C8, $000A ; Max missiles
dw $09D2, $0000 ; Currently selected item
dw $0AF6, $01A1 ; Samus X
dw $D870, $0190 ; Items
dw #$FFFF
preset_14speed_wrecked_ship_wrecked_ship_shaft:
dw #preset_14speed_brinstar_ocean ; Brinstar: Ocean
dw $078D, $89D6 ; DDB
dw $079B, $CA08 ; MDB
dw $07F3, $0030 ; Music Bank
dw $090F, $0000 ; Screen subpixel X position
dw $0911, $02D8 ; Screen X position in pixels
dw $0917, $0222 ; Layer 2 X position
dw $09CA, $0004 ; Supers
dw $0AF6, $0338 ; Samus X
dw $D8B0, $7000 ; Doors
dw #$FFFF
preset_14speed_wrecked_ship_phantoon:
dw #preset_14speed_wrecked_ship_wrecked_ship_shaft ; Wrecked Ship: Wrecked Ship Shaft
dw $078D, $A21C ; DDB
dw $079B, $CC6F ; MDB
dw $090F, $F000 ; Screen subpixel X position
dw $0911, $0400 ; Screen X position in pixels
dw $0913, $7400 ; Screen subpixel Y position
dw $0917, $0300 ; Layer 2 X position
dw $09CA, $0002 ; Supers
dw $0AF6, $04CF ; Samus X
dw $D8C0, $0030 ; Doors
dw #$FFFF
preset_14speed_wrecked_ship_wrecked_ship_supers:
dw #preset_14speed_wrecked_ship_phantoon ; Wrecked Ship: Phantoon
dw $078D, $A2C4 ; DDB
dw $07F5, $0006 ; Music Track
dw $090F, $0000 ; Screen subpixel X position
dw $0911, $0229 ; Screen X position in pixels
dw $0913, $AC00 ; Screen subpixel Y position
dw $0917, $019E ; Layer 2 X position
dw $09C2, $00C7 ; Health
dw $09C6, $000A ; Missiles
dw $09CA, $0005 ; Supers
dw $09CE, $0002 ; Pbs
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $02C9 ; Samus X
dw $0AFA, $006B ; Samus Y
dw $D82A, $0100 ; Bosses
dw $D8C0, $0070 ; Doors
dw #$FFFF
preset_14speed_wrecked_ship_shaft_revisit:
dw #preset_14speed_wrecked_ship_wrecked_ship_supers ; Wrecked Ship: Wrecked Ship Supers
dw $078D, $A210 ; DDB
dw $079B, $CDA8 ; MDB
dw $090F, $7000 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $4800 ; Screen subpixel Y position
dw $0917, $0000 ; Layer 2 X position
dw $09CA, $000A ; Supers
dw $09CC, $000A ; Max supers
dw $09CE, $0001 ; Pbs
dw $0A1C, $0001 ; Samus position/state
dw $0A1E, $0008 ; More position/state
dw $0AF6, $00C4 ; Samus X
dw $0AFA, $008B ; Samus Y
dw $D880, $0020 ; Items
dw $D8C0, $0074 ; Doors
dw #$FFFF
preset_14speed_wrecked_ship_attic:
dw #preset_14speed_wrecked_ship_shaft_revisit ; Wrecked Ship: Shaft Revisit
dw $078D, $A2E8 ; DDB
dw $079B, $CAF6 ; MDB
dw $090F, $E000 ; Screen subpixel X position
dw $0911, $0400 ; Screen X position in pixels
dw $0913, $B000 ; Screen subpixel Y position
dw $0917, $0300 ; Layer 2 X position
dw $0AF6, $044D ; Samus X
dw $0AFA, $006B ; Samus Y
dw #$FFFF
preset_14speed_wrecked_ship_bowling_alley_path:
dw #preset_14speed_wrecked_ship_attic ; Wrecked Ship: Attic
dw $078D, $A1E0 ; DDB
dw $079B, $93FE ; MDB
dw $07F3, $000C ; Music Bank
dw $07F5, $0005 ; Music Track
dw $090F, $B000 ; Screen subpixel X position
dw $0911, $0200 ; Screen X position in pixels
dw $0913, $1800 ; Screen subpixel Y position
dw $0915, $0202 ; Screen Y position in pixels
dw $0917, $0100 ; Layer 2 X position
dw $09C6, $0002 ; Missiles
dw $09CA, $0009 ; Supers
dw $09CE, $0000 ; Pbs
dw $0AF6, $02C6 ; Samus X
dw $0AFA, $028B ; Samus Y
dw $D8C0, $0174 ; Doors
dw #$FFFF
preset_14speed_wrecked_ship_bowling_alley:
dw #preset_14speed_wrecked_ship_bowling_alley_path ; Wrecked Ship: Bowling Alley Path
dw $078D, $8A1E ; DDB
dw $079B, $968F ; MDB
dw $090F, $3800 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $BC00 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0917, $0000 ; Layer 2 X position
dw $09C2, $00BD ; Health
dw $0AF6, $002E ; Samus X
dw $0AFA, $008B ; Samus Y
dw #$FFFF
preset_14speed_wrecked_ship_leaving_gravity:
dw #preset_14speed_wrecked_ship_bowling_alley ; Wrecked Ship: Bowling Alley
dw $078D, $A1A4 ; DDB
dw $079B, $CE40 ; MDB
dw $07F3, $0030 ; Music Bank
dw $07F5, $0003 ; Music Track
dw $090F, $3000 ; Screen subpixel X position
dw $0913, $5800 ; Screen subpixel Y position
dw $0917, $0001 ; Layer 2 X position
dw $09A2, $1024 ; Equipped Items
dw $09A4, $1024 ; Collected Items
dw $09C2, $0045 ; Health
dw $0A1C, $009B ; Samus position/state
dw $0A1E, $0000 ; More position/state
dw $0AF6, $0078 ; Samus X
dw $0AFA, $0088 ; Samus Y
dw $D880, $00A0 ; Items
dw #$FFFF
preset_14speed_brinstar_revisit_red_tower_elevator:
dw #preset_14speed_wrecked_ship_leaving_gravity ; Wrecked Ship: Leaving Gravity
dw $078D, $8B02 ; DDB
dw $079B, $A322 ; MDB
dw $07F3, $0012 ; Music Bank
dw $07F5, $0005 ; Music Track
dw $0913, $0000 ; Screen subpixel Y position
dw $0915, $0238 ; Screen Y position in pixels
dw $0917, $0000 ; Layer 2 X position
dw $0919, $0238 ; Layer 2 Y position
dw $09C2, $0043 ; Health
dw $09C6, $0000 ; Missiles
dw $09CE, $0002 ; Pbs
dw $0AF6, $0080 ; Samus X
dw $0AFA, $02A8 ; Samus Y
dw #$FFFF
preset_14speed_brinstar_revisit_breaking_tube:
dw #preset_14speed_brinstar_revisit_red_tower_elevator ; Brinstar Revisit: Red Tower Elevator
dw $078D, $911A ; DDB
dw $079B, $CF54 ; MDB
dw $090F, $C000 ; Screen subpixel X position
dw $0913, $5C00 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0919, $0000 ; Layer 2 Y position
dw $09C2, $0052 ; Health
dw $09C6, $0008 ; Missiles
dw $09CA, $000A ; Supers
dw $09D2, $0003 ; Currently selected item
dw $0A1C, $0001 ; Samus position/state
dw $0A1E, $0008 ; More position/state
dw $0AF6, $002C ; Samus X
dw $0AFA, $008B ; Samus Y
dw #$FFFF
preset_14speed_brinstar_revisit_entering_kraids_lair:
dw #preset_14speed_brinstar_revisit_breaking_tube ; Brinstar Revisit: Breaking Tube
dw $078D, $A348 ; DDB
dw $079B, $CF80 ; MDB
dw $090F, $5000 ; Screen subpixel X position
dw $0913, $1801 ; Screen subpixel Y position
dw $0915, $0100 ; Screen Y position in pixels
dw $0919, $0100 ; Layer 2 Y position
dw $09CE, $0001 ; Pbs
dw $09D2, $0000 ; Currently selected item
dw $0AF6, $002E ; Samus X
dw $0AFA, $018B ; Samus Y
dw $D820, $0801 ; Events
dw #$FFFF
preset_14speed_brinstar_revisit_baby_kraid_entering:
dw #preset_14speed_brinstar_revisit_entering_kraids_lair ; Brinstar Revisit: Entering Kraids Lair
dw $078D, $9156 ; DDB
dw $079B, $A4DA ; MDB
dw $090F, $3000 ; Screen subpixel X position
dw $0911, $0100 ; Screen X position in pixels
dw $0913, $DC00 ; Screen subpixel Y position
dw $0917, $00C0 ; Layer 2 X position
dw $09CA, $0007 ; Supers
dw $0AF6, $0171 ; Samus X
dw #$FFFF
preset_14speed_brinstar_revisit_kraid:
dw #preset_14speed_brinstar_revisit_baby_kraid_entering ; Brinstar Revisit: Baby Kraid (Entering)
dw $078D, $919E ; DDB
dw $079B, $A56B ; MDB
dw $07F3, $0027 ; Music Bank
dw $07F5, $0006 ; Music Track
dw $090F, $5000 ; Screen subpixel X position
dw $0913, $3800 ; Screen subpixel Y position
dw $0917, $0100 ; Layer 2 X position
dw $09C2, $004D ; Health
dw $09C6, $0005 ; Missiles
dw $09CA, $0009 ; Supers
dw $0AF6, $01C8 ; Samus X
dw $D8B8, $0024 ; Doors
dw #$FFFF
preset_14speed_brinstar_revisit_baby_kraid_exiting:
dw #preset_14speed_brinstar_revisit_kraid ; Brinstar Revisit: Kraid
dw $078D, $91CE ; DDB
dw $07F5, $0003 ; Music Track
dw $090F, $8000 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $A800 ; Screen subpixel Y position
dw $0917, $0000 ; Layer 2 X position
dw $09A2, $1025 ; Equipped Items
dw $09A4, $1025 ; Collected Items
dw $09C2, $008A ; Health
dw $09C6, $000A ; Missiles
dw $09CA, $0007 ; Supers
dw $09CE, $0004 ; Pbs
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $005F ; Samus X
dw $D828, $0104 ; Bosses
dw $D876, $0001 ; Items
dw $D8B8, $00E4 ; Doors
dw #$FFFF
preset_14speed_brinstar_revisit_kraid_etank:
dw #preset_14speed_brinstar_revisit_baby_kraid_exiting ; Brinstar Revisit: Baby Kraid (Exiting)
dw $078D, $916E ; DDB
dw $079B, $A471 ; MDB
dw $07F3, $0012 ; Music Bank
dw $07F5, $0005 ; Music Track
dw $090F, $4000 ; Screen subpixel X position
dw $0913, $CC00 ; Screen subpixel Y position
dw $09C2, $0085 ; Health
dw $09CA, $000A ; Supers
dw $09CE, $0002 ; Pbs
dw $0AF6, $0056 ; Samus X
dw $D8B8, $00ED ; Doors
dw #$FFFF
preset_14speed_upper_norfair_precathedral:
dw #preset_14speed_brinstar_revisit_kraid_etank ; Brinstar Revisit: Kraid E-tank
dw $078D, $9246 ; DDB
dw $079B, $A7DE ; MDB
dw $07F3, $0015 ; Music Bank
dw $090F, $8000 ; Screen subpixel X position
dw $0913, $0000 ; Screen subpixel Y position
dw $0915, $0238 ; Screen Y position in pixels
dw $0919, $01AA ; Layer 2 Y position
dw $09C2, $012B ; Health
dw $09C4, $012B ; Max health
dw $09CA, $0009 ; Supers
dw $09CE, $0005 ; Pbs
dw $0A1C, $009B ; Samus position/state
dw $0A1E, $0000 ; More position/state
dw $0AF6, $0080 ; Samus X
dw $0AFA, $02A8 ; Samus Y
dw $D874, $0904 ; Items
dw $D8B8, $00EF ; Doors
dw #$FFFF
preset_14speed_upper_norfair_bubble_mountain:
dw #preset_14speed_upper_norfair_precathedral ; Upper Norfair: Pre-Cathedral
dw $078D, $929A ; DDB
dw $079B, $AFA3 ; MDB
dw $090F, $0000 ; Screen subpixel X position
dw $0911, $0400 ; Screen X position in pixels
dw $0913, $F400 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0917, $0300 ; Layer 2 X position
dw $0919, $0000 ; Layer 2 Y position
dw $09C2, $0120 ; Health
dw $09C6, $0009 ; Missiles
dw $09CA, $0007 ; Supers
dw $0A1C, $0001 ; Samus position/state
dw $0A1E, $0008 ; More position/state
dw $0AF6, $04B5 ; Samus X
dw $0AFA, $008B ; Samus Y
dw $D8B8, $06EF ; Doors
dw #$FFFF
preset_14speed_upper_norfair_bubble_mountain_revisit:
dw #preset_14speed_upper_norfair_bubble_mountain ; Upper Norfair: Bubble Mountain
dw $078D, $95A6 ; DDB
dw $079B, $B07A ; MDB
dw $090F, $8001 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $FC00 ; Screen subpixel Y position
dw $0915, $0100 ; Screen Y position in pixels
dw $0917, $0000 ; Layer 2 X position
dw $0919, $0100 ; Layer 2 Y position
dw $09A2, $3025 ; Equipped Items
dw $09A4, $3025 ; Collected Items
dw $09C2, $0129 ; Health
dw $09C6, $000A ; Missiles
dw $09CA, $000A ; Supers
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $0041 ; Samus X
dw $0AFA, $018B ; Samus Y
dw $D822, $0020 ; Events
dw $D878, $0004 ; Items
dw $D8BA, $0030 ; Doors
dw #$FFFF
preset_14speed_upper_norfair_magdollite_room:
dw #preset_14speed_upper_norfair_bubble_mountain_revisit ; Upper Norfair: Bubble Mountain Revisit
dw $078D, $9576 ; DDB
dw $079B, $AEDF ; MDB
dw $090F, $D000 ; Screen subpixel X position
dw $0913, $0000 ; Screen subpixel Y position
dw $0915, $01F5 ; Screen Y position in pixels
dw $0919, $0177 ; Layer 2 Y position
dw $09CE, $0004 ; Pbs
dw $0A1C, $0001 ; Samus position/state
dw $0A1E, $0008 ; More position/state
dw $0AF6, $0059 ; Samus X
dw $0AFA, $028B ; Samus Y
dw #$FFFF
preset_14speed_upper_norfair_lava_spark:
dw #preset_14speed_upper_norfair_magdollite_room ; Upper Norfair: Magdollite Room
dw $078D, $96A2 ; DDB
dw $079B, $AE74 ; MDB
dw $090F, $5000 ; Screen subpixel X position
dw $0911, $0100 ; Screen X position in pixels
dw $0913, $C400 ; Screen subpixel Y position
dw $0915, $0200 ; Screen Y position in pixels
dw $0917, $0100 ; Layer 2 X position
dw $0919, $0200 ; Layer 2 Y position
dw $09C2, $012B ; Health
dw $09C6, $0008 ; Missiles
dw $09CE, $0005 ; Pbs
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $01EB ; Samus X
dw $D8BA, $0130 ; Doors
dw #$FFFF
preset_14speed_lower_norfair_ln_main_hall:
dw #preset_14speed_upper_norfair_lava_spark ; Upper Norfair: Lava Spark
dw $078D, $96F6 ; DDB
dw $079B, $B236 ; MDB
dw $07F3, $0018 ; Music Bank
dw $090F, $B000 ; Screen subpixel X position
dw $0911, $0400 ; Screen X position in pixels
dw $0913, $0000 ; Screen subpixel Y position
dw $0917, $0300 ; Layer 2 X position
dw $0919, $0301 ; Layer 2 Y position
dw $09C2, $00D7 ; Health
dw $09D2, $0003 ; Currently selected item
dw $0A1C, $009B ; Samus position/state
dw $0A1E, $0000 ; More position/state
dw $0AF6, $0480 ; Samus X
dw $0AFA, $0288 ; Samus Y
dw #$FFFF
preset_14speed_lower_norfair_pillars:
dw #preset_14speed_lower_norfair_ln_main_hall ; Lower Norfair: LN Main Hall
dw $078D, $985E ; DDB
dw $079B, $B3A5 ; MDB
dw $090F, $5700 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $4000 ; Screen subpixel Y position
dw $0917, $0000 ; Layer 2 X position
dw $0919, $0180 ; Layer 2 Y position
dw $09C2, $00DC ; Health
dw $0A1C, $0001 ; Samus position/state
dw $0A1E, $0008 ; More position/state
dw $0AF6, $0025 ; Samus X
dw $0AFA, $028B ; Samus Y
dw #$FFFF
preset_14speed_lower_norfair_worst_room:
dw #preset_14speed_lower_norfair_pillars ; Lower Norfair: Pillars
dw $078D, $9912 ; DDB
dw $079B, $B457 ; MDB
dw $090F, $037F ; Screen subpixel X position
dw $0911, $0300 ; Screen X position in pixels
dw $0913, $9C00 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0917, $0240 ; Layer 2 X position
dw $0919, $0000 ; Layer 2 Y position
dw $09C2, $0092 ; Health
dw $0AF6, $03DB ; Samus X
dw $0AFA, $008B ; Samus Y
dw #$FFFF
preset_14speed_lower_norfair_amphitheatre:
dw #preset_14speed_lower_norfair_worst_room ; Lower Norfair: Worst Room
dw $078D, $994E ; DDB
dw $079B, $B4AD ; MDB
dw $090F, $1FFF ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $1C00 ; Screen subpixel Y position
dw $0915, $011F ; Screen Y position in pixels
dw $0917, $0000 ; Layer 2 X position
dw $0919, $00D7 ; Layer 2 Y position
dw $09C6, $0005 ; Missiles
dw $09CA, $0006 ; Supers
dw $09CE, $0004 ; Pbs
dw $09D2, $0000 ; Currently selected item
dw $0AF6, $00B3 ; Samus X
dw $0AFA, $018B ; Samus Y
dw #$FFFF
preset_14speed_lower_norfair_kihunter_stairs:
dw #preset_14speed_lower_norfair_amphitheatre ; Lower Norfair: Amphitheatre
dw $078D, $997E ; DDB
dw $079B, $B4E5 ; MDB
dw $090F, $0000 ; Screen subpixel X position
dw $0911, $0244 ; Screen X position in pixels
dw $0913, $0000 ; Screen subpixel Y position
dw $0915, $0043 ; Screen Y position in pixels
dw $0917, $01B3 ; Layer 2 X position
dw $0919, $0032 ; Layer 2 Y position
dw $0AF6, $02E4 ; Samus X
dw $0AFA, $00B3 ; Samus Y
dw #$FFFF
preset_14speed_lower_norfair_wasteland:
dw #preset_14speed_lower_norfair_kihunter_stairs ; Lower Norfair: Kihunter Stairs
dw $078D, $99A2 ; DDB
dw $079B, $B585 ; MDB
dw $090F, $E000 ; Screen subpixel X position
dw $0911, $0200 ; Screen X position in pixels
dw $0913, $9000 ; Screen subpixel Y position
dw $0915, $0419 ; Screen Y position in pixels
dw $0917, $0180 ; Layer 2 X position
dw $0919, $0312 ; Layer 2 Y position
dw $09C2, $00B7 ; Health
dw $09CE, $0002 ; Pbs
dw $0A1C, $001D ; Samus position/state
dw $0A1E, $0408 ; More position/state
dw $0AF6, $0247 ; Samus X
dw $0AFA, $0489 ; Samus Y
dw $D8BA, $4130 ; Doors
dw #$FFFF
preset_14speed_lower_norfair_metal_pirates:
dw #preset_14speed_lower_norfair_wasteland ; Lower Norfair: Wasteland
dw $078D, $99EA ; DDB
dw $079B, $B5D5 ; MDB
dw $090F, $DFFF ; Screen subpixel X position
dw $0911, $0100 ; Screen X position in pixels
dw $0913, $0000 ; Screen subpixel Y position
dw $0915, $021F ; Screen Y position in pixels
dw $0917, $00C0 ; Layer 2 X position
dw $0919, $0197 ; Layer 2 Y position
dw $09C2, $00A1 ; Health
dw $09CA, $0005 ; Supers
dw $09CE, $0001 ; Pbs
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $0162 ; Samus X
dw $0AFA, $028B ; Samus Y
dw $D8BA, $C130 ; Doors
dw #$FFFF
preset_14speed_lower_norfair_ridley_farming_room:
dw #preset_14speed_lower_norfair_metal_pirates ; Lower Norfair: Metal Pirates
dw $078D, $9A32 ; DDB
dw $079B, $B482 ; MDB
dw $090F, $5000 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $4400 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0917, $0000 ; Layer 2 X position
dw $0919, $0000 ; Layer 2 Y position
dw $09C2, $00F4 ; Health
dw $09C6, $000A ; Missiles
dw $09CA, $000A ; Supers
dw $0AF6, $004D ; Samus X
dw $0AFA, $008B ; Samus Y
dw $D8BC, $0001 ; Doors
dw #$FFFF
preset_14speed_lower_norfair_ridley:
dw #preset_14speed_lower_norfair_ridley_farming_room ; Lower Norfair: Ridley Farming Room
dw $078D, $995A ; DDB
dw $079B, $B37A ; MDB
dw $090F, $8000 ; Screen subpixel X position
dw $0913, $7400 ; Screen subpixel Y position
dw $09C2, $012B ; Health
dw $09CE, $0005 ; Pbs
dw $0AF6, $003F ; Samus X
dw $0AFA, $009B ; Samus Y
dw $D8BA, $D130 ; Doors
dw #$FFFF
preset_14speed_lower_norfair_leaving_ridley:
dw #preset_14speed_lower_norfair_ridley ; Lower Norfair: Ridley
dw $078D, $9A62 ; DDB
dw $079B, $B32E ; MDB
dw $07F3, $0024 ; Music Bank
dw $07F5, $0003 ; Music Track
dw $090F, $1000 ; Screen subpixel X position
dw $0913, $1800 ; Screen subpixel Y position
dw $0915, $011C ; Screen Y position in pixels
dw $0917, $0001 ; Layer 2 X position
dw $0919, $00D5 ; Layer 2 Y position
dw $09C2, $018F ; Health
dw $09C4, $018F ; Max health
dw $09C6, $0006 ; Missiles
dw $09CA, $0006 ; Supers
dw $09CE, $0002 ; Pbs
dw $0A1C, $0001 ; Samus position/state
dw $0A1E, $0008 ; More position/state
dw $0AF6, $0042 ; Samus X
dw $0AFA, $019B ; Samus Y
dw $D82A, $0101 ; Bosses
dw $D878, $4004 ; Items
dw $D8BA, $D930 ; Doors
dw #$FFFF
preset_14speed_lower_norfair_wasteland_revisit:
dw #preset_14speed_lower_norfair_leaving_ridley ; Lower Norfair: Leaving Ridley
dw $078D, $9966 ; DDB
dw $079B, $B62B ; MDB
dw $07F3, $0018 ; Music Bank
dw $07F5, $0005 ; Music Track
dw $090F, $2000 ; Screen subpixel X position
dw $0911, $0200 ; Screen X position in pixels
dw $0913, $9C00 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0917, $0180 ; Layer 2 X position
dw $0919, $0000 ; Layer 2 Y position
dw $09C2, $015E ; Health
dw $09C6, $0005 ; Missiles
dw $09CE, $0005 ; Pbs
dw $0A1C, $0089 ; Samus position/state
dw $0A1E, $1508 ; More position/state
dw $0AF6, $02DB ; Samus X
dw $0AFA, $00AB ; Samus Y
dw $D8BA, $DD30 ; Doors
dw #$FFFF
preset_14speed_lower_norfair_kihunter_stairs_revisit:
dw #preset_14speed_lower_norfair_wasteland_revisit ; Lower Norfair: Wasteland Revisit
dw $078D, $9A3E ; DDB
dw $079B, $B5D5 ; MDB
dw $090F, $C000 ; Screen subpixel X position
dw $0911, $0500 ; Screen X position in pixels
dw $0913, $8800 ; Screen subpixel Y position
dw $0917, $03C0 ; Layer 2 X position
dw $09C2, $012F ; Health
dw $09CE, $0004 ; Pbs
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $0581 ; Samus X
dw $0AFA, $005B ; Samus Y
dw #$FFFF
preset_14speed_lower_norfair_fireflea_room:
dw #preset_14speed_lower_norfair_kihunter_stairs_revisit ; Lower Norfair: Kihunter Stairs Revisit
dw $078D, $9A26 ; DDB
dw $079B, $B585 ; MDB
dw $090F, $FC7F ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $7400 ; Screen subpixel Y position
dw $0915, $001A ; Screen Y position in pixels
dw $0917, $0000 ; Layer 2 X position
dw $0919, $0013 ; Layer 2 Y position
dw $0A1C, $0001 ; Samus position/state
dw $0A1E, $0008 ; More position/state
dw $0AF6, $009C ; Samus X
dw $0AFA, $008B ; Samus Y
dw #$FFFF
preset_14speed_lower_norfair_three_musketeers:
dw #preset_14speed_lower_norfair_fireflea_room ; Lower Norfair: Fireflea Room
dw $078D, $9A92 ; DDB
dw $079B, $B510 ; MDB
dw $090F, $DFFF ; Screen subpixel X position
dw $0913, $0000 ; Screen subpixel Y position
dw $0915, $001D ; Screen Y position in pixels
dw $0919, $0015 ; Layer 2 Y position
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $005F ; Samus X
dw #$FFFF
preset_14speed_lower_norfair_bubble_mountain_revisit_2:
dw #preset_14speed_lower_norfair_three_musketeers ; Lower Norfair: Three Musketeers
dw $078D, $9A4A ; DDB
dw $079B, $AD5E ; MDB
dw $07F3, $0015 ; Music Bank
dw $090F, $8000 ; Screen subpixel X position
dw $0915, $001B ; Screen Y position in pixels
dw $0919, $0014 ; Layer 2 Y position
dw $09C2, $0084 ; Health
dw $09CE, $0003 ; Pbs
dw $0AF6, $008A ; Samus X
dw #$FFFF
preset_14speed_maridia_entering_maridia:
dw #preset_14speed_lower_norfair_bubble_mountain_revisit_2 ; Lower Norfair: Bubble Mountain Revisit
dw $078D, $92EE ; DDB
dw $079B, $A6A1 ; MDB
dw $07F3, $0012 ; Music Bank
dw $07F5, $0003 ; Music Track
dw $090F, $6000 ; Screen subpixel X position
dw $0915, $0000 ; Screen Y position in pixels
dw $0919, $0000 ; Layer 2 Y position
dw $09C2, $00FB ; Health
dw $09C6, $000A ; Missiles
dw $09CA, $000A ; Supers
dw $09CE, $0005 ; Pbs
dw $0A1C, $009B ; Samus position/state
dw $0A1E, $0000 ; More position/state
dw $0AF6, $0080 ; Samus X
dw $0AFA, $0086 ; Samus Y
dw #$FFFF
preset_14speed_maridia_mt_everest:
dw #preset_14speed_maridia_entering_maridia ; Maridia: Entering Maridia
dw $078D, $A3B4 ; DDB
dw $079B, $D017 ; MDB
dw $07F3, $001B ; Music Bank
dw $07F5, $0006 ; Music Track
dw $090F, $D000 ; Screen subpixel X position
dw $0911, $006D ; Screen X position in pixels
dw $0913, $7400 ; Screen subpixel Y position
dw $0917, $0051 ; Layer 2 X position
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $00D0 ; Samus X
dw $0AFA, $006B ; Samus Y
dw #$FFFF
preset_14speed_maridia_aqueduct:
dw #preset_14speed_maridia_mt_everest ; Maridia: Mt Everest
dw $078D, $A468 ; DDB
dw $079B, $D1A3 ; MDB
dw $090F, $0000 ; Screen subpixel X position
dw $0911, $0100 ; Screen X position in pixels
dw $0913, $47FF ; Screen subpixel Y position
dw $0915, $0300 ; Screen Y position in pixels
dw $0917, $0100 ; Layer 2 X position
dw $0919, $0240 ; Layer 2 Y position
dw $09C2, $00C3 ; Health
dw $09CA, $0009 ; Supers
dw $09D2, $0003 ; Currently selected item
dw $0A1C, $001D ; Samus position/state
dw $0A1E, $0408 ; More position/state
dw $0AF6, $01BD ; Samus X
dw $0AFA, $0399 ; Samus Y
dw $D8C0, $8174 ; Doors
dw #$FFFF
preset_14speed_maridia_botwoon:
dw #preset_14speed_maridia_aqueduct ; Maridia: Aqueduct
dw $078D, $A72C ; DDB
dw $079B, $D617 ; MDB
dw $07F5, $0005 ; Music Track
dw $090F, $E000 ; Screen subpixel X position
dw $0911, $0300 ; Screen X position in pixels
dw $0913, $73FF ; Screen subpixel Y position
dw $0915, $0013 ; Screen Y position in pixels
dw $0917, $0240 ; Layer 2 X position
dw $0919, $0013 ; Layer 2 Y position
dw $09CE, $0004 ; Pbs
dw $09D2, $0000 ; Currently selected item
dw $0A1C, $0001 ; Samus position/state
dw $0A1E, $0008 ; More position/state
dw $0AF6, $03AD ; Samus X
dw $0AFA, $008B ; Samus Y
dw #$FFFF
preset_14speed_maridia_botwoon_etank_room:
dw #preset_14speed_maridia_botwoon ; Maridia: Botwoon
dw $078D, $A774 ; DDB
dw $079B, $D95E ; MDB
dw $07F3, $002A ; Music Bank
dw $07F5, $0003 ; Music Track
dw $090F, $5000 ; Screen subpixel X position
dw $0911, $0100 ; Screen X position in pixels
dw $0913, $A000 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0917, $0100 ; Layer 2 X position
dw $0919, $0000 ; Layer 2 Y position
dw $09C2, $0125 ; Health
dw $09C6, $0005 ; Missiles
dw $09CA, $0004 ; Supers
dw $0AF6, $01C3 ; Samus X
dw $D82C, $0002 ; Bosses
dw #$FFFF
preset_14speed_maridia_colosseum:
dw #preset_14speed_maridia_botwoon_etank_room ; Maridia: Botwoon E-tank Room
dw $078D, $A870 ; DDB
dw $079B, $D913 ; MDB
dw $07F3, $001B ; Music Bank
dw $07F5, $0005 ; Music Track
dw $090F, $B400 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $8400 ; Screen subpixel Y position
dw $0915, $0003 ; Screen Y position in pixels
dw $0917, $0000 ; Layer 2 X position
dw $0919, $0003 ; Layer 2 Y position
dw $09C2, $018F ; Health
dw $09C6, $0009 ; Missiles
dw $09CA, $0007 ; Supers
dw $09CE, $0005 ; Pbs
dw $0AF6, $00C1 ; Samus X
dw #$FFFF
preset_14speed_maridia_draygon:
dw #preset_14speed_maridia_colosseum ; Maridia: Colosseum
dw $078D, $A7F8 ; DDB
dw $079B, $D78F ; MDB
dw $090F, $A000 ; Screen subpixel X position
dw $0913, $EC00 ; Screen subpixel Y position
dw $0915, $0200 ; Screen Y position in pixels
dw $0919, $0180 ; Layer 2 Y position
dw $09C2, $0180 ; Health
dw $09CA, $0005 ; Supers
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $005B ; Samus X
dw $0AFA, $028B ; Samus Y
dw $D8C2, $0C00 ; Doors
dw #$FFFF
preset_14speed_maridia_colosseum_revisit:
dw #preset_14speed_maridia_draygon ; Maridia: Draygon
dw $078D, $A96C ; DDB
dw $090F, $8001 ; Screen subpixel X position
dw $0913, $4000 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0919, $0000 ; Layer 2 Y position
dw $09C2, $0172 ; Health
dw $09C6, $0006 ; Missiles
dw $09CA, $0008 ; Supers
dw $0A68, $0001 ; Flash suit
dw $0AF6, $0043 ; Samus X
dw $0AFA, $008B ; Samus Y
dw $D82C, $0003 ; Bosses
dw $D8C2, $4C00 ; Doors
dw #$FFFF
preset_14speed_maridia_reverse_botwoon:
dw #preset_14speed_maridia_colosseum_revisit ; Maridia: Colosseum Revisit
dw $078D, $A7E0 ; DDB
dw $079B, $D913 ; MDB
dw $090F, $7001 ; Screen subpixel X position
dw $0913, $4400 ; Screen subpixel Y position
dw $0915, $0200 ; Screen Y position in pixels
dw $0919, $0200 ; Layer 2 Y position
dw $09C2, $00F7 ; Health
dw $09C6, $0008 ; Missiles
dw $0A68, $0000 ; Flash suit
dw $0AF6, $00B2 ; Samus X
dw $0AFA, $028B ; Samus Y
dw #$FFFF
preset_14speed_maridia_aqueduct_revisit:
dw #preset_14speed_maridia_reverse_botwoon ; Maridia: Reverse Botwoon
dw $078D, $A90C ; DDB
dw $079B, $D617 ; MDB
dw $090F, $C000 ; Screen subpixel X position
dw $0913, $9400 ; Screen subpixel Y position
dw $0915, $001F ; Screen Y position in pixels
dw $0919, $001F ; Layer 2 Y position
dw $09C2, $00FC ; Health
dw $0AF6, $009D ; Samus X
dw $0AFA, $008B ; Samus Y
dw $D8C2, $6C00 ; Doors
dw #$FFFF
preset_14speed_maridia_everest_revisit:
dw #preset_14speed_maridia_aqueduct_revisit ; Maridia: Aqueduct Revisit
dw $078D, $A708 ; DDB
dw $079B, $D1A3 ; MDB
dw $07F5, $0006 ; Music Track
dw $090F, $8001 ; Screen subpixel X position
dw $0913, $7800 ; Screen subpixel Y position
dw $0915, $0207 ; Screen Y position in pixels
dw $0919, $0185 ; Layer 2 Y position
dw $0AF6, $006F ; Samus X
dw $0AFA, $028B ; Samus Y
dw #$FFFF
preset_14speed_maridia_red_tower_green_gate:
dw #preset_14speed_maridia_everest_revisit ; Maridia: Everest Revisit
dw $078D, $A42C ; DDB
dw $079B, $D104 ; MDB
dw $090F, $5001 ; Screen subpixel X position
dw $0911, $0013 ; Screen X position in pixels
dw $0913, $CC00 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0917, $0013 ; Layer 2 X position
dw $0919, $0000 ; Layer 2 Y position
dw $09C2, $00C8 ; Health
dw $0AF6, $0074 ; Samus X
dw $0AFA, $008B ; Samus Y
dw #$FFFF
preset_14speed_tourian_kihunter_room_revisit:
dw #preset_14speed_maridia_red_tower_green_gate ; Maridia: Red Tower Green Gate
dw $078D, $90BA ; DDB
dw $079B, $962A ; MDB
dw $07F3, $0012 ; Music Bank
dw $07F5, $0003 ; Music Track
dw $090F, $C000 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $AC00 ; Screen subpixel Y position
dw $0917, $0000 ; Layer 2 X position
dw $09CA, $0007 ; Supers
dw $0A1C, $0001 ; Samus position/state
dw $0A1E, $0008 ; More position/state
dw $0AF6, $006E ; Samus X
dw $0AFA, $005B ; Samus Y
dw #$FFFF
preset_14speed_tourian_terminator_revisit:
dw #preset_14speed_tourian_kihunter_room_revisit ; Tourian: Kihunter Room Revisit
dw $078D, $8916 ; DDB
dw $079B, $92FD ; MDB
dw $07F3, $0009 ; Music Bank
dw $07F5, $0005 ; Music Track
dw $090F, $FC00 ; Screen subpixel X position
dw $0911, $0100 ; Screen X position in pixels
dw $0913, $4000 ; Screen subpixel Y position
dw $0917, $00C0 ; Layer 2 X position
dw $09C2, $00C7 ; Health
dw $09C6, $0007 ; Missiles
dw $0A1C, $008A ; Samus position/state
dw $0A1E, $1504 ; More position/state
dw $0AF6, $0115 ; Samus X
dw $0AFA, $008B ; Samus Y
dw #$FFFF
preset_14speed_tourian_pirate_shaft_revisit:
dw #preset_14speed_tourian_terminator_revisit ; Tourian: Terminator Revisit
dw $078D, $895E ; DDB
dw $079B, $990D ; MDB
dw $090F, $5000 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $0000 ; Screen subpixel Y position
dw $0915, $01FB ; Screen Y position in pixels
dw $0917, $0000 ; Layer 2 X position
dw $0919, $017C ; Layer 2 Y position
dw $09C2, $00C5 ; Health
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $006C ; Samus X
dw $0AFA, $029B ; Samus Y
dw #$FFFF
preset_14speed_tourian_metroids_1:
dw #preset_14speed_tourian_pirate_shaft_revisit ; Tourian: Pirate Shaft Revisit
dw $078D, $9222 ; DDB
dw $079B, $DAAE ; MDB
dw $07F3, $001E ; Music Bank
dw $090F, $A001 ; Screen subpixel X position
dw $0913, $03FF ; Screen subpixel Y position
dw $0915, $0300 ; Screen Y position in pixels
dw $0919, $0240 ; Layer 2 Y position
dw $09C6, $0006 ; Missiles
dw $09CA, $0006 ; Supers
dw $0AF6, $0036 ; Samus X
dw $0AFA, $038B ; Samus Y
dw $D820, $0FC1 ; Events
dw $D8B2, $6C01 ; Doors
dw $D90C, $0100 ; Map Stations
dw #$FFFF
preset_14speed_tourian_metroids_2:
dw #preset_14speed_tourian_metroids_1 ; Tourian: Metroids 1
dw $078D, $A984 ; DDB
dw $079B, $DAE1 ; MDB
dw $090F, $7000 ; Screen subpixel X position
dw $0913, $DC00 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0919, $0000 ; Layer 2 Y position
dw $09C2, $018E ; Health
dw $09C6, $000A ; Missiles
dw $09CA, $000A ; Supers
dw $0AF6, $0039 ; Samus X
dw $0AFA, $008B ; Samus Y
dw $D822, $0021 ; Events
dw $D8C4, $0001 ; Doors
dw #$FFFF
preset_14speed_tourian_metroids_3:
dw #preset_14speed_tourian_metroids_2 ; Tourian: Metroids 2
dw $078D, $A9B4 ; DDB
dw $079B, $DB31 ; MDB
dw $090F, $2000 ; Screen subpixel X position
dw $0913, $3800 ; Screen subpixel Y position
dw $0915, $00F6 ; Screen Y position in pixels
dw $0919, $00B8 ; Layer 2 Y position
dw $09C2, $015E ; Health
dw $09CE, $0003 ; Pbs
dw $0A1C, $0001 ; Samus position/state
dw $0A1E, $0008 ; More position/state
dw $0AF6, $00C1 ; Samus X
dw $0AFA, $018B ; Samus Y
dw $D822, $0023 ; Events
dw $D8C4, $0003 ; Doors
dw #$FFFF
preset_14speed_tourian_metroids_4:
dw #preset_14speed_tourian_metroids_3 ; Tourian: Metroids 3
dw $078D, $A9CC ; DDB
dw $079B, $DB7D ; MDB
dw $090F, $A000 ; Screen subpixel X position
dw $0911, $0500 ; Screen X position in pixels
dw $0913, $CC00 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0917, $03C0 ; Layer 2 X position
dw $0919, $0000 ; Layer 2 Y position
dw $09C2, $011B ; Health
dw $0AF6, $05AA ; Samus X
dw $0AFA, $008B ; Samus Y
dw $D822, $0027 ; Events
dw $D8C4, $0007 ; Doors
dw #$FFFF
preset_14speed_tourian_doors_and_refills:
dw #preset_14speed_tourian_metroids_4 ; Tourian: Metroids 4
dw $078D, $AA2C ; DDB
dw $079B, $DCB1 ; MDB
dw $07F3, $0045 ; Music Bank
dw $07F5, $0007 ; Music Track
dw $090F, $1000 ; Screen subpixel X position
dw $0911, $0000 ; Screen X position in pixels
dw $0913, $0800 ; Screen subpixel Y position
dw $0917, $0000 ; Layer 2 X position
dw $09C2, $0001 ; Health
dw $09CE, $0001 ; Pbs
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $0018 ; Samus X
dw $D822, $002F ; Events
dw $D8C4, $002F ; Doors
dw #$FFFF
preset_14speed_tourian_zeb_skip:
dw #preset_14speed_tourian_doors_and_refills ; Tourian: Doors and Refills
dw $078D, $AAA4 ; DDB
dw $079B, $DDF3 ; MDB
dw $07F3, $001E ; Music Bank
dw $07F5, $0005 ; Music Track
dw $090F, $3FFF ; Screen subpixel X position
dw $0913, $4C00 ; Screen subpixel Y position
dw $0915, $021C ; Screen Y position in pixels
dw $0919, $0195 ; Layer 2 Y position
dw $09C2, $018F ; Health
dw $09CA, $0009 ; Supers
dw $0AF6, $00DB ; Samus X
dw $0AFA, $028B ; Samus Y
dw $D8C4, $03AF ; Doors
dw #$FFFF
preset_14speed_tourian_mother_brain_2:
dw #preset_14speed_tourian_zeb_skip ; Tourian: Zeb Skip
dw $078D, $AAC8 ; DDB
dw $079B, $DD58 ; MDB
dw $07F3, $0021 ; Music Bank
dw $07F5, $0000 ; Music Track
dw $090F, $79FF ; Screen subpixel X position
dw $0915, $0000 ; Screen Y position in pixels
dw $0919, $0000 ; Layer 2 Y position
dw $09C2, $0180 ; Health
dw $09C6, $0001 ; Missiles
dw $09CA, $0000 ; Supers
dw $0AF6, $00CF ; Samus X
dw $0AFA, $009B ; Samus Y
dw $D820, $0FC5 ; Events
dw #$FFFF
preset_14speed_tourian_mother_brain_3:
dw #preset_14speed_tourian_mother_brain_2 ; Tourian: Mother Brain 2
dw $07F3, $0048 ; Music Bank
dw $09A6, $1009 ; Beams
dw $09C2, $018F ; Health
dw $09C6, $0000 ; Missiles
dw $09CE, $0000 ; Pbs
dw $0A76, $8000 ; Hyper beam
dw $D82C, $0203 ; Bosses
dw #$FFFF
preset_14speed_tourian_zebes_escape:
dw #preset_14speed_tourian_mother_brain_3 ; Tourian: Mother Brain 3
dw $09A6, $1009 ; Beams
dw $0AF6, $0025 ; Samus X
dw $0AFA, $00C3 ; Samus Y
dw $D820, $4FC5 ; Events
dw #$FFFF
preset_14speed_tourian_escape_room_3:
dw #preset_14speed_tourian_zebes_escape ; Tourian: Zebes Escape
dw $078D, $AAEC ; DDB
dw $079B, $DE7A ; MDB
dw $07F3, $0024 ; Music Bank
dw $07F5, $0007 ; Music Track
dw $090F, $F000 ; Screen subpixel X position
dw $0913, $7000 ; Screen subpixel Y position
dw $0915, $0100 ; Screen Y position in pixels
dw $0919, $00C0 ; Layer 2 Y position
dw $09A6, $1009 ; Beams
dw $09C6, $0000 ; Missiles
dw $09CA, $0000 ; Supers
dw $09CE, $0000 ; Pbs
dw $0A1C, $0001 ; Samus position/state
dw $0A1E, $0008 ; More position/state
dw $0A76, $8000 ; Hyper beam
dw $0AF6, $00DF ; Samus X
dw $0AFA, $018B ; Samus Y
dw $D820, $4FC5 ; Events
dw $D82C, $0203 ; Bosses
dw #$FFFF
preset_14speed_tourian_escape_room_4:
dw #preset_14speed_tourian_escape_room_3 ; Tourian: Escape Room 3
dw $078D, $AB04 ; DDB
dw $079B, $DEA7 ; MDB
dw $090F, $3000 ; Screen subpixel X position
dw $0911, $0500 ; Screen X position in pixels
dw $0913, $4C00 ; Screen subpixel Y position
dw $0915, $001C ; Screen Y position in pixels
dw $0917, $03C0 ; Layer 2 X position
dw $0919, $0015 ; Layer 2 Y position
dw $0AF6, $05D6 ; Samus X
dw $0AFA, $008B ; Samus Y
dw #$FFFF
preset_14speed_tourian_escape_climb:
dw #preset_14speed_tourian_escape_room_4 ; Tourian: Escape Room 4
dw $078D, $AB1C ; DDB
dw $079B, $DEDE ; MDB
dw $090F, $0000 ; Screen subpixel X position
dw $0911, $00F1 ; Screen X position in pixels
dw $0913, $A400 ; Screen subpixel Y position
dw $0915, $00FB ; Screen Y position in pixels
dw $0917, $00B4 ; Layer 2 X position
dw $0919, $00BC ; Layer 2 Y position
dw $09C2, $0171 ; Health
dw $0AF6, $0151 ; Samus X
dw $0AFA, $018B ; Samus Y
dw #$FFFF
preset_14speed_tourian_escape_parlor:
dw #preset_14speed_tourian_escape_climb ; Tourian: Escape Climb
dw $078D, $AB34 ; DDB
dw $079B, $96BA ; MDB
dw $090F, $B000 ; Screen subpixel X position
dw $0911, $0100 ; Screen X position in pixels
dw $0913, $6801 ; Screen subpixel Y position
dw $0915, $0000 ; Screen Y position in pixels
dw $0917, $00C0 ; Layer 2 X position
dw $0919, $0000 ; Layer 2 Y position
dw $09C2, $00E0 ; Health
dw $0A1C, $0002 ; Samus position/state
dw $0A1E, $0004 ; More position/state
dw $0AF6, $01D2 ; Samus X
dw $0AFA, $004B ; Samus Y
dw #$FFFF
|
alloy4fun_models/trashltl/models/11/eKChcb37BHi7v3746.als | Kaixi26/org.alloytools.alloy | 0 | 4386 | <gh_stars>0
open main
pred ideKChcb37BHi7v3746_prop12 {
always some f : File | eventually f in Trash => always f in Trash
}
pred __repair { ideKChcb37BHi7v3746_prop12 }
check __repair { ideKChcb37BHi7v3746_prop12 <=> prop12o } |
libsrc/_DEVELOPMENT/string/z80/asm_strnset.asm | Frodevan/z88dk | 640 | 105042 | <reponame>Frodevan/z88dk<gh_stars>100-1000
; ===============================================================
; Jan 2015
; ===============================================================
;
; char *strnset(char *s, int c, size_t n)
;
; Write at most n chars c into s.
;
; ===============================================================
SECTION code_clib
SECTION code_string
PUBLIC asm_strnset
asm_strnset:
; enter : hl = char *s
; e = int c
; bc = size_t n
;
; exit : hl = char *s
; bc = remaining n
;
; uses : af, bc
ld a,b
or c
ret z
push hl
xor a
loop:
cp (hl)
jr z, exit
ld (hl),e
IF __CPU_GBZ80__
EXTERN __z80asm__cpi
call __z80asm__cpi
ld a,b
or c
ld a,0
jr nz,loop
ELSE
cpi ; hl++, bc--
jp pe, loop
ENDIF
exit:
pop hl
ret
|
msquic/msvc/evercrypt/amd64/sha256-x86_64-msvc.asm | ThadHouse/everest-dist | 1 | 85917 | <gh_stars>1-10
.code
ALIGN 16
sha256_update proc
pextrq rax, xmm15, 0
push rax
pextrq rax, xmm15, 1
push rax
pextrq rax, xmm14, 0
push rax
pextrq rax, xmm14, 1
push rax
pextrq rax, xmm13, 0
push rax
pextrq rax, xmm13, 1
push rax
pextrq rax, xmm12, 0
push rax
pextrq rax, xmm12, 1
push rax
pextrq rax, xmm11, 0
push rax
pextrq rax, xmm11, 1
push rax
pextrq rax, xmm10, 0
push rax
pextrq rax, xmm10, 1
push rax
pextrq rax, xmm9, 0
push rax
pextrq rax, xmm9, 1
push rax
pextrq rax, xmm8, 0
push rax
pextrq rax, xmm8, 1
push rax
pextrq rax, xmm7, 0
push rax
pextrq rax, xmm7, 1
push rax
pextrq rax, xmm6, 0
push rax
pextrq rax, xmm6, 1
push rax
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
mov rdi, rcx
mov rsi, rdx
mov rdx, r8
mov rcx, r9
movdqu xmm1, xmmword ptr [rdi + 0]
movdqu xmm2, xmmword ptr [rdi + 16]
mov rax, 289644378169868803
pinsrq xmm7, rax, 0
mov rax, 868365760874482187
pinsrq xmm7, rax, 1
pshufd xmm0, xmm1, 27
pshufd xmm1, xmm1, 177
pshufd xmm2, xmm2, 27
movdqu xmm8, xmm7
palignr xmm1, xmm2, 8
shufpd xmm2, xmm0, 0
jmp L1
ALIGN 16
L0:
movdqu xmm3, xmmword ptr [rsi + 0]
movdqu xmm4, xmmword ptr [rsi + 16]
movdqu xmm5, xmmword ptr [rsi + 32]
pshufb xmm3, xmm7
movdqu xmm6, xmmword ptr [rsi + 48]
movdqu xmm0, xmmword ptr [rcx + 0]
paddd xmm0, xmm3
pshufb xmm4, xmm7
movdqu xmm10, xmm2
sha256rnds2 xmm2, xmm1, xmm0
pshufd xmm0, xmm0, 14
movdqu xmm9, xmm1
sha256rnds2 xmm1, xmm2, xmm0
movdqu xmm0, xmmword ptr [rcx + 16]
paddd xmm0, xmm4
pshufb xmm5, xmm7
sha256rnds2 xmm2, xmm1, xmm0
pshufd xmm0, xmm0, 14
add rsi, 64
sha256msg1 xmm3, xmm4
sha256rnds2 xmm1, xmm2, xmm0
movdqu xmm0, xmmword ptr [rcx + 32]
paddd xmm0, xmm5
pshufb xmm6, xmm7
sha256rnds2 xmm2, xmm1, xmm0
pshufd xmm0, xmm0, 14
movdqu xmm7, xmm6
palignr xmm7, xmm5, 4
paddd xmm3, xmm7
sha256msg1 xmm4, xmm5
sha256rnds2 xmm1, xmm2, xmm0
movdqu xmm0, xmmword ptr [rcx + 48]
paddd xmm0, xmm6
sha256msg2 xmm3, xmm6
sha256rnds2 xmm2, xmm1, xmm0
pshufd xmm0, xmm0, 14
movdqu xmm7, xmm3
palignr xmm7, xmm6, 4
paddd xmm4, xmm7
sha256msg1 xmm5, xmm6
sha256rnds2 xmm1, xmm2, xmm0
movdqu xmm0, xmmword ptr [rcx + 64]
paddd xmm0, xmm3
sha256msg2 xmm4, xmm3
sha256rnds2 xmm2, xmm1, xmm0
pshufd xmm0, xmm0, 14
movdqu xmm7, xmm4
palignr xmm7, xmm3, 4
paddd xmm5, xmm7
sha256msg1 xmm6, xmm3
sha256rnds2 xmm1, xmm2, xmm0
movdqu xmm7, xmm3
movdqu xmm0, xmm6
movdqu xmm3, xmm4
movdqu xmm4, xmm5
movdqu xmm6, xmm7
movdqu xmm5, xmm0
movdqu xmm0, xmmword ptr [rcx + 80]
paddd xmm0, xmm3
sha256msg2 xmm4, xmm3
sha256rnds2 xmm2, xmm1, xmm0
pshufd xmm0, xmm0, 14
movdqu xmm7, xmm4
palignr xmm7, xmm3, 4
paddd xmm5, xmm7
sha256msg1 xmm6, xmm3
sha256rnds2 xmm1, xmm2, xmm0
movdqu xmm7, xmm3
movdqu xmm0, xmm6
movdqu xmm3, xmm4
movdqu xmm4, xmm5
movdqu xmm6, xmm7
movdqu xmm5, xmm0
movdqu xmm0, xmmword ptr [rcx + 96]
paddd xmm0, xmm3
sha256msg2 xmm4, xmm3
sha256rnds2 xmm2, xmm1, xmm0
pshufd xmm0, xmm0, 14
movdqu xmm7, xmm4
palignr xmm7, xmm3, 4
paddd xmm5, xmm7
sha256msg1 xmm6, xmm3
sha256rnds2 xmm1, xmm2, xmm0
movdqu xmm7, xmm3
movdqu xmm0, xmm6
movdqu xmm3, xmm4
movdqu xmm4, xmm5
movdqu xmm6, xmm7
movdqu xmm5, xmm0
movdqu xmm0, xmmword ptr [rcx + 112]
paddd xmm0, xmm3
sha256msg2 xmm4, xmm3
sha256rnds2 xmm2, xmm1, xmm0
pshufd xmm0, xmm0, 14
movdqu xmm7, xmm4
palignr xmm7, xmm3, 4
paddd xmm5, xmm7
sha256msg1 xmm6, xmm3
sha256rnds2 xmm1, xmm2, xmm0
movdqu xmm7, xmm3
movdqu xmm0, xmm6
movdqu xmm3, xmm4
movdqu xmm4, xmm5
movdqu xmm6, xmm7
movdqu xmm5, xmm0
movdqu xmm0, xmmword ptr [rcx + 128]
paddd xmm0, xmm3
sha256msg2 xmm4, xmm3
sha256rnds2 xmm2, xmm1, xmm0
pshufd xmm0, xmm0, 14
movdqu xmm7, xmm4
palignr xmm7, xmm3, 4
paddd xmm5, xmm7
sha256msg1 xmm6, xmm3
sha256rnds2 xmm1, xmm2, xmm0
movdqu xmm7, xmm3
movdqu xmm0, xmm6
movdqu xmm3, xmm4
movdqu xmm4, xmm5
movdqu xmm6, xmm7
movdqu xmm5, xmm0
movdqu xmm0, xmmword ptr [rcx + 144]
paddd xmm0, xmm3
sha256msg2 xmm4, xmm3
sha256rnds2 xmm2, xmm1, xmm0
pshufd xmm0, xmm0, 14
movdqu xmm7, xmm4
palignr xmm7, xmm3, 4
paddd xmm5, xmm7
sha256msg1 xmm6, xmm3
sha256rnds2 xmm1, xmm2, xmm0
movdqu xmm7, xmm3
movdqu xmm0, xmm6
movdqu xmm3, xmm4
movdqu xmm4, xmm5
movdqu xmm6, xmm7
movdqu xmm5, xmm0
movdqu xmm0, xmmword ptr [rcx + 160]
paddd xmm0, xmm3
sha256msg2 xmm4, xmm3
sha256rnds2 xmm2, xmm1, xmm0
pshufd xmm0, xmm0, 14
movdqu xmm7, xmm4
palignr xmm7, xmm3, 4
paddd xmm5, xmm7
sha256msg1 xmm6, xmm3
sha256rnds2 xmm1, xmm2, xmm0
movdqu xmm7, xmm3
movdqu xmm0, xmm6
movdqu xmm3, xmm4
movdqu xmm4, xmm5
movdqu xmm6, xmm7
movdqu xmm5, xmm0
movdqu xmm0, xmmword ptr [rcx + 176]
paddd xmm0, xmm3
sha256msg2 xmm4, xmm3
sha256rnds2 xmm2, xmm1, xmm0
pshufd xmm0, xmm0, 14
movdqu xmm7, xmm4
palignr xmm7, xmm3, 4
paddd xmm5, xmm7
sha256msg1 xmm6, xmm3
sha256rnds2 xmm1, xmm2, xmm0
movdqu xmm7, xmm3
movdqu xmm0, xmm6
movdqu xmm3, xmm4
movdqu xmm4, xmm5
movdqu xmm6, xmm7
movdqu xmm5, xmm0
movdqu xmm0, xmmword ptr [rcx + 192]
paddd xmm0, xmm3
sha256msg2 xmm4, xmm3
sha256rnds2 xmm2, xmm1, xmm0
pshufd xmm0, xmm0, 14
movdqu xmm7, xmm4
palignr xmm7, xmm3, 4
paddd xmm5, xmm7
sha256msg1 xmm6, xmm3
sha256rnds2 xmm1, xmm2, xmm0
movdqu xmm7, xmm3
movdqu xmm0, xmm6
movdqu xmm3, xmm4
movdqu xmm4, xmm5
movdqu xmm6, xmm7
movdqu xmm5, xmm0
movdqu xmm0, xmmword ptr [rcx + 208]
paddd xmm0, xmm3
sha256msg2 xmm4, xmm3
sha256rnds2 xmm2, xmm1, xmm0
pshufd xmm0, xmm0, 14
movdqu xmm7, xmm4
palignr xmm7, xmm3, 4
sha256rnds2 xmm1, xmm2, xmm0
paddd xmm5, xmm7
movdqu xmm0, xmmword ptr [rcx + 224]
paddd xmm0, xmm4
sha256rnds2 xmm2, xmm1, xmm0
pshufd xmm0, xmm0, 14
sha256msg2 xmm5, xmm4
movdqu xmm7, xmm8
sha256rnds2 xmm1, xmm2, xmm0
movdqu xmm0, xmmword ptr [rcx + 240]
paddd xmm0, xmm5
sha256rnds2 xmm2, xmm1, xmm0
pshufd xmm0, xmm0, 14
sub rdx, 1
sha256rnds2 xmm1, xmm2, xmm0
paddd xmm2, xmm10
paddd xmm1, xmm9
ALIGN 16
L1:
cmp rdx, 0
ja L0
pshufd xmm2, xmm2, 177
pshufd xmm7, xmm1, 27
pshufd xmm1, xmm1, 177
shufpd xmm1, xmm2, 3
palignr xmm2, xmm7, 8
movdqu xmmword ptr [rdi + 0], xmm1
movdqu xmmword ptr [rdi + 16], xmm2
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
pop rax
pinsrq xmm6, rax, 1
pop rax
pinsrq xmm6, rax, 0
pop rax
pinsrq xmm7, rax, 1
pop rax
pinsrq xmm7, rax, 0
pop rax
pinsrq xmm8, rax, 1
pop rax
pinsrq xmm8, rax, 0
pop rax
pinsrq xmm9, rax, 1
pop rax
pinsrq xmm9, rax, 0
pop rax
pinsrq xmm10, rax, 1
pop rax
pinsrq xmm10, rax, 0
pop rax
pinsrq xmm11, rax, 1
pop rax
pinsrq xmm11, rax, 0
pop rax
pinsrq xmm12, rax, 1
pop rax
pinsrq xmm12, rax, 0
pop rax
pinsrq xmm13, rax, 1
pop rax
pinsrq xmm13, rax, 0
pop rax
pinsrq xmm14, rax, 1
pop rax
pinsrq xmm14, rax, 0
pop rax
pinsrq xmm15, rax, 1
pop rax
pinsrq xmm15, rax, 0
ret
sha256_update endp
end
|
archive/agda-1/Membership.agda | m0davis/oscar | 0 | 600 |
module Membership where
open import OscarPrelude
open import Successor
record Membership {ℓ} (m : Set ℓ) (M : Set ℓ) : Set (⊹ ℓ)
where
field
_∈_ : m → M → Set ℓ
_∉_ : m → M → Set ℓ
xor-membership : ∀ {x : m} {X : M} → x ∈ X ←⊗→ x ∉ X
open Membership ⦃ … ⦄ public
data _∈List_ {ℓ} {A : Set ℓ} (a : A) : List A → Set ℓ
where
zero : {as : List A} → a ∈List (a ∷ as)
suc : {x : A} {as : List A} → a ∈List as → a ∈List (x ∷ as)
instance MembershipList : ∀ {ℓ} {A : Set ℓ} → Membership A $ List A
Membership._∈_ MembershipList = _∈List_
Membership._∉_ MembershipList x X = ¬ x ∈ X
Membership.xor-membership MembershipList = (λ x x₁ → x₁ x) , (λ x x₁ → x x₁)
instance SuccessorMembershipList : ∀ {ℓ} {A : Set ℓ} {a : A} {x : A} {as : List A} → Successor (a ∈ as) $ a ∈ (x List.∷ as)
Successor.⊹ SuccessorMembershipList = suc
_⊆_ : ∀ {ℓ} {m M : Set ℓ} ⦃ _ : Membership m M ⦄ → M → M → Set ℓ
_⊆_ {m = m} M₁ M₂ = ∀ {x : m} → x ∈ M₁ → x ∈ M₂
|
test/interaction/Issue591.agda | cruhland/agda | 1,989 | 16449 | <reponame>cruhland/agda<filename>test/interaction/Issue591.agda
module Issue591 where
import Issue591.M
|
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_13_1616.asm | ljhsiun2/medusa | 9 | 14711 | <filename>Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_13_1616.asm
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r14
push %r8
push %r9
push %rdi
push %rdx
lea addresses_A_ht+0x16d75, %r12
nop
nop
xor %r14, %r14
movb $0x61, (%r12)
nop
nop
sub $34653, %rdi
lea addresses_WC_ht+0xef1d, %r8
nop
nop
nop
nop
add $50269, %rdx
mov (%r8), %r9d
xor $44514, %r14
lea addresses_A_ht+0x6de3, %r9
cmp $19008, %r8
movups (%r9), %xmm0
vpextrq $0, %xmm0, %rdi
nop
nop
nop
nop
nop
sub $39462, %r14
lea addresses_WC_ht+0x22dd, %r14
xor $46493, %rdi
movups (%r14), %xmm3
vpextrq $0, %xmm3, %r8
nop
cmp $36692, %rdx
pop %rdx
pop %rdi
pop %r9
pop %r8
pop %r14
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r8
push %rcx
push %rdi
push %rdx
push %rsi
// Load
lea addresses_US+0x104fd, %r11
clflush (%r11)
nop
nop
cmp $64172, %rdx
vmovups (%r11), %ymm6
vextracti128 $0, %ymm6, %xmm6
vpextrq $1, %xmm6, %rdi
nop
nop
nop
nop
nop
xor %r11, %r11
// Store
lea addresses_WT+0x38fd, %r8
nop
nop
sub $38853, %rsi
movw $0x5152, (%r8)
nop
nop
nop
dec %rdi
// Store
lea addresses_WT+0x7355, %rcx
nop
nop
sub %r13, %r13
movw $0x5152, (%rcx)
nop
nop
nop
cmp %rdi, %rdi
// Faulty Load
lea addresses_WC+0xcfd, %r13
nop
nop
sub $51637, %r11
movb (%r13), %dl
lea oracles, %rcx
and $0xff, %rdx
shlq $12, %rdx
mov (%rcx,%rdx,1), %rdx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r8
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_WC', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_US', 'same': False, 'AVXalign': False, 'congruent': 10}}
{'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_WT', 'same': False, 'AVXalign': False, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_WT', 'same': False, 'AVXalign': False, 'congruent': 2}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_WC', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 1}}
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 5}}
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 1}}
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 5}}
{'00': 13}
00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
programs/oeis/057/A057174.asm | neoneye/loda | 22 | 104052 | <reponame>neoneye/loda
; A057174: a(n+3)=a(n)+a(n+1)-a(n+2), starting with 1,2,3.
; 1,2,3,0,5,-2,7,-4,9,-6,11,-8,13,-10,15,-12,17,-14,19,-16,21,-18,23,-20,25,-22,27,-24,29,-26,31,-28,33,-30,35,-32,37,-34,39,-36,41,-38,43,-40,45,-42,47,-44,49,-46,51,-48,53,-50,55,-52,57,-54,59,-56,61,-58,63,-60,65,-62,67,-64,69,-66,71,-68,73,-70,75,-72
add $0,2
lpb $0
mov $1,5
add $2,$0
sub $0,1
mod $0,2
sub $1,$2
mov $2,$1
lpe
mov $0,$1
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_588.asm | ljhsiun2/medusa | 9 | 4370 | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r13
push %r14
push %r8
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x173a0, %rbx
nop
nop
nop
nop
inc %r8
movb $0x61, (%rbx)
nop
sub $29716, %r14
lea addresses_A_ht+0x6220, %rsi
lea addresses_D_ht+0xf720, %rdi
nop
nop
nop
and $64014, %r13
mov $79, %rcx
rep movsq
and $31810, %r8
lea addresses_D_ht+0x132e7, %rsi
lea addresses_D_ht+0x175a0, %rdi
clflush (%rsi)
nop
nop
nop
nop
nop
and %r11, %r11
mov $82, %rcx
rep movsw
nop
cmp %rdi, %rdi
lea addresses_WT_ht+0xcda0, %rsi
inc %r13
movb $0x61, (%rsi)
nop
nop
nop
nop
sub $1809, %rbx
lea addresses_UC_ht+0x1bf20, %rcx
nop
nop
nop
nop
sub $19882, %r14
mov $0x6162636465666768, %rsi
movq %rsi, %xmm7
movups %xmm7, (%rcx)
nop
nop
nop
nop
nop
and $23039, %rdi
lea addresses_normal_ht+0x9fa0, %rdi
nop
nop
cmp $12529, %r8
movl $0x61626364, (%rdi)
nop
nop
nop
nop
and %r13, %r13
lea addresses_WT_ht+0x1370, %rsi
nop
nop
nop
nop
and %rcx, %rcx
movups (%rsi), %xmm5
vpextrq $1, %xmm5, %rdi
nop
nop
nop
nop
sub $6992, %rsi
lea addresses_D_ht+0x1deb8, %r13
nop
sub %r11, %r11
movb (%r13), %r8b
nop
nop
nop
sub $38887, %r11
lea addresses_UC_ht+0x8ba0, %rcx
nop
nop
nop
nop
nop
sub %r8, %r8
movl $0x61626364, (%rcx)
nop
nop
nop
nop
cmp %rdi, %rdi
lea addresses_A_ht+0x9fa0, %rbx
nop
nop
nop
nop
cmp %r11, %r11
mov (%rbx), %r8d
dec %rcx
lea addresses_UC_ht+0x116a0, %rdi
nop
cmp $58022, %rsi
movups (%rdi), %xmm7
vpextrq $1, %xmm7, %r11
sub %r11, %r11
lea addresses_WT_ht+0xad20, %rsi
lea addresses_D_ht+0x1e940, %rdi
nop
nop
nop
dec %rbx
mov $70, %rcx
rep movsl
nop
nop
nop
sub %rsi, %rsi
lea addresses_WT_ht+0x9a22, %rsi
lea addresses_D_ht+0x1a180, %rdi
nop
nop
inc %r11
mov $59, %rcx
rep movsw
and $17446, %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r8
pop %r14
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r14
push %r8
push %r9
push %rax
push %rbp
push %rsi
// Load
lea addresses_normal+0x12fa0, %r9
add $42867, %r14
vmovups (%r9), %ymm4
vextracti128 $1, %ymm4, %xmm4
vpextrq $0, %xmm4, %rsi
nop
and %r14, %r14
// Store
lea addresses_US+0x37f8, %r11
clflush (%r11)
nop
nop
nop
nop
xor $37829, %rax
movl $0x51525354, (%r11)
sub %rax, %rax
// Store
lea addresses_normal+0x15ca0, %r8
nop
nop
nop
nop
nop
xor $11130, %rax
mov $0x5152535455565758, %r11
movq %r11, %xmm3
movups %xmm3, (%r8)
nop
nop
inc %rbp
// Store
lea addresses_D+0x8ec6, %rax
dec %r9
mov $0x5152535455565758, %rbp
movq %rbp, %xmm1
movups %xmm1, (%rax)
nop
nop
nop
nop
cmp $35745, %r11
// Load
mov $0x1a0, %r8
nop
nop
nop
nop
and %r11, %r11
movb (%r8), %al
nop
nop
nop
nop
xor $30936, %r9
// Store
lea addresses_normal+0x10921, %rbp
nop
nop
inc %r8
mov $0x5152535455565758, %rax
movq %rax, %xmm4
vmovups %ymm4, (%rbp)
add $16682, %rax
// Faulty Load
lea addresses_PSE+0x137a0, %r9
nop
nop
add $60256, %rax
movups (%r9), %xmm1
vpextrq $0, %xmm1, %r14
lea oracles, %rax
and $0xff, %r14
shlq $12, %r14
mov (%rax,%r14,1), %r14
pop %rsi
pop %rbp
pop %rax
pop %r9
pop %r8
pop %r14
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_PSE', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal', 'same': False, 'size': 32, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_US', 'same': False, 'size': 4, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_normal', 'same': False, 'size': 16, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_D', 'same': False, 'size': 16, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_P', 'same': False, 'size': 1, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_normal', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_PSE', 'same': True, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 1, 'congruent': 10, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 1, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 16, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 4, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 16, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D_ht', 'same': False, 'size': 1, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 4, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_A_ht', 'same': False, 'size': 4, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 16, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM'}
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
|
a0301.asm | zhangyuesai/8086-asm-learning-code | 1 | 2808 | <gh_stars>1-10
assume cs:codesg
codesg segment
s:
jmp s
jmp short s
jmp near ptr s
jmp far ptr s
codesg ends
end s |
test/Succeed/Issue2233.agda | shlevy/agda | 1,989 | 15782 | -- Andreas, 2016-10-03, issue #2233
-- Positivity check should return the same result when change
-- all involved definitions from non-abstract to abstract.
abstract
data Functor : Set where
Id : Functor
_·_ : Functor → Set → Set
Id · A = A
data ν (F : Functor) : Set where
inn : F · ν F → ν F
-- Should positivity check ok.
|
programs/oeis/090/A090909.asm | jmorken/loda | 1 | 28853 | <reponame>jmorken/loda
; A090909: Terms a(k) of A073869 for which a(k-1), a(k) and a(k+1) are distinct.
; 0,2,5,7,10,13,15,18,20,23,26,28,31,34,36,39,41,44,47,49,52,54,57,60,62,65,68,70,73,75,78,81,83,86,89,91,94,96,99,102,104,107,109,112,115,117,120,123,125,128,130,133,136,138,141,143,146,149,151,154,157,159,162
mov $27,$0
mov $29,$0
mov $30,$0
mov $33,$0
lpb $29
mov $0,$27
sub $29,1
sub $0,$29
mov $23,$0
mov $25,2
lpb $25
clr $0,23
mov $0,$23
sub $25,1
add $0,$25
sub $0,1
mov $20,$0
mov $22,$0
lpb $22
mov $0,$20
sub $22,1
sub $0,$22
mov $16,$0
mov $18,2
lpb $18
mov $0,$16
sub $18,1
add $0,$18
trn $0,2
mov $2,$0
add $0,1
pow $0,2
add $2,3
lpb $0
add $0,1
mov $1,$0
mov $0,0
add $1,2
add $2,2
trn $1,$2
add $0,$1
lpe
mov $1,$2
mov $19,$18
lpb $19
mov $17,$1
sub $19,1
lpe
lpe
lpb $16
mov $16,0
sub $17,$1
lpe
mov $1,$17
mul $1,2
add $1,4
add $21,$1
lpe
mov $1,$21
mov $26,$25
lpb $26
mov $24,$1
sub $26,1
lpe
lpe
lpb $23
mov $23,1
sub $24,$1
lpe
mov $1,$24
sub $1,4
div $1,5
mul $1,3
add $1,2
add $28,$1
lpe
mov $1,$28
mov $32,$30
mul $32,3
add $1,$32
add $1,$33
div $1,3
|
programs/oeis/304/A304887.asm | ckrause/cm | 22 | 241307 | ; A304887: Number of non-isomorphic blobs of weight n.
; 1,1,1,1,1,1,3,3,8,14
mov $2,$0
lpb $0
sub $0,1
add $1,3
mul $2,$1
mov $1,$0
mul $0,2
sub $0,$1
div $2,6
lpe
mov $0,$2
add $0,1
|
src/Categories/Category/Product.agda | Trebor-Huang/agda-categories | 279 | 5910 | <gh_stars>100-1000
{-# OPTIONS --without-K --safe #-}
module Categories.Category.Product where
open import Level
open import Function using () renaming (_∘_ to _∙_)
open import Data.Product using (_×_; Σ; _,_; proj₁; proj₂; zip; map; <_,_>; swap)
open import Categories.Utils.Product
open import Categories.Category using (Category)
open import Categories.Category.Groupoid using (IsGroupoid)
open import Categories.Functor renaming (id to idF)
open import Categories.NaturalTransformation.Core
open import Categories.NaturalTransformation.NaturalIsomorphism hiding (refl)
import Categories.Morphism as Morphism
private
variable
o ℓ e o′ ℓ′ e′ o″ ℓ″ e″ : Level
o₁ ℓ₁ e₁ o′₁ ℓ′₁ e′₁ o₂ ℓ₂ e₂ o′₂ ℓ′₂ e′₂ : Level
C C₁ C₂ D D₁ D₂ : Category o ℓ e
Product : (C : Category o ℓ e) (D : Category o′ ℓ′ e′) → Category (o ⊔ o′) (ℓ ⊔ ℓ′) (e ⊔ e′)
Product C D = record
{ Obj = C.Obj × D.Obj
; _⇒_ = C._⇒_ -< _×_ >- D._⇒_
; _≈_ = C._≈_ -< _×_ >- D._≈_
; _∘_ = zip C._∘_ D._∘_
; id = C.id , D.id
; assoc = C.assoc , D.assoc
; sym-assoc = C.sym-assoc , D.sym-assoc
; identityˡ = C.identityˡ , D.identityˡ
; identityʳ = C.identityʳ , D.identityʳ
; identity² = C.identity² , D.identity²
; equiv = record
{ refl = C.Equiv.refl , D.Equiv.refl
; sym = map C.Equiv.sym D.Equiv.sym
; trans = zip C.Equiv.trans D.Equiv.trans
}
; ∘-resp-≈ = zip C.∘-resp-≈ D.∘-resp-≈
}
where module C = Category C
module D = Category D
-- product of functors sharing the same domain
infixr 2 _※_
_※_ : ∀ (F : Functor C D₁) → (G : Functor C D₂) → Functor C (Product D₁ D₂)
F ※ G = record
{ F₀ = < F.F₀ , G.F₀ >
; F₁ = < F.F₁ , G.F₁ >
; identity = F.identity , G.identity
; homomorphism = F.homomorphism , G.homomorphism
; F-resp-≈ = < F.F-resp-≈ , G.F-resp-≈ >
}
where module F = Functor F
module G = Functor G
-- general product of functors
infixr 2 _⁂_
_⁂_ : ∀ (F₁ : Functor C₁ D₁) (F₂ : Functor C₂ D₂) → Functor (Product C₁ C₂) (Product D₁ D₂)
F ⁂ G = record
{ F₀ = map F.F₀ G.F₀
; F₁ = map F.F₁ G.F₁
; identity = F.identity , G.identity
; homomorphism = F.homomorphism , G.homomorphism
; F-resp-≈ = map F.F-resp-≈ G.F-resp-≈
}
where module F = Functor F
module G = Functor G
-- Natural Transformations respect the ⁂ product
infixr 5 _⁂ⁿ_
_⁂ⁿ_ : ∀ {C₁ : Category o₁ ℓ₁ e₁} {D₁ : Category o′₁ ℓ′₁ e′₁}
{C₂ : Category o₂ ℓ₂ e₂} {D₂ : Category o′₂ ℓ′₂ e′₂}
{F₁ G₁ : Functor C₁ D₁} {F₂ G₂ : Functor C₂ D₂}
(α : NaturalTransformation F₁ G₁) (β : NaturalTransformation F₂ G₂) →
NaturalTransformation (F₁ ⁂ F₂) (G₁ ⁂ G₂)
α ⁂ⁿ β = ntHelper record
{ η = map⁎′ α.η β.η
; commute = map⁎′ α.commute β.commute
}
where module α = NaturalTransformation α
module β = NaturalTransformation β
-- Natural Transformations respect the ※ product as well
infixr 5 _※ⁿ_
_※ⁿ_ : ∀ {D₁ : Category o ℓ e} {D₂ : Category o′ ℓ′ e′}
{F₁ G₁ : Functor C D₁} {F₂ G₂ : Functor C D₂}
(α : NaturalTransformation F₁ G₁) →
(β : NaturalTransformation F₂ G₂) →
NaturalTransformation (F₁ ※ F₂) (G₁ ※ G₂)
α ※ⁿ β = ntHelper record
{ η = < α.η , β.η >
; commute = < α.commute , β.commute >
}
where module α = NaturalTransformation α
module β = NaturalTransformation β
-- Natural Isomorphisms too
infixr 5 _⁂ⁿⁱ_
_⁂ⁿⁱ_ : ∀ {C₁ : Category o₁ ℓ₁ e₁} {D₁ : Category o′₁ ℓ′₁ e′₁}
{C₂ : Category o₂ ℓ₂ e₂} {D₂ : Category o′₂ ℓ′₂ e′₂}
{F₁ G₁ : Functor C₁ D₁} {F₂ G₂ : Functor C₂ D₂}
(α : NaturalIsomorphism F₁ G₁) (β : NaturalIsomorphism F₂ G₂) →
NaturalIsomorphism (F₁ ⁂ F₂) (G₁ ⁂ G₂)
α ⁂ⁿⁱ β = record
{ F⇒G = α.F⇒G ⁂ⁿ β.F⇒G
; F⇐G = α.F⇐G ⁂ⁿ β.F⇐G
; iso = λ where
(X , Y) → record
{ isoˡ = isoˡ (α.iso X) , isoˡ (β.iso Y)
; isoʳ = isoʳ (α.iso X) , isoʳ (β.iso Y)
}
}
where module α = NaturalIsomorphism α
module β = NaturalIsomorphism β
open Morphism.Iso
-- Natural Isomorphisms too
infixr 5 _※ⁿⁱ_
_※ⁿⁱ_ : ∀ {D₁ : Category o ℓ e} {D₂ : Category o′ ℓ′ e′}
{F₁ G₁ : Functor C D₁} {F₂ G₂ : Functor C D₂}
(α : NaturalIsomorphism F₁ G₁) →
(β : NaturalIsomorphism F₂ G₂) →
NaturalIsomorphism (F₁ ※ F₂) (G₁ ※ G₂)
α ※ⁿⁱ β = record
{ F⇒G = α.F⇒G ※ⁿ β.F⇒G
; F⇐G = α.F⇐G ※ⁿ β.F⇐G
; iso = λ X → record
{ isoˡ = isoˡ (α.iso X) , isoˡ (β.iso X)
; isoʳ = isoʳ (α.iso X) , isoʳ (β.iso X)
}
}
where module α = NaturalIsomorphism α
module β = NaturalIsomorphism β
open Morphism.Iso
module _ (C₁ : Category o ℓ e) (C₂ : Category o′ ℓ′ e′) (C₃ : Category o″ ℓ″ e″) where
private
module C₁ = Category C₁
module C₂ = Category C₂
module C₃ = Category C₃
assocˡ : Functor (Product (Product C₁ C₂) C₃) (Product C₁ (Product C₂ C₃))
assocˡ = record
{ F₀ = < proj₁ ∙ proj₁ , < proj₂ ∙ proj₁ , proj₂ > >
; F₁ = < proj₁ ∙ proj₁ , < proj₂ ∙ proj₁ , proj₂ > >
; identity = C₁.Equiv.refl , C₂.Equiv.refl , C₃.Equiv.refl
; homomorphism = C₁.Equiv.refl , C₂.Equiv.refl , C₃.Equiv.refl
; F-resp-≈ = < proj₁ ∙ proj₁ , < proj₂ ∙ proj₁ , proj₂ > >
}
assocʳ : Functor (Product C₁ (Product C₂ C₃)) (Product (Product C₁ C₂) C₃)
assocʳ = record
{ F₀ = < < proj₁ , proj₁ ∙ proj₂ > , proj₂ ∙ proj₂ >
; F₁ = < < proj₁ , proj₁ ∙ proj₂ > , proj₂ ∙ proj₂ >
; identity = (C₁.Equiv.refl , C₂.Equiv.refl) , C₃.Equiv.refl
; homomorphism = (C₁.Equiv.refl , C₂.Equiv.refl) , C₃.Equiv.refl
; F-resp-≈ = < < proj₁ , proj₁ ∙ proj₂ > , proj₂ ∙ proj₂ >
}
module _ {C : Category o ℓ e} {D : Category o′ ℓ′ e′} where
private
module C = Category C
module D = Category D
πˡ : Functor (Product C D) C
πˡ = record
{ F₀ = proj₁
; F₁ = proj₁
; identity = refl
; homomorphism = refl
; F-resp-≈ = proj₁
}
where open C.Equiv using (refl)
πʳ : Functor (Product C D) D
πʳ = record
{ F₀ = proj₂
; F₁ = proj₂
; identity = refl
; homomorphism = refl
; F-resp-≈ = proj₂
}
where open D.Equiv using (refl)
Swap : Functor (Product C D) (Product D C)
Swap = record
{ F₀ = swap
; F₁ = swap
; identity = D.Equiv.refl , C.Equiv.refl
; homomorphism = D.Equiv.refl , C.Equiv.refl
; F-resp-≈ = swap
}
-- Groupoid Product
Groupoid-× : {C : Category o₁ ℓ₁ e₁} {D : Category o₂ ℓ₂ e₂}
→ IsGroupoid C → IsGroupoid D → IsGroupoid (Product C D)
Groupoid-× c₁ c₂ = record
{ _⁻¹ = map (IsGroupoid._⁻¹ c₁) (IsGroupoid._⁻¹ c₂)
; iso = record { isoˡ = Iso.isoˡ i₁ , Iso.isoˡ i₂
; isoʳ = Iso.isoʳ i₁ , Iso.isoʳ i₂
}
}
where
open Morphism
i₁ = IsGroupoid.iso c₁
i₂ = IsGroupoid.iso c₂
|
Anul 1/Semestrul I/Arhitectura sistemelor de calcul/Lucru/Proiect/TASM/Armin.asm | ArmynC/ArminC-UTM-Info | 0 | 84703 | .model small ; Model memorie small - un segment de date si un segment de cod
.stack 100h ; Rezerva 256 octeti (bytes) spatiu de stiva
.data ; Definire si initializare date
; CHANCHIAN - ASCII --> C = 6(7) | H = 7(2) | A = 6(5)
; v2[3] = a1 = 7
; v2[4] = v2[3] + a2 = 7 + 2 = 9
; v2[5] = v2[4] + a3 = 9 + 5 = 14
; Sir : 7914
a1 db 7 ; a1 = 7
a2 db 2 ; a2 = 2
a3 db 5 ; a3 = 5
v2 db 6 dup(?) ; vector cu 6 elemente neinitializate
sir db 6 dup(' ') ; sir format din 6 spatii
divizor db 10 ; divizor = 10
afisare db "Sirul este:", "$" ; Afiseaza rezultatul cu intrerupere de sir
.code ; Rulare cod post-definire
.startup ; Partea de inceput a codului
mov ax, dgroup ; Registrul ax preia segmentul dgroup (partea de date initiala)
mov ds, ax ; Registrul ds este initializat cu continutul registrului ax
mov al, a1 ; Registrul al [ax -> al (low) | ah (high)] este initializat cu variabila a1
mov v2[3], al ; Vectorul v2[3] = al
add al, a2 ; Registrului al i se aduna registrul a2
mov v2[4], al ; Vectorul v2[4] = al
mov al, v2[4] ; Registrului al i se copiaza vectorul v2[4]
add al, a3 ; Registrului al i se aduna registrul a3
mov v2[5], al ; Vectorul v2[5] = al
mov di,5 ; di = 5 (final sir)
mov sir[di], '$' ; Seteaza caracterul $ ca finalizator
mov si, 5 ; si = 5
vector: ; Subprogram
mov al, v2[si] ; Registrului al i se copiaza vectorul v2[si]
conversie: ; Subprogram
mov ah, 0 ; ah (high) = 0
dec di ; Registrul di (sir) este micsorat cu 1
div divizor ; Numarul curent din registrul ax este impartit la divizor (10)
add ah, '0' ; Registrului ah i se aduna caracterului '0' valoarea cifrei
mov sir[di], ah ; Sirului i se copiaza registrul ah
cmp al, 0 ; Compara registrul al (catul) cu valoarea 0
jne conversie ; Daca registrul ah nu este 0, reia operatia
dec si ; Registrul si (vector) este micsorat cu 1
cmp si, 2 ; Compara registrul si (sirul) cu valoarea 2
jne vector ; Daca indicele vectorului (si) nu este mai mic decat 3, reia operatia
listn: ; Subprogram
mov ah, 09h ; Operatie de scriere a sirului curent in output
mov dx, offset afisare ; Linkeaza locatia mesajului
int 21h ; Se afiseaza caracterul din input
mov dx, offset sir ; Linkeaza locatia a variabilei sir | ds:0010
int 21h ; Se afiseaza caracterul din input
stopprg: ; Subprogram
mov ah, 4ch ; Returneaza controlul cate sistemul de operare
int 21h ; Finalizeaza operatiunea data | AX - > 4x24H
end ; Partea de sfarsit a codului |
clib64.asm | VeroFess/X64SystemCall | 46 | 29855 | .code
memset proc
xor rax, rax
memset_loop:
cmp rax, r8
je memset_end
mov [rcx + rax], dl
inc rax
jmp memset_loop
memset_end:
mov rax, rcx
ret
memset endp
memcpy proc
push r9
xor rax, rax
memcpy_loop:
cmp rax, r8
je memcpy_end
mov r9, [rdx + rax]
mov [rcx + rax], r9
inc rax
jmp memcpy_loop
memcpy_end:
mov rax, rcx
pop r9
ret
memcpy endp
end |
specs/ada/server/ike/tkmrpc-operation_handlers-ike-nc_create.adb | DrenfongWong/tkm-rpc | 0 | 11683 | with
Tkmrpc.Servers.Ike;
with Tkmrpc.Results;
with Tkmrpc.Request.Ike.Nc_Create.Convert;
with Tkmrpc.Response.Ike.Nc_Create.Convert;
package body Tkmrpc.Operation_Handlers.Ike.Nc_Create is
-------------------------------------------------------------------------
procedure Handle (Req : Request.Data_Type; Res : out Response.Data_Type) is
Specific_Req : Request.Ike.Nc_Create.Request_Type;
Specific_Res : Response.Ike.Nc_Create.Response_Type;
begin
Specific_Res := Response.Ike.Nc_Create.Null_Response;
Specific_Req := Request.Ike.Nc_Create.Convert.From_Request (S => Req);
if Specific_Req.Data.Nc_Id'Valid and
Specific_Req.Data.Nonce_Length'Valid
then
Servers.Ike.Nc_Create
(Result => Specific_Res.Header.Result,
Nc_Id => Specific_Req.Data.Nc_Id,
Nonce_Length => Specific_Req.Data.Nonce_Length,
Nonce => Specific_Res.Data.Nonce);
Res :=
Response.Ike.Nc_Create.Convert.To_Response (S => Specific_Res);
else
Res.Header.Result := Results.Invalid_Parameter;
end if;
end Handle;
end Tkmrpc.Operation_Handlers.Ike.Nc_Create;
|
other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/英語_PAL/pal_asm/zel_obj_grph.asm | prismotizm/gigaleak | 0 | 793 | Name: zel_obj_grph.asm
Type: file
Size: 18949
Last-Modified: '2016-05-13T04:25:37Z'
SHA-1: C734EDF7581ADE914AAEECA8EC1DD2689DED419E
Description: null
|
Cubical/Algebra/Group/Construct/Unit.agda | bijan2005/univalent-foundations | 0 | 2469 | {-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.Algebra.Group.Construct.Unit where
open import Cubical.Core.Everything
open import Cubical.Foundations.Prelude
open import Cubical.Algebra.Group
open import Cubical.Data.Prod using (_,_)
open import Cubical.Data.Unit
import Cubical.Algebra.Monoid.Construct.Unit as ⊤Monoid
open ⊤Monoid public hiding (⊤-isMonoid; ⊤-Monoid)
inv : Op₁ ⊤
inv _ = tt
⊤-inverseˡ : LeftInverse tt inv _◯_
⊤-inverseˡ _ = refl
⊤-inverseʳ : RightInverse tt inv _◯_
⊤-inverseʳ _ = refl
⊤-inverse : Inverse tt inv _◯_
⊤-inverse = ⊤-inverseˡ , ⊤-inverseʳ
⊤-isGroup : IsGroup ⊤ _◯_ tt inv
⊤-isGroup = record
{ isMonoid = ⊤Monoid.⊤-isMonoid
; inverse = ⊤-inverse
}
⊤-Group : Group ℓ-zero
⊤-Group = record { isGroup = ⊤-isGroup }
|
alloy4fun_models/trashltl/models/1/FCqL9g23TXxoc9AaW.als | Kaixi26/org.alloytools.alloy | 0 | 4350 | open main
pred idFCqL9g23TXxoc9AaW_prop2 {
historically no (File+Trash+Protected)
}
pred __repair { idFCqL9g23TXxoc9AaW_prop2 }
check __repair { idFCqL9g23TXxoc9AaW_prop2 <=> prop2o } |
programs/oeis/168/A168622.asm | neoneye/loda | 22 | 22354 | <gh_stars>10-100
; A168622: Triangle T(n,k) with the coefficient [x^k] of the polynomial 7*(x+1)^n - 6*(x^n+1) in row n, column k. T(0,0)=1.
; 1,1,1,1,14,1,1,21,21,1,1,28,42,28,1,1,35,70,70,35,1,1,42,105,140,105,42,1,1,49,147,245,245,147,49,1,1,56,196,392,490,392,196,56,1,1,63,252,588,882,882,588,252,63,1,1,70,315,840,1470,1764,1470,840,315,70,1
seq $0,7318 ; Pascal's triangle read by rows: C(n,k) = binomial(n,k) = n!/(k!*(n-k)!), 0 <= k <= n.
mov $1,2
lpb $0
mul $1,7
mul $1,$0
mov $0,1
lpe
sub $1,2
div $1,2
add $1,1
mov $0,$1
|
tests/nonsmoke/functional/CompileTests/experimental_ada_tests/tests/tagged_incomplete_type_declaration.ads | rose-compiler/rose | 488 | 19173 | package Tagged_Incomplete_Type_Declaration is
type Car is tagged;
type Car is tagged
record
Number : Integer;
end record;
end Tagged_Incomplete_Type_Declaration;
|
Data/Binary/Addition.agda | oisdk/agda-playground | 6 | 2407 | <gh_stars>1-10
{-# OPTIONS --without-K --safe #-}
module Data.Binary.Addition where
open import Data.Binary.Definition
open import Data.Binary.Increment
add₁ : 𝔹 → 𝔹 → 𝔹
add₂ : 𝔹 → 𝔹 → 𝔹
add₁ 0ᵇ ys = inc ys
add₁ (1ᵇ xs) 0ᵇ = 2ᵇ xs
add₁ (2ᵇ xs) 0ᵇ = 1ᵇ inc xs
add₁ (1ᵇ xs) (1ᵇ ys) = 1ᵇ add₁ xs ys
add₁ (1ᵇ xs) (2ᵇ ys) = 2ᵇ add₁ xs ys
add₁ (2ᵇ xs) (1ᵇ ys) = 2ᵇ add₁ xs ys
add₁ (2ᵇ xs) (2ᵇ ys) = 1ᵇ add₂ xs ys
add₂ 0ᵇ 0ᵇ = 2ᵇ 0ᵇ
add₂ 0ᵇ (1ᵇ ys) = 1ᵇ inc ys
add₂ 0ᵇ (2ᵇ ys) = 2ᵇ inc ys
add₂ (1ᵇ xs) 0ᵇ = 1ᵇ inc xs
add₂ (2ᵇ xs) 0ᵇ = 2ᵇ inc xs
add₂ (1ᵇ xs) (1ᵇ ys) = 2ᵇ add₁ xs ys
add₂ (1ᵇ xs) (2ᵇ ys) = 1ᵇ add₂ xs ys
add₂ (2ᵇ xs) (1ᵇ ys) = 1ᵇ add₂ xs ys
add₂ (2ᵇ xs) (2ᵇ ys) = 2ᵇ add₂ xs ys
infixl 6 _+_
_+_ : 𝔹 → 𝔹 → 𝔹
0ᵇ + ys = ys
1ᵇ xs + 0ᵇ = 1ᵇ xs
2ᵇ xs + 0ᵇ = 2ᵇ xs
1ᵇ xs + 1ᵇ ys = 2ᵇ (xs + ys)
1ᵇ xs + 2ᵇ ys = 1ᵇ add₁ xs ys
2ᵇ xs + 1ᵇ ys = 1ᵇ add₁ xs ys
2ᵇ xs + 2ᵇ ys = 2ᵇ add₁ xs ys
|
src/music.asm | fjpena/sword-of-ianna-msx2 | 43 | 27191 | <reponame>fjpena/sword-of-ianna-msx2
INCLUDE "music_sfx.sym"
; level1, level2, level3, level4, level5, level6, level7, level8, attrac, secret, nomus gameover intro main menu game end credits
music_levels: dw music1, music5, music3, music4, music5, music6, music7, music8, music0, music4, music0, music_gameover, music_intro, music_menu, music_end, music_credits
atInit: equ MUSIC_CODE
atPlay: equ MUSIC_CODE + 3
atStop: equ MUSIC_CODE + 6
atSfxInit: equ MUSIC_CODE + 9
atSfxPlay: equ MUSIC_CODE + 12
atSfxStop: equ MUSIC_CODE + 15
; Initialize music variables
MUSIC_Init:
xor a
ld (music_playing), a
ld (music_state), a
ld (music_save), a
ret
; Load music
; INPUT:
; - A: music number
MUSIC_Load:
di
ld l, a
ld a, (music_state)
and 2
jr z, MUSIC_Load_music
ld a, 10
jr MUSIC_Load_nomusic
MUSIC_Load_music:
ld a, l
MUSIC_Load_nomusic:
push af
call MUSIC_setbank
ld hl, music_levels
pop af
add a, a
ld e, a
ld d, 0
add hl, de
ld e, (hl)
inc hl
ld d, (hl)
ex de, hl
ld de, music_addr
call depack
ld hl, SFX_ADDR
ld de, music_sfx
call depack
ld de, music_addr
call atInit
ld de, music_sfx
call atSfxInit
ld a, 1
ld (music_playing), a ; music is now playing
call MUSIC_restorebank
ei
ret
MUSIC_restorebank:
ld a, (music_save)
call setROM2_DI ; set previous rom bank
ret
MUSIC_setbank:
ld a, (ROMBank1) ;System var with the previous value
ld (music_save), a
ld a, MUSIC_ROM_PAGE
call setROM2_DI
ret
; Play music
MUSIC_Play:
jp atPlay
; Stop music
MUSIC_Stop:
call atStop
call atSfxStop
xor a
ld (music_playing), a
ret
; Play FX
FX_SWORD1 EQU 1
FX_DESTROY_BLOCK EQU 2
FX_BLOCK_HIT EQU 3
FX_HIT EQU 4
FX_LEVER EQU 5
FX_SKELETON_FALL EQU 6
FX_PICKUP EQU 7
FX_GROUND EQU 8
FX_GRIP EQU 9
FX_UNSHEATHE EQU 10
FX_SHEATHE EQU 11
FX_INVENTORY_MOVE EQU 12
FX_INVENTORY_SELECT EQU 13
FX_OPEN_DOOR EQU 14
FX_CLOSE_DOOR EQU 15
FX_ENTER_DOOR EQU 16
FX_TEXT EQU 17
FX_PAUSE EQU 18
FX_LONGJUMP EQU 19
FX_EMPTY EQU 20
FX_LEVEL_UP EQU 21
; Input:
; A: sound effect to play
FX_Play:
push hl
ld l, a
ld a, (music_state)
and 1
jr nz, FX_Play_nofx
ld a, l
pop hl
push bc
push de
push hl
push ix
push iy
ld l, a ; effect
ld a, 1 ; channel B
ld h, 15 ; volume
ld e, 36 ; C4 ??
ld d, 0
ld bc, 0
call atSfxPlay
pop iy
pop ix
pop hl
pop de
pop bc
ret
FX_Play_nofx:
pop hl
ret
|
programs/oeis/045/A045944.asm | karttu/loda | 1 | 94904 | <reponame>karttu/loda
; A045944: Rhombic matchstick numbers: a(n) = n*(3*n+2).
; 0,5,16,33,56,85,120,161,208,261,320,385,456,533,616,705,800,901,1008,1121,1240,1365,1496,1633,1776,1925,2080,2241,2408,2581,2760,2945,3136,3333,3536,3745,3960,4181,4408,4641,4880,5125,5376,5633,5896,6165,6440,6721,7008,7301,7600,7905,8216,8533,8856,9185,9520,9861,10208,10561,10920,11285,11656,12033,12416,12805,13200,13601,14008,14421,14840,15265,15696,16133,16576,17025,17480,17941,18408,18881,19360,19845,20336,20833,21336,21845,22360,22881,23408,23941,24480,25025,25576,26133,26696,27265,27840,28421,29008,29601,30200,30805,31416,32033,32656,33285,33920,34561,35208,35861,36520,37185,37856,38533,39216,39905,40600,41301,42008,42721,43440,44165,44896,45633,46376,47125,47880,48641,49408,50181,50960,51745,52536,53333,54136,54945,55760,56581,57408,58241,59080,59925,60776,61633,62496,63365,64240,65121,66008,66901,67800,68705,69616,70533,71456,72385,73320,74261,75208,76161,77120,78085,79056,80033,81016,82005,83000,84001,85008,86021,87040,88065,89096,90133,91176,92225,93280,94341,95408,96481,97560,98645,99736,100833,101936,103045,104160,105281,106408,107541,108680,109825,110976,112133,113296,114465,115640,116821,118008,119201,120400,121605,122816,124033,125256,126485,127720,128961,130208,131461,132720,133985,135256,136533,137816,139105,140400,141701,143008,144321,145640,146965,148296,149633,150976,152325,153680,155041,156408,157781,159160,160545,161936,163333,164736,166145,167560,168981,170408,171841,173280,174725,176176,177633,179096,180565,182040,183521,185008,186501
mov $1,3
mul $1,$0
add $1,2
mul $1,$0
|
smsq/qd/exv.asm | olifink/smsqe | 0 | 19360 | <reponame>olifink/smsqe
* Set exception vector (per job) V2.00 1986 <NAME> QJUMP
*
section qd
*
xdef qd_exv
*
xref sms_ckid
xref sms_rte
*
include dev8_keys_jcbq
include dev8_keys_sys
*
* d1 cr job id
* a0 sp base of job
* a1 c p base of table
*
* all other registers preserved
*
qd_exv
bsr.l sms_ckid check id and set a0
bne.s qdx_exit
sub.w #$54,a1
move.l a1,jcb_exv(a0) set vector
move.l a1,sys_ertb(a6)
moveq #0,d0 ... ok
qdx_exit
bra.l sms_rte
end
|
alloy4fun_models/trainstlt/models/13/cEyhPCpFSELFoCwrJ.als | Kaixi26/org.alloytools.alloy | 0 | 1686 | <filename>alloy4fun_models/trainstlt/models/13/cEyhPCpFSELFoCwrJ.als<gh_stars>0
open main
pred idcEyhPCpFSELFoCwrJ_prop14 {
always ( all t:Train | eventually (some t.pos and one (t.pos.signal :>Green) and t.pos' !=t. pos and some t.pos' ) implies (t.pos.signal in Signal-Green) )
}
pred __repair { idcEyhPCpFSELFoCwrJ_prop14 }
check __repair { idcEyhPCpFSELFoCwrJ_prop14 <=> prop14o } |
init.asm | reubenct/OSproject-xv6 | 1 | 104852 | <reponame>reubenct/OSproject-xv6
_init: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
char *argv[] = { "sh", 0 };
int
main(void)
{
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 53 push %ebx
4: 83 e4 f0 and $0xfffffff0,%esp
7: 83 ec 10 sub $0x10,%esp
int pid, wpid;
if(open("console", O_RDWR) < 0){
a: c7 44 24 04 02 00 00 movl $0x2,0x4(%esp)
11: 00
12: c7 04 24 2e 08 00 00 movl $0x82e,(%esp)
19: e8 74 03 00 00 call 392 <open>
1e: 85 c0 test %eax,%eax
20: 0f 88 ac 00 00 00 js d2 <main+0xd2>
mknod("console", 1, 1);
open("console", O_RDWR);
}
dup(0); // stdout
26: c7 04 24 00 00 00 00 movl $0x0,(%esp)
2d: e8 98 03 00 00 call 3ca <dup>
dup(0); // stderr
32: c7 04 24 00 00 00 00 movl $0x0,(%esp)
39: e8 8c 03 00 00 call 3ca <dup>
3e: 66 90 xchg %ax,%ax
for(;;){
printf(1, "init: starting sh\n");
40: c7 44 24 04 36 08 00 movl $0x836,0x4(%esp)
47: 00
48: c7 04 24 01 00 00 00 movl $0x1,(%esp)
4f: e8 6c 04 00 00 call 4c0 <printf>
pid = fork();
54: e8 f1 02 00 00 call 34a <fork>
if(pid < 0){
59: 85 c0 test %eax,%eax
dup(0); // stdout
dup(0); // stderr
for(;;){
printf(1, "init: starting sh\n");
pid = fork();
5b: 89 c3 mov %eax,%ebx
if(pid < 0){
5d: 78 2d js 8c <main+0x8c>
5f: 90 nop
printf(1, "init: fork failed\n");
exit();
}
if(pid == 0){
60: 74 43 je a5 <main+0xa5>
62: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
exec("sh", argv);
printf(1, "init: exec sh failed\n");
exit();
}
while((wpid=wait()) >= 0 && wpid != pid)
68: e8 ed 02 00 00 call 35a <wait>
6d: 85 c0 test %eax,%eax
6f: 90 nop
70: 78 ce js 40 <main+0x40>
72: 39 d8 cmp %ebx,%eax
74: 74 ca je 40 <main+0x40>
printf(1, "zombie!\n");
76: c7 44 24 04 75 08 00 movl $0x875,0x4(%esp)
7d: 00
7e: c7 04 24 01 00 00 00 movl $0x1,(%esp)
85: e8 36 04 00 00 call 4c0 <printf>
8a: eb dc jmp 68 <main+0x68>
for(;;){
printf(1, "init: starting sh\n");
pid = fork();
if(pid < 0){
printf(1, "init: fork failed\n");
8c: c7 44 24 04 49 08 00 movl $0x849,0x4(%esp)
93: 00
94: c7 04 24 01 00 00 00 movl $0x1,(%esp)
9b: e8 20 04 00 00 call 4c0 <printf>
exit();
a0: e8 ad 02 00 00 call 352 <exit>
}
if(pid == 0){
exec("sh", argv);
a5: c7 44 24 04 14 0b 00 movl $0xb14,0x4(%esp)
ac: 00
ad: c7 04 24 5c 08 00 00 movl $0x85c,(%esp)
b4: e8 d1 02 00 00 call 38a <exec>
printf(1, "init: exec sh failed\n");
b9: c7 44 24 04 5f 08 00 movl $0x85f,0x4(%esp)
c0: 00
c1: c7 04 24 01 00 00 00 movl $0x1,(%esp)
c8: e8 f3 03 00 00 call 4c0 <printf>
exit();
cd: e8 80 02 00 00 call 352 <exit>
main(void)
{
int pid, wpid;
if(open("console", O_RDWR) < 0){
mknod("console", 1, 1);
d2: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
d9: 00
da: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp)
e1: 00
e2: c7 04 24 2e 08 00 00 movl $0x82e,(%esp)
e9: e8 ac 02 00 00 call 39a <mknod>
open("console", O_RDWR);
ee: c7 44 24 04 02 00 00 movl $0x2,0x4(%esp)
f5: 00
f6: c7 04 24 2e 08 00 00 movl $0x82e,(%esp)
fd: e8 90 02 00 00 call 392 <open>
102: e9 1f ff ff ff jmp 26 <main+0x26>
107: 66 90 xchg %ax,%ax
109: 66 90 xchg %ax,%ax
10b: 66 90 xchg %ax,%ax
10d: 66 90 xchg %ax,%ax
10f: 90 nop
00000110 <strcpy>:
110: 55 push %ebp
111: 89 e5 mov %esp,%ebp
113: 53 push %ebx
114: 8b 45 08 mov 0x8(%ebp),%eax
117: 8b 4d 0c mov 0xc(%ebp),%ecx
11a: 89 c2 mov %eax,%edx
11c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
120: 83 c1 01 add $0x1,%ecx
123: 0f b6 59 ff movzbl -0x1(%ecx),%ebx
127: 83 c2 01 add $0x1,%edx
12a: 84 db test %bl,%bl
12c: 88 5a ff mov %bl,-0x1(%edx)
12f: 75 ef jne 120 <strcpy+0x10>
131: 5b pop %ebx
132: 5d pop %ebp
133: c3 ret
134: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
13a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
00000140 <strcmp>:
140: 55 push %ebp
141: 89 e5 mov %esp,%ebp
143: 56 push %esi
144: 53 push %ebx
145: 8b 55 08 mov 0x8(%ebp),%edx
148: 8b 4d 0c mov 0xc(%ebp),%ecx
14b: 0f b6 02 movzbl (%edx),%eax
14e: 0f b6 19 movzbl (%ecx),%ebx
151: 84 c0 test %al,%al
153: 75 1e jne 173 <strcmp+0x33>
155: eb 29 jmp 180 <strcmp+0x40>
157: 89 f6 mov %esi,%esi
159: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
160: 83 c2 01 add $0x1,%edx
163: 0f b6 02 movzbl (%edx),%eax
166: 8d 71 01 lea 0x1(%ecx),%esi
169: 0f b6 59 01 movzbl 0x1(%ecx),%ebx
16d: 84 c0 test %al,%al
16f: 74 0f je 180 <strcmp+0x40>
171: 89 f1 mov %esi,%ecx
173: 38 d8 cmp %bl,%al
175: 74 e9 je 160 <strcmp+0x20>
177: 29 d8 sub %ebx,%eax
179: 5b pop %ebx
17a: 5e pop %esi
17b: 5d pop %ebp
17c: c3 ret
17d: 8d 76 00 lea 0x0(%esi),%esi
180: 31 c0 xor %eax,%eax
182: 29 d8 sub %ebx,%eax
184: 5b pop %ebx
185: 5e pop %esi
186: 5d pop %ebp
187: c3 ret
188: 90 nop
189: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000190 <strlen>:
190: 55 push %ebp
191: 89 e5 mov %esp,%ebp
193: 8b 4d 08 mov 0x8(%ebp),%ecx
196: 80 39 00 cmpb $0x0,(%ecx)
199: 74 12 je 1ad <strlen+0x1d>
19b: 31 d2 xor %edx,%edx
19d: 8d 76 00 lea 0x0(%esi),%esi
1a0: 83 c2 01 add $0x1,%edx
1a3: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1)
1a7: 89 d0 mov %edx,%eax
1a9: 75 f5 jne 1a0 <strlen+0x10>
1ab: 5d pop %ebp
1ac: c3 ret
1ad: 31 c0 xor %eax,%eax
1af: 5d pop %ebp
1b0: c3 ret
1b1: eb 0d jmp 1c0 <memset>
1b3: 90 nop
1b4: 90 nop
1b5: 90 nop
1b6: 90 nop
1b7: 90 nop
1b8: 90 nop
1b9: 90 nop
1ba: 90 nop
1bb: 90 nop
1bc: 90 nop
1bd: 90 nop
1be: 90 nop
1bf: 90 nop
000001c0 <memset>:
1c0: 55 push %ebp
1c1: 89 e5 mov %esp,%ebp
1c3: 57 push %edi
1c4: 8b 55 08 mov 0x8(%ebp),%edx
1c7: 8b 4d 10 mov 0x10(%ebp),%ecx
1ca: 8b 45 0c mov 0xc(%ebp),%eax
1cd: 89 d7 mov %edx,%edi
1cf: fc cld
1d0: f3 aa rep stos %al,%es:(%edi)
1d2: 89 d0 mov %edx,%eax
1d4: 5f pop %edi
1d5: 5d pop %ebp
1d6: c3 ret
1d7: 89 f6 mov %esi,%esi
1d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
000001e0 <strchr>:
1e0: 55 push %ebp
1e1: 89 e5 mov %esp,%ebp
1e3: 53 push %ebx
1e4: 8b 45 08 mov 0x8(%ebp),%eax
1e7: 8b 5d 0c mov 0xc(%ebp),%ebx
1ea: 0f b6 10 movzbl (%eax),%edx
1ed: 84 d2 test %dl,%dl
1ef: 74 1d je 20e <strchr+0x2e>
1f1: 38 d3 cmp %dl,%bl
1f3: 89 d9 mov %ebx,%ecx
1f5: 75 0d jne 204 <strchr+0x24>
1f7: eb 17 jmp 210 <strchr+0x30>
1f9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
200: 38 ca cmp %cl,%dl
202: 74 0c je 210 <strchr+0x30>
204: 83 c0 01 add $0x1,%eax
207: 0f b6 10 movzbl (%eax),%edx
20a: 84 d2 test %dl,%dl
20c: 75 f2 jne 200 <strchr+0x20>
20e: 31 c0 xor %eax,%eax
210: 5b pop %ebx
211: 5d pop %ebp
212: c3 ret
213: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
219: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000220 <gets>:
220: 55 push %ebp
221: 89 e5 mov %esp,%ebp
223: 57 push %edi
224: 56 push %esi
225: 53 push %ebx
226: 31 f6 xor %esi,%esi
228: 8d 7d e7 lea -0x19(%ebp),%edi
22b: 83 ec 1c sub $0x1c,%esp
22e: eb 29 jmp 259 <gets+0x39>
230: 83 ec 04 sub $0x4,%esp
233: 6a 01 push $0x1
235: 57 push %edi
236: 6a 00 push $0x0
238: e8 2d 01 00 00 call 36a <read>
23d: 83 c4 10 add $0x10,%esp
240: 85 c0 test %eax,%eax
242: 7e 1d jle 261 <gets+0x41>
244: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
248: 8b 55 08 mov 0x8(%ebp),%edx
24b: 89 de mov %ebx,%esi
24d: 3c 0a cmp $0xa,%al
24f: 88 44 1a ff mov %al,-0x1(%edx,%ebx,1)
253: 74 1b je 270 <gets+0x50>
255: 3c 0d cmp $0xd,%al
257: 74 17 je 270 <gets+0x50>
259: 8d 5e 01 lea 0x1(%esi),%ebx
25c: 3b 5d 0c cmp 0xc(%ebp),%ebx
25f: 7c cf jl 230 <gets+0x10>
261: 8b 45 08 mov 0x8(%ebp),%eax
264: c6 04 30 00 movb $0x0,(%eax,%esi,1)
268: 8d 65 f4 lea -0xc(%ebp),%esp
26b: 5b pop %ebx
26c: 5e pop %esi
26d: 5f pop %edi
26e: 5d pop %ebp
26f: c3 ret
270: 8b 45 08 mov 0x8(%ebp),%eax
273: 89 de mov %ebx,%esi
275: c6 04 30 00 movb $0x0,(%eax,%esi,1)
279: 8d 65 f4 lea -0xc(%ebp),%esp
27c: 5b pop %ebx
27d: 5e pop %esi
27e: 5f pop %edi
27f: 5d pop %ebp
280: c3 ret
281: eb 0d jmp 290 <stat>
283: 90 nop
284: 90 nop
285: 90 nop
286: 90 nop
287: 90 nop
288: 90 nop
289: 90 nop
28a: 90 nop
28b: 90 nop
28c: 90 nop
28d: 90 nop
28e: 90 nop
28f: 90 nop
00000290 <stat>:
290: 55 push %ebp
291: 89 e5 mov %esp,%ebp
293: 56 push %esi
294: 53 push %ebx
295: 83 ec 08 sub $0x8,%esp
298: 6a 00 push $0x0
29a: ff 75 08 pushl 0x8(%ebp)
29d: e8 f0 00 00 00 call 392 <open>
2a2: 83 c4 10 add $0x10,%esp
2a5: 85 c0 test %eax,%eax
2a7: 78 27 js 2d0 <stat+0x40>
2a9: 83 ec 08 sub $0x8,%esp
2ac: ff 75 0c pushl 0xc(%ebp)
2af: 89 c3 mov %eax,%ebx
2b1: 50 push %eax
2b2: e8 f3 00 00 00 call 3aa <fstat>
2b7: 89 c6 mov %eax,%esi
2b9: 89 1c 24 mov %ebx,(%esp)
2bc: e8 b9 00 00 00 call 37a <close>
2c1: 83 c4 10 add $0x10,%esp
2c4: 89 f0 mov %esi,%eax
2c6: 8d 65 f8 lea -0x8(%ebp),%esp
2c9: 5b pop %ebx
2ca: 5e pop %esi
2cb: 5d pop %ebp
2cc: c3 ret
2cd: 8d 76 00 lea 0x0(%esi),%esi
2d0: b8 ff ff ff ff mov $0xffffffff,%eax
2d5: eb ef jmp 2c6 <stat+0x36>
2d7: 89 f6 mov %esi,%esi
2d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
000002e0 <atoi>:
2e0: 55 push %ebp
2e1: 89 e5 mov %esp,%ebp
2e3: 53 push %ebx
2e4: 8b 4d 08 mov 0x8(%ebp),%ecx
2e7: 0f be 11 movsbl (%ecx),%edx
2ea: 8d 42 d0 lea -0x30(%edx),%eax
2ed: 3c 09 cmp $0x9,%al
2ef: b8 00 00 00 00 mov $0x0,%eax
2f4: 77 1f ja 315 <atoi+0x35>
2f6: 8d 76 00 lea 0x0(%esi),%esi
2f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
300: 8d 04 80 lea (%eax,%eax,4),%eax
303: 83 c1 01 add $0x1,%ecx
306: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax
30a: 0f be 11 movsbl (%ecx),%edx
30d: 8d 5a d0 lea -0x30(%edx),%ebx
310: 80 fb 09 cmp $0x9,%bl
313: 76 eb jbe 300 <atoi+0x20>
315: 5b pop %ebx
316: 5d pop %ebp
317: c3 ret
318: 90 nop
319: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000320 <memmove>:
320: 55 push %ebp
321: 89 e5 mov %esp,%ebp
323: 56 push %esi
324: 53 push %ebx
325: 8b 5d 10 mov 0x10(%ebp),%ebx
328: 8b 45 08 mov 0x8(%ebp),%eax
32b: 8b 75 0c mov 0xc(%ebp),%esi
32e: 85 db test %ebx,%ebx
330: 7e 14 jle 346 <memmove+0x26>
332: 31 d2 xor %edx,%edx
334: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
338: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
33c: 88 0c 10 mov %cl,(%eax,%edx,1)
33f: 83 c2 01 add $0x1,%edx
342: 39 da cmp %ebx,%edx
344: 75 f2 jne 338 <memmove+0x18>
346: 5b pop %ebx
347: 5e pop %esi
348: 5d pop %ebp
349: c3 ret
0000034a <fork>:
34a: b8 01 00 00 00 mov $0x1,%eax
34f: cd 40 int $0x40
351: c3 ret
00000352 <exit>:
352: b8 02 00 00 00 mov $0x2,%eax
357: cd 40 int $0x40
359: c3 ret
0000035a <wait>:
35a: b8 03 00 00 00 mov $0x3,%eax
35f: cd 40 int $0x40
361: c3 ret
00000362 <pipe>:
362: b8 04 00 00 00 mov $0x4,%eax
367: cd 40 int $0x40
369: c3 ret
0000036a <read>:
36a: b8 05 00 00 00 mov $0x5,%eax
36f: cd 40 int $0x40
371: c3 ret
00000372 <write>:
372: b8 10 00 00 00 mov $0x10,%eax
377: cd 40 int $0x40
379: c3 ret
0000037a <close>:
37a: b8 15 00 00 00 mov $0x15,%eax
37f: cd 40 int $0x40
381: c3 ret
00000382 <kill>:
382: b8 06 00 00 00 mov $0x6,%eax
387: cd 40 int $0x40
389: c3 ret
0000038a <exec>:
38a: b8 07 00 00 00 mov $0x7,%eax
38f: cd 40 int $0x40
391: c3 ret
00000392 <open>:
392: b8 0f 00 00 00 mov $0xf,%eax
397: cd 40 int $0x40
399: c3 ret
0000039a <mknod>:
39a: b8 11 00 00 00 mov $0x11,%eax
39f: cd 40 int $0x40
3a1: c3 ret
000003a2 <unlink>:
3a2: b8 12 00 00 00 mov $0x12,%eax
3a7: cd 40 int $0x40
3a9: c3 ret
000003aa <fstat>:
3aa: b8 08 00 00 00 mov $0x8,%eax
3af: cd 40 int $0x40
3b1: c3 ret
000003b2 <link>:
3b2: b8 13 00 00 00 mov $0x13,%eax
3b7: cd 40 int $0x40
3b9: c3 ret
000003ba <mkdir>:
3ba: b8 14 00 00 00 mov $0x14,%eax
3bf: cd 40 int $0x40
3c1: c3 ret
000003c2 <chdir>:
3c2: b8 09 00 00 00 mov $0x9,%eax
3c7: cd 40 int $0x40
3c9: c3 ret
000003ca <dup>:
3ca: b8 0a 00 00 00 mov $0xa,%eax
3cf: cd 40 int $0x40
3d1: c3 ret
000003d2 <getpid>:
3d2: b8 0b 00 00 00 mov $0xb,%eax
3d7: cd 40 int $0x40
3d9: c3 ret
000003da <sbrk>:
3da: b8 0c 00 00 00 mov $0xc,%eax
3df: cd 40 int $0x40
3e1: c3 ret
000003e2 <sleep>:
3e2: b8 0d 00 00 00 mov $0xd,%eax
3e7: cd 40 int $0x40
3e9: c3 ret
000003ea <uptime>:
3ea: b8 0e 00 00 00 mov $0xe,%eax
3ef: cd 40 int $0x40
3f1: c3 ret
000003f2 <random>:
3f2: b8 16 00 00 00 mov $0x16,%eax
3f7: cd 40 int $0x40
3f9: c3 ret
000003fa <cprocstate>:
3fa: b8 18 00 00 00 mov $0x18,%eax
3ff: cd 40 int $0x40
401: c3 ret
00000402 <signalinfo>:
402: b8 19 00 00 00 mov $0x19,%eax
407: cd 40 int $0x40
409: c3 ret
0000040a <setseed>:
40a: b8 17 00 00 00 mov $0x17,%eax
40f: cd 40 int $0x40
411: c3 ret
412: 66 90 xchg %ax,%ax
414: 66 90 xchg %ax,%ax
416: 66 90 xchg %ax,%ax
418: 66 90 xchg %ax,%ax
41a: 66 90 xchg %ax,%ax
41c: 66 90 xchg %ax,%ax
41e: 66 90 xchg %ax,%ax
00000420 <printint>:
write(fd, &c, 1);
}
static void
printint(int fd, int xx, int base, int sgn)
{
420: 55 push %ebp
421: 89 e5 mov %esp,%ebp
423: 57 push %edi
424: 56 push %esi
425: 89 c6 mov %eax,%esi
427: 53 push %ebx
428: 83 ec 4c sub $0x4c,%esp
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
42b: 8b 5d 08 mov 0x8(%ebp),%ebx
42e: 85 db test %ebx,%ebx
430: 74 09 je 43b <printint+0x1b>
432: 89 d0 mov %edx,%eax
434: c1 e8 1f shr $0x1f,%eax
437: 84 c0 test %al,%al
439: 75 75 jne 4b0 <printint+0x90>
neg = 1;
x = -xx;
} else {
x = xx;
43b: 89 d0 mov %edx,%eax
static char digits[] = "0123456789ABCDEF";
char buf[16];
int i, neg;
uint x;
neg = 0;
43d: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp)
444: 89 75 c0 mov %esi,-0x40(%ebp)
x = -xx;
} else {
x = xx;
}
i = 0;
447: 31 ff xor %edi,%edi
449: 89 ce mov %ecx,%esi
44b: 8d 5d d7 lea -0x29(%ebp),%ebx
44e: eb 02 jmp 452 <printint+0x32>
do{
buf[i++] = digits[x % base];
450: 89 cf mov %ecx,%edi
452: 31 d2 xor %edx,%edx
454: f7 f6 div %esi
456: 8d 4f 01 lea 0x1(%edi),%ecx
459: 0f b6 92 85 08 00 00 movzbl 0x885(%edx),%edx
}while((x /= base) != 0);
460: 85 c0 test %eax,%eax
x = xx;
}
i = 0;
do{
buf[i++] = digits[x % base];
462: 88 14 0b mov %dl,(%ebx,%ecx,1)
}while((x /= base) != 0);
465: 75 e9 jne 450 <printint+0x30>
if(neg)
467: 8b 55 c4 mov -0x3c(%ebp),%edx
x = xx;
}
i = 0;
do{
buf[i++] = digits[x % base];
46a: 89 c8 mov %ecx,%eax
46c: 8b 75 c0 mov -0x40(%ebp),%esi
}while((x /= base) != 0);
if(neg)
46f: 85 d2 test %edx,%edx
471: 74 08 je 47b <printint+0x5b>
buf[i++] = '-';
473: 8d 4f 02 lea 0x2(%edi),%ecx
476: c6 44 05 d8 2d movb $0x2d,-0x28(%ebp,%eax,1)
while(--i >= 0)
47b: 8d 79 ff lea -0x1(%ecx),%edi
47e: 66 90 xchg %ax,%ax
480: 0f b6 44 3d d8 movzbl -0x28(%ebp,%edi,1),%eax
485: 83 ef 01 sub $0x1,%edi
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
488: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
48f: 00
490: 89 5c 24 04 mov %ebx,0x4(%esp)
494: 89 34 24 mov %esi,(%esp)
497: 88 45 d7 mov %al,-0x29(%ebp)
49a: e8 d3 fe ff ff call 372 <write>
buf[i++] = digits[x % base];
}while((x /= base) != 0);
if(neg)
buf[i++] = '-';
while(--i >= 0)
49f: 83 ff ff cmp $0xffffffff,%edi
4a2: 75 dc jne 480 <printint+0x60>
putc(fd, buf[i]);
}
4a4: 83 c4 4c add $0x4c,%esp
4a7: 5b pop %ebx
4a8: 5e pop %esi
4a9: 5f pop %edi
4aa: 5d pop %ebp
4ab: c3 ret
4ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
uint x;
neg = 0;
if(sgn && xx < 0){
neg = 1;
x = -xx;
4b0: 89 d0 mov %edx,%eax
4b2: f7 d8 neg %eax
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
neg = 1;
4b4: c7 45 c4 01 00 00 00 movl $0x1,-0x3c(%ebp)
4bb: eb 87 jmp 444 <printint+0x24>
4bd: 8d 76 00 lea 0x0(%esi),%esi
000004c0 <printf>:
}
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
4c0: 55 push %ebp
4c1: 89 e5 mov %esp,%ebp
4c3: 57 push %edi
char *s;
int c, i, state;
uint *ap;
state = 0;
4c4: 31 ff xor %edi,%edi
}
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
4c6: 56 push %esi
4c7: 53 push %ebx
4c8: 83 ec 3c sub $0x3c,%esp
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
4cb: 8b 5d 0c mov 0xc(%ebp),%ebx
char *s;
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
4ce: 8d 45 10 lea 0x10(%ebp),%eax
}
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
4d1: 8b 75 08 mov 0x8(%ebp),%esi
char *s;
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
4d4: 89 45 d4 mov %eax,-0x2c(%ebp)
for(i = 0; fmt[i]; i++){
4d7: 0f b6 13 movzbl (%ebx),%edx
4da: 83 c3 01 add $0x1,%ebx
4dd: 84 d2 test %dl,%dl
4df: 75 39 jne 51a <printf+0x5a>
4e1: e9 c2 00 00 00 jmp 5a8 <printf+0xe8>
4e6: 66 90 xchg %ax,%ax
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
4e8: 83 fa 25 cmp $0x25,%edx
4eb: 0f 84 bf 00 00 00 je 5b0 <printf+0xf0>
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
4f1: 8d 45 e2 lea -0x1e(%ebp),%eax
4f4: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
4fb: 00
4fc: 89 44 24 04 mov %eax,0x4(%esp)
500: 89 34 24 mov %esi,(%esp)
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
state = '%';
} else {
putc(fd, c);
503: 88 55 e2 mov %dl,-0x1e(%ebp)
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
506: e8 67 fe ff ff call 372 <write>
50b: 83 c3 01 add $0x1,%ebx
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
50e: 0f b6 53 ff movzbl -0x1(%ebx),%edx
512: 84 d2 test %dl,%dl
514: 0f 84 8e 00 00 00 je 5a8 <printf+0xe8>
c = fmt[i] & 0xff;
if(state == 0){
51a: 85 ff test %edi,%edi
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
c = fmt[i] & 0xff;
51c: 0f be c2 movsbl %dl,%eax
if(state == 0){
51f: 74 c7 je 4e8 <printf+0x28>
if(c == '%'){
state = '%';
} else {
putc(fd, c);
}
} else if(state == '%'){
521: 83 ff 25 cmp $0x25,%edi
524: 75 e5 jne 50b <printf+0x4b>
if(c == 'd'){
526: 83 fa 64 cmp $0x64,%edx
529: 0f 84 31 01 00 00 je 660 <printf+0x1a0>
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
52f: 25 f7 00 00 00 and $0xf7,%eax
534: 83 f8 70 cmp $0x70,%eax
537: 0f 84 83 00 00 00 je 5c0 <printf+0x100>
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
53d: 83 fa 73 cmp $0x73,%edx
540: 0f 84 a2 00 00 00 je 5e8 <printf+0x128>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
546: 83 fa 63 cmp $0x63,%edx
549: 0f 84 35 01 00 00 je 684 <printf+0x1c4>
putc(fd, *ap);
ap++;
} else if(c == '%'){
54f: 83 fa 25 cmp $0x25,%edx
552: 0f 84 e0 00 00 00 je 638 <printf+0x178>
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
558: 8d 45 e6 lea -0x1a(%ebp),%eax
55b: 83 c3 01 add $0x1,%ebx
55e: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
565: 00
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
566: 31 ff xor %edi,%edi
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
568: 89 44 24 04 mov %eax,0x4(%esp)
56c: 89 34 24 mov %esi,(%esp)
56f: 89 55 d0 mov %edx,-0x30(%ebp)
572: c6 45 e6 25 movb $0x25,-0x1a(%ebp)
576: e8 f7 fd ff ff call 372 <write>
} else if(c == '%'){
putc(fd, c);
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
57b: 8b 55 d0 mov -0x30(%ebp),%edx
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
57e: 8d 45 e7 lea -0x19(%ebp),%eax
581: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
588: 00
589: 89 44 24 04 mov %eax,0x4(%esp)
58d: 89 34 24 mov %esi,(%esp)
} else if(c == '%'){
putc(fd, c);
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
590: 88 55 e7 mov %dl,-0x19(%ebp)
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
593: e8 da fd ff ff call 372 <write>
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
598: 0f b6 53 ff movzbl -0x1(%ebx),%edx
59c: 84 d2 test %dl,%dl
59e: 0f 85 76 ff ff ff jne 51a <printf+0x5a>
5a4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
putc(fd, c);
}
state = 0;
}
}
}
5a8: 83 c4 3c add $0x3c,%esp
5ab: 5b pop %ebx
5ac: 5e pop %esi
5ad: 5f pop %edi
5ae: 5d pop %ebp
5af: c3 ret
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
state = '%';
5b0: bf 25 00 00 00 mov $0x25,%edi
5b5: e9 51 ff ff ff jmp 50b <printf+0x4b>
5ba: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
} else if(state == '%'){
if(c == 'd'){
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
printint(fd, *ap, 16, 0);
5c0: 8b 45 d4 mov -0x2c(%ebp),%eax
5c3: b9 10 00 00 00 mov $0x10,%ecx
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
5c8: 31 ff xor %edi,%edi
} else if(state == '%'){
if(c == 'd'){
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
printint(fd, *ap, 16, 0);
5ca: c7 04 24 00 00 00 00 movl $0x0,(%esp)
5d1: 8b 10 mov (%eax),%edx
5d3: 89 f0 mov %esi,%eax
5d5: e8 46 fe ff ff call 420 <printint>
ap++;
5da: 83 45 d4 04 addl $0x4,-0x2c(%ebp)
5de: e9 28 ff ff ff jmp 50b <printf+0x4b>
5e3: 90 nop
5e4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
} else if(c == 's'){
s = (char*)*ap;
5e8: 8b 45 d4 mov -0x2c(%ebp),%eax
ap++;
5eb: 83 45 d4 04 addl $0x4,-0x2c(%ebp)
ap++;
} else if(c == 'x' || c == 'p'){
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
s = (char*)*ap;
5ef: 8b 38 mov (%eax),%edi
ap++;
if(s == 0)
s = "(null)";
5f1: b8 7e 08 00 00 mov $0x87e,%eax
5f6: 85 ff test %edi,%edi
5f8: 0f 44 f8 cmove %eax,%edi
while(*s != 0){
5fb: 0f b6 07 movzbl (%edi),%eax
5fe: 84 c0 test %al,%al
600: 74 2a je 62c <printf+0x16c>
602: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
608: 88 45 e3 mov %al,-0x1d(%ebp)
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
60b: 8d 45 e3 lea -0x1d(%ebp),%eax
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
60e: 83 c7 01 add $0x1,%edi
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
611: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
618: 00
619: 89 44 24 04 mov %eax,0x4(%esp)
61d: 89 34 24 mov %esi,(%esp)
620: e8 4d fd ff ff call 372 <write>
} else if(c == 's'){
s = (char*)*ap;
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
625: 0f b6 07 movzbl (%edi),%eax
628: 84 c0 test %al,%al
62a: 75 dc jne 608 <printf+0x148>
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
62c: 31 ff xor %edi,%edi
62e: e9 d8 fe ff ff jmp 50b <printf+0x4b>
633: 90 nop
634: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
638: 8d 45 e5 lea -0x1b(%ebp),%eax
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
63b: 31 ff xor %edi,%edi
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
63d: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
644: 00
645: 89 44 24 04 mov %eax,0x4(%esp)
649: 89 34 24 mov %esi,(%esp)
64c: c6 45 e5 25 movb $0x25,-0x1b(%ebp)
650: e8 1d fd ff ff call 372 <write>
655: e9 b1 fe ff ff jmp 50b <printf+0x4b>
65a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
} else {
putc(fd, c);
}
} else if(state == '%'){
if(c == 'd'){
printint(fd, *ap, 10, 1);
660: 8b 45 d4 mov -0x2c(%ebp),%eax
663: b9 0a 00 00 00 mov $0xa,%ecx
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
668: 66 31 ff xor %di,%di
} else {
putc(fd, c);
}
} else if(state == '%'){
if(c == 'd'){
printint(fd, *ap, 10, 1);
66b: c7 04 24 01 00 00 00 movl $0x1,(%esp)
672: 8b 10 mov (%eax),%edx
674: 89 f0 mov %esi,%eax
676: e8 a5 fd ff ff call 420 <printint>
ap++;
67b: 83 45 d4 04 addl $0x4,-0x2c(%ebp)
67f: e9 87 fe ff ff jmp 50b <printf+0x4b>
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
putc(fd, *ap);
684: 8b 45 d4 mov -0x2c(%ebp),%eax
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
687: 31 ff xor %edi,%edi
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
putc(fd, *ap);
689: 8b 00 mov (%eax),%eax
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
68b: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
692: 00
693: 89 34 24 mov %esi,(%esp)
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
putc(fd, *ap);
696: 88 45 e4 mov %al,-0x1c(%ebp)
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
699: 8d 45 e4 lea -0x1c(%ebp),%eax
69c: 89 44 24 04 mov %eax,0x4(%esp)
6a0: e8 cd fc ff ff call 372 <write>
putc(fd, *s);
s++;
}
} else if(c == 'c'){
putc(fd, *ap);
ap++;
6a5: 83 45 d4 04 addl $0x4,-0x2c(%ebp)
6a9: e9 5d fe ff ff jmp 50b <printf+0x4b>
6ae: 66 90 xchg %ax,%ax
000006b0 <free>:
6b0: 55 push %ebp
6b1: a1 1c 0b 00 00 mov 0xb1c,%eax
6b6: 89 e5 mov %esp,%ebp
6b8: 57 push %edi
6b9: 56 push %esi
6ba: 53 push %ebx
6bb: 8b 5d 08 mov 0x8(%ebp),%ebx
6be: 8b 10 mov (%eax),%edx
6c0: 8d 4b f8 lea -0x8(%ebx),%ecx
6c3: 39 c8 cmp %ecx,%eax
6c5: 73 19 jae 6e0 <free+0x30>
6c7: 89 f6 mov %esi,%esi
6c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
6d0: 39 d1 cmp %edx,%ecx
6d2: 72 1c jb 6f0 <free+0x40>
6d4: 39 d0 cmp %edx,%eax
6d6: 73 18 jae 6f0 <free+0x40>
6d8: 89 d0 mov %edx,%eax
6da: 39 c8 cmp %ecx,%eax
6dc: 8b 10 mov (%eax),%edx
6de: 72 f0 jb 6d0 <free+0x20>
6e0: 39 d0 cmp %edx,%eax
6e2: 72 f4 jb 6d8 <free+0x28>
6e4: 39 d1 cmp %edx,%ecx
6e6: 73 f0 jae 6d8 <free+0x28>
6e8: 90 nop
6e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
6f0: 8b 73 fc mov -0x4(%ebx),%esi
6f3: 8d 3c f1 lea (%ecx,%esi,8),%edi
6f6: 39 d7 cmp %edx,%edi
6f8: 74 19 je 713 <free+0x63>
6fa: 89 53 f8 mov %edx,-0x8(%ebx)
6fd: 8b 50 04 mov 0x4(%eax),%edx
700: 8d 34 d0 lea (%eax,%edx,8),%esi
703: 39 f1 cmp %esi,%ecx
705: 74 23 je 72a <free+0x7a>
707: 89 08 mov %ecx,(%eax)
709: a3 1c 0b 00 00 mov %eax,0xb1c
70e: 5b pop %ebx
70f: 5e pop %esi
710: 5f pop %edi
711: 5d pop %ebp
712: c3 ret
713: 03 72 04 add 0x4(%edx),%esi
716: 89 73 fc mov %esi,-0x4(%ebx)
719: 8b 10 mov (%eax),%edx
71b: 8b 12 mov (%edx),%edx
71d: 89 53 f8 mov %edx,-0x8(%ebx)
720: 8b 50 04 mov 0x4(%eax),%edx
723: 8d 34 d0 lea (%eax,%edx,8),%esi
726: 39 f1 cmp %esi,%ecx
728: 75 dd jne 707 <free+0x57>
72a: 03 53 fc add -0x4(%ebx),%edx
72d: a3 1c 0b 00 00 mov %eax,0xb1c
732: 89 50 04 mov %edx,0x4(%eax)
735: 8b 53 f8 mov -0x8(%ebx),%edx
738: 89 10 mov %edx,(%eax)
73a: 5b pop %ebx
73b: 5e pop %esi
73c: 5f pop %edi
73d: 5d pop %ebp
73e: c3 ret
73f: 90 nop
00000740 <malloc>:
740: 55 push %ebp
741: 89 e5 mov %esp,%ebp
743: 57 push %edi
744: 56 push %esi
745: 53 push %ebx
746: 83 ec 0c sub $0xc,%esp
749: 8b 45 08 mov 0x8(%ebp),%eax
74c: 8b 15 1c 0b 00 00 mov 0xb1c,%edx
752: 8d 78 07 lea 0x7(%eax),%edi
755: c1 ef 03 shr $0x3,%edi
758: 83 c7 01 add $0x1,%edi
75b: 85 d2 test %edx,%edx
75d: 0f 84 a3 00 00 00 je 806 <malloc+0xc6>
763: 8b 02 mov (%edx),%eax
765: 8b 48 04 mov 0x4(%eax),%ecx
768: 39 cf cmp %ecx,%edi
76a: 76 74 jbe 7e0 <malloc+0xa0>
76c: 81 ff 00 10 00 00 cmp $0x1000,%edi
772: be 00 10 00 00 mov $0x1000,%esi
777: 8d 1c fd 00 00 00 00 lea 0x0(,%edi,8),%ebx
77e: 0f 43 f7 cmovae %edi,%esi
781: ba 00 80 00 00 mov $0x8000,%edx
786: 81 ff ff 0f 00 00 cmp $0xfff,%edi
78c: 0f 46 da cmovbe %edx,%ebx
78f: eb 10 jmp 7a1 <malloc+0x61>
791: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
798: 8b 02 mov (%edx),%eax
79a: 8b 48 04 mov 0x4(%eax),%ecx
79d: 39 cf cmp %ecx,%edi
79f: 76 3f jbe 7e0 <malloc+0xa0>
7a1: 39 05 1c 0b 00 00 cmp %eax,0xb1c
7a7: 89 c2 mov %eax,%edx
7a9: 75 ed jne 798 <malloc+0x58>
7ab: 83 ec 0c sub $0xc,%esp
7ae: 53 push %ebx
7af: e8 26 fc ff ff call 3da <sbrk>
7b4: 83 c4 10 add $0x10,%esp
7b7: 83 f8 ff cmp $0xffffffff,%eax
7ba: 74 1c je 7d8 <malloc+0x98>
7bc: 89 70 04 mov %esi,0x4(%eax)
7bf: 83 ec 0c sub $0xc,%esp
7c2: 83 c0 08 add $0x8,%eax
7c5: 50 push %eax
7c6: e8 e5 fe ff ff call 6b0 <free>
7cb: 8b 15 1c 0b 00 00 mov 0xb1c,%edx
7d1: 83 c4 10 add $0x10,%esp
7d4: 85 d2 test %edx,%edx
7d6: 75 c0 jne 798 <malloc+0x58>
7d8: 31 c0 xor %eax,%eax
7da: eb 1c jmp 7f8 <malloc+0xb8>
7dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
7e0: 39 cf cmp %ecx,%edi
7e2: 74 1c je 800 <malloc+0xc0>
7e4: 29 f9 sub %edi,%ecx
7e6: 89 48 04 mov %ecx,0x4(%eax)
7e9: 8d 04 c8 lea (%eax,%ecx,8),%eax
7ec: 89 78 04 mov %edi,0x4(%eax)
7ef: 89 15 1c 0b 00 00 mov %edx,0xb1c
7f5: 83 c0 08 add $0x8,%eax
7f8: 8d 65 f4 lea -0xc(%ebp),%esp
7fb: 5b pop %ebx
7fc: 5e pop %esi
7fd: 5f pop %edi
7fe: 5d pop %ebp
7ff: c3 ret
800: 8b 08 mov (%eax),%ecx
802: 89 0a mov %ecx,(%edx)
804: eb e9 jmp 7ef <malloc+0xaf>
806: c7 05 1c 0b 00 00 20 movl $0xb20,0xb1c
80d: 0b 00 00
810: c7 05 20 0b 00 00 20 movl $0xb20,0xb20
817: 0b 00 00
81a: b8 20 0b 00 00 mov $0xb20,%eax
81f: c7 05 24 0b 00 00 00 movl $0x0,0xb24
826: 00 00 00
829: e9 3e ff ff ff jmp 76c <malloc+0x2c>
|
Library/Text/TextLine/tlTabLeader.asm | steakknife/pcgeos | 504 | 171621 | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1992 -- All Rights Reserved
PROJECT: PC GEOS
MODULE:
FILE: tlTabLeader.asm
AUTHOR: <NAME>, Feb 26, 1992
ROUTINES:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
John 2/26/92 Initial revision
DESCRIPTION:
Misc border related stuff.
$Id: tlTabLeader.asm,v 1.1 97/04/07 11:20:44 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TextBorder segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DrawTabLeader
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Draw a tab leader for a field.
CALLED BY: CommonFieldDraw
PASS: *ds:si = Instance ptr
es:di = Line
es:di.bx= Field
ss:bp = CommonDrawParameters
ax = TabLeader
RETURN: nothing
DESTROYED: ax, cx
PSEUDO CODE/STRATEGY:
leaderType = LeaderFromTab(field.tab)
if (leaderType != TL_NONE) {
if (field == firstField) {
prevFieldEnd = 0
} else {
pf = fieldOffset - sizeof(FieldInfo)
prevFieldEnd = pf.position + pf.width
}
left = lineLeft + prevFieldEnd
right = lineLeft + field.position
y = line.baseline
if (left != right) {
call leaderHandlerTable[leaderType]
}
}
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 1/ 6/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DrawTabLeader proc far
class VisTextClass
uses bx, dx, di
.enter inherit CommonFieldDraw
;
; If we are drawing a tab-leader then we clearly are drawing all the
; characters in the field. Set the drawOffset to 0 so that all the
; characters in things like the dot-leader get drawn.
;
push di, ax ; Save line offset, TabLeader
call TextBorder_DerefVis_DI ; ds:di <- instance ptr
mov di, ds:[di].VTI_gstate ; di <- gstate
clr ax ; Draw everything
call GrSetTextDrawOffset ; Set the drawOffset
pop di, ax ; Restore line offset, TabLeader
;
; There is a tab leader. We need to compute the area it covers.
;
clr cx ; Assume first field
cmp bx, offset LI_firstField
je gotPrevFieldEnd ; Branch if first field
;
; This isn't the first field. Compute the right edge of the previous one
;
push bx ; Save field offset
sub bx, size FieldInfo ; es:di.bx <- previous field
mov cx, es:[di][bx].FI_position
add cx, es:[di][bx].FI_width
pop bx ; Restore field offset
gotPrevFieldEnd:
;
; We have the end of the previous field.
;
; *ds:si= Instance ptr
; es:di = Line
; ax = TabLeader
; bx = Offset to current field
; cx = End of previous field
;
add cx, es:[di].LI_adjustment
mov dx, es:[di][bx].FI_position
add dx, es:[di].LI_adjustment
;
; Here's the various situations:
;
; tab stop
; |
; LEFT TAB: |
; |text
; [t.line][offset]|
; (want leader to reach left side of tab line)
;
; RIGHT TAB: |
; text|
; |[offset][t.line]
; (want leader to reach left side of text)
;
; CENTER TAB: |
; te|xt
; [t.line][offset]|
; (want leader to reach min(left side of text, left side of tab line)
;
; DECIMAL TAB: |
; $100|00
; [t.line][offset]|
; (want leader to reach min(left side of text, left side of tab line)
;
; If a left tab, we return the offset from the tab stop back to the
; left side of the tab line.
;
; If a right tab then spacing is zero since tab line is drawn to right
; of tab position (plus offset) and we want the tab leader to reach
; the left side of the text.
;
; If a center or decimal tab, we return the offset from the tab stop
; back to the left side of the tab line, and let DrawTabLeader get the
; minimum of that and the left side of the text.
;
; The left tab case can also be handled like the center/decimal tab
; case since the min(left side of tab line, left side of text) is
; going to be (left side of tab line).
;
; As a matter of fact, since we return the distance from the tab stop
; to the right side of the tab line for the right tab case, we can
; always use this:
;
; right side of tab leader = min(left side of text,
; tab stop position
; + adjustment for tab line width
; + adjustment for tab line offset)
;
; - brianc 11/3/94
;
push ax, cx, bp ; save TabLeader, left, params
mov bp, params.CDP_liclVars ; ss:bp = LICL_vars
mov al, es:[di][bx].FI_tab ; al = TabReference
call TabGetPositionAndAttributes ; cx = position, bx = spacing
; al = TabAttributes
add cx, bx ; cx = left side of tab line
; (right side for right tab)
cmp dx, cx ; left side of text < tab line?
jbe haveLeaderRight ; yes, leader only reaches text
mov dx, cx ; else, leader reaches tab line
haveLeaderRight:
pop ax, cx, bp ; ax = TabLeader, cx = left
; side of tab leader
; bp = params
;
; cx,dx = Range to draw to
; ax = TabLeader
;
cmp cx, dx ; check bounds
jg noLeader ; nothing to draw
shl ax, 1 ; ax <- index into table of words
mov_tr bx, ax ; bx <- index into table of words
call cs:leaderHandlerTable[bx] ; Call the routine
noLeader:
.leave
ret
DrawTabLeader endp
leaderHandlerTable label word
word offset DrawTabLeaderNone ; Should never be called
word offset DrawTabLeaderDot ; TL_DOT
word offset DrawTabLeaderLine ; TL_LINE
word offset DrawTabLeaderBullet ; TL_BULLET
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DrawTabLeaderNone
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Draw nothing... This routine should never be reached
CALLED BY: DrawTabLeader via leaderHandlerTable
PASS: xxx
RETURN: xxx
DESTROYED: xxx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 1/ 7/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DrawTabLeaderNone proc near
EC < ERROR -1 >
NEC < .fall_thru >
DrawTabLeaderNone endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DrawTabLeaderLine
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Draw a line tab-leader.
CALLED BY: DrawTabLeader via leaderHandlerTable
PASS: *ds:si = Instance ptr
es:di = Line
cx = Left edge of area to draw the leader to
dx = Right edge of area to draw the leader to
ss:bp = Inheritable CommonDrawParameters
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 1/ 7/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DrawTabLeaderLine proc near
class VisTextClass
uses ax, bx, cx, dx, di
.enter inherit DrawTabLeader
push cx, dx ; Save left, right
;
; Compute the Y position to draw at
;
CommonLineGetBLO ; dx.bl <- baseline
ceilwbf dxbl, dx ; dx <- baseline
add dx, params.CDP_drawPos.PWBF_y.WBF_int
push dx ; Save Y position to draw at
;
; Set the character attributes so we can use them for drawing the
; line.
;
call TextBorder_DerefVis_DI ; ds:di <- instance ptr
mov di, ds:[di].VTI_gstate ; di <- gstate
movdw dxax, gdfVars.GDFV_textOffset ; dx.ax <- offset to the TAB
call SetupGStateForDrawAtOffset ; Do the setup
;
; Copy the character attributes into the line attributes
;
call GrGetTextColor ; al, bl, bh <- RGB
mov ah, CF_RGB
call GrSetLineColor
mov al, GMT_ENUM
call GrGetTextMask
call GrSetLineMask
;
; Draw the line
;
pop bx ; bx <- Y position
pop ax, cx ; ax <- left
; cx <- right
call GrDrawHLine ; Draw the line
.leave
ret
DrawTabLeaderLine endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DrawTabLeaderBullet
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Draw a bullet tab-leader.
CALLED BY: DrawTabLeader via leaderHandlerTable
PASS: *ds:si = Instance ptr
es:di = Line
cx = Left edge of area to draw the leader to
dx = Right edge of area to draw the leader to
ss:bp = Inheritable CommonDrawParameters
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 1/ 7/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DrawRepeatedStringParams struc
DRSP_string dword ; String pointer
DRSP_count word ; Size of string
DrawRepeatedStringParams ends
REPEATED_CHAR_COUNT = 32
DrawTabLeaderBullet proc near
uses ax, bx
.enter inherit DrawTabLeader
;
; Lock the resource containing the leader strings
;
FXIP< mov bx, handle TabLeaderStringsXIP >
FXIP< call MemLock ; ax <- seg >
sub sp, size DrawRepeatedStringParams
mov bx, sp ; ss:bx <- parameters
FXIP< mov ss:[bx].DRSP_string.segment, ax >
NOFXIP< mov ss:[bx].DRSP_string.segment, cs >
mov ax, offset bulletString
mov ss:[bx].DRSP_string.offset, ax
mov ss:[bx].DRSP_count, REPEATED_CHAR_COUNT
call DrawTabLeaderRepeatedString
FXIP< mov bx, handle TabLeaderStringsXIP >
FXIP< call MemUnlock >
add sp, size DrawRepeatedStringParams
.leave
ret
DrawTabLeaderBullet endp
if _FXIP
TabLeaderStringsXIP segment resource
endif
SBCS <bulletString byte REPEATED_CHAR_COUNT dup (C_BULLET) >
if PZ_PCGEOS
;
; C_BULLET doesn't exist in SJIS, so we use an alternative.
;
DBCS <bulletString wchar REPEATED_CHAR_COUNT dup (C_KATAKANA_MIDDLE_DOT)>
else
DBCS <bulletString wchar REPEATED_CHAR_COUNT dup (C_BULLET) >
endif
if _FXIP
TabLeaderStringsXIP ends
endif
;------------
DrawTabLeaderDot proc near
uses ax, bx
.enter inherit DrawTabLeader
;
; Lock the resource containing the leader strings
;
FXIP< mov bx, handle TabLeaderStringsXIP >
FXIP< call MemLock ; ax <- seg >
sub sp, size DrawRepeatedStringParams
mov bx, sp ; ss:bx <- parameters
FXIP< mov ss:[bx].DRSP_string.segment, ax >
NOFXIP< mov ss:[bx].DRSP_string.segment, cs >
mov ax, offset dotString
mov ss:[bx].DRSP_string.offset, ax
mov ss:[bx].DRSP_count, REPEATED_CHAR_COUNT
call DrawTabLeaderRepeatedString
FXIP< mov bx, handle TabLeaderStringsXIP >
FXIP< call MemUnlock >
add sp, size DrawRepeatedStringParams
.leave
ret
DrawTabLeaderDot endp
if _FXIP
TabLeaderStringsXIP segment resource
endif
SBCS <dotString byte REPEATED_CHAR_COUNT dup ('.') >
DBCS <dotString wchar REPEATED_CHAR_COUNT dup ('.') >
if _FXIP
TabLeaderStringsXIP ends
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DrawTabLeaderRepeatedString
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Draw a tab-leader consisting of a string to repeat.
CALLED BY: DrawTabLeaderBullet, DrawTabLeaderDot
PASS: *ds:si = Instance ptr
es:di = Line
cx = Left edge of area to draw the leader to
dx = Right edge of area to draw the leader to
ss:bp = Inheritable CommonDrawParameters
ss:bx = DrawRepeatedStringParams
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 1/ 7/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DrawTabLeaderRepeatedString proc near
class VisTextClass
uses ax, bx, cx, dx, si, ds
.enter inherit DrawTabLeader
;
; Compute the width of the area to fill
;
sub dx, cx ; dx <- width
mov ax, dx ; ax <- width
;
; Compute the Y position to draw at
;
ceilwbf es:[di].LI_blo, dx ; dx <- baseline
add dx, params.CDP_drawPos.PWBF_y.WBF_int
push cx, dx ; Save X/Y position
push ax ; Save width
;
; Set the gstate so that it has the character attribute appropriate for
; the position in the text where the tab falls.
;
call TextBorder_DerefVis_DI ; ds:di <- instance ptr
mov di, ds:[di].VTI_gstate ; di <- gstate
movdw dxax, gdfVars.GDFV_textOffset ; dx.ax <- offset to the TAB
call SetupGStateForDrawAtOffset ; Do the setup
;
; Set the gstate to draw text from the baseline.
;
mov al, mask TM_DRAW_BASE
mov ah, mask TM_DRAW_OPTIONAL_HYPHENS or \
mask TM_DRAW_ACCENT or \
mask TM_DRAW_BOTTOM
call GrSetTextMode
;
; Set to no track-kerning.
;
clr ax
call GrSetTrackKern
;
; Figure out how many dots we'll need to draw in order to make this
; happen. To get this we divide the width (dx-cx) by the width
; of a dot.
;
segmov ds, ss:[bx].DRSP_string.segment, ax
mov si, ss:[bx].DRSP_string.offset ; ds:si <- string to use
mov cx, ss:[bx].DRSP_count ; cx <- size of string
pop dx ; Restore width
push cx ; Save string length
clr cx ; dx.cx <- width (WWFixed)
mov bx, dx ; bx.cx <- width (WWFixed)
LocalGetChar ax, ds:[si], NO_ADVANCE ; ax <- character to use
SBCS < clr ah >
call GrCharWidth ; dx.ah <- width of char
clr al ; dx.ax <- width of char
xchg dx, bx ; dx.cx <- width of area
; bx.ax <- width of char
call GrUDivWWFixed ; dx.cx <- result
; dx <- integer result
pop cx ; cx <- string length
pop ax, bx ; ax <- left edge
; bx <- top edge
call GrMoveTo
drawLoop:
;
; Check for no more dots to draw
; Pen position set to place to draw at
; dx = Number of characters to draw
; cx = String length
; ds:si = pointer to dot-string
;
tst dx ; Check for none will fit
jz quit ; Branch if no dots will fit
;
; Figure out how many we *can* draw
;
push cx ; Save string length
cmp dx, cx ; Check for more than in string
jae gotCount ; Branch if not
mov cx, dx ; Otherwise use as many as we can
gotCount:
;
; Draw as many as we can
; ds:si = Dot-string
; cx = Number to draw
;
call GrDrawTextAtCP ; Draw some dots
sub dx, cx ; dx <- # left to draw
pop cx ; Restore string length
jmp drawLoop ; Loop to draw more
quit:
.leave
ret
DrawTabLeaderRepeatedString endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SetupGStateForDrawAtOffset
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Setup a gstate for drawing characters at a given offset.
CALLED BY: DrawTabLeaderRepeatedString, DrawTabLeaderLine
PASS: *ds:si = Instance
dx.ax = Offset to setup for
di = GState
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 5/19/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SetupGStateForDrawAtOffset proc far
uses ax, bx, cx, dx, si, ds
.enter
sub sp, size TextAttr ; Allocate frame
movdw bxcx, sssp ; bx:cx <- ptr to frame
;
; Grab the attributes
;
push di ; Save gstate
mov di, cx ; bx:di <- ptr to frame
push cx
call TA_FarFillTextAttrForDraw ; Fill the attribute structure
pop cx
;
; Set the gstate
;
movdw dssi, bxdi ; ds:si <- ptr to frame
pop di ; Restore gstate
call GrSetTextAttr ; Set the attributes
add sp, size TextAttr ; Restore stack
.leave
ret
SetupGStateForDrawAtOffset endp
TextBorder ends
|
dv3/atari/hd/init.asm | olifink/smsqe | 0 | 94879 | <gh_stars>0
; DV3 Atari ACSI Disk Initialisation V3.00 1992 <NAME>
section dv3
xdef hd_init
xref.l hd_vers
xref.s hd.rev
xref dv3_link
xref dv3_acdef
xref gu_fopen
xref gu_fclos
include 'dev8_dv3_keys'
include 'dev8_dv3_hd_keys'
include 'dev8_dv3_mac'
include 'dev8_keys_qdos_ioa'
include 'dev8_keys_qdos_sms'
include 'dev8_keys_sys'
include 'dev8_mac_basic'
include 'dev8_mac_proc'
include 'dev8_keys_qlv'
;+++
; DV3 Atari ACSI disk initialisation
; d5 c s ACSI auto detect removable
; d6 c s boot target and partition
; d7 s
; a3 smashed
;---
hd_init
lea ac_proctab,a1
move.w sb.inipr,a2
jsr (a2) ; link in procedures
lea ac_table,a3
jsr dv3_link ; link in acsi driver
move.l a3,a5 ; save ACSI linkage
move.l a3,a4 ; no scsi yet, asci is favourite
tst.b d5 ; auto detect removable?
bne.s hdi_mtype ; ... yes
clr.l hdl_remd(a3)
clr.l hdl_remd+4(a3) ; ... no
hdi_mtype
moveq #sms.info,d0
trap #1
moveq #sys.mtyp,d1
and.b sys_mtyp(a0),d1 ; machine type
cmp.b #sys.mtt,d1 ; TT
bne.s hdi_drive ; ... no
lea sc_table,a3
jsr dv3_link
move.l a3,a4 ; save SCSI linkage
hdi_drive
tst.w d6 ; anything other than 0,0
beq.s hdi_ckdrive ; ... no
bclr #3+8,d6 ; 0..7 or 8..15?
beq.s hdi_pracsi
cmp.l a4,a5 ; any scsi?
beq.s hdi_ckdrive ; ... no
move.l a4,a5 ; preset scsi
hdi_pracsi
move.b d6,hdl_part(a5) ; set partition
lsr.w #8,d6
move.b d6,hdl_targ(a5)
moveq #0,d0
rts
hdi_ckdrive
moveq #0,d1 ; try partitions 0 to 7
moveq #1,d7 ; for WIN1
st hdl_npart(a3) ; assume no partition found at all
hdi_loop
move.b d1,hdl_part(a3)
lea hdi_boot,a0
moveq #ioa.kshr,d3
jsr gu_fopen ; try to open
beq.s hdi_found ; OK
tst.b hdl_npart(a3) ; any partition found at all?
bne.s hdi_npart ; ... no
lea hdi_blat,a0 ; blat the definition
jsr dv3_acdef
addq.b #1,d1
cmp.b #7,d1
ble.s hdi_loop ; try first 8 partitions
hdi_npart
st hdl_part(a3) ; no partition
cmp.l a5,a3 ; was it ASCI we have just tried?
move.l a5,a3
bne.s hdi_drive
moveq #0,d0
move.b d0,hdl_part(a4) ; reset favourite drive to partition 0
rts
hdi_blat
sf ddf_mstat(a4)
rts
hdi_found
jsr gu_fclos
moveq #sms.xtop,d0
trap #do.smsq
lea sys_datd(a6),a0 ; data default
bsr.s hdi_dset
lea sys_prgd(a6),a0
hdi_dset
move.l (a0),d0 ; set?
beq.s hdi_rts
move.l d0,a0
move.l hdi_boot+2,2(a0) ; set boot device as default
moveq #0,d0
hdi_rts
rts
hdi_boot dc.w 9,'win1_boot'
ac_table
link_table WIN, hd.rev, hdl_end, ddf_dtop
buffered
sectl 512
mtype ddl.hd
msect 255
density ddf.dd
poll ahd_poll
check hd_check
direct hd_direct
rsect ac_rsect
wsect ac_wsect
slbfill hd_slbfill
slbupd hd_slbupd
dflush hd_dflush
fflush hd_fflush
fslave ahd_fslave
mformat ahd_mformat
status hd_fstatus
done hd_done
thing hd_tname,hd_thing
preset_b hdl_apnd-1, 0,hdl.apnd
preset_b hdl_maxd, hdl.maxd, 0
preset_w hdl_paus,30
preset_b hdl_part,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
preset_b hdl_remd,1,1,1,1,1,1,1,1
preset_v hdl_rsint,ac_rsint
preset_v hdl_wsint,ac_wsint
preset_v hdl_ckrdy,ac_ckrdy
preset_v hdl_ckwp,ac_ckwp
preset_v hdl_lock,ac_lock
preset_v hdl_unlock,ac_unlock
preset_v hdl_ststp,ac_ststp
link_end hdl_buff
sc_table
link_table WIN, hd.rev, hdl_end, ddf_dtop
buffered
sectl 512
mtype ddl.hd
msect 255
poll ahd_poll
check hd_check
direct hd_direct
rsect sc_rsect
wsect sc_wsect
slbfill hd_slbfill
slbupd hd_slbupd
dflush hd_dflush
fflush hd_fflush
mformat ahd_mformat
status hd_fstatus
done hd_done
master WIN
preset_b hdl_apnd-1, 0,hdl.apnd
preset_b hdl_maxd, hdl.maxd, 0
preset_w hdl_paus,30
preset_b hdl_part,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
preset_b hdl_remd,1,1,1,1,1,1,1,1
preset_v hdl_rsint,sc_rsint
preset_v hdl_wsint,sc_wsint
preset_v hdl_ckrdy,sc_ckrdy
preset_v hdl_ckwp,sc_ckwp
preset_v hdl_lock,sc_lock
preset_v hdl_unlock,sc_unlock
preset_v hdl_ststp,sc_ststp
link_end hdl_buff
section exten
proc_thg {WIN Control}
fun40_thg {WIN Control}
win_use proc {USE }
win_drive proc {DRIV}
win_start proc {STRT}
win_stop proc {STOP}
win_remv proc {REMV}
win_wp proc {WPRT}
win_format proc {FRMT}
win_slug proc {SLUG}
win_drive$ fun40 {DRV$}
ac_proctab
proc_stt
proc_ref WIN_USE
proc_ref WIN_DRIVE
proc_ref WIN_START
proc_ref WIN_STOP
proc_ref WIN_REMV
proc_ref WIN_WP
proc_ref WIN_FORMAT
proc_ref WIN_SLUG
proc_end
proc_stt
proc_ref WIN_DRIVE$
proc_end
end
|
oeis/331/A331326.asm | neoneye/loda-programs | 11 | 81346 | <filename>oeis/331/A331326.asm
; A331326: a(n) = n!*[x^n] sinh(x/(1 - x))/(1 - x).
; Submitted by <NAME>(w3)
; 0,1,4,19,112,801,6756,65563,717760,8729857,116570980,1693096131,26548383984,446689827169,8023582921732,153192673528651,3097301219335936,66095983547942913,1484384376886189380,34991710162280602867,863797053818651591920,22282392569877969167521,599478224363542292113444,16790969536751944429793019,488833195970075138789710272,14769816297171621986709600001,462503329656688352502913248676,14990618623928087469780233418403,502305423199602383656470821065840,17380958301612757486852741115945697
mov $4,$0
add $0,1
lpb $0
sub $0,1
mov $2,$1
mod $2,2
mov $3,$4
bin $3,$1
mul $5,$1
add $1,1
mul $3,$2
add $5,$3
lpe
mov $0,$5
|
stage1/gdt.asm | nelsoncole/sx | 3 | 94773 | ;==========================================================================================
;
; File Name: gdt.asm
;
;
; BSD 3-Clause License
;
; Copyright (c) 2019, nelsoncole
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are met:
;
; 1. Redistributions of source code must retain the above copyright notice, this
; list of conditions and the following disclaimer.
;
; 2. Redistributions in binary form must reproduce the above copyright notice,
; this list of conditions and the following disclaimer in the documentation
; and/or other materials provided with the distribution.
;
; 3. Neither the name of the copyright holder nor the names of its
; contributors may be used to endorse or promote products derived from
; this software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;
;
;========================================================================================
bits 32
section .data
global gdtr
gdt:
;0x0 Entrada Nula, em um GDT a primeira entrada é sempre nula
dw 0 ; Limit
dw 0 ; Base 15:00
db 0 ; Base 23:16
db 0 ; Flags
db 0 ; Flags e Limit 19:16
db 0 ; Base 31:24
; 0x8 CS LIMIT 0xFFFFF, BASE 0x00000000, DPL=0, G=1, S=1 code ou data
dw 0xFFFF ; Limit
dw 0 ; Base 15:00
db 0 ; Base 23:16
db 0x9A ; Flags
db 0xCF ; Flags e Limit 19:16
db 0 ; Base 31:24
; 0x10 DS LIMIT 0xFFFFF, BASE 0x00000000, DPL=0, G=1, S=1 code ou data
dw 0xFFFF ; Limit
dw 0 ; Base 15:00
db 0 ; Base 23:16
db 0x92 ; Flags
db 0xCF ; Flags e Limit 19:16
db 0 ; Base 31:24
;0x18 ;SEGMENTO DE CODIGO (CS 16-BITS) DPL 0, LIMIT 0XFFFF BASE 0X00000000 G 0 1B
dw 0xFFFF
dw 0x0
db 0x0
db 0x9E
db 0x0
db 0x0
;0x20 SEGMENTO DE DADOS (CD 16-BITS) LIMIT 0XFFFF BASE 0X00000000 G 0 1B
dw 0xFFFF
dw 0x0
db 0x0
db 0x92
db 0x0
db 0x0
gdt_end:
; Crindo nosso ponteiro gdtr
gdtr:
dw gdt_end - gdt -1 ; LIMIT
dd gdt ; BASE
|
libsrc/zx81/basic/zx_basic_length.asm | meesokim/z88dk | 0 | 20285 | <reponame>meesokim/z88dk
;
; ZX 81 specific routines
; by <NAME>, Oct 2007
;
; This routine gives the length of the current BASIC program.
; Memory used by variables is not included.
;
; $Id: zx_basic_length.asm,v 1.2 2015/01/19 01:33:26 pauloscustodio Exp $
;
PUBLIC zx_basic_length
zx_basic_length:
ld de,$407D ; location of BASIC program (just after system variables)
ld hl,($400C) ; Display file is end of program
sbc hl,de
ret
|
programs/oeis/078/A078723.asm | neoneye/loda | 22 | 88406 | <filename>programs/oeis/078/A078723.asm
; A078723: a(n) = prime(n*(n+1)/2 + n).
; 3,11,23,43,71,103,149,193,251,313,389,463,569,653,761,881,1013,1129,1289,1451,1601,1777,1979,2143,2357,2591,2789,3023,3301,3539,3793,4057,4349,4651,4969,5297,5639,5927,6299,6673,7013,7459,7823,8237,8677,9067,9479
add $0,3
bin $0,2
sub $0,2
seq $0,6005 ; The odd prime numbers together with 1.
|
data/pokemon/base_stats/machop.asm | opiter09/ASM-Machina | 1 | 102452 | db DEX_MACHOP ; pokedex id
db 70, 80, 50, 35, 35
; hp atk def spd spc
db FIGHTING, FIGHTING ; type
db 180 ; catch rate
db 88 ; base exp
INCBIN "gfx/pokemon/front/machop.pic", 0, 1 ; sprite dimensions
dw MachopPicFront, MachopPicBack
db KARATE_CHOP, NO_MOVE, NO_MOVE, NO_MOVE ; level 1 learnset
db GROWTH_MEDIUM_SLOW ; growth rate
; tm/hm learnset
tmhm MEGA_PUNCH, MEGA_KICK, TOXIC, BODY_SLAM, TAKE_DOWN, \
DOUBLE_EDGE, SUBMISSION, COUNTER, SEISMIC_TOSS, RAGE, \
EARTHQUAKE, FISSURE, DIG, MIMIC, DOUBLE_TEAM, \
BIDE, METRONOME, FIRE_BLAST, SKULL_BASH, REST, \
ROCK_SLIDE, SUBSTITUTE, STRENGTH
; end
db 0 ; padding
|
programs/oeis/166/A166959.asm | karttu/loda | 1 | 172885 | <reponame>karttu/loda
; A166959: Numbers congruent to (12,32) mod 44.
; 12,32,56,76,100,120,144,164,188,208,232,252,276,296,320,340,364,384,408,428,452,472,496,516,540,560,584,604,628,648,672,692,716,736,760,780,804,824,848,868,892,912,936,956,980,1000,1024,1044,1068,1088,1112,1132,1156,1176,1200,1220,1244,1264,1288,1308,1332,1352,1376,1396,1420,1440,1464,1484,1508,1528,1552,1572,1596,1616,1640,1660,1684,1704,1728,1748,1772,1792,1816,1836,1860,1880,1904,1924,1948,1968,1992,2012,2036,2056,2080,2100,2124,2144,2168,2188,2212,2232,2256,2276,2300,2320,2344,2364,2388,2408,2432,2452,2476,2496,2520,2540,2564,2584,2608,2628,2652,2672,2696,2716,2740,2760,2784,2804,2828,2848,2872,2892,2916,2936,2960,2980,3004,3024,3048,3068,3092,3112,3136,3156,3180,3200,3224,3244,3268,3288,3312,3332,3356,3376,3400,3420,3444,3464,3488,3508,3532,3552,3576,3596,3620,3640,3664,3684,3708,3728,3752,3772,3796,3816,3840,3860,3884,3904,3928,3948,3972,3992,4016,4036,4060,4080,4104,4124,4148,4168,4192,4212,4236,4256,4280,4300,4324,4344,4368,4388,4412,4432,4456,4476,4500,4520,4544,4564,4588,4608,4632,4652,4676,4696,4720,4740,4764,4784,4808,4828,4852,4872,4896,4916,4940,4960,4984,5004,5028,5048,5072,5092,5116,5136,5160,5180,5204,5224,5248,5268,5292,5312,5336,5356,5380,5400,5424,5444,5468,5488
mov $1,$0
mul $1,11
add $1,6
div $1,2
mul $1,4
|
oeis/332/A332243.asm | neoneye/loda-programs | 11 | 737 | <gh_stars>10-100
; A332243: Starhex honeycomb numbers: a(n) = 13 + 60*n + 60*n^2.
; 13,133,373,733,1213,1813,2533,3373,4333,5413,6613,7933,9373,10933,12613,14413,16333,18373,20533,22813,25213,27733,30373,33133,36013,39013,42133,45373,48733,52213,55813,59533,63373,67333,71413,75613,79933,84373
add $0,1
bin $0,2
mul $0,120
add $0,13
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.