hexsha stringlengths 40 40 | size int64 6 1.05M | ext stringclasses 3 values | lang stringclasses 1 value | max_stars_repo_path stringlengths 4 232 | max_stars_repo_name stringlengths 7 106 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 7 | max_stars_count int64 1 33.5k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 232 | max_issues_repo_name stringlengths 7 106 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 7 | max_issues_count int64 1 37.5k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 232 | max_forks_repo_name stringlengths 7 106 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 7 | max_forks_count int64 1 12.6k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 6 1.05M | avg_line_length float64 1.16 19.7k | max_line_length int64 2 938k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d0f8ae11813330ca260f0f3a1927aa9c45179e59 | 161 | asm | Assembly | libsrc/_DEVELOPMENT/arch/sms/SMSlib/c/sdcc/SMS_VDPType.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/arch/sms/SMSlib/c/sdcc/SMS_VDPType.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/arch/sms/SMSlib/c/sdcc/SMS_VDPType.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ; unsigned char SMS_VDPType(void)
SECTION code_clib
SECTION code_SMSlib
PUBLIC _SMS_VDPType
EXTERN asm_SMSlib_VDPType
defc _SMS_VDPType = asm_SMSlib_VDPType
| 14.636364 | 38 | 0.850932 |
cf202da7fc4a6ebde32b90c84d2b34581b3d31d0 | 251 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/math32/lm32/c/sccz80/invsqrt.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/math/float/math32/lm32/c/sccz80/invsqrt.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/math/float/math32/lm32/c/sccz80/invsqrt.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
SECTION code_fp_math32
PUBLIC invsqrt
EXTERN m32_fsinvsqrt_fastcall
defc invsqrt = m32_fsinvsqrt_fastcall
; SDCC bridge for Classic
IF __CLASSIC
PUBLIC _invsqrt
EXTERN cm32_sdcc_fsinvsqrt
defc _invsqrt = cm32_sdcc_fsinvsqrt
ENDIF
| 15.6875 | 41 | 0.800797 |
801e11870063f91cbe8b41a804ef087ddbbb57ca | 7,191 | asm | Assembly | wtfx/main.asm | bushy555/ZX-Spectrum-1-Bit-Routines | 4d336dec9d7abc979a97af76d515104a9263f127 | [
"BSD-3-Clause"
] | 59 | 2015-02-28T14:15:56.000Z | 2022-03-26T12:06:01.000Z | wtfx/main.asm | bushy555/ZX-Spectrum-1-Bit-Routines | 4d336dec9d7abc979a97af76d515104a9263f127 | [
"BSD-3-Clause"
] | 1 | 2016-08-22T05:32:43.000Z | 2016-08-22T09:33:28.000Z | wtfx/main.asm | bushy555/ZX-Spectrum-1-Bit-Routines | 4d336dec9d7abc979a97af76d515104a9263f127 | [
"BSD-3-Clause"
] | 9 | 2015-02-28T14:16:31.000Z | 2022-01-18T17:52:48.000Z | ;wtfx - wavetable player with fx
;by utz 02'2016
;hl - add counter ch1
;hl' - add counter ch2
;de/de' - temporarily hold base freq. values and sample pointers
;c/c' - #fe
;b/b' - timer lo/hi-byte
org #8000
di
init
ei ;detect kempston
halt
in a,(#1f)
inc a
jr nz,_skip
ld (maskKempston),a
_skip
di
ld c,#fe
exx
ld c,#fe
push hl ;preserve HL' for return to BASIC
ld (oldSP),sp
ld hl,musicdata
ld (seqpntr),hl
;******************************************************************
rdseq
seqpntr equ $+1
ld sp,0
xor a
pop de ;pattern pointer to DE
or d
ld (seqpntr),sp
jr nz,rdptn0
;jp exit ;uncomment to disable looping
ld sp,loop ;get loop point
jr rdseq+3
exit
oldSP equ $+1
ld sp,0
pop hl
exx
ei
ret
;******************************************************************
rdptn0
ld (patpntr),de
rdptn
in a,(#1f) ;read joystick
maskKempston equ $+1
and #1f
ld d,a
in a,(#fe) ;read kbd
cpl
or d
and #1f
jp nz,exit
ld b,a ;set timer lo-byte
patpntr equ $+1 ;fetch pointer to pattern data
ld sp,0
pop af
jr z,rdseq
pop de ;freq.ch1
pop hl ;smp.ch1
exx
ld b,a ;timer hi-byte
pop de ;freq.ch2
pop hl ;smp.ch2
pop ix ;fx table address
ld (patpntr),sp ;preserve pattern pointer
ld sp,buffer+8 ;load buffer pointer
ld a,(hl) ;load initial sample ch2
push hl
push de
ld hl,0 ;clear add counter ch2
exx
ex af,af'
push hl
push de
ld a,(hl) ;load initial sample ch1
ld h,b ;clear add counter ch1
ld l,b
playRow
;*********************************************************************
frame1 ;calculate counter ch1
out (c),a ;12 ch1/1
rlca ;4__16
out (c),a ;12 ch1/2
rlca ;4__16 ch1/3
out (c),a ;12
rlca ;4
nop ;4
nop ;4__24
out (c),a ;12 ch1/4
rlca ;4
ex af,af' ;4
nop ;4
nop ;4
nop ;4__32
out (c),a ;12 ch2/1
rlca ;4__16
out (c),a ;12 ch2/2
rlca ;4
nop ;4
dec b ;4__24 adjust timer
out (c),a ;12 ch2/3
rlca ;4
pop de ;10 base freq ch1
dec sp ;6__32 timing
out (c),a ;12 ch2/4
rlca ;4
ex af,af' ;4
add hl,de ;11 add to counter ch1
ld r,a ;9__40 timing
;*********************************************************************
frame2 ;load sample ch1
out (c),a ;12 ch1/1
rlca ;4__16
out (c),a ;12 ch1/2
rlca ;4__16 ch1/3
out (c),a ;12
rlca ;4
nop ;4
nop ;4__24
out (c),a ;12 ch1/4
rlca ;4
ex af,af' ;4
nop ;4
nop ;4
nop ;4__32
out (c),a ;12 ch2/1
rlca ;4__16
out (c),a ;12 ch2/2
rlca ;4
nop ;4
nop ;4__24 ch2/3
out (c),a ;12
rlca ;4
inc sp ;6 timing
pop de ;10_32 base sample pointer ch1
out (c),a ;12 ch2/4
rlca ;4
ex af,af' ;4
ld e,h ;4 set sample pointer lo-byte ch1
ld a,(de) ;7 load sample
ld r,a ;9__40 timing
;*********************************************************************
frame3 ;calculate counter ch2
out (c),a ;12 ch1/1
rlca ;4__16
out (c),a ;12 ch1/2
rlca ;4__16 ch1/3
out (c),a ;12
rlca ;4
nop ;4
nop ;4__24
out (c),a ;12 ch1/4
rlca ;4
ex af,af' ;4
nop ;4
nop ;4
nop ;4__32
out (c),a ;12 ch2/1
rlca ;4__16
out (c),a ;12 ch2/2
rlca ;4
nop ;4
exx ;4__24 ch2/3
out (c),a ;12
rlca ;4
pop de ;10 base freq ch2
dec sp ;6__32 timing
out (c),a ;12 ch2/4
rlca ;4
ex af,af' ;4
add hl,de ;11 add to counter ch2
ld r,a ;9__40 timing
;*********************************************************************
frame4 ;load sample ch2
out (c),a ;12 ch1/1
rlca ;4__16
out (c),a ;12 ch1/2
rlca ;4__16 ch1/3
out (c),a ;12
rlca ;4
nop ;4
nop ;4__24
out (c),a ;12 ch1/4
rlca ;4
ex af,af' ;4
nop ;4
nop ;4
nop ;4__32
out (c),a ;12 ch2/1
rlca ;4__16
out (c),a ;12 ch2/2
rlca ;4
nop ;4
nop ;4__24 ch2/3
out (c),a ;12
rlca ;4
inc sp ;6 timing
pop de ;10_32 base sample pointer ch2
out (c),a ;12 ch2/4
rlca ;4
ld e,h ;4 set sample pointer lo-byte ch2
ld a,(de) ;7 load sample
ld r,a ;9 timing
ex af,af' ;4__40
;*********************************************************************
frame5 ;update timer and reload stack pntr
out (c),a ;12 ch1/1
rlca ;4__16
out (c),a ;12 ch1/2
rlca ;4__16 ch1/3
out (c),a ;12
rlca ;4
nop ;4
nop ;4__24
out (c),a ;12 ch1/4
rlca ;4
ex af,af' ;4
nop ;4
nop ;4
nop ;4__32
out (c),a ;12 ch2/1
rlca ;4__16
out (c),a ;12 ch2/2
rlca ;4
nop ;4
exx ;4__24 ch2/3
out (c),a ;12
rlca ;4
ld sp,buffer+2 ;10 reload stack pointer
dec sp ;6__32 timing
out (c),a ;12 ch2/4
rlca ;4
ex af,af' ;4
dec sp ;6 timing
dec b ;4 decrement timer lo-byte
jp nz,playRow ;10_40 and loop
;200/200
;*********************************************************************
exx ;4 ;decrement timer hi-byte
dec b ;4
exx ;4
ld sp,ix ;10
pop iy ;14
jp (iy) ;8
tExecNone
inc ix
inc ix
tExecStop
ld sp,buffer ;10
jp nz,playRow ;10
;64
jp rdptn
tExecLoop
pop ix
ld sp,ix
pop iy
jp (iy)
tf1
pop de
ld (buffer),de
ld de,4
add ix,de
ld sp,buffer
jp nz,playRow
jp rdptn
tf1s1
pop de
ld (buffer),de
pop de
ld d,a
ld a,e
ld (buffer+3),a
ld a,d
ld de,5
add ix,de
ld sp,buffer
jp nz,playRow
jp rdptn
tf1s1f2
pop de ;note ch1
ld (buffer),de
pop de ;note ch2
ld (buffer+4),de
pop de
ld d,a
ld a,e
ld (buffer+3),a
ld a,d
ld de,7
add ix,de
ld sp,buffer
jp nz,playRow
jp rdptn
tf1s1s2
pop de
ld (buffer),de
ld b,a
pop de
ld a,e
ld (buffer+3),a
ld a,d
ld (buffer+7),a
ld a,b
ld de,6
ld b,d
add ix,de
ld sp,buffer
jp nz,playRow
jp rdptn
tf1s1f2s2
pop de
ld (buffer),de
pop de
ld (buffer+4),de
ld b,a
pop de
ld a,e
ld (buffer+3),a
ld a,d
ld (buffer+7),a
ld a,b
ld de,8
ld b,d
add ix,de
ld sp,buffer
jp nz,playRow
jp rdptn
tf1f2
pop de
ld (buffer),de
pop de
ld (buffer+4),de
ld de,6
add ix,de
jp nz,playRow
jp rdptn
tf1f2s2
pop de
ld (buffer),de
pop de
ld (buffer+4),de
pop de
ld d,a
ld a,e
ld (buffer+7),a
ld a,d
ld de,7
add ix,de
ld sp,buffer
jp nz,playRow
jp rdptn
tf1s2
pop de
ld (buffer),de
pop de
ld d,a
ld a,e
ld (buffer+7),a
ld a,d
ld de,5
add ix,de
ld sp,buffer
jp nz,playRow
jp rdptn
ts1
pop de
ld d,a
ld a,e
ld (buffer+3),a
ld a,d
ld de,3
add ix,de
ld sp,buffer
jp nz,playRow
jp rdptn
ts1f2
pop de
ld d,a
ld a,e
ld (buffer+3),a
ld a,d
pop de
ld (buffer+4),de
ld de,5
add ix,de
ld sp,buffer
jp nz,playRow
jp rdptn
ts1f2s2
pop de
ld (buffer+4),de
ld b,a
pop de
ld a,e
ld (buffer+3),a
ld a,d
ld (buffer+7),a
ld a,b
ld de,6
ld b,d
add ix,de
ld sp,buffer
jp nz,playRow
jp rdptn
tf2
pop de
ld (buffer+4),de
ld de,4
add ix,de
jp nz,playRow
jp rdptn
tf2s2
pop de
ld (buffer+4),de
pop de
ld d,a
ld a,e
ld (buffer+7),a
ld a,d
ld de,5
add ix,de
ld sp,buffer
jp nz,playRow
jp rdptn
ts2
pop de
ld d,a
ld a,e
ld (buffer+7),a
ld a,d
ld de,3
add ix,de
ld sp,buffer
jp nz,playRow
jp rdptn
buffer ;4 words: freq.ch1, smp.ch1, freq.ch2, smp.ch2
ds 8
samples
include "samples.asm"
musicdata
include "music.asm"
| 14.353293 | 71 | 0.546238 |
98808f8548d50e47592b485552649eaf00fff84f | 322 | asm | Assembly | boot/stage1/print.asm | nelsoncole/sirius-x86-64 | 741370f204a1da1fab2547e395f737cd383aee19 | [
"BSD-3-Clause"
] | 10 | 2021-08-18T22:37:50.000Z | 2022-02-07T11:12:32.000Z | boot/stage1/print.asm | nelsoncole/sirius-x86-64 | 741370f204a1da1fab2547e395f737cd383aee19 | [
"BSD-3-Clause"
] | null | null | null | boot/stage1/print.asm | nelsoncole/sirius-x86-64 | 741370f204a1da1fab2547e395f737cd383aee19 | [
"BSD-3-Clause"
] | null | null | null | print:
pusha
.next:
cld ; flag de direcção
lodsb ; a cada loop carrega si p --> al, actualizando si
cmp al, 0 ; compara al com o 0
je .end ; se al for 0 pula para o final do programa
mov ah, 0x0e ; função TTY da BIOS imprime caracter na tela
int 0x10 ; interrupção de vídeo
jmp .next
.end:
popa
ret
| 23 | 59 | 0.667702 |
7920f36dc2ed3392cefb57b7ace53729b5d046dc | 7,876 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_st_un_4k_sm_/i7-8650U_0xd2.log_5492_939.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_st_un_4k_sm_/i7-8650U_0xd2.log_5492_939.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_st_un_4k_sm_/i7-8650U_0xd2.log_5492_939.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r15
push %r9
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x118c7, %r12
nop
nop
nop
nop
nop
dec %rdi
mov $0x6162636465666768, %r15
movq %r15, %xmm3
vmovups %ymm3, (%r12)
nop
nop
nop
inc %rbp
lea addresses_UC_ht+0x7107, %rsi
lea addresses_UC_ht+0xb807, %rdi
nop
nop
cmp $17235, %rbx
mov $80, %rcx
rep movsb
nop
nop
xor $32631, %rsi
lea addresses_A_ht+0x2e07, %rdi
nop
and %rcx, %rcx
mov $0x6162636465666768, %r12
movq %r12, (%rdi)
nop
cmp $64071, %rdi
lea addresses_D_ht+0x1507, %rcx
and $60451, %rbp
mov (%rcx), %r12d
nop
nop
nop
nop
and %rdi, %rdi
lea addresses_normal_ht+0x14707, %rsi
lea addresses_WC_ht+0x13307, %rdi
nop
nop
nop
dec %rbx
mov $126, %rcx
rep movsw
nop
nop
nop
inc %rbp
lea addresses_WT_ht+0x11a47, %rcx
nop
nop
nop
nop
sub $19702, %rbx
mov $0x6162636465666768, %rbp
movq %rbp, %xmm5
vmovups %ymm5, (%rcx)
nop
nop
nop
nop
nop
inc %rdi
lea addresses_WT_ht+0x1d107, %r15
nop
nop
cmp $21650, %rbx
mov $0x6162636465666768, %rdi
movq %rdi, %xmm5
vmovups %ymm5, (%r15)
add %r12, %r12
lea addresses_normal_ht+0x907, %rsi
lea addresses_D_ht+0x13fc7, %rdi
nop
nop
nop
nop
nop
and %r9, %r9
mov $82, %rcx
rep movsq
xor %r12, %r12
lea addresses_WT_ht+0xbc07, %r15
nop
nop
nop
nop
nop
sub $31437, %rbx
movb (%r15), %r9b
nop
xor %rcx, %rcx
lea addresses_WT_ht+0x1ed07, %rsi
lea addresses_WC_ht+0x12e47, %rdi
and %rbx, %rbx
mov $79, %rcx
rep movsq
cmp $32175, %rbx
lea addresses_D_ht+0x2c43, %rsi
lea addresses_D_ht+0x17ba7, %rdi
nop
nop
nop
nop
and $38013, %r12
mov $8, %rcx
rep movsb
nop
nop
add %rcx, %rcx
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r9
pop %r15
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r8
push %rax
push %rbx
push %rcx
push %rdi
// Store
lea addresses_PSE+0x1bd2f, %r8
nop
inc %rax
movl $0x51525354, (%r8)
and $45075, %r8
// Store
lea addresses_WT+0x1a307, %r11
nop
nop
nop
add $60160, %rdi
mov $0x5152535455565758, %rcx
movq %rcx, (%r11)
nop
nop
sub $13251, %rcx
// Store
lea addresses_A+0xb07, %r8
nop
nop
nop
cmp $40607, %rcx
mov $0x5152535455565758, %rbx
movq %rbx, %xmm0
vmovups %ymm0, (%r8)
nop
nop
nop
nop
inc %rax
// Store
lea addresses_WT+0x1a307, %rbx
nop
and %r11, %r11
movb $0x51, (%rbx)
dec %r11
// Faulty Load
lea addresses_WT+0x1a307, %rbx
nop
nop
nop
nop
nop
add %rcx, %rcx
movb (%rbx), %r8b
lea oracles, %r13
and $0xff, %r8
shlq $12, %r8
mov (%r13,%r8,1), %r8
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r8
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'size': 1, 'AVXalign': True, 'NT': False, 'congruent': 0, 'same': True}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 1, 'AVXalign': True, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 4, 'AVXalign': True, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 3, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}}
{'58': 4069, '51': 1417, '32': 1, '34': 1, '2e': 1, '14': 1, '3a': 1, '10': 1}
58 58 51 51 58 58 58 51 58 58 51 58 58 58 51 58 58 58 58 51 58 58 51 58 58 58 58 58 51 51 58 51 58 58 58 51 51 58 51 58 51 58 58 51 58 58 58 58 58 58 51 58 58 58 58 51 58 58 58 51 58 58 58 58 51 58 58 58 51 58 51 51 51 58 58 51 58 58 51 58 51 58 58 51 58 58 58 58 58 58 51 51 58 51 58 58 58 58 51 58 51 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 51 58 58 51 58 58 51 58 58 58 58 58 58 58 58 51 58 51 58 58 51 58 58 58 58 58 58 51 58 51 58 58 51 58 58 51 58 58 58 58 58 58 58 58 58 58 58 58 58 58 51 58 58 58 58 58 58 51 58 58 51 58 58 51 58 51 51 51 58 58 58 58 58 58 58 58 58 51 58 51 51 58 58 58 58 58 58 58 58 58 51 58 58 58 58 58 58 58 58 58 58 58 58 58 51 58 51 58 51 51 58 58 51 58 58 51 58 51 58 51 58 51 58 51 51 58 58 51 51 58 51 58 51 58 58 58 58 51 58 51 58 58 58 58 58 51 58 58 51 58 51 58 58 58 58 58 51 51 58 58 58 51 58 58 58 58 58 58 58 58 51 58 58 58 58 51 58 58 58 58 58 58 58 58 58 58 58 51 51 58 58 58 58 58 51 58 58 51 58 51 58 58 51 58 58 58 58 58 58 58 58 51 58 58 58 58 58 58 58 58 51 58 58 51 58 58 58 58 51 58 58 51 58 51 51 58 58 58 58 58 58 58 58 58 51 58 58 58 58 51 58 58 58 58 51 58 58 51 58 58 58 51 58 58 51 58 51 58 51 58 51 58 58 58 58 58 51 58 51 58 51 58 58 58 51 58 58 51 58 58 51 58 51 58 58 58 58 58 51 58 58 51 58 51 51 51 51 58 51 58 58 51 58 51 51 51 58 58 58 51 58 58 51 58 51 58 58 51 58 58 51 51 58 58 51 58 58 58 58 58 58 51 58 58 51 51 58 58 58 51 58 58 51 58 58 51 58 58 51 58 58 51 58 58 58 51 58 58 58 58 58 58 58 51 58 58 58 51 58 58 51 58 51 58 58 58 58 51 58 51 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 51 58 58 58 51 58 58 58 58 58 58 58 51 58 51 51 51 58 58 58 58 58 51 58 58 58 58 51 58 58 58 51 51 58 58 58 58 58 51 51 51 58 51 51 51 58 58 51 51 58 51 58 58 51 58 58 58 51 58 51 51 58 58 58 51 58 58 51 58 51 58 58 51 58 58 51 51 58 51 58 51 58 58 58 58 58 58 58 58 58 58 58 58 58 51 58 58 58 58 51 58 58 58 58 51 58 58 58 58 58 58 51 58 58 51 58 51 58 58 58 51 58 51 58 58 51 58 58 58 58 58 51 58 58 58 58 58 51 58 58 51 58 51 58 58 58 51 58 51 51 58 58 58 51 58 51 58 51 58 58 51 58 51 51 58 51 58 58 58 58 58 51 58 51 58 58 58 58 58 58 58 51 58 58 58 58 51 58 58 58 51 58 58 51 58 58 51 58 51 58 58 51 58 58 51 58 51 58 58 58 58 51 58 58 51 58 58 58 51 58 51 58 58 51 51 58 58 51 58 51 58 58 51 58 58 58 58 58 51 58 58 51 58 58 58 58 58 51 58 58 58 58 58 58 51 58 58 51 58 51 58 58 58 51 58 58 51 58 51 58 51 58 58 58 58 51 51 58 51 58 51 51 58 58 58 51 58 58 51 58 58 58 51 58 51 58 58 58 58 58 58 51 51 58 58 58 58 58 58 58 58 51 58 58 51 58 58 58 58 58 51 51 58 51 58 51 58 58 51 58 51 58 58 58 51 58 58 58 58 58 58 58 58 51 58 58 58 51 51 58 58 58 58 58 58 58 58 51 58 58 58 58 58 58 51 58 51 58 51 58 51 58 51 58 58 58 58 51 58 58 58 58 58 58 58 58 58 58 51 51 58 58 58 58 51 58 58 51 51 51 58 51 58 58 58 51 58 58 58 58 51 58 58 51 58 58 51 58 51 58 58 58 58 58 51 58 58 58 58 51 58 58 58 58 58 58 58 58 58 51 58 51 58 58 58 58 58 51 51 58 58 51 58 58 51 58 51 51 58 58 51 51 58 58 51 58 51 58 58 58 58
*/
| 33.948276 | 2,999 | 0.654901 |
575ae9deda35ff7cda76d8f9716306ff60a0c486 | 1,241 | asm | Assembly | programs/oeis/187/A187272.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/187/A187272.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/187/A187272.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A187272: a(n) = (n/4)*2^(n/2)*((1+sqrt(2))^2 + (-1)^n*(1-sqrt(2))^2).
; 0,2,6,12,24,40,72,112,192,288,480,704,1152,1664,2688,3840,6144,8704,13824,19456,30720,43008,67584,94208,147456,204800,319488,442368,688128,950272,1474560,2031616,3145728,4325376,6684672,9175040,14155776,19398656,29884416,40894464,62914560,85983232,132120576,180355072,276824064,377487360,578813952,788529152,1207959552,1644167168,2516582400,3422552064,5234491392,7113539584,10871635968,14763950080,22548578304,30601641984,46707769344,63350767616,96636764160,130996502528,199715979264,270582939648,412316860416,558345748480,850403524608,1151051235328,1752346656768,2370821947392,3607772528640,4879082848256,7421703487488,10033043603456,15255723835392,20615843020800,31336081391616,42331197669376,64321430224896,86861418594304,131941395333120,178120883699712,270479860432896,365037860421632,554153860399104,747667906887680,1134695999864832,1530520185864192,2322168557862912,3131409115906048,4749890231992320,6403555720167424,9710886696517632,13088586417045504,19843985858101248,26740122787512320,40532396646334464,54606145481867264,82753643152932864,111464090777419776
mov $1,$0
mul $0,2
mov $2,$1
lpb $2
add $0,$3
mov $3,$1
mov $1,$0
sub $1,$3
sub $2,1
lpe
| 88.642857 | 1,068 | 0.841257 |
4a8497cdb8a1494b9b9647770924d85ec7b1ff28 | 167 | asm | Assembly | libsrc/_DEVELOPMENT/string/c/sdcc_iy/ffsl.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/string/c/sdcc_iy/ffsl.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/string/c/sdcc_iy/ffsl.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
; int ffsl(long i)
SECTION code_string
PUBLIC _ffsl
EXTERN asm_ffsl
_ffsl:
pop af
pop hl
pop de
push de
push hl
push af
jp asm_ffsl
| 7.952381 | 19 | 0.616766 |
0530211dc393bd5c698d4e68e8ae0fa9a060c2ce | 5,032 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1540.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1540.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1540.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x63cc, %rsi
lea addresses_D_ht+0x17360, %rdi
clflush (%rdi)
nop
nop
nop
sub %r13, %r13
mov $114, %rcx
rep movsw
nop
cmp %rbx, %rbx
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r14
push %r15
push %r9
push %rdx
// Store
lea addresses_PSE+0x10c88, %r14
nop
nop
nop
nop
nop
cmp $31119, %r9
mov $0x5152535455565758, %r15
movq %r15, %xmm6
movups %xmm6, (%r14)
nop
nop
nop
nop
nop
add %r15, %r15
// Store
lea addresses_A+0xc45e, %r9
nop
nop
nop
nop
nop
sub $6871, %r11
mov $0x5152535455565758, %r14
movq %r14, (%r9)
// Exception!!!
nop
nop
nop
nop
mov (0), %r15
nop
nop
nop
nop
cmp $44866, %r15
// Store
lea addresses_UC+0x1eac8, %r12
nop
nop
nop
sub %r15, %r15
movw $0x5152, (%r12)
nop
nop
nop
add %r9, %r9
// Faulty Load
lea addresses_normal+0x2b60, %r14
nop
nop
nop
and $23174, %rdx
vmovups (%r14), %ymm1
vextracti128 $1, %ymm1, %xmm1
vpextrq $0, %xmm1, %r11
lea oracles, %r9
and $0xff, %r11
shlq $12, %r11
mov (%r9,%r11,1), %r11
pop %rdx
pop %r9
pop %r15
pop %r14
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_normal', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'size': 8, 'NT': True, 'same': False, 'congruent': 1}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 3}}
[Faulty Load]
{'src': {'type': 'addresses_normal', 'AVXalign': False, 'size': 32, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_normal_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
| 40.910569 | 2,999 | 0.660771 |
31bfb0666f50d8aa1dbd1227c2dea27586275805 | 72,280 | asm | Assembly | Source/GBSound.asm | AbePralle/GameBoySoundManipulator | 677243531c58a11faca6547dd15707d7feb64cfa | [
"MIT"
] | null | null | null | Source/GBSound.asm | AbePralle/GameBoySoundManipulator | 677243531c58a11faca6547dd15707d7feb64cfa | [
"MIT"
] | null | null | null | Source/GBSound.asm | AbePralle/GameBoySoundManipulator | 677243531c58a11faca6547dd15707d7feb64cfa | [
"MIT"
] | null | null | null | ;===============================================================================
; GBSound.asm
; 2000.03.06 by Abe Pralle
;===============================================================================
MPRINT: MACRO
push bc
ld a,\4
ld [textColor],a
ld b,\2
ld c,\3
ld hl,\1
call PrintText
pop bc
ENDM
PRINTCURSOR: MACRO
ld a,\2
ld [textColor],a
ld hl,\1
call PrintTextAtCursor
ENDM
UPDATESCREEN: MACRO
ld a,1
ldio [backBufferReady],a
ENDM
LOADA: MACRO
ld a,\2
ld \1,a
ENDM
DPAD_RIGHT EQU $01
DPAD_LEFT EQU $02
DPAD_UP EQU $04
DPAD_DOWN EQU $08
BUTTON_A EQU $10
BUTTON_B EQU $20
BUTTON_SELECT EQU $40
BUTTON_START EQU $80
BUTTON_ALL EQU $f0
;---------------------------------------------------------------------
; Variables
;---------------------------------------------------------------------
SECTION "UserVars",WRAM0[$c000]
backBuffer: DS 608 ;must start on even $10 address
waveBuffer: DS 128 ;must start on even $10 address
padding: DS 32
attributeBuffer: DS 608 ;must start on even $10 address
padding2: DS 160
spriteOAMBuffer: DS 160 ;must start on even $100 address
curJoy1: DS 1
curSound: DS 1 ;sound type being manipulated
textColor: DS 1
state1_data: DS 5
state2_data: DS 4
state3_data: DS 22
state4_data: DS 4
curByte: DS 1
curByteMask: DS 1
cursor_x: DS 1
cursor_y: DS 1
copyWaveChars: DS 1
SECTION "User",ROM0
;---------------------------------------------------------------------
; Routine: UserMain
; Description: Sets up stuff then goes into main loop
;---------------------------------------------------------------------
UserMain::
call InitGraphics
call InitSound
call ClearScreen
xor a
ld [copyWaveChars],a
;turn on the vblank interrupt
ld a,[$ffff]
or 1
ld [$ffff],a
;set up initial values for sounds
LOADA [state1_data],%00000000 ;sweep
LOADA [state1_data+1],%10000000 ;duty+length
LOADA [state1_data+2],%11110000 ;envelope
LOADA [state1_data+3],%00000000 ;freq_lo
LOADA [state1_data+4],%11000001 ;freq_hi
LOADA [state2_data],%10000000 ;duty+length
LOADA [state2_data+1],%11110000 ;envelope
LOADA [state2_data+2],%00000000 ;freq_lo
LOADA [state2_data+3],%11000001 ;freq_hi
LOADA [state3_data], %10000000 ;play sound
LOADA [state3_data+1],%00000000 ;length
LOADA [state3_data+2],%00100000 ;output level
LOADA [state3_data+3],%00000000 ;frequency lo
LOADA [state3_data+4],%11000001 ;frequency hi
LOADA [state4_data], %00000000 ;length
LOADA [state4_data+1],%11110000 ;envelope
LOADA [state4_data+2],%00000000 ;frequency
LOADA [state4_data+3],%11000000 ;init/consecutive
ld hl,state3_data+5
ld c,8
ld a,$ff
.fill1 ld [hl+],a
dec c
jr nz,.fill1
xor a
ld c,8
.fill2 ld [hl+],a
dec c
jr nz,.fill2
ei
call ShowInfo
ld a,0
ld [curSound],a
jr .advanceState
.stateLoop
ldio a,[backBufferReady] ;screen been drawn yet?
or a
jr nz,.stateLoop
call GetInput
ld a,[curJoy1]
and BUTTON_SELECT
jr z,.checkState1
;advance state
.advanceState
.waitSelectRelease
call GetInput
ld a,[curJoy1]
and BUTTON_SELECT
jr nz,.waitSelectRelease
xor a
ld [curByte],a
ld a,[curSound]
and %11
inc a
;cp 3
;jr nz,.soundOkay
;inc a ;skip sound 3 for now
.soundOkay
ld [curSound],a
cp 1
jr nz,.checkInitSound2
ld a,%01110000
ld [curByteMask],a
jp .checkState1
.checkInitSound2
cp 2
jr nz,.checkInitSound3
ld a,1
ld [$ff1a],a ;turn sound on
ld a,%11000000
ld [curByteMask],a
jr .checkState1
.checkInitSound3
cp 3
jr nz,.checkInitSound4
ld a,1
ld [curByte],a
ld a,%11110000
ld [curByteMask],a
jr .checkState1
.checkInitSound4
ld a,%00111111
ld [curByteMask],a
jr .checkState1
.checkState1
;handle value increase/decrease
ld a,[curJoy1]
bit 2,a
jr z,.tryDown
call IncrementBits
jr .tryButtonA
.tryDown
bit 3,a
jr z,.tryButtonA
call DecrementBits
.tryButtonA
ld a,[curJoy1]
and (BUTTON_A | BUTTON_START)
jr z,.reallyCheckState1
call PlayCurrentSound
.waitRelease
call GetInput
ld a,[curJoy1]
and (BUTTON_A | BUTTON_START)
jr nz,.waitRelease
.reallyCheckState1
ld a,[curSound]
cp a,1
jr nz,.checkState2
call OnState1
jp .stateLoop
.checkState2
cp a,2
jr nz,.checkState3
call OnState2
jp .stateLoop
.checkState3
cp a,3
jr nz,.checkState4
call OnState3
jp .stateLoop
.checkState4
cp a,4
jr nz,.done
call OnState4
.done
jp .stateLoop
;---------------------------------------------------------------------
; Routine: InitSound
; Description: Turns on the sound at full volume both output
; channels
;---------------------------------------------------------------------
InitSound:
;turn on sound at master control
ld a,%10000000
ld [$ff26],a
ld a,$ff
ld [$ff24],a ;full volume
ld [$ff25],a ;both channels
ret
;---------------------------------------------------------------------
; Routine: InitGraphics
; Alters: af
; Description: Sets the display, defines colors, and loads the font.
;---------------------------------------------------------------------
InitGraphics:
push bc
push de
push hl
call DisplayOffWaitVRAM
call SetupSpriteHandler
;set screen offsets to 0
xor a
ldh [$ff43], a
ldh [$ff42], a
call SetupColorPalette
call LoadFont
;turn LCD on
ld a,%11000011
ld [$ff40], a ;lcdc control
pop hl
pop de
pop bc
ret
;---------------------------------------------------------------------
; Routine: DisplayOffWaitVRAM
; Alters: af
; Description: Turns off the screen and waits until the VRAM
; is accessible
;---------------------------------------------------------------------
DisplayOffWaitVRAM:
;turn display off
ld a,[$ffff] ;get interrupts enabled
push af ;save original value
and %11111110 ;turn off vblank interrupt
ld [$ffff],a ;"interrupt THIS!"
.wait ld a,[$ff44] ;get line being drawn
cp 144 ;wait until line is >= 144
jr c,.wait
ld a,[$ff40] ;LCDC register
and %01111111 ;turn off screen
ld [$ff40],a
pop af ;retrieve original interrupt settings
ld [$ffff],a
.waitVRAM
ld a,[$ff41] ;STAT register
and %00000010 ;bit 1 needs to be zero to access VRAM
jr nz,.waitVRAM
ret
;---------------------------------------------------------------------
; Routine: SetupSpriteHandler
; Description: Copies the routine required for sprite DMA to high
; RAM and initializes the sprites to "off"
;---------------------------------------------------------------------
SetupSpriteHandler:
ld hl,oamHandlerStart ;src addr
ld de,SpriteDMAHandler ;dest addr
ld c,(oamHandlerFinish - oamHandlerStart) ;# of bytes
.loop ld a,[hl+]
ld [de],a
inc de
dec c
jr nz,.loop
;clear oam buffer by setting each y-coordinate to zero
ld c,40
ld hl,spriteOAMBuffer
ld de,3 ;add to address hl every time
xor a
.loop2 ld [hl+],a
add hl,de
dec c
jr nz,.loop2
ret
oamHandlerStart:
;addr of start (in $100's)
ld a,((spriteOAMBuffer>>8) & $ff)
ld [$ff00+$46],a ;start sprite dma
ld a,$28 ;start a delay loop
.wait dec a
jr nz,.wait
ret
oamHandlerFinish:
;---------------------------------------------------------------------
; Routine: SetupColorPalette
; Alters: af
; Description: Sets up the background & sprite color palettes
;---------------------------------------------------------------------
SetupColorPalette:
push bc
push hl
ld a,%00100111 ;background color order (0213)
ld [$ff47],a
ld a,$80
ld [$ff68],a ;background specifier
ld [$ff6a],a ;sprite specifier
ld c,8*4 ;copy 32 bytes
ld hl,.paletteData
.loop ld a,[hl+] ;get a byte of data
ld [$ff69],a ;copy to bg color...
ld [$ff6b],a ;...and fg color
dec c
jr nz,.loop
pop bc
pop hl
ret
.paletteData
; black, grey, white, green
DW $0000, $3def, $5ef7, $7fff ;grey/white
DW $23e8, $14a5, $03e0, $0000 ;green bg black fg
DW $0000, $ffff, $ffff, $3def ;grey
DW $0000, $14a5, $ffff, $23e8 ;green & grey fg
;---------------------------------------------------------------------
; Routine: LoadFont
; Alters: af
; Description: Loads in the font data to tile pattern memory (bank 0)
; by copying 2048 bytes from ROM to tile mem.
;---------------------------------------------------------------------
LoadFont:
push bc
push de
push hl
;Switch to VRAM bank 0
xor a
ld [$ff00+$4f],a ;(VRAM bank 0)
ld hl,font ;source address
ld de,$9000 ;destination address
ld b,128 ;copy 128 tiles
.outer
ld c,16 ;16 bytes per tile
.inner ld a,[hl+]
ld [de],a
inc de
dec c
jr nz,.inner
;first 128 tiles from $9000 to $97ff, second 128 tiles from
;$8800-$8fff. If dest points >= $9800 reset to $8800.
ld a,d
cp $98
jr c,.destPtrOkay
ld de,$8800
.destPtrOkay
dec b
jr nz,.outer
pop bc
pop de
pop hl
ret
;---------------------------------------------------------------------
; Routine: ClearScreen
; Alters: af
; Description: Clears the background tile & attribute buffers
;---------------------------------------------------------------------
ClearScreen:
push bc
push de
push hl
;clear background buffer
xor a ;data
ld hl,backBuffer ;addr of tile buffer
ld de,attributeBuffer ;addr of attribute buffer
ld b,18 ;clear 18 lines
.outer
ld c,32 ;32 chars per line
.inner
ld [hl+],a
ld [de],a
inc de
dec c
jr nz,.inner
dec b
jr nz,.outer
pop hl
pop de
pop bc
ret
;---------------------------------------------------------------------
; Routine: PrintText
; Arguments: b - horizonal location (0-19)
; c - vertical location (0-18)
; hl - ptr to null-terminated text
; [textColor] - palette color of text
; Alters: af
; Description: Draws the specified text to the back-buffer
;---------------------------------------------------------------------
PrintTextAtCursor: ;same as printtext but sets up b & c from cursor
push bc
push de
push hl
ld a,[cursor_x]
ld b,a
ld a,[cursor_y]
ld c,a
jr PrintTextCommon
PrintText:
push bc
push de
push hl
PrintTextCommon:
;store b & c in cursor_x/y
ld a,b
ld [cursor_x],a
ld a,c
ld [cursor_y],a
ld d,h ;strptr into de
ld e,l
;convert bc from indices into a memory location
; bc = (c*32) + b + backBuffer
xor a
sla c ;*2
rla
sla c ;*4
rla
sla c ;*8
rla
sla c ;*16
rla
sla c ;*32
rla ;now a+c is a 16 bit value
ld h,a ;save off a
ld a,c ;get low byte
add b ;plus horizontal offset
ld c,a ;is now low byte
ld b,h ;b is high byte, bc is 16 bit offset
ld hl,backBuffer
add hl,bc ;hl now points to backbuffer
;copy the tile indicies
.loop ld a,[de] ;get a character
inc de
or a ;finished if it's null
jr z,.done
ld [hl],a ;write it to the buffer
push hl
ld a,h ;switch to attribute buffer
add 3
ld h,a
ld a,[textColor] ;get the color for this character
ld [hl],a ;write it to attribute buffer
ld a,[cursor_x] ;increment x cursor
inc a
ld [cursor_x],a
pop hl
inc hl
jr .loop
.done
pop hl
pop de
pop bc
ret
;---------------------------------------------------------------------
; Routine: OnVBlank
; Description: Called every vertical blank. Sets "vblankFlag" to
; 1 to indicate a vertical blank has occurred
;---------------------------------------------------------------------
OnVBlank::
push af ;save all registers on stack
push bc
push de
push hl
ld a,1 ;set "vblankFlag" to 1
ldio [vblankFlag],a
;is the backBuffer ready for DMA blit to screen?
ldio a,[backBufferReady]
or a
jr z,.done ;wasn't ready
xor a
ldio [backBufferReady],a ;signal we've blitted it
;store current VRAM bank in use
ld a,[$ff00+$4f]
push af
;set VRAM bank to 0
xor a
ld [$ff00+$4f],a
;use DMA to transfer sprite OAM buffer to VRAM
call SpriteDMAHandler
;Initiate DMA transfer of backbuffer to VRAM
ld hl,backBuffer
ld a,h
ld [$ff00+$51],a ;high byte of source
ld a,l
ld [$ff00+$52],a ;low byte of source
ld a,$98
ld [$ff00+$53],a ;high byte of dest
xor a
ld [$ff00+$54],a ;low byte of dest
ld a,37 ;copy (37+1)*16 = 608 bytes
ld [$ff00+$55],a ;store length to start DMA
;set VRAM bank to 1 (tile attributes)
ld a,1
ld [$ff00+$4f],a
;Initiate DMA transfer of tile attributes to VRAM
ld hl,attributeBuffer
ld a,h
ld [$ff00+$51],a ;high byte of source
ld a,l
ld [$ff00+$52],a ;low byte of source
ld a,$98
ld [$ff00+$53],a ;high byte of dest
xor a
ld [$ff00+$54],a ;low byte of dest
ld a,37 ;copy (37+1)*16 = 608 bytes
ld [$ff00+$55],a ;store length to start DMA
;copy wave chars using dma
ld hl,copyWaveChars
ld a,[hl]
or a
jr z,.afterWaveCopy
xor a
ld [hl],a
ld [$ff00+$4f],a ;set VRAM bank to 0
;Initiate DMA transfer of wave tiles to VRAM
ld a,((waveBuffer>>8) & $ff)
ld [$ff00+$51],a ;high byte of source
ld a,(waveBuffer & $ff)
ld [$ff00+$52],a ;low byte of source
ld a,$90
ld [$ff00+$53],a ;high byte of dest
ld a,$50
ld [$ff00+$54],a ;low byte of dest
ld a,7 ;copy (7+1)*16 = 128 bytes
ld [$ff00+$55],a ;store length to start DMA
.afterWaveCopy
;restore VRAM bank that was in use
pop af
ld [$ff00+$4f],a
.done pop hl ;restore all regs from stack
pop de
pop bc
pop af
reti ;return from interrupt
;---------------------------------------------------------------------
; Routine: GetInput
; Alters: af
; Description: Polls the buttons and stores the input in [curJoy1]
; $80 - Start
; $40 - Select
; $20 - B
; $10 - A
; $08 - Down
; $04 - Up
; $02 - Left
; $01 - Right
;---------------------------------------------------------------------
GetInput::
push bc
ld a,$20
ld [$ff00],a ;select P14
ld a,[$ff00]
ld a,[$ff00] ;wait a few cycles
cpl
and $0f
ld b,a ;b has direction info
ld a,$10 ;select P15
ld [$ff00],a
ld a,[$ff00] ;wait mo
ld a,[$ff00] ;wait mo
ld a,[$ff00] ;wait mo
ld a,[$ff00] ;wait mo
ld a,[$ff00] ;wait mo
ld a,[$ff00] ;wait mo
cpl
and $0f
swap a
or b ;a has all buttons
ld [curJoy1],a
ld a,$30 ;deselect P14 and P15
ld [$ff00],a
pop bc
ret
;---------------------------------------------------------------------
; Routine: WaitKey
; Arguments: a - bits to wait for
; Returns: a - button pressed
; Alters: af
; Description: Waits until all specified bits are not pressed, then
; waits till one is pressed, then waits till all are
; released before returning.
;---------------------------------------------------------------------
WaitKey:
push bc
ld b,a
.waitRelease1
call GetInput
ld a,[curJoy1]
and b
jr nz,.waitRelease1
.waitPress
call GetInput
ld a,[curJoy1]
and b
jr z,.waitPress
ld c,a
.waitRelease2
call GetInput
ld a,[curJoy1]
and b
jr nz,.waitRelease2
ld c,a
pop bc
ret
;---------------------------------------------------------------------
; Routine: ShowInfo
; Description: Displays startup info & waits for a keypress
;---------------------------------------------------------------------
ShowInfo:
call ClearScreen
MPRINT .introText1,0,0,1
MPRINT .introText2,0,1,1
MPRINT .introText2_1,0,2,0
MPRINT .introText3,0,4,0
MPRINT .introText4,0,5,0
MPRINT .introText5,0,7,0
MPRINT .introText6,0,10,1
MPRINT .introText7,0,11,1
MPRINT .introText8,0,12,1
MPRINT .introText9,0,16,0
MPRINT .introText10,0,17,0
UPDATESCREEN
ld a,BUTTON_ALL
call WaitKey
ret
.introText1 DB " GameBoy Sound ",0
.introText2 DB " Manipulator ",0
.introText2_1 DB " v1.1.1 ",0
.introText3 DB " ",15,"2022.01.08 by ",0
.introText4 DB "Abe.Pralle@gmail.com",0
.introText5 DB " ",0
.introText6 DB "SELECT = change type",0
.introText7 DB " D-PAD = settings ",0
.introText8 DB " A = play sound ",0
.introText9 DB " May be freely used ",0
.introText10 DB " and distributed ",0
;---------------------------------------------------------------------
; Routine: OnState1
; Alters: All registers.
; Description: Allows fiddling with sound 1 parameters
;---------------------------------------------------------------------
OnState1:
call ClearScreen
MPRINT .state1Text1,0,0,1
MPRINT .state1Text2,0,16,2
xor a
ld [cursor_x],a
inc a
ld [cursor_y],a
ld c,0 ;display 5 bytes
ld hl,state1_data
.loop
ld a,[hl+]
call DrawByte
inc c
ld a,c
cp 5
jr nz,.loop
ld hl,state1_data
ld d,0
ld a,[curByte]
ld e,a
add hl,de
ld a,[hl]
call DrawBinary
;what is the cursor highlighting?
ld a,[curByte]
or a
jr nz,.checkState1
;state 0
ld a,[curByteMask]
cp %01110000
jr nz,.check0_3
;state 0_64
ld a,0
call PrintInfo
ld a,%00001000
ld b,0
call NewMaskIfRight
ld a,%00000111
ld b,4
call NewMaskIfLeft
jp .done
.check0_3
cp %00001000
jr nz,.check0_20
;state 0_3
ld a,1
call PrintInfo
ld a,%00000111
ld b,0
call NewMaskIfRight
ld a,%01110000
ld b,0
call NewMaskIfLeft
jp .done
.check0_20
ld a,2
call PrintInfo
ld a,%11000000
ld b,1
call NewMaskIfRight
ld a,%00001000
ld b,0
call NewMaskIfLeft
jp .done
.checkState1
cp 1
jr nz,.checkState2
ld a,[curByteMask]
cp %11000000
jr nz,.check1_50
;mask 1_76
ld a,3
call PrintInfo
ld a,%00111111
ld b,1
call NewMaskIfRight
ld a,%00000111
ld b,0
call NewMaskIfLeft
jp .done
.check1_50
ld a,4
call PrintInfo
ld a,%11110000
ld b,2
call NewMaskIfRight
ld a,%11000000
ld b,1
call NewMaskIfLeft
jp .done
.checkState2
cp 2
jr nz,.checkState3
ld a,[curByteMask]
cp %11110000
jr nz,.check2_3
;state 2_74
ld a,5
call PrintInfo
ld a,%00001000
ld b,2
call NewMaskIfRight
ld a,%00011111
ld b,1
call NewMaskIfLeft
jp .done
.check2_3
cp %00001000
jr nz,.check2_20
ld a,6
call PrintInfo
ld a,%00000111
ld b,2
call NewMaskIfRight
ld a,%11110000
ld b,2
call NewMaskIfLeft
jp .done
.check2_20
ld a,7
call PrintInfo
ld a,%11110000
ld b,3
call NewMaskIfRight
ld a,%00001000
ld b,2
call NewMaskIfLeft
jp .done
.checkState3
cp 3
jr nz,.checkState4
ld a,[curByteMask]
cp %11110000
jr nz,.check3_30
;state 3_74
ld a,8
call PrintInfo
ld a,%00001111
ld b,3
call NewMaskIfRight
ld a,%00000111
ld b,2
call NewMaskIfLeft
jp .done
.check3_30
ld a,9
call PrintInfo
ld a,%01000000
ld b,4
call NewMaskIfRight
ld a,%11110000
ld b,3
call NewMaskIfLeft
jr .done
.checkState4
ld a,[curByteMask]
cp %01000000
jr nz,.check4_20
;state 4_6
ld a,10
call PrintInfo
ld a,%00000111
ld b,4
call NewMaskIfRight
ld a,%00001111
ld b,3
call NewMaskIfLeft
jr .done
.check4_20
ld a,11
call PrintInfo
ld a,%11100000
ld b,0
call NewMaskIfRight
ld a,%01000000
ld b,4
call NewMaskIfLeft
.done
UPDATESCREEN
ret
.state1Text1 DB "Sound 1: Quad+Sweep ",0
.state1Text2 DB "REGS FF10-FF14 ",0
;---------------------------------------------------------------------
; Routine: OnState2
; Alters: All registers.
; Description: Allows fiddling with sound 2 parameters
;---------------------------------------------------------------------
OnState2:
call ClearScreen
MPRINT .state2Text1,0,0,1
MPRINT .state2Text2,0,16,2
xor a
ld [cursor_x],a
inc a
ld [cursor_y],a
ld c,0 ;display 4 bytes
ld hl,state2_data
.loop
ld a,[hl+]
call DrawByte
inc c
ld a,c
cp 4
jr nz,.loop
ld hl,state2_data
ld d,0
ld a,[curByte]
ld e,a
add hl,de
ld a,[hl]
call DrawBinary
;what is the cursor highlighting?
ld a,[curByte]
or a
jr nz,.checkState1
.checkState0
ld a,[curByteMask]
cp %11000000
jr nz,.check0_50
;mask 0_76
ld a,3
call PrintInfo
ld a,%00111111
ld b,0
call NewMaskIfRight
ld a,%00000111
ld b,3
call NewMaskIfLeft
jp .done
.check0_50
ld a,4
call PrintInfo
ld a,%11110000
ld b,1
call NewMaskIfRight
ld a,%11000000
ld b,0
call NewMaskIfLeft
jp .done
.checkState1
cp 1
jr nz,.checkState2
ld a,[curByteMask]
cp %11110000
jr nz,.check1_3
;state 1_74
ld a,5
call PrintInfo
ld a,%00001000
ld b,1
call NewMaskIfRight
ld a,%00011111
ld b,0
call NewMaskIfLeft
jp .done
.check1_3
cp %00001000
jr nz,.check1_20
ld a,6
call PrintInfo
ld a,%00000111
ld b,1
call NewMaskIfRight
ld a,%11110000
ld b,1
call NewMaskIfLeft
jp .done
.check1_20
ld a,7
call PrintInfo
ld a,%11110000
ld b,2
call NewMaskIfRight
ld a,%00001000
ld b,1
call NewMaskIfLeft
jp .done
.checkState2
cp 2
jr nz,.checkState3
ld a,[curByteMask]
cp %11110000
jr nz,.check2_30
;state 2_74
ld a,8
call PrintInfo
ld a,%00001111
ld b,2
call NewMaskIfRight
ld a,%00000111
ld b,1
call NewMaskIfLeft
jp .done
.check2_30
ld a,9
call PrintInfo
ld a,%01000000
ld b,3
call NewMaskIfRight
ld a,%11110000
ld b,2
call NewMaskIfLeft
jr .done
.checkState3
ld a,[curByteMask]
cp %01000000
jr nz,.check3_20
;state 3_6
ld a,10
call PrintInfo
ld a,%00000111
ld b,3
call NewMaskIfRight
ld a,%00001111
ld b,2
call NewMaskIfLeft
jr .done
.check3_20
ld a,11
call PrintInfo
ld a,%11100000
ld b,0
call NewMaskIfRight
ld a,%01000000
ld b,3
call NewMaskIfLeft
.done
UPDATESCREEN
ret
.state2Text1 DB "Sound 2: Quadrangulr",0
.state2Text2 DB "REGS FF16-FF19 ",0
;---------------------------------------------------------------------
; Routine: OnState3
; Alters: All registers.
; Description: Allows fiddling with sound 3 parameters
;---------------------------------------------------------------------
OnState3:
call ClearScreen
MPRINT .state3Text1,0,0,1
MPRINT .state3Text2,0,16,2
xor a
ld [cursor_x],a
inc a
ld [cursor_y],a
ld c,0 ;display 5 bytes
ld hl,state3_data
.loop
ld a,[hl+]
call DrawByte
inc c
ld a,c
cp 5
jr nz,.loop
ld hl,state3_data
ld d,0
ld a,[curByte]
ld e,a
add hl,de
ld a,[hl]
call DrawBinary
;draw first line of waveform bytes
xor a
ld [cursor_x],a
ld a,5
ld [cursor_y],a
ld c,5 ;display next 8 bytes
ld hl,state3_data+5
.loop2
ld a,[hl+]
call DrawByte
ld a,[cursor_x] ;prevent space between bytes
dec a
ld [cursor_x],a
inc c
ld a,c
cp 13
jr nz,.loop2
;draw second line of waveform bytes
xor a
ld [cursor_x],a
ld a,6
ld [cursor_y],a
ld c,13 ;display next 8 bytes
ld hl,state3_data+13
.loop3
ld a,[hl+]
call DrawByte
ld a,[cursor_x] ;prevent space between bytes
dec a
ld [cursor_x],a
inc c
ld a,c
cp 21
jr nz,.loop3
;draw the graphic waveform box
MPRINT .state3BoxTop,16,5,3
MPRINT .state3BoxBottom,16,6,3
;what is the cursor highlighting?
ld a,[curByte]
;note: will never be byte zero
cp 1
jr nz,.checkState2
ld a,[curByteMask]
cp %11110000
jr nz,.check1_30
;state 1_74
ld a,15
call PrintInfo
ld a,%00001111
ld b,1
call NewMaskIfRight
ld a,%00001111
ld b,20
call NewMaskIfLeft
jp .done
.check1_30
ld a,16
call PrintInfo
ld a,%01100000
ld b,2
call NewMaskIfRight
ld a,%11110000
ld b,1
call NewMaskIfLeft
jp .done
.checkState2
cp 2
jr nz,.checkState3
;state 2_65
ld a,17
call PrintInfo
ld a,%11110000
ld b,3
call NewMaskIfRight
ld a,%00001111
ld b,1
call NewMaskIfLeft
jp .done
.checkState3
cp 3
jr nz,.checkState4
ld a,[curByteMask]
cp %11110000
jr nz,.check3_30
;state 3_74
ld a,18
call PrintInfo
ld a,%00001111
ld b,3
call NewMaskIfRight
ld a,%01100000
ld b,2
call NewMaskIfLeft
jp .done
.check3_30
ld a,19
call PrintInfo
ld a,%01000000
ld b,4
call NewMaskIfRight
ld a,%11110000
ld b,3
call NewMaskIfLeft
jp .done
.checkState4
cp 4
jr nz,.check5
ld a,[curByteMask]
cp %01000000
jr nz,.check4_20
;4_6
ld a,20
call PrintInfo
ld a,%00000111
ld b,4
call NewMaskIfRight
ld a,%00001111
ld b,3
call NewMaskIfLeft
jp .done
.check4_20
ld a,21
call PrintInfo
ld a,%11110000
ld b,5
call NewMaskIfRight
ld a,%01000000
ld b,4
call NewMaskIfLeft
jp .done
.check5
cp 5
jr nz,.check20
call TestWaveButtonB
ld a,[curByteMask]
cp %11110000
jr nz,.check5_30
;check5_74
ld a,22
call PrintInfo
ld a,%00001111
ld b,5
call NewMaskIfRight
ld a,%00000111
ld b,4
call NewMaskIfLeft
jp .done
.check5_30
ld a,22
call PrintInfo
ld a,%11110000
ld b,6
call NewMaskIfRight
ld a,%11110000
ld b,5
call NewMaskIfLeft
jp .done
.check20
cp 20
jr nz,.check6_to_19
call TestWaveButtonB
ld a,[curByteMask]
cp %11110000
jr nz,.check20_30
;check20_74
ld a,22
call PrintInfo
ld a,%00001111
ld b,20
call NewMaskIfRight
ld a,%00001111
ld b,19
call NewMaskIfLeft
jr .done
.check20_30
ld a,22
call PrintInfo
ld a,%11110000
ld b,1
call NewMaskIfRight
ld a,%11110000
ld b,20
call NewMaskIfLeft
jr .done
.check6_to_19
call TestWaveButtonB
ld a,[curByteMask]
cp %11110000
jr nz,.check6_to_19_30
;6_to_19_74
ld a,22
call PrintInfo
ld a,[curByte]
ld b,a
ld a,%00001111
call NewMaskIfRight
ld a,[curByte]
dec a
ld b,a
ld a,%00001111
call NewMaskIfLeft
jr .done
.check6_to_19_30
ld a,22
call PrintInfo
ld a,[curByte]
inc a
ld b,a
ld a,%11110000
call NewMaskIfRight
ld a,[curByte]
ld b,a
ld a,%11110000
call NewMaskIfLeft
.done
call RestoreWaveBox
call PlotWaveForm
ld a,1
ld [copyWaveChars],a
UPDATESCREEN
ret
.state3Text1 DB "Sound 3: Custom Wave",0
.state3Text2 DB "REGS FF1A-1E,FF30-3F",0
.state3BoxTop DB 5,6,7,8,0
.state3BoxBottom DB 9,10,11,12,0
;---------------------------------------------------------------------
; Routine: TestWaveButtonB
; Alters: af
; Description: If the B button is pressed, copies the current nibble
; of wave data to the next one and sets the current
; byte/nibble to be the next value
;---------------------------------------------------------------------
TestWaveButtonB:
ld a,[curJoy1] ;test for B pressed
and BUTTON_B
ret z
;release button b
.waitRelease
call GetInput
ld a,[curJoy1]
and BUTTON_B
jr nz,.waitRelease
;start of routine proper
push bc
push de
push hl
;if the last byte then copy the first byte into the pad byte
;following
ld a,[curByte]
cp 20
jr nz,.determineNibble
ld a,[state3_data+5]
ld [state3_data+21],a
.determineNibble
ld a,[curByteMask]
cp %00001111
jr z,.lowNibble
;high nibble being copied to low nibble
call GetCurByteValue
and %11110000
ld b,a
swap b
or b
ld [hl],a
ld a,%00001111
ld [curByteMask],a
jr .done
.lowNibble ;being copied to high nibble of next byte
call GetCurByteValue
and %00001111
swap a
ld b,a
inc hl
ld a,[hl]
and %00001111
or b
ld [hl],a
ld a,%11110000
ld [curByteMask],a
ld a,[curByte]
inc a
ld [curByte],a
;did we run off the end into the pad byte?
ld a,[curByte]
cp 21
jr nz,.done
;if so copy that pad byte back to the beginning
ld a,[state3_data+21]
ld [state3_data+5],a
ld a,5
ld [curByte],a
.done
call PlayCurrentSound
pop hl
pop de
pop bc
ret
;---------------------------------------------------------------------
; Routine: OnState4
; Alters: All registers.
; Description: Allows fiddling with sound 4 parameters
;---------------------------------------------------------------------
OnState4:
call ClearScreen
MPRINT .state4Text1,0,0,1
MPRINT .state4Text2,0,16,2
xor a
ld [cursor_x],a
inc a
ld [cursor_y],a
ld c,0 ;display 4 bytes
ld hl,state4_data
.loop
ld a,[hl+]
call DrawByte
inc c
ld a,c
cp 4
jr nz,.loop
ld hl,state4_data
ld d,0
ld a,[curByte]
ld e,a
add hl,de
ld a,[hl]
call DrawBinary
;what is the cursor highlighting?
ld a,[curByte]
or a
jr nz,.checkState1
.check0_50
ld a,4
call PrintInfo
ld a,%11110000
ld b,1
call NewMaskIfRight
ld a,%01000000
ld b,3
call NewMaskIfLeft
jp .done
.checkState1
cp 1
jr nz,.checkState2
ld a,[curByteMask]
cp %11110000
jr nz,.check1_3
;state 1_74
ld a,5
call PrintInfo
ld a,%00001000
ld b,1
call NewMaskIfRight
ld a,%00011111
ld b,0
call NewMaskIfLeft
jp .done
.check1_3
cp %00001000
jr nz,.check1_20
ld a,6
call PrintInfo
ld a,%00000111
ld b,1
call NewMaskIfRight
ld a,%11110000
ld b,1
call NewMaskIfLeft
jp .done
.check1_20
ld a,7
call PrintInfo
ld a,%11110000
ld b,2
call NewMaskIfRight
ld a,%00001000
ld b,1
call NewMaskIfLeft
jp .done
.checkState2
cp 2
jr nz,.checkState3
ld a,[curByteMask]
cp %11110000
jr nz,.check2_3
;state 2_74
ld a,12
call PrintInfo
ld a,%00001000
ld b,2
call NewMaskIfRight
ld a,%00000111
ld b,1
call NewMaskIfLeft
jp .done
.check2_3
cp %00001000
jr nz,.check2_20
ld a,13
call PrintInfo
ld a,%00000111
ld b,2
call NewMaskIfRight
ld a,%11110000
ld b,2
call NewMaskIfLeft
jp .done
.check2_20
ld a,14
call PrintInfo
ld a,%01000000
ld b,3
call NewMaskIfRight
ld a,%00001000
ld b,2
call NewMaskIfLeft
jp .done
.checkState3
;state 3_6
ld a,10
call PrintInfo
ld a,%00111111
ld b,0
call NewMaskIfRight
ld a,%00000111
ld b,2
call NewMaskIfLeft
.done
UPDATESCREEN
ret
.state4Text1 DB "Sound 4: White Noise",0
.state4Text2 DB "REGS FF20-FF23 ",0
;---------------------------------------------------------------------
; Routine: DrawByte
; Arguments: a - byte to show
; c - index of byte
; Alters: af
; Description: Displays byte A in hex form at the current cursor
; position. Highlights the byte or a nibble if the
; cursor is over it.
;---------------------------------------------------------------------
DrawByte:
push bc
push de
push hl
ld b,0 ;highlight assumed false
ld e,a ;save byte
ld a,[curByte] ;are we drawing byte under cursor?
cp c
jr nz,.after_highlight
;highlight which nibbles?
ld a,[curByteMask]
and %11110000
jr z,.checkHighlightLowNibble
set 1,b
.checkHighlightLowNibble
ld a,[curByteMask]
and %00001111
jr z,.after_highlight
set 0,b
.after_highlight
ld a,e ;retrieve byte to draw
swap a
and %00001111 ;draw high nibble
push bc
srl b
call DrawNibble
pop bc
res 1,b ;make sure high-nibble highlight flag zero
ld a,e
and %00001111 ;draw low nibble
call DrawNibble
;draw a blank space
xor a
ld [textColor],a
ld a,[cursor_x]
ld b,a
inc a
ld [cursor_x],a
ld a,[cursor_y]
ld c,a
ld hl,.blankSpace
call PrintText
pop hl
pop de
pop bc
ret
.blankSpace DB " ",0
;---------------------------------------------------------------------
; Routine: DrawNibble
; Arguments: a - nibble to draw
; b - 1=highlight, 0=normal
; Alters: af
; Description: Displays nibble A in hex form at the current cursor
; position. Highlights the byte or a nibble if the
; cursor is over it.
;---------------------------------------------------------------------
DrawNibble:
push bc
push de
push hl
;load hl with ptr to string to draw
ld hl,.hexTable
rlca
add l
ld l,a
ld a,0
adc h
ld h,a
;handle highlight
ld a,b
ld [textColor],a
;get coordinates to draw at
ld a,[cursor_x]
ld b,a
inc a
ld [cursor_x],a
ld a,[cursor_y]
ld c,a
;draw it
call PrintText
pop hl
pop de
pop bc
ret
.hexTable
DB "0",0
DB "1",0
DB "2",0
DB "3",0
DB "4",0
DB "5",0
DB "6",0
DB "7",0
DB "8",0
DB "9",0
DB "A",0
DB "B",0
DB "C",0
DB "D",0
DB "E",0
DB "F",0
;---------------------------------------------------------------------
; Routine: DrawBinary
; Arguments: a - byte to draw in binary form
; [curByteMask] - bits to highlight
; Alters: af
; Description: Displays selected byte in binary form
;---------------------------------------------------------------------
DrawBinary:
push bc
push de
push hl
ld b,a ;save data for later
ld a,[curByteMask]
ld d,a ;save mask for later
MPRINT .percent,0,3,0
ld c,8 ;draw 8 bits
.loop rlc b ;rotate b left, old bit 7 to carry
jr c,.drawOne
;draw zero
rlc d ;look at corresponding bit of mask
jr c,.drawZeroHighlighted
PRINTCURSOR .zero,0
jr .continue
.drawZeroHighlighted
PRINTCURSOR .zero,1
jr .continue
.drawOne
rlc d
jr c,.drawOneHighlighted
PRINTCURSOR .one,0
jr .continue
.drawOneHighlighted
PRINTCURSOR .one,1
.continue
dec c
jr nz,.loop
pop hl
pop de
pop bc
ret
.percent DB "%",0
.zero DB "0",0
.one DB "1",0
;---------------------------------------------------------------------
; Routines: IncrementBits
; DecrementBits
; Alters: af
; Description: Adds or subtracts one to [curByteMask] portion of
; [curByte].
;---------------------------------------------------------------------
IncrementBits:
push bc
;make mask for value to increment
ld a,[curByteMask]
ld b,a
ld c,a
sla a
xor b
and b
ld b,a ;b has one bit set = proper value to increment
call GetCurByteValue
add b
and c
ld b,a
ld a,$ff
xor c
and [hl]
or b
ld [hl],a
;prevent prohibited values for sound 4
ld a,[curSound]
cp 4
jr nz,.playSound
ld a,[curByte]
cp 2
jr nz,.playSound
ld a,[curByteMask]
cp %11110000
jr nz,.playSound
ld a,[hl]
and %11100000
xor %11100000
jr nz,.playSound
ld a,%00001111 ;fix prohibited value
and [hl]
ld [hl],a
.playSound
call PlayCurrentSound
.waitRelease
call GetInput
ld a,[curJoy1]
and DPAD_UP
jr nz,.waitRelease
pop bc
ret
DecrementBits:
push bc
;make mask for value to increment
ld a,[curByteMask]
ld b,a
ld c,a
sla a
xor b
and b
ld b,a ;b has one bit set = proper value to increment
call GetCurByteValue
sub b
and c
ld b,a
ld a,$ff
xor c
and [hl]
or b
ld [hl],a
;prevent prohibited values for sound 4
ld a,[curSound]
cp 4
jr nz,.playSound
ld a,[curByte]
cp 2
jr nz,.playSound
ld a,[curByteMask]
cp %11110000
jr nz,.playSound
ld a,[hl]
and %11100000
xor %11100000
jr nz,.playSound
ld a,%00001111 ;fix prohibited value
and [hl]
or %11010000
ld [hl],a
.playSound
call PlayCurrentSound
.waitRelease
call GetInput
ld a,[curJoy1]
and DPAD_DOWN
jr nz,.waitRelease
pop bc
ret
;---------------------------------------------------------------------
; Routine: GetCurByteValue
; Returns: a - selected byte value
; hl - addr of selected value
; Alters: af,hl
;---------------------------------------------------------------------
GetCurByteValue:
push de
ld a,[curByte]
ld e,a
ld d,0
ld a,[curSound]
cp 1
jr nz,.checkState2
ld hl,state1_data
jr .done
.checkState2
cp 2
jr nz,.checkState3
ld hl,state2_data
jr .done
.checkState3
cp 3
jr nz,.checkState4
ld hl,state3_data
jr .done
.checkState4
ld hl,state4_data
.done
add hl,de
ld a,[hl]
pop de
ret
;---------------------------------------------------------------------
; Routine: PlayCurrentSound
; Alters: af
;---------------------------------------------------------------------
PlayCurrentSound:
push bc
push de
push hl
ld a,[curSound]
cp 1
jr nz,.checkState2
ld hl,state1_data
ld a,[hl+]
ld [$ff10],a
ld a,[hl+]
ld [$ff11],a
ld a,[hl+]
ld [$ff12],a
ld a,[hl+]
ld [$ff13],a
ld a,[hl+]
ld [$ff14],a
jr .done
.checkState2
cp 2
jr nz,.checkState3
ld hl,state2_data
ld a,[hl+]
ld [$ff16],a
ld a,[hl+]
ld [$ff17],a
ld a,[hl+]
ld [$ff18],a
ld a,[hl+]
ld [$ff19],a
jr .done
.checkState3
cp 3
jr nz,.checkState4
xor a
ld [$ff1a],a ;turn off sound
;copy waveform data to $ff30-$ff40
ld c,$30
ld hl,state3_data+5
.copyWave
ld a,[hl+]
ld [c],a
inc c
ld a,c
cp $40
jr nz,.copyWave
ld hl,state3_data
ld a,[hl+]
ld [$ff1a],a
ld a,[hl+]
ld [$ff1b],a
ld a,[hl+]
ld [$ff1c],a
ld a,[hl+]
ld [$ff1d],a
ld a,[hl+]
ld [$ff1e],a
jr .done
.checkState4
ld hl,state4_data
ld a,[hl+]
ld [$ff20],a
ld a,[hl+]
ld [$ff21],a
ld a,[hl+]
ld [$ff22],a
ld a,[hl+]
ld [$ff23],a
.done
pop hl
pop de
pop bc
ret
;---------------------------------------------------------------------
; Routines: NewMaskIfRight
; NewMaskIfLeft
; Arguments: a - new mask if DPAD right/left is pressed
; b - new byte if DPAD right/left is pressed
; Alters: af
;---------------------------------------------------------------------
NewMaskIfRight:
push bc
ld c,a
ld a,[curJoy1]
and DPAD_RIGHT
jr nz,NewMaskCommon
pop bc
ret
NewMaskCommon:
;pressed!
ld a,b
ld [curByte],a
ld a,c
ld [curByteMask],a
.waitRelease
call GetInput
ld a,[curJoy1]
and (DPAD_RIGHT | DPAD_LEFT)
jr nz,.waitRelease
pop bc
ret
NewMaskIfLeft:
push bc
ld c,a
ld a,[curJoy1]
and DPAD_LEFT
jr nz,NewMaskCommon
pop bc
ret
;---------------------------------------------------------------------
; Routine: PrintInfo
; Arguments: a - index of info to print
; Alters: af
; Description: Prints helpful text to the screen depending on which
; byte+mask is selected
;---------------------------------------------------------------------
PrintInfo:
push bc
push de
push hl
call .printInfoBody
MPRINT .selectString,0,17,2
pop hl
pop de
pop bc
ret
.selectString DB "SELECT=change sounds",0
.printInfoBody
.check0
or a
jr z,.print0
jp .check1
.print0
MPRINT .t0_1,0,5,1
MPRINT .t0_2,0,6,2
MPRINT .t0_3,0,7,2
MPRINT .t0_4,0,8,2
MPRINT .t0_5,0,9,2
MPRINT .t0_6,0,10,2
MPRINT .t0_7,0,11,2
MPRINT .t0_8,0,12,2
MPRINT .t0_9,0,13,2
ret
.check1
cp 1
jr nz,.check2
MPRINT .t1_1,0,5,1
MPRINT .t1_2,0,6,2
MPRINT .t1_3,0,7,2
ret
.check2
cp 2
jr nz,.check3
MPRINT .t2_1,0,5,1
MPRINT .t2_2,0,6,2
MPRINT .t2_3,0,7,2
MPRINT .t2_4,0,8,2
ret
.check3
cp 3
jr nz,.check4
MPRINT .t3_1,0,5,1
MPRINT .t3_2,0,6,2
MPRINT .t3_3,0,7,2
MPRINT .t3_4,0,8,2
MPRINT .t3_5,0,9,2
ret
.check4
cp 4
jr nz,.check5
MPRINT .t4_1,0,5,1
MPRINT .t4_2,0,6,2
MPRINT .t4_3,0,8,2
MPRINT .t4_4,0,9,2
ret
.check5
cp 5
jr nz,.check6
MPRINT .t5_1,0,5,1
MPRINT .t5_2,0,6,2
MPRINT .t5_3,0,7,2
ret
.check6
cp 6
jr nz,.check7
MPRINT .t6_1,0,5,1
MPRINT .t6_2,0,6,2
MPRINT .t6_3,0,7,2
ret
.check7
cp 7
jr nz,.check8
MPRINT .t7_1,0,5,1
MPRINT .t7_2,0,6,2
MPRINT .t7_3,0,7,2
MPRINT .t7_4,0,8,2
MPRINT .t7_5,0,9,2
ret
.check8
cp 8
jr nz,.check9
MPRINT .t8_1,0,5,1
MPRINT .t8_2,0,6,2
MPRINT .t8_3,0,7,2
MPRINT .t8_4,0,9,2
MPRINT .t8_5,0,10,2
ret
.check9
cp 9
jr nz,.check10
MPRINT .t9_1,0,5,1
MPRINT .t9_2,0,6,2
MPRINT .t9_3,0,7,2
MPRINT .t9_4,0,9,2
MPRINT .t9_5,0,10,2
ret
.check10
cp 10
jr nz,.check11
MPRINT .t10_1,0,5,1
MPRINT .t10_2,0,6,2
MPRINT .t10_3,0,7,2
ret
.check11
cp 11
jr nz,.check12
MPRINT .t11_1,0,5,1
MPRINT .t11_2,0,6,2
MPRINT .t11_3,0,7,2
MPRINT .t11_4,0,9,2
MPRINT .t11_5,0,10,2
ret
.check12
cp 12
jr z,.print12
jp .check13
.print12
MPRINT .t12_1,0,5,1
MPRINT .t12_2,0,6,2
MPRINT .t12_3,0,7,2
MPRINT .t12_4,0,9,2
MPRINT .t12_5,0,10,2
MPRINT .t12_6,0,11,2
MPRINT .t12_7,0,12,2
MPRINT .t12_8,0,13,2
ret
.check13
cp 13
jr nz,.check14
MPRINT .t13_1,0,5,1
MPRINT .t13_2,0,6,2
MPRINT .t13_3,0,7,2
ret
.check14
cp 14
jr z,.print14
jp .check15
.print14
MPRINT .t14_1,0,5,1
MPRINT .t14_2,0,6,2
MPRINT .t14_3,0,7,2
MPRINT .t14_4,0,8,2
MPRINT .t14_5,0,9,2
MPRINT .t14_6,0,10,2
MPRINT .t14_7,0,11,2
MPRINT .t14_8,0,12,2
MPRINT .t14_9,0,13,2
MPRINT .t14_10,0,14,2
ret
.check15
cp 15
jr nz,.check16
MPRINT .t15_1,0,8,1
MPRINT .t15_2,0,9,2
MPRINT .t15_3,0,10,2
MPRINT .t15_4,0,11,2
MPRINT .t15_5,0,12,2
MPRINT .t15_6,0,13,2
ret
.check16
cp 16
jr nz,.check17
MPRINT .t16_1,0,8,1
MPRINT .t16_2,0,9,2
MPRINT .t15_3,0,10,2
MPRINT .t15_4,0,11,2
MPRINT .t15_5,0,12,2
MPRINT .t15_6,0,13,2
ret
.check17
cp 17
jr nz,.check18
MPRINT .t17_1,0,8,1
MPRINT .t17_2,0,9,2
MPRINT .t17_3,0,10,2
MPRINT .t17_4,0,11,2
MPRINT .t17_5,0,12,2
ret
.check18
cp 18
jr nz,.check19
MPRINT .t8_1,0,8,1
MPRINT .t8_2,0,9,2
MPRINT .t8_3,0,10,2
MPRINT .t8_4,0,11,2
MPRINT .t8_5,0,12,2
ret
.check19
cp 19
jr nz,.check20
MPRINT .t9_1,0,8,1
MPRINT .t9_2,0,9,2
MPRINT .t9_3,0,10,2
MPRINT .t9_4,0,11,2
MPRINT .t9_5,0,12,2
ret
.check20
cp 20
jr nz,.check21
MPRINT .t10_1,0,8,1
MPRINT .t10_2,0,9,2
MPRINT .t10_3,0,10,2
ret
.check21
cp 21
jr nz,.check22
MPRINT .t11_1,0,8,1
MPRINT .t11_2,0,9,2
MPRINT .t11_3,0,10,2
MPRINT .t11_4,0,11,2
MPRINT .t11_5,0,12,2
ret
.check22
MPRINT .t22_1,0,8,1
MPRINT .t22_2,0,9,2
MPRINT .t22_3,0,10,2
MPRINT .t22_4,0,11,2
ret
.t0_1 DB "Sweep Time ",0
.t0_2 DB "000 - off",0
.t0_3 DB "001 1/128 Hz (short)",0
.t0_4 DB "010 2/128 Hz",0
.t0_5 DB "011 3/128 Hz",0
.t0_6 DB "100 4/128 Hz",0
.t0_7 DB "101 5/128 Hz",0
.t0_8 DB "110 6/128 Hz",0
.t0_9 DB "111 7/128 Hz (long)",0
.t1_1 DB "Sweep increase/decr ",0
.t1_2 DB " 0: Freq increases",0
.t1_3 DB " 1: Freq decreases",0
.t2_1 DB "# Sweep Shifts ",0
.t2_2 DB "000: None",0
.t2_3 DB "001: 1 (quick shift)",0
.t2_4 DB "111: 7 (long shift)",0
.t3_1 DB "Waveform Duty ",0
.t3_2 DB "00: 12.5% ",1,2,3,3,3,3,3,3,1,2,0
.t3_3 DB "01: 25% ",1,2,3,3,1,2,3,3,1,2,0
.t3_4 DB "10: 50% ",1,2,1,2,1,2,1,2,1,2,0
.t3_5 DB "11: 75% ",1,4,4,2,1,4,4,2,1,4,0
.t4_1 DB "Sound Length ",0
.t4_2 DB "= (64-t)*(1/256) sec",0
.t4_3 DB "00000: long 1/4 sec",0
.t4_4 DB "11111: short 1/256 s",0
.t5_1 DB "Initial Envelope Vol",0
.t5_2 DB " 0000: mute",0
.t5_3 DB " 1111: loud",0
.t6_1 DB "Envelope Up/Down ",0
.t6_2 DB "0: Decrease (quietr)",0
.t6_3 DB "1: Increase (louder)",0
.t7_1 DB "# Envelope Steps ",0
.t7_2 DB "000: No change (off)",0
.t7_3 DB "001: Shorter fade",0
.t7_4 DB " ...",0
.t7_5 DB "111: Longer fade",0
.t8_1 DB "Frequency [7:4] ",0
.t8_2 DB "Mid 4 bits of",0
.t8_3 DB "11-bit frequency.",0
.t8_4 DB "Hz=131072/(2048-gb)",0
.t8_5 DB "gb=2048-(131072/Hz)",0
.t9_1 DB "Frequency [3:0] ",0
.t9_2 DB "Lower 4 bits of",0
.t9_3 DB "11-bit frequency.",0
.t9_4 DB "Hz=131072/(2048-gb)",0
.t9_5 DB "gb=2048-(131072/Hz)",0
.t10_1 DB "Consecutive flag ",0
.t10_2 DB " 0: Repeat",0
.t10_3 DB " 1: No Repeat",0
.t11_1 DB "Frequency [11:8] ",0
.t11_2 DB "Upper 3 bits of",0
.t11_3 DB "11-bit frequency.",0
.t11_4 DB "Hz=131072/(2048-gb)",0
.t11_5 DB "gb=2048-(131072/Hz)",0
.t12_1 DB "Shift Clk Frequency ",0
.t12_2 DB "0000: Ratio * 1/2",0
.t12_3 DB "0001: Ratio * 1/4",0
.t12_4 DB "0010: Ratio * 1/8",0
.t12_5 DB " ...",0
.t12_6 DB "1101: Ratio * 1/2",13,0 ;char 13 = "14" superscript
.t12_7 DB "1110: Illegal Code",0
.t12_8 DB "1111: Illegal Code",0
.t13_1 DB "Step for Counter ",0
.t13_2 DB " 0: 15 steps",0
.t13_3 DB " 1: 7 steps",0
.t14_1 DB "Dividing Ratio ",0
.t14_2 DB " f=(4.194304/8) Mhz",0
.t14_3 DB "000: f * 2",0
.t14_4 DB "001: f * 1",0
.t14_5 DB "010: f * 1/2",0
.t14_6 DB "011: f * 1/3",0
.t14_7 DB "100: f * 1/4",0
.t14_8 DB "101: f * 1/5",0
.t14_9 DB "110: f * 1/6",0
.t14_10 DB "111: f * 1/7",0
.t15_1 DB "Sound Length [7:4] ",0
.t15_2 DB "Upper 4 bits of",0
.t15_3 DB "8-bit duration.",0
.t15_4 DB "=(256-t)*(1/256) sec",0
.t15_5 DB " 0: longer",0
.t15_6 DB " 255: shorter",0
.t16_1 DB "Sound Length [3:0] ",0
.t16_2 DB "Lower 4 bits of",0
.t17_1 DB "Output Level ",0
.t17_2 DB " 00: Mute ",0
.t17_3 DB " 01: Normal ",0
.t17_4 DB " 10: >> 1 ",0
.t17_5 DB " 11: >> 2 ",0
.t22_1 DB "Wave Data ",0
.t22_2 DB "Press B to copy",0
.t22_3 DB "current nibble to",0
.t22_4 DB "next nibble",0
;---------------------------------------------------------------------
; Routine: RestoreWaveBox
; Alters: af
; Description: Restores the wave-form box buffer to its empty state.
;---------------------------------------------------------------------
RestoreWaveBox:
push bc
push de
push hl
ld hl,.emptyWaveBox
ld de,waveBuffer
ld c,16*8
.loop ld a,[hl+]
ld [de],a
inc de
dec c
jr nz,.loop
pop hl
pop de
pop bc
ret
.emptyWaveBox
DW `22222222
DW `20000000
DW `20222000
DW `20220000
DW `20200000
DW `20000000
DW `20000000
DW `20000000
DW `22222222
DW `00000002
DW `00000000
DW `00000000
DW `00000002
DW `00000002
DW `00000000
DW `00000000
DW `22222222,`00000000,`20000000,`20000000
DW `00000000,`00000000,`20000000,`20000000
DW `22222222
DW `00000002
DW `00000002
DW `00000002
DW `00000002
DW `00000002
DW `00000002
DW `00000002
DW `20000000
DW `20000000
DW `20000000
DW `20222000
DW `20202000
DW `20222000
DW `20000000
DW `22222222
DW `00000002
DW `00000002
DW `00000000
DW `00000000
DW `00000002
DW `00000002
DW `00000000
DW `22222222
DW `00000000, `00000000, `20000000, `20000000
DW `00000000, `00000000, `20000000, `22222222
DW `00000002
DW `00000002
DW `00000002
DW `00000002
DW `00000002
DW `00000002
DW `00000002
DW `22222222
;---------------------------------------------------------------------
; Routine: PlotWavePoint
; Arguments: b - x coord of point (0-31)
; c - y coord of point (0-15)
; Alters: af
; Description: Alters the characters 5-8 and 9-12 which form a
; graphical representation of a waveform by placing a
; green pixel at the specified position (x,y) away from
; the BOTTOM left corner of the 3x2 box of characters.
;---------------------------------------------------------------------
PlotWavePoint:
push bc
push de
push hl
ld a,c
and %00001111
ld c,a
;reverse vertical axis so that 0 is topmost "normal"
ld a,15
sub c
ld c,a
ld hl,waveBuffer
;does point lie within top half or bottom half of box?
ld a,c
cp 8
jr c,.findHorizontal ;coords are in top half
;bottom half
ld de,16*4 ;skip 4 tiles (the top)
add hl,de
sub 8
ld c,a
.findHorizontal
ld a,b
cp 8
jr c,.foundTile
ld de,16
add hl,de
sub 8
ld b,a
jr .findHorizontal
.foundTile ;hl now points to tile to change. b is 0-7, c is 0-7
ld a,c
or a
jr z,.atCorrectVertical
inc hl
inc hl
dec c
jr .foundTile
.atCorrectVertical
;make a bit mask of of c using shifting
ld c,%10000000
ld a,b
or a
jr z,.haveMask
.makeMask
srl c
dec b
jr nz,.makeMask
.haveMask
ld a,c ;make green by setting bits to 1 and 1
or [hl]
ld [hl+],a
ld a,c
or [hl]
ld [hl],a
pop hl
pop de
pop bc
ret
;---------------------------------------------------------------------
; Routine: PlotWaveForm
; Alters: af
; Description: Uses PlotWavePoint() to plot the sound 3 custom
; waveform to the box
;---------------------------------------------------------------------
PlotWaveForm:
push bc
push de
push hl
;copy the first byte to one past the end to avoid hassle
ld a,[state3_data+5]
ld [state3_data+21],a
ld b,0
ld hl,state3_data+5
.loop ld a,[hl+]
ld c,a
swap c
call PlotWavePoint
ld a,c
swap a
call ExtendLineToNeighbor
swap c
inc b
call PlotWavePoint
ld a,[hl]
swap a
call ExtendLineToNeighbor
inc b
ld a,b
cp 32
jr nz,.loop
pop hl
pop de
pop bc
ret
;---------------------------------------------------------------------
; Routine: ExtendLineToNeighbor
; Arguments: b,c - (x,y) coord of line
; a - y coord of next line
; Alters: af
; Description: If cur y is more than 1 different from next y, plots
; points in the waveform box to close that gap
;---------------------------------------------------------------------
ExtendLineToNeighbor:
push bc
push de
push hl
and %00001111 ;restrict A 0-15
ld d,a
ld a,c
and %00001111
ld c,a
.testForGap
ld a,d ;dest
sub c ;minus cur
jr nc,.haveAbsValue
cpl ;make negative a positive
add 1
.haveAbsValue
cp 2
jr c,.done ;less than 2 different then okay
;need to adjust c towards d then plot point there
ld a,c
cp d
jr c,.c_lt_d
;c > d
dec c
jr .plot
.c_lt_d
inc c
.plot call PlotWavePoint
jr .testForGap
.done
pop hl
pop de
pop bc
ret
;---------------------------------------------------------------------
SECTION "fontdata",ROMX
;---------------------------------------------------------------------
font:
INCBIN "Data/Font.bin"
;---------------------------------------------------------------------
SECTION "HimemSpriteDMAHandler",HRAM[$FF80]
;---------------------------------------------------------------------
SpriteDMAHandler:
DS (oamHandlerFinish - oamHandlerStart)
vblankFlag: DS 1
backBufferReady: DS 1
| 25.281567 | 81 | 0.396458 |
b0ac923c6bdc10801d8afd888973e0f4bd0d5e00 | 83 | asm | Assembly | libsrc/graphics/__gfx_coords4.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 38 | 2021-06-18T12:56:15.000Z | 2022-03-12T20:38:40.000Z | libsrc/graphics/__gfx_coords4.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 2 | 2021-06-20T16:28:12.000Z | 2021-11-17T21:33:56.000Z | libsrc/graphics/__gfx_coords4.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 6 | 2021-06-18T18:18:36.000Z | 2021-12-22T08:01:32.000Z |
SECTION bss_graphics
PUBLIC __gfx_coords
__gfx_coords: defw 0
defw 0
| 9.222222 | 23 | 0.710843 |
92b963e9310cc19607afb981c6dbaa8f13666bc3 | 370 | asm | Assembly | programs/oeis/320/A320226.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/320/A320226.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/320/A320226.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A320226: Number of integer partitions of n whose non-1 parts are all equal.
; 1,1,2,3,5,6,9,10,13,15,18,19,24,25,28,31,35,36,41,42,47,50,53,54,61,63,66,69,74,75,82,83,88,91,94,97,105,106,109,112,119,120,127,128,133,138,141,142,151,153,158,161,166,167,174,177,184,187,190,191,202
lpb $0
sub $0,1
add $2,1
mov $3,$0
div $3,$2
add $1,$3
lpe
add $1,1
mov $0,$1
| 28.461538 | 202 | 0.654054 |
3af5cb19af76f4a460e1f328e3a611d49fb7898e | 540 | asm | Assembly | oeis/302/A302436.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/302/A302436.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/302/A302436.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A302436: a(n) is the number of ways of writing the binary expansion of n as a concatenation of nonempty substrings with Hamming weight at most 1.
; Submitted by Christian Krause
; 1,1,2,1,4,3,2,1,8,7,6,3,4,3,2,1,16,15,14,7,12,9,6,3,8,7,6,3,4,3,2,1,32,31,30,15,28,21,14,7,24,21,18,9,12,9,6,3,16,15,14,7,12,9,6,3,8,7,6,3,4,3,2,1,64,63,62,31,60,45,30,15,56,49,42,21,28,21,14,7,48,45,42,21,36,27,18,9,24,21,18,9,12,9,6,3,32,31,30,15
mov $1,1
lpb $0
lpb $0
dif $0,2
mul $1,2
add $1,$2
lpe
div $0,2
mov $2,$1
lpe
mov $0,$1
| 33.75 | 250 | 0.62963 |
69ad2dd63f4b54e10445b6e92d5a3c93eddc1d91 | 304 | asm | Assembly | programs/oeis/105/A105338.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/105/A105338.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/105/A105338.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A105338: a(n) = n*(n+1)/2 mod 512.
; 0,1,3,6,10,15,21,28,36,45,55,66,78,91,105,120,136,153,171,190,210,231,253,276,300,325,351,378,406,435,465,496,16,49,83,118,154,191,229,268,308,349,391,434,478,11,57,104,152,201,251,302,354,407,461,4,60,117,175,234
mov $2,$0
pow $2,2
add $0,$2
mod $0,1024
div $0,2
| 33.777778 | 215 | 0.661184 |
64a8cca61e8466eac9d4407a6f59fd522e5fa959 | 1,220 | asm | Assembly | programs/oeis/269/A269878.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/269/A269878.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/269/A269878.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A269878: Partial sums of the number of active (ON,black) cells in n-th stage of growth of two-dimensional cellular automaton defined by "Rule 43", based on the 5-celled von Neumann neighborhood.
; 1,6,11,48,61,158,183,368,409,710,771,1216,1301,1918,2031,2848,2993,4038,4219,5520,5741,7326,7591,9488,9801,12038,12403,15008,15429,18430,18911,22336,22881,26758,27371,31728,32413,37278,38039,43440,44281,50246,51171,57728,58741,65918,67023,74848,76049,84550,85851,95056,96461,106398,107911,118608,120233,131718,133459,145760,147621,160766,162751,176768,178881,193798,196043,211888,214269,231070,233591,251376,254041,272838,275651,295488,298453,319358,322479,344480,347761,370886,374331,398608,402221,427678,431463,458128,462089,489990,494131,523296,527621,558078,562591,594368,599073,632198,637099,671600,676701,712606,717911,755248,760761,799558,805283,845568,851509,893310,899471,942816,949201,994118,1000731,1047248,1054093,1102238,1109319,1159120,1166441,1217926,1225491,1278688,1286501,1341438,1349503,1406208,1414529
mov $2,$0
mul $2,2
mov $5,$0
mul $0,2
mov $3,3
lpb $3,1
lpb $2,1
trn $2,4
add $4,$0
add $0,4
add $1,$4
lpe
mul $1,2
trn $3,$0
lpe
lpb $5,1
add $1,1
sub $5,1
lpe
add $1,1
| 50.833333 | 823 | 0.771311 |
6e78557901d065f874196b06670810158aff39e5 | 489 | asm | Assembly | programs/oeis/024/A024204.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/024/A024204.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/024/A024204.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A024204: [ (3rd elementary symmetric function of S(n))/(2nd elementary symmetric function of S(n)) ], where S(n) = {first n+2 odd positive integers}.
; 0,2,4,6,10,14,19,24,30,37,44,53,61,71,81,92,103,115,128,141,156,170,186,202,219,236,254,273,292,313,333,355,377,400,423,447,472,497,524,550,578,606,635,664,694,725,756,789,821,855,889,924,959,995,1032
mov $1,2
mov $3,$0
mul $3,6
sub $3,4
add $1,$3
sub $1,6
pow $1,2
sub $1,5
mul $1,2
div $1,216
mov $2,$0
mul $2,2
add $1,$2
mov $0,$1
| 27.166667 | 202 | 0.666667 |
8b42432ac9a0d5217ac95967f34d554f86bb761f | 537 | asm | Assembly | oeis/140/A140840.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/140/A140840.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/140/A140840.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A140840: Primes of the form 210n+11.
; Submitted by Christian Krause
; 11,431,641,1061,1481,1901,2111,2531,2741,3371,3581,4001,4211,4421,5051,5261,5471,6101,6311,6521,7151,8831,9041,9461,10091,10301,11351,11981,12401,12611,12821,13241,13451,14081,15131,15551,15761,15971,16811,17021
mov $1,10
mov $2,$0
add $2,2
pow $2,2
lpb $2
mov $3,$1
add $1,26
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,79
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
sub $2,1
lpe
mov $0,$1
add $0,1
| 23.347826 | 213 | 0.681564 |
6ca52b723586065b9f3fc184d790262ccfcf8ab2 | 5,431 | asm | Assembly | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_876.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_876.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_876.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r14
push %r15
push %r8
push %r9
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x6f88, %r9
nop
nop
nop
nop
nop
and %r8, %r8
movups (%r9), %xmm5
vpextrq $0, %xmm5, %r14
and $28748, %r15
lea addresses_normal_ht+0x9b21, %rsi
lea addresses_WT_ht+0x37f1, %rdi
nop
nop
nop
sub %r8, %r8
mov $101, %rcx
rep movsq
nop
cmp %r14, %r14
lea addresses_A_ht+0xa721, %rsi
lea addresses_WT_ht+0x5231, %rdi
nop
nop
inc %r10
mov $42, %rcx
rep movsl
nop
sub %r14, %r14
lea addresses_D_ht+0x8a01, %r8
nop
nop
nop
nop
nop
sub %rdi, %rdi
mov (%r8), %rsi
nop
inc %rsi
lea addresses_UC_ht+0x15309, %rsi
lea addresses_WT_ht+0xff21, %rdi
xor $15494, %r9
mov $25, %rcx
rep movsb
add %rcx, %rcx
lea addresses_UC_ht+0x12921, %rsi
nop
nop
nop
nop
and %r10, %r10
movw $0x6162, (%rsi)
nop
nop
nop
nop
nop
add $9312, %r8
pop %rsi
pop %rdi
pop %rcx
pop %r9
pop %r8
pop %r15
pop %r14
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r14
push %r8
push %rax
push %rdi
push %rsi
// Faulty Load
lea addresses_UC+0x13521, %r14
clflush (%r14)
nop
add $64039, %r10
movups (%r14), %xmm6
vpextrq $1, %xmm6, %rsi
lea oracles, %r10
and $0xff, %rsi
shlq $12, %rsi
mov (%r10,%rsi,1), %rsi
pop %rsi
pop %rdi
pop %rax
pop %r8
pop %r14
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 5, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 9, 'size': 2, 'same': False, 'NT': False}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 44.154472 | 2,999 | 0.659547 |
86c3adee425f7a50c543492520e1e707cbf52a1d | 2,095 | asm | Assembly | lib/core/stack/_udt.asm | locodarwin/xc-basic3 | 74d73fb4049980fc0c7b648b4893ce3a53056af3 | [
"MIT"
] | 11 | 2021-08-05T18:13:21.000Z | 2022-03-26T21:44:50.000Z | lib/core/stack/_udt.asm | locodarwin/xc-basic3 | 74d73fb4049980fc0c7b648b4893ce3a53056af3 | [
"MIT"
] | 119 | 2021-08-09T06:28:44.000Z | 2022-03-31T07:12:11.000Z | lib/core/stack/_udt.asm | locodarwin/xc-basic3 | 74d73fb4049980fc0c7b648b4893ce3a53056af3 | [
"MIT"
] | 3 | 2022-01-22T05:25:09.000Z | 2022-03-26T17:11:55.000Z | PROCESSOR 6502
; Push variable of user defined type onto stack
; Variable label in {1}
; Number of bytes in {2}
MAC pudtvar
ldx #0
.do
lda.wx {1}
pha
inx
cpx #{2}
bcc .do
ENDM
; Pull value of user defined type off of stack into variable
; Variable label in {1}
; Number of bytes in {2}
MAC pludtvar
ldx #{2}
.do
pla
sta.wx {1} - 1
dex
bne .do
ENDM
; Push user defined type of an array onto stack
; (indexed by a word)
; Variable label in {1}
; Number of bytes in {2}
MAC pudtarray ; @pull
getaddr {1}
; Load and push
ldy #0
.do
lda (R0),y
pha
iny
cpy #{2}
bcc .do
ENDM
; Push byte of an array onto stack
; (indexed by a byte)
; Variable label in {1}
; Number of bytes in {2}
MAC pudtarrayfast ; @pull
IF !FPULL
pla
ENDIF
tay
sta R0
clc
adc #{2}
sta R0
.do
lda {1},y
pha
iny
cpy R0
bcc .do
ENDM
; Pull value of user defined type off of stack
; and store in array (indexed by a word)
MAC pludtarray ; @pull
getaddr [{1} - 1]
ldy #{2}
.do
pla
sta (R0),y
dey
bne .do
ENDM
; Pull value of user defined type off of stack
; and store in array (indexed by a byte)
MAC pludtarrayfast ; @pull
IF !FPULL
pla
ENDIF
sta R0
inc R0
clc
adc #{2}
tay
.do
pla
sta.wy {1} - 1
dey
cpy R0
bcs .do
ENDM
; Push one dynamic udt variable onto stack
; Relative address of var in {1}
; Type length in {2}
MAC pdynudtvar
ldy #{1}
.loop
lda (RC),y
pha
iny
cpy #[{1} + {2}]
bcc .loop
ENDM
; Pull dynamic udt on stack to variable
; Relative address of var in {1}
; Type length in {2}
MAC pldynudtvar
ldy #[{1} + {2} - 1]
.loop
pla
sta (RC),y
dey
cpy #{1}
bpl .loop
ENDM
; Push relative udt variable (e.g this.something)
; Relative address of var in {1}
; Type length in {2}
MAC prelativeudtvar
ldy #{1}
.loop
lda (TH),y
pha
iny
cpy #[{1} + {2}]
bcc .loop
ENDM
; Pull udt value and store in relative udt variable
; (e.g this.something)
; Relative address of var in {1}
; Type length in {2}
MAC plrelativeudtvar
ldy #[{1} + {2} - 1]
.loop
pla
sta (TH),y
dey
cpy #{1}
bpl .loop
ENDM | 14.251701 | 61 | 0.633413 |
ad52835fa1a81a21732fb3a0bd33d4582dc946bb | 976 | asm | Assembly | src/stars/examples/arrays/dec_to_hex.asm | kevintmcdonnell/stars | ce0df570c546a8490ef4f9ceeb84c8e1132b2791 | [
"MIT"
] | 9 | 2020-11-05T21:26:09.000Z | 2022-03-04T15:24:40.000Z | src/stars/examples/arrays/dec_to_hex.asm | kevintmcdonnell/stars | ce0df570c546a8490ef4f9ceeb84c8e1132b2791 | [
"MIT"
] | 7 | 2020-11-06T15:59:40.000Z | 2021-08-31T16:36:43.000Z | src/stars/examples/arrays/dec_to_hex.asm | kevintmcdonnell/stars | ce0df570c546a8490ef4f9ceeb84c8e1132b2791 | [
"MIT"
] | 1 | 2021-07-13T21:55:02.000Z | 2021-07-13T21:55:02.000Z | ## hex.asm ask user for decimal number,
## convert to hex, print the result.
.data
result: .space 8
.asciiz "\n"
prompt: .asciiz "Enter decimal number: "
ans1: .asciiz "Hexadecimal is "
.text
.globl main
main:
la $a0,prompt # print prompt on terminal
li $v0,4
syscall
li $v0,5 # sycall 5 reads an integer
syscall
move $t2,$v0 # $t2 holds hex number
la $a0,ans1 # print string before result
li $v0,4
syscall
li $t0,8 # eight hex digits in word
la $t3,result # answer string set up here
loop:
rol $t2,$t2,4 # start with leftmost digit
andi $t1,$t2,0xF # mask one digit
li $t4, 9
ble $t1, $t4, print # check if 0 to 9
addi $t1,$t1,7 # 7 chars between '9' and 'A'
print:
addi $t1,$t1,48 # ASCII '0' is 48
sb $t1,($t3) # save in string
addi $t3,$t3,1 # advance destination pointer
addi $t0,$t0,-1 # decrement counter
bnez $t0,loop # and continue if counter>0
la $a0,result # print result on terminal
li $v0,4
syscall
li $v0,10
syscall
| 20.765957 | 46 | 0.663934 |
c0bbbc142c4c33255f502adad1f912ea845bc200 | 686 | asm | Assembly | PIC/mikroC/Projects/PIC18F4550/PIC18F4550_DEV.asm | UdayanSinha/Code_Blocks | 43c010dcfb587942b6e6f8ba72b93862042afa1d | [
"MIT"
] | 3 | 2016-10-30T05:54:44.000Z | 2021-05-17T20:24:42.000Z | PIC/mikroC/Projects/PIC18F4550/PIC18F4550_DEV.asm | UdayanSinha/Code_Blocks | 43c010dcfb587942b6e6f8ba72b93862042afa1d | [
"MIT"
] | null | null | null | PIC/mikroC/Projects/PIC18F4550/PIC18F4550_DEV.asm | UdayanSinha/Code_Blocks | 43c010dcfb587942b6e6f8ba72b93862042afa1d | [
"MIT"
] | 1 | 2018-10-04T08:20:25.000Z | 2018-10-04T08:20:25.000Z |
_main:
;PIC18F4550_DEV.c,1 :: void main(void)
;PIC18F4550_DEV.c,3 :: TRISD=0xFE;
MOVLW 254
MOVWF TRISD+0
;PIC18F4550_DEV.c,4 :: while(1)
L_main0:
;PIC18F4550_DEV.c,6 :: PORTD.B0=~PORTD.B0;
BTG PORTD+0, 0
;PIC18F4550_DEV.c,7 :: Delay_ms(500);
MOVLW 13
MOVWF R11, 0
MOVLW 175
MOVWF R12, 0
MOVLW 182
MOVWF R13, 0
L_main2:
DECFSZ R13, 1, 1
BRA L_main2
DECFSZ R12, 1, 1
BRA L_main2
DECFSZ R11, 1, 1
BRA L_main2
NOP
;PIC18F4550_DEV.c,8 :: }
GOTO L_main0
;PIC18F4550_DEV.c,9 :: }
L_end_main:
GOTO $+0
; end of _main
| 20.787879 | 45 | 0.530612 |
865e871388c590bffa5a39671d23e50c27c95351 | 1,968 | asm | Assembly | programs/oeis/217/A217873.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/217/A217873.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/217/A217873.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A217873: 4*n*(n^2+2)/3.
; 0,4,16,44,96,180,304,476,704,996,1360,1804,2336,2964,3696,4540,5504,6596,7824,9196,10720,12404,14256,16284,18496,20900,23504,26316,29344,32596,36080,39804,43776,48004,52496,57260,62304,67636,73264,79196,85440,92004,98896,106124,113696,121620,129904,138556,147584,156996,166800,177004,187616,198644,210096,221980,234304,247076,260304,273996,288160,302804,317936,333564,349696,366340,383504,401196,419424,438196,457520,477404,497856,518884,540496,562700,585504,608916,632944,657596,682880,708804,735376,762604,790496,819060,848304,878236,908864,940196,972240,1005004,1038496,1072724,1107696,1143420,1179904,1217156,1255184,1293996,1333600,1374004,1415216,1457244,1500096,1543780,1588304,1633676,1679904,1726996,1774960,1823804,1873536,1924164,1975696,2028140,2081504,2135796,2191024,2247196,2304320,2362404,2421456,2481484,2542496,2604500,2667504,2731516,2796544,2862596,2929680,2997804,3066976,3137204,3208496,3280860,3354304,3428836,3504464,3581196,3659040,3738004,3818096,3899324,3981696,4065220,4149904,4235756,4322784,4410996,4500400,4591004,4682816,4775844,4870096,4965580,5062304,5160276,5259504,5359996,5461760,5564804,5669136,5774764,5881696,5989940,6099504,6210396,6322624,6436196,6551120,6667404,6785056,6904084,7024496,7146300,7269504,7394116,7520144,7647596,7776480,7906804,8038576,8171804,8306496,8442660,8580304,8719436,8860064,9002196,9145840,9291004,9437696,9585924,9735696,9887020,10039904,10194356,10350384,10507996,10667200,10828004,10990416,11154444,11320096,11487380,11656304,11826876,11999104,12172996,12348560,12525804,12704736,12885364,13067696,13251740,13437504,13624996,13814224,14005196,14197920,14392404,14588656,14786684,14986496,15188100,15391504,15596716,15803744,16012596,16223280,16435804,16650176,16866404,17084496,17304460,17526304,17750036,17975664,18203196,18432640,18664004,18897296,19132524,19369696,19608820,19849904,20092956,20337984,20584996
mov $1,$0
pow $0,2
add $0,2
mul $1,$0
div $1,3
mul $1,4
| 196.8 | 1,884 | 0.851626 |
36d9c03fbea053e879ba272ef4541a3a808e983b | 704 | asm | Assembly | oeis/001/A001781.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/001/A001781.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/001/A001781.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A001781: Expansion of 1/((1+x)*(1-x)^10).
; Submitted by Christian Krause
; 1,9,46,174,541,1461,3544,7896,16414,32206,60172,107788,186142,311278,505912,801592,1241383,1883167,2803658,4103242,5911763,8395387,11764688,16284112,22282988,30168268,40439192,53704088,70699532,92312108,119603024,153835856,196507709,249384101,314537894,394392614,491770521,609945809,752703336,924403304,1130052330,1375381370,1666930980,2012144420,2419469130,2898467130,3459934920,4116033480,4880428995,5768444955,6797226306,7985916354,9355847151,10930744119,12736945696,14803638816,17163111064
mov $2,$0
add $2,1
mov $3,$0
lpb $2
mov $0,$3
sub $2,1
sub $0,$2
add $0,9
bin $0,9
mul $4,-1
add $4,$0
lpe
mov $0,$4
| 39.111111 | 495 | 0.78125 |
cd303d8e7ccd6ee3361f94c03e0ff3d491eec34c | 5,379 | asm | Assembly | Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_21829_275.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_21829_275.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_21829_275.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x19ee0, %rsi
lea addresses_UC_ht+0xee0, %rdi
nop
nop
inc %rbx
mov $111, %rcx
rep movsw
nop
nop
nop
nop
add $48807, %rcx
lea addresses_D_ht+0x17370, %rbp
nop
nop
nop
nop
nop
and $48727, %rsi
mov $0x6162636465666768, %r12
movq %r12, (%rbp)
nop
nop
and %rdi, %rdi
lea addresses_D_ht+0x18ee0, %rsi
lea addresses_A_ht+0xa740, %rdi
sub $43794, %r11
mov $73, %rcx
rep movsb
xor %rbp, %rbp
lea addresses_normal_ht+0x268, %rbx
nop
sub %rcx, %rcx
mov (%rbx), %r12w
nop
and $60534, %r12
lea addresses_WC_ht+0x1be60, %rsi
nop
nop
nop
nop
inc %rdi
vmovups (%rsi), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $1, %xmm4, %rbp
and $37958, %rdi
lea addresses_normal_ht+0x1bee0, %rsi
nop
nop
nop
nop
nop
inc %rdi
movl $0x61626364, (%rsi)
nop
nop
nop
nop
nop
add $52324, %rcx
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r8
push %r9
push %rbx
push %rdx
// Faulty Load
lea addresses_A+0x86e0, %r8
nop
nop
sub %r9, %r9
mov (%r8), %ebx
lea oracles, %rdx
and $0xff, %rbx
shlq $12, %rbx
mov (%rdx,%rbx,1), %rbx
pop %rdx
pop %rbx
pop %r9
pop %r8
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_A', 'same': False, 'AVXalign': False, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_A', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 11}, 'dst': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 11}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 3}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 10}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 3}}
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 2}}
{'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': True, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 11}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 44.825 | 2,999 | 0.660904 |
4315725ba8ba5d7bf9dc3312f6ad4e3ae6e94434 | 6,334 | asm | Assembly | Windows/FastMaxU64.asm | clayne/FastExtrema | 9d38cdcd095f7ea07e94c9690b79bcd9ac1228b3 | [
"MIT"
] | 6 | 2021-04-02T16:09:13.000Z | 2022-01-24T11:15:48.000Z | Windows/FastMaxU64.asm | komrad36/FastArrayOps | 9d38cdcd095f7ea07e94c9690b79bcd9ac1228b3 | [
"MIT"
] | null | null | null | Windows/FastMaxU64.asm | komrad36/FastArrayOps | 9d38cdcd095f7ea07e94c9690b79bcd9ac1228b3 | [
"MIT"
] | 1 | 2021-02-17T21:51:17.000Z | 2021-02-17T21:51:17.000Z | ; /*******************************************************************
; *
; * Author: Kareem Omar
; * kareem.h.omar@gmail.com
; * https://github.com/komrad36
; *
; * Last updated Oct 11, 2020
; *******************************************************************/
_TEXT$FastMaxU64 SEGMENT ALIGN(64)
FastMaxU64 PROC
sub rsp,56
vpcmpeqd ymm1,ymm1,ymm1
mov eax,edx
vpsllq ymm0,ymm1,63
cmp edx,32
jae CASE_LARGE
vmovdqa ymm1,ymm0
vmovdqa ymm2,ymm0
lea r8,JUMP_TABLE
movzx edx,byte ptr [r8+rax]
add r8,rdx
lea rdx,[rcx+8*rax]
and eax,-4
lea rcx,[rcx+8*rax]
xor eax,eax
jmp r8
JUMP_TABLE:
db 1 DUP ( CASE_0 - JUMP_TABLE)
db 1 DUP ( CASE_1 - JUMP_TABLE)
db 1 DUP ( CASE_2 - JUMP_TABLE)
db 1 DUP ( CASE_3 - JUMP_TABLE)
db 1 DUP ( CASE_4 - JUMP_TABLE)
db 1 DUP ( CASE_5 - JUMP_TABLE)
db 1 DUP ( CASE_6 - JUMP_TABLE)
db 1 DUP ( CASE_7 - JUMP_TABLE)
db 1 DUP ( CASE_8 - JUMP_TABLE)
db 1 DUP ( CASE_9 - JUMP_TABLE)
db 1 DUP (CASE_10 - JUMP_TABLE)
db 1 DUP (CASE_11 - JUMP_TABLE)
db 4 DUP (CASE_12 - JUMP_TABLE)
db 4 DUP (CASE_16 - JUMP_TABLE)
db 4 DUP (CASE_20 - JUMP_TABLE)
db 4 DUP (CASE_24 - JUMP_TABLE)
db 4 DUP (CASE_28 - JUMP_TABLE)
CASE_28:
vpxor ymm1,ymm0,ymmword ptr [rcx-224]
CASE_24:
vpxor ymm2,ymm0,ymmword ptr [rcx-192]
CASE_20:
vpxor ymm3,ymm0,ymmword ptr [rcx-160]
vpcmpgtq ymm4,ymm3,ymm1
vpblendvb ymm1,ymm1,ymm3,ymm4
CASE_16:
vpxor ymm3,ymm0,ymmword ptr [rcx-128]
vpcmpgtq ymm4,ymm3,ymm2
vpblendvb ymm2,ymm2,ymm3,ymm4
CASE_12:
vpxor ymm3,ymm0,ymmword ptr [rcx-96]
vpcmpgtq ymm4,ymm3,ymm1
vpblendvb ymm1,ymm1,ymm3,ymm4
vpxor ymm3,ymm0,ymmword ptr [rcx-64]
vpcmpgtq ymm4,ymm3,ymm2
vpblendvb ymm2,ymm2,ymm3,ymm4
vpxor ymm3,ymm0,ymmword ptr [rcx-32]
vpcmpgtq ymm4,ymm3,ymm1
vpblendvb ymm1,ymm1,ymm3,ymm4
vpxor ymm3,ymm0,ymmword ptr [rdx-32]
vpcmpgtq ymm4,ymm3,ymm2
vpblendvb ymm2,ymm2,ymm3,ymm4
jmp GATHER_1
CASE_11:
mov rax,qword ptr [rdx-88]
CASE_10:
cmp rax,qword ptr [rdx-80]
cmovb rax,qword ptr [rdx-80]
CASE_9:
cmp rax,qword ptr [rdx-72]
cmovb rax,qword ptr [rdx-72]
CASE_8:
cmp rax,qword ptr [rdx-64]
cmovb rax,qword ptr [rdx-64]
CASE_7:
cmp rax,qword ptr [rdx-56]
cmovb rax,qword ptr [rdx-56]
CASE_6:
cmp rax,qword ptr [rdx-48]
cmovb rax,qword ptr [rdx-48]
CASE_5:
cmp rax,qword ptr [rdx-40]
cmovb rax,qword ptr [rdx-40]
CASE_4:
cmp rax,qword ptr [rdx-32]
cmovb rax,qword ptr [rdx-32]
CASE_3:
cmp rax,qword ptr [rdx-24]
cmovb rax,qword ptr [rdx-24]
CASE_2:
cmp rax,qword ptr [rdx-16]
cmovb rax,qword ptr [rdx-16]
CASE_1:
cmp rax,qword ptr [rdx-8]
cmovb rax,qword ptr [rdx-8]
CASE_0:
add rsp,56
ret
db 26 DUP (0CCh)
CASE_LARGE:
vpxor ymm1,ymm0,ymmword ptr [rcx]
vpxor ymm2,ymm0,ymmword ptr [rcx+32]
vpxor ymm3,ymm0,ymmword ptr [rcx+64]
vpxor ymm4,ymm0,ymmword ptr [rcx+96]
vpxor ymm5,ymm0,ymmword ptr [rcx+128]
vmovaps xmmword ptr [rsp],xmm6
vpxor ymm6,ymm0,ymmword ptr [rcx+160]
vmovaps xmmword ptr [rsp+16],xmm7
vpxor ymm7,ymm0,ymmword ptr [rcx+192]
vmovaps xmmword ptr [rsp+32],xmm8
vpxor ymm8,ymm0,ymmword ptr [rcx+224]
vmovaps xmmword ptr [rsp+64],xmm9
vmovaps xmmword ptr [rsp+80],xmm10
lea rdx,[rcx+8*rax]
add rcx,512
cmp rcx,rdx
jae LOOP_END
LOOP_TOP:
vpxor ymm9,ymm0,ymmword ptr [rcx-256]
vpcmpgtq ymm10,ymm9,ymm1
vpblendvb ymm1,ymm1,ymm9,ymm10
vpxor ymm9,ymm0,ymmword ptr [rcx-224]
vpcmpgtq ymm10,ymm9,ymm2
vpblendvb ymm2,ymm2,ymm9,ymm10
vpxor ymm9,ymm0,ymmword ptr [rcx-192]
vpcmpgtq ymm10,ymm9,ymm3
vpblendvb ymm3,ymm3,ymm9,ymm10
vpxor ymm9,ymm0,ymmword ptr [rcx-160]
vpcmpgtq ymm10,ymm9,ymm4
vpblendvb ymm4,ymm4,ymm9,ymm10
vpxor ymm9,ymm0,ymmword ptr [rcx-128]
vpcmpgtq ymm10,ymm9,ymm5
vpblendvb ymm5,ymm5,ymm9,ymm10
vpxor ymm9,ymm0,ymmword ptr [rcx-96]
vpcmpgtq ymm10,ymm9,ymm6
vpblendvb ymm6,ymm6,ymm9,ymm10
vpxor ymm9,ymm0,ymmword ptr [rcx-64]
vpcmpgtq ymm10,ymm9,ymm7
vpblendvb ymm7,ymm7,ymm9,ymm10
vpxor ymm9,ymm0,ymmword ptr [rcx-32]
vpcmpgtq ymm10,ymm9,ymm8
vpblendvb ymm8,ymm8,ymm9,ymm10
add rcx,256
cmp rcx,rdx
jb LOOP_TOP
LOOP_END:
vpxor ymm9,ymm0,ymmword ptr [rdx-256]
vpcmpgtq ymm10,ymm9,ymm1
vpblendvb ymm1,ymm1,ymm9,ymm10
vpxor ymm9,ymm0,ymmword ptr [rdx-224]
vpcmpgtq ymm10,ymm9,ymm2
vpblendvb ymm2,ymm2,ymm9,ymm10
vpxor ymm9,ymm0,ymmword ptr [rdx-192]
vpcmpgtq ymm10,ymm9,ymm3
vpblendvb ymm3,ymm3,ymm9,ymm10
vpxor ymm9,ymm0,ymmword ptr [rdx-160]
vpcmpgtq ymm10,ymm9,ymm4
vpblendvb ymm4,ymm4,ymm9,ymm10
vpxor ymm9,ymm0,ymmword ptr [rdx-128]
vpcmpgtq ymm10,ymm9,ymm5
vpblendvb ymm5,ymm5,ymm9,ymm10
vpxor ymm9,ymm0,ymmword ptr [rdx-96]
vpcmpgtq ymm10,ymm9,ymm6
vpblendvb ymm6,ymm6,ymm9,ymm10
vpxor ymm9,ymm0,ymmword ptr [rdx-64]
vpcmpgtq ymm10,ymm9,ymm7
vpblendvb ymm7,ymm7,ymm9,ymm10
vpxor ymm9,ymm0,ymmword ptr [rdx-32]
vpcmpgtq ymm10,ymm9,ymm8
vpblendvb ymm8,ymm8,ymm9,ymm10
vmovaps xmm10,xmmword ptr [rsp+80]
vmovaps xmm9,xmmword ptr [rsp+64]
vpcmpgtq ymm0,ymm8,ymm4
vpblendvb ymm4,ymm4,ymm8,ymm0
vmovaps xmm8,xmmword ptr [rsp+32]
vpcmpgtq ymm0,ymm7,ymm3
vpblendvb ymm3,ymm3,ymm7,ymm0
vmovaps xmm7,xmmword ptr [rsp+16]
vpcmpgtq ymm0,ymm6,ymm2
vpblendvb ymm2,ymm2,ymm6,ymm0
vmovaps xmm6,xmmword ptr [rsp]
vpcmpgtq ymm0,ymm5,ymm1
vpblendvb ymm1,ymm1,ymm5,ymm0
vpcmpgtq ymm0,ymm3,ymm1
vpblendvb ymm1,ymm1,ymm3,ymm0
vpcmpgtq ymm0,ymm4,ymm2
vpblendvb ymm2,ymm2,ymm4,ymm0
GATHER_1:
vpcmpgtq ymm0,ymm2,ymm1
vpblendvb ymm1,ymm1,ymm2,ymm0
vextracti128 xmm2,ymm1,1
vpcmpgtq xmm0,xmm2,xmm1
vpblendvb xmm1,xmm1,xmm2,xmm0
vpshufd xmm2,xmm1,78
vpcmpgtq xmm0,xmm2,xmm1
vpblendvb xmm1,xmm1,xmm2,xmm0
vmovq rax,xmm1
btc rax,63
add rsp,56
ret
FastMaxU64 ENDP
_TEXT$FastMaxU64 ENDS
END
| 28.276786 | 70 | 0.642564 |
baa38837fa7748ac6ade25044e0798e1b9657ff6 | 3,315 | asm | Assembly | misc/spriteDemo.asm | TheStormkeeper/c64_fun | 8aa214b945e33f3326c0576d0720955fbce51809 | [
"MIT"
] | 13 | 2016-01-29T13:57:19.000Z | 2021-10-21T23:36:08.000Z | misc/spriteDemo.asm | kondrak/c64_fun | 22604fc2d465aa065ac132a9996a8d615ad79a92 | [
"MIT"
] | null | null | null | misc/spriteDemo.asm | kondrak/c64_fun | 22604fc2d465aa065ac132a9996a8d615ad79a92 | [
"MIT"
] | 3 | 2015-07-16T15:22:31.000Z | 2020-05-03T09:38:48.000Z | ;
; Demo displaying a single sprite and handling joystick actions.
; Uses raster interrupt.
;
!to "spritedemo.prg", cbm
; launch routine
*=$0801
!byte $0c, $08, $0a, $00, $9e, $20, $38, $31, $39, $32
deltaX !byte $0 ; dx for joystick movement ( -1 - left, 1 - right, 0 - none)
deltaY !byte $0 ; dy for joystick movement ( -1 - up, 1 - down, 0 - none)
firePressed !byte $1 ; 1 - not pressed; 0 - pressed
; ----- MAIN PROGRAM -----
*=$2000
.init:
jsr clearScreen
.initSprites:
lda #1
sta $d015
sta $d01c ; enable multicolor
; multicolor settings
lda #$0A
sta $d025
lda #$07
sta $d026
; sprite 0 setup
lda #$AA ; set coordinates
sta $d000
lda #$88
sta $d001
lda #$c0 ; set sprite image
sta $07f8
lda #$05 ; set sprite color
sta $d027
.initInterrupt:
sei
lda #$7f
sta $dc0d
sta $dd0d
lda #$01
sta $d01a
ldx #$1b ; text mode
lda #$08 ; single color text
ldy #$14 ; uppercase text ($16 for lowercase)
stx $d011
sta $d016
sty $d018
lda #<updateIRQ
ldx #>updateIRQ
sta $0314
stx $0315
ldy #$ff ; line to trigger interrupt
sty $d012
lda $dc0d
lda $dd0d
asl $d019
cli
.mainLoop:
jmp .mainLoop
rts
; ----- MAIN UPDATE SUBROUTINE (called on raster irq) -----
updateIRQ:
asl $d019
jsr handleJoystick
lda firePressed
cmp #$1
beq .move
inc $d020 ; change border color on fire press
.move:
jsr moveSprite
jmp $ea81
;----- MOVE SPRITE -----
moveSprite:
lda deltaX
cmp #$01
beq .checkHorizontalRight
cmp #$ff
beq .checkHorizontalLeft
jmp .checkVertical
.checkHorizontalRight:
inc $d000
bne .checkVertical
jsr flipPosBitX
jmp .checkVertical
.checkHorizontalLeft:
lda $d000
bne .decX
jsr flipPosBitX
.decX:
dec $d000
.checkVertical:
lda $d001
clc
adc deltaY
sta $d001
.exitMoveProc:
rts
; ----- SUBROUTINE FOR FLIPPING X DIR REGISTER -----
flipPosBitX:
lda $d010
eor #$01
sta $d010
rts
; ----- HANDLE JOYSTICK (PORT 2) -----
handleJoystick:
lda $dc00 ; get port 2 input
ldy #0
ldx #0
lsr
bcs .hj0
dey
.hj0:
lsr
bcs .hj1
iny
.hj1:
lsr
bcs .hj2
dex
.hj2:
lsr
bcs .hj3
inx
.hj3:
lsr
stx deltaX
sty deltaY
lda #$0
bcc .storeFire ; fire information stored in carry flag
lda #$1
.storeFire:
sta firePressed
rts
; ----- CLEAR SCREEN -----
clearScreen:
lda #$00
tax
sta $d020
sta $d021
lda #$20
.clrLoop:
sta $0400, x
sta $0500, x
sta $0600, x
sta $0700, x ; be careful here - clearing all bytes starting from $0700 will corrupt sprite data
dex
bne .clrLoop
; use this code to clear the $0700 screen region skipping last 8 bytes (sprite pointers)
; ldx #$f7
;clrLastSegment:
; sta $0700, x
; dex
; bne clrLastSegment
rts
; ---- SPRITE DATA -----
*=$3000
!bin "spritedemo.spr" | 17.539683 | 103 | 0.534842 |
d4d76b0249ef35ea9e7f2231cec9618dd92dbf1f | 8,450 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_3078.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_3078.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_3078.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r8
push %r9
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0xb04, %rsi
lea addresses_WT_ht+0x11304, %rdi
xor $32035, %rdx
mov $42, %rcx
rep movsw
nop
nop
xor $417, %r9
lea addresses_D_ht+0x10334, %r8
nop
nop
cmp $7149, %rcx
movl $0x61626364, (%r8)
nop
nop
nop
nop
nop
xor $21838, %r9
lea addresses_UC_ht+0xb444, %rdx
nop
nop
nop
and %r12, %r12
mov (%rdx), %r8
nop
and $5275, %r12
lea addresses_A_ht+0xb104, %rdx
nop
nop
nop
nop
nop
and %r8, %r8
movb (%rdx), %cl
nop
nop
nop
dec %rdx
lea addresses_A_ht+0x13304, %rsi
lea addresses_WC_ht+0x5984, %rdi
nop
nop
nop
xor $37916, %rax
mov $110, %rcx
rep movsq
nop
nop
nop
nop
cmp $33908, %rdi
lea addresses_WC_ht+0x17c14, %rsi
lea addresses_normal_ht+0x1ba44, %rdi
nop
sub %rdx, %rdx
mov $32, %rcx
rep movsb
nop
nop
nop
nop
dec %r12
lea addresses_UC_ht+0x15f04, %rsi
cmp %rax, %rax
mov $0x6162636465666768, %rdx
movq %rdx, %xmm2
vmovups %ymm2, (%rsi)
nop
nop
nop
xor %rax, %rax
lea addresses_UC_ht+0x10b04, %rsi
lea addresses_UC_ht+0xb004, %rdi
nop
nop
nop
nop
and $29473, %r9
mov $0, %rcx
rep movsw
nop
nop
nop
nop
xor $16686, %r8
lea addresses_WT_ht+0x55dc, %rsi
lea addresses_WT_ht+0x11304, %rdi
add %rdx, %rdx
mov $88, %rcx
rep movsb
cmp $13923, %r8
lea addresses_normal_ht+0xc5c, %rcx
nop
sub %rax, %rax
movl $0x61626364, (%rcx)
sub $57617, %rax
lea addresses_UC_ht+0xcd2c, %rcx
nop
nop
nop
nop
nop
sub %r12, %r12
and $0xffffffffffffffc0, %rcx
vmovaps (%rcx), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $1, %xmm4, %rdi
nop
cmp %r12, %r12
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r8
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r9
push %rax
push %rbx
push %rdi
push %rdx
// Store
lea addresses_RW+0x2f04, %rax
nop
nop
nop
nop
nop
xor %r12, %r12
mov $0x5152535455565758, %rdi
movq %rdi, (%rax)
nop
nop
nop
cmp $55995, %r9
// Store
lea addresses_A+0x7304, %r12
nop
nop
nop
nop
nop
and %rdi, %rdi
mov $0x5152535455565758, %r11
movq %r11, %xmm5
movups %xmm5, (%r12)
nop
nop
nop
xor $18030, %r11
// Store
mov $0x21d0480000000f04, %r11
nop
nop
nop
nop
nop
add $46664, %rbx
mov $0x5152535455565758, %r12
movq %r12, %xmm2
movups %xmm2, (%r11)
// Exception!!!
nop
nop
nop
nop
mov (0), %r9
nop
nop
nop
nop
nop
inc %r11
// Load
lea addresses_PSE+0x1304, %rdi
nop
sub $31892, %r11
movb (%rdi), %r9b
nop
nop
nop
nop
nop
xor %r12, %r12
// Load
lea addresses_D+0xff4d, %rbx
nop
nop
inc %rax
mov (%rbx), %r11w
nop
nop
nop
xor %rdi, %rdi
// Store
mov $0xf32, %rdi
nop
nop
nop
add $3624, %rbx
movb $0x51, (%rdi)
nop
nop
nop
nop
nop
inc %r12
// Faulty Load
lea addresses_D+0x17b04, %rdx
clflush (%rdx)
nop
nop
nop
nop
cmp $13017, %rax
movups (%rdx), %xmm3
vpextrq $0, %xmm3, %r12
lea oracles, %rdi
and $0xff, %r12
shlq $12, %r12
mov (%rdi,%r12,1), %r12
pop %rdx
pop %rdi
pop %rbx
pop %rax
pop %r9
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_D', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_RW', 'same': False, 'size': 8, 'congruent': 10, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_A', 'same': False, 'size': 16, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_NC', 'same': False, 'size': 16, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_PSE', 'same': False, 'size': 1, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D', 'same': False, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_P', 'same': False, 'size': 1, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_D', 'same': True, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_A_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_D_ht', 'same': True, 'size': 4, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 8, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'same': False, 'size': 1, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_UC_ht', 'same': False, 'size': 32, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_normal_ht', 'same': False, 'size': 4, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 32, 'congruent': 2, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
| 29.753521 | 2,999 | 0.65432 |
d4eb025d3e0ed380ca3944f8d9d58b239cb4d772 | 81 | asm | Assembly | libsrc/math/daimath32/c/asm/___dai32_xcos.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/math/daimath32/c/asm/___dai32_xcos.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/math/daimath32/c/asm/___dai32_xcos.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | SECTION code_fp_dai32
PUBLIC ___dai32_xcos
EXTERN xcos
defc ___dai32_xcos = xcos
| 16.2 | 25 | 0.864198 |
99db4b7c7df5c509efa72d69a84c399d79334585 | 270 | asm | Assembly | programs/oeis/145/A145910.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/145/A145910.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/145/A145910.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A145910: a(n) = (1 + 3*n)*(4 + 3*n)/2.
; 2,14,35,65,104,152,209,275,350,434,527,629,740,860,989,1127,1274,1430,1595,1769,1952,2144,2345,2555,2774,3002,3239,3485,3740,4004,4277,4559,4850,5150,5459,5777,6104,6440,6785,7139,7502,7874
mul $0,3
add $0,3
bin $0,2
sub $0,1
| 33.75 | 191 | 0.681481 |
fd68397e0a0844efea97acdb2c8b31cc52c44034 | 2,846 | asm | Assembly | coverage/IN_CTS/0445-COVERAGE-nir-opt-idiv-const-90/work/variant/1_spirv_asm/shader.frag.asm | asuonpaa/ShaderTests | 6a3672040dcfa0d164d313224446496d1775a15e | [
"Apache-2.0"
] | null | null | null | coverage/IN_CTS/0445-COVERAGE-nir-opt-idiv-const-90/work/variant/1_spirv_asm/shader.frag.asm | asuonpaa/ShaderTests | 6a3672040dcfa0d164d313224446496d1775a15e | [
"Apache-2.0"
] | 47 | 2021-03-11T07:42:51.000Z | 2022-03-14T06:30:14.000Z | coverage/IN_CTS/0445-COVERAGE-nir-opt-idiv-const-90/work/variant/1_spirv_asm/shader.frag.asm | asuonpaa/ShaderTests | 6a3672040dcfa0d164d313224446496d1775a15e | [
"Apache-2.0"
] | 4 | 2021-03-09T13:37:19.000Z | 2022-02-25T07:32:11.000Z | ; SPIR-V
; Version: 1.0
; Generator: Khronos Glslang Reference Front End; 10
; Bound: 51
; Schema: 0
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %4 "main" %32
OpExecutionMode %4 OriginUpperLeft
OpSource ESSL 320
OpName %4 "main"
OpName %8 "a"
OpName %13 "buf0"
OpMemberName %13 0 "_GLF_uniform_int_values"
OpName %15 ""
OpName %32 "_GLF_color"
OpDecorate %12 ArrayStride 16
OpMemberDecorate %13 0 Offset 0
OpDecorate %13 Block
OpDecorate %15 DescriptorSet 0
OpDecorate %15 Binding 0
OpDecorate %32 Location 0
%2 = OpTypeVoid
%3 = OpTypeFunction %2
%6 = OpTypeInt 32 1
%7 = OpTypePointer Function %6
%9 = OpConstant %6 -7563
%10 = OpTypeInt 32 0
%11 = OpConstant %10 2
%12 = OpTypeArray %6 %11
%13 = OpTypeStruct %12
%14 = OpTypePointer Uniform %13
%15 = OpVariable %14 Uniform
%16 = OpConstant %6 0
%17 = OpConstant %6 1
%18 = OpTypePointer Uniform %6
%25 = OpTypeBool
%29 = OpTypeFloat 32
%30 = OpTypeVector %29 4
%31 = OpTypePointer Output %30
%32 = OpVariable %31 Output
%4 = OpFunction %2 None %3
%5 = OpLabel
%8 = OpVariable %7 Function
OpStore %8 %9
%19 = OpAccessChain %18 %15 %16 %17
%20 = OpLoad %6 %19
%21 = OpLoad %6 %8
%22 = OpSDiv %6 %20 %21
%23 = OpAccessChain %18 %15 %16 %16
%24 = OpLoad %6 %23
%26 = OpIEqual %25 %22 %24
OpSelectionMerge %28 None
OpBranchConditional %26 %27 %46
%27 = OpLabel
%33 = OpAccessChain %18 %15 %16 %17
%34 = OpLoad %6 %33
%35 = OpConvertSToF %29 %34
%36 = OpAccessChain %18 %15 %16 %16
%37 = OpLoad %6 %36
%38 = OpConvertSToF %29 %37
%39 = OpAccessChain %18 %15 %16 %16
%40 = OpLoad %6 %39
%41 = OpConvertSToF %29 %40
%42 = OpAccessChain %18 %15 %16 %17
%43 = OpLoad %6 %42
%44 = OpConvertSToF %29 %43
%45 = OpCompositeConstruct %30 %35 %38 %41 %44
OpStore %32 %45
OpBranch %28
%46 = OpLabel
%47 = OpAccessChain %18 %15 %16 %16
%48 = OpLoad %6 %47
%49 = OpConvertSToF %29 %48
%50 = OpCompositeConstruct %30 %49 %49 %49 %49
OpStore %32 %50
OpBranch %28
%28 = OpLabel
OpReturn
OpFunctionEnd
| 34.707317 | 59 | 0.48981 |
dc7582d2515ab6d4d6da3921141e3c417cfba3fc | 517 | asm | Assembly | oeis/160/A160207.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | null | null | null | oeis/160/A160207.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | null | null | null | oeis/160/A160207.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | null | null | null | ; A160207: Decimal expansion of (907+210*sqrt(2))/857.
; Submitted by Jamie Morken(w4)
; 1,4,0,4,8,8,3,1,3,6,6,3,7,5,1,4,5,3,9,3,7,9,6,4,3,6,7,8,0,4,4,3,8,3,4,2,6,4,8,7,3,1,7,4,9,5,7,1,6,6,3,8,3,8,4,3,2,5,6,7,4,1,4,8,1,6,5,7,5,7,0,8,3,4,0,3,7,8,3,5,2,1,7,7,1,9,7,3,6,0,8,1,7,8,3,0,1,9,0,2
bin $1,$0
mov $2,2
mov $3,$0
mul $3,4
lpb $3
add $5,$2
add $1,$5
add $2,$1
mov $1,$2
sub $3,1
lpe
mul $1,2
add $2,$5
mov $4,10
pow $4,$0
add $5,$2
div $2,10
mul $2,22
add $2,$5
div $2,$4
div $1,$2
mov $0,$1
mod $0,10
| 18.464286 | 201 | 0.539652 |
5f7e6b5d74571bc22b923913a709c73243aa09a3 | 2,385 | asm | Assembly | Tests/timing.i.asm | ped7g/ZXSpectrumNextTests | 3a3082cf3b2b17e1d9cd4f1d5c71934a2c3ce862 | [
"MIT"
] | 3 | 2018-12-29T16:02:49.000Z | 2020-01-30T06:41:37.000Z | Tests/timing.i.asm | ped7g/ZXSpectrumNextTests | 3a3082cf3b2b17e1d9cd4f1d5c71934a2c3ce862 | [
"MIT"
] | null | null | null | Tests/timing.i.asm | ped7g/ZXSpectrumNextTests | 3a3082cf3b2b17e1d9cd4f1d5c71934a2c3ce862 | [
"MIT"
] | null | null | null | MACRO WAIT_FOR_SCANLINE scanline
ld l, scanline
call WaitForScanline
ENDM
MACRO WAIT_FOR_SCANLINE_MSB msb
ld l, msb
call WaitForScanlineMSB
ENDM
; delays for (C-1)x4363T + Bx17T + 16T + 27T, where r=0 is as r=256
MACRO IDLE_WAIT delay_counts
ld bc,delay_counts
call WaitForSomeCycles
ENDM
MACRO WAIT_HALF_SCANLINE_AFTER scanline
ld l, scanline
call WaitForScanlineAndHalf
ENDM
; this is not precisely robust routine, it waits while (scanline-low8-bits < L)
; the code calling this should be partially aware where the scanline was prior
; and call it only when it makes sense (i.e. high bit of scanline is known to it)
WaitForScanline: ; code is somewhat optimized to return ASAP when it happens
ld bc, TBBLUE_REGISTER_SELECT_P_243B
ld a, RASTER_LINE_LSB_NR_1F
out (c),a
inc b ; bc = TBBLUE_REGISTER_ACCESS_P_253B
.waitLoop:
in a,(c) ; read RASTER_LINE_LSB_NR_1F
cp l
jr c,.waitLoop
ret
; this waits until MSB is equal to L (0/1) (otherwise same gimmick as WaitForScanline)
WaitForScanlineMSB: ; code is somewhat optimized to return ASAP when it happens
ld bc, TBBLUE_REGISTER_SELECT_P_243B
ld a, RASTER_LINE_MSB_NR_1E
out (c),a
inc b ; bc = TBBLUE_REGISTER_ACCESS_P_253B
dec l
ld l,1
jr z,.waitForMsbSet
.waitForMsbReset:
in a,(c) ; read RASTER_LINE_MSB_NR_1E
and l
jr nz,.waitForMsbReset
ret
.waitForMsbSet:
in a,(c) ; read RASTER_LINE_MSB_NR_1E
and l
jr z,.waitForMsbSet
ret
; similar as WaitForScanline, but even less precise, and waits cca. ~"half" of line extra
WaitForScanlineAndHalf:
call WaitForScanline
ld bc,$0401 ; wait until detected scanline is well over half
; continue with WaitForSomeCycles code
; delays for (C-1)x4363T + Bx17T + 16T, where r=0 is as r=256
; with "ld bc,** call Delay" the final duration is: (C-1)x4363T + Bx17T + 16T + 27T
WaitForSomeCycles:
nop ; 4T
djnz WaitForSomeCycles ; 13/8T = 4347T for B=0
dec c ; 4T
jr nz,WaitForSomeCycles ; 12/7T
ret ; 10T
| 34.071429 | 89 | 0.618449 |
54016021c0a7792546ea9da3028ca0914374bce2 | 3,104 | asm | Assembly | src/main.asm | Gegel85/SpaceShooterGB | 7f1ff08708fd3ad91c911c7c91f8d07e1c7b2366 | [
"MIT"
] | 3 | 2020-02-24T14:31:36.000Z | 2020-03-28T22:38:57.000Z | src/main.asm | Gegel85/SpaceShooterGB | 7f1ff08708fd3ad91c911c7c91f8d07e1c7b2366 | [
"MIT"
] | 4 | 2020-02-24T16:35:26.000Z | 2020-02-26T16:47:11.000Z | src/main.asm | Gegel85/SpaceShooterGB | 7f1ff08708fd3ad91c911c7c91f8d07e1c7b2366 | [
"MIT"
] | 1 | 2020-02-24T14:31:39.000Z | 2020-02-24T14:31:39.000Z | include "src/constants.asm"
include "src/macro.asm"
SECTION "Main", ROM0
; Locks the CPU
; Params:
; None
; Return:
; None
; Registers:
; N/A
lockup::
reset INTERRUPT_ENABLED
halt
; Main function
main::
call init ; Init
ld sp, $E000 ; Init stack
jp intro
mainMenu::
ld hl, menuMelody
call playSound2
ld hl, menuBass
call playSound
ld de, OAM_SRC_START << 8
ld bc, $A0
xor a
call fillMemory
call updateSound
call updateSound2
.lateInit:
reg WY, $58
reg WX, $7
call waitVBLANK
reset LCD_CONTROL
call DMA
reg BGP, %11011000
reg SHOOT_COOLDOWN, 30
call updateSound
call updateSound2
ld de, $8800
ld hl, logo
ld bc, logoEnd - logo
call copyMemory
ld de, $9800
ld bc, $800
ld a, 1
call fillMemory
call updateSound
call updateSound2
ld hl, $9802
ld d, $8
ld bc, $20 - $10
ld a, $80
.bgLoop:
ld e, $10
.bgCopyLoop:
ld [hli], a
inc a
dec e
jr nz, .bgCopyLoop
add hl, bc
dec d
jr nz, .bgLoop
ld hl, pressStart
ld bc, pressStartEnd - pressStart
ld de, $9984
call copyMemory
reg LCD_CONTROL, LCD_BASE_CONTROL
xor a
push af
.loop:
call random
reset INTERRUPT_REQUEST
halt
call updateSound
call updateSound2
ld hl, SHOOT_COOLDOWN
xor a
dec [hl]
jr nz, .skip
ld a, [LCD_CONTROL]
xor %00100000
ld [LCD_CONTROL], a
ld [hl], 30
.skip:
pop af
dec a
push af
jr z, .credits
call getKeys
bit 7, a
jr nz, .loop
jr run
.credits:
jp credits
; Runs the main program
run::
reg WY, $88
reg WX, $78
reset BOSS_STATUS
ld [ASTEROID_NEXT_INC], a
ld [ASTEROID_MAX_SPEED_Y], a
ld [ASTEROID_MAX_SPEED_X], a
ld de, $C01A
ld bc, 300
call fillMemory
ld hl, SCORE_REGISTER + 2
ld [NB_OBSTACLES], a
ld [NB_SHOOTS], a
ld [hl-], a
ld [hl-], a
ld [hl-], a
reg DISABLE_BOSS, 1
reg OBP1, ENNEMIES_PALETTE
ld hl, gameMelody
call playSound
ld hl, gameBass
call playSound2
ld hl, ASTEROID_SPAWN_IN
ld [hl], $FF
ld hl, PLAYER1_STRUCT + PLAYER_STRUCT_X_OFF
ld a, $44
ld [hli], a
ld a, $70
ld [hl], a
ei
reg BGP, %11011000
call waitVBLANK
reset LCD_CONTROL
call drawBackground
reg LCD_CONTROL, LCD_BASE_CONTROL
ld hl, $FF42
.gameLoop:
reset INTERRUPT_REQUEST
halt
call updateScore
ld hl, SCROLL_Y
dec [hl]
call checkCollisionSpaceshipAsteroid
call checkCollisionSpaceshipBoss
call executePlayerActions
call updateRegisters
call updatePlayer
call updateLasers
call updateObstacles
call updateSound
call updateSound2
call spawnObstacles
call bossAttack
jr .gameLoop
include "src/init.asm"
include "src/fatal_error.asm"
include "src/utils.asm"
include "src/interrupts.asm"
include "src/rendering.asm"
include "src/player.asm"
include "src/play_sound.asm"
include "src/obstacle.asm"
include "src/shoot.asm"
include "src/intro.asm"
include "src/collision.asm"
include "src/game_bass.asm"
include "src/game_melody.asm"
include "src/menu_bass.asm"
include "src/menu_melody.asm"
include "src/boss.asm"
include "src/score.asm"
include "src/boss_bass.asm"
include "src/boss_melody.asm"
include "src/boss_jingle_bass.asm"
include "src/boss_jingle_melody.asm"
include "src/credits.asm" | 16.082902 | 44 | 0.719072 |
07486df2facdcd8649b418a1fd9bf5e02d49624f | 3,459 | asm | Assembly | libtool/src/gmp-6.1.2/mpn/powerpc32/addmul_1.asm | kroggen/aergo | 05af317eaa1b62b21dc0144ef74a9e7acb14fb87 | [
"MIT"
] | 1,602 | 2015-01-06T11:26:31.000Z | 2022-03-30T06:17:21.000Z | libtool/src/gmp-6.1.2/mpn/powerpc32/addmul_1.asm | kroggen/aergo | 05af317eaa1b62b21dc0144ef74a9e7acb14fb87 | [
"MIT"
] | 11,789 | 2015-01-05T04:50:15.000Z | 2022-03-31T23:39:19.000Z | libtool/src/gmp-6.1.2/mpn/powerpc32/addmul_1.asm | kroggen/aergo | 05af317eaa1b62b21dc0144ef74a9e7acb14fb87 | [
"MIT"
] | 498 | 2015-01-08T18:58:18.000Z | 2022-03-20T15:37:45.000Z | dnl PowerPC-32 mpn_addmul_1 -- Multiply a limb vector with a limb and add the
dnl result to a second limb vector.
dnl Copyright 1995, 1997, 1998, 2000-2003, 2005 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl
dnl The GNU MP Library is free software; you can redistribute it and/or modify
dnl it under the terms of either:
dnl
dnl * the GNU Lesser General Public License as published by the Free
dnl Software Foundation; either version 3 of the License, or (at your
dnl option) any later version.
dnl
dnl or
dnl
dnl * the GNU General Public License as published by the Free Software
dnl Foundation; either version 2 of the License, or (at your option) any
dnl later version.
dnl
dnl or both in parallel, as here.
dnl
dnl The GNU MP Library is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
dnl for more details.
dnl
dnl You should have received copies of the GNU General Public License and the
dnl GNU Lesser General Public License along with the GNU MP Library. If not,
dnl see https://www.gnu.org/licenses/.
include(`../config.m4')
C cycles/limb
C 603e: ?
C 604e: 6.75
C 75x (G3): 8.7-14.3
C 7400,7410 (G4): 8.7-14.3
C 744x,745x (G4+): 9.5
C power4/ppc970: 6.25
C power5: 6.25
C INPUT PARAMETERS
C rp r3
C up r4
C n r5
C vl r6
C This is optimized for the PPC604. It has not been tuned for other
C PowerPC processors.
C
C Loop Analysis for the 604:
C 12 mem insn
C 8 serializing insn
C 8 int multiply
C 25 int reg write
C 9 int ops (8 of which serialize)
C
C The multiply insns need 16 cycles/4limb.
C The integer register writes will need 13 cycles/4limb.
C All-in-all, it should be possible to get to 4 or 5 cycles/limb on PPC604,
C but that will require some clever FPNOPS and BNOPS for exact
C issue control.
ASM_START()
PROLOGUE(mpn_addmul_1)
cmpwi cr0,r5,9 C more than 9 limbs?
bgt cr0,L(big) C branch if more than 9 limbs
mtctr r5
lwz r0,0(r4)
mullw r7,r0,r6
mulhwu r10,r0,r6
lwz r9,0(r3)
addc r8,r7,r9
addi r3,r3,-4
bdz L(end)
L(loop):
lwzu r0,4(r4)
stwu r8,4(r3)
mullw r8,r0,r6
adde r7,r8,r10
mulhwu r10,r0,r6
lwz r9,4(r3)
addze r10,r10
addc r8,r7,r9
bdnz L(loop)
L(end): stw r8,4(r3)
addze r3,r10
blr
L(big): stwu r1,-16(r1)
addi r5,r5,-1
stw r30,8(r1)
srwi r0,r5,2
stw r31,12(r1)
mtctr r0
lwz r7,0(r4)
mullw r8,r7,r6
mulhwu r0,r7,r6
lwz r7,0(r3)
addc r8,r8,r7
stw r8,0(r3)
L(loopU):
lwz r7,4(r4)
lwz r12,8(r4)
lwz r30,12(r4)
lwzu r31,16(r4)
mullw r8,r7,r6
mullw r9,r12,r6
mullw r10,r30,r6
mullw r11,r31,r6
adde r8,r8,r0 C add cy_limb
mulhwu r0,r7,r6
lwz r7,4(r3)
adde r9,r9,r0
mulhwu r0,r12,r6
lwz r12,8(r3)
adde r10,r10,r0
mulhwu r0,r30,r6
lwz r30,12(r3)
adde r11,r11,r0
mulhwu r0,r31,r6
lwz r31,16(r3)
addze r0,r0 C new cy_limb
addc r8,r8,r7
stw r8,4(r3)
adde r9,r9,r12
stw r9,8(r3)
adde r10,r10,r30
stw r10,12(r3)
adde r11,r11,r31
stwu r11,16(r3)
bdnz L(loopU)
andi. r31,r5,3
mtctr r31
beq cr0,L(endx)
L(loopE):
lwzu r7,4(r4)
mullw r8,r7,r6
adde r8,r8,r0 C add cy_limb
mulhwu r0,r7,r6
lwz r7,4(r3)
addze r0,r0 C new cy_limb
addc r8,r8,r7
stwu r8,4(r3)
bdnz L(loopE)
L(endx):
addze r3,r0
lwz r30,8(r1)
lwz r31,12(r1)
addi r1,r1,16
blr
EPILOGUE(mpn_addmul_1)
| 21.61875 | 79 | 0.699046 |
58b09236e4855eb4b95255b59b0c1607bbf07f38 | 1,425 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_zr_/i3-7100_9_0x84_notsx.log_61_80.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i3-7100_9_0x84_notsx.log_61_80.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i3-7100_9_0x84_notsx.log_61_80.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r9
push %rbp
push %rdi
lea addresses_D_ht+0x191d4, %rdi
clflush (%rdi)
nop
nop
nop
cmp %rbp, %rbp
mov (%rdi), %r12
sub $18369, %r9
pop %rdi
pop %rbp
pop %r9
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r14
push %r15
push %r8
push %rax
push %rbx
push %rcx
push %rsi
// Load
lea addresses_WT+0x1a3cc, %rax
nop
nop
nop
nop
mfence
mov (%rax), %r8w
nop
cmp $61933, %rax
// Faulty Load
lea addresses_US+0x1045c, %r15
nop
nop
nop
nop
cmp $45611, %rsi
movb (%r15), %al
lea oracles, %rbx
and $0xff, %rax
shlq $12, %rax
mov (%rbx,%rax,1), %rax
pop %rsi
pop %rcx
pop %rbx
pop %rax
pop %r8
pop %r15
pop %r14
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_US', 'same': False, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT', 'same': False, 'size': 2, 'congruent': 2, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_US', 'same': True, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_D_ht', 'same': False, 'size': 8, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'00': 61}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 19 | 182 | 0.644912 |
8692e453c1008c30426e44cefa49bd83e629179f | 557 | asm | Assembly | oeis/269/A269788.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/269/A269788.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/269/A269788.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A269788: Primes p such that 2*p + 47 is a square.
; Submitted by Jon Maiga
; 17,37,61,89,157,197,241,397,457,521,661,1277,1381,1489,1601,2089,2221,2357,2789,3257,3761,4877,5077,5281,5701,6361,7057,7297,7541,7789,8297,8821,10781,11681,12301,13921,15289,15641,17837,18217,19381,19777,20177,21401
mov $1,10
mov $2,332202
lpb $2
mov $3,$6
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,6
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
sub $2,18
add $5,$1
sub $1,2
mov $6,$5
lpe
mov $0,$5
add $0,1
| 24.217391 | 218 | 0.666068 |
24241ee6833a487a393d9960b25e0bf5e787ce91 | 1,645 | asm | Assembly | programs/oeis/122/A122046.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/122/A122046.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/122/A122046.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A122046: Partial sums of floor(n^2/8).
; 0,0,0,1,3,6,10,16,24,34,46,61,79,100,124,152,184,220,260,305,355,410,470,536,608,686,770,861,959,1064,1176,1296,1424,1560,1704,1857,2019,2190,2370,2560,2760,2970,3190,3421,3663,3916,4180,4456,4744,5044,5356,5681,6019,6370,6734,7112,7504,7910,8330,8765,9215,9680,10160,10656,11168,11696,12240,12801,13379,13974,14586,15216,15864,16530,17214,17917,18639,19380,20140,20920,21720,22540,23380,24241,25123,26026,26950,27896,28864,29854,30866,31901,32959,34040,35144,36272,37424,38600,39800,41025,42275,43550,44850,46176,47528,48906,50310,51741,53199,54684,56196,57736,59304,60900,62524,64177,65859,67570,69310,71080,72880,74710,76570,78461,80383,82336,84320,86336,88384,90464,92576,94721,96899,99110,101354,103632,105944,108290,110670,113085,115535,118020,120540,123096,125688,128316,130980,133681,136419,139194,142006,144856,147744,150670,153634,156637,159679,162760,165880,169040,172240,175480,178760,182081,185443,188846,192290,195776,199304,202874,206486,210141,213839,217580,221364,225192,229064,232980,236940,240945,244995,249090,253230,257416,261648,265926,270250,274621,279039,283504,288016,292576,297184,301840,306544,311297,316099,320950,325850,330800,335800,340850,345950,351101,356303,361556,366860,372216,377624,383084,388596,394161,399779,405450,411174,416952,422784,428670,434610,440605,446655,452760,458920,465136,471408,477736,484120,490561,497059,503614,510226,516896,523624,530410,537254,544157,551119,558140,565220,572360,579560,586820,594140,601521,608963,616466,624030,631656,639344,647094
mov $2,$0
add $2,2
lpb $2
add $3,$2
lpb $3
trn $3,4
add $1,$3
lpe
sub $2,1
lpe
| 117.5 | 1,507 | 0.807295 |
c0587bb87ad1b3058c723817178d66571c0bc993 | 10,176 | asm | Assembly | fiat-amd64/38.51_ratio12082_seed4032974613556909_square_p224.asm | dderjoel/fiat-crypto | 57a9612577d766a0ae83169ea9517bfa7f01ea4e | [
"BSD-1-Clause",
"Apache-2.0",
"MIT-0",
"MIT"
] | 491 | 2015-11-25T23:44:39.000Z | 2022-03-29T17:31:21.000Z | fiat-amd64/38.51_ratio12082_seed4032974613556909_square_p224.asm | dderjoel/fiat-crypto | 57a9612577d766a0ae83169ea9517bfa7f01ea4e | [
"BSD-1-Clause",
"Apache-2.0",
"MIT-0",
"MIT"
] | 755 | 2016-02-02T14:03:05.000Z | 2022-03-31T16:47:23.000Z | fiat-amd64/38.51_ratio12082_seed4032974613556909_square_p224.asm | dderjoel/fiat-crypto | 57a9612577d766a0ae83169ea9517bfa7f01ea4e | [
"BSD-1-Clause",
"Apache-2.0",
"MIT-0",
"MIT"
] | 117 | 2015-10-25T16:28:15.000Z | 2022-02-08T23:01:09.000Z | SECTION .text
GLOBAL square_p224
square_p224:
sub rsp, 0x88 ; last 0x30 (6) for Caller - save regs
mov [ rsp + 0x58 ], rbx; saving to stack
mov [ rsp + 0x60 ], rbp; saving to stack
mov [ rsp + 0x68 ], r12; saving to stack
mov [ rsp + 0x70 ], r13; saving to stack
mov [ rsp + 0x78 ], r14; saving to stack
mov [ rsp + 0x80 ], r15; saving to stack
mov rax, [ rsi + 0x0 ]; load m64 x4 to register64
mov rdx, [ rsi + 0x0 ]; arg1[0] to rdx
mulx r10, r11, rax; x12, x11<- x4 * arg1[0]
mov rbx, 0xffffffffffffffff ; moving imm to reg
mov rdx, rbx; 0xffffffffffffffff to rdx
mulx rbx, rbp, r11; _, x20<- x11 * 0xffffffffffffffff
mov rbx, 0xffffffff00000000 ; moving imm to reg
xchg rdx, rbp; x20, swapping with 0xffffffffffffffff, which is currently in rdx
mulx r12, r13, rbx; x27, x26<- x20 * 0xffffffff00000000
mov r14, 0xffffffff ; moving imm to reg
mulx r15, rcx, r14; x23, x22<- x20 * 0xffffffff
mulx r8, r9, rbp; x25, x24<- x20 * 0xffffffffffffffff
add r9, r12; could be done better, if r0 has been u8 as well
mov r12, [ rsi + 0x8 ]; load m64 x1 to register64
adcx rcx, r8
adc r15, 0x0
mov r8, rdx; preserving value of x20 into a new reg
mov rdx, [ rsi + 0x0 ]; saving arg1[0] in rdx.
mulx rbx, rbp, r12; x50, x49<- x1 * arg1[0]
mov rdx, r12; x1 to rdx
mulx r12, r14, [ rsi + 0x18 ]; x44, x43<- x1 * arg1[3]
mov [ rsp + 0x0 ], rdi; spilling out1 to mem
mov [ rsp + 0x8 ], r15; spilling x32 to mem
mulx rdi, r15, [ rsi + 0x8 ]; x48, x47<- x1 * arg1[1]
mov [ rsp + 0x10 ], rcx; spilling x30 to mem
xor rcx, rcx
adox r15, rbx
adcx r8, r11
mulx rdx, r8, [ rsi + 0x10 ]; x46, x45<- x1 * arg1[2]
adox r8, rdi
adox r14, rdx
adox r12, rcx
mov rdx, [ rsi + 0x8 ]; arg1[1] to rdx
mulx r11, rbx, rax; x10, x9<- x4 * arg1[1]
mov rdx, -0x3 ; moving imm to reg
inc rdx; OF<-0x0, preserve CF (debug 7; load -3, increase it, save it as -2). #last resort
adox rbx, r10
adcx r13, rbx
setc r10b; spill CF x36 to reg (r10)
clc;
adcx rbp, r13
mov rdi, 0xffffffffffffffff ; moving imm to reg
mov rdx, rbp; x58 to rdx
mulx rbp, rbx, rdi; _, x68<- x58 * 0xffffffffffffffff
mov rbp, rbx; _, copying x68 here, cause x68 is needed in a reg for other than _, namely all: , _--x82, x72--x73, x70--x71, x74--x75, size: 4
setc r13b; spill CF x59 to reg (r13)
clc;
adcx rbp, rdx
mov rdx, [ rsi + 0x10 ]; arg1[2] to rdx
mulx rbp, rcx, rax; x8, x7<- x4 * arg1[2]
adox rcx, r11
mov rdx, [ rsi + 0x18 ]; arg1[3] to rdx
mulx rax, r11, rax; x6, x5<- x4 * arg1[3]
mov rdx, 0xffffffff00000000 ; moving imm to reg
mov [ rsp + 0x18 ], r12; spilling x57 to mem
mulx rdi, r12, rbx; x75, x74<- x68 * 0xffffffff00000000
seto dl; spill OF x16 to reg (rdx)
mov [ rsp + 0x20 ], rdi; spilling x75 to mem
mov rdi, 0x0 ; moving imm to reg
dec rdi; OF<-0x0, preserve CF (debug: state 4 (thanks Paul))
movzx r10, r10b
adox r10, rdi; loading flag
adox rcx, r9
seto r9b; spill OF x38 to reg (r9)
inc rdi; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0))
mov r10, -0x1 ; moving imm to reg
movzx r13, r13b
adox r13, r10; loading flag
adox rcx, r15
adcx r12, rcx
setc r15b; spill CF x84 to reg (r15)
clc;
movzx rdx, dl
adcx rdx, r10; loading flag
adcx rbp, r11
adcx rax, rdi
mov r13, 0xffffffff ; moving imm to reg
mov rdx, rbx; x68 to rdx
mulx rbx, r11, r13; x71, x70<- x68 * 0xffffffff
clc;
movzx r9, r9b
adcx r9, r10; loading flag
adcx rbp, [ rsp + 0x10 ]
mov r9, [ rsp + 0x8 ]; x41, copying x32 here, cause x32 is needed in a reg for other than x41, namely all: , x41--x42, size: 1
adcx r9, rax
mov rcx, 0xffffffffffffffff ; moving imm to reg
mulx rdx, rax, rcx; x73, x72<- x68 * 0xffffffffffffffff
adox r8, rbp
adox r14, r9
mov rbp, [ rsi + 0x10 ]; load m64 x2 to register64
setc r9b; spill CF x42 to reg (r9)
clc;
adcx rax, [ rsp + 0x20 ]
adcx r11, rdx
adcx rbx, rdi
movzx r9, r9b
mov rdx, [ rsp + 0x18 ]; x66, copying x57 here, cause x57 is needed in a reg for other than x66, namely all: , x66--x67, size: 1
adox rdx, r9
clc;
movzx r15, r15b
adcx r15, r10; loading flag
adcx r8, rax
adcx r11, r14
adcx rbx, rdx
seto r15b; spill OF x91 to reg (r15)
adc r15b, 0x0
movzx r15, r15b
mov rdx, [ rsi + 0x0 ]; arg1[0] to rdx
mulx r9, r14, rbp; x99, x98<- x2 * arg1[0]
adox r14, r12
mov rdx, rcx; 0xffffffffffffffff to rdx
mulx rcx, r12, r14; _, x117<- x107 * 0xffffffffffffffff
mov rcx, [ rsi + 0x18 ]; load m64 x3 to register64
mov rax, rdx; preserving value of 0xffffffffffffffff into a new reg
mov rdx, [ rsi + 0x8 ]; saving arg1[1] in rdx.
mulx rdi, r10, rcx; x146, x145<- x3 * arg1[1]
mov rdx, 0xffffffff00000000 ; moving imm to reg
mulx r13, rax, r12; x124, x123<- x117 * 0xffffffff00000000
mov rdx, 0xffffffff ; moving imm to reg
mov byte [ rsp + 0x28 ], r15b; spilling byte x91 to mem
mov [ rsp + 0x30 ], rax; spilling x123 to mem
mulx r15, rax, r12; x120, x119<- x117 * 0xffffffff
mov rdx, 0xffffffffffffffff ; moving imm to reg
mov [ rsp + 0x38 ], rbx; spilling x89 to mem
mov [ rsp + 0x40 ], r11; spilling x87 to mem
mulx rbx, r11, r12; x122, x121<- x117 * 0xffffffffffffffff
adcx r11, r13
xchg rdx, rcx; x3, swapping with 0xffffffffffffffff, which is currently in rdx
mulx r13, rcx, [ rsi + 0x0 ]; x148, x147<- x3 * arg1[0]
mov [ rsp + 0x48 ], rcx; spilling x147 to mem
mov [ rsp + 0x50 ], r11; spilling x125 to mem
mulx rcx, r11, [ rsi + 0x18 ]; x142, x141<- x3 * arg1[3]
adcx rax, rbx
mov rbx, 0x0 ; moving imm to reg
adcx r15, rbx
mulx rdx, rbx, [ rsi + 0x10 ]; x144, x143<- x3 * arg1[2]
clc;
adcx r10, r13
adcx rbx, rdi
adcx r11, rdx
mov rdi, 0x0 ; moving imm to reg
adcx rcx, rdi
mov rdx, rbp; x2 to rdx
mulx rbp, r13, [ rsi + 0x8 ]; x97, x96<- x2 * arg1[1]
clc;
adcx r12, r14
setc r12b; spill CF x131 to reg (r12)
clc;
adcx r13, r9
mulx r9, r14, [ rsi + 0x10 ]; x95, x94<- x2 * arg1[2]
adox r13, r8
adcx r14, rbp
mulx rdx, r8, [ rsi + 0x18 ]; x93, x92<- x2 * arg1[3]
adcx r8, r9
mov rbp, [ rsp + 0x40 ]; x111, copying x87 here, cause x87 is needed in a reg for other than x111, namely all: , x111--x112, size: 1
adox rbp, r14
mov r9, [ rsp + 0x38 ]; x113, copying x89 here, cause x89 is needed in a reg for other than x113, namely all: , x113--x114, size: 1
adox r9, r8
adcx rdx, rdi
clc;
mov r14, -0x1 ; moving imm to reg
movzx r12, r12b
adcx r12, r14; loading flag
adcx r13, [ rsp + 0x30 ]
mov r12, [ rsp + 0x50 ]; x134, copying x125 here, cause x125 is needed in a reg for other than x134, namely all: , x134--x135, size: 1
adcx r12, rbp
movzx r8, byte [ rsp + 0x28 ]; x115, copying x91 here, cause x91 is needed in a reg for other than x115, namely all: , x115--x116, size: 1
adox r8, rdx
adcx rax, r9
adcx r15, r8
setc bpl; spill CF x139 to reg (rbp)
clc;
adcx r13, [ rsp + 0x48 ]
movzx r9, bpl; x140, copying x139 here, cause x139 is needed in a reg for other than x140, namely all: , x140, size: 1
adox r9, rdi
mov rdx, 0xffffffffffffffff ; moving imm to reg
mulx r8, rbp, r13; _, x166<- x156 * 0xffffffffffffffff
mulx r8, rdi, rbp; x171, x170<- x166 * 0xffffffffffffffff
adcx r10, r12
mov r12, rbp; _, copying x166 here, cause x166 is needed in a reg for other than _, namely all: , x168--x169, _--x180, x172--x173, size: 3
inc r14; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0))
adox r12, r13
mov r12, 0xffffffff00000000 ; moving imm to reg
xchg rdx, rbp; x166, swapping with 0xffffffffffffffff, which is currently in rdx
mulx r13, r14, r12; x173, x172<- x166 * 0xffffffff00000000
adox r14, r10
adcx rbx, rax
adcx r11, r15
setc al; spill CF x163 to reg (rax)
clc;
adcx rdi, r13
adox rdi, rbx
setc r15b; spill CF x175 to reg (r15)
seto r10b; spill OF x184 to reg (r10)
mov r13, r14; x190, copying x181 here, cause x181 is needed in a reg for other than x190, namely all: , x190--x191, x200, size: 2
sub r13, 0x00000001
mov rbx, rdi; x192, copying x183 here, cause x183 is needed in a reg for other than x192, namely all: , x192--x193, x201, size: 2
sbb rbx, r12
mov r12, 0xffffffff ; moving imm to reg
mulx rdx, rbp, r12; x169, x168<- x166 * 0xffffffff
mov r12, 0x0 ; moving imm to reg
dec r12; OF<-0x0, preserve CF (debug: state 4 (thanks Paul))
movzx r15, r15b
adox r15, r12; loading flag
adox r8, rbp
mov r15, 0x0 ; moving imm to reg
adox rdx, r15
dec r15; OF<-0x0, preserve CF (debug: state 1(0x0) (thanks Paul))
movzx rax, al
adox rax, r15; loading flag
adox r9, rcx
seto r12b; spill OF x165 to reg (r12)
inc r15; OF<-0x0, preserve CF (debug: state 2 (y: -1, n: 0))
mov rcx, -0x1 ; moving imm to reg
movzx r10, r10b
adox r10, rcx; loading flag
adox r11, r8
adox rdx, r9
movzx rax, r12b; x189, copying x165 here, cause x165 is needed in a reg for other than x189, namely all: , x189, size: 1
adox rax, r15
mov r10, r11; x194, copying x185 here, cause x185 is needed in a reg for other than x194, namely all: , x202, x194--x195, size: 2
mov rbp, 0xffffffffffffffff ; moving imm to reg
sbb r10, rbp
mov r8, rdx; x196, copying x187 here, cause x187 is needed in a reg for other than x196, namely all: , x203, x196--x197, size: 2
mov r9, 0xffffffff ; moving imm to reg
sbb r8, r9
sbb rax, 0x00000000
cmovc rbx, rdi; if CF, x201<- x183 (nzVar)
cmovc r13, r14; if CF, x200<- x181 (nzVar)
mov rax, [ rsp + 0x0 ]; load m64 out1 to register64
mov [ rax + 0x8 ], rbx; out1[1] = x201
cmovc r8, rdx; if CF, x203<- x187 (nzVar)
cmovc r10, r11; if CF, x202<- x185 (nzVar)
mov [ rax + 0x10 ], r10; out1[2] = x202
mov [ rax + 0x0 ], r13; out1[0] = x200
mov [ rax + 0x18 ], r8; out1[3] = x203
mov rbx, [ rsp + 0x58 ]; restoring from stack
mov rbp, [ rsp + 0x60 ]; restoring from stack
mov r12, [ rsp + 0x68 ]; restoring from stack
mov r13, [ rsp + 0x70 ]; restoring from stack
mov r14, [ rsp + 0x78 ]; restoring from stack
mov r15, [ rsp + 0x80 ]; restoring from stack
add rsp, 0x88
ret
; cpu Intel(R) Core(TM) i7-10710U CPU @ 1.10GHz
; clocked at 1600 MHz
; first cyclecount 48.82, best 38.055813953488375, lastGood 38.50697674418605
; seed 4032974613556909
; CC / CFLAGS clang / -march=native -mtune=native -O3
; time needed: 1142090 ms / 60000 runs=> 19.034833333333335ms/run
; Time spent for assembling and measureing (initial batch_size=215, initial num_batches=101): 406329 ms
; Ratio (time for assembling + measure)/(total runtime for 60000runs): 0.3557766901032318
; number reverted permutation/ tried permutation: 26715 / 29849 =89.500%
; number reverted decision/ tried decision: 26604 / 30152 =88.233% | 38.545455 | 141 | 0.687991 |
37b1d2ce75ee8653d13d716126cbcc8d3920baca | 133 | asm | Assembly | programs/oeis/086/A086388.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/086/A086388.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/086/A086388.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A086388: Duplicate of A008619.
; 1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15
mov $1,$0
div $1,2
add $1,1
| 19 | 70 | 0.601504 |
995dd1148603bfe2e55fec5ad45592288a4255b8 | 51,860 | asm | Assembly | Firmware/obj/hm_trp/radio~hm_trp/packet.asm | mgrunsfeld/SiK | 76563efb25620265b47992d7af30cb4de9849941 | [
"BSD-2-Clause"
] | null | null | null | Firmware/obj/hm_trp/radio~hm_trp/packet.asm | mgrunsfeld/SiK | 76563efb25620265b47992d7af30cb4de9849941 | [
"BSD-2-Clause"
] | null | null | null | Firmware/obj/hm_trp/radio~hm_trp/packet.asm | mgrunsfeld/SiK | 76563efb25620265b47992d7af30cb4de9849941 | [
"BSD-2-Clause"
] | null | null | null | ;--------------------------------------------------------
; File Created by SDCC : free open source ANSI-C Compiler
; Version 3.5.0 #9253 (Mar 24 2016) (Linux)
; This file was generated Mon Jul 23 11:34:34 2018
;--------------------------------------------------------
.module packet
.optsdcc -mmcs51 --model-large
;--------------------------------------------------------
; Public variables in this module
;--------------------------------------------------------
.globl _timer2_tick
.globl _printf_end_capture
.globl _printf_start_capture
.globl _at_command
.globl _param_print
.globl _serial_read_available
.globl _serial_read_buf
.globl _serial_peekx
.globl _serial_peek2
.globl _serial_peek
.globl _serial_read
.globl _memcmp
.globl _memcpy
.globl _SDN
.globl _NSS1
.globl _IRQ
.globl _PIN_ENABLE
.globl _PIN_CONFIG
.globl _LED_GREEN
.globl _LED_RED
.globl _SPI0EN
.globl _TXBMT0
.globl _NSS0MD0
.globl _NSS0MD1
.globl _RXOVRN0
.globl _MODF0
.globl _WCOL0
.globl _SPIF0
.globl _AD0CM0
.globl _AD0CM1
.globl _AD0CM2
.globl _AD0WINT
.globl _AD0BUSY
.globl _AD0INT
.globl _BURSTEN
.globl _AD0EN
.globl _CCF0
.globl _CCF1
.globl _CCF2
.globl _CCF3
.globl _CCF4
.globl _CCF5
.globl _CR
.globl _CF
.globl _P
.globl _F1
.globl _OV
.globl _RS0
.globl _RS1
.globl _F0
.globl _AC
.globl _CY
.globl _T2XCLK
.globl _T2RCLK
.globl _TR2
.globl _T2SPLIT
.globl _TF2CEN
.globl _TF2LEN
.globl _TF2L
.globl _TF2H
.globl _SI
.globl _ACK
.globl _ARBLOST
.globl _ACKRQ
.globl _STO
.globl _STA
.globl _TXMODE
.globl _MASTER
.globl _PX0
.globl _PT0
.globl _PX1
.globl _PT1
.globl _PS0
.globl _PT2
.globl _PSPI0
.globl _SPI1EN
.globl _TXBMT1
.globl _NSS1MD0
.globl _NSS1MD1
.globl _RXOVRN1
.globl _MODF1
.globl _WCOL1
.globl _SPIF1
.globl _EX0
.globl _ET0
.globl _EX1
.globl _ET1
.globl _ES0
.globl _ET2
.globl _ESPI0
.globl _EA
.globl _RI0
.globl _TI0
.globl _RB80
.globl _TB80
.globl _REN0
.globl _MCE0
.globl _S0MODE
.globl _CRC0VAL
.globl _CRC0INIT
.globl _CRC0SEL
.globl _IT0
.globl _IE0
.globl _IT1
.globl _IE1
.globl _TR0
.globl _TF0
.globl _TR1
.globl _TF1
.globl _PCA0CP4
.globl _PCA0CP0
.globl _PCA0
.globl _PCA0CP3
.globl _PCA0CP2
.globl _PCA0CP1
.globl _PCA0CP5
.globl _TMR2
.globl _TMR2RL
.globl _ADC0LT
.globl _ADC0GT
.globl _ADC0
.globl _TMR3
.globl _TMR3RL
.globl _TOFF
.globl _DP
.globl _VDM0CN
.globl _PCA0CPH4
.globl _PCA0CPL4
.globl _PCA0CPH0
.globl _PCA0CPL0
.globl _PCA0H
.globl _PCA0L
.globl _SPI0CN
.globl _EIP2
.globl _EIP1
.globl _SMB0ADM
.globl _SMB0ADR
.globl _P2MDIN
.globl _P1MDIN
.globl _P0MDIN
.globl _B
.globl _RSTSRC
.globl _PCA0CPH3
.globl _PCA0CPL3
.globl _PCA0CPH2
.globl _PCA0CPL2
.globl _PCA0CPH1
.globl _PCA0CPL1
.globl _ADC0CN
.globl _EIE2
.globl _EIE1
.globl _FLWR
.globl _IT01CF
.globl _XBR2
.globl _XBR1
.globl _XBR0
.globl _ACC
.globl _PCA0PWM
.globl _PCA0CPM4
.globl _PCA0CPM3
.globl _PCA0CPM2
.globl _PCA0CPM1
.globl _PCA0CPM0
.globl _PCA0MD
.globl _PCA0CN
.globl _P0MAT
.globl _P2SKIP
.globl _P1SKIP
.globl _P0SKIP
.globl _PCA0CPH5
.globl _PCA0CPL5
.globl _REF0CN
.globl _PSW
.globl _P1MAT
.globl _PCA0CPM5
.globl _TMR2H
.globl _TMR2L
.globl _TMR2RLH
.globl _TMR2RLL
.globl _REG0CN
.globl _TMR2CN
.globl _P0MASK
.globl _ADC0LTH
.globl _ADC0LTL
.globl _ADC0GTH
.globl _ADC0GTL
.globl _SMB0DAT
.globl _SMB0CF
.globl _SMB0CN
.globl _P1MASK
.globl _ADC0H
.globl _ADC0L
.globl _ADC0TK
.globl _ADC0CF
.globl _ADC0MX
.globl _ADC0PWR
.globl _ADC0AC
.globl _IREF0CN
.globl _IP
.globl _FLKEY
.globl _FLSCL
.globl _PMU0CF
.globl _OSCICL
.globl _OSCICN
.globl _OSCXCN
.globl _SPI1CN
.globl _ONESHOT
.globl _EMI0TC
.globl _RTC0KEY
.globl _RTC0DAT
.globl _RTC0ADR
.globl _EMI0CF
.globl _EMI0CN
.globl _CLKSEL
.globl _IE
.globl _SFRPAGE
.globl _P2DRV
.globl _P2MDOUT
.globl _P1DRV
.globl _P1MDOUT
.globl _P0DRV
.globl _P0MDOUT
.globl _SPI0DAT
.globl _SPI0CKR
.globl _SPI0CFG
.globl _P2
.globl _CPT0MX
.globl _CPT1MX
.globl _CPT0MD
.globl _CPT1MD
.globl _CPT0CN
.globl _CPT1CN
.globl _SBUF0
.globl _SCON0
.globl _CRC0CNT
.globl _DC0CN
.globl _CRC0AUTO
.globl _DC0CF
.globl _TMR3H
.globl _CRC0FLIP
.globl _TMR3L
.globl _CRC0IN
.globl _TMR3RLH
.globl _CRC0CN
.globl _TMR3RLL
.globl _CRC0DAT
.globl _TMR3CN
.globl _P1
.globl _PSCTL
.globl _CKCON
.globl _TH1
.globl _TH0
.globl _TL1
.globl _TL0
.globl _TMOD
.globl _TCON
.globl _PCON
.globl _TOFFH
.globl _SPI1DAT
.globl _TOFFL
.globl _SPI1CKR
.globl _SPI1CFG
.globl _DPH
.globl _DPL
.globl _SP
.globl _P0
.globl _packet_inject_PARM_2
.globl _packet_is_duplicate_PARM_2
.globl _packet_get_next_PARM_2
.globl _packet_is_duplicate_PARM_3
.globl _seen_mavlink
.globl _packet_get_next
.globl _packet_is_resend
.globl _packet_is_injected
.globl _packet_force_resend
.globl _packet_set_max_xmit
.globl _packet_set_serial_speed
.globl _packet_is_duplicate
.globl _packet_ati5_inject
.globl _packet_at_inject
.globl _packet_inject
;--------------------------------------------------------
; special function registers
;--------------------------------------------------------
.area RSEG (ABS,DATA)
.org 0x0000
_P0 = 0x0080
_SP = 0x0081
_DPL = 0x0082
_DPH = 0x0083
_SPI1CFG = 0x0084
_SPI1CKR = 0x0085
_TOFFL = 0x0085
_SPI1DAT = 0x0086
_TOFFH = 0x0086
_PCON = 0x0087
_TCON = 0x0088
_TMOD = 0x0089
_TL0 = 0x008a
_TL1 = 0x008b
_TH0 = 0x008c
_TH1 = 0x008d
_CKCON = 0x008e
_PSCTL = 0x008f
_P1 = 0x0090
_TMR3CN = 0x0091
_CRC0DAT = 0x0091
_TMR3RLL = 0x0092
_CRC0CN = 0x0092
_TMR3RLH = 0x0093
_CRC0IN = 0x0093
_TMR3L = 0x0094
_CRC0FLIP = 0x0095
_TMR3H = 0x0095
_DC0CF = 0x0096
_CRC0AUTO = 0x0096
_DC0CN = 0x0097
_CRC0CNT = 0x0097
_SCON0 = 0x0098
_SBUF0 = 0x0099
_CPT1CN = 0x009a
_CPT0CN = 0x009b
_CPT1MD = 0x009c
_CPT0MD = 0x009d
_CPT1MX = 0x009e
_CPT0MX = 0x009f
_P2 = 0x00a0
_SPI0CFG = 0x00a1
_SPI0CKR = 0x00a2
_SPI0DAT = 0x00a3
_P0MDOUT = 0x00a4
_P0DRV = 0x00a4
_P1MDOUT = 0x00a5
_P1DRV = 0x00a5
_P2MDOUT = 0x00a6
_P2DRV = 0x00a6
_SFRPAGE = 0x00a7
_IE = 0x00a8
_CLKSEL = 0x00a9
_EMI0CN = 0x00aa
_EMI0CF = 0x00ab
_RTC0ADR = 0x00ac
_RTC0DAT = 0x00ad
_RTC0KEY = 0x00ae
_EMI0TC = 0x00af
_ONESHOT = 0x00af
_SPI1CN = 0x00b0
_OSCXCN = 0x00b1
_OSCICN = 0x00b2
_OSCICL = 0x00b3
_PMU0CF = 0x00b5
_FLSCL = 0x00b6
_FLKEY = 0x00b7
_IP = 0x00b8
_IREF0CN = 0x00b9
_ADC0AC = 0x00ba
_ADC0PWR = 0x00ba
_ADC0MX = 0x00bb
_ADC0CF = 0x00bc
_ADC0TK = 0x00bd
_ADC0L = 0x00bd
_ADC0H = 0x00be
_P1MASK = 0x00bf
_SMB0CN = 0x00c0
_SMB0CF = 0x00c1
_SMB0DAT = 0x00c2
_ADC0GTL = 0x00c3
_ADC0GTH = 0x00c4
_ADC0LTL = 0x00c5
_ADC0LTH = 0x00c6
_P0MASK = 0x00c7
_TMR2CN = 0x00c8
_REG0CN = 0x00c9
_TMR2RLL = 0x00ca
_TMR2RLH = 0x00cb
_TMR2L = 0x00cc
_TMR2H = 0x00cd
_PCA0CPM5 = 0x00ce
_P1MAT = 0x00cf
_PSW = 0x00d0
_REF0CN = 0x00d1
_PCA0CPL5 = 0x00d2
_PCA0CPH5 = 0x00d3
_P0SKIP = 0x00d4
_P1SKIP = 0x00d5
_P2SKIP = 0x00d6
_P0MAT = 0x00d7
_PCA0CN = 0x00d8
_PCA0MD = 0x00d9
_PCA0CPM0 = 0x00da
_PCA0CPM1 = 0x00db
_PCA0CPM2 = 0x00dc
_PCA0CPM3 = 0x00dd
_PCA0CPM4 = 0x00de
_PCA0PWM = 0x00df
_ACC = 0x00e0
_XBR0 = 0x00e1
_XBR1 = 0x00e2
_XBR2 = 0x00e3
_IT01CF = 0x00e4
_FLWR = 0x00e5
_EIE1 = 0x00e6
_EIE2 = 0x00e7
_ADC0CN = 0x00e8
_PCA0CPL1 = 0x00e9
_PCA0CPH1 = 0x00ea
_PCA0CPL2 = 0x00eb
_PCA0CPH2 = 0x00ec
_PCA0CPL3 = 0x00ed
_PCA0CPH3 = 0x00ee
_RSTSRC = 0x00ef
_B = 0x00f0
_P0MDIN = 0x00f1
_P1MDIN = 0x00f2
_P2MDIN = 0x00f3
_SMB0ADR = 0x00f4
_SMB0ADM = 0x00f5
_EIP1 = 0x00f6
_EIP2 = 0x00f7
_SPI0CN = 0x00f8
_PCA0L = 0x00f9
_PCA0H = 0x00fa
_PCA0CPL0 = 0x00fb
_PCA0CPH0 = 0x00fc
_PCA0CPL4 = 0x00fd
_PCA0CPH4 = 0x00fe
_VDM0CN = 0x00ff
_DP = 0x8382
_TOFF = 0x8685
_TMR3RL = 0x9392
_TMR3 = 0x9594
_ADC0 = 0xbebd
_ADC0GT = 0xc4c3
_ADC0LT = 0xc6c5
_TMR2RL = 0xcbca
_TMR2 = 0xcdcc
_PCA0CP5 = 0xd3d2
_PCA0CP1 = 0xeae9
_PCA0CP2 = 0xeceb
_PCA0CP3 = 0xeeed
_PCA0 = 0xfaf9
_PCA0CP0 = 0xfcfb
_PCA0CP4 = 0xfefd
;--------------------------------------------------------
; special function bits
;--------------------------------------------------------
.area RSEG (ABS,DATA)
.org 0x0000
_TF1 = 0x008f
_TR1 = 0x008e
_TF0 = 0x008d
_TR0 = 0x008c
_IE1 = 0x008b
_IT1 = 0x008a
_IE0 = 0x0089
_IT0 = 0x0088
_CRC0SEL = 0x0096
_CRC0INIT = 0x0095
_CRC0VAL = 0x0094
_S0MODE = 0x009f
_MCE0 = 0x009d
_REN0 = 0x009c
_TB80 = 0x009b
_RB80 = 0x009a
_TI0 = 0x0099
_RI0 = 0x0098
_EA = 0x00af
_ESPI0 = 0x00ae
_ET2 = 0x00ad
_ES0 = 0x00ac
_ET1 = 0x00ab
_EX1 = 0x00aa
_ET0 = 0x00a9
_EX0 = 0x00a8
_SPIF1 = 0x00b7
_WCOL1 = 0x00b6
_MODF1 = 0x00b5
_RXOVRN1 = 0x00b4
_NSS1MD1 = 0x00b3
_NSS1MD0 = 0x00b2
_TXBMT1 = 0x00b1
_SPI1EN = 0x00b0
_PSPI0 = 0x00be
_PT2 = 0x00bd
_PS0 = 0x00bc
_PT1 = 0x00bb
_PX1 = 0x00ba
_PT0 = 0x00b9
_PX0 = 0x00b8
_MASTER = 0x00c7
_TXMODE = 0x00c6
_STA = 0x00c5
_STO = 0x00c4
_ACKRQ = 0x00c3
_ARBLOST = 0x00c2
_ACK = 0x00c1
_SI = 0x00c0
_TF2H = 0x00cf
_TF2L = 0x00ce
_TF2LEN = 0x00cd
_TF2CEN = 0x00cc
_T2SPLIT = 0x00cb
_TR2 = 0x00ca
_T2RCLK = 0x00c9
_T2XCLK = 0x00c8
_CY = 0x00d7
_AC = 0x00d6
_F0 = 0x00d5
_RS1 = 0x00d4
_RS0 = 0x00d3
_OV = 0x00d2
_F1 = 0x00d1
_P = 0x00d0
_CF = 0x00df
_CR = 0x00de
_CCF5 = 0x00dd
_CCF4 = 0x00dc
_CCF3 = 0x00db
_CCF2 = 0x00da
_CCF1 = 0x00d9
_CCF0 = 0x00d8
_AD0EN = 0x00ef
_BURSTEN = 0x00ee
_AD0INT = 0x00ed
_AD0BUSY = 0x00ec
_AD0WINT = 0x00eb
_AD0CM2 = 0x00ea
_AD0CM1 = 0x00e9
_AD0CM0 = 0x00e8
_SPIF0 = 0x00ff
_WCOL0 = 0x00fe
_MODF0 = 0x00fd
_RXOVRN0 = 0x00fc
_NSS0MD1 = 0x00fb
_NSS0MD0 = 0x00fa
_TXBMT0 = 0x00f9
_SPI0EN = 0x00f8
_LED_RED = 0x0096
_LED_GREEN = 0x0095
_PIN_CONFIG = 0x0082
_PIN_ENABLE = 0x0083
_IRQ = 0x0087
_NSS1 = 0x0094
_SDN = 0x00a6
;--------------------------------------------------------
; overlayable register banks
;--------------------------------------------------------
.area REG_BANK_0 (REL,OVR,DATA)
.ds 8
;--------------------------------------------------------
; internal ram data
;--------------------------------------------------------
.area DSEG (DATA)
_extract_hipri_c_2_150:
.ds 1
_extract_hipri_sloc0_1_0:
.ds 2
_mavlink_frame_slen_1_156:
.ds 2
_mavlink_frame_offset_1_156:
.ds 2
_mavlink_frame_high_offset_1_156:
.ds 2
_mavlink_frame_c_2_157:
.ds 1
_mavlink_frame_sloc0_1_0:
.ds 2
_mavlink_frame_sloc1_1_0:
.ds 1
_packet_get_next_max_xmit_1_163:
.ds 1
_packet_get_next_slen_1_164:
.ds 2
_packet_get_next_sloc0_1_0:
.ds 2
;--------------------------------------------------------
; overlayable items in internal ram
;--------------------------------------------------------
;--------------------------------------------------------
; indirectly addressable internal ram data
;--------------------------------------------------------
.area ISEG (DATA)
;--------------------------------------------------------
; absolute internal ram data
;--------------------------------------------------------
.area IABS (ABS,DATA)
.area IABS (ABS,DATA)
;--------------------------------------------------------
; bit data
;--------------------------------------------------------
.area BSEG (BIT)
_last_sent_is_resend:
.ds 1
_last_sent_is_injected:
.ds 1
_last_recv_is_resend:
.ds 1
_force_resend:
.ds 1
_injected_packet:
.ds 1
_seen_mavlink::
.ds 1
_packet_is_duplicate_PARM_3:
.ds 1
;--------------------------------------------------------
; paged external ram data
;--------------------------------------------------------
.area PSEG (PAG,XDATA)
_last_sent_len:
.ds 1
_last_recv_len:
.ds 1
_serial_rate:
.ds 2
_mav_pkt_len:
.ds 1
_mav_pkt_start_time:
.ds 2
_mav_pkt_max_time:
.ds 2
_mav_max_xmit:
.ds 1
_extract_hipri_max_xmit_1_148:
.ds 1
_extract_hipri_slen_1_149:
.ds 2
_extract_hipri_high_offset_1_149:
.ds 2
_mavlink_frame_PARM_2:
.ds 2
_packet_get_next_PARM_2:
.ds 2
_packet_is_duplicate_PARM_2:
.ds 2
_packet_inject_PARM_2:
.ds 1
;--------------------------------------------------------
; external ram data
;--------------------------------------------------------
.area XSEG (XDATA)
_last_received:
.ds 252
_last_sent:
.ds 252
_mavlink_frame_max_xmit_1_155:
.ds 1
_packet_set_max_xmit_max_1_195:
.ds 1
_packet_set_serial_speed_speed_1_197:
.ds 2
_packet_is_duplicate_len_1_199:
.ds 1
;--------------------------------------------------------
; absolute external ram data
;--------------------------------------------------------
.area XABS (ABS,XDATA)
;--------------------------------------------------------
; external initialized ram data
;--------------------------------------------------------
.area XISEG (XDATA)
.area HOME (CODE)
.area GSINIT0 (CODE)
.area GSINIT1 (CODE)
.area GSINIT2 (CODE)
.area GSINIT3 (CODE)
.area GSINIT4 (CODE)
.area GSINIT5 (CODE)
.area GSINIT (CODE)
.area GSFINAL (CODE)
.area CSEG (CODE)
;--------------------------------------------------------
; global & static initialisations
;--------------------------------------------------------
.area HOME (CODE)
.area GSINIT (CODE)
.area GSFINAL (CODE)
.area GSINIT (CODE)
;--------------------------------------------------------
; Home
;--------------------------------------------------------
.area HOME (CODE)
.area HOME (CODE)
;--------------------------------------------------------
; code
;--------------------------------------------------------
.area CSEG (CODE)
;------------------------------------------------------------
;Allocation info for local variables in function 'check_heartbeat'
;------------------------------------------------------------
; radio/packet.c:77: static void check_heartbeat(__xdata uint8_t * __pdata buf) __nonbanked
; -----------------------------------------
; function check_heartbeat
; -----------------------------------------
_check_heartbeat:
ar7 = 0x07
ar6 = 0x06
ar5 = 0x05
ar4 = 0x04
ar3 = 0x03
ar2 = 0x02
ar1 = 0x01
ar0 = 0x00
; radio/packet.c:79: if (buf[0] == MAVLINK10_STX &&
mov r6,dpl
mov r7,dph
movx a,@dptr
mov r5,a
cjne r5,#0xFE,00105$
; radio/packet.c:80: buf[1] == 9 && buf[5] == 0) {
mov dpl,r6
mov dph,r7
inc dptr
movx a,@dptr
mov r5,a
cjne r5,#0x09,00105$
mov a,#0x05
add a,r6
mov r6,a
clr a
addc a,r7
mov r7,a
mov dpl,r6
mov dph,r7
movx a,@dptr
jnz 00105$
; radio/packet.c:82: seen_mavlink = true;
setb _seen_mavlink
00105$:
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'extract_hipri'
;------------------------------------------------------------
;c Allocated with name '_extract_hipri_c_2_150'
;sloc0 Allocated with name '_extract_hipri_sloc0_1_0'
;------------------------------------------------------------
; radio/packet.c:92: int16_t extract_hipri(__pdata uint8_t max_xmit)
; -----------------------------------------
; function extract_hipri
; -----------------------------------------
_extract_hipri:
mov a,dpl
mov r0,#_extract_hipri_max_xmit_1_148
movx @r0,a
; radio/packet.c:94: __pdata uint16_t slen = serial_read_available();
lcall _serial_read_available
mov r0,#_extract_hipri_slen_1_149
mov a,dpl
movx @r0,a
inc r0
mov a,dph
movx @r0,a
; radio/packet.c:95: __pdata uint16_t offset = 0;
mov r3,#0x00
mov r4,#0x00
; radio/packet.c:96: __pdata int16_t high_offset = -1;
mov r0,#_extract_hipri_high_offset_1_149
mov a,#0xFF
movx @r0,a
inc r0
movx @r0,a
; radio/packet.c:99: while (slen >= 8) {
00111$:
mov r0,#_extract_hipri_slen_1_149
clr c
movx a,@r0
subb a,#0x08
inc r0
movx a,@r0
subb a,#0x00
jnc 00140$
ljmp 00113$
00140$:
; radio/packet.c:100: register uint8_t c = serial_peekx(offset);
mov dpl,r3
mov dph,r4
push ar4
push ar3
lcall _serial_peekx
mov _extract_hipri_c_2_150,dpl
pop ar3
pop ar4
; radio/packet.c:101: if (c != MAVLINK10_STX) {
mov a,#0xFE
cjne a,_extract_hipri_c_2_150,00141$
sjmp 00142$
00141$:
ljmp 00113$
00142$:
; radio/packet.c:105: c = serial_peekx(offset + 1);
mov a,#0x01
add a,r3
mov r6,a
clr a
addc a,r4
mov r7,a
mov dpl,r6
mov dph,r7
push ar4
push ar3
lcall _serial_peekx
mov _extract_hipri_c_2_150,dpl
pop ar3
pop ar4
; radio/packet.c:106: if (c >= 255 - 8 ||
mov a,#0x100 - 0xF7
add a,_extract_hipri_c_2_150
jnc 00143$
ljmp 00113$
00143$:
; radio/packet.c:107: c+8 > max_xmit - last_sent_len) {
push ar3
push ar4
mov r5,_extract_hipri_c_2_150
mov r6,#0x00
mov a,#0x08
add a,r5
mov r2,a
clr a
addc a,r6
mov r4,a
mov r0,#_extract_hipri_max_xmit_1_148
movx a,@r0
mov _extract_hipri_sloc0_1_0,a
; 1-genFromRTrack replaced mov (_extract_hipri_sloc0_1_0 + 1),#0x00
mov (_extract_hipri_sloc0_1_0 + 1),r6
mov r0,#_last_sent_len
movx a,@r0
mov r3,a
mov r7,#0x00
mov a,_extract_hipri_sloc0_1_0
clr c
subb a,r3
mov r3,a
mov a,(_extract_hipri_sloc0_1_0 + 1)
subb a,r7
mov r7,a
clr c
mov a,r3
subb a,r2
mov a,r7
xrl a,#0x80
mov b,r4
xrl b,#0x80
subb a,b
pop ar4
pop ar3
jc 00113$
; radio/packet.c:111: if (c+8 > slen) {
mov a,#0x08
add a,r5
mov r5,a
clr a
addc a,r6
mov r6,a
mov r0,#_extract_hipri_slen_1_149
clr c
movx a,@r0
subb a,r5
inc r0
movx a,@r0
subb a,r6
jc 00113$
; radio/packet.c:117: if(serial_peekx(offset +6) == MSG_TYP_RC_OVERRIDE && c == MSG_LEN_RC_OVERRIDE) {
mov a,#0x06
add a,r3
mov r6,a
clr a
addc a,r4
mov r7,a
mov dpl,r6
mov dph,r7
push ar4
push ar3
lcall _serial_peekx
mov r7,dpl
pop ar3
pop ar4
cjne r7,#0x46,00109$
mov a,#0x12
cjne a,_extract_hipri_c_2_150,00109$
; radio/packet.c:119: high_offset = offset;
mov r0,#_extract_hipri_high_offset_1_149
mov a,r3
movx @r0,a
inc r0
mov a,r4
movx @r0,a
00109$:
; radio/packet.c:122: c += 8;
mov a,#0x08
add a,_extract_hipri_c_2_150
mov _extract_hipri_c_2_150,a
; radio/packet.c:123: slen -= c;
mov r2,_extract_hipri_c_2_150
mov r7,#0x00
mov r0,#_extract_hipri_slen_1_149
movx a,@r0
clr c
subb a,r2
movx @r0,a
inc r0
movx a,@r0
subb a,r7
movx @r0,a
; radio/packet.c:124: offset += c;
mov a,r2
add a,r3
mov r3,a
mov a,r7
addc a,r4
mov r4,a
ljmp 00111$
00113$:
; radio/packet.c:127: return high_offset;
mov r0,#_extract_hipri_high_offset_1_149
movx a,@r0
mov dpl,a
inc r0
movx a,@r0
mov dph,a
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'mavlink_frame'
;------------------------------------------------------------
;slen Allocated with name '_mavlink_frame_slen_1_156'
;offset Allocated with name '_mavlink_frame_offset_1_156'
;high_offset Allocated with name '_mavlink_frame_high_offset_1_156'
;c Allocated with name '_mavlink_frame_c_2_157'
;sloc0 Allocated with name '_mavlink_frame_sloc0_1_0'
;sloc1 Allocated with name '_mavlink_frame_sloc1_1_0'
;max_xmit Allocated with name '_mavlink_frame_max_xmit_1_155'
;------------------------------------------------------------
; radio/packet.c:137: uint8_t mavlink_frame(uint8_t max_xmit, __xdata uint8_t * __pdata buf) __nonbanked
; -----------------------------------------
; function mavlink_frame
; -----------------------------------------
_mavlink_frame:
mov a,dpl
mov dptr,#_mavlink_frame_max_xmit_1_155
movx @dptr,a
; radio/packet.c:139: __data uint16_t slen, offset = 0, high_offset;
clr a
mov _mavlink_frame_offset_1_156,a
mov (_mavlink_frame_offset_1_156 + 1),a
; radio/packet.c:141: serial_read_buf(last_sent, mav_pkt_len);
mov r0,#_mav_pkt_len
mov r1,#_serial_read_buf_PARM_2
movx a,@r0
movx @r1,a
mov dptr,#_last_sent
lcall _serial_read_buf
; radio/packet.c:142: last_sent_len = mav_pkt_len;
mov r0,#_mav_pkt_len
movx a,@r0
mov r5,a
mov r0,#_last_sent_len
movx @r0,a
; radio/packet.c:143: memcpy(buf, last_sent, last_sent_len);
mov r0,#_mavlink_frame_PARM_2
movx a,@r0
mov r2,a
inc r0
movx a,@r0
mov r3,a
mov r4,#0x00
mov dptr,#_memcpy_PARM_2
mov a,#_last_sent
movx @dptr,a
mov a,#(_last_sent >> 8)
inc dptr
movx @dptr,a
clr a
inc dptr
movx @dptr,a
mov dptr,#_memcpy_PARM_3
mov a,r5
movx @dptr,a
clr a
inc dptr
movx @dptr,a
mov dpl,r2
mov dph,r3
mov b,r4
lcall _memcpy
; radio/packet.c:144: mav_pkt_len = 0;
mov r0,#_mav_pkt_len
clr a
movx @r0,a
; radio/packet.c:146: check_heartbeat(buf);
mov r0,#_mavlink_frame_PARM_2
movx a,@r0
mov dpl,a
inc r0
movx a,@r0
mov dph,a
lcall _check_heartbeat
; radio/packet.c:148: high_offset = (feature_mavlink_framing == MAVLINK_FRAMING_HIGHPRI) ? extract_hipri(max_xmit) : -1;
mov dptr,#_feature_mavlink_framing
movx a,@dptr
mov r5,a
cjne r5,#0x02,00119$
mov dptr,#_mavlink_frame_max_xmit_1_155
movx a,@dptr
mov dpl,a
lcall _extract_hipri
mov r4,dpl
mov r5,dph
sjmp 00120$
00119$:
mov r4,#0xFF
mov r5,#0xFF
00120$:
mov _mavlink_frame_high_offset_1_156,r4
mov (_mavlink_frame_high_offset_1_156 + 1),r5
; radio/packet.c:150: slen = serial_read_available();
lcall _serial_read_available
mov _mavlink_frame_slen_1_156,dpl
mov (_mavlink_frame_slen_1_156 + 1),dph
; radio/packet.c:154: while (slen >= 8) {
mov dptr,#_mavlink_frame_max_xmit_1_155
movx a,@dptr
mov _mavlink_frame_sloc1_1_0,a
mov a,#0xFF
cjne a,_mavlink_frame_high_offset_1_156,00156$
mov a,#0xFF
cjne a,(_mavlink_frame_high_offset_1_156 + 1),00156$
mov a,#0x01
sjmp 00157$
00156$:
clr a
00157$:
mov r4,a
00114$:
clr c
mov a,_mavlink_frame_slen_1_156
subb a,#0x08
mov a,(_mavlink_frame_slen_1_156 + 1)
subb a,#0x00
jnc 00158$
ljmp 00116$
00158$:
; radio/packet.c:155: register uint8_t c = serial_peek();
push ar4
lcall _serial_peek
mov _mavlink_frame_c_2_157,dpl
pop ar4
; radio/packet.c:156: if (c != MAVLINK10_STX) {
mov a,#0xFE
cjne a,_mavlink_frame_c_2_157,00159$
sjmp 00102$
00159$:
; radio/packet.c:158: return last_sent_len;
mov r0,#_last_sent_len
movx a,@r0
mov dpl,a
ret
00102$:
; radio/packet.c:160: c = serial_peek2();
push ar4
lcall _serial_peek2
mov _mavlink_frame_c_2_157,dpl
pop ar4
; radio/packet.c:161: if (c >= 255 - 8 ||
mov a,#0x100 - 0xF7
add a,_mavlink_frame_c_2_157
jnc 00160$
ljmp 00116$
00160$:
; radio/packet.c:162: c+8 > max_xmit - last_sent_len) {
push ar4
mov _mavlink_frame_sloc0_1_0,_mavlink_frame_c_2_157
mov (_mavlink_frame_sloc0_1_0 + 1),#0x00
mov a,#0x08
add a,_mavlink_frame_sloc0_1_0
mov r3,a
clr a
addc a,(_mavlink_frame_sloc0_1_0 + 1)
mov r6,a
mov r2,_mavlink_frame_sloc1_1_0
mov r7,#0x00
mov r0,#_last_sent_len
movx a,@r0
mov r4,a
mov r5,#0x00
mov a,r2
clr c
subb a,r4
mov r2,a
mov a,r7
subb a,r5
mov r7,a
clr c
mov a,r2
subb a,r3
mov a,r7
xrl a,#0x80
mov b,r6
xrl b,#0x80
subb a,b
pop ar4
jnc 00161$
ljmp 00116$
00161$:
; radio/packet.c:166: if (c+8 > slen) {
mov a,#0x08
add a,_mavlink_frame_sloc0_1_0
mov r6,a
clr a
addc a,(_mavlink_frame_sloc0_1_0 + 1)
mov r7,a
clr c
mov a,_mavlink_frame_slen_1_156
subb a,r6
mov a,(_mavlink_frame_slen_1_156 + 1)
subb a,r7
jnc 00162$
ljmp 00116$
00162$:
; radio/packet.c:173: if(high_offset != -1 && high_offset != offset && serial_peekx(6) == MSG_TYP_RC_OVERRIDE && c == MSG_LEN_RC_OVERRIDE) {
mov a,r4
jnz 00109$
mov a,_mavlink_frame_offset_1_156
cjne a,_mavlink_frame_high_offset_1_156,00164$
mov a,(_mavlink_frame_offset_1_156 + 1)
cjne a,(_mavlink_frame_high_offset_1_156 + 1),00164$
sjmp 00109$
00164$:
mov dptr,#0x0006
push ar4
lcall _serial_peekx
mov r7,dpl
pop ar4
cjne r7,#0x46,00109$
mov a,#0x12
cjne a,_mavlink_frame_c_2_157,00109$
; radio/packet.c:175: c += 8;
mov a,#0x08
add a,_mavlink_frame_c_2_157
mov _mavlink_frame_c_2_157,a
sjmp 00110$
00109$:
; radio/packet.c:178: c += 8;
mov a,#0x08
add a,_mavlink_frame_c_2_157
mov _mavlink_frame_c_2_157,a
; radio/packet.c:181: serial_read_buf(&last_sent[last_sent_len], c);
mov r0,#_last_sent_len
movx a,@r0
add a,#_last_sent
mov r6,a
clr a
addc a,#(_last_sent >> 8)
mov r7,a
mov r0,#_serial_read_buf_PARM_2
mov a,_mavlink_frame_c_2_157
movx @r0,a
mov dpl,r6
mov dph,r7
push ar4
lcall _serial_read_buf
; radio/packet.c:182: memcpy(&buf[last_sent_len], &last_sent[last_sent_len], c);
mov r0,#_mavlink_frame_PARM_2
mov r1,#_last_sent_len
movx a,@r1
xch a,b
movx a,@r0
add a,b
mov r6,a
inc r0
movx a,@r0
addc a,#0x00
mov r7,a
mov r5,#0x00
mov r0,#_last_sent_len
movx a,@r0
add a,#_last_sent
mov r2,a
clr a
addc a,#(_last_sent >> 8)
mov r3,a
mov dptr,#_memcpy_PARM_2
mov a,r2
movx @dptr,a
mov a,r3
inc dptr
movx @dptr,a
clr a
inc dptr
movx @dptr,a
mov dptr,#_memcpy_PARM_3
mov a,_mavlink_frame_c_2_157
movx @dptr,a
clr a
inc dptr
movx @dptr,a
mov dpl,r6
mov dph,r7
mov b,r5
lcall _memcpy
; radio/packet.c:184: check_heartbeat(buf+last_sent_len);
mov r0,#_mavlink_frame_PARM_2
mov r1,#_last_sent_len
movx a,@r1
xch a,b
movx a,@r0
add a,b
mov r6,a
inc r0
movx a,@r0
addc a,#0x00
mov r7,a
mov dpl,r6
mov dph,r7
lcall _check_heartbeat
pop ar4
00110$:
; radio/packet.c:187: last_sent_len += c;
mov r0,#_last_sent_len
movx a,@r0
add a,_mavlink_frame_c_2_157
movx @r0,a
; radio/packet.c:188: slen -= c;
mov r6,_mavlink_frame_c_2_157
mov r7,#0x00
mov a,_mavlink_frame_slen_1_156
clr c
subb a,r6
mov _mavlink_frame_slen_1_156,a
mov a,(_mavlink_frame_slen_1_156 + 1)
subb a,r7
mov (_mavlink_frame_slen_1_156 + 1),a
; radio/packet.c:189: offset += c;
mov a,r6
add a,_mavlink_frame_offset_1_156
mov _mavlink_frame_offset_1_156,a
mov a,r7
addc a,(_mavlink_frame_offset_1_156 + 1)
mov (_mavlink_frame_offset_1_156 + 1),a
ljmp 00114$
00116$:
; radio/packet.c:192: return last_sent_len;
mov r0,#_last_sent_len
movx a,@r0
mov dpl,a
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'packet_get_next'
;------------------------------------------------------------
;max_xmit Allocated with name '_packet_get_next_max_xmit_1_163'
;slen Allocated with name '_packet_get_next_slen_1_164'
;c Allocated to registers r7
;sloc0 Allocated with name '_packet_get_next_sloc0_1_0'
;------------------------------------------------------------
; radio/packet.c:198: packet_get_next(register uint8_t max_xmit, __xdata uint8_t * __pdata buf)
; -----------------------------------------
; function packet_get_next
; -----------------------------------------
_packet_get_next:
mov _packet_get_next_max_xmit_1_163,dpl
; radio/packet.c:207: slen = serial_read_available();
lcall _serial_read_available
mov _packet_get_next_slen_1_164,dpl
mov (_packet_get_next_slen_1_164 + 1),dph
; radio/packet.c:208: if (force_resend ||
jb _force_resend,00103$
; radio/packet.c:209: (feature_opportunistic_resend &&
jnb _feature_opportunistic_resend,00104$
jb _last_sent_is_resend,00104$
; radio/packet.c:211: last_sent_len != 0 &&
mov r0,#_last_sent_len
movx a,@r0
jz 00104$
; radio/packet.c:212: slen < PACKET_RESEND_THRESHOLD)) {
clr c
mov a,_packet_get_next_slen_1_164
subb a,#0x20
mov a,(_packet_get_next_slen_1_164 + 1)
subb a,#0x00
jnc 00104$
00103$:
; radio/packet.c:213: if (max_xmit < last_sent_len) {
mov r0,#_last_sent_len
clr c
movx a,@r0
mov b,a
mov a,_packet_get_next_max_xmit_1_163
subb a,b
jnc 00102$
; radio/packet.c:214: last_sent_len = 0;
mov r0,#_last_sent_len
clr a
movx @r0,a
; radio/packet.c:215: return 0;
mov dpl,#0x00
ret
00102$:
; radio/packet.c:217: last_sent_is_resend = true;
setb _last_sent_is_resend
; radio/packet.c:218: force_resend = false;
clr _force_resend
; radio/packet.c:219: memcpy(buf, last_sent, last_sent_len);
mov r0,#_packet_get_next_PARM_2
movx a,@r0
mov r2,a
inc r0
movx a,@r0
mov r3,a
mov r4,#0x00
mov dptr,#_memcpy_PARM_2
mov a,#_last_sent
movx @dptr,a
mov a,#(_last_sent >> 8)
inc dptr
movx @dptr,a
clr a
inc dptr
movx @dptr,a
mov r0,#_last_sent_len
mov dptr,#_memcpy_PARM_3
movx a,@r0
movx @dptr,a
clr a
inc dptr
movx @dptr,a
mov dpl,r2
mov dph,r3
mov b,r4
lcall _memcpy
; radio/packet.c:220: slen = last_sent_len;
mov r0,#_last_sent_len
movx a,@r0
mov _packet_get_next_slen_1_164,a
mov (_packet_get_next_slen_1_164 + 1),#0x00
; radio/packet.c:221: last_sent_len = 0;
mov r0,#_last_sent_len
clr a
movx @r0,a
; radio/packet.c:222: return (slen & 0xFF);
mov r3,_packet_get_next_slen_1_164
mov dpl,r3
ret
00104$:
; radio/packet.c:225: last_sent_is_resend = false;
clr _last_sent_is_resend
; radio/packet.c:227: if (injected_packet) {
jb _injected_packet,00240$
ljmp 00112$
00240$:
; radio/packet.c:229: slen = last_sent_len;
mov r0,#_last_sent_len
movx a,@r0
mov r3,a
mov r4,#0x00
mov _packet_get_next_slen_1_164,r3
mov (_packet_get_next_slen_1_164 + 1),r4
; radio/packet.c:230: if (max_xmit < slen) {
mov _packet_get_next_sloc0_1_0,_packet_get_next_max_xmit_1_163
; 1-genFromRTrack replaced mov (_packet_get_next_sloc0_1_0 + 1),#0x00
mov (_packet_get_next_sloc0_1_0 + 1),r4
clr c
mov a,_packet_get_next_sloc0_1_0
subb a,_packet_get_next_slen_1_164
mov a,(_packet_get_next_sloc0_1_0 + 1)
subb a,(_packet_get_next_slen_1_164 + 1)
jnc 00110$
; radio/packet.c:232: memcpy(buf, last_sent, max_xmit);
mov r0,#_packet_get_next_PARM_2
movx a,@r0
mov r2,a
inc r0
movx a,@r0
mov r6,a
mov r7,#0x00
mov dptr,#_memcpy_PARM_2
mov a,#_last_sent
movx @dptr,a
mov a,#(_last_sent >> 8)
inc dptr
movx @dptr,a
clr a
inc dptr
movx @dptr,a
mov dptr,#_memcpy_PARM_3
mov a,_packet_get_next_sloc0_1_0
movx @dptr,a
mov a,(_packet_get_next_sloc0_1_0 + 1)
inc dptr
movx @dptr,a
mov dpl,r2
mov dph,r6
mov b,r7
lcall _memcpy
; radio/packet.c:233: memcpy(last_sent, &last_sent[max_xmit], slen - max_xmit);
mov a,_packet_get_next_max_xmit_1_163
add a,#_last_sent
mov r6,a
clr a
addc a,#(_last_sent >> 8)
mov r7,a
mov dptr,#_memcpy_PARM_2
mov a,r6
movx @dptr,a
mov a,r7
inc dptr
movx @dptr,a
clr a
inc dptr
movx @dptr,a
mov r6,_packet_get_next_max_xmit_1_163
mov r7,#0x00
mov dptr,#_memcpy_PARM_3
mov a,_packet_get_next_slen_1_164
clr c
subb a,r6
movx @dptr,a
mov a,(_packet_get_next_slen_1_164 + 1)
subb a,r7
inc dptr
movx @dptr,a
mov dptr,#_last_sent
mov b,#0x00
lcall _memcpy
; radio/packet.c:234: last_sent_len = slen - max_xmit;
mov a,_packet_get_next_slen_1_164
clr c
subb a,_packet_get_next_max_xmit_1_163
mov r0,#_last_sent_len
movx @r0,a
; radio/packet.c:235: last_sent_is_injected = true;
setb _last_sent_is_injected
; radio/packet.c:236: return max_xmit;
mov dpl,_packet_get_next_max_xmit_1_163
ret
00110$:
; radio/packet.c:239: memcpy(buf, last_sent, last_sent_len);
mov r0,#_packet_get_next_PARM_2
movx a,@r0
mov r5,a
inc r0
movx a,@r0
mov r6,a
mov r7,#0x00
mov dptr,#_memcpy_PARM_2
mov a,#_last_sent
movx @dptr,a
mov a,#(_last_sent >> 8)
inc dptr
movx @dptr,a
clr a
inc dptr
movx @dptr,a
mov dptr,#_memcpy_PARM_3
mov a,r3
movx @dptr,a
mov a,r4
inc dptr
movx @dptr,a
mov dpl,r5
mov dph,r6
mov b,r7
lcall _memcpy
; radio/packet.c:240: injected_packet = false;
clr _injected_packet
; radio/packet.c:241: last_sent_is_injected = true;
setb _last_sent_is_injected
; radio/packet.c:242: return last_sent_len;
mov r0,#_last_sent_len
movx a,@r0
mov dpl,a
ret
00112$:
; radio/packet.c:245: last_sent_is_injected = false;
clr _last_sent_is_injected
; radio/packet.c:249: if (slen > max_xmit) {
mov r6,_packet_get_next_max_xmit_1_163
mov r7,#0x00
clr c
mov a,r6
subb a,_packet_get_next_slen_1_164
mov a,r7
subb a,(_packet_get_next_slen_1_164 + 1)
jnc 00114$
; radio/packet.c:250: slen = max_xmit;
mov _packet_get_next_slen_1_164,r6
mov (_packet_get_next_slen_1_164 + 1),r7
00114$:
; radio/packet.c:253: last_sent_len = 0;
mov r0,#_last_sent_len
clr a
movx @r0,a
; radio/packet.c:255: if (slen == 0) {
mov a,_packet_get_next_slen_1_164
orl a,(_packet_get_next_slen_1_164 + 1)
; radio/packet.c:257: return 0;
jnz 00116$
mov dpl,a
ret
00116$:
; radio/packet.c:260: if (!feature_mavlink_framing) {
mov dptr,#_feature_mavlink_framing
movx a,@dptr
jnz 00122$
; radio/packet.c:262: if (slen > 0 && serial_read_buf(buf, slen)) {
mov a,_packet_get_next_slen_1_164
orl a,(_packet_get_next_slen_1_164 + 1)
jz 00118$
mov r5,_packet_get_next_slen_1_164
mov r0,#_serial_read_buf_PARM_2
mov a,r5
movx @r0,a
mov r0,#_packet_get_next_PARM_2
movx a,@r0
mov dpl,a
inc r0
movx a,@r0
mov dph,a
push ar5
lcall _serial_read_buf
pop ar5
jnc 00118$
; radio/packet.c:263: memcpy(last_sent, buf, slen);
mov r0,#_packet_get_next_PARM_2
mov dptr,#_memcpy_PARM_2
movx a,@r0
movx @dptr,a
inc r0
movx a,@r0
inc dptr
movx @dptr,a
clr a
inc dptr
movx @dptr,a
mov dptr,#_memcpy_PARM_3
mov a,_packet_get_next_slen_1_164
movx @dptr,a
mov a,(_packet_get_next_slen_1_164 + 1)
inc dptr
movx @dptr,a
mov dptr,#_last_sent
mov b,#0x00
push ar5
lcall _memcpy
pop ar5
; radio/packet.c:264: last_sent_len = slen;
mov r0,#_last_sent_len
mov a,r5
movx @r0,a
sjmp 00119$
00118$:
; radio/packet.c:266: last_sent_len = 0;
mov r0,#_last_sent_len
clr a
movx @r0,a
00119$:
; radio/packet.c:268: return last_sent_len;
mov r0,#_last_sent_len
movx a,@r0
mov dpl,a
ret
00122$:
; radio/packet.c:273: if (mav_pkt_len == 1) {
mov r0,#_mav_pkt_len
movx a,@r0
cjne a,#0x01,00247$
sjmp 00248$
00247$:
ljmp 00128$
00248$:
; radio/packet.c:275: if (slen == 1) {
mov a,#0x01
cjne a,_packet_get_next_slen_1_164,00249$
clr a
cjne a,(_packet_get_next_slen_1_164 + 1),00249$
sjmp 00250$
00249$:
sjmp 00126$
00250$:
; radio/packet.c:276: if ((uint16_t)(timer2_tick() - mav_pkt_start_time) > mav_pkt_max_time) {
lcall _timer2_tick
mov r6,dpl
mov r7,dph
mov r0,#_mav_pkt_start_time
setb c
movx a,@r0
subb a,r6
cpl a
cpl c
mov r6,a
cpl c
inc r0
movx a,@r0
subb a,r7
cpl a
mov r7,a
mov r0,#_mav_pkt_max_time
clr c
movx a,@r0
subb a,r6
inc r0
movx a,@r0
subb a,r7
jnc 00124$
; radio/packet.c:278: last_sent[last_sent_len++] = serial_read();
mov r0,#_last_sent_len
movx a,@r0
mov r7,a
mov r0,#_last_sent_len
inc a
movx @r0,a
mov a,r7
add a,#_last_sent
mov r7,a
clr a
addc a,#(_last_sent >> 8)
mov r6,a
push ar7
push ar6
lcall _serial_read
mov r5,dpl
pop ar6
pop ar7
mov dpl,r7
mov dph,r6
mov a,r5
movx @dptr,a
; radio/packet.c:279: memcpy(buf, last_sent, last_sent_len);
mov r0,#_packet_get_next_PARM_2
movx a,@r0
mov r5,a
inc r0
movx a,@r0
mov r6,a
mov r7,#0x00
mov dptr,#_memcpy_PARM_2
mov a,#_last_sent
movx @dptr,a
mov a,#(_last_sent >> 8)
inc dptr
movx @dptr,a
clr a
inc dptr
movx @dptr,a
mov r0,#_last_sent_len
mov dptr,#_memcpy_PARM_3
movx a,@r0
movx @dptr,a
clr a
inc dptr
movx @dptr,a
mov dpl,r5
mov dph,r6
mov b,r7
lcall _memcpy
; radio/packet.c:280: mav_pkt_len = 0;
mov r0,#_mav_pkt_len
clr a
movx @r0,a
; radio/packet.c:281: return last_sent_len;
mov r0,#_last_sent_len
movx a,@r0
mov dpl,a
ret
00124$:
; radio/packet.c:284: return 0;
mov dpl,#0x00
ret
00126$:
; radio/packet.c:288: mav_pkt_len = 0;
mov r0,#_mav_pkt_len
clr a
movx @r0,a
00128$:
; radio/packet.c:292: if (mav_pkt_len != 0) {
mov r0,#_mav_pkt_len
movx a,@r0
jnz 00252$
ljmp 00179$
00252$:
; radio/packet.c:293: if (slen < mav_pkt_len) {
mov r0,#_mav_pkt_len
movx a,@r0
mov r6,a
mov r7,#0x00
clr c
mov a,_packet_get_next_slen_1_164
subb a,r6
mov a,(_packet_get_next_slen_1_164 + 1)
subb a,r7
jnc 00132$
; radio/packet.c:294: if ((uint16_t)(timer2_tick() - mav_pkt_start_time) > mav_pkt_max_time) {
lcall _timer2_tick
mov r6,dpl
mov r7,dph
mov r0,#_mav_pkt_start_time
setb c
movx a,@r0
subb a,r6
cpl a
cpl c
mov r6,a
cpl c
inc r0
movx a,@r0
subb a,r7
cpl a
mov r7,a
mov r0,#_mav_pkt_max_time
clr c
movx a,@r0
subb a,r6
inc r0
movx a,@r0
subb a,r7
jnc 00130$
; radio/packet.c:297: serial_read_buf(last_sent, slen);
mov r5,_packet_get_next_slen_1_164
mov r0,#_serial_read_buf_PARM_2
mov a,r5
movx @r0,a
mov dptr,#_last_sent
push ar5
lcall _serial_read_buf
pop ar5
; radio/packet.c:298: last_sent_len = slen;
mov r0,#_last_sent_len
mov a,r5
movx @r0,a
; radio/packet.c:299: memcpy(buf, last_sent, last_sent_len);
mov r0,#_packet_get_next_PARM_2
movx a,@r0
mov r4,a
inc r0
movx a,@r0
mov r6,a
mov r7,#0x00
mov dptr,#_memcpy_PARM_2
mov a,#_last_sent
movx @dptr,a
mov a,#(_last_sent >> 8)
inc dptr
movx @dptr,a
clr a
inc dptr
movx @dptr,a
mov dptr,#_memcpy_PARM_3
mov a,r5
movx @dptr,a
clr a
inc dptr
movx @dptr,a
mov dpl,r4
mov dph,r6
mov b,r7
lcall _memcpy
; radio/packet.c:300: mav_pkt_len = 0;
mov r0,#_mav_pkt_len
clr a
movx @r0,a
; radio/packet.c:301: return last_sent_len;
mov r0,#_last_sent_len
movx a,@r0
mov dpl,a
ret
00130$:
; radio/packet.c:305: return 0;
mov dpl,#0x00
ret
00132$:
; radio/packet.c:309: return mavlink_frame(max_xmit, buf);
mov r0,#_packet_get_next_PARM_2
mov r1,#_mavlink_frame_PARM_2
movx a,@r0
movx @r1,a
inc r0
movx a,@r0
inc r1
movx @r1,a
mov dpl,_packet_get_next_max_xmit_1_163
ljmp _mavlink_frame
; radio/packet.c:312: while (slen > 0) {
00179$:
00151$:
mov a,_packet_get_next_slen_1_164
orl a,(_packet_get_next_slen_1_164 + 1)
jnz 00255$
ljmp 00153$
00255$:
; radio/packet.c:313: register uint8_t c = serial_peek();
lcall _serial_peek
mov r7,dpl
; radio/packet.c:314: if (c == MAVLINK10_STX) {
cjne r7,#0xFE,00256$
sjmp 00257$
00256$:
ljmp 00149$
00257$:
; radio/packet.c:315: if (slen == 1) {
mov a,#0x01
cjne a,_packet_get_next_slen_1_164,00258$
clr a
cjne a,(_packet_get_next_slen_1_164 + 1),00258$
sjmp 00259$
00258$:
sjmp 00138$
00259$:
; radio/packet.c:317: if (last_sent_len == 0) {
mov r0,#_last_sent_len
movx a,@r0
jz 00260$
ljmp 00153$
00260$:
; radio/packet.c:320: mav_pkt_len = 1;
mov r0,#_mav_pkt_len
mov a,#0x01
movx @r0,a
; radio/packet.c:321: mav_pkt_start_time = timer2_tick();
lcall _timer2_tick
mov a,dpl
mov b,dph
mov r0,#_mav_pkt_start_time
movx @r0,a
inc r0
mov a,b
movx @r0,a
; radio/packet.c:322: mav_pkt_max_time = serial_rate;
mov r0,#_serial_rate
movx a,@r0
mov r6,a
inc r0
movx a,@r0
mov r7,a
mov r0,#_mav_pkt_max_time
mov a,r6
movx @r0,a
inc r0
mov a,r7
movx @r0,a
; radio/packet.c:323: return 0;
mov dpl,#0x00
ret
; radio/packet.c:325: break;
00138$:
; radio/packet.c:327: mav_pkt_len = serial_peek2();
lcall _serial_peek2
mov r7,dpl
mov r0,#_mav_pkt_len
mov a,r7
movx @r0,a
; radio/packet.c:328: if (mav_pkt_len >= 255-8 ||
cjne r7,#0xF7,00261$
00261$:
jnc 00139$
; radio/packet.c:329: mav_pkt_len+8 > mav_max_xmit) {
mov ar5,r7
mov r6,#0x00
mov a,#0x08
add a,r5
mov r5,a
clr a
addc a,r6
mov r6,a
mov r0,#_mav_max_xmit
movx a,@r0
mov r3,a
mov r4,#0x00
clr c
mov a,r3
subb a,r5
mov a,r4
xrl a,#0x80
mov b,r6
xrl b,#0x80
subb a,b
jnc 00140$
00139$:
; radio/packet.c:331: mav_pkt_len = 0;
mov r0,#_mav_pkt_len
clr a
movx @r0,a
; radio/packet.c:332: last_sent[last_sent_len++] = serial_read();
mov r0,#_last_sent_len
movx a,@r0
mov r6,a
mov r0,#_last_sent_len
inc a
movx @r0,a
mov a,r6
add a,#_last_sent
mov r6,a
clr a
addc a,#(_last_sent >> 8)
mov r5,a
push ar6
push ar5
lcall _serial_read
mov r4,dpl
pop ar5
pop ar6
mov dpl,r6
mov dph,r5
mov a,r4
movx @dptr,a
; radio/packet.c:333: slen--;
dec _packet_get_next_slen_1_164
mov a,#0xFF
cjne a,_packet_get_next_slen_1_164,00264$
dec (_packet_get_next_slen_1_164 + 1)
00264$:
; radio/packet.c:334: continue;
ljmp 00151$
00140$:
; radio/packet.c:339: mav_pkt_len += 8;
mov a,#0x08
add a,r7
mov r7,a
mov r0,#_mav_pkt_len
movx @r0,a
; radio/packet.c:341: if (last_sent_len != 0) {
mov r0,#_last_sent_len
movx a,@r0
jz 00146$
; radio/packet.c:345: memcpy(buf, last_sent, last_sent_len);
mov r0,#_packet_get_next_PARM_2
movx a,@r0
mov r4,a
inc r0
movx a,@r0
mov r5,a
mov r6,#0x00
mov dptr,#_memcpy_PARM_2
mov a,#_last_sent
movx @dptr,a
mov a,#(_last_sent >> 8)
inc dptr
movx @dptr,a
clr a
inc dptr
movx @dptr,a
mov r0,#_last_sent_len
mov dptr,#_memcpy_PARM_3
movx a,@r0
movx @dptr,a
clr a
inc dptr
movx @dptr,a
mov dpl,r4
mov dph,r5
mov b,r6
lcall _memcpy
; radio/packet.c:346: mav_pkt_start_time = timer2_tick();
lcall _timer2_tick
mov a,dpl
mov b,dph
mov r0,#_mav_pkt_start_time
movx @r0,a
inc r0
mov a,b
movx @r0,a
; radio/packet.c:347: mav_pkt_max_time = mav_pkt_len * serial_rate;
mov r0,#_mav_pkt_len
movx a,@r0
mov r5,a
mov r6,#0x00
mov r0,#_serial_rate
mov dptr,#__mulint_PARM_2
movx a,@r0
movx @dptr,a
inc r0
movx a,@r0
inc dptr
movx @dptr,a
mov dpl,r5
mov dph,r6
lcall __mulint
mov a,dpl
mov b,dph
mov r0,#_mav_pkt_max_time
movx @r0,a
inc r0
mov a,b
movx @r0,a
; radio/packet.c:348: return last_sent_len;
mov r0,#_last_sent_len
movx a,@r0
mov dpl,a
ret
00146$:
; radio/packet.c:349: } else if (mav_pkt_len > slen) {
mov r6,#0x00
clr c
mov a,_packet_get_next_slen_1_164
subb a,r7
mov a,(_packet_get_next_slen_1_164 + 1)
subb a,r6
jnc 00143$
; radio/packet.c:352: mav_pkt_start_time = timer2_tick();
lcall _timer2_tick
mov a,dpl
mov b,dph
mov r0,#_mav_pkt_start_time
movx @r0,a
inc r0
mov a,b
movx @r0,a
; radio/packet.c:353: mav_pkt_max_time = mav_pkt_len * serial_rate;
mov r0,#_mav_pkt_len
movx a,@r0
mov r6,a
mov r7,#0x00
mov r0,#_serial_rate
mov dptr,#__mulint_PARM_2
movx a,@r0
movx @dptr,a
inc r0
movx a,@r0
inc dptr
movx @dptr,a
mov dpl,r6
mov dph,r7
lcall __mulint
mov a,dpl
mov b,dph
mov r0,#_mav_pkt_max_time
movx @r0,a
inc r0
mov a,b
movx @r0,a
; radio/packet.c:354: return 0;
mov dpl,#0x00
ret
00143$:
; radio/packet.c:358: return mavlink_frame(max_xmit, buf);
mov r0,#_packet_get_next_PARM_2
mov r1,#_mavlink_frame_PARM_2
movx a,@r0
movx @r1,a
inc r0
movx a,@r0
inc r1
movx @r1,a
mov dpl,_packet_get_next_max_xmit_1_163
ljmp _mavlink_frame
00149$:
; radio/packet.c:361: last_sent[last_sent_len++] = serial_read();
mov r0,#_last_sent_len
movx a,@r0
mov r7,a
mov r0,#_last_sent_len
inc a
movx @r0,a
mov a,r7
add a,#_last_sent
mov r7,a
clr a
addc a,#(_last_sent >> 8)
mov r6,a
push ar7
push ar6
lcall _serial_read
mov r5,dpl
pop ar6
pop ar7
mov dpl,r7
mov dph,r6
mov a,r5
movx @dptr,a
; radio/packet.c:362: slen--;
dec _packet_get_next_slen_1_164
mov a,#0xFF
cjne a,_packet_get_next_slen_1_164,00267$
dec (_packet_get_next_slen_1_164 + 1)
00267$:
ljmp 00151$
00153$:
; radio/packet.c:366: memcpy(buf, last_sent, last_sent_len);
mov r0,#_packet_get_next_PARM_2
movx a,@r0
mov r5,a
inc r0
movx a,@r0
mov r6,a
mov r7,#0x00
mov dptr,#_memcpy_PARM_2
mov a,#_last_sent
movx @dptr,a
mov a,#(_last_sent >> 8)
inc dptr
movx @dptr,a
clr a
inc dptr
movx @dptr,a
mov r0,#_last_sent_len
mov dptr,#_memcpy_PARM_3
movx a,@r0
movx @dptr,a
clr a
inc dptr
movx @dptr,a
mov dpl,r5
mov dph,r6
mov b,r7
lcall _memcpy
; radio/packet.c:367: return last_sent_len;
mov r0,#_last_sent_len
movx a,@r0
mov dpl,a
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'packet_is_resend'
;------------------------------------------------------------
; radio/packet.c:373: packet_is_resend(void)
; -----------------------------------------
; function packet_is_resend
; -----------------------------------------
_packet_is_resend:
; radio/packet.c:375: return last_sent_is_resend;
mov c,_last_sent_is_resend
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'packet_is_injected'
;------------------------------------------------------------
; radio/packet.c:381: packet_is_injected(void)
; -----------------------------------------
; function packet_is_injected
; -----------------------------------------
_packet_is_injected:
; radio/packet.c:383: return last_sent_is_injected;
mov c,_last_sent_is_injected
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'packet_force_resend'
;------------------------------------------------------------
; radio/packet.c:388: packet_force_resend(void)
; -----------------------------------------
; function packet_force_resend
; -----------------------------------------
_packet_force_resend:
; radio/packet.c:390: force_resend = true;
setb _force_resend
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'packet_set_max_xmit'
;------------------------------------------------------------
;max Allocated with name '_packet_set_max_xmit_max_1_195'
;------------------------------------------------------------
; radio/packet.c:395: packet_set_max_xmit(uint8_t max)
; -----------------------------------------
; function packet_set_max_xmit
; -----------------------------------------
_packet_set_max_xmit:
mov a,dpl
mov dptr,#_packet_set_max_xmit_max_1_195
movx @dptr,a
; radio/packet.c:397: mav_max_xmit = max;
movx a,@dptr
mov r0,#_mav_max_xmit
movx @r0,a
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'packet_set_serial_speed'
;------------------------------------------------------------
;speed Allocated with name '_packet_set_serial_speed_speed_1_197'
;------------------------------------------------------------
; radio/packet.c:402: packet_set_serial_speed(uint16_t speed)
; -----------------------------------------
; function packet_set_serial_speed
; -----------------------------------------
_packet_set_serial_speed:
mov r7,dph
mov a,dpl
mov dptr,#_packet_set_serial_speed_speed_1_197
movx @dptr,a
mov a,r7
inc dptr
movx @dptr,a
; radio/packet.c:405: serial_rate = (65536UL / speed) + 1;
mov dptr,#_packet_set_serial_speed_speed_1_197
movx a,@dptr
mov r6,a
inc dptr
movx a,@dptr
mov r7,a
mov dptr,#__divulong_PARM_2
mov a,r6
movx @dptr,a
mov a,r7
inc dptr
movx @dptr,a
clr a
inc dptr
movx @dptr,a
inc dptr
movx @dptr,a
mov dptr,#0x0000
mov b,#0x01
clr a
lcall __divulong
mov r4,dpl
mov r5,dph
mov r6,b
mov r7,a
inc r4
cjne r4,#0x00,00103$
inc r5
cjne r5,#0x00,00103$
inc r6
cjne r6,#0x00,00103$
inc r7
00103$:
mov r0,#_serial_rate
mov a,r4
movx @r0,a
inc r0
mov a,r5
movx @r0,a
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'packet_is_duplicate'
;------------------------------------------------------------
;len Allocated with name '_packet_is_duplicate_len_1_199'
;------------------------------------------------------------
; radio/packet.c:410: packet_is_duplicate(uint8_t len, __xdata uint8_t * __pdata buf, bool is_resend)
; -----------------------------------------
; function packet_is_duplicate
; -----------------------------------------
_packet_is_duplicate:
mov a,dpl
mov dptr,#_packet_is_duplicate_len_1_199
movx @dptr,a
; radio/packet.c:412: if (!is_resend) {
jb _packet_is_duplicate_PARM_3,00102$
; radio/packet.c:413: memcpy(last_received, buf, len);
mov r0,#_packet_is_duplicate_PARM_2
movx a,@r0
mov r5,a
inc r0
movx a,@r0
mov r6,a
mov r7,#0x00
mov dptr,#_packet_is_duplicate_len_1_199
movx a,@dptr
mov r4,a
mov r2,a
mov r3,#0x00
mov dptr,#_memcpy_PARM_2
mov a,r5
movx @dptr,a
mov a,r6
inc dptr
movx @dptr,a
mov a,r7
inc dptr
movx @dptr,a
mov dptr,#_memcpy_PARM_3
mov a,r2
movx @dptr,a
mov a,r3
inc dptr
movx @dptr,a
mov dptr,#_last_received
mov b,#0x00
push ar4
lcall _memcpy
pop ar4
; radio/packet.c:414: last_recv_len = len;
mov r0,#_last_recv_len
mov a,r4
movx @r0,a
; radio/packet.c:415: last_recv_is_resend = false;
clr _last_recv_is_resend
; radio/packet.c:416: return false;
clr c
ret
00102$:
; radio/packet.c:420: memcmp(last_received, buf, len) == 0) {
jb _last_recv_is_resend,00104$
; radio/packet.c:419: len == last_recv_len &&
mov dptr,#_packet_is_duplicate_len_1_199
movx a,@dptr
mov r7,a
mov r0,#_last_recv_len
movx a,@r0
cjne a,ar7,00104$
; radio/packet.c:420: memcmp(last_received, buf, len) == 0) {
mov r0,#_packet_is_duplicate_PARM_2
mov dptr,#_memcmp_PARM_2
movx a,@r0
movx @dptr,a
inc r0
movx a,@r0
inc dptr
movx @dptr,a
clr a
inc dptr
movx @dptr,a
mov dptr,#_memcmp_PARM_3
mov a,r7
movx @dptr,a
clr a
inc dptr
movx @dptr,a
mov dptr,#_last_received
mov b,#0x00
lcall _memcmp
mov a,dpl
mov b,dph
orl a,b
jnz 00104$
; radio/packet.c:421: last_recv_is_resend = false;
clr _last_recv_is_resend
; radio/packet.c:422: return true;
setb c
ret
00104$:
; radio/packet.c:430: last_recv_is_resend = true;
setb _last_recv_is_resend
; radio/packet.c:431: return false;
clr c
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'packet_ati5_inject'
;------------------------------------------------------------
; radio/packet.c:436: packet_ati5_inject(__pdata uint8_t ati5_id)
; -----------------------------------------
; function packet_ati5_inject
; -----------------------------------------
_packet_ati5_inject:
mov r7,dpl
; radio/packet.c:438: if (ati5_id < PARAM_MAX) {
cjne r7,#0x13,00113$
00113$:
jnc 00105$
; radio/packet.c:439: printf_start_capture(last_sent, sizeof(last_sent));
mov dptr,#_printf_start_capture_PARM_2
mov a,#0xFC
movx @dptr,a
mov dptr,#_last_sent
push ar7
lcall _printf_start_capture
pop ar7
; radio/packet.c:440: param_print(ati5_id);
mov dpl,r7
lcall _param_print
; radio/packet.c:441: last_sent_len = printf_end_capture();
lcall _printf_end_capture
mov r7,dpl
mov r0,#_last_sent_len
mov a,r7
movx @r0,a
; radio/packet.c:443: if(last_sent_len>0)
mov a,r7
jz 00105$
; radio/packet.c:445: last_sent_is_resend = false;
clr _last_sent_is_resend
; radio/packet.c:446: injected_packet = true;
setb _injected_packet
00105$:
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'packet_at_inject'
;------------------------------------------------------------
; radio/packet.c:458: packet_at_inject(void)
; -----------------------------------------
; function packet_at_inject
; -----------------------------------------
_packet_at_inject:
; radio/packet.c:460: at_cmd_ready = true;
setb _at_cmd_ready
; radio/packet.c:461: printf_start_capture(last_sent, sizeof(last_sent));
mov dptr,#_printf_start_capture_PARM_2
mov a,#0xFC
movx @dptr,a
mov dptr,#_last_sent
lcall _printf_start_capture
; radio/packet.c:462: at_command();
lcall _at_command
; radio/packet.c:463: last_sent_len = printf_end_capture();
lcall _printf_end_capture
mov r7,dpl
mov r0,#_last_sent_len
mov a,r7
movx @r0,a
; radio/packet.c:465: if (last_sent_len > 0)
mov a,r7
jz 00103$
; radio/packet.c:467: last_sent_is_resend = false;
clr _last_sent_is_resend
; radio/packet.c:468: injected_packet = true;
setb _injected_packet
00103$:
ret
;------------------------------------------------------------
;Allocation info for local variables in function 'packet_inject'
;------------------------------------------------------------
; radio/packet.c:474: packet_inject(__xdata uint8_t * __pdata buf, __pdata uint8_t len)
; -----------------------------------------
; function packet_inject
; -----------------------------------------
_packet_inject:
mov r6,dpl
mov r7,dph
; radio/packet.c:476: if (len > sizeof(last_sent)) {
mov r0,#_packet_inject_PARM_2
clr c
movx a,@r0
mov b,a
mov a,#0xFC
subb a,b
jnc 00102$
; radio/packet.c:477: len = sizeof(last_sent);
mov r0,#_packet_inject_PARM_2
mov a,#0xFC
movx @r0,a
00102$:
; radio/packet.c:479: memcpy(last_sent, buf, len);
mov dptr,#_memcpy_PARM_2
mov a,r6
movx @dptr,a
mov a,r7
inc dptr
movx @dptr,a
clr a
inc dptr
movx @dptr,a
mov r0,#_packet_inject_PARM_2
mov dptr,#_memcpy_PARM_3
movx a,@r0
movx @dptr,a
clr a
inc dptr
movx @dptr,a
mov dptr,#_last_sent
mov b,#0x00
lcall _memcpy
; radio/packet.c:480: last_sent_len = len;
mov r0,#_packet_inject_PARM_2
movx a,@r0
mov r0,#_last_sent_len
movx @r0,a
; radio/packet.c:481: last_sent_is_resend = false;
clr _last_sent_is_resend
; radio/packet.c:482: injected_packet = true;
setb _injected_packet
ret
.area CSEG (CODE)
.area CONST (CODE)
.area XINIT (CODE)
.area CABS (ABS,CODE)
| 21.072735 | 140 | 0.660297 |
455cd03105c6060df4c3e0e69fce5835d68a3e8b | 403 | asm | Assembly | libsrc/_DEVELOPMENT/l/sccz80/9-common/l_gint_eq.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/l/sccz80/9-common/l_gint_eq.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/l/sccz80/9-common/l_gint_eq.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ; Z88 Small C+ Run time Library
; Moved functions over to proper libdefs
; To make startup code smaller and neater!
;
; 6/9/98 djm
;
; 13/5/99 djm Optimizer routine to test against zero
; Returns z=0 nz otherwise as well as the int in hl
SECTION code_clib
SECTION code_l_sccz80
PUBLIC l_gint_eq
l_gint_eq:
ld a,(hl+)
ld h,(hl)
ld l,a
or h
ret
| 17.521739 | 58 | 0.632754 |
ed8be34e7a39388eee3db63b6ced9a511424eec8 | 538 | asm | Assembly | oeis/271/A271055.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/271/A271055.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/271/A271055.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A271055: Number of active (ON,black) cells at stage 2^n-1 of the two-dimensional cellular automaton defined by "Rule 259", based on the 5-celled von Neumann neighborhood.
; Submitted by Jon Maiga
; 1,5,36,212,948,3956,16116,65012,261108,1046516,4190196,16769012,67092468,268402676,1073676276,4294836212
seq $0,273385 ; Number of active (ON,black) cells at stage 2^n-1 of the two-dimensional cellular automaton defined by "Rule 659", based on the 5-celled von Neumann neighborhood.
mov $2,$0
lpb $0
mod $0,8
sub $2,13
lpe
mov $0,$2
| 44.833333 | 177 | 0.756506 |
d47cdde195827aa5d39ad304a3157968d72eb179 | 106 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_iy/scalbln.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_iy/scalbln.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/math/float/math48/lm/c/sdcc_iy/scalbln.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
SECTION code_fp_math48
PUBLIC _scalbln
EXTERN cm48_sdcciy_scalbln
defc _scalbln = cm48_sdcciy_scalbln
| 11.777778 | 35 | 0.858491 |
98ea49bdfdeab5388fb54a1124809b3670c2c97e | 706 | asm | Assembly | src/link_to_cpp/LinkToCpp.asm | AaronWharton/custom-process | 5a2b78a869e30883bdd0d586d611849786f1dc35 | [
"Apache-2.0"
] | null | null | null | src/link_to_cpp/LinkToCpp.asm | AaronWharton/custom-process | 5a2b78a869e30883bdd0d586d611849786f1dc35 | [
"Apache-2.0"
] | null | null | null | src/link_to_cpp/LinkToCpp.asm | AaronWharton/custom-process | 5a2b78a869e30883bdd0d586d611849786f1dc35 | [
"Apache-2.0"
] | null | null | null | ; assembly process (LinkToCpp.asm)
.586
.model flat,stdcall ; .model flat,C is also OK.
; C++ functions
displayMessage PROTO C
displayResult PROTO C, value:DWORD
LOOP_TIME = 10 ; loop time
.data
intVal DWORD ? ; get the value and save the result
.code
;--------------------------------------------------------------------------
SendMessage PROC C
;
; Input a number and display a multiplication table.
;--------------------------------------------------------------------------
INVOKE displayMessage
mov intVal,eax
mov ecx,LOOP_TIME
L1: push ecx
shl intVal,1 ; shift operation,equals *2
INVOKE displayResult,intVal
pop ecx
loop L1
ret
SendMessage ENDP
END | 21.393939 | 75 | 0.553824 |
0b821ed3cdd1d784eccfa9e5b2eb4bcb2cb211b5 | 586 | asm | Assembly | oeis/254/A254474.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/254/A254474.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/254/A254474.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A254474: 30-gonal numbers: a(n) = n*(14*n-13).
; 0,1,30,87,172,285,426,595,792,1017,1270,1551,1860,2197,2562,2955,3376,3825,4302,4807,5340,5901,6490,7107,7752,8425,9126,9855,10612,11397,12210,13051,13920,14817,15742,16695,17676,18685,19722,20787,21880,23001,24150,25327,26532,27765,29026,30315,31632,32977,34350,35751,37180,38637,40122,41635,43176,44745,46342,47967,49620,51301,53010,54747,56512,58305,60126,61975,63852,65757,67690,69651,71640,73657,75702,77775,79876,82005,84162,86347,88560,90801,93070,95367,97692,100045,102426,104835,107272
mov $1,$0
bin $1,2
mul $1,28
add $0,$1
| 73.25 | 496 | 0.778157 |
80f55a0898060941637357fcdedeb41cc8ff4eeb | 704 | asm | Assembly | oeis/293/A293641.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/293/A293641.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/293/A293641.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A293641: a(n) is the integer k that minimizes |k/Fibonacci(n) - 2/5|.
; Submitted by Jamie Morken(m1)
; 0,0,0,1,1,2,3,5,8,14,22,36,58,93,151,244,395,639,1034,1672,2706,4378,7084,11463,18547,30010,48557,78567,127124,205692,332816,538508,871324,1409831,2281155,3690986,5972141,9663127,15635268,25298394,40933662,66232056,107165718,173397775,280563493,453961268,734524761,1188486029,1923010790,3111496820,5034507610,8146004430,13180512040,21326516469,34507028509,55833544978,90340573487,146174118465,236514691952,382688810416,619203502368,1001892312784,1621095815152,2622988127937,4244083943089
seq $0,45 ; Fibonacci numbers: F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1.
mul $0,2
add $0,2
div $0,5
| 78.222222 | 489 | 0.785511 |
e113183f098e68342110fd7267b85bc8d892cef7 | 352 | asm | Assembly | programs/oeis/137/A137512.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/137/A137512.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/137/A137512.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A137512: The number of nodes visible from underneath a binary tree, where the nodes are placed such that the innermost of the two sprouting nodes should be underneath the mother.
; 1,1,2,3,3,3,4,5,5,6,6,6,7,7,8,9,9,10,10,11,11,12,12,12,13,13,14,14,15,15,16
mov $2,$0
add $0,4
lpb $2
div $2,2
mov $1,$2
trn $2,1
lpe
add $0,$1
div $0,2
sub $0,1
| 25.142857 | 180 | 0.676136 |
b8d6dd4864ed3feb50adb4cb0f14c5a97ba2443f | 1,169 | asm | Assembly | x86/src/32/indexed-32.asm | sneakin/north | bff0fdaa6d4641c54c4dc9942948e2edd34f2251 | [
"Linux-OpenIB"
] | 2 | 2019-02-25T19:20:26.000Z | 2019-05-11T00:32:01.000Z | x86/src/32/indexed-32.asm | sneakin/north | bff0fdaa6d4641c54c4dc9942948e2edd34f2251 | [
"Linux-OpenIB"
] | null | null | null | x86/src/32/indexed-32.asm | sneakin/north | bff0fdaa6d4641c54c4dc9942948e2edd34f2251 | [
"Linux-OpenIB"
] | null | null | null | bits 32
defop index->pointer,index_to_pointer
mov eax, [esp+ptrsize]
and eax, [d_index_mask+dict_entry_data]
call [d_dict_offset_a+dict_entry_code]
mov [esp+ptrsize], eax
ret
defop literal_indexed
mov eax, [eval_ip]
and eax, [d_index_mask+dict_entry_data]
call [d_dict_offset_a+dict_entry_code]
add eval_ip, [d_index_size+dict_entry_data]
pop ebx
push eax
push ebx
ret
defop eval_index ; the ToS
pop ebx
pop eax
push ebx
jmp [d_doop_index+dict_entry_code]
defop eval_ptr_index
pop ebx
pop eax
push ebx
jmp [d_doop_ptr_index+dict_entry_code]
defop doop_ptr_index
push eval_ip
mov eval_ip, eax
jmp [d_next_index+dict_entry_code]
defop doop_index ; the entry in eax
push eval_ip
mov eval_ip, [eax+dict_entry_data]
jmp [d_next_index+dict_entry_code]
defop next_index
mov eax, [eval_ip]
and eax, [d_index_mask+dict_entry_data]
add eval_ip, [d_index_size+dict_entry_data]
call [d_dict_offset_a+dict_entry_code]
call [eax+dict_entry_code]
jmp [d_next_index+dict_entry_code]
%macro defi 1
create %1, doop_index_asm, %1_ops
section .rdata_forth
%1_ops:
%endmacro
constant index_size,4
constant index_mask,0xFFFFFFFF
| 20.155172 | 44 | 0.779299 |
616b4269800d9abd0120ed774f9db6bad9ba8543 | 428 | asm | Assembly | oeis/329/A329754.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/329/A329754.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/329/A329754.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A329754: Doubly pentagonal pyramidal numbers.
; Submitted by Jon Maiga
; 0,1,126,3078,32800,213750,1008126,3783976,11985408,33297075,83338750,191592126,410450976,828497488,1589341950,2917620000,5154021376,8801526501,14585352318,23529456550,37052820000,57089119626,86233820926,127923156648,186649920000,268221484375,380065968126
mov $1,$0
add $0,1
pow $1,2
mul $1,$0
mov $0,$1
add $1,2
mul $1,$0
mul $1,$0
mov $0,$1
div $0,16
| 28.533333 | 256 | 0.787383 |
4ceb0e37235ac8c6cd0d190e0f7cdca4be3ae57c | 2,628 | asm | Assembly | libsrc/stdio_new/file/stream-out/stdio_out_ld.asm | andydansby/z88dk-mk2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | 1 | 2020-09-15T08:35:49.000Z | 2020-09-15T08:35:49.000Z | libsrc/stdio_new/file/stream-out/stdio_out_ld.asm | andydansby/z88dk-MK2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | null | null | null | libsrc/stdio_new/file/stream-out/stdio_out_ld.asm | andydansby/z88dk-MK2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | null | null | null | ; stdio_out_ld
; 05.2008 aralbrec
XLIB stdio_out_ld
LIB stdio_longnumprec, stdio_outcommon, stdio_nextarg
LIB l_int2long_s, l_long_neg
XREF LIBDISP_STDIO_OUTCOMMON_SIGNED
INCLUDE "../../stdio.def"
; output %ld parameter, handles both 16-bit %d and 32-bit %ld
;
; enter : ix = FILE *
; a = precision (default 1)
; b = width (default 0)
; c = flags [-+ O#PLN]
; de = 16-bit parameter (most significant word if long)
; hl = & parameter list
; bc' = total num chars output on stream thus far
; carry flag reset (important for %x, %lx)
; stack = output buffer, ptr in format string, ret
; on exit : bc' = total num chars output on stream thus far
; hl = & parameter list
; carry set if error on stream, ERRNO set appropriately
; uses : af, bc, de, hl, exx, bc'
.stdio_out_ld
bit 1,c ; check if %ld or %d
jr nz, long
push hl ; save & parameter list
push af ; save precision
ex de,hl ; only doing integer so form long in dehl
call l_int2long_s ; sign extend hl into dehl
jr checksign
.long
push de ; save most sig 16-bits
call stdio_nextarg ; get next 16-bit word from parameter list
ex (sp),hl ; save & parameter list
ex de,hl ; dehl = long
push af ; save precision
.checksign
bit 0,c
call nz, l_long_neg ; get magnitude if negative
pop af
; a = precision
; b = width
; c = flags [-+ O#PLN]
; dehl = unsigned integer
push ix ; save output function
push bc ; save width and flags
ld bc,10 ; num chars in buffer = 0, radix = 10
ld ix,STDIO_TEMPBUFSIZE + 9
add ix,sp ; ix = & last char in temporary buffer
call stdio_longnumprec ; write number to buffer including precision digits
pop hl
ld e,ixl
ld d,ixh
ex de,hl
pop ix
; b = num chars written to buffer
; d = width
; e = flags [-+ O#PLN]
; hl = & next free position in destination buffer
inc b ; no digits written to buffer means precision and integer == 0
djnz adjwidth
ld e,0 ; in this case clear sign and zero-pad flags so they aren't printed too
.adjwidth
call stdio_outcommon + LIBDISP_STDIO_OUTCOMMON_SIGNED
pop hl ; hl = & parameter list
ret
| 30.206897 | 102 | 0.548326 |
046c2e6d10fc81cdb5b34224aa60c1e5154e70cd | 2,579 | asm | Assembly | base/crts/crtw32/string/i386/strrchr.asm | npocmaka/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 17 | 2020-11-13T13:42:52.000Z | 2021-09-16T09:13:13.000Z | base/crts/crtw32/string/i386/strrchr.asm | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 2 | 2020-10-19T08:02:06.000Z | 2020-10-19T08:23:18.000Z | base/crts/crtw32/string/i386/strrchr.asm | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 14 | 2020-11-14T09:43:20.000Z | 2021-08-28T08:59:57.000Z | page ,132
title strrchr - find last occurence of character in string
;***
;strrchr.asm - find last occurrence of character in string
;
; Copyright (c) 1985-2001, Microsoft Corporation. All rights reserved.
;
;Purpose:
; defines strrchr() - find the last occurrence of a given character
; in a string.
;
;Revision History:
; 10-27-83 RN initial version
; 05-18-88 SJM Add model-independent (large model) ifdef
; 08-04-88 SJM convert to cruntime/ add 32-bit support
; 08-23-88 JCR 386 cleanup
; 10-26-88 JCR General cleanup for 386-only code
; 03-26-90 GJF Changed to _stdcall. Also, fixed the copyright.
; 05-10-91 GJF Back to _cdecl, sigh...
; 06-12-01 PML inc->add 1, dec->sub 1 for Pentium 4 perf (vs7#267015)
;
;*******************************************************************************
.xlist
include cruntime.inc
.list
page
;***
;char *strrchr(string, ch) - find last occurrence of ch in string
;
;Purpose:
; Finds the last occurrence of ch in string. The terminating
; null character is used as part of the search.
;
; Algorithm:
; char *
; strrchr (string, ch)
; char *string, ch;
; {
; char *start = string;
;
; while (*string++)
; ;
; while (--string != start && *string != ch)
; ;
; if (*string == ch)
; return(string);
; return(NULL);
; }
;
;Entry:
; char *string - string to search in
; char ch - character to search for
;
;Exit:
; returns a pointer to the last occurrence of ch in the given
; string
; returns NULL if ch does not occurr in the string
;
;Uses:
;
;Exceptions:
;
;*******************************************************************************
CODESEG
public strrchr
strrchr proc \
uses edi, \
string:ptr byte, \
chr:byte
mov edi,[string] ; di = string
xor eax,eax ; al=null byte
or ecx,-1 ; cx = -1
repne scasb ; find the null & count bytes
add ecx,1 ; cx=-byte count (with null)
neg ecx ; cx=+byte count (with null)
sub edi,1 ; di points to terminal null
mov al,chr ; al=search byte
std ; count 'down' on string this time
repne scasb ; find that byte
add edi,1 ; di points to byte which stopped scan
cmp [edi],al ; see if we have a hit
je short returndi ; yes, point to byte
xor eax,eax ; no, return NULL
jmp short toend ; do return sequence
returndi:
mov eax,edi ; ax=pointer to byte
toend:
cld
ifdef _STDCALL_
ret DPSIZE + ISIZE ; _stdcall return
else
ret ; _cdecl return
endif
strrchr endp
end
| 24.102804 | 81 | 0.592478 |
07c77f0f75267b7c608639aff263541cb22928f8 | 607 | asm | Assembly | programs/oeis/040/A040670.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/040/A040670.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/040/A040670.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A040670: Continued fraction for sqrt(697).
; 26,2,2,52,2,2,52,2,2,52,2,2,52,2,2,52,2,2,52,2,2,52,2,2,52,2,2,52,2,2,52,2,2,52,2,2,52,2,2,52,2,2,52,2,2,52,2,2,52,2,2,52,2,2,52,2,2,52,2,2,52,2,2,52,2,2,52,2,2,52,2,2,52,2,2,52,2,2,52,2,2
mov $9,$0
mov $11,2
lpb $11
clr $0,9
mov $0,$9
sub $11,1
add $0,$11
sub $0,1
add $8,3
div $0,$8
lpb $0
mov $4,$0
mov $0,0
add $8,6
mov $3,$8
mul $3,2
add $3,7
mul $3,$4
lpe
add $3,12
mov $1,$3
mov $12,$11
lpb $12
mov $10,$1
sub $12,1
lpe
lpe
lpb $9
mov $9,0
sub $10,$1
lpe
mov $1,$10
mul $1,2
add $1,2
| 15.973684 | 190 | 0.514003 |
d13ab09fcf0217ca54a575e6a311b31eee1babd5 | 744 | asm | Assembly | oeis/041/A041867.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/041/A041867.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/041/A041867.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A041867: Denominators of continued fraction convergents to sqrt(455).
; Submitted by Christian Krause
; 1,3,127,384,16255,49149,2080513,6290688,266289409,805158915,34082963839,103054050432,4362353081983,13190113296381,558347111529985,1688231447886336,71464067922756097,216080435216154627,9146842347001250431,27656607476219905920,1170724356348237299071,3539829676520931803133,149843570770227373030657,453070541987203050895104,19178806334232755510625025,57989489544685469582770179,2454737367211022477986972543,7422201591177752903543687808,314187204196676644426821860479,949983814181207686184009269245
add $0,1
mov $3,1
lpb $0
sub $0,1
add $2,$3
mov $3,$1
mov $1,$2
dif $2,7
mul $2,21
dif $2,2
add $3,$2
lpe
mov $0,$2
div $0,21
| 39.157895 | 496 | 0.830645 |
ae2e638d81d937ae5445665f581921da2d8b5f04 | 5,859 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0xca.log_21829_1450.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0xca.log_21829_1450.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0xca.log_21829_1450.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r9
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_D_ht+0x1bfa9, %rcx
nop
nop
dec %rdx
mov $0x6162636465666768, %r9
movq %r9, (%rcx)
nop
nop
nop
xor $23896, %r9
lea addresses_D_ht+0x1d53, %r11
nop
nop
nop
nop
cmp $3933, %rsi
movl $0x61626364, (%r11)
nop
xor $9803, %r10
lea addresses_UC_ht+0x29a9, %rcx
nop
sub %rbx, %rbx
movb $0x61, (%rcx)
nop
nop
nop
nop
nop
add %r10, %r10
lea addresses_D_ht+0x5289, %rdx
nop
nop
inc %r10
movb $0x61, (%rdx)
nop
nop
nop
inc %r10
lea addresses_UC_ht+0x4169, %rsi
lea addresses_normal_ht+0x1bfc9, %rdi
nop
nop
nop
nop
nop
add $62870, %r11
mov $74, %rcx
rep movsb
nop
nop
nop
add $18782, %r10
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r14
push %r8
push %rbx
push %rcx
push %rdx
// Store
lea addresses_PSE+0x28a9, %rbx
nop
nop
nop
nop
nop
add %rdx, %rdx
mov $0x5152535455565758, %r14
movq %r14, (%rbx)
nop
nop
nop
cmp $40455, %r13
// Store
lea addresses_A+0xeda9, %rcx
inc %r11
mov $0x5152535455565758, %r13
movq %r13, (%rcx)
nop
nop
nop
nop
sub $27451, %r13
// Store
lea addresses_WC+0x10c9d, %r14
nop
nop
nop
inc %r13
movb $0x51, (%r14)
nop
nop
nop
nop
cmp $28407, %r14
// Faulty Load
lea addresses_WC+0xf1a9, %r13
nop
nop
add $14727, %r8
mov (%r13), %ebx
lea oracles, %rcx
and $0xff, %rbx
shlq $12, %rbx
mov (%rcx,%rbx,1), %rbx
pop %rdx
pop %rcx
pop %rbx
pop %r8
pop %r14
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WC'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_PSE'}}
{'OP': 'STOR', 'dst': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_A'}}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WC'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': True, 'same': True, 'size': 4, 'NT': False, 'type': 'addresses_WC'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_D_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_D_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_UC_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 5, 'AVXalign': False, 'same': True, 'size': 1, 'NT': False, 'type': 'addresses_D_ht'}}
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 5, 'same': False, 'type': 'addresses_normal_ht'}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 36.849057 | 2,999 | 0.657279 |
2e75a351f0c3f4d2963b1290d935243fc1c68b90 | 347 | asm | Assembly | programs/oeis/122/A122769.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/122/A122769.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/122/A122769.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A122769: Numbers k such that k^2 is of the form 3*m^2 + 2*m + 1 (A056109).
; 1,11,153,2131,29681,413403,5757961,80198051,1117014753,15558008491,216695104121,3018173449203,42037733184721,585510091136891,8155103542731753,113585939507107651,1582048049556775361
mul $0,2
mov $1,1
lpb $0
sub $0,1
add $2,$1
add $2,$1
add $1,$2
lpe
mov $0,$1
| 26.692308 | 182 | 0.73487 |
099997cca4971c460880a35deaad74fa5bbe6067 | 1,972 | asm | Assembly | programs/oeis/304/A304830.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/304/A304830.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/304/A304830.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A304830: a(n) = 102*2^n - 108 (n>=1).
; 96,300,708,1524,3156,6420,12948,26004,52116,104340,208788,417684,835476,1671060,3342228,6684564,13369236,26738580,53477268,106954644,213909396,427818900,855637908,1711275924,3422551956,6845104020,13690208148,27380416404,54760832916,109521665940,219043331988,438086664084,876173328276,1752346656660,3504693313428,7009386626964,14018773254036,28037546508180,56075093016468,112150186033044,224300372066196,448600744132500,897201488265108,1794402976530324,3588805953060756,7177611906121620,14355223812243348,28710447624486804,57420895248973716,114841790497947540,229683580995895188,459367161991790484,918734323983581076,1837468647967162260,3674937295934324628,7349874591868649364,14699749183737298836,29399498367474597780,58798996734949195668,117597993469898391444,235195986939796782996,470391973879593566100,940783947759187132308,1881567895518374264724,3763135791036748529556,7526271582073497059220,15052543164146994118548,30105086328293988237204,60210172656587976474516,120420345313175952949140,240840690626351905898388,481681381252703811796884,963362762505407623593876,1926725525010815247187860,3853451050021630494375828,7706902100043260988751764,15413804200086521977503636,30827608400173043955007380,61655216800346087910014868,123310433600692175820029844,246620867201384351640059796,493241734402768703280119700,986483468805537406560239508,1972966937611074813120479124,3945933875222149626240958356,7891867750444299252481916820,15783735500888598504963833748,31567471001777197009927667604,63134942003554394019855335316,126269884007108788039710670740,252539768014217576079421341588,505079536028435152158842683284,1010159072056870304317685366676,2020318144113740608635370733460,4040636288227481217270741467028,8081272576454962434541482934164,16162545152909924869082965868436,32325090305819849738165931736980,64650180611639699476331863474068,129300361223279398952663726948244
mov $1,2
pow $1,$0
sub $1,1
mul $1,204
add $1,96
mov $0,$1
| 197.2 | 1,871 | 0.923935 |
cae5db087d6f8ebc613508335ae093aa91eee17c | 505 | asm | Assembly | SMP_ATTR.asm | CodexLink/8086_ASM_DOSBOX_Examples | 215436099ccce5ee22206efc51af5ec37513a4a2 | [
"MIT"
] | null | null | null | SMP_ATTR.asm | CodexLink/8086_ASM_DOSBOX_Examples | 215436099ccce5ee22206efc51af5ec37513a4a2 | [
"MIT"
] | 1 | 2022-01-20T09:48:07.000Z | 2022-01-20T09:48:07.000Z | SMP_ATTR.asm | CodexLink/8086_ASM_DOSBOX_Examples | 215436099ccce5ee22206efc51af5ec37513a4a2 | [
"MIT"
] | 1 | 2021-08-17T05:40:03.000Z | 2021-08-17T05:40:03.000Z | ; Sample of Screen Attribute Modification — SMP_ATTR.asm
; Copyright (c) 2021 Janrey Licas
; This code is licensed under MIT license. (see LICENSE for details)
.MODEL TINY
.CODE
MOV AH, 09H ; Set to screen attribute mode.
MOV BX, 00B4H ; Set the background and foreground color and blink state to ON.
MOV AL, 'A' ; Character to output in iteration.
MOV CX, 05H ; Set # of Iteration to output the character.
INT 10H ; Execute it.
MOV AH, 4CH ; Syscall to Termination.
INT 21H ; Execute it.
END | 36.071429 | 79 | 0.726733 |
fa9d4105a7a78d49b4b9929ce88611f7ef7733fa | 321 | asm | Assembly | programs/oeis/096/A096944.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/096/A096944.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/096/A096944.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A096944: Seventh column of (1,5)-Pascal triangle A096940.
; 5,31,112,308,714,1470,2772,4884,8151,13013,20020,29848,43316,61404,85272,116280,156009,206283,269192,347116,442750,559130,699660,868140,1068795,1306305,1585836,1913072,2294248,2736184,3246320,3832752
mov $1,$0
add $0,5
bin $0,$1
add $1,30
mul $0,$1
div $0,6
| 32.1 | 201 | 0.760125 |
db9a1576ff2fc98de802c2aa1b570950f379ee44 | 260 | asm | Assembly | nand2tetris/personal/signum.asm | raventid/coursera_learning | 115a03f08d30d8ba49f02c9692c289cbfb242358 | [
"MIT"
] | 1 | 2019-11-28T09:26:00.000Z | 2019-11-28T09:26:00.000Z | nand2tetris/personal/signum.asm | raventid/coursera_learning | 115a03f08d30d8ba49f02c9692c289cbfb242358 | [
"MIT"
] | null | null | null | nand2tetris/personal/signum.asm | raventid/coursera_learning | 115a03f08d30d8ba49f02c9692c289cbfb242358 | [
"MIT"
] | null | null | null | // Program: Signum.asm
// Computes: if R0 > 0
// R1 = 1
// else
// R1 = 0
// TODO: I need to check instructions numbers. Not sure about do we count @ labels or not.
@R0
D=M
@8
D;JGT
@R1
M=0
@10
0;JMP
@R1
M=1
@10
0;JMP
| 10.4 | 90 | 0.519231 |
31d9515031ab4b05009272caf392ced7d21f3e05 | 19,168 | asm | Assembly | sprite/sprite.asm | avik-das/nesdev | 4de6dbe471a65d2de919b8e992ad029c25935939 | [
"BSD-3-Clause"
] | 4 | 2020-04-11T13:50:28.000Z | 2020-10-19T09:55:53.000Z | sprite/sprite.asm | avik-das/nesdev | 4de6dbe471a65d2de919b8e992ad029c25935939 | [
"BSD-3-Clause"
] | null | null | null | sprite/sprite.asm | avik-das/nesdev | 4de6dbe471a65d2de919b8e992ad029c25935939 | [
"BSD-3-Clause"
] | null | null | null | ; bg-ophis.asm - Avik Das
;
; A very simple demo, based on the NES101 tutorial by Michael Martin.
; This demo can be assembled using Ophis, and runs on FCEUX.
;
; This demo serves two purposes. Firstly, my goal is to learn NES
; development, which I can only achieve by creating a program.
; Secondly, the entirety of the program will be in one file, in order
; to show at a glance all the different parts of the program.
; iNES header
; iNES identifier
.byte "NES",$1A
.byte $01 ; 1 PRG-ROM page
.byte $01 ; 1 CHR-ROM page
.byte $00, $00 ; horizontal mirroring, mapper #0
.byte $00,$00,$00,$00,$00,$00,$00,$00 ; reserved/filler
; PRG-ROM
.alias sprite $200 ; use page 2 for sprite data
.alias player sprite ; the first sprite is the player
.text zp ; zero page
.org $0000
.space ab 1 ; whether the A button was pressed before
.space bb 1 ; whether the B button was pressed before
.space sel 1 ; whether the B button was pressed before
.space snd 1 ; whether a low or a high note should be played
.space ani 1 ; the current frame of the animation
.space temp 1 ; a temporary variable in an undefined state
; Actual program code. We only have one PRG-ROM chip here, so the
; origin is $C000.
.text
.org $C000
reset:
sei ; disable interrupts
cld ; ensure binary mode
; wait two VBlanks
* lda $2002
bpl -
* lda $2002
bpl -
; clear out the RAM
lda #$00
ldx #$00
* sta $000,x
sta $100,x
sta $200,x
sta $300,x
sta $400,x
sta $500,x
sta $600,x
sta $700,x
inx
bne -
; reset the stack pointer
ldx #$FF
txs
lda #$00
sta $2000
sta $2001
jsr init_graphics
jsr init_sound
jsr init_variables
; set PPU registers
lda #%10001000 ; enable NMI on VBlank
; 8x8 sprites
; background pattern table at $0000
; sprite pattern table at $1000
; name table at $2000
sta $2000
lda #%00011110 ; unmodified color intensity
; sprites and backgrounds visible
; sprites and backgrounds not clipped
; color display
sta $2001
cli ; enable interrupts
loop: jmp loop ; transfer control to VBlank routines
init_graphics:
jsr init_sprites
jsr load_palette
jsr load_name_tables
rts
init_sprites:
; Clear page 2, used to hold sprite data. If we zeroed out this page,
; all the unused sprites would end up in the upper left corner of the
; screen. To prevent that, we make sure the Y coordinate of all the
; unused sprites are set to $FF, which puts them off screen. For
; simplicity, all the data on this page is set to $FF, then
; overwritten for the sprites we want to use.
lda #$FF
ldx #$00
* sta sprite,x
inx
bne -
; initialize sprite 0
lda #$70
sta player ; Y coordinate
lda #$00
sta player+1 ; tile index
sta player+2 ; no flip, in front, first palette
sta player+3 ; X coordinate
; initialize sprite 1
lda #$70
sta player+4 ; Y coordinate
lda #$01
sta player+5 ; tile index
lda #$00
sta player+6 ; no flip, in front, first palette
lda #$08
sta player+7 ; X coordinate
; initialize sprite 2
lda #$78
sta player+8 ; Y coordinate
lda #$02
sta player+9 ; tile index
lda #$01
sta player+10 ; no flip, in front, second palette
lda #$00
sta player+11 ; X coordinate
; initialize sprite 3
lda #$78
sta player+12 ; Y coordinate
lda #$03
sta player+13 ; tile index
lda #$01
sta player+14 ; no flip, in front, second palette
lda #$08
sta player+15 ; X coordinate
rts
load_palette:
lda #$3F ; write the address $3F00 to PPU address port
sta $2006 ; write the high byte
lda #$00
sta $2006 ; write the low byte
ldx #$00
* lda palette, x ; load data from address (palette_data + x)
sta $2007 ; write data to PPU
inx
cpx #$20 ; loop if x != $20
bne -
rts
load_name_tables:
; load 1KB of data into the first name table
; $2000 and $2400 mirrored, so we can fill $2400 and $2800
ldy #$00
ldx #$04
lda #<bg
sta $10
lda #>bg
sta $11
lda #$24
sta $2006
lda #$00
sta $2006
* lda ($10),y
sta $2007
iny
bne -
inc $11
dex
bne -
; clear out $2800
; we're already at $2800
ldy #$00
ldx #$04
lda #$00
* sta $2007
iny
bne -
dex
bne -
rts
init_sound:
lda #%00000011 ; length ctr not enabled
; no delta modulation
; no noise
; no triangle
; yes pulse #2
; yes pulse #1
sta $4015
lda #0 ; sweep not enabled
; period = 0
; not negative
; no shift
sta $4001
sta $4005
lda #%01000000 ; 4-frame cycle
; disable frame interrupt
sta $4017
rts
init_variables:
lda #0
sta ab
sta bb
sta sel
sta snd
sta ani
rts
react_to_input:
.scope
; reset joypads
lda #$01
ldx #$00
sta $4016
stx $4016
lda $4016 ; don't ignore A
and #1
beq _not_a
lda ab
and #1
bne + ; don't switch colors if A was pressed before
lda #1
sta ab ; A is now pressed
lda player+2 ; sprite attributes
and #%11 ; isolate palette portion
clc
adc #2 ; switch to next palette (2 palettes were used)
and #%11 ; cycle back to 0th palette if necessary
sta temp ; store new palette portion
; All four sprites need to be changed
; TODO: refactor
lda player+2 ; sprite attributes
and #%11111100 ; remove palette portion
ora temp ; store new palette portion
sta player+2 ; update sprite
lda player+6 ; sprite attributes
and #%11111100 ; remove palette portion
ora temp ; store new palette portion
sta player+6 ; update sprite
lda temp
sec
sbc #1
and #%1
pha
lda temp
and #%10
sta temp
pla
ora temp
sta temp
lda player+10 ; sprite attributes
and #%11111100 ; remove palette portion
ora temp ; store new palette portion
sta player+10 ; update sprite
lda player+14 ; sprite attributes
and #%11111100 ; remove palette portion
ora temp ; store new palette portion
sta player+14 ; update sprite
jmp +
_not_a:
lda #0
sta ab ; A is no longer pressed
* lda $4016 ; don't ignore B
and #1
beq _not_b
lda bb
and #1
bne + ; don't flip if B was pressed before
lda #1
sta bb ; B is now pressed
lda player+2 ; sprite attributes
clc
adc #%10000001 ; effectively flip MSB, vertical flip
and #%11111101
sta player+2
lda player+6
clc
adc #%10000001
and #%11111101
sta player+6
lda player+10
clc
adc #%10000001
and #%11111101
sta player+10
lda player+14
clc
adc #%10000001
and #%11111101
sta player+14
lda player+1 ; tile index
clc
adc #2
and #%00000011
sta player+1
adc #1
sta player+5
adc #1
and #%00000011
sta player+9
adc #1
sta player+13
jmp +
_not_b:
lda #0
sta bb ; B is no longer pressed
* lda $4016 ; don't ignore SELECT
and #1
beq _not_sel
lda sel
and #1
bne + ; don't flip if SELECT was pressed before
lda #1
sta sel ; SELECT is now pressed
lda player+2 ; sprite attributes
clc
adc #%00100000 ; effectively flip bit 2, background priority
and #%00100000 ; isolate new background priority
sta temp
lda player+2
and #%11011111 ; clear old background priority
ora temp ; update new background priority
sta player+2
lda player+6
and #%11011111
ora temp
sta player+6
lda player+10
and #%11011111
ora temp
sta player+10
lda player+14
and #%11011111
ora temp
sta player+14
jmp +
_not_sel:
lda #0
sta sel ; SELECT is no longer pressed
* lda #0
sta temp ; hasn't moved
lda $4016 ; ignore START
lda $4016 ; don't ignore UP
and #1
beq +
lda player
cmp #8 ; can't go past top of screen
beq +
dec player ; update Y-coordinate
dec player
dec player+4
dec player+4
dec player+8
dec player+8
dec player+12
dec player+12
lda #1 ; has moved
sta temp
* lda $4016 ; don't ignore DOWN
and #1
beq +
lda player
cmp #222-8 ; can't go past bottom of screen
beq +
inc player ; update Y-coordinate
inc player
inc player+4
inc player+4
inc player+8
inc player+8
inc player+12
inc player+12
lda #1 ; has moved
sta temp
* lda $4016 ; don't ignore LEFT
and #1
beq +
lda player+3
beq + ; can't past left of screen
dec player+3 ; update X-coordinate
dec player+3
dec player+7
dec player+7
dec player+11
dec player+11
dec player+15
dec player+15
lda #1 ; has moved
sta temp
* lda $4016 ; don't ignore RIGHT
and #$01
beq +
lda player+3
cmp #255-7-8
beq + ; can't past right of screen
inc player+3 ; update X-coordinate
inc player+3
inc player+7
inc player+7
inc player+11
inc player+11
inc player+15
inc player+15
lda #1 ; has moved
sta temp
* jsr _update_frame
rts
_update_frame:
lda ani
beq _rest_frame
and #%1111
bne _inc_ani
lda ani
and #%110000
bne _change_frame
_rest_frame:
lda temp
beq _done
_change_frame:
lda player+1 ; tile index
clc
adc #$4
and #$F
sta player+1
adc #1
and #$F
sta player+5
adc #1
and #$F
sta player+9
adc #1
and #$F
sta player+13
_inc_ani:
inc ani
lda ani
and #%111111
sta ani
_done:
rts
.scend
snd_low_c:
pha
lda #%10000100 ; duty = 2
; loop env/disable length = 0
; env not disabled
; vol/env period = 4
sta $4000
; middle C has a frequency of about 523 Hz, so the square
; wave needed has a frequency of 261.5 Hz, which
; corresponds to $1AA
lda #%10101010 ; upper two nibbles of $1AA
sta $4002
lda #%00001001 ; length index = 0b00001, corresponds to 127 frames
; upper three bits of $1AA
sta $4003
pla
rts
snd_high_c:
pha
lda #%10000110 ; duty = 2
; loop env/disable length = 0
; env not disabled
; vol/env period = 6
sta $4004
; high C has a frequency of about 2092 Hz, so the square
; wave needed has a frequency of 1046 Hz, which
; corresponds to $06A
lda #%01101010 ; upper two nibbles of $06A
sta $4006
lda #%00001000 ; length index = 0b00001, corresponds to 127 frames
; upper three bits of $06A
sta $4007
pla
rts
play_snd:
.scope
lda #%00000
cmp snd
beq _play_low_c
lda #%10000
cmp snd
beq _play_high_c
jmp _done_playing
_play_low_c:
jsr snd_low_c
jmp _done_playing
_play_high_c:
jsr snd_high_c
_done_playing:
inc snd
lda #%11111
and snd
sta snd
rts
.scend
vblank:
jsr react_to_input
ldx #$00 ; Reset VRAM
stx $2006
stx $2006
lda #$00
sta $2005 ; Write 0 for Horiz. Scroll value
sta $2005 ; Write 0 for Vert. Scroll value
lda #>sprite
sta $4014 ; move page $200-$2FF into SPR-RAM via DMA
jsr play_snd
rti
irq : rti
; Palettes
palette:
; Background palette, a wide variety of colors
.byte $0F,$10,$00,$30 ; grays
.byte $2D,$15,$2A,$22 ; slightly lighter
.byte $00,$35,$39,$32 ; even lighter
.byte $30,$30,$30,$30 ; whites
; Sprite palette, background is dark blue
.byte $0C,$31,$1C,$0F ; top of ghost, normal
.byte $0C,$31,$1C,$16 ; bottom of ghost, normal
.byte $0F,$26,$08,$30 ; top of ghost, inverted
.byte $0F,$26,$08,$2C ; bottom of ghost, inverted
bg:
; 32x30 (16 bytes per line, 60 lines)
.byte $01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01
.byte $02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02
.byte $04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04
.byte $05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05
.byte $01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01
.byte $02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02
.byte $04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04
.byte $05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05
.byte $01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01
.byte $02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02
.byte $04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04
.byte $05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05
.byte $01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01
.byte $02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02
.byte $04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04
.byte $05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05
.byte $01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01
.byte $02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02
.byte $04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04
.byte $05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05
.byte $01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01
.byte $02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02
.byte $04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04
.byte $05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05
.byte $01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01
.byte $02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02
.byte $04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04
.byte $05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05
.byte $01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01
.byte $02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02
.byte $04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04
.byte $05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05
.byte $01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01
.byte $02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02
.byte $04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04
.byte $05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05
.byte $01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01
.byte $02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02
.byte $04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04
.byte $05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05
.byte $01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01
.byte $02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02
.byte $04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04
.byte $05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05
.byte $01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01
.byte $02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02
.byte $04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04
.byte $05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05
.byte $01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01
.byte $02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02
.byte $04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04
.byte $05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05
.byte $01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01
.byte $02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02
.byte $04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04
.byte $05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05
.byte $01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01
.byte $02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02,$03,$01,$02
.byte $04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04
.byte $05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05,$06,$04,$05
; attribute table
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
.advance $FFFA
.word vblank, reset, irq
; CHR-ROM
; This is a Mapper #0 cartridge, so the CHR-ROM is an 8K block of
; data mapped directly into the first $2000 bytes of the PPU's
; address space. Correspondingly, we begin by setting the origin to
; $0000.
.org $0000
; Pattern Table #0: Background
; A single, transparent 8x8 tile
.byte $00,$00,$00,$00,$00,$00,$00,$00
.byte $00,$00,$00,$00,$00,$00,$00,$00
; a 24x16 cloud, composed of a 3x2 tile grid
.byte $00,$00,$00,$00,$03,$04,$08,$08
.byte $00,$00,$00,$03,$07,$0F,$1F,$1F
.byte $00,$00,$1C,$36,$23,$D2,$6F,$BF
.byte $00,$1C,$3E,$7F,$FF,$EF,$91,$40
.byte $00,$00,$00,$00,$00,$E0,$F0,$F0
.byte $00,$00,$00,$00,$E0,$F0,$78,$B8
.byte $05,$09,$12,$11,$18,$0F,$00,$00
.byte $0E,$1E,$3D,$3E,$3F,$1F,$0F,$00
.byte $7F,$FF,$FF,$FF,$FF,$FF,$00,$00
.byte $85,$0A,$05,$0A,$05,$FF,$FF,$00
.byte $F0,$F0,$E8,$F8,$F8,$F0,$00,$00
.byte $78,$F8,$7C,$BC,$5C,$F8,$F0,$00
.advance $1000 ; The rest of Pattern Table #0 is blank
; Pattern Table #1: Sprites
; A ghost, with four frames of walking animation. Each frame is
; 16x16, so there are four sprites per frame.
;.byte $00,$61,$F0,$F4,$F4,$F0,$F0,$80 ; frame 0
;.byte $18,$1E,$0F,$2F,$2F,$0F,$0F,$19
;.byte $00,$61,$F0,$D0,$F4,$F0,$70,$00 ; frame 1
;.byte $18,$1E,$0F,$0B,$2F,$0F,$0F,$19
;.byte $00,$61,$F0,$F4,$F4,$F0,$F0,$80 ; frame 2
;.byte $18,$1E,$0F,$2F,$2F,$0F,$0F,$19
;.byte $00,$61,$F0,$F4,$D0,$F0,$F0,$80 ; frame 3
;.byte $18,$1E,$0F,$2F,$0B,$0F,$0E,$18
.byte $00,$03,$0F,$0F,$1F,$1F,$1F,$1F ; frame 0
.byte $03,$0C,$10,$10,$24,$26,$26,$60
.byte $00,$C0,$F0,$F0,$F8,$F8,$F8,$F8
.byte $C0,$30,$08,$08,$44,$64,$64,$06
.byte $5F,$5F,$5F,$1F,$1F,$1F,$19,$00
.byte $A5,$AA,$A0,$60,$20,$20,$26,$19
.byte $FA,$FA,$FA,$F8,$F8,$F8,$98,$00
.byte $55,$A5,$05,$06,$04,$04,$64,$98
.byte $00,$03,$0F,$0F,$1F,$1F,$5F,$5F ; frame 1
.byte $03,$0C,$10,$10,$24,$66,$A6,$A0
.byte $00,$C0,$F0,$F0,$F8,$F8,$F8,$F8
.byte $C0,$30,$08,$08,$44,$64,$64,$04
.byte $5F,$1F,$1F,$1F,$1B,$01,$00,$00
.byte $A5,$6A,$20,$20,$24,$1A,$01,$00
.byte $F8,$F8,$FA,$FA,$FA,$B8,$18,$00
.byte $54,$A6,$05,$05,$05,$46,$A4,$18
.byte $00,$03,$0F,$0F,$1F,$1F,$1F,$1F ; frame 2
.byte $03,$0C,$10,$10,$24,$26,$26,$60
.byte $00,$C0,$F0,$F0,$F8,$F8,$F8,$F8
.byte $C0,$30,$08,$08,$44,$64,$64,$06
.byte $5F,$5F,$5F,$1F,$1F,$1F,$19,$00
.byte $A5,$AA,$A0,$60,$20,$20,$26,$19
.byte $FA,$FA,$FA,$F8,$F8,$F8,$98,$00
.byte $55,$A5,$05,$06,$04,$04,$64,$98
.byte $00,$03,$0F,$0F,$1F,$1F,$1F,$1F ; frame 3
.byte $03,$0C,$10,$10,$24,$26,$26,$20
.byte $00,$C0,$F0,$F0,$F8,$F8,$FA,$FA
.byte $C0,$30,$08,$08,$44,$66,$65,$05
.byte $1F,$1F,$5F,$5F,$5F,$1D,$18,$00
.byte $25,$6A,$A0,$A0,$A0,$62,$25,$18
.byte $FC,$F8,$F8,$F8,$D8,$80,$00,$00
.byte $55,$A6,$04,$04,$24,$58,$80,$00
.advance $2000 ; The rest of Pattern Table #1 is blank
; vim: ft=asmM6502:tw=72:sw=2
| 26.150068 | 74 | 0.582586 |
a9a01b325b4691fb1423b00bf6fc87de58b5939b | 474 | asm | Assembly | programs/oeis/214/A214856.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/214/A214856.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/214/A214856.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A214856: Number of triangular numbers in interval ](n-1)^2, n^2] for n>0, a(0)=1.
; 1,1,1,1,2,1,2,1,1,2,1,2,1,1,2,1,2,1,1,2,1,2,1,2,1,1,2,1,2,1,1,2,1,2,1,2,1,1,2,1,2,1,1,2,1,2,1,1,2,1,2,1,2,1,1,2,1,2,1,1,2,1,2,1,2,1,1,2,1,2,1,1,2,1
mov $4,$0
mov $5,2
lpb $5
sub $5,1
add $0,$5
sub $0,1
mov $2,$5
mov $3,$0
pow $3,2
seq $3,2024 ; n appears n times; a(n) = floor(sqrt(2n) + 1/2).
mul $2,$3
add $1,$2
mov $6,$3
lpe
min $4,1
mul $4,$6
sub $1,$4
mov $0,$1
| 21.545455 | 149 | 0.523207 |
bcd99697fd2ec665c781386b8b67140acae0b445 | 714 | asm | Assembly | oeis/021/A021484.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/021/A021484.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/021/A021484.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A021484: Expansion of 1/((1-x)(1-3x)(1-5x)(1-12x)).
; Submitted by Christian Krause
; 1,21,310,4050,50371,613671,7411240,89174100,1071295141,12861600921,154369595770,1852587338550,22231809806311,266785528785771,3201445408153900,38417440232993400,461009759536223881,5532119498329912221,66385445900016205630,796625410402224154650,9559505222842068467851,114714064164197405204271,1376568777420878851990960,16518825366303237386358300,198225904581902728092938221,2378710855914153405331365921,28544530275626448017855669890,342534363330800423422060660350,4110412360086020351418879714991
add $0,2
lpb $0
sub $0,1
add $2,2
mul $2,10
mul $3,12
add $3,$1
mul $1,3
add $1,$2
div $2,2
lpe
mov $0,$3
div $0,20
| 39.666667 | 494 | 0.820728 |
7ebe915983ad59938451e1071ada62c0021d3ef8 | 3,825 | asm | Assembly | Kernel/asm/interrupts.asm | slococo/TP2-SO | bcf678e2a3c5f5b360b500276d4c119bacda970d | [
"BSD-3-Clause"
] | null | null | null | Kernel/asm/interrupts.asm | slococo/TP2-SO | bcf678e2a3c5f5b360b500276d4c119bacda970d | [
"BSD-3-Clause"
] | null | null | null | Kernel/asm/interrupts.asm | slococo/TP2-SO | bcf678e2a3c5f5b360b500276d4c119bacda970d | [
"BSD-3-Clause"
] | null | null | null | GLOBAL _cli
GLOBAL _sti
GLOBAL picMasterMask
GLOBAL picSlaveMask
GLOBAL haltcpu
GLOBAL _hlt
GLOBAL _irq00Handler
GLOBAL _irq01Handler
GLOBAL _irq02Handler
GLOBAL _irq03Handler
GLOBAL _irq04Handler
GLOBAL _irq05Handler
GLOBAL _systemCallsHandler
GLOBAL _exception0Handler
GLOBAL _exception6Handler
EXTERN irqDispatcher
EXTERN exceptionDispatcher
EXTERN systemCallsDispatcher
EXTERN changeWindow
EXTERN nextProcess
GLOBAL switchContext
GLOBAL loadProcess
GLOBAL _initialize_stack_frame
EXTERN getFPUaddress, getSSEaddress
EXTERN checkSleeping
SECTION .text
%macro pushState 0
push rax
push rbx
push rcx
push rdx
push rbp
push rdi
push rsi
push r8
push r9
push r10
push r11
push r12
push r13
push r14
push r15
%endmacro
%macro popState 0
pop r15
pop r14
pop r13
pop r12
pop r11
pop r10
pop r9
pop r8
pop rsi
pop rdi
pop rbp
pop rdx
pop rcx
pop rbx
pop rax
%endmacro
%macro irqHandlerMaster 1
pushState
fsave [bytesForFPU]
fxsave [bytesForSSEAligned]
mov rdi, %1
call irqDispatcher
mov al, 20h
out 20h, al
fxrstor [bytesForSSEAligned]
frstor [bytesForFPU]
popState
iretq
%endmacro
%macro exceptionHandler 1
mov [insPointer], rsp
push rax
lea rax, [rsp + 4 * 8]
mov [rspPointer], rax
pop rax
pushState
mov rdi, %1
mov rsi, [insPointer]
mov rdx, [rspPointer]
mov rcx, rsp
call exceptionDispatcher
popState
iretq
%endmacro
%macro pushStateNoRax 0
push rbx
push rcx
push rdx
push rbp
push rdi
push rsi
push r8
push r9
push r10
push r11
push r12
push r13
push r14
push r15
%endmacro
%macro popStateNoRax 0
pop r15
pop r14
pop r13
pop r12
pop r11
pop r10
pop r9
pop r8
pop rsi
pop rdi
pop rbp
pop rdx
pop rcx
pop rbx
%endmacro
_hlt:
sti
hlt
ret
_cli:
cli
ret
_sti:
sti
ret
picMasterMask:
push rbp
mov rbp, rsp
mov ax, di
out 21h,al
pop rbp
retn
picSlaveMask:
push rbp
mov rbp, rsp
mov ax, di
out 0A1h,al
pop rbp
retn
;8254 Timer (Timer Tick)
_irq00Handler:
pushState
mov rsi, rsp
and rsp, -16
sub rsp, 108
fsave [rsp]
and rsp, -16
sub rsp, 512
fxsave [rsp]
push rsi
call checkSleeping
mov rdi, 0
call irqDispatcher
mov rdi, rsp
call nextProcess
mov rsp, rax
mov al, 20h
out 20h, al
pop rsp
mov rax, rsp
and rsp, -16
sub rsp, 108
frstor [rsp]
and rsp, -16
sub rsp, 512
fxrstor [rsp]
mov rsp, rax
popState
iretq
;Keyboard
_irq01Handler:
irqHandlerMaster 1
;Cascade pic never called
_irq02Handler:
irqHandlerMaster 2
;Serial Port 2 and 4
_irq03Handler:
irqHandlerMaster 3
;Serial Port 1 and 3
_irq04Handler:
irqHandlerMaster 4
;USB
_irq05Handler:
irqHandlerMaster 5
;Zero Division Exception
_exception0Handler:
exceptionHandler 0
;Invalid OPCODE Exc
_exception6Handler:
exceptionHandler 6
haltcpu:
sti
hlt
cli
ret
_initialize_stack_frame:
mov r10, rsp
mov rsp, rsi
push 0x0 ; ss
push rsi ; sp
push 0x202 ; rflags
push 0x08 ; cs
push rdi ; IP
mov rsi, rcx
mov rdi, rdx
pushState
mov rsi, rsp
and rsp, -16
sub rsp, 108
fsave [rsp]
and rsp, -16
sub rsp, 512
fxsave [rsp]
push rsi
mov rax, rsp
mov rsp, r10
ret
; System calls (int 80h)
_systemCallsHandler:
pushStateNoRax
mov [auxRSI], rsi
mov rsi, rsp
and rsp, -16
sub rsp, 108
fsave [rsp]
; and rsp, -16
; sub rsp, 512
; fxsave [rsp]
push rsi
mov rsi, [auxRSI]
call systemCallsDispatcher
pop rsp
mov [auxRAX], rax
mov rax, rsp
and rsp, -16
sub rsp, 108
frstor [rsp]
; and rsp, -16
; sub rsp, 512
; fxrstor [rsp]
mov rsp, rax
mov rax, [auxRAX]
popStateNoRax
iretq
SECTION .data
align 16
bytesForSSEAligned times 512 db 0
SECTION .bss
aux resq 1
bytesForSSE resb 512
bytesForFPU resb 108
insPointer resb 8
rspPointer resb 8
auxRSI resb 8
auxRDI resb 8
auxRAX resb 8 | 12.142857 | 35 | 0.717647 |
b40cf4b6c1cc176587ad6e55449c60b3b310b10b | 15,571 | asm | Assembly | src/third_party/nasm/travis/test/testnos3.asm | Mr-Sheep/naiveproxy | 9f6e9768295f6d1d41517a15a621d4756bd7d6be | [
"BSD-3-Clause"
] | 2,219 | 2018-03-26T02:57:34.000Z | 2022-03-31T00:27:59.000Z | src/third_party/nasm/travis/test/testnos3.asm | Mr-Sheep/naiveproxy | 9f6e9768295f6d1d41517a15a621d4756bd7d6be | [
"BSD-3-Clause"
] | 250 | 2018-02-02T23:16:57.000Z | 2022-03-21T06:09:53.000Z | src/third_party/nasm/travis/test/testnos3.asm | Mr-Sheep/naiveproxy | 9f6e9768295f6d1d41517a15a621d4756bd7d6be | [
"BSD-3-Clause"
] | 473 | 2019-03-24T16:34:23.000Z | 2022-03-31T02:01:05.000Z | ; Double-precision floating point tests, derived from Fred Tydeman's posting
; of 26 February 1996 to comp.arch.arithmetic, via David M. Gay's gdtoa
; package.
;
bits 64
dq 9.e0306
dq 0x7fa9a2028368022e
dq 4.e-079
dq 0x2fa7b6d71d20b96c
dq 7.e-261
dq 0x09eb8d7e32be6396
dq 6.e-025
dq 0x3ae7361cb863de62
dq 7.e-161
dq 0x1eaf7e0db3799aa3
dq 7.e0289
dq 0x7c1cbb547777a285
dq 5.e0079
dq 0x507afcef51f0fb5f
dq 1.e0080
dq 0x508afcef51f0fb5f
dq 7.e-303
dq 0x0133339131c46f8b
dq 5.e0152
dq 0x5fa317e5ef3ab327
dq 5.e0125
dq 0x5a07a2ecc414a03f
dq 2.e0126
dq 0x5a27a2ecc414a03f
dq 7.e-141
dq 0x22d5570f59bd178c
dq 4.e-192
dq 0x18323ff06eea847a
dq 9.e0043
dq 0x49102498ea6df0c4
dq 1.e0303
dq 0x7ed754e31cd072da
dq 95.e-089
dq 0x2dde3cbc9907fdc8
dq 85.e0194
dq 0x689d1c26db7d0dae
dq 69.e0267
dq 0x77c0b7cb60c994da
dq 97.e-019
dq 0x3c665dde8e688ba6
dq 37.e0046
dq 0x49d033d7eca0adef
dq 74.e0046
dq 0x49e033d7eca0adef
dq 61.e-099
dq 0x2bc0ad836f269a17
dq 53.e-208
dq 0x151b39ae1909c31b
dq 93.e-234
dq 0x0fc27b2e4f210075
dq 79.e-095
dq 0x2c9a5db812948281
dq 87.e-274
dq 0x0772d36cf48e7abd
dq 83.e0025
dq 0x4585747ab143e353
dq 17.e-036
dq 0x38b698ccdc60015a
dq 53.e0033
dq 0x47246a3418629ef6
dq 51.e-074
dq 0x30ecd5bee57763e6
dq 63.e-022
dq 0x3bbdc03b8fd7016a
dq 839.e0143
dq 0x5e3ae03f245703e2
dq 749.e-182
dq 0x1abf14727744c63e
dq 999.e-026
dq 0x3b282782afe1869e
dq 345.e0266
dq 0x77b0b7cb60c994da
dq 914.e-102
dq 0x2b5ffc81bc29f02b
dq 829.e0102
dq 0x55b7221a79cdd1d9
dq 307.e0090
dq 0x5322d6b183fe4b55
dq 859.e0182
dq 0x6654374d8b87ac63
dq 283.e0085
dq 0x5216c309024bab4b
dq 589.e0187
dq 0x675526be9c22eb17
dq 302.e0176
dq 0x64fdcf7df8f573b7
dq 604.e0176
dq 0x650dcf7df8f573b7
dq 761.e-244
dq 0x0de03cea3586452e
dq 647.e0230
dq 0x7044d64d4079150c
dq 755.e0174
dq 0x64a7d93193f78fc6
dq 255.e-075
dq 0x30dcd5bee57763e6
dq 3391.e0055
dq 0x4c159bd3ad46e346
dq 4147.e-015
dq 0x3d923d1b5eb1d778
dq 3996.e-026
dq 0x3b482782afe1869e
dq 1998.e-026
dq 0x3b382782afe1869e
dq 3338.e-296
dq 0x0335519ac5142aab
dq 1669.e-296
dq 0x0325519ac5142aab
dq 8699.e-276
dq 0x0772d2df246ecd2d
dq 5311.e0243
dq 0x73284e91f4aa0fdb
dq 7903.e-096
dq 0x2cd07c2d27a5b989
dq 7611.e-226
dq 0x11d19b8744033457
dq 3257.e0058
dq 0x4cb444b34a6fb3eb
dq 6514.e0058
dq 0x4cc444b34a6fb3eb
dq 3571.e0263
dq 0x77462644c61d41aa
dq 7142.e0263
dq 0x77562644c61d41aa
dq 5311.e0242
dq 0x72f3720e5d54d97c
dq 1617.e-063
dq 0x3384c98fce16152e
dq 51881.e0037
dq 0x4897d2950dc76da4
dq 31441.e-118
dq 0x285ef890f5de4c86
dq 30179.e0079
dq 0x5143e272a77478e8
dq 60358.e0079
dq 0x5153e272a77478e8
dq 63876.e-020
dq 0x3cc703856844bdbf
dq 31938.e-020
dq 0x3cb703856844bdbf
dq 46073.e-032
dq 0x3a42405b773fbdf3
dq 32941.e0051
dq 0x4b757eb8ad52a5c9
dq 82081.e0041
dq 0x49770105df3d47cb
dq 38701.e-215
dq 0x1440492a4a8a37fd
dq 62745.e0047
dq 0x4ab0c52fe6dc6a1b
dq 12549.e0048
dq 0x4ac0c52fe6dc6a1b
dq 64009.e-183
dq 0x1af099b393b84832
dq 89275.e0261
dq 0x77262644c61d41aa
dq 75859.e0025
dq 0x46232645e1ba93f0
dq 57533.e0287
dq 0x7c8272ed2307f56a
dq 584169.e0229
dq 0x70ad657059dc79aa
dq 940189.e-112
dq 0x29eb99d6240c1a28
dq 416121.e0197
dq 0x6a00fd07ed297f80
dq 832242.e0197
dq 0x6a10fd07ed297f80
dq 584738.e0076
dq 0x50e8a85eb277e645
dq 933587.e-140
dq 0x241b248728b9c117
dq 252601.e0121
dq 0x5a2dda592e398dd7
dq 358423.e0274
dq 0x79f9463b59b8f2bd
dq 892771.e-213
dq 0x14f25818c7294f27
dq 410405.e0040
dq 0x49670105df3d47cb
dq 928609.e-261
dq 0x0afbe2dd66200bef
dq 302276.e-254
dq 0x0c55a462d91c6ab3
dq 920657.e-023
dq 0x3c653a9985dbde6c
dq 609019.e-025
dq 0x3bf1f99e11ea0a24
dq 252601.e0120
dq 0x59f7e1e0f1c7a4ac
dq 654839.e-060
dq 0x34b00e7db3b3f242
dq 8823691.e0130
dq 0x5c5e597c0b94b7ae
dq 2920845.e0228
dq 0x709d657059dc79aa
dq 9210917.e0080
dq 0x51fda232347e6032
dq 5800419.e-303
dq 0x026e58ffa48f4fce
dq 6119898.e-243
dq 0x0ee3ecf22ea07863
dq 3059949.e-243
dq 0x0ed3ecf22ea07863
dq 2572231.e0223
dq 0x6f90f73be1dff9ad
dq 5444097.e-021
dq 0x3cf8849dd33c95af
dq 5783893.e-127
dq 0x26f7e5902ce0e151
dq 3865421.e-225
dq 0x1295d4fe53afec65
dq 4590831.e0156
dq 0x61b4689b4a5fa201
dq 9181662.e0156
dq 0x61c4689b4a5fa201
dq 5906361.e-027
dq 0x3bbbe45a312d08a0
dq 7315057.e0235
dq 0x7225f0d408362a72
dq 9088115.e0106
dq 0x5762e51a84a3c6a0
dq 1817623.e0107
dq 0x5772e51a84a3c6a0
dq 44118455.e0129
dq 0x5c4e597c0b94b7ae
dq 35282041.e0293
dq 0x7e5512d5273e62e8
dq 31279898.e-291
dq 0x05129b01b6885d36
dq 15639949.e-291
dq 0x05029b01b6885d36
dq 27966061.e0145
dq 0x5f955bcf72fd10f9
dq 55932122.e0145
dq 0x5fa55bcf72fd10f9
dq 70176353.e-053
dq 0x36900683a21de855
dq 40277543.e-032
dq 0x3adf29ca0ff893b1
dq 50609263.e0157
dq 0x622193aff1f1c8e3
dq 66094077.e0077
dq 0x518b37c4b7928317
dq 84863171.e0114
dq 0x59406e98f5ec8f37
dq 89396333.e0264
dq 0x786526f061ca9053
dq 87575437.e-309
dq 0x016e07320602056c
dq 78693511.e-044
dq 0x3870bc7b7603a2ca
dq 90285923.e-206
dq 0x16d1470083f89d48
dq 30155207.e-030
dq 0x3b423a4ad20748a2
dq 245540327.e0121
dq 0x5acc569e968e0944
dq 263125459.e0287
dq 0x7d44997a298b2f2e
dq 566446538.e-257
dq 0x0c64472ba9550e86
dq 283223269.e-257
dq 0x0c54472ba9550e86
dq 245540327.e0122
dq 0x5b01b6231e18c5cb
dq 491080654.e0122
dq 0x5b11b6231e18c5cb
dq 971212611.e-126
dq 0x27a397d3c9745d2f
dq 229058583.e0052
dq 0x4c76ce94febdc7a5
dq 325270231.e0039
dq 0x49cc7ccf90c9f8ab
dq 989648089.e-035
dq 0x3a8880a3d515e849
dq 653777767.e0273
dq 0x7a720223f2b3a881
dq 923091487.e0209
dq 0x6d30bc60e6896717
dq 526250918.e0288
dq 0x7d89bfd8b3edfafa
dq 350301748.e-309
dq 0x018e07320602056c
dq 741111169.e-203
dq 0x17a14fe7daf8f3ae
dq 667284113.e-240
dq 0x0ff09355f8050c02
dq 1227701635.e0120
dq 0x5abc569e968e0944
dq 9981396317.e-182
dq 0x1c38afe10a2a66aa
dq 5232604057.e-298
dq 0x041465b896c24520
dq 5572170023.e-088
dq 0x2fb0847822f765b2
dq 1964322616.e0122
dq 0x5b31b6231e18c5cb
dq 3928645232.e0122
dq 0x5b41b6231e18c5cb
dq 8715380633.e-058
dq 0x35f4614c3219891f
dq 4856063055.e-127
dq 0x279397d3c9745d2f
dq 8336960483.e-153
dq 0x223a06a1024b95e1
dq 1007046393.e-155
dq 0x21a01891fc4717fd
dq 5378822089.e-176
dq 0x1d695fd4c88d4b1b
dq 5981342308.e-190
dq 0x1a83db11ac608107
dq 7214782613.e-086
dq 0x3020b552d2edcdea
dq 5458466829.e0142
dq 0x5f70acde6a98eb4c
dq 9078555839.e-109
dq 0x2b5fc575867314ee
dq 6418488827.e0079
dq 0x526021f14ed7b3fa
dq 65325840981.e0069
dq 0x5081a151ddbd3c4a
dq 49573485983.e0089
dq 0x54a221bd871d2cf4
dq 46275205733.e0074
dq 0x51830e6c7d4e3480
dq 92550411466.e0074
dq 0x51930e6c7d4e3480
dq 41129842097.e-202
dq 0x1832c3e72d179607
dq 93227267727.e-049
dq 0x380960fe08d5847f
dq 41297294357.e0185
dq 0x688c49437fccfadb
dq 41534892987.e-067
dq 0x343a12666477886d
dq 42333842451.e0201
dq 0x6be0189a26df575f
dq 78564021519.e-227
dq 0x131155515fd37265
dq 53587107423.e-061
dq 0x35800a19a3ffd981
dq 53827010643.e-200
dq 0x18a32fa69a69bd6d
dq 83356057653.e0193
dq 0x6a4544e6daee2a18
dq 45256834646.e-118
dq 0x29a541ecdfd48694
dq 45392779195.e-110
dq 0x2b4fc575867314ee
dq 23934638219.e0291
dq 0x7e81deaf40ead9a0
dq 995779191233.e0113
dq 0x59e2d44edcc51304
dq 997422852243.e-265
dq 0x0b676688faee99bc
dq 653532977297.e-123
dq 0x28d925a0aabcdc68
dq 938885684947.e0147
dq 0x60f11894b202e9f4
dq 619534293513.e0124
dq 0x5c210c20303fe0f1
dq 539879452414.e-042
dq 0x39a5e66dc3d6bdb5
dq 742522891517.e0259
dq 0x782c1c352fc3c309
dq 254901016865.e-022
dq 0x3dbc06d366394441
dq 685763015669.e0280
dq 0x7c85fd7aa44d9477
dq 384865004907.e-285
dq 0x072aa65b58639e69
dq 286556458711.e0081
dq 0x5321958b36c5102b
dq 573112917422.e0081
dq 0x5331958b36c5102b
dq 769525178383.e-150
dq 0x234253ec0e161420
dq 416780288265.e0192
dq 0x6a3544e6daee2a18
dq 226963895975.e-111
dq 0x2b3fc575867314ee
dq 665592809339.e0063
dq 0x4f778b6516c2b478
dq 3891901811465.e0217
dq 0x6f99ab8261990292
dq 4764593340755.e0069
dq 0x50e4177a9915fbf8
dq 6336156586177.e0269
dq 0x7a7173f76c63b792
dq 8233559360849.e0095
dq 0x56566fee05649a7a
dq 3662265515198.e-107
dq 0x2c538e6edd48f2a3
dq 1831132757599.e-107
dq 0x2c438e6edd48f2a3
dq 7812878489261.e-179
dq 0x1d726dae7bbeda75
dq 6363857920591.e0145
dq 0x60b28a61cf9483b7
dq 8811915538555.e0082
dq 0x53a51f508b287ae7
dq 9997878507563.e-195
dq 0x1a253db2fea1ea31
dq 9224786422069.e-291
dq 0x0634ee5d56b32957
dq 6284426329974.e-294
dq 0x058d3409dfbca26f
dq 9199302046091.e-062
dq 0x35c135972630774c
dq 6070482281213.e-122
dq 0x29423fa9e6fcf47e
dq 2780161250963.e-301
dq 0x0405acc2053064c2
dq 8233559360849.e0094
dq 0x5621f324d11d4862
dq 72027097041701.e0206
dq 0x6d94677812d3a606
dq 97297545286625.e0215
dq 0x6f79ab8261990292
dq 99021992302453.e-025
dq 0x3da5c6714def374c
dq 54104687080198.e-022
dq 0x3e373cdf8db7a7bc
dq 33519685743233.e0089
dq 0x5537f203339c9629
dq 67039371486466.e0089
dq 0x5547f203339c9629
dq 39064392446305.e-180
dq 0x1d626dae7bbeda75
dq 17796979903653.e0261
dq 0x78e072f3819c1321
dq 28921916763211.e0038
dq 0x4a9eebabe0957af3
dq 87605699161665.e0155
dq 0x6302920f96e7f9ef
dq 41921560615349.e-067
dq 0x34d9b2a5c4041e4b
dq 80527976643809.e0061
dq 0x4f7c7c5aea080a49
dq 72335858886654.e-159
dq 0x21cce77c2b3328fc
dq 52656615219377.e0102
dq 0x57f561def4a9ee32
dq 15400733123779.e-072
dq 0x33b8bf7e7fa6f02a
dq 77003665618895.e-073
dq 0x33a8bf7e7fa6f02a
dq 475603213226859.e-042
dq 0x3a42d73088f4050a
dq 972708181182949.e0116
dq 0x5b218a7f36172332
dq 246411729980464.e-071
dq 0x342eef5e1f90ac34
dq 123205864990232.e-071
dq 0x341eef5e1f90ac34
dq 609610927149051.e-255
dq 0x0e104273b18918b1
dq 475603213226859.e-041
dq 0x3a778cfcab31064d
dq 672574798934795.e0065
dq 0x508226c684c87261
dq 134514959786959.e0066
dq 0x509226c684c87261
dq 294897574603217.e-151
dq 0x2395f2df5e675a0f
dq 723047919080275.e0036
dq 0x4a7eebabe0957af3
dq 660191429952702.e-088
dq 0x30bddc7e975c5045
dq 330095714976351.e-088
dq 0x30addc7e975c5045
dq 578686871093232.e-159
dq 0x21fce77c2b3328fc
dq 144671717773308.e-159
dq 0x21dce77c2b3328fc
dq 385018328094475.e-074
dq 0x3398bf7e7fa6f02a
dq 330095714976351.e-089
dq 0x3077e3987916a69e
dq 2215901545757777.e-212
dq 0x171a80a6e566428c
dq 1702061899637397.e-276
dq 0x09cacc46749dccfe
dq 1864950924021923.e0213
dq 0x6f53ae60753af6ca
dq 3729901848043846.e0213
dq 0x6f63ae60753af6ca
dq 7487252720986826.e-165
dq 0x20f8823a57adbef9
dq 3743626360493413.e-165
dq 0x20e8823a57adbef9
dq 4988915232824583.e0119
dq 0x5be5f6de9d5d6b5b
dq 3771476185376383.e0277
dq 0x7cae3c14d6916ce9
dq 6182410494241627.e-119
dq 0x2a81b96458445d07
dq 2572981889477453.e0142
dq 0x609dfc11fbf46087
dq 7793560217139653.e0051
dq 0x4dd280461b856ec5
dq 9163942927285259.e-202
dq 0x194fe601457dce4d
dq 6353227084707473.e0155
dq 0x63650aff653ffe8a
dq 4431803091515554.e-211
dq 0x176090684f5fe998
dq 9324754620109615.e0211
dq 0x6f0f7d6721f7f144
dq 8870461176410409.e0263
dq 0x79d90529a37b7e22
dq 90372559027740405.e0143
dq 0x612491daad0ba280
dq 18074511805548081.e0146
dq 0x61a011f2d73116f4
dq 54897030182071313.e0029
dq 0x496ec55666d8f9ec
dq 76232626624829156.e-032
dq 0x3ccb7738011e75fe
dq 59898021767894608.e-165
dq 0x2128823a57adbef9
dq 29949010883947304.e-165
dq 0x2118823a57adbef9
dq 26153245263757307.e0049
dq 0x4d83de005bd620df
dq 27176258005319167.e-261
dq 0x0d27c0747bd76fa1
dq 18074511805548081.e0147
dq 0x61d4166f8cfd5cb1
dq 24691002732654881.e-115
dq 0x2b759a2783ce70ab
dq 58483921078398283.e0057
dq 0x4f408ce499519ce3
dq 64409240769861689.e-159
dq 0x22692238f7987779
dq 94080055902682397.e-242
dq 0x11364981e39e66ca
dq 31766135423537365.e0154
dq 0x63550aff653ffe8a
dq 68985865317742005.e0164
dq 0x657a999ddec72aca
dq 13797173063548401.e0165
dq 0x658a999ddec72aca
dq 902042358290366539.e-281
dq 0x09522dc01ca1cb8c
dq 238296178309629163.e0272
dq 0x7c038fd93f1f5342
dq 783308178698887621.e0226
dq 0x72925ae62cb346d8
dq 439176241456570504.e0029
dq 0x499ec55666d8f9ec
dq 899810892172646163.e0283
dq 0x7e6adf51fa055e03
dq 926145344610700019.e-225
dq 0x14f307a67f1f69ff
dq 653831131593932675.e0047
dq 0x4d63de005bd620df
dq 130766226318786535.e0048
dq 0x4d73de005bd620df
dq 557035730189854663.e-294
dq 0x0693bfac6bc4767b
dq 902042358290366539.e-280
dq 0x0986b93023ca3e6f
dq 272104041512242479.e0200
dq 0x6d13bbb4bf05f087
dq 544208083024484958.e0200
dq 0x6d23bbb4bf05f087
dq 680429695511221511.e0192
dq 0x6b808ebc116f8a20
dq 308975121073410857.e0236
dq 0x7490db75cc001072
dq 792644927852378159.e0078
dq 0x53d7bff336d8ff06
dq 783308178698887621.e0223
dq 0x71f2cbac35f71140
dq 8396094300569779681.e-252
dq 0x0f8ab223efcee35a
dq 3507665085003296281.e-074
dq 0x346b85c026a264e4
dq 7322325862592278999.e0074
dq 0x5336775b6caa5ae0
dq 6014546754280072926.e0209
dq 0x6f396397b06732a4
dq 7120190517612959703.e0120
dq 0x5cc3220dcd5899fd
dq 3507665085003296281.e-073
dq 0x34a1339818257f0f
dq 4345544743100783551.e-218
dq 0x168a9c42e5b6d89f
dq 9778613303868468131.e-090
dq 0x313146fe1075e1ef
dq 7539204280836061195.e-082
dq 0x32d3d969e3dbe723
dq 7862637540082247119.e-202
dq 0x19eaba3262ee707b
dq 2176832332097939832.e0200
dq 0x6d43bbb4bf05f087
dq 8643988913946659879.e0115
dq 0x5bbe71ec1ed0a4f9
dq 5529436763613147623.e0138
dq 0x6079c677be6f236e
dq 6764958008109694533.e-173
dq 0x1fed06692e6f5ef6
dq 6802601037806061975.e0197
dq 0x6cbf92bacb3cb40c
dq 1360520207561212395.e0198
dq 0x6ccf92bacb3cb40c
dq 62259110684423957791.e0047
dq 0x4dcd8f2cfc20d6e8
dq 88800290202542652011.e-226
dq 0x1526cec51a43f41a
dq 41010852717673354694.e-221
dq 0x162012954b6aabba
dq 20505426358836677347.e-221
dq 0x161012954b6aabba
dq 66102447903809911604.e0055
dq 0x4f7762068a24fd55
dq 35600952588064798515.e0119
dq 0x5cb3220dcd5899fd
dq 14371240869903838702.e0205
dq 0x6e78d92d2bcc7a81
dq 57500690832492901689.e0043
dq 0x4cf65d3e2acd616b
dq 23432630639573022093.e-107
dq 0x2dbdd54c40a2f25f
dq 62259110684423957791.e0048
dq 0x4e02797c1d948651
dq 35620497849450218807.e-306
dq 0x0475b22082529425
dq 69658634627134074624.e0200
dq 0x6d93bbb4bf05f087
dq 99440755792436956989.e-062
dq 0x37362d10462a26f4
dq 55277197169490210673.e0081
dq 0x54d945bfa911e32a
dq 36992084760177624177.e-318
dq 0x01f8c5f9551c2f9a
dq 30888265282878466443.e-111
dq 0x2cf01b8ef28251fc
dq 2.4703282292062327208828439643411068618252990130716238221279284125033775363510437593264991818081799618989828234772285886546332835517796989819938739800539093906315035659515570226392290858392449105184435931802849936536152500319370457678249219365623669863658480757001585769269903706311928279558551332927834338409351978015531246597263579574622766465272827220056374006485499977096599470454020828166226237857393450736339007967761930577506740176324673600968951340535537458516661134223766678604162159680461914467291840300530057530849048765391711386591646239524912623653881879636239373280423891018672348497668235089863388587925628302755995657524455507255189313690836254779186948667994968324049705821028513185451396213837722826145437693412532098591327667236328125e-324
dq 0x0000000000000000
dq 2.47032822920623272e-324
dq 0x0000000000000000
| 16.019547 | 762 | 0.821848 |
5caa4a1afbf2cf46a93237cfcd347c5f6496249d | 344 | asm | Assembly | oeis/021/A021165.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/021/A021165.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/021/A021165.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A021165: Decimal expansion of 1/161.
; Submitted by Jamie Morken(s3)
; 0,0,6,2,1,1,1,8,0,1,2,4,2,2,3,6,0,2,4,8,4,4,7,2,0,4,9,6,8,9,4,4,0,9,9,3,7,8,8,8,1,9,8,7,5,7,7,6,3,9,7,5,1,5,5,2,7,9,5,0,3,1,0,5,5,9,0,0,6,2,1,1,1,8,0,1,2,4,2,2,3,6,0,2,4,8,4,4,7,2,0,4,9,6,8,9,4,4,0
add $0,1
mov $1,10
pow $1,$0
mul $1,84
div $1,13524
mod $1,10
mov $0,$1
| 28.666667 | 199 | 0.563953 |
cdeaaf96a074ffe1c3d0c515801238c51bcf2e1e | 1,884 | asm | Assembly | src/sm/maps.asm | SmolBig/alttp_sm_combo_randomizer_rom | 571ca88e10cce0b4477be8a0f5f9bdbe4693757c | [
"MIT"
] | null | null | null | src/sm/maps.asm | SmolBig/alttp_sm_combo_randomizer_rom | 571ca88e10cce0b4477be8a0f5f9bdbe4693757c | [
"MIT"
] | null | null | null | src/sm/maps.asm | SmolBig/alttp_sm_combo_randomizer_rom | 571ca88e10cce0b4477be8a0f5f9bdbe4693757c | [
"MIT"
] | null | null | null | BRINSTAR_MAP = $8000
BRINSTAR_VISIBLE = $9827
CRATERIA_MAP = $9000
CRATERIA_VISIBLE = $9727
NORFAIR_MAP = $A000
NORFAIR_VISIBLE = $9927
WRECKED_SHIP_MAP = $B000
WRECKED_SHIP_VISIBLE = $9A27
MARIDIA_MAP = $C000
MARIDIA_VISIBLE = $9B27
TOURIAN_MAP = $D000
TOURIAN_VISIBLE = $9C27
CERES_MAP = $E000
CERES_VISIBLE = $9D27
; Place the portal tiles into the maps where needed.
; Each of these maps is 64x32 tiles big, split into two 32x32 blocks.
; First is the left 32x32 tiles, and then following is the rightmost 32x32 tiles
; To place a maptile at X,Y calculate ((X%32)*2 + Y*64) + ((X/32) * 0x800)
macro write_map_tile(start, x, y, tile)
org $F50000+<start>+((((<x>%32)*2)+(<y>*64))+((<x>/32)*$800))
dw <tile>
endmacro
; Modifies the maptiles that can be revealed by a map station, 1 byte is 8 tiles, one per bit
macro write_map_visibility(start, x, y, value)
org $C20000+<start>+(((<x>%32)/8)+(<y>*4)+((<x>/32)*$80))
db <value>
endmacro
; Write crateria portal icon
%write_map_tile(CRATERIA_MAP, $14, $8, $0c1a)
; Blank out inaccessible crateria room tiles
%write_map_tile(CRATERIA_MAP, $15, $08, $0c1f)
%write_map_tile(CRATERIA_MAP, $16, $08, $0c1f)
%write_map_tile(CRATERIA_MAP, $17, $08, $0c1f)
; Write maridia portal icon
%write_map_tile(MARIDIA_MAP, $26, $09, $0c1a)
; Write upper norfair portal icon
%write_map_tile(NORFAIR_MAP, $09, $05, $4c1a)
; Write lower norfair portal icon
%write_map_tile(NORFAIR_MAP, $16, $10, $0c1a)
; Modify the norfair default visible map tiles to show the lower norfair portal
%write_map_visibility(NORFAIR_VISIBLE, $16, $10, $02)
; Insert the new portal map tile into the map tile bank
org $DAB3A0
DB $00,$E0,$60,$95,$7C,$80,$7C,$80,$7C,$80,$7C,$80,$60,$95,$00,$E0
org $F68340
DB $00,$E0,$60,$95,$7C,$80,$7C,$80,$7C,$80,$7C,$80,$60,$95,$00,$E0
DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
| 31.4 | 93 | 0.693737 |
0d29cd2c4596fb9e3c588d1c07cfe4aff8537b35 | 596 | asm | Assembly | Tejas-Simulator/PIN/pin-2.14/source/tools/Regvalue/doXsave_intel64.asm | markoshorro/tejas_knl | 5e772aef46362d8bec8ad6d5427b9bcff9be5cfe | [
"Apache-2.0"
] | 17 | 2021-07-10T13:22:26.000Z | 2022-02-09T20:11:39.000Z | pin_kit/source/tools/Regvalue/doXsave_intel64.asm | sawansib/SNIPER | 45ec1eeb09b81a7250bc1a1aaa452f16b2b7f497 | [
"MIT"
] | 4 | 2021-08-18T14:07:24.000Z | 2022-01-24T16:38:06.000Z | pin_kit/source/tools/Regvalue/doXsave_intel64.asm | sawansib/SNIPER | 45ec1eeb09b81a7250bc1a1aaa452f16b2b7f497 | [
"MIT"
] | 2 | 2021-08-03T10:56:16.000Z | 2022-01-31T12:10:56.000Z | PUBLIC DoXsave
extern xsaveArea:qword
.code
; void DoXsave();
; This function calls xsave and stores the FP state in the given dst area.
; The caller is expected to allocate enough space for the xsave area.
; The function expects the given dst pointer to be properly aligned for the xsave instruction.
DoXsave PROC
; Save the necessary GPRs
push rax
push rcx
push rdx
lea rcx, xsaveArea
xor rdx, rdx
mov rax, 7
; Do xsave
xsave [rcx]
; Restore the GPRs
pop rdx
pop rcx
pop rax
ret
DoXsave ENDP
end
| 18.625 | 94 | 0.645973 |
40701130653156d3f9fdb904e7dc3fc79b574787 | 1,160 | asm | Assembly | gsconv850/examples/alex16.asm | hwreverse/PocketComputerTools | a7097fd4ffacf29e9dc9979d38bb7118b85402c2 | [
"MIT"
] | 4 | 2019-12-23T05:41:39.000Z | 2021-07-23T09:53:45.000Z | gsconv850/examples/alex16.asm | hwreverse/PocketComputerTools | a7097fd4ffacf29e9dc9979d38bb7118b85402c2 | [
"MIT"
] | null | null | null | gsconv850/examples/alex16.asm | hwreverse/PocketComputerTools | a7097fd4ffacf29e9dc9979d38bb7118b85402c2 | [
"MIT"
] | null | null | null | 10 ORG 100H
20 JP MAIN
30GPF EQU 0BFD0H
40MAIN: LD HL,L0
50 LD B,32
60 LD DE,0
70 CALL GPF
80 LD HL,L1
90 LD B,32
100 LD DE,0100H
110 CALL GPF
120 CALL WAIT
130 LD HL,L2
140 LD B,32
150 LD DE,0000H
160 CALL GPF
170 LD HL,L3
180 LD B,32
190 LD DE,0100H
200 CALL GPF
210 CALL WAIT
220 IN A,(1FH)
230 RLCA
240 RET C
250 JP MAIN
260 RET
270WAIT: LD BC,500
280WLOOP: DEC BC
290 LD A,B
300 OR C
310 JR NZ,WLOOP
320 RET
330L0: DB 00H, 88H, 0CCH, 0FCH, 0DCH, 0F8H, 0C0H, 80H, 00H, 0CH, 0FCH, 0FCH
340 DB 0CH, 08H, 00H, 80H, 0CH, 0FCH, 0FCH, 0ECH, 0FCH, 3CH, 9CH, 00H
350 DB 0CH, 08H, 00H, 80H, 0CH, 0FCH, 0FCH, 0ECH
360L1: DB 06H, 07H, 07H, 02H, 01H, 02H, 07H, 07H, 06H, 02H, 07H, 07H
370 DB 07H, 06H, 07H, 07H, 06H, 07H, 07H, 06H, 07H, 07H, 07H, 03H
380 DB 07H, 06H, 07H, 07H, 06H, 07H, 07H, 06H
390L2: DB 00H, 00H, 0C8H, 0B8H, 98H, 0B0H, 0C0H, 00H, 00H, 08H, 0F8H, 08H
400 DB 08H, 00H, 00H, 80H, 00H, 08H, 0F8H, 48H, 0E8H, 08H, 18H, 00H
410 DB 08H, 00H, 00H, 80H, 00H, 08H, 0F8H, 48H
420L3: DB 00H, 02H, 03H, 00H, 00H, 02H, 03H, 02H, 00H, 02H, 03H, 02H
430 DB 02H, 02H, 02H, 03H, 00H, 02H, 03H, 02H, 02H, 02H, 03H, 00H
440 DB 02H, 02H, 02H, 03H, 00H, 02H, 03H, 02H
| 25.777778 | 75 | 0.666379 |
7d5dfa61cad808fc9814df03fbd2ccbbc1b311ac | 863 | asm | Assembly | pkgs/tools/yasm/src/modules/arch/x86/tests/gas64/align64.asm | manggoguy/parsec-modified | d14edfb62795805c84a4280d67b50cca175b95af | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | pkgs/tools/yasm/src/modules/arch/x86/tests/gas64/align64.asm | manggoguy/parsec-modified | d14edfb62795805c84a4280d67b50cca175b95af | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | pkgs/tools/yasm/src/modules/arch/x86/tests/gas64/align64.asm | manggoguy/parsec-modified | d14edfb62795805c84a4280d67b50cca175b95af | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | .text
# 15 fill
.byte 0xff
.p2align 4
# 14 fill
.byte 0xff
.byte 0xff
.p2align 4
# 13 fill
.byte 0xff
.byte 0xff
.byte 0xff
.p2align 4
# 12 fill
.byte 0xff
.byte 0xff
.byte 0xff
.byte 0xff
.p2align 4
# 11 fill
.byte 0xff
.byte 0xff
.byte 0xff
.byte 0xff
.byte 0xff
.p2align 4
# 10 fill
.byte 0xff
.byte 0xff
.byte 0xff
.byte 0xff
.byte 0xff
.byte 0xff
.p2align 4
# 9 fill
.byte 0xff
.byte 0xff
.byte 0xff
.byte 0xff
.byte 0xff
.byte 0xff
.byte 0xff
.p2align 4
# 8 fill
.byte 0xff
.byte 0xff
.byte 0xff
.byte 0xff
.byte 0xff
.byte 0xff
.byte 0xff
.byte 0xff
.p2align 4
# 7 fill
.byte 0xff
.p2align 3
# 6 fill
.byte 0xff
.byte 0xff
.p2align 3
# 5 fill
.byte 0xff
.byte 0xff
.byte 0xff
.p2align 3
# 4 fill
.byte 0xff
.byte 0xff
.byte 0xff
.byte 0xff
.p2align 3
# 3 fill
.byte 0xff
.p2align 2
# 2 fill
.byte 0xff
.byte 0xff
.p2align 2
# 1 fill
.byte 0xff
.p2align 1
| 10.39759 | 10 | 0.701043 |
c389fbce88988672b1fb6c6f39944073196e31ca | 630 | asm | Assembly | programs/oeis/092/A092054.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/092/A092054.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/092/A092054.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A092054: Logarithm base 2 of the sum of numerator and denominator of the convergents of the continued fraction expansion [1;1/2,1/3,1/4,...,1/n,...].
; 1,2,4,6,7,8,11,14,15,16,18,20,21,22,26,30,31,32,34,36,37,38,41,44,45,46,48,50,51,52,57,62,63,64,66,68,69,70,73,76,77,78,80,82,83,84,88,92,93,94,96,98,99,100,103,106,107,108,110,112,113,114,120,126,127,128,130
mov $4,$0
add $4,1
mov $5,$0
lpb $4
mov $0,$5
sub $4,1
sub $0,$4
mov $2,1
mov $6,$0
mov $7,$0
lpb $6
add $2,7
mov $3,$6
sub $6,$6
sub $6,2
div $7,2
bin $6,$7
add $6,$3
lpe
mov $7,$2
div $7,7
add $7,1
add $1,$7
lpe
| 22.5 | 210 | 0.580952 |
13410d06f19268321fa06ccb992dc4abc76d3dbd | 32 | asm | Assembly | pkgs/tools/yasm/src/modules/parsers/nasm/tests/alignnop32.asm | manggoguy/parsec-modified | d14edfb62795805c84a4280d67b50cca175b95af | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | pkgs/tools/yasm/src/modules/parsers/nasm/tests/alignnop32.asm | manggoguy/parsec-modified | d14edfb62795805c84a4280d67b50cca175b95af | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | pkgs/tools/yasm/src/modules/parsers/nasm/tests/alignnop32.asm | manggoguy/parsec-modified | d14edfb62795805c84a4280d67b50cca175b95af | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | bits 32
mov eax,32
align 16
ret
| 6.4 | 10 | 0.75 |
eb7fe98b39ed7593fb47a5ee81b9614de3c3df78 | 687 | asm | Assembly | oeis/052/A052650.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/052/A052650.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/052/A052650.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A052650: E.g.f. 1/((1-2x)(1-x)^2).
; Submitted by Jamie Morken(s2)
; 1,4,22,156,1368,14400,177840,2530080,40844160,738823680,14816390400,326439590400,7840777190400,203947385241600,5711834461132800,171375956623872000,5484386299392000000,186475536553033728000,6713240961009623040000,255105589420373852160000,10204274667757125795840000,428580660046527061032960000,18857574894063929570426880000,867449065575342493479075840000,41637570658826483017981624320000,2081878936232785277504716800000000,108257715572974284848597434368000000,5845916945828955993538121957376000000
add $0,1
mov $2,$0
mov $4,1
lpb $0
sub $0,1
add $3,$4
mul $3,$2
mov $2,$0
mul $4,2
mul $4,$0
lpe
mov $0,$3
| 40.411765 | 497 | 0.823872 |
924e8cc697398c988f4695e94dc38243674241ff | 14,156 | asm | Assembly | Kostur/lcd.asm | bogdanbebic/AirLevitation | e8473b4add427d0a104f3beb19bba1d6f30e8a56 | [
"MIT"
] | null | null | null | Kostur/lcd.asm | bogdanbebic/AirLevitation | e8473b4add427d0a104f3beb19bba1d6f30e8a56 | [
"MIT"
] | null | null | null | Kostur/lcd.asm | bogdanbebic/AirLevitation | e8473b4add427d0a104f3beb19bba1d6f30e8a56 | [
"MIT"
] | null | null | null |
_lcd_show_height_percentage:
;lcd.c,6 :: void lcd_show_height_percentage(int height_percentage)
;lcd.c,8 :: LCD_Out(1, 1, "Height:");
MOVLW 1
MOVWF FARG_Lcd_Out_row+0
MOVLW 1
MOVWF FARG_Lcd_Out_column+0
MOVLW ?lstr1_lcd+0
MOVWF FARG_Lcd_Out_text+0
MOVLW hi_addr(?lstr1_lcd+0)
MOVWF FARG_Lcd_Out_text+1
CALL _Lcd_Out+0, 0
;lcd.c,9 :: if (height_percentage <= 1000)
MOVLW 128
XORLW 3
MOVWF R0
MOVLW 128
XORWF FARG_lcd_show_height_percentage_height_percentage+1, 0
SUBWF R0, 0
BTFSS STATUS+0, 2
GOTO L__lcd_show_height_percentage7
MOVF FARG_lcd_show_height_percentage_height_percentage+0, 0
SUBLW 232
L__lcd_show_height_percentage7:
BTFSS STATUS+0, 0
GOTO L_lcd_show_height_percentage0
;lcd.c,11 :: LCD_Chr(1, TENTHS, '0' + height_percentage % 10);
MOVLW 1
MOVWF FARG_Lcd_Chr_row+0
MOVLW 15
MOVWF FARG_Lcd_Chr_column+0
MOVLW 10
MOVWF R4
MOVLW 0
MOVWF R5
MOVF FARG_lcd_show_height_percentage_height_percentage+0, 0
MOVWF R0
MOVF FARG_lcd_show_height_percentage_height_percentage+1, 0
MOVWF R1
CALL _Div_16x16_S+0, 0
MOVF R8, 0
MOVWF R0
MOVF R9, 0
MOVWF R1
MOVF R0, 0
ADDLW 48
MOVWF FARG_Lcd_Chr_out_char+0
CALL _Lcd_Chr+0, 0
;lcd.c,12 :: LCD_Chr(1, DECIMAL_POINT, '.');
MOVLW 1
MOVWF FARG_Lcd_Chr_row+0
MOVLW 14
MOVWF FARG_Lcd_Chr_column+0
MOVLW 46
MOVWF FARG_Lcd_Chr_out_char+0
CALL _Lcd_Chr+0, 0
;lcd.c,13 :: LCD_Chr(1, UNITS, '0' + height_percentage / 10 % 10);
MOVLW 1
MOVWF FARG_Lcd_Chr_row+0
MOVLW 13
MOVWF FARG_Lcd_Chr_column+0
MOVLW 10
MOVWF R4
MOVLW 0
MOVWF R5
MOVF FARG_lcd_show_height_percentage_height_percentage+0, 0
MOVWF R0
MOVF FARG_lcd_show_height_percentage_height_percentage+1, 0
MOVWF R1
CALL _Div_16x16_S+0, 0
MOVLW 10
MOVWF R4
MOVLW 0
MOVWF R5
CALL _Div_16x16_S+0, 0
MOVF R8, 0
MOVWF R0
MOVF R9, 0
MOVWF R1
MOVF R0, 0
ADDLW 48
MOVWF FARG_Lcd_Chr_out_char+0
CALL _Lcd_Chr+0, 0
;lcd.c,14 :: LCD_Chr(1, TENS, '0' + height_percentage / 100 % 10);
MOVLW 1
MOVWF FARG_Lcd_Chr_row+0
MOVLW 12
MOVWF FARG_Lcd_Chr_column+0
MOVLW 100
MOVWF R4
MOVLW 0
MOVWF R5
MOVF FARG_lcd_show_height_percentage_height_percentage+0, 0
MOVWF R0
MOVF FARG_lcd_show_height_percentage_height_percentage+1, 0
MOVWF R1
CALL _Div_16x16_S+0, 0
MOVLW 10
MOVWF R4
MOVLW 0
MOVWF R5
CALL _Div_16x16_S+0, 0
MOVF R8, 0
MOVWF R0
MOVF R9, 0
MOVWF R1
MOVF R0, 0
ADDLW 48
MOVWF FARG_Lcd_Chr_out_char+0
CALL _Lcd_Chr+0, 0
;lcd.c,15 :: LCD_Chr(1, HUNDREDS, '0' + height_percentage / 1000 % 10);
MOVLW 1
MOVWF FARG_Lcd_Chr_row+0
MOVLW 11
MOVWF FARG_Lcd_Chr_column+0
MOVLW 232
MOVWF R4
MOVLW 3
MOVWF R5
MOVF FARG_lcd_show_height_percentage_height_percentage+0, 0
MOVWF R0
MOVF FARG_lcd_show_height_percentage_height_percentage+1, 0
MOVWF R1
CALL _Div_16x16_S+0, 0
MOVLW 10
MOVWF R4
MOVLW 0
MOVWF R5
CALL _Div_16x16_S+0, 0
MOVF R8, 0
MOVWF R0
MOVF R9, 0
MOVWF R1
MOVF R0, 0
ADDLW 48
MOVWF FARG_Lcd_Chr_out_char+0
CALL _Lcd_Chr+0, 0
;lcd.c,16 :: }
GOTO L_lcd_show_height_percentage1
L_lcd_show_height_percentage0:
;lcd.c,19 :: LCD_Out(1, HUNDREDS, "100.0");
MOVLW 1
MOVWF FARG_Lcd_Out_row+0
MOVLW 11
MOVWF FARG_Lcd_Out_column+0
MOVLW ?lstr2_lcd+0
MOVWF FARG_Lcd_Out_text+0
MOVLW hi_addr(?lstr2_lcd+0)
MOVWF FARG_Lcd_Out_text+1
CALL _Lcd_Out+0, 0
;lcd.c,20 :: }
L_lcd_show_height_percentage1:
;lcd.c,22 :: LCD_Out(1, LCD_END_INDEX, "%");
MOVLW 1
MOVWF FARG_Lcd_Out_row+0
MOVLW 16
MOVWF FARG_Lcd_Out_column+0
MOVLW ?lstr3_lcd+0
MOVWF FARG_Lcd_Out_text+0
MOVLW hi_addr(?lstr3_lcd+0)
MOVWF FARG_Lcd_Out_text+1
CALL _Lcd_Out+0, 0
;lcd.c,23 :: }
L_end_lcd_show_height_percentage:
RETURN 0
; end of _lcd_show_height_percentage
_lcd_show_reference_percentage:
;lcd.c,25 :: void lcd_show_reference_percentage(int reference_percentage)
;lcd.c,27 :: LCD_Out(2, 1, "Reference:");
MOVLW 2
MOVWF FARG_Lcd_Out_row+0
MOVLW 1
MOVWF FARG_Lcd_Out_column+0
MOVLW ?lstr4_lcd+0
MOVWF FARG_Lcd_Out_text+0
MOVLW hi_addr(?lstr4_lcd+0)
MOVWF FARG_Lcd_Out_text+1
CALL _Lcd_Out+0, 0
;lcd.c,28 :: if (reference_percentage <= 1000)
MOVLW 128
XORLW 3
MOVWF R0
MOVLW 128
XORWF FARG_lcd_show_reference_percentage_reference_percentage+1, 0
SUBWF R0, 0
BTFSS STATUS+0, 2
GOTO L__lcd_show_reference_percentage9
MOVF FARG_lcd_show_reference_percentage_reference_percentage+0, 0
SUBLW 232
L__lcd_show_reference_percentage9:
BTFSS STATUS+0, 0
GOTO L_lcd_show_reference_percentage2
;lcd.c,30 :: LCD_Chr(2, TENTHS, '0' + reference_percentage % 10);
MOVLW 2
MOVWF FARG_Lcd_Chr_row+0
MOVLW 15
MOVWF FARG_Lcd_Chr_column+0
MOVLW 10
MOVWF R4
MOVLW 0
MOVWF R5
MOVF FARG_lcd_show_reference_percentage_reference_percentage+0, 0
MOVWF R0
MOVF FARG_lcd_show_reference_percentage_reference_percentage+1, 0
MOVWF R1
CALL _Div_16x16_S+0, 0
MOVF R8, 0
MOVWF R0
MOVF R9, 0
MOVWF R1
MOVF R0, 0
ADDLW 48
MOVWF FARG_Lcd_Chr_out_char+0
CALL _Lcd_Chr+0, 0
;lcd.c,31 :: LCD_Chr(2, DECIMAL_POINT, '.');
MOVLW 2
MOVWF FARG_Lcd_Chr_row+0
MOVLW 14
MOVWF FARG_Lcd_Chr_column+0
MOVLW 46
MOVWF FARG_Lcd_Chr_out_char+0
CALL _Lcd_Chr+0, 0
;lcd.c,32 :: LCD_Chr(2, UNITS, '0' + reference_percentage / 10 % 10);
MOVLW 2
MOVWF FARG_Lcd_Chr_row+0
MOVLW 13
MOVWF FARG_Lcd_Chr_column+0
MOVLW 10
MOVWF R4
MOVLW 0
MOVWF R5
MOVF FARG_lcd_show_reference_percentage_reference_percentage+0, 0
MOVWF R0
MOVF FARG_lcd_show_reference_percentage_reference_percentage+1, 0
MOVWF R1
CALL _Div_16x16_S+0, 0
MOVLW 10
MOVWF R4
MOVLW 0
MOVWF R5
CALL _Div_16x16_S+0, 0
MOVF R8, 0
MOVWF R0
MOVF R9, 0
MOVWF R1
MOVF R0, 0
ADDLW 48
MOVWF FARG_Lcd_Chr_out_char+0
CALL _Lcd_Chr+0, 0
;lcd.c,33 :: LCD_Chr(2, TENS, '0' + reference_percentage / 100 % 10);
MOVLW 2
MOVWF FARG_Lcd_Chr_row+0
MOVLW 12
MOVWF FARG_Lcd_Chr_column+0
MOVLW 100
MOVWF R4
MOVLW 0
MOVWF R5
MOVF FARG_lcd_show_reference_percentage_reference_percentage+0, 0
MOVWF R0
MOVF FARG_lcd_show_reference_percentage_reference_percentage+1, 0
MOVWF R1
CALL _Div_16x16_S+0, 0
MOVLW 10
MOVWF R4
MOVLW 0
MOVWF R5
CALL _Div_16x16_S+0, 0
MOVF R8, 0
MOVWF R0
MOVF R9, 0
MOVWF R1
MOVF R0, 0
ADDLW 48
MOVWF FARG_Lcd_Chr_out_char+0
CALL _Lcd_Chr+0, 0
;lcd.c,34 :: LCD_Chr(2, HUNDREDS, '0' + reference_percentage / 1000 % 10);
MOVLW 2
MOVWF FARG_Lcd_Chr_row+0
MOVLW 11
MOVWF FARG_Lcd_Chr_column+0
MOVLW 232
MOVWF R4
MOVLW 3
MOVWF R5
MOVF FARG_lcd_show_reference_percentage_reference_percentage+0, 0
MOVWF R0
MOVF FARG_lcd_show_reference_percentage_reference_percentage+1, 0
MOVWF R1
CALL _Div_16x16_S+0, 0
MOVLW 10
MOVWF R4
MOVLW 0
MOVWF R5
CALL _Div_16x16_S+0, 0
MOVF R8, 0
MOVWF R0
MOVF R9, 0
MOVWF R1
MOVF R0, 0
ADDLW 48
MOVWF FARG_Lcd_Chr_out_char+0
CALL _Lcd_Chr+0, 0
;lcd.c,35 :: }
GOTO L_lcd_show_reference_percentage3
L_lcd_show_reference_percentage2:
;lcd.c,38 :: LCD_Out(2, HUNDREDS, "100.0");
MOVLW 2
MOVWF FARG_Lcd_Out_row+0
MOVLW 11
MOVWF FARG_Lcd_Out_column+0
MOVLW ?lstr5_lcd+0
MOVWF FARG_Lcd_Out_text+0
MOVLW hi_addr(?lstr5_lcd+0)
MOVWF FARG_Lcd_Out_text+1
CALL _Lcd_Out+0, 0
;lcd.c,39 :: }
L_lcd_show_reference_percentage3:
;lcd.c,41 :: LCD_Out(2, LCD_END_INDEX, "%");
MOVLW 2
MOVWF FARG_Lcd_Out_row+0
MOVLW 16
MOVWF FARG_Lcd_Out_column+0
MOVLW ?lstr6_lcd+0
MOVWF FARG_Lcd_Out_text+0
MOVLW hi_addr(?lstr6_lcd+0)
MOVWF FARG_Lcd_Out_text+1
CALL _Lcd_Out+0, 0
;lcd.c,42 :: }
L_end_lcd_show_reference_percentage:
RETURN 0
; end of _lcd_show_reference_percentage
_lcd_show_control_percentage:
;lcd.c,44 :: void lcd_show_control_percentage(int control_percentage)
;lcd.c,46 :: LCD_Out(2, 1, "Control: ");
MOVLW 2
MOVWF FARG_Lcd_Out_row+0
MOVLW 1
MOVWF FARG_Lcd_Out_column+0
MOVLW ?lstr7_lcd+0
MOVWF FARG_Lcd_Out_text+0
MOVLW hi_addr(?lstr7_lcd+0)
MOVWF FARG_Lcd_Out_text+1
CALL _Lcd_Out+0, 0
;lcd.c,47 :: if (control_percentage <= 1000)
MOVLW 128
XORLW 3
MOVWF R0
MOVLW 128
XORWF FARG_lcd_show_control_percentage_control_percentage+1, 0
SUBWF R0, 0
BTFSS STATUS+0, 2
GOTO L__lcd_show_control_percentage11
MOVF FARG_lcd_show_control_percentage_control_percentage+0, 0
SUBLW 232
L__lcd_show_control_percentage11:
BTFSS STATUS+0, 0
GOTO L_lcd_show_control_percentage4
;lcd.c,49 :: LCD_Chr(2, TENTHS, '0' + control_percentage % 10);
MOVLW 2
MOVWF FARG_Lcd_Chr_row+0
MOVLW 15
MOVWF FARG_Lcd_Chr_column+0
MOVLW 10
MOVWF R4
MOVLW 0
MOVWF R5
MOVF FARG_lcd_show_control_percentage_control_percentage+0, 0
MOVWF R0
MOVF FARG_lcd_show_control_percentage_control_percentage+1, 0
MOVWF R1
CALL _Div_16x16_S+0, 0
MOVF R8, 0
MOVWF R0
MOVF R9, 0
MOVWF R1
MOVF R0, 0
ADDLW 48
MOVWF FARG_Lcd_Chr_out_char+0
CALL _Lcd_Chr+0, 0
;lcd.c,50 :: LCD_Chr(2, DECIMAL_POINT, '.');
MOVLW 2
MOVWF FARG_Lcd_Chr_row+0
MOVLW 14
MOVWF FARG_Lcd_Chr_column+0
MOVLW 46
MOVWF FARG_Lcd_Chr_out_char+0
CALL _Lcd_Chr+0, 0
;lcd.c,51 :: LCD_Chr(2, UNITS, '0' + control_percentage / 10 % 10);
MOVLW 2
MOVWF FARG_Lcd_Chr_row+0
MOVLW 13
MOVWF FARG_Lcd_Chr_column+0
MOVLW 10
MOVWF R4
MOVLW 0
MOVWF R5
MOVF FARG_lcd_show_control_percentage_control_percentage+0, 0
MOVWF R0
MOVF FARG_lcd_show_control_percentage_control_percentage+1, 0
MOVWF R1
CALL _Div_16x16_S+0, 0
MOVLW 10
MOVWF R4
MOVLW 0
MOVWF R5
CALL _Div_16x16_S+0, 0
MOVF R8, 0
MOVWF R0
MOVF R9, 0
MOVWF R1
MOVF R0, 0
ADDLW 48
MOVWF FARG_Lcd_Chr_out_char+0
CALL _Lcd_Chr+0, 0
;lcd.c,52 :: LCD_Chr(2, TENS, '0' + control_percentage / 100 % 10);
MOVLW 2
MOVWF FARG_Lcd_Chr_row+0
MOVLW 12
MOVWF FARG_Lcd_Chr_column+0
MOVLW 100
MOVWF R4
MOVLW 0
MOVWF R5
MOVF FARG_lcd_show_control_percentage_control_percentage+0, 0
MOVWF R0
MOVF FARG_lcd_show_control_percentage_control_percentage+1, 0
MOVWF R1
CALL _Div_16x16_S+0, 0
MOVLW 10
MOVWF R4
MOVLW 0
MOVWF R5
CALL _Div_16x16_S+0, 0
MOVF R8, 0
MOVWF R0
MOVF R9, 0
MOVWF R1
MOVF R0, 0
ADDLW 48
MOVWF FARG_Lcd_Chr_out_char+0
CALL _Lcd_Chr+0, 0
;lcd.c,53 :: LCD_Chr(2, HUNDREDS, '0' + control_percentage / 1000 % 10);
MOVLW 2
MOVWF FARG_Lcd_Chr_row+0
MOVLW 11
MOVWF FARG_Lcd_Chr_column+0
MOVLW 232
MOVWF R4
MOVLW 3
MOVWF R5
MOVF FARG_lcd_show_control_percentage_control_percentage+0, 0
MOVWF R0
MOVF FARG_lcd_show_control_percentage_control_percentage+1, 0
MOVWF R1
CALL _Div_16x16_S+0, 0
MOVLW 10
MOVWF R4
MOVLW 0
MOVWF R5
CALL _Div_16x16_S+0, 0
MOVF R8, 0
MOVWF R0
MOVF R9, 0
MOVWF R1
MOVF R0, 0
ADDLW 48
MOVWF FARG_Lcd_Chr_out_char+0
CALL _Lcd_Chr+0, 0
;lcd.c,54 :: }
GOTO L_lcd_show_control_percentage5
L_lcd_show_control_percentage4:
;lcd.c,57 :: LCD_Out(2, HUNDREDS, "100.0");
MOVLW 2
MOVWF FARG_Lcd_Out_row+0
MOVLW 11
MOVWF FARG_Lcd_Out_column+0
MOVLW ?lstr8_lcd+0
MOVWF FARG_Lcd_Out_text+0
MOVLW hi_addr(?lstr8_lcd+0)
MOVWF FARG_Lcd_Out_text+1
CALL _Lcd_Out+0, 0
;lcd.c,58 :: }
L_lcd_show_control_percentage5:
;lcd.c,60 :: LCD_Out(2, LCD_END_INDEX, "%");
MOVLW 2
MOVWF FARG_Lcd_Out_row+0
MOVLW 16
MOVWF FARG_Lcd_Out_column+0
MOVLW ?lstr9_lcd+0
MOVWF FARG_Lcd_Out_text+0
MOVLW hi_addr(?lstr9_lcd+0)
MOVWF FARG_Lcd_Out_text+1
CALL _Lcd_Out+0, 0
;lcd.c,61 :: }
L_end_lcd_show_control_percentage:
RETURN 0
; end of _lcd_show_control_percentage
| 28.031683 | 76 | 0.604408 |
ba4ff6954d641a34c22a91fa7410f989b3aff45d | 14,910 | asm | Assembly | archie/noise.asm | bushy555/ZX-Spectrum-1-Bit-Routines | 4d336dec9d7abc979a97af76d515104a9263f127 | [
"BSD-3-Clause"
] | 59 | 2015-02-28T14:15:56.000Z | 2022-03-26T12:06:01.000Z | archie/noise.asm | bushy555/ZX-Spectrum-1-Bit-Routines | 4d336dec9d7abc979a97af76d515104a9263f127 | [
"BSD-3-Clause"
] | 1 | 2016-08-22T05:32:43.000Z | 2016-08-22T09:33:28.000Z | archie/noise.asm | bushy555/ZX-Spectrum-1-Bit-Routines | 4d336dec9d7abc979a97af76d515104a9263f127 | [
"BSD-3-Clause"
] | 9 | 2015-02-28T14:16:31.000Z | 2022-01-18T17:52:48.000Z | ; The format is 0
; High value is 224
; Low value is 15
db $07,$01,$04,$03,$01,$0D,$03,$01,$07,$01,$05,$03,$09,$0E,$05,$04
db $06,$02,$06,$06,$09,$13,$04,$07,$02,$02,$03,$03,$0D,$01,$04,$08
db $0D,$02,$03,$01,$07,$02,$05,$04,$02,$05,$11,$09,$04,$02,$08,$03
db $01,$06,$02,$01,$04,$06,$06,$04,$03,$01,$08,$01,$07,$03,$04,$02
db $04,$04,$04,$05,$05,$03,$0D,$03,$0B,$02,$03,$02,$03,$03,$07,$04
db $02,$03,$0A,$04,$04,$01,$03,$0A,$02,$09,$02,$03,$02,$0A,$0F,$07
db $04,$0E,$01,$09,$0A,$08,$05,$01,$01,$04,$09,$05,$02,$08,$04,$03
db $01,$01,$02,$02,$07,$09,$0F,$02,$0B,$03,$04,$06,$01,$06,$01,$03
db $01,$03,$04,$01,$06,$07,$03,$05,$03,$03,$02,$01,$04,$05,$05,$02
db $05,$0B,$02,$01,$0B,$01,$01,$12,$07,$01,$04,$0A,$02,$1B,$01,$02
db $01,$04,$03,$05,$03,$01,$02,$01,$04,$06,$02,$06,$01,$04,$05,$04
db $03,$01,$09,$02,$01,$03,$10,$01,$01,$04,$04,$02,$13,$04,$01,$04
db $0A,$01,$03,$01,$02,$08,$03,$01,$01,$01,$02,$05,$01,$01,$01,$01
db $03,$09,$03,$03,$07,$05,$01,$04,$03,$0D,$01,$06,$0F,$03,$03,$07
db $04,$06,$14,$02,$02,$05,$06,$03,$04,$0D,$04,$04,$02,$01,$05,$02
db $02,$09,$02,$05,$0E,$06,$12,$01,$13,$02,$07,$01,$02,$05,$0A,$01
db $0A,$03,$01,$03,$02,$02,$04,$03,$0B,$04,$09,$01,$01,$01,$01,$03
db $06,$04,$03,$01,$0F,$03,$04,$10,$07,$07,$03,$02,$02,$09,$0B,$06
db $08,$01,$0B,$02,$03,$05,$05,$08,$04,$02,$03,$02,$05,$09,$08,$02
db $07,$03,$02,$07,$11,$03,$09,$04,$08,$02,$06,$04,$01,$05,$08,$06
db $01,$03,$0A,$01,$02,$05,$04,$04,$02,$03,$07,$02,$0F,$02,$04,$04
db $05,$01,$03,$02,$0E,$01,$04,$07,$02,$03,$04,$03,$02,$01,$0D,$01
db $03,$02,$06,$03,$01,$04,$03,$07,$02,$06,$01,$03,$01,$01,$01,$01
db $04,$02,$04,$06,$02,$01,$03,$02,$0A,$03,$07,$02,$02,$01,$04,$0A
db $02,$03,$01,$06,$0F,$04,$02,$08,$02,$03,$09,$0A,$0A,$04,$04,$0F
db $02,$01,$03,$02,$04,$0A,$10,$03,$08,$08,$0B,$01,$02,$07,$0B,$02
db $05,$05,$03,$02,$04,$06,$03,$03,$08,$0A,$01,$20,$0D,$05,$02,$07
db $17,$02,$13,$0F,$02,$04,$04,$0A,$06,$05,$01,$04,$01,$01,$06,$09
db $11,$12,$0E,$02,$07,$03,$05,$07,$07,$03,$05,$04,$03,$03,$05,$04
db $01,$04,$05,$01,$05,$01,$02,$03,$02,$09,$05,$08,$02,$04,$03,$01
db $01,$04,$02,$01,$02,$04,$04,$03,$02,$0E,$08,$01,$02,$01,$02,$01
db $06,$01,$04,$01,$01,$03,$07,$0A,$02,$01,$01,$03,$04,$01,$09,$07
db $02,$0D,$02,$06,$02,$04,$0A,$02,$01,$08,$08,$01,$03,$08,$07,$03
db $03,$03,$02,$03,$0A,$04,$1E,$02,$09,$02,$04,$04,$0C,$06,$01,$02
db $03,$01,$02,$01,$0A,$06,$04,$09,$10,$01,$07,$02,$03,$04,$02,$02
db $02,$05,$03,$03,$01,$03,$04,$01,$1A,$02,$05,$04,$01,$01,$0A,$01
db $05,$05,$07,$01,$09,$04,$05,$02,$0A,$02,$04,$01,$03,$02,$01,$04
db $05,$01,$01,$03,$05,$07,$04,$01,$04,$09,$02,$02,$03,$01,$04,$03
db $12,$04,$09,$02,$02,$04,$03,$03,$02,$08,$04,$02,$04,$0A,$03,$01
db $07,$05,$04,$02,$07,$01,$03,$04,$08,$04,$08,$04,$01,$09,$07,$05
db $12,$05,$04,$01,$02,$03,$0C,$03,$05,$02,$02,$01,$03,$03,$0E,$06
db $06,$09,$0C,$08,$04,$09,$01,$02,$02,$07,$09,$03,$03,$02,$04,$02
db $01,$03,$01,$01,$02,$04,$0D,$01,$01,$04,$01,$03,$04,$07,$06,$03
db $03,$02,$03,$01,$0F,$01,$03,$03,$03,$05,$02,$06,$06,$04,$02,$0B
db $04,$02,$01,$05,$03,$02,$03,$04,$01,$04,$04,$01,$14,$04,$15,$01
db $02,$04,$05,$05,$04,$05,$02,$05,$02,$03,$02,$02,$03,$01,$02,$04
db $02,$01,$0A,$01,$07,$01,$08,$04,$14,$01,$04,$05,$03,$03,$02,$05
db $04,$01,$01,$0B,$03,$04,$07,$04,$03,$06,$02,$07,$04,$04,$02,$03
db $09,$01,$06,$01,$01,$02,$03,$0D,$06,$03,$02,$01,$0B,$06,$07,$01
db $01,$02,$07,$01,$05,$05,$04,$03,$04,$03,$09,$01,$0D,$02,$02,$01
db $01,$03,$01,$02,$04,$01,$0A,$01,$07,$03,$01,$02,$02,$01,$01,$13
db $04,$05,$02,$01,$01,$02,$04,$01,$04,$05,$05,$02,$09,$03,$0D,$01
db $03,$0A,$02,$03,$01,$09,$02,$01,$02,$01,$01,$05,$07,$07,$07,$06
db $02,$03,$01,$03,$08,$03,$09,$05,$02,$02,$04,$03,$01,$02,$04,$01
db $10,$02,$04,$05,$02,$01,$11,$04,$02,$03,$02,$01,$02,$04,$07,$03
db $03,$04,$01,$02,$02,$03,$05,$06,$03,$08,$06,$01,$01,$01,$09,$05
db $05,$02,$02,$05,$06,$02,$02,$02,$08,$01,$04,$02,$02,$09,$02,$05
db $0B,$03,$08,$06,$02,$01,$0C,$07,$01,$01,$0E,$06,$01,$08,$08,$01
db $04,$04,$01,$07,$15,$01,$07,$01,$06,$02,$04,$03,$03,$08,$01,$07
db $03,$04,$04,$05,$01,$09,$03,$01,$02,$02,$07,$02,$08,$07,$01,$03
db $02,$01,$08,$01,$03,$0E,$06,$01,$09,$0B,$09,$05,$05,$03,$08,$03
db $01,$01,$07,$04,$04,$01,$08,$01,$03,$01,$06,$04,$09,$04,$02,$01
db $09,$05,$06,$07,$03,$03,$13,$01,$04,$01,$0A,$0B,$06,$02,$01,$0A
db $04,$06,$13,$01,$03,$01,$03,$02,$08,$05,$01,$15,$06,$01,$02,$02
db $04,$0A,$03,$02,$0B,$07,$03,$02,$0B,$03,$01,$03,$0D,$03,$01,$0C
db $01,$05,$02,$04,$01,$04,$0B,$01,$04,$05,$05,$04,$02,$02,$0A,$04
db $08,$04,$0A,$07,$03,$02,$02,$06,$02,$08,$03,$02,$0B,$06,$0A,$05
db $01,$01,$0D,$0E,$02,$01,$08,$06,$08,$02,$01,$02,$03,$01,$05,$05
db $0A,$02,$01,$04,$01,$02,$02,$01,$03,$01,$01,$03,$03,$02,$01,$02
db $07,$02,$01,$02,$01,$02,$02,$01,$02,$03,$08,$01,$02,$03,$05,$01
db $07,$05,$08,$02,$02,$01,$15,$01,$04,$02,$0B,$14,$0A,$01,$09,$04
db $0D,$02,$06,$04,$01,$01,$01,$03,$06,$01,$04,$06,$0A,$05,$01,$03
db $05,$02,$09,$01,$08,$04,$04,$08,$09,$02,$05,$03,$0F,$03,$01,$02
db $01,$09,$03,$11,$03,$02,$02,$04,$03,$06,$03,$07,$0E,$04,$07,$04
db $01,$0E,$03,$01,$05,$0B,$02,$04,$04,$01,$0B,$04,$04,$0F,$01,$01
db $04,$01,$0C,$02,$03,$01,$03,$03,$0C,$06,$09,$01,$05,$03,$03,$03
db $04,$03,$01,$06,$0D,$05,$0B,$06,$01,$01,$08,$01,$0A,$06,$03,$02
db $08,$03,$06,$07,$11,$06,$03,$06,$03,$06,$05,$06,$0A,$08,$02,$07
db $01,$01,$06,$04,$01,$06,$04,$0B,$10,$04,$04,$01,$01,$06,$08,$06
db $07,$02,$02,$08,$03,$05,$06,$07,$03,$01,$01,$04,$07,$06,$02,$02
db $02,$02,$01,$04,$04,$06,$04,$0B,$03,$01,$04,$01,$05,$02,$02,$05
db $02,$12,$01,$03,$02,$06,$10,$03,$15,$01,$16,$03,$02,$06,$01,$01
db $02,$01,$02,$03,$01,$01,$09,$01,$05,$11,$08,$02,$02,$02,$05,$01
db $03,$01,$03,$06,$01,$02,$08,$01,$04,$01,$01,$06,$09,$02,$06,$03
db $03,$07,$13,$02,$02,$01,$0F,$01,$03,$01,$01,$01,$07,$03,$01,$01
db $14,$0C,$02,$03,$01,$03,$01,$03,$05,$01,$06,$02,$08,$04,$06,$0C
db $01,$04,$03,$04,$08,$04,$02,$04,$01,$09,$07,$02,$0A,$05,$04,$02
db $01,$03,$05,$05,$22,$01,$07,$01,$07,$04,$03,$02,$04,$01,$02,$0C
db $03,$04,$03,$06,$09,$02,$08,$07,$01,$01,$07,$02,$01,$02,$0B,$02
db $05,$02,$04,$03,$06,$01,$07,$01,$0C,$05,$07,$05,$07,$08,$0B,$04
db $03,$03,$05,$01,$08,$03,$01,$01,$04,$11,$07,$02,$01,$05,$02,$0A
db $07,$08,$09,$02,$04,$10,$07,$02,$05,$01,$12,$0A,$04,$02,$04,$02
db $06,$01,$02,$04,$01,$05,$01,$06,$02,$02,$04,$02,$01,$02,$0F,$04
db $02,$01,$09,$06,$01,$01,$10,$03,$08,$01,$01,$02,$02,$03,$02,$06
db $03,$03,$05,$0B,$05,$05,$01,$08,$06,$01,$01,$12,$07,$02,$04,$05
db $03,$01,$01,$01,$01,$01,$05,$05,$03,$04,$03,$0F,$03,$02,$01,$01
db $07,$02,$03,$01,$0D,$01,$02,$03,$02,$03,$05,$01,$03,$05,$01,$01
db $06,$01,$04,$02,$01,$03,$08,$05,$0D,$05,$04,$01,$05,$02,$02,$05
db $0E,$02,$0B,$0B,$02,$01,$14,$02,$0C,$02,$02,$02,$04,$05,$06,$01
db $12,$07,$02,$06,$05,$01,$0B,$04,$02,$06,$05,$07,$12,$02,$03,$05
db $19,$0B,$04,$04,$05,$09,$03,$06,$05,$01,$05,$05,$1C,$05,$17,$01
db $04,$02,$07,$03,$03,$03,$05,$01,$0D,$04,$02,$0F,$03,$04,$01,$11
db $03,$01,$04,$02,$08,$07,$08,$05,$08,$02,$01,$09,$04,$05,$0B,$05
db $01,$05,$08,$04,$02,$02,$04,$0F,$02,$02,$08,$0D,$01,$04,$03,$01
db $09,$01,$05,$02,$05,$02,$0B,$01,$08,$01,$0D,$03,$07,$04,$05,$0D
db $04,$03,$05,$02,$02,$04,$05,$04,$01,$06,$02,$0A,$01,$02,$01,$02
db $01,$0F,$0B,$01,$0A,$04,$14,$02,$0C,$02,$01,$02,$02,$03,$01,$01
db $04,$04,$01,$03,$02,$10,$01,$05,$06,$06,$02,$07,$01,$03,$02,$0B
db $01,$03,$03,$06,$03,$06,$07,$06,$04,$09,$01,$01,$0A,$01,$0A,$01
db $04,$02,$05,$01,$03,$01,$03,$04,$04,$02,$0C,$01,$09,$03,$01,$07
db $01,$02,$09,$03,$09,$09,$0E,$02,$02,$01,$0D,$04,$16,$02,$03,$02
db $01,$02,$13,$02,$06,$06,$02,$01,$01,$01,$18,$0F,$08,$04,$0A,$08
db $04,$02,$03,$01,$02,$01,$07,$06,$01,$03,$01,$01,$09,$01,$06,$01
db $01,$05,$01,$02,$01,$02,$01,$05,$06,$01,$03,$03,$03,$03,$05,$02
db $06,$04,$02,$02,$01,$01,$02,$06,$05,$05,$02,$0B,$01,$02,$04,$02
db $01,$04,$0C,$02,$08,$03,$04,$04,$05,$01,$0A,$08,$01,$02,$06,$01
db $02,$03,$01,$02,$08,$01,$07,$12,$07,$07,$07,$01,$04,$02,$05,$06
db $07,$01,$0B,$07,$05,$02,$08,$08,$05,$01,$02,$05,$09,$07,$0F,$01
db $0E,$04,$03,$06,$01,$04,$13,$01,$02,$03,$07,$05,$06,$06,$05,$0A
db $01,$01,$02,$03,$04,$0B,$03,$03,$01,$05,$04,$01,$04,$03,$08,$07
db $01,$03,$02,$03,$0E,$03,$02,$03,$0A,$01,$08,$01,$01,$02,$06,$01
db $11,$06,$01,$02,$0E,$09,$01,$03,$02,$01,$06,$03,$01,$09,$07,$01
db $05,$01,$08,$01,$01,$01,$03,$02,$01,$06,$01,$06,$08,$06,$05,$02
db $01,$02,$04,$02,$08,$01,$03,$03,$0D,$03,$02,$08,$01,$05,$01,$03
db $05,$01,$05,$06,$02,$01,$03,$06,$06,$04,$02,$01,$01,$06,$09,$0B
db $06,$02,$05,$06,$05,$0A,$01,$04,$06,$01,$01,$05,$04,$05,$0C,$0B
db $03,$06,$05,$01,$07,$01,$04,$08,$08,$04,$0F,$01,$08,$02,$08,$10
db $0B,$04,$02,$02,$04,$0E,$02,$02,$01,$01,$0E,$05,$02,$04,$07,$05
db $09,$01,$07,$01,$0A,$03,$01,$07,$03,$01,$0D,$06,$0D,$04,$03,$07
db $0A,$02,$01,$01,$03,$05,$01,$05,$07,$07,$01,$02,$03,$08,$07,$04
db $07,$06,$01,$04,$04,$03,$06,$01,$05,$01,$05,$07,$05,$01,$03,$04
db $05,$09,$15,$07,$04,$01,$0A,$02,$08,$02,$02,$01,$04,$05,$03,$04
db $0A,$01,$01,$02,$01,$05,$03,$04,$02,$02,$02,$02,$02,$01,$09,$01
db $05,$01,$04,$0E,$08,$06,$09,$02,$07,$04,$0C,$04,$06,$03,$07,$08
db $11,$01,$01,$04,$01,$07,$01,$02,$0A,$08,$02,$06,$03,$06,$09,$01
db $01,$07,$0A,$0F,$01,$04,$06,$03,$04,$01,$0D,$02,$02,$07,$01,$02
db $05,$02,$0C,$01,$05,$06,$01,$02,$07,$03,$07,$02,$01,$02,$0C,$02
db $02,$09,$05,$03,$04,$01,$07,$0E,$0C,$02,$06,$0D,$03,$05,$01,$04
db $05,$07,$01,$0B,$01,$02,$03,$04,$01,$05,$04,$07,$0B,$01,$02,$01
db $02,$05,$02,$03,$08,$0B,$08,$0E,$04,$02,$05,$08,$03,$01,$01,$04
db $02,$0E,$03,$03,$0D,$01,$05,$04,$02,$04,$02,$02,$01,$05,$06,$01
db $06,$02,$04,$01,$08,$05,$0F,$03,$10,$04,$01,$04,$0F,$03,$08,$01
db $0E,$0C,$0A,$0A,$08,$04,$0B,$01,$02,$05,$01,$09,$08,$02,$06,$01
db $0C,$02,$05,$04,$02,$02,$02,$01,$02,$08,$03,$0A,$01,$02,$02,$03
db $0B,$05,$01,$01,$01,$01,$01,$02,$01,$08,$05,$03,$03,$13,$08,$01
db $08,$04,$05,$05,$08,$08,$02,$03,$01,$0C,$0B,$06,$06,$03,$03,$02
db $08,$01,$02,$10,$06,$02,$03,$03,$05,$06,$03,$02,$02,$06,$0C,$06
db $0B,$01,$01,$05,$01,$02,$07,$06,$07,$12,$08,$03,$10,$04,$02,$01
db $0E,$08,$02,$03,$01,$02,$0E,$01,$03,$03,$02,$0C,$03,$04,$03,$03
db $03,$05,$04,$19,$0C,$01,$05,$04,$07,$02,$0E,$02,$03,$02,$02,$01
db $01,$01,$02,$01,$05,$06,$01,$02,$08,$06,$04,$06,$10,$01,$01,$04
db $03,$01,$09,$06,$02,$05,$02,$08,$03,$03,$03,$01,$02,$05,$0B,$02
db $04,$02,$01,$04,$03,$01,$07,$03,$03,$07,$05,$01,$06,$01,$01,$06
db $02,$01,$06,$04,$06,$08,$03,$05,$08,$03,$08,$01,$05,$01,$02,$03
db $01,$23,$01,$01,$01,$04,$06,$01,$15,$02,$02,$03,$01,$02,$01,$07
db $06,$02,$05,$03,$02,$04,$02,$02,$03,$01,$02,$01,$01,$07,$03,$03
db $04,$0C,$01,$0F,$01,$0B,$05,$14,$03,$02,$01,$01,$05,$01,$01,$05
db $14,$01,$0B,$01,$05,$03,$02,$06,$05,$02,$02,$01,$01,$09,$01,$04
db $04,$02,$07,$03,$02,$05,$06,$03,$07,$01,$01,$05,$01,$02,$02,$03
db $02,$05,$01,$05,$03,$03,$03,$0A,$04,$07,$09,$03,$05,$01,$07,$02
db $04,$06,$02,$04,$06,$01,$05,$02,$07,$05,$03,$0A,$14,$06,$09,$02
db $07,$04,$03,$04,$02,$08,$07,$01,$04,$02,$05,$03,$02,$01,$01,$06
db $01,$04,$02,$01,$02,$01,$04,$01,$02,$07,$07,$01,$07,$1A,$0D,$09
db $08,$06,$01,$02,$04,$01,$08,$01,$02,$07,$0B,$04,$0D,$01,$13,$04
db $02,$02,$07,$02,$04,$09,$05,$01,$07,$01,$02,$03,$03,$04,$06,$04
db $0A,$02,$06,$01,$02,$01,$07,$08,$0A,$05,$01,$09,$04,$02,$02,$02
db $05,$03,$09,$01,$04,$01,$02,$03,$06,$01,$06,$02,$02,$02,$08,$05
db $02,$06,$03,$02,$02,$0A,$03,$03,$01,$09,$06,$0A,$03,$05,$01,$01
db $02,$02,$01,$04,$01,$03,$15,$04,$0A,$02,$07,$07,$06,$06,$02,$01
db $01,$01,$02,$01,$03,$02,$05,$03,$18,$03,$06,$01,$05,$04,$05,$04
db $04,$02,$0A,$01,$02,$03,$0E,$06,$07,$01,$04,$01,$06,$01,$13,$09
db $02,$03,$07,$04,$03,$02,$01,$10,$0D,$09,$03,$05,$08,$03,$03,$04
db $0B,$06,$0B,$04,$07,$08,$02,$06,$02,$12,$02,$02,$01,$01,$01,$08
db $09,$06,$01,$01,$04,$02,$04,$08,$01,$01,$05,$03,$01,$02,$01,$08
db $07,$05,$01,$02,$01,$03,$09,$03,$01,$04,$03,$09,$0F,$01,$09,$07
db $12,$03,$03,$01,$01,$09,$05,$12,$02,$01,$0C,$02,$01,$06,$03,$05
db $08,$02,$09,$05,$01,$04,$08,$05,$0A,$02,$03,$03,$02,$02,$03,$04
db $05,$05,$01,$02,$03,$01,$06,$03,$03,$01,$02,$07,$05,$01,$01,$03
db $01,$03,$02,$09,$01,$0A,$03,$04,$0A,$02,$09,$02,$04,$01,$02,$01
db $06,$05,$02,$04,$04,$05,$01,$09,$04,$06,$05,$04,$01,$02,$07,$01
db $03,$02,$10,$01,$03,$03,$01,$02,$03,$01,$03,$04,$0C,$0C,$02,$06
db $04,$05,$01,$07,$03,$01,$02,$05,$05,$0B,$03,$03,$03,$01,$01,$07
db $03,$02,$02,$08,$09,$04,$01,$02,$06,$01,$03,$01,$01,$03,$07,$03
db $0B,$02,$02,$01,$02,$08,$01,$02,$09,$01,$02,$03,$06,$01,$03,$03
db $02,$05,$02,$08,$0A,$05,$0A,$09,$0E,$01,$03,$07,$04,$08,$04,$06
db $10,$01,$01,$06,$02,$08,$06,$03,$01,$02,$01,$02,$03,$01,$03,$09
db $0E,$03,$02,$01,$02,$06,$01,$02,$04,$02,$07,$01,$0B,$06,$03,$07
db $01,$01,$04,$09,$08,$01,$01,$02,$01,$03,$05,$01,$01,$05,$02,$02
db $04,$08,$04,$07,$07,$06,$04,$02,$05,$01,$05,$03,$01,$01,$03,$05
db $10,$01,$03,$04,$02,$02,$04,$06,$04,$02,$01,$01,$07,$07,$01,$02
db $05,$04,$09,$0C,$0A,$01,$04,$02,$05,$06,$06,$05,$04,$05,$01,$01
db $01,$06,$03,$01,$08,$02,$06,$01,$04,$01,$04,$04,$0E,$07,$08,$06
db $02,$02,$03,$01,$03,$05,$08,$03,$06,$02,$01,$02,$0C,$04,$01,$01
db $01,$01,$07,$05,$01,$02,$03,$04,$01,$02,$02,$06,$02,$02,$02,$01
db $0E,$06,$0C,$09,$01,$01,$02,$05,$05,$02,$06,$01,$0B,$02,$07,$08
db $06,$06,$0B,$01,$03,$02,$01,$0A,$06,$0E,$07,$01,$0C,$09,$07,$09
db $07,$03,$0A,$05,$07,$08,$01,$0C,$02,$09,$0B,$0D,$03,$02,$02,$04
db $03,$01,$03,$01,$01,$06,$03,$03,$18,$02,$03,$05,$06,$04,$04,$04
db $03,$01,$03,$0D,$04,$06,$01,$06,$02,$04,$08,$01,$04,$04,$01,$06
db $06,$02,$04,$01,$01,$02,$02,$01,$01,$0F,$05,$0A,$03,$08,$01,$06
db $01,$02,$01,$01,$01,$06,$01,$01,$04,$02,$02,$02,$01,$0A,$03,$01
db $06,$05,$02,$01,$03,$01,$09,$07,$01,$02,$06,$01,$02,$01,$03,$08
db $03,$0A,$01,$03,$02,$02,$01,$07,$02,$01,$01,$05,$03,$01,$02,$04
db $01,$08,$04,$02,$05,$02,$02,$01,$07,$01,$02,$03,$0B,$07,$05,$03
db $0E,$05,$03,$05,$02,$05,$01,$01,$02,$04,$06,$01,$06,$03,$03,$03
db $04,$01,$02,$01,$06,$04,$14,$0F,$14,$05,$04,$05,$06,$01,$01,$04
db $01,$03,$03,$02,$01,$0C,$02,$01,$08,$02,$03,$04,$07,$01,$04,$01
db $04,$08,$02,$02,$07,$04,$01,$02,$01,$09,$0A,$04,$04,$01,$03,$01
db $04,$04,$09,$01,$01,$03,$08,$02,$03,$07,$01,$04,$03,$03,$06,$08
db $12,$0
| 69.348837 | 70 | 0.479477 |
638489990d517f9b1cc01465ca54ce7ad127bdc1 | 5,123 | asm | Assembly | binutils-2.21.1/gcc-4.5.1/gcc/config/ia64/crtbegin.asm | cberner12/xv6 | 53c4dfef0d48287ca0d0f9d27eab7a6ed7fee845 | [
"MIT-0"
] | 51 | 2015-01-31T01:51:39.000Z | 2022-02-18T02:01:50.000Z | binutils-2.21.1/gcc-4.5.1/gcc/config/ia64/crtbegin.asm | cberner12/xv6 | 53c4dfef0d48287ca0d0f9d27eab7a6ed7fee845 | [
"MIT-0"
] | 7 | 2017-05-29T09:29:00.000Z | 2019-03-11T16:01:39.000Z | binutils-2.21.1/gcc-4.5.1/gcc/config/ia64/crtbegin.asm | cberner12/xv6 | 53c4dfef0d48287ca0d0f9d27eab7a6ed7fee845 | [
"MIT-0"
] | 12 | 2015-03-26T08:05:38.000Z | 2022-02-18T02:01:51.000Z | /* Copyright (C) 2000, 2001, 2003, 2005, 2009 Free Software Foundation, Inc.
Contributed by Jes Sorensen, <Jes.Sorensen@cern.ch>
This file is part of GCC.
GCC 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, or (at your option)
any later version.
GCC 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.
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/>. */
#include "auto-host.h"
.section .ctors,"aw","progbits"
.align 8
__CTOR_LIST__:
data8 -1
.section .dtors,"aw","progbits"
.align 8
__DTOR_LIST__:
data8 -1
.section .jcr,"aw","progbits"
.align 8
__JCR_LIST__:
.section .sdata
.type dtor_ptr,@object
.size dtor_ptr,8
dtor_ptr:
data8 @gprel(__DTOR_LIST__ + 8)
/* A handle for __cxa_finalize to manage c++ local destructors. */
.global __dso_handle
.type __dso_handle,@object
.size __dso_handle,8
#ifdef SHARED
.section .data
__dso_handle:
data8 __dso_handle
#else
.section .bss
.align 8
__dso_handle:
.skip 8
#endif
.hidden __dso_handle
#ifdef HAVE_INITFINI_ARRAY
.section .fini_array, "a"
data8 @fptr(__do_global_dtors_aux)
.section .init_array, "a"
data8 @fptr(__do_jv_register_classes)
data8 @fptr(__do_global_ctors_aux)
#else /* !HAVE_INITFINI_ARRAY */
/*
* Fragment of the ELF _fini routine that invokes our dtor cleanup.
*
* We make the call by indirection, because in large programs the
* .fini and .init sections are not in range of the destination, and
* we cannot allow the linker to insert a stub at the end of this
* fragment of the _fini function. Further, Itanium does not implement
* the long branch instructions, and we do not wish every program to
* trap to the kernel for emulation.
*
* Note that we require __do_global_dtors_aux to preserve the GP,
* so that the next fragment in .fini gets the right value.
*/
.section .fini,"ax","progbits"
{ .mlx
movl r2 = @pcrel(__do_global_dtors_aux - 16)
}
{ .mii
mov r3 = ip
;;
add r2 = r2, r3
;;
}
{ .mib
nop 0
mov b6 = r2
br.call.sptk.many b0 = b6
}
/* Likewise for _init. */
.section .init,"ax","progbits"
{ .mlx
movl r2 = @pcrel(__do_jv_register_classes - 16)
}
{ .mii
mov r3 = ip
;;
add r2 = r2, r3
;;
}
{ .mib
nop 0
mov b6 = r2
br.call.sptk.many b0 = b6
}
#endif /* !HAVE_INITFINI_ARRAY */
.section .text
.align 32
.proc __do_global_dtors_aux
__do_global_dtors_aux:
.prologue
#ifndef SHARED
.save ar.pfs, r35
alloc loc3 = ar.pfs, 0, 4, 1, 0
addl loc0 = @gprel(dtor_ptr), gp
.save rp, loc1
mov loc1 = rp
.body
mov loc2 = gp
nop 0
br.sptk.many .entry
#else
/*
if (__cxa_finalize)
__cxa_finalize(__dso_handle)
*/
.save ar.pfs, r35
alloc loc3 = ar.pfs, 0, 4, 1, 0
addl loc0 = @gprel(dtor_ptr), gp
addl r16 = @ltoff(@fptr(__cxa_finalize)), gp
;;
ld8 r16 = [r16]
;;
addl out0 = @ltoff(__dso_handle), gp
cmp.ne p7, p0 = r0, r16
;;
ld8 out0 = [out0]
(p7) ld8 r18 = [r16], 8
.save rp, loc1
mov loc1 = rp
.body
;;
mov loc2 = gp
(p7) ld8 gp = [r16]
(p7) mov b6 = r18
nop 0
nop 0
(p7) br.call.sptk.many rp = b6
;;
nop 0
nop 0
br.sptk.many .entry
#endif
/*
do {
dtor_ptr++;
(*(dtor_ptr-1)) ();
} while (dtor_ptr);
*/
.loop:
st8 [loc0] = r15 // update dtor_ptr (in memory)
ld8 r17 = [r16], 8 // r17 <- dtor's entry-point
nop 0
;;
ld8 gp = [r16] // gp <- dtor's gp
mov b6 = r17
br.call.sptk.many rp = b6
.entry: ld8 r15 = [loc0] // r15 <- dtor_ptr (gp-relative)
;;
add r16 = r15, loc2 // r16 <- dtor_ptr (absolute)
adds r15 = 8, r15
;;
ld8 r16 = [r16] // r16 <- pointer to dtor's fdesc
mov rp = loc1
mov ar.pfs = loc3
;;
cmp.ne p6, p0 = r0, r16
(p6) br.cond.sptk.few .loop
br.ret.sptk.many rp
.endp __do_global_dtors_aux
.align 32
.proc __do_jv_register_classes
__do_jv_register_classes:
.prologue
.save ar.pfs, r33
alloc loc1 = ar.pfs, 0, 3, 1, 0
movl out0 = @gprel(__JCR_LIST__)
;;
addl r14 = @ltoff(@fptr(_Jv_RegisterClasses)), gp
add out0 = out0, gp
.save rp, loc0
mov loc0 = rp
.body
;;
ld8 r14 = [r14]
ld8 r15 = [out0]
cmp.ne p6, p0 = r0, r0
;;
cmp.eq.or p6, p0 = r0, r14
cmp.eq.or p6, p0 = r0, r15
(p6) br.ret.sptk.many rp
ld8 r15 = [r14], 8
;;
nop 0
mov b6 = r15
mov loc2 = gp
ld8 gp = [r14]
br.call.sptk.many rp = b6
;;
mov gp = loc2
mov rp = loc0
mov ar.pfs = loc1
nop 0
nop 0
br.ret.sptk.many rp
.endp __do_jv_register_classes
#ifdef SHARED
.weak __cxa_finalize
#endif
.weak _Jv_RegisterClasses
| 20.090196 | 76 | 0.671286 |
66095cadf08b3ce7190b51e805cf823fd222a63e | 618 | asm | Assembly | tests/r800/r800_extras.asm | fengjixuchui/sjasmplus | df0fabd2411bf89e23637fce46d273f52dafbe16 | [
"BSD-3-Clause"
] | 220 | 2016-10-22T19:44:39.000Z | 2022-03-29T20:57:04.000Z | tests/r800/r800_extras.asm | ped7g/sjasmplus | 487635c8057cd5594c372d9b70bc00a3f3a1ecc4 | [
"BSD-3-Clause"
] | 153 | 2018-05-07T10:31:23.000Z | 2022-03-30T04:35:59.000Z | tests/r800/r800_extras.asm | ped7g/sjasmplus | 487635c8057cd5594c372d9b70bc00a3f3a1ecc4 | [
"BSD-3-Clause"
] | 51 | 2016-05-12T21:27:36.000Z | 2022-03-27T15:16:16.000Z | ;mulub a,a ; #EDF9 - not guaranteed to work properly, sjasmplus doesn't support it
mulub a,b ; #EDC1
mulub a,c ; #EDC9
mulub a,d ; #EDD1
mulub a,e ; #EDD9
;mulub a,h ; #EDE1 - not guaranteed
;mulub a,l ; #EDE9 - not guaranteed
muluw hl,bc ; #EDC3
;muluw hl,de ; #EDD3 - not guaranteed
;muluw hl,hl ; #EDE3 - not guaranteed
muluw hl,sp ; #EDF3
;; syntax variants
mulub b
muluw bc
;; invalid instr. variants
mulub a
muluw hl
| 30.9 | 99 | 0.472492 |
1b6868f9ee1fc194ab0afac70c59c03bd6d59774 | 2,334 | asm | Assembly | leddriver16bit.asm | brainsmoke/softpwmpdk | a893ed1e32ee5ad0b4101964e21a021cca0027c7 | [
"MIT"
] | 1 | 2021-11-08T17:12:45.000Z | 2021-11-08T17:12:45.000Z | leddriver16bit.asm | brainsmoke/softpwmpdk | a893ed1e32ee5ad0b4101964e21a021cca0027c7 | [
"MIT"
] | null | null | null | leddriver16bit.asm | brainsmoke/softpwmpdk | a893ed1e32ee5ad0b4101964e21a021cca0027c7 | [
"MIT"
] | 1 | 2022-03-25T17:50:53.000Z | 2022-03-25T17:50:53.000Z | .module softpwmpdk
BUFSIZE=8
.include "pdk.asm"
.include "delay.asm"
.include "settings.asm"
.include "uart2.asm"
.include "softpwm16.asm"
.area DATA (ABS)
.org 0x00
; bitwise ops need to have an address < 16
shiftreg: .ds 1
error: .ds 1
uart_state: .ds 1
pin_mask_cur: .ds 1
pinmask: .ds 1
uart_tmp: .ds 1
low1_staging: .ds 1
low2_staging: .ds 1
low3_staging: .ds 1
refresh: .ds 1
; word aligned
;...
p_lo: .ds 1
p_hi: .ds 1
out0: .ds 1
out1: .ds 1
cycle: .ds 1
switch_channel: .ds 1
high: .ds 1
high1: .ds 1
high2: .ds 1
high3: .ds 1
high1_staging: .ds 1
high2_staging: .ds 1
high3_staging: .ds 1
low: .ds 1
low1: .ds 1
low2: .ds 1
low3: .ds 1
dith: .ds 1
dith1: .ds 1
dith2: .ds 1
dith3: .ds 1
dith1_staging: .ds 1
dith2_staging: .ds 1
dith3_staging: .ds 1
cmp1: .ds 1
cmp2: .ds 1
cmp3: .ds 1
rem1: .ds 1
rem2: .ds 1
rem3: .ds 1
low_highnib: .ds 1
low_cur: .ds 1
;
index: .ds 1
cur_channel: .ds 1
wait_count: .ds 1
bit_count: .ds 1
reset_count: .ds 1
index_const: .ds 1
.area CODE (ABS)
.org 0x00
; pull mosfets low first
clock_8mhz
;
; ________ ________
; ________0000000011111111222222223333333344444444555555556666666677777777
; /\
; |-----------| (start_wait+1/2)*interval 9 1/2 baud
; time to first sample (avg) sample stop bit (avg)
;
;baud = 38400
;start_wait = 4
;bit_wait = 3
;check_interval = 64
;cycles = (.5+start_wait+8*bit_wait)*check_interval
;t = 9.5/baud
;freq = cycles/t
;print(freq)
FREQ=7372800
easypdk_calibrate FREQ, 3300
mov a, #PINMASK
mov pac, a
mov a, #0
mov pa, a
find_settings settings p_lo
read_settings index_const
softpwm_init
uart_init
softpwm
settings:
;.rept 256
;nop
;.endm
mov a, #INDEX
; update index by nopping (0x0000) out this instruction and appending a new mov, #NEW_INDEX
;
| 17.41791 | 103 | 0.523136 |
f8979726eb6616b420710f27d7184048c0ea7fb1 | 126 | asm | Assembly | src/Project7/SimpleAdd.asm | HSU-F20-CS243/p07-starter | 38e03cc8f993380c2316261f9d0ae078501356ca | [
"Apache-2.0"
] | null | null | null | src/Project7/SimpleAdd.asm | HSU-F20-CS243/p07-starter | 38e03cc8f993380c2316261f9d0ae078501356ca | [
"Apache-2.0"
] | null | null | null | src/Project7/SimpleAdd.asm | HSU-F20-CS243/p07-starter | 38e03cc8f993380c2316261f9d0ae078501356ca | [
"Apache-2.0"
] | null | null | null | @7
D=A
@SP
A=M
M=D
@SP
D=M+1
M=D
@8
D=A
@SP
A=M
M=D
@SP
D=M+1
M=D
@SP
M=M-1
A=M
D=M
@SP
M=M-1
A=M
D=D+M
@SP
A=M
M=D
@SP
M=M+1
| 4.2 | 5 | 0.492063 |
73fdffa1a8dbae9f58de4a63f2fe5bccb419a5ca | 67 | asm | Assembly | testdata/test.asm | lwagner94/mycpu | d057e3d466e95dea6ce0124997f4d08b01ce4cd5 | [
"MIT"
] | null | null | null | testdata/test.asm | lwagner94/mycpu | d057e3d466e95dea6ce0124997f4d08b01ce4cd5 | [
"MIT"
] | null | null | null | testdata/test.asm | lwagner94/mycpu | d057e3d466e95dea6ce0124997f4d08b01ce4cd5 | [
"MIT"
] | 1 | 2018-12-02T20:42:36.000Z | 2018-12-02T20:42:36.000Z | ldi sp, MEMORY_END // Setup stack
ldi r0, 10
subi r0, r0, 1
halt
| 9.571429 | 33 | 0.671642 |
45f0c3b6b815af0144249c64fb54225b85a08a87 | 1,431 | asm | Assembly | programs/oeis/000/A000969.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/000/A000969.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/000/A000969.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A000969: Expansion of (1+x+2*x^2)/((1-x)^2*(1-x^3)).
; 1,3,7,12,18,26,35,45,57,70,84,100,117,135,155,176,198,222,247,273,301,330,360,392,425,459,495,532,570,610,651,693,737,782,828,876,925,975,1027,1080,1134,1190,1247,1305,1365,1426,1488,1552,1617,1683,1751,1820,1890,1962,2035,2109,2185,2262,2340,2420,2501,2583,2667,2752,2838,2926,3015,3105,3197,3290,3384,3480,3577,3675,3775,3876,3978,4082,4187,4293,4401,4510,4620,4732,4845,4959,5075,5192,5310,5430,5551,5673,5797,5922,6048,6176,6305,6435,6567,6700,6834,6970,7107,7245,7385,7526,7668,7812,7957,8103,8251,8400,8550,8702,8855,9009,9165,9322,9480,9640,9801,9963,10127,10292,10458,10626,10795,10965,11137,11310,11484,11660,11837,12015,12195,12376,12558,12742,12927,13113,13301,13490,13680,13872,14065,14259,14455,14652,14850,15050,15251,15453,15657,15862,16068,16276,16485,16695,16907,17120,17334,17550,17767,17985,18205,18426,18648,18872,19097,19323,19551,19780,20010,20242,20475,20709,20945,21182,21420,21660,21901,22143,22387,22632,22878,23126,23375,23625,23877,24130,24384,24640,24897,25155,25415,25676,25938,26202,26467,26733,27001,27270,27540,27812,28085,28359,28635,28912,29190,29470,29751,30033,30317,30602,30888,31176,31465,31755,32047,32340,32634,32930,33227,33525,33825,34126,34428,34732,35037,35343,35651,35960,36270,36582,36895,37209,37525,37842,38160,38480,38801,39123,39447,39772,40098,40426,40755,41085,41417,41750
mov $1,$0
add $0,3
add $1,$0
bin $1,2
div $1,3
| 159 | 1,327 | 0.789658 |
bebaad384aef8caefed22cdaa067dce1c2a50aa6 | 261 | asm | Assembly | programs/oeis/057/A057073.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/057/A057073.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/057/A057073.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A057073: floor[11^11/n].
; 285311670611,142655835305,95103890203,71327917652,57062334122,47551945101,40758810087,35663958826,31701296734,28531167061,25937424601,23775972550,21947051585,20379405043,19020778040
add $0,1
mov $1,285311670611
div $1,$0
mov $0,$1
| 32.625 | 183 | 0.823755 |
fd29c749a52a4744fae78a026e4b0b31edfcf101 | 43,652 | asm | Assembly | init.asm | sloanetj/Xv6-Container-Support | 80a58b9ac7ead24c63d67ee21ab6cdc72243ab76 | [
"MIT-0"
] | null | null | null | init.asm | sloanetj/Xv6-Container-Support | 80a58b9ac7ead24c63d67ee21ab6cdc72243ab76 | [
"MIT-0"
] | null | null | null | init.asm | sloanetj/Xv6-Container-Support | 80a58b9ac7ead24c63d67ee21ab6cdc72243ab76 | [
"MIT-0"
] | null | null | null |
_init: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
char *argv[] = {"sh", 0};
int
main(void)
{
0: 8d 4c 24 04 lea 0x4(%esp),%ecx
4: 83 e4 f0 and $0xfffffff0,%esp
7: ff 71 fc pushl -0x4(%ecx)
a: 55 push %ebp
b: 89 e5 mov %esp,%ebp
d: 53 push %ebx
e: 51 push %ecx
int pid, wpid;
if (open("console", O_RDWR) < 0) {
f: 83 ec 08 sub $0x8,%esp
12: 6a 02 push $0x2
14: 68 58 08 00 00 push $0x858
19: e8 83 03 00 00 call 3a1 <open>
1e: 83 c4 10 add $0x10,%esp
21: 85 c0 test %eax,%eax
23: 0f 88 9f 00 00 00 js c8 <main+0xc8>
mknod("console", 1, 1);
open("console", O_RDWR);
}
dup(0); // stdout
29: 83 ec 0c sub $0xc,%esp
2c: 6a 00 push $0x0
2e: e8 a6 03 00 00 call 3d9 <dup>
dup(0); // stderr
33: c7 04 24 00 00 00 00 movl $0x0,(%esp)
3a: e8 9a 03 00 00 call 3d9 <dup>
3f: 83 c4 10 add $0x10,%esp
42: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
for (;;) {
printf(1, "init: starting sh\n");
48: 83 ec 08 sub $0x8,%esp
4b: 68 60 08 00 00 push $0x860
50: 6a 01 push $0x1
52: e8 a9 04 00 00 call 500 <printf>
pid = fork();
57: e8 fd 02 00 00 call 359 <fork>
if (pid < 0) {
5c: 83 c4 10 add $0x10,%esp
5f: 85 c0 test %eax,%eax
pid = fork();
61: 89 c3 mov %eax,%ebx
if (pid < 0) {
63: 78 2c js 91 <main+0x91>
printf(1, "init: fork failed\n");
exit();
}
if (pid == 0) {
65: 74 3d je a4 <main+0xa4>
67: 89 f6 mov %esi,%esi
69: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
exec("sh", argv);
printf(1, "init: exec sh failed\n");
exit();
}
while ((wpid = wait()) >= 0 && wpid != pid) printf(1, "zombie!\n");
70: e8 f4 02 00 00 call 369 <wait>
75: 85 c0 test %eax,%eax
77: 78 cf js 48 <main+0x48>
79: 39 c3 cmp %eax,%ebx
7b: 74 cb je 48 <main+0x48>
7d: 83 ec 08 sub $0x8,%esp
80: 68 9f 08 00 00 push $0x89f
85: 6a 01 push $0x1
87: e8 74 04 00 00 call 500 <printf>
8c: 83 c4 10 add $0x10,%esp
8f: eb df jmp 70 <main+0x70>
printf(1, "init: fork failed\n");
91: 53 push %ebx
92: 53 push %ebx
93: 68 73 08 00 00 push $0x873
98: 6a 01 push $0x1
9a: e8 61 04 00 00 call 500 <printf>
exit();
9f: e8 bd 02 00 00 call 361 <exit>
exec("sh", argv);
a4: 50 push %eax
a5: 50 push %eax
a6: 68 98 0b 00 00 push $0xb98
ab: 68 86 08 00 00 push $0x886
b0: e8 e4 02 00 00 call 399 <exec>
printf(1, "init: exec sh failed\n");
b5: 5a pop %edx
b6: 59 pop %ecx
b7: 68 89 08 00 00 push $0x889
bc: 6a 01 push $0x1
be: e8 3d 04 00 00 call 500 <printf>
exit();
c3: e8 99 02 00 00 call 361 <exit>
mknod("console", 1, 1);
c8: 50 push %eax
c9: 6a 01 push $0x1
cb: 6a 01 push $0x1
cd: 68 58 08 00 00 push $0x858
d2: e8 d2 02 00 00 call 3a9 <mknod>
open("console", O_RDWR);
d7: 58 pop %eax
d8: 5a pop %edx
d9: 6a 02 push $0x2
db: 68 58 08 00 00 push $0x858
e0: e8 bc 02 00 00 call 3a1 <open>
e5: 83 c4 10 add $0x10,%esp
e8: e9 3c ff ff ff jmp 29 <main+0x29>
ed: 66 90 xchg %ax,%ax
ef: 90 nop
000000f0 <strcpy>:
#include "user.h"
#include "x86.h"
char *
strcpy(char *s, char *t)
{
f0: 55 push %ebp
f1: 89 e5 mov %esp,%ebp
f3: 53 push %ebx
f4: 8b 45 08 mov 0x8(%ebp),%eax
f7: 8b 4d 0c mov 0xc(%ebp),%ecx
char *os;
os = s;
while ((*s++ = *t++) != 0)
fa: 89 c2 mov %eax,%edx
fc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
100: 83 c1 01 add $0x1,%ecx
103: 0f b6 59 ff movzbl -0x1(%ecx),%ebx
107: 83 c2 01 add $0x1,%edx
10a: 84 db test %bl,%bl
10c: 88 5a ff mov %bl,-0x1(%edx)
10f: 75 ef jne 100 <strcpy+0x10>
;
return os;
}
111: 5b pop %ebx
112: 5d pop %ebp
113: c3 ret
114: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
11a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
00000120 <strcmp>:
int
strcmp(const char *p, const char *q)
{
120: 55 push %ebp
121: 89 e5 mov %esp,%ebp
123: 53 push %ebx
124: 8b 55 08 mov 0x8(%ebp),%edx
127: 8b 4d 0c mov 0xc(%ebp),%ecx
while (*p && *p == *q) p++, q++;
12a: 0f b6 02 movzbl (%edx),%eax
12d: 0f b6 19 movzbl (%ecx),%ebx
130: 84 c0 test %al,%al
132: 75 1c jne 150 <strcmp+0x30>
134: eb 2a jmp 160 <strcmp+0x40>
136: 8d 76 00 lea 0x0(%esi),%esi
139: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
140: 83 c2 01 add $0x1,%edx
143: 0f b6 02 movzbl (%edx),%eax
146: 83 c1 01 add $0x1,%ecx
149: 0f b6 19 movzbl (%ecx),%ebx
14c: 84 c0 test %al,%al
14e: 74 10 je 160 <strcmp+0x40>
150: 38 d8 cmp %bl,%al
152: 74 ec je 140 <strcmp+0x20>
return (uchar)*p - (uchar)*q;
154: 29 d8 sub %ebx,%eax
}
156: 5b pop %ebx
157: 5d pop %ebp
158: c3 ret
159: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
160: 31 c0 xor %eax,%eax
return (uchar)*p - (uchar)*q;
162: 29 d8 sub %ebx,%eax
}
164: 5b pop %ebx
165: 5d pop %ebp
166: c3 ret
167: 89 f6 mov %esi,%esi
169: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000170 <strlen>:
uint
strlen(char *s)
{
170: 55 push %ebp
171: 89 e5 mov %esp,%ebp
173: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
for (n = 0; s[n]; n++)
176: 80 39 00 cmpb $0x0,(%ecx)
179: 74 15 je 190 <strlen+0x20>
17b: 31 d2 xor %edx,%edx
17d: 8d 76 00 lea 0x0(%esi),%esi
180: 83 c2 01 add $0x1,%edx
183: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1)
187: 89 d0 mov %edx,%eax
189: 75 f5 jne 180 <strlen+0x10>
;
return n;
}
18b: 5d pop %ebp
18c: c3 ret
18d: 8d 76 00 lea 0x0(%esi),%esi
for (n = 0; s[n]; n++)
190: 31 c0 xor %eax,%eax
}
192: 5d pop %ebp
193: c3 ret
194: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
19a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
000001a0 <memset>:
void *
memset(void *dst, int c, uint n)
{
1a0: 55 push %ebp
1a1: 89 e5 mov %esp,%ebp
1a3: 57 push %edi
1a4: 8b 55 08 mov 0x8(%ebp),%edx
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" : "=D"(addr), "=c"(cnt) : "0"(addr), "1"(cnt), "a"(data) : "memory", "cc");
1a7: 8b 4d 10 mov 0x10(%ebp),%ecx
1aa: 8b 45 0c mov 0xc(%ebp),%eax
1ad: 89 d7 mov %edx,%edi
1af: fc cld
1b0: f3 aa rep stos %al,%es:(%edi)
stosb(dst, c, n);
return dst;
}
1b2: 89 d0 mov %edx,%eax
1b4: 5f pop %edi
1b5: 5d pop %ebp
1b6: c3 ret
1b7: 89 f6 mov %esi,%esi
1b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
000001c0 <strchr>:
char *
strchr(const char *s, char c)
{
1c0: 55 push %ebp
1c1: 89 e5 mov %esp,%ebp
1c3: 53 push %ebx
1c4: 8b 45 08 mov 0x8(%ebp),%eax
1c7: 8b 5d 0c mov 0xc(%ebp),%ebx
for (; *s; s++)
1ca: 0f b6 10 movzbl (%eax),%edx
1cd: 84 d2 test %dl,%dl
1cf: 74 1d je 1ee <strchr+0x2e>
if (*s == c) return (char *)s;
1d1: 38 d3 cmp %dl,%bl
1d3: 89 d9 mov %ebx,%ecx
1d5: 75 0d jne 1e4 <strchr+0x24>
1d7: eb 17 jmp 1f0 <strchr+0x30>
1d9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
1e0: 38 ca cmp %cl,%dl
1e2: 74 0c je 1f0 <strchr+0x30>
for (; *s; s++)
1e4: 83 c0 01 add $0x1,%eax
1e7: 0f b6 10 movzbl (%eax),%edx
1ea: 84 d2 test %dl,%dl
1ec: 75 f2 jne 1e0 <strchr+0x20>
return 0;
1ee: 31 c0 xor %eax,%eax
}
1f0: 5b pop %ebx
1f1: 5d pop %ebp
1f2: c3 ret
1f3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
1f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000200 <gets>:
char *
gets(char *buf, int max)
{
200: 55 push %ebp
201: 89 e5 mov %esp,%ebp
203: 57 push %edi
204: 56 push %esi
205: 53 push %ebx
int i, cc;
char c;
for (i = 0; i + 1 < max;) {
206: 31 f6 xor %esi,%esi
208: 89 f3 mov %esi,%ebx
{
20a: 83 ec 1c sub $0x1c,%esp
20d: 8b 7d 08 mov 0x8(%ebp),%edi
for (i = 0; i + 1 < max;) {
210: eb 2f jmp 241 <gets+0x41>
212: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
cc = read(0, &c, 1);
218: 8d 45 e7 lea -0x19(%ebp),%eax
21b: 83 ec 04 sub $0x4,%esp
21e: 6a 01 push $0x1
220: 50 push %eax
221: 6a 00 push $0x0
223: e8 51 01 00 00 call 379 <read>
if (cc < 1) break;
228: 83 c4 10 add $0x10,%esp
22b: 85 c0 test %eax,%eax
22d: 7e 1c jle 24b <gets+0x4b>
buf[i++] = c;
22f: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
233: 83 c7 01 add $0x1,%edi
236: 88 47 ff mov %al,-0x1(%edi)
if (c == '\n' || c == '\r') break;
239: 3c 0a cmp $0xa,%al
23b: 74 23 je 260 <gets+0x60>
23d: 3c 0d cmp $0xd,%al
23f: 74 1f je 260 <gets+0x60>
for (i = 0; i + 1 < max;) {
241: 83 c3 01 add $0x1,%ebx
244: 3b 5d 0c cmp 0xc(%ebp),%ebx
247: 89 fe mov %edi,%esi
249: 7c cd jl 218 <gets+0x18>
24b: 89 f3 mov %esi,%ebx
}
buf[i] = '\0';
return buf;
}
24d: 8b 45 08 mov 0x8(%ebp),%eax
buf[i] = '\0';
250: c6 03 00 movb $0x0,(%ebx)
}
253: 8d 65 f4 lea -0xc(%ebp),%esp
256: 5b pop %ebx
257: 5e pop %esi
258: 5f pop %edi
259: 5d pop %ebp
25a: c3 ret
25b: 90 nop
25c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
260: 8b 75 08 mov 0x8(%ebp),%esi
263: 8b 45 08 mov 0x8(%ebp),%eax
266: 01 de add %ebx,%esi
268: 89 f3 mov %esi,%ebx
buf[i] = '\0';
26a: c6 03 00 movb $0x0,(%ebx)
}
26d: 8d 65 f4 lea -0xc(%ebp),%esp
270: 5b pop %ebx
271: 5e pop %esi
272: 5f pop %edi
273: 5d pop %ebp
274: c3 ret
275: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
279: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000280 <stat>:
int
stat(char *n, struct stat *st)
{
280: 55 push %ebp
281: 89 e5 mov %esp,%ebp
283: 56 push %esi
284: 53 push %ebx
int fd;
int r;
fd = open(n, O_RDONLY);
285: 83 ec 08 sub $0x8,%esp
288: 6a 00 push $0x0
28a: ff 75 08 pushl 0x8(%ebp)
28d: e8 0f 01 00 00 call 3a1 <open>
if (fd < 0) return -1;
292: 83 c4 10 add $0x10,%esp
295: 85 c0 test %eax,%eax
297: 78 27 js 2c0 <stat+0x40>
r = fstat(fd, st);
299: 83 ec 08 sub $0x8,%esp
29c: ff 75 0c pushl 0xc(%ebp)
29f: 89 c3 mov %eax,%ebx
2a1: 50 push %eax
2a2: e8 12 01 00 00 call 3b9 <fstat>
close(fd);
2a7: 89 1c 24 mov %ebx,(%esp)
r = fstat(fd, st);
2aa: 89 c6 mov %eax,%esi
close(fd);
2ac: e8 d8 00 00 00 call 389 <close>
return r;
2b1: 83 c4 10 add $0x10,%esp
}
2b4: 8d 65 f8 lea -0x8(%ebp),%esp
2b7: 89 f0 mov %esi,%eax
2b9: 5b pop %ebx
2ba: 5e pop %esi
2bb: 5d pop %ebp
2bc: c3 ret
2bd: 8d 76 00 lea 0x0(%esi),%esi
if (fd < 0) return -1;
2c0: be ff ff ff ff mov $0xffffffff,%esi
2c5: eb ed jmp 2b4 <stat+0x34>
2c7: 89 f6 mov %esi,%esi
2c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
000002d0 <atoi>:
int
atoi(const char *s)
{
2d0: 55 push %ebp
2d1: 89 e5 mov %esp,%ebp
2d3: 53 push %ebx
2d4: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
n = 0;
while ('0' <= *s && *s <= '9') n= n * 10 + *s++ - '0';
2d7: 0f be 11 movsbl (%ecx),%edx
2da: 8d 42 d0 lea -0x30(%edx),%eax
2dd: 3c 09 cmp $0x9,%al
n = 0;
2df: b8 00 00 00 00 mov $0x0,%eax
while ('0' <= *s && *s <= '9') n= n * 10 + *s++ - '0';
2e4: 77 1f ja 305 <atoi+0x35>
2e6: 8d 76 00 lea 0x0(%esi),%esi
2e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
2f0: 8d 04 80 lea (%eax,%eax,4),%eax
2f3: 83 c1 01 add $0x1,%ecx
2f6: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax
2fa: 0f be 11 movsbl (%ecx),%edx
2fd: 8d 5a d0 lea -0x30(%edx),%ebx
300: 80 fb 09 cmp $0x9,%bl
303: 76 eb jbe 2f0 <atoi+0x20>
return n;
}
305: 5b pop %ebx
306: 5d pop %ebp
307: c3 ret
308: 90 nop
309: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000310 <memmove>:
void *
memmove(void *vdst, void *vsrc, int n)
{
310: 55 push %ebp
311: 89 e5 mov %esp,%ebp
313: 56 push %esi
314: 53 push %ebx
315: 8b 5d 10 mov 0x10(%ebp),%ebx
318: 8b 45 08 mov 0x8(%ebp),%eax
31b: 8b 75 0c mov 0xc(%ebp),%esi
char *dst, *src;
dst = vdst;
src = vsrc;
while (n-- > 0) *dst++= *src++;
31e: 85 db test %ebx,%ebx
320: 7e 14 jle 336 <memmove+0x26>
322: 31 d2 xor %edx,%edx
324: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
328: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
32c: 88 0c 10 mov %cl,(%eax,%edx,1)
32f: 83 c2 01 add $0x1,%edx
332: 39 d3 cmp %edx,%ebx
334: 75 f2 jne 328 <memmove+0x18>
return vdst;
}
336: 5b pop %ebx
337: 5e pop %esi
338: 5d pop %ebp
339: c3 ret
33a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
00000340 <shm_get>:
char*
shm_get(char* name)
{
340: 55 push %ebp
341: 89 e5 mov %esp,%ebp
return shmget(name);
}
343: 5d pop %ebp
return shmget(name);
344: e9 00 01 00 00 jmp 449 <shmget>
349: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000350 <shm_rem>:
int
shm_rem(char* name)
{
350: 55 push %ebp
351: 89 e5 mov %esp,%ebp
return shmrem(name);
}
353: 5d pop %ebp
return shmrem(name);
354: e9 f8 00 00 00 jmp 451 <shmrem>
00000359 <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
359: b8 01 00 00 00 mov $0x1,%eax
35e: cd 40 int $0x40
360: c3 ret
00000361 <exit>:
SYSCALL(exit)
361: b8 02 00 00 00 mov $0x2,%eax
366: cd 40 int $0x40
368: c3 ret
00000369 <wait>:
SYSCALL(wait)
369: b8 03 00 00 00 mov $0x3,%eax
36e: cd 40 int $0x40
370: c3 ret
00000371 <pipe>:
SYSCALL(pipe)
371: b8 04 00 00 00 mov $0x4,%eax
376: cd 40 int $0x40
378: c3 ret
00000379 <read>:
SYSCALL(read)
379: b8 05 00 00 00 mov $0x5,%eax
37e: cd 40 int $0x40
380: c3 ret
00000381 <write>:
SYSCALL(write)
381: b8 10 00 00 00 mov $0x10,%eax
386: cd 40 int $0x40
388: c3 ret
00000389 <close>:
SYSCALL(close)
389: b8 15 00 00 00 mov $0x15,%eax
38e: cd 40 int $0x40
390: c3 ret
00000391 <kill>:
SYSCALL(kill)
391: b8 06 00 00 00 mov $0x6,%eax
396: cd 40 int $0x40
398: c3 ret
00000399 <exec>:
SYSCALL(exec)
399: b8 07 00 00 00 mov $0x7,%eax
39e: cd 40 int $0x40
3a0: c3 ret
000003a1 <open>:
SYSCALL(open)
3a1: b8 0f 00 00 00 mov $0xf,%eax
3a6: cd 40 int $0x40
3a8: c3 ret
000003a9 <mknod>:
SYSCALL(mknod)
3a9: b8 11 00 00 00 mov $0x11,%eax
3ae: cd 40 int $0x40
3b0: c3 ret
000003b1 <unlink>:
SYSCALL(unlink)
3b1: b8 12 00 00 00 mov $0x12,%eax
3b6: cd 40 int $0x40
3b8: c3 ret
000003b9 <fstat>:
SYSCALL(fstat)
3b9: b8 08 00 00 00 mov $0x8,%eax
3be: cd 40 int $0x40
3c0: c3 ret
000003c1 <link>:
SYSCALL(link)
3c1: b8 13 00 00 00 mov $0x13,%eax
3c6: cd 40 int $0x40
3c8: c3 ret
000003c9 <mkdir>:
SYSCALL(mkdir)
3c9: b8 14 00 00 00 mov $0x14,%eax
3ce: cd 40 int $0x40
3d0: c3 ret
000003d1 <chdir>:
SYSCALL(chdir)
3d1: b8 09 00 00 00 mov $0x9,%eax
3d6: cd 40 int $0x40
3d8: c3 ret
000003d9 <dup>:
SYSCALL(dup)
3d9: b8 0a 00 00 00 mov $0xa,%eax
3de: cd 40 int $0x40
3e0: c3 ret
000003e1 <getpid>:
SYSCALL(getpid)
3e1: b8 0b 00 00 00 mov $0xb,%eax
3e6: cd 40 int $0x40
3e8: c3 ret
000003e9 <sbrk>:
SYSCALL(sbrk)
3e9: b8 0c 00 00 00 mov $0xc,%eax
3ee: cd 40 int $0x40
3f0: c3 ret
000003f1 <sleep>:
SYSCALL(sleep)
3f1: b8 0d 00 00 00 mov $0xd,%eax
3f6: cd 40 int $0x40
3f8: c3 ret
000003f9 <uptime>:
SYSCALL(uptime)
3f9: b8 0e 00 00 00 mov $0xe,%eax
3fe: cd 40 int $0x40
400: c3 ret
00000401 <mcreate>:
SYSCALL(mcreate)
401: b8 16 00 00 00 mov $0x16,%eax
406: cd 40 int $0x40
408: c3 ret
00000409 <mdelete>:
SYSCALL(mdelete)
409: b8 17 00 00 00 mov $0x17,%eax
40e: cd 40 int $0x40
410: c3 ret
00000411 <mlock>:
SYSCALL(mlock)
411: b8 18 00 00 00 mov $0x18,%eax
416: cd 40 int $0x40
418: c3 ret
00000419 <munlock>:
SYSCALL(munlock)
419: b8 19 00 00 00 mov $0x19,%eax
41e: cd 40 int $0x40
420: c3 ret
00000421 <waitcv>:
SYSCALL(waitcv)
421: b8 1a 00 00 00 mov $0x1a,%eax
426: cd 40 int $0x40
428: c3 ret
00000429 <signalcv>:
SYSCALL(signalcv)
429: b8 1b 00 00 00 mov $0x1b,%eax
42e: cd 40 int $0x40
430: c3 ret
00000431 <prio_set>:
SYSCALL(prio_set)
431: b8 1c 00 00 00 mov $0x1c,%eax
436: cd 40 int $0x40
438: c3 ret
00000439 <testpqeq>:
SYSCALL(testpqeq)
439: b8 1d 00 00 00 mov $0x1d,%eax
43e: cd 40 int $0x40
440: c3 ret
00000441 <testpqdq>:
SYSCALL(testpqdq)
441: b8 1e 00 00 00 mov $0x1e,%eax
446: cd 40 int $0x40
448: c3 ret
00000449 <shmget>:
SYSCALL(shmget)
449: b8 1f 00 00 00 mov $0x1f,%eax
44e: cd 40 int $0x40
450: c3 ret
00000451 <shmrem>:
451: b8 20 00 00 00 mov $0x20,%eax
456: cd 40 int $0x40
458: c3 ret
459: 66 90 xchg %ax,%ax
45b: 66 90 xchg %ax,%ax
45d: 66 90 xchg %ax,%ax
45f: 90 nop
00000460 <printint>:
write(fd, &c, 1);
}
static void
printint(int fd, int xx, int base, int sgn)
{
460: 55 push %ebp
461: 89 e5 mov %esp,%ebp
463: 57 push %edi
464: 56 push %esi
465: 53 push %ebx
466: 83 ec 3c sub $0x3c,%esp
char buf[16];
int i, neg;
uint x;
neg = 0;
if (sgn && xx < 0) {
469: 85 d2 test %edx,%edx
{
46b: 89 45 c0 mov %eax,-0x40(%ebp)
neg = 1;
x = -xx;
46e: 89 d0 mov %edx,%eax
if (sgn && xx < 0) {
470: 79 76 jns 4e8 <printint+0x88>
472: f6 45 08 01 testb $0x1,0x8(%ebp)
476: 74 70 je 4e8 <printint+0x88>
x = -xx;
478: f7 d8 neg %eax
neg = 1;
47a: c7 45 c4 01 00 00 00 movl $0x1,-0x3c(%ebp)
} else {
x = xx;
}
i = 0;
481: 31 f6 xor %esi,%esi
483: 8d 5d d7 lea -0x29(%ebp),%ebx
486: eb 0a jmp 492 <printint+0x32>
488: 90 nop
489: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
do {
buf[i++] = digits[x % base];
490: 89 fe mov %edi,%esi
492: 31 d2 xor %edx,%edx
494: 8d 7e 01 lea 0x1(%esi),%edi
497: f7 f1 div %ecx
499: 0f b6 92 b0 08 00 00 movzbl 0x8b0(%edx),%edx
} while ((x /= base) != 0);
4a0: 85 c0 test %eax,%eax
buf[i++] = digits[x % base];
4a2: 88 14 3b mov %dl,(%ebx,%edi,1)
} while ((x /= base) != 0);
4a5: 75 e9 jne 490 <printint+0x30>
if (neg) buf[i++] = '-';
4a7: 8b 45 c4 mov -0x3c(%ebp),%eax
4aa: 85 c0 test %eax,%eax
4ac: 74 08 je 4b6 <printint+0x56>
4ae: c6 44 3d d8 2d movb $0x2d,-0x28(%ebp,%edi,1)
4b3: 8d 7e 02 lea 0x2(%esi),%edi
4b6: 8d 74 3d d7 lea -0x29(%ebp,%edi,1),%esi
4ba: 8b 7d c0 mov -0x40(%ebp),%edi
4bd: 8d 76 00 lea 0x0(%esi),%esi
4c0: 0f b6 06 movzbl (%esi),%eax
write(fd, &c, 1);
4c3: 83 ec 04 sub $0x4,%esp
4c6: 83 ee 01 sub $0x1,%esi
4c9: 6a 01 push $0x1
4cb: 53 push %ebx
4cc: 57 push %edi
4cd: 88 45 d7 mov %al,-0x29(%ebp)
4d0: e8 ac fe ff ff call 381 <write>
while (--i >= 0) putc(fd, buf[i]);
4d5: 83 c4 10 add $0x10,%esp
4d8: 39 de cmp %ebx,%esi
4da: 75 e4 jne 4c0 <printint+0x60>
}
4dc: 8d 65 f4 lea -0xc(%ebp),%esp
4df: 5b pop %ebx
4e0: 5e pop %esi
4e1: 5f pop %edi
4e2: 5d pop %ebp
4e3: c3 ret
4e4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
neg = 0;
4e8: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp)
4ef: eb 90 jmp 481 <printint+0x21>
4f1: eb 0d jmp 500 <printf>
4f3: 90 nop
4f4: 90 nop
4f5: 90 nop
4f6: 90 nop
4f7: 90 nop
4f8: 90 nop
4f9: 90 nop
4fa: 90 nop
4fb: 90 nop
4fc: 90 nop
4fd: 90 nop
4fe: 90 nop
4ff: 90 nop
00000500 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
500: 55 push %ebp
501: 89 e5 mov %esp,%ebp
503: 57 push %edi
504: 56 push %esi
505: 53 push %ebx
506: 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++) {
509: 8b 75 0c mov 0xc(%ebp),%esi
50c: 0f b6 1e movzbl (%esi),%ebx
50f: 84 db test %bl,%bl
511: 0f 84 b3 00 00 00 je 5ca <printf+0xca>
ap = (uint *)(void *)&fmt + 1;
517: 8d 45 10 lea 0x10(%ebp),%eax
51a: 83 c6 01 add $0x1,%esi
state = 0;
51d: 31 ff xor %edi,%edi
ap = (uint *)(void *)&fmt + 1;
51f: 89 45 d4 mov %eax,-0x2c(%ebp)
522: eb 2f jmp 553 <printf+0x53>
524: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
c = fmt[i] & 0xff;
if (state == 0) {
if (c == '%') {
528: 83 f8 25 cmp $0x25,%eax
52b: 0f 84 a7 00 00 00 je 5d8 <printf+0xd8>
write(fd, &c, 1);
531: 8d 45 e2 lea -0x1e(%ebp),%eax
534: 83 ec 04 sub $0x4,%esp
537: 88 5d e2 mov %bl,-0x1e(%ebp)
53a: 6a 01 push $0x1
53c: 50 push %eax
53d: ff 75 08 pushl 0x8(%ebp)
540: e8 3c fe ff ff call 381 <write>
545: 83 c4 10 add $0x10,%esp
548: 83 c6 01 add $0x1,%esi
for (i = 0; fmt[i]; i++) {
54b: 0f b6 5e ff movzbl -0x1(%esi),%ebx
54f: 84 db test %bl,%bl
551: 74 77 je 5ca <printf+0xca>
if (state == 0) {
553: 85 ff test %edi,%edi
c = fmt[i] & 0xff;
555: 0f be cb movsbl %bl,%ecx
558: 0f b6 c3 movzbl %bl,%eax
if (state == 0) {
55b: 74 cb je 528 <printf+0x28>
state = '%';
} else {
putc(fd, c);
}
} else if (state == '%') {
55d: 83 ff 25 cmp $0x25,%edi
560: 75 e6 jne 548 <printf+0x48>
if (c == 'd') {
562: 83 f8 64 cmp $0x64,%eax
565: 0f 84 05 01 00 00 je 670 <printf+0x170>
printint(fd, *ap, 10, 1);
ap++;
} else if (c == 'x' || c == 'p') {
56b: 81 e1 f7 00 00 00 and $0xf7,%ecx
571: 83 f9 70 cmp $0x70,%ecx
574: 74 72 je 5e8 <printf+0xe8>
printint(fd, *ap, 16, 0);
ap++;
} else if (c == 's') {
576: 83 f8 73 cmp $0x73,%eax
579: 0f 84 99 00 00 00 je 618 <printf+0x118>
if (s == 0) s = "(null)";
while (*s != 0) {
putc(fd, *s);
s++;
}
} else if (c == 'c') {
57f: 83 f8 63 cmp $0x63,%eax
582: 0f 84 08 01 00 00 je 690 <printf+0x190>
putc(fd, *ap);
ap++;
} else if (c == '%') {
588: 83 f8 25 cmp $0x25,%eax
58b: 0f 84 ef 00 00 00 je 680 <printf+0x180>
write(fd, &c, 1);
591: 8d 45 e7 lea -0x19(%ebp),%eax
594: 83 ec 04 sub $0x4,%esp
597: c6 45 e7 25 movb $0x25,-0x19(%ebp)
59b: 6a 01 push $0x1
59d: 50 push %eax
59e: ff 75 08 pushl 0x8(%ebp)
5a1: e8 db fd ff ff call 381 <write>
5a6: 83 c4 0c add $0xc,%esp
5a9: 8d 45 e6 lea -0x1a(%ebp),%eax
5ac: 88 5d e6 mov %bl,-0x1a(%ebp)
5af: 6a 01 push $0x1
5b1: 50 push %eax
5b2: ff 75 08 pushl 0x8(%ebp)
5b5: 83 c6 01 add $0x1,%esi
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
5b8: 31 ff xor %edi,%edi
write(fd, &c, 1);
5ba: e8 c2 fd ff ff call 381 <write>
for (i = 0; fmt[i]; i++) {
5bf: 0f b6 5e ff movzbl -0x1(%esi),%ebx
write(fd, &c, 1);
5c3: 83 c4 10 add $0x10,%esp
for (i = 0; fmt[i]; i++) {
5c6: 84 db test %bl,%bl
5c8: 75 89 jne 553 <printf+0x53>
}
}
}
5ca: 8d 65 f4 lea -0xc(%ebp),%esp
5cd: 5b pop %ebx
5ce: 5e pop %esi
5cf: 5f pop %edi
5d0: 5d pop %ebp
5d1: c3 ret
5d2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
state = '%';
5d8: bf 25 00 00 00 mov $0x25,%edi
5dd: e9 66 ff ff ff jmp 548 <printf+0x48>
5e2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
printint(fd, *ap, 16, 0);
5e8: 83 ec 0c sub $0xc,%esp
5eb: b9 10 00 00 00 mov $0x10,%ecx
5f0: 6a 00 push $0x0
5f2: 8b 7d d4 mov -0x2c(%ebp),%edi
5f5: 8b 45 08 mov 0x8(%ebp),%eax
5f8: 8b 17 mov (%edi),%edx
5fa: e8 61 fe ff ff call 460 <printint>
ap++;
5ff: 89 f8 mov %edi,%eax
601: 83 c4 10 add $0x10,%esp
state = 0;
604: 31 ff xor %edi,%edi
ap++;
606: 83 c0 04 add $0x4,%eax
609: 89 45 d4 mov %eax,-0x2c(%ebp)
60c: e9 37 ff ff ff jmp 548 <printf+0x48>
611: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
s = (char *)*ap;
618: 8b 45 d4 mov -0x2c(%ebp),%eax
61b: 8b 08 mov (%eax),%ecx
ap++;
61d: 83 c0 04 add $0x4,%eax
620: 89 45 d4 mov %eax,-0x2c(%ebp)
if (s == 0) s = "(null)";
623: 85 c9 test %ecx,%ecx
625: 0f 84 8e 00 00 00 je 6b9 <printf+0x1b9>
while (*s != 0) {
62b: 0f b6 01 movzbl (%ecx),%eax
state = 0;
62e: 31 ff xor %edi,%edi
s = (char *)*ap;
630: 89 cb mov %ecx,%ebx
while (*s != 0) {
632: 84 c0 test %al,%al
634: 0f 84 0e ff ff ff je 548 <printf+0x48>
63a: 89 75 d0 mov %esi,-0x30(%ebp)
63d: 89 de mov %ebx,%esi
63f: 8b 5d 08 mov 0x8(%ebp),%ebx
642: 8d 7d e3 lea -0x1d(%ebp),%edi
645: 8d 76 00 lea 0x0(%esi),%esi
write(fd, &c, 1);
648: 83 ec 04 sub $0x4,%esp
s++;
64b: 83 c6 01 add $0x1,%esi
64e: 88 45 e3 mov %al,-0x1d(%ebp)
write(fd, &c, 1);
651: 6a 01 push $0x1
653: 57 push %edi
654: 53 push %ebx
655: e8 27 fd ff ff call 381 <write>
while (*s != 0) {
65a: 0f b6 06 movzbl (%esi),%eax
65d: 83 c4 10 add $0x10,%esp
660: 84 c0 test %al,%al
662: 75 e4 jne 648 <printf+0x148>
664: 8b 75 d0 mov -0x30(%ebp),%esi
state = 0;
667: 31 ff xor %edi,%edi
669: e9 da fe ff ff jmp 548 <printf+0x48>
66e: 66 90 xchg %ax,%ax
printint(fd, *ap, 10, 1);
670: 83 ec 0c sub $0xc,%esp
673: b9 0a 00 00 00 mov $0xa,%ecx
678: 6a 01 push $0x1
67a: e9 73 ff ff ff jmp 5f2 <printf+0xf2>
67f: 90 nop
write(fd, &c, 1);
680: 83 ec 04 sub $0x4,%esp
683: 88 5d e5 mov %bl,-0x1b(%ebp)
686: 8d 45 e5 lea -0x1b(%ebp),%eax
689: 6a 01 push $0x1
68b: e9 21 ff ff ff jmp 5b1 <printf+0xb1>
putc(fd, *ap);
690: 8b 7d d4 mov -0x2c(%ebp),%edi
write(fd, &c, 1);
693: 83 ec 04 sub $0x4,%esp
putc(fd, *ap);
696: 8b 07 mov (%edi),%eax
write(fd, &c, 1);
698: 6a 01 push $0x1
ap++;
69a: 83 c7 04 add $0x4,%edi
putc(fd, *ap);
69d: 88 45 e4 mov %al,-0x1c(%ebp)
write(fd, &c, 1);
6a0: 8d 45 e4 lea -0x1c(%ebp),%eax
6a3: 50 push %eax
6a4: ff 75 08 pushl 0x8(%ebp)
6a7: e8 d5 fc ff ff call 381 <write>
ap++;
6ac: 89 7d d4 mov %edi,-0x2c(%ebp)
6af: 83 c4 10 add $0x10,%esp
state = 0;
6b2: 31 ff xor %edi,%edi
6b4: e9 8f fe ff ff jmp 548 <printf+0x48>
if (s == 0) s = "(null)";
6b9: bb a8 08 00 00 mov $0x8a8,%ebx
while (*s != 0) {
6be: b8 28 00 00 00 mov $0x28,%eax
6c3: e9 72 ff ff ff jmp 63a <printf+0x13a>
6c8: 66 90 xchg %ax,%ax
6ca: 66 90 xchg %ax,%ax
6cc: 66 90 xchg %ax,%ax
6ce: 66 90 xchg %ax,%ax
000006d0 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
6d0: 55 push %ebp
Header *bp, *p;
bp = (Header *)ap - 1;
for (p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
6d1: a1 a0 0b 00 00 mov 0xba0,%eax
{
6d6: 89 e5 mov %esp,%ebp
6d8: 57 push %edi
6d9: 56 push %esi
6da: 53 push %ebx
6db: 8b 5d 08 mov 0x8(%ebp),%ebx
bp = (Header *)ap - 1;
6de: 8d 4b f8 lea -0x8(%ebx),%ecx
6e1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
for (p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
6e8: 39 c8 cmp %ecx,%eax
6ea: 8b 10 mov (%eax),%edx
6ec: 73 32 jae 720 <free+0x50>
6ee: 39 d1 cmp %edx,%ecx
6f0: 72 04 jb 6f6 <free+0x26>
if (p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break;
6f2: 39 d0 cmp %edx,%eax
6f4: 72 32 jb 728 <free+0x58>
if (bp + bp->s.size == p->s.ptr) {
6f6: 8b 73 fc mov -0x4(%ebx),%esi
6f9: 8d 3c f1 lea (%ecx,%esi,8),%edi
6fc: 39 fa cmp %edi,%edx
6fe: 74 30 je 730 <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;
700: 89 53 f8 mov %edx,-0x8(%ebx)
if (p + p->s.size == bp) {
703: 8b 50 04 mov 0x4(%eax),%edx
706: 8d 34 d0 lea (%eax,%edx,8),%esi
709: 39 f1 cmp %esi,%ecx
70b: 74 3a je 747 <free+0x77>
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
70d: 89 08 mov %ecx,(%eax)
freep = p;
70f: a3 a0 0b 00 00 mov %eax,0xba0
}
714: 5b pop %ebx
715: 5e pop %esi
716: 5f pop %edi
717: 5d pop %ebp
718: c3 ret
719: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
if (p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break;
720: 39 d0 cmp %edx,%eax
722: 72 04 jb 728 <free+0x58>
724: 39 d1 cmp %edx,%ecx
726: 72 ce jb 6f6 <free+0x26>
{
728: 89 d0 mov %edx,%eax
72a: eb bc jmp 6e8 <free+0x18>
72c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
bp->s.size += p->s.ptr->s.size;
730: 03 72 04 add 0x4(%edx),%esi
733: 89 73 fc mov %esi,-0x4(%ebx)
bp->s.ptr = p->s.ptr->s.ptr;
736: 8b 10 mov (%eax),%edx
738: 8b 12 mov (%edx),%edx
73a: 89 53 f8 mov %edx,-0x8(%ebx)
if (p + p->s.size == bp) {
73d: 8b 50 04 mov 0x4(%eax),%edx
740: 8d 34 d0 lea (%eax,%edx,8),%esi
743: 39 f1 cmp %esi,%ecx
745: 75 c6 jne 70d <free+0x3d>
p->s.size += bp->s.size;
747: 03 53 fc add -0x4(%ebx),%edx
freep = p;
74a: a3 a0 0b 00 00 mov %eax,0xba0
p->s.size += bp->s.size;
74f: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
752: 8b 53 f8 mov -0x8(%ebx),%edx
755: 89 10 mov %edx,(%eax)
}
757: 5b pop %ebx
758: 5e pop %esi
759: 5f pop %edi
75a: 5d pop %ebp
75b: c3 ret
75c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
00000760 <malloc>:
return freep;
}
void *
malloc(uint nbytes)
{
760: 55 push %ebp
761: 89 e5 mov %esp,%ebp
763: 57 push %edi
764: 56 push %esi
765: 53 push %ebx
766: 83 ec 0c sub $0xc,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1) / sizeof(Header) + 1;
769: 8b 45 08 mov 0x8(%ebp),%eax
if ((prevp = freep) == 0) {
76c: 8b 15 a0 0b 00 00 mov 0xba0,%edx
nunits = (nbytes + sizeof(Header) - 1) / sizeof(Header) + 1;
772: 8d 78 07 lea 0x7(%eax),%edi
775: c1 ef 03 shr $0x3,%edi
778: 83 c7 01 add $0x1,%edi
if ((prevp = freep) == 0) {
77b: 85 d2 test %edx,%edx
77d: 0f 84 9d 00 00 00 je 820 <malloc+0xc0>
783: 8b 02 mov (%edx),%eax
785: 8b 48 04 mov 0x4(%eax),%ecx
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for (p = prevp->s.ptr;; prevp = p, p = p->s.ptr) {
if (p->s.size >= nunits) {
788: 39 cf cmp %ecx,%edi
78a: 76 6c jbe 7f8 <malloc+0x98>
78c: 81 ff 00 10 00 00 cmp $0x1000,%edi
792: bb 00 10 00 00 mov $0x1000,%ebx
797: 0f 43 df cmovae %edi,%ebx
p = sbrk(nu * sizeof(Header));
79a: 8d 34 dd 00 00 00 00 lea 0x0(,%ebx,8),%esi
7a1: eb 0e jmp 7b1 <malloc+0x51>
7a3: 90 nop
7a4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
for (p = prevp->s.ptr;; prevp = p, p = p->s.ptr) {
7a8: 8b 02 mov (%edx),%eax
if (p->s.size >= nunits) {
7aa: 8b 48 04 mov 0x4(%eax),%ecx
7ad: 39 f9 cmp %edi,%ecx
7af: 73 47 jae 7f8 <malloc+0x98>
p->s.size = nunits;
}
freep = prevp;
return (void *)(p + 1);
}
if (p == freep)
7b1: 39 05 a0 0b 00 00 cmp %eax,0xba0
7b7: 89 c2 mov %eax,%edx
7b9: 75 ed jne 7a8 <malloc+0x48>
p = sbrk(nu * sizeof(Header));
7bb: 83 ec 0c sub $0xc,%esp
7be: 56 push %esi
7bf: e8 25 fc ff ff call 3e9 <sbrk>
if (p == (char *)-1) return 0;
7c4: 83 c4 10 add $0x10,%esp
7c7: 83 f8 ff cmp $0xffffffff,%eax
7ca: 74 1c je 7e8 <malloc+0x88>
hp->s.size = nu;
7cc: 89 58 04 mov %ebx,0x4(%eax)
free((void *)(hp + 1));
7cf: 83 ec 0c sub $0xc,%esp
7d2: 83 c0 08 add $0x8,%eax
7d5: 50 push %eax
7d6: e8 f5 fe ff ff call 6d0 <free>
return freep;
7db: 8b 15 a0 0b 00 00 mov 0xba0,%edx
if ((p = morecore(nunits)) == 0) return 0;
7e1: 83 c4 10 add $0x10,%esp
7e4: 85 d2 test %edx,%edx
7e6: 75 c0 jne 7a8 <malloc+0x48>
}
}
7e8: 8d 65 f4 lea -0xc(%ebp),%esp
if ((p = morecore(nunits)) == 0) return 0;
7eb: 31 c0 xor %eax,%eax
}
7ed: 5b pop %ebx
7ee: 5e pop %esi
7ef: 5f pop %edi
7f0: 5d pop %ebp
7f1: c3 ret
7f2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
if (p->s.size == nunits)
7f8: 39 cf cmp %ecx,%edi
7fa: 74 54 je 850 <malloc+0xf0>
p->s.size -= nunits;
7fc: 29 f9 sub %edi,%ecx
7fe: 89 48 04 mov %ecx,0x4(%eax)
p += p->s.size;
801: 8d 04 c8 lea (%eax,%ecx,8),%eax
p->s.size = nunits;
804: 89 78 04 mov %edi,0x4(%eax)
freep = prevp;
807: 89 15 a0 0b 00 00 mov %edx,0xba0
}
80d: 8d 65 f4 lea -0xc(%ebp),%esp
return (void *)(p + 1);
810: 83 c0 08 add $0x8,%eax
}
813: 5b pop %ebx
814: 5e pop %esi
815: 5f pop %edi
816: 5d pop %ebp
817: c3 ret
818: 90 nop
819: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
base.s.ptr = freep = prevp = &base;
820: c7 05 a0 0b 00 00 a4 movl $0xba4,0xba0
827: 0b 00 00
82a: c7 05 a4 0b 00 00 a4 movl $0xba4,0xba4
831: 0b 00 00
base.s.size = 0;
834: b8 a4 0b 00 00 mov $0xba4,%eax
839: c7 05 a8 0b 00 00 00 movl $0x0,0xba8
840: 00 00 00
843: e9 44 ff ff ff jmp 78c <malloc+0x2c>
848: 90 nop
849: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
prevp->s.ptr = p->s.ptr;
850: 8b 08 mov (%eax),%ecx
852: 89 0a mov %ecx,(%edx)
854: eb b1 jmp 807 <malloc+0xa7>
| 33.578462 | 106 | 0.417369 |
8890a7300fb31d3b1a1efa86fa67c7b3e20c7bfa | 431 | asm | Assembly | oeis/063/A063648.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/063/A063648.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/063/A063648.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A063648: Smallest c such that 1/n=1/c+1/b has integer solutions with c>b.
; Submitted by Christian Krause
; 6,12,12,30,15,56,24,36,30,132,28,182,42,40,48,306,45,380,45,70,66,552,56,150,78,108,77,870,66,992,96,132,102,84,84,1406,114,156,90,1722,91,1892,132,120,138,2256,112,392,150,204,156,2862,135,176,120,228,174
mov $1,$0
seq $0,63718 ; a(n) is the smallest divisor of n^2 that is greater than n.
add $1,$0
mov $0,$1
add $0,2
| 43.1 | 207 | 0.703016 |
277a2a5cb7147e60a2872bb55f40c3f3ac8567da | 4,636 | asm | Assembly | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_1868.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_1868.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_1868.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r14
push %r9
push %rax
push %rbx
push %rdx
lea addresses_D_ht+0x15ef0, %rdx
sub $37664, %rax
vmovups (%rdx), %ymm5
vextracti128 $0, %ymm5, %xmm5
vpextrq $0, %xmm5, %r9
nop
nop
nop
nop
nop
sub %r11, %r11
lea addresses_D_ht+0x1c670, %r14
clflush (%r14)
nop
nop
nop
xor $19053, %rdx
mov $0x6162636465666768, %rbx
movq %rbx, %xmm4
vmovups %ymm4, (%r14)
nop
nop
nop
add $10828, %rax
pop %rdx
pop %rbx
pop %rax
pop %r9
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r15
push %r8
push %rax
push %rdi
push %rsi
// Load
lea addresses_US+0xb9f4, %rdi
nop
nop
nop
nop
sub $22828, %r12
mov (%rdi), %r8w
nop
nop
nop
nop
sub %rdi, %rdi
// Faulty Load
lea addresses_A+0x18a70, %r8
nop
nop
nop
nop
xor $40734, %rsi
movb (%r8), %r15b
lea oracles, %r12
and $0xff, %r15
shlq $12, %r15
mov (%r12,%r15,1), %r15
pop %rsi
pop %rdi
pop %rax
pop %r8
pop %r15
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 2, 'NT': True, 'type': 'addresses_A'}, 'OP': 'LOAD'}
{'src': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_US'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 1, 'NT': False, 'type': 'addresses_A'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_D_ht'}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 47.793814 | 2,999 | 0.660052 |
3f03abe16696010ffedc7b81b09071daed24640f | 4,967 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_ht_zr_un_/i7-7700_9_0x48.log_21829_1111.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_ht_zr_un_/i7-7700_9_0x48.log_21829_1111.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_ht_zr_un_/i7-7700_9_0x48.log_21829_1111.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r13
push %r15
push %r8
push %r9
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x1ee44, %r15
nop
nop
nop
nop
nop
and $64506, %r13
mov $0x6162636465666768, %r9
movq %r9, %xmm2
movups %xmm2, (%r15)
sub $42581, %rbp
lea addresses_WC_ht+0x170c4, %r11
nop
nop
dec %rdi
movups (%r11), %xmm1
vpextrq $0, %xmm1, %r15
nop
nop
nop
nop
and $58068, %r9
lea addresses_WT_ht+0x1471e, %rdi
nop
nop
mfence
movl $0x61626364, (%rdi)
nop
nop
add %r13, %r13
lea addresses_normal_ht+0x18818, %rsi
lea addresses_A_ht+0xfcc4, %rdi
nop
nop
nop
cmp %r11, %r11
mov $98, %rcx
rep movsb
cmp %r8, %r8
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r8
pop %r15
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r14
push %r8
push %rcx
push %rdx
// Faulty Load
lea addresses_PSE+0x164c4, %r8
nop
nop
nop
nop
nop
cmp %rdx, %rdx
movaps (%r8), %xmm2
vpextrq $1, %xmm2, %rcx
lea oracles, %rdx
and $0xff, %rcx
shlq $12, %rcx
mov (%rdx,%rcx,1), %rcx
pop %rdx
pop %rcx
pop %r8
pop %r14
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': True}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'AVXalign': True, 'congruent': 0, 'size': 16, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 7, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 6, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 1, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}}
{'62': 3, '00': 10898, '44': 10924, '48': 1, 'ff': 1, '6d': 2}
44 00 44 00 00 00 00 00 00 00 00 44 00 00 44 44 00 44 44 00 00 00 44 00 44 00 44 44 44 44 00 00 44 00 44 62 00 00 44 00 00 44 00 00 00 44 00 44 00 44 00 44 00 00 44 44 00 00 44 00 44 44 00 00 00 00 00 44 44 44 00 44 00 00 44 44 00 44 44 44 44 00 00 00 00 00 00 44 00 44 00 00 44 00 00 44 00 00 00 44 44 00 00 44 44 44 00 00 44 00 44 00 44 44 44 00 00 44 44 00 00 00 44 44 00 44 44 44 00 44 00 00 44 44 00 00 44 00 44 00 00 00 00 00 44 44 44 00 00 44 44 44 44 44 44 00 44 44 44 44 44 44 44 00 00 44 00 44 00 44 00 00 44 44 00 00 00 00 44 44 00 00 00 44 44 00 00 44 00 44 44 44 00 00 44 44 44 00 44 00 00 44 44 00 00 44 44 44 00 44 44 44 00 00 00 00 00 44 44 44 00 44 00 00 00 44 00 44 44 44 00 00 00 00 44 44 44 44 00 00 44 00 44 00 00 44 00 00 00 00 00 00 00 44 00 00 00 00 44 44 44 00 00 44 44 00 00 00 44 00 00 00 44 44 00 00 00 44 44 00 44 44 00 44 44 00 00 44 00 00 44 00 44 00 44 00 44 00 00 44 44 00 00 00 44 44 00 00 00 44 00 00 00 44 00 44 00 44 44 44 00 44 44 44 44 00 00 00 44 00 44 44 44 00 44 44 44 00 44 00 44 00 44 00 44 44 00 00 44 00 44 00 00 00 00 44 44 00 00 44 00 00 44 00 44 44 00 44 44 00 00 44 44 00 00 44 44 44 00 44 00 44 44 00 00 00 44 44 00 00 44 00 44 44 00 44 44 00 00 00 00 00 44 44 44 00 00 00 00 00 00 44 00 44 00 00 00 44 00 44 00 00 00 00 44 00 44 44 44 44 00 44 44 44 00 00 44 44 44 00 00 44 00 44 00 00 44 00 44 00 00 00 00 44 44 44 00 44 44 00 00 00 00 44 00 00 44 00 44 00 44 00 00 44 00 44 44 44 00 00 00 44 44 00 00 44 00 00 44 44 00 00 44 00 44 44 44 00 00 44 00 44 44 00 00 44 00 44 00 44 00 44 44 44 00 00 44 00 00 44 00 00 44 00 00 00 00 00 00 00 00 44 44 00 44 44 00 44 00 00 44 00 44 44 44 44 00 00 00 00 44 00 44 44 44 00 44 44 44 44 44 00 44 00 00 44 00 44 44 00 00 00 44 44 44 00 00 00 00 44 44 44 00 00 00 00 00 00 00 00 00 00 44 44 44 00 00 00 44 44 44 00 44 44 00 00 44 00 00 44 00 00 00 44 44 00 44 00 44 44 44 44 00 44 00 00 00 44 00 44 00 00 44 44 00 00 00 00 00 44 44 00 44 44 44 00 44 44 44 00 00 00 00 44 00 44 00 00 00 00 00 44 44 00 44 44 00 00 00 44 00 00 00 00 44 44 00 44 44 00 44 00 00 44 44 44 00 44 00 00 44 00 00 44 00 44 00 44 00 00 44 44 44 00 44 00 00 44 00 44 44 00 00 00 44 44 00 00 44 00 00 44 44 00 44 00 44 00 00 44 00 44 00 00 44 44 00 00 44 44 00 00 00 44 00 00 44 00 44 00 00 00 00 00 00 00 44 00 44 44 44 44 44 44 44 00 00 00 00 00 00 00 44 44 00 44 00 44 44 44 44 44 00 00 44 00 00 00 44 44 00 44 00 00 00 00 44 00 00 44 44 44 00 44 00 44 44 00 00 44 00 44 44 44 00 00 00 00 00 00 44 44 00 00 44 00 00 00 00 00 00 00 44 00 44 00 00 00 44 44 44 44 00 44 44 44 44 00 00 44 44 44 00 44 00 00 44 00 00 44 00 00 00 00 44 00 44 44 44 44 00 44 00 44 44 44 00 44 44 44 44 00 44 44 44 00 44 00 44 00 00 44 44 44 44 44 44 44 44 00 44 00 44 00 00 44 00 44 44 44 44 44 00 00 00 44 00 00 00 44 00 00 44 44 44 00 44 00 00 00 00 00 44 44 44 00 44 44 00 44 44 44 44 00 44 44 00 44 00 44 44 44 00 00 44 44 00 00 00 00 44 44 00 44 44 44 00 44 44 00 44 00 00 00 00 44 44 00 44 44 00 00 00 00 44 44 44 00 00 00 44 44 00 44 44 44 44 00 00 00
*/
| 47.304762 | 2,999 | 0.65915 |
083164c52ae3a28cfd3f956b5dd3f75d77907d93 | 9,330 | asm | Assembly | sw/prg.asm | butyi/aci2can | 7d7c695694fe3b0f2848a06c9568d6c7592f5db5 | [
"MIT"
] | 1 | 2021-09-11T14:33:48.000Z | 2021-09-11T14:33:48.000Z | sw/prg.asm | butyi/aci2can | 7d7c695694fe3b0f2848a06c9568d6c7592f5db5 | [
"MIT"
] | null | null | null | sw/prg.asm | butyi/aci2can | 7d7c695694fe3b0f2848a06c9568d6c7592f5db5 | [
"MIT"
] | 3 | 2021-09-12T00:36:39.000Z | 2021-09-14T10:19:10.000Z | ; ==============================================================================
; MINI LAUSCH BOX
; ==============================================================================
; Hardware: https://github.com/butyi/sci2can/
; Software: janos.bencsik@knorr-bremse.com, 2020.05.23.
; ==============================================================================
#include "dz60.inc"
; ===================== CONFIG =================================================
APPLICATION equ 0 ; Gateway applications ID (0: github example)
SW_REV equ 2 ; Software revison
BUILD_DATE_YH equ $20 ; ${:year/100}
BUILD_DATE_YL equ $21 ; ${:year-2000}
BUILD_DATE_MO equ $02 ; ${:month}
BUILD_DATE_DA equ $28 ; ${:date}
BUILD_DATE_HO equ $09 ; ${:hour}
BUILD_DATE_MI equ $30 ; ${:min}
;OSCILL_SUPP equ 1 ; To switch on oscillator support
BUFFLEN equ 96 ; Number of bytes in received burst
; uC port definitions with line names in schematic
LED2 @pin PTA,6
CANRX @pin PTE,7
CANTX @pin PTE,6
RxD1 @pin PTE,1
RxD1_2 @pin PTA,0
FET @pin PTD,2
;BTNL @pin PTA,2 ; My prototype
;BTNR @pin PTA,1 ; My prototype
BTNL @pin PTE,3
BTNR @pin PTE,2
#ifdef OSCILL_SUPP
; Debug pins to measure execution times (high level) by oscilloscope
OSC_SCIRX @pin PTD,0 ; Pin is high during SCI Rx burst
OSC_CANTX @pin PTD,1 ; Pin is high during CAN Tx burst
OSC_RTCIT @pin PTD,3 ; Pin is high during RTC Interrupt routine
OSC_SCIIT @pin PTD,4 ; Pin is high during SCI Rx Interrupt routine
OSC_CANIT @pin PTD,5 ; Pin is high during CAN Tx Interrupt routine
#endif
; ===================== INCLUDE FILES ==========================================
#include "cop.sub"
#include "mcg.sub"
#include "rtc.sub"
#include "iic.sub"
#include "ssd1780.sub" ; 0.96" 128x64 OLED display
#include "lib.sub"
#include "sci.sub"
#include "can.sub"
#include "adc.sub"
; ==================== VARIABLES =============================================
#RAM
uz ds 2 ; Hysteresis filtered Uz voltage
btns ds 1 ; Saved button states to detect change
; ==================== PROGRAM START =========================================
#ROM
start:
sei ; disable interrupts
ldhx #XRAM_END ; H:X points to SP
txs ; Init SP
jsr COP_Init
jsr PTX_Init ; I/O ports initialization
jsr MCG_Init
jsr RTC_Init
jsr CAN_Init
jsr SCI_Init
jsr IIC_Init ; Init IIC for fast clear (~100khz)
bsr ADC_Init
cli ; Enable interrupts
clr uz ; Init uz variable
clr uz+1
jsr update_btns ; Init btns variable
jsr IIC_wfe ; Wait for end of action list
jsr DISP_init ; Initialize display
lda #$00 ; Set position to top-left
ldhx #startscreen ; Get address of string
jsr DISP_print ; Print string
jsr IIC_wfe ; Wait for end of action list
; jsr IIC_Slow ; Slow down IIC for update (~10khz)
main
jsr KickCop ; Update watchdog
brset EVERY1SEC.,timeevents,m_onesec ; Check if 1s spent
jsr update_btns ; Test button change
bne m_btn_event ; In case of edge, jump to handle
mov #PIN5.,ADCSC1 ; Start Uz voltage measurement
m_meas
jsr KickCop ; Update watchdog
brclr COCO.,ADCSC1,m_meas ; Wait for finish Uz measurement
ldx #0 ; Load uz to arit32
stx arit32
stx arit32+1
lda uz
sta arit32+2
lda uz+1
sta arit32+3
stx yy ; *=255
stx yy+1
stx yy+2
lda #255
sta yy+3
jsr szor16bit
ldx #0 ; /=256
stx yy
stx yy+1
lda #1
sta yy+2
stx yy+3
jsr oszt32bit
lda arit32+3 ; +=ADCRL
add ADCRL
sta uz+1
lda arit32+2
adc #0
sta uz ; Save back to uz
bra main ; Repeat main cycle
m_onesec ; This path called once in every sec
bclr EVERY1SEC.,timeevents ; Clear event flag
lda uz ; Load high byte
; ldx #18 ; *=18 ;My prototype
ldx #55 ; *=55
mul
pshx
pulh
; ldx #10 ; /=10 ;My prototype
ldx #30 ; /=30
div
clrh
ldx #1 ; Length of fractional part is 1 digit
mov #5,str_bufidx ; Set length of string
jsr str_val ; Convert value to string
lda #$26 ; Screen position
jsr DISP_print ; Print string
; Update SCI status
ldhx #ok_err_str
brclr SCIPACK_LED.,led_flags,m_sci_err
aix #2
m_sci_err
lda #$45 ; Screen position
jsr DISP_print ; Print string
; Update CAN status
ldhx #ok_err_str
brclr CANSENT_LED.,led_flags,m_can_err
aix #2
m_can_err
lda #$4E ; Screen position
jsr DISP_print ; Print string
jmp main
m_btn_event ; Button state changed
ldhx #btn_str ; Just show the new state, no real function yet
lda btns
and #BTNL_
beq m_btnl_err
aix #4
m_btnl_err
lda #$72 ; Screen position
jsr DISP_print ; Print string
ldhx #btn_str ; Just show the new state, no real function yet
lda btns
and #BTNR_
beq m_btnr_err
aix #4
m_btnr_err
lda #$7B ; Screen position
jsr DISP_print ; Print string
jmp main
; ===================== STRINGS ================================================
hexakars
db '0123456789ABCDEF'
startscreen
db "* sci2can 1v02 *"
db " "
db " Uz= V "
db " "
db " SCI ? CAN ? "
db " "
db "Build 2102280930"
db " "
db 0
ok_err_str
db "-",0
db $1F,0 ; Check mark symbol
btn_str
db " ",0
db "vvv",0
; ===================== SUB-ROUTINES ===========================================
; ------------------------------------------------------------------------------
; Parallel Input/Output Control
; To prevent extra current consumption caused by flying not connected input
; ports, all ports shall be configured as output. I have configured ports to
; low level output by default.
; There are only a few exceptions for the used ports, where different
; initialization is needed.
; Default init states are proper for OSCILL_SUPP pins, no exception needed.
PTX_Init
; All ports to be low level
clra
sta PTA
sta PTB
sta PTC
sta PTD
sta PTE
sta PTF
sta PTG
bset CANTX.,CANTX ; CANTX to be high
bset LED2.,LED2 ; LED2 to be On
; All ports to be output
lda #$FF
sta DDRA
sta DDRB
sta DDRC
sta DDRD
sta DDRE
sta DDRF
sta DDRG
bclr CANRX.,CANRX+1 ; CANRX to be input
bclr RxD1.,RxD1+1 ; RxD1 to be input
bclr RxD1_2.,RxD1_2+1 ; RxD1_2 to be input
bclr BTNL.,BTNL+1 ; Button to be input
bclr BTNR.,BTNR+1 ; Button to be input
lda #BTNL_|BTNR_ ; Buttons to be pulled up
sta PTEPE ; to prevent instable state when not mounted
lda #RxD1_2_
sta PTAPE ; RxD1_2 to be pulled up
rts
update_btns
lda BTNL ; Load current button state
coma ; Change polarity to active low
and #BTNL_|BTNR_ ; Mask bits of two buttons
tax ; Update btns later with this value
eor btns ; Detect state change comparing to last value still in btns
stx btns ; Update btns now with before saved value
tsta ; Update status register with A to report any button edge
rts
; ===================== IT VECTORS =============================================
#VECTORS
org Vreset
dw start
; ===================== END ====================================================
| 32.283737 | 91 | 0.449625 |
38c00a2856f7dfef37ea23a2974c2d62b1893312 | 899 | asm | Assembly | files/files.asm | fushinori/nasm | 9b78f812e93c8cc3cddc9fe148310a0ca94968fe | [
"MIT"
] | 1 | 2022-02-08T06:27:21.000Z | 2022-02-08T06:27:21.000Z | files/files.asm | fushinori/nasm | 9b78f812e93c8cc3cddc9fe148310a0ca94968fe | [
"MIT"
] | null | null | null | files/files.asm | fushinori/nasm | 9b78f812e93c8cc3cddc9fe148310a0ca94968fe | [
"MIT"
] | null | null | null | %include "constants.asm"
global _start
section .data
filename db "hello.txt", 0 ; zero-terminated file name
msg db "Hi there.", 0ah
len equ $ - msg
section .text
_start:
; Open file
; `fd` will be stored in `rax` in case of success.
mov rax, SYS_OPEN
mov rdi, filename
mov rsi, O_CREAT | O_WRONLY ; bitwise OR the flags
mov rdx, 0q0644 ; permissions in octal
; read = 4, write = 2, execute = 1
; special perm, owner, group, other
; 0, 4+2, 4, 4
syscall
; write to file
push rax ; push `fd` to stack
mov rdi, rax ; set `fd`
mov rax, SYS_WRITE
mov rsi, msg
mov rdx, len
syscall
; close file
mov rax, SYS_CLOSE
pop rdi ; pop `fd` off stack
syscall
; exit
mov rax, 0x3c
mov rdi, 0
syscall
| 22.475 | 67 | 0.536151 |
280f5cbed37c0a4fa90da331c0993a270da4e6a1 | 643 | asm | Assembly | oeis/213/A213749.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/213/A213749.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/213/A213749.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A213749: Antidiagonal sums of the convolution array A213747.
; 1,9,46,180,603,1827,5164,13878,35905,90189,221274,532584,1261687,2949255,6815896,15597738,35389629,79691985,178258150,396361980,876609811,1929380139,4227858756,9227469150,20065550713,43486544277,93952410034,202400334288,434865439215,932007903759,1992864825904,4252017623634,9053791060597,19241453486745,40819369181886,86449101734628,182793808118539,385928581350195,813638604555100,1713039116075910,3602000092595121,7564639999099869,15868151812064266,33249231623947320,69594687991710823
mov $1,$0
add $0,2
seq $1,45618 ; Partial sums of A000337(n+4), n >= 0.
mul $0,$1
div $0,2
| 71.444444 | 487 | 0.847589 |
2692e913867e08d9e647ccc24e1bd41b948feafb | 7,549 | asm | Assembly | src/play/wind_slope_shared.asm | 1888games/golf | 5078fc0699e5f91a53761cc30526b510d49e955c | [
"BSD-2-Clause"
] | 1 | 2022-02-13T16:09:18.000Z | 2022-02-13T16:09:18.000Z | src/play/wind_slope_shared.asm | 1888games/golf | 5078fc0699e5f91a53761cc30526b510d49e955c | [
"BSD-2-Clause"
] | null | null | null | src/play/wind_slope_shared.asm | 1888games/golf | 5078fc0699e5f91a53761cc30526b510d49e955c | [
"BSD-2-Clause"
] | null | null | null | ; Top-hole Golf
; Copyright 2020-2021 Matthew Clarke
winslp_c_BEGIN = *
; *****************
; *** CONSTANTS ***
; *****************
winslp_l_BOX_ICON
!bin "../../assets/pictures/slope_box.bin"
winslp_c_ARROW_LEN = 96
winslp_c_LINE_CENTER_X = 10
winslp_c_LINE_CENTER_Y = 145
; *****************
; *** VARIABLES ***
; *****************
winslp_v_rot_vx_lo !byte 0
winslp_v_rot_vx_hi !byte 0
winslp_v_rot_vz_lo !byte 0
winslp_v_rot_vz_hi !byte 0
winslp_v_final_vx_lo !byte 0
winslp_v_final_vx_hi !byte 0
winslp_v_final_vz_lo !byte 0
winslp_v_final_vz_hi !byte 0
; Set 'delay' variable as part of setup routine.
winslp_v_delay !byte 0
winslp_v_count !byte 0
; *******************
; ****** MACROS *****
; *******************
; *******************
; *** SUBROUTINES ***
; *******************
; FIXME: this is used only for slopes, not wind!!!
!zone {
winslp_s_apply
dec winslp_v_count
bne .end
lda winslp_v_delay
sta winslp_v_count
lda ball_vx_lo
clc
adc winslp_v_final_vx_lo
sta ball_vx_lo
lda ball_vx_hi
adc winslp_v_final_vx_hi
sta ball_vx_hi
lda ball_vz_lo
clc
adc winslp_v_final_vz_lo
sta ball_vz_lo
lda ball_vz_hi
adc winslp_v_final_vz_hi
sta ball_vz_hi
.end
rts
; end sub winslp_s_apply
} ; !zone
; **************************************************
!zone {
winslp_s_draw_box
lda #<winslp_l_BOX_ICON
sta P0
lda #>winslp_l_BOX_ICON
sta P1
lda #$ff
sta P2
jsr icon_s_draw
rts
; end sub winslp_s_draw_box
} ; !zone
; **************************************************
; INPUTS: P0=P1 = address of source vectors (set of 4 bytes).
!zone {
winslp_s_rotate
ldy #3
-
lda (P0),y
sta winslp_v_rot_vx_lo,y
dey
bpl -
lda #<winslp_v_rot_vx_lo
sta MATHS0
lda #>winslp_v_rot_vx_lo
sta MATHS1
lda #<winslp_v_rot_vz_lo
sta MATHS2
lda #>winslp_v_rot_vz_lo
sta MATHS3
lda hole_current_rotation_angle
sta MATHS4
clc
jsr maths_s_rotate
rts
; end sub winslp_s_rotate
} ; !zone
; **************************************************
!zone {
.TOP_LEFT = gfxs_c_BITMAP_BASE+(17*40*8)+8+1
.BOTTOM_LEFT = gfxs_c_BITMAP_BASE+(18*40*8)+8
.TOP_RIGHT = gfxs_c_BITMAP_BASE+(17*40*8)+(3*8)+1
.BOTTOM_RIGHT = gfxs_c_BITMAP_BASE+(18*40*8)+(3*8)
.CENTER_DEST = gfxs_c_BITMAP_BASE+(18*40*8)+(2*8)+1
.CENTER_PATTERN = %00001100
winslp_s_draw_direction
lda winslp_v_rot_vx_lo
bpl +
+nega
lsr
lsr
lsr
lsr
+nega
jmp ++
+
lsr
lsr
lsr
lsr
++
; TODO: adjust if > 3?
sta MATHS0
lda winslp_v_rot_vz_lo
bpl +
+nega
lsr
lsr
lsr
lsr
+nega
jmp ++
+
lsr
lsr
lsr
lsr
++
sta MATHS1
; lda #31
lda #winslp_c_LINE_CENTER_X
sta LINE_X0_LO
clc
adc MATHS0
; ; FIXME/TODO: hack! Sometimes the line overdraws the box!
; cmp #35
; bcc +
; lda #34
;+
sta LINE_X1_LO
; lda #168
lda #winslp_c_LINE_CENTER_Y
sta LINE_Y0_LO
sec
sbc MATHS1
sta LINE_Y1_LO
; NOTE: even though we're not going to use them, set destination for
; 'edges', otherwise they'll overwrite some random area of memory.
lda #<quads_edges_from
sta EDGES_LO
lda #>quads_edges_from
sta EDGES_HI
lda #1
ldy #0
jsr dp_s_draw_line
+utils_m_kernal_out
; Do potential repair here (?!)...
; NOTE: we are only modifying 7 bytes for each cell - omit top and
; bottom rows (of the 16 available).
ldx #6
-
lda .TOP_LEFT,x
; Orange 'margin' around box:
and #%11001111
; Black border on lhs:
ora #%11000000
sta .TOP_LEFT,x
lda .BOTTOM_LEFT,x
and #%11001111
ora #%11000000
sta .BOTTOM_LEFT,x
lda .TOP_RIGHT,x
and #%11111100
sta .TOP_RIGHT,x
lda .BOTTOM_RIGHT,x
and #%11111100
sta .BOTTOM_RIGHT,x
dex
bpl -
; And finally draw the center point in BLACK.
; NOTE: because color code for BLACK is 11 (in binary), we can just ORA
; it into the bitmap - no need to mask out the pixel first!
lda .CENTER_DEST
ora #.CENTER_PATTERN
sta .CENTER_DEST
lda .CENTER_DEST+1
ora #.CENTER_PATTERN
sta .CENTER_DEST+1
+utils_m_kernal_in
; And finally draw the center point in BLACK.
; ldx #10
; ldy #145
; lda #3
; jsr dp_s_draw_pixel
; ldx #10
; ldy #146
; lda #3
; jsr dp_s_draw_pixel
rts
; end sub winslp_s_draw_direction
} ; !zone
; **************************************************
; NOTE: this is the vector we'll actually apply to the ball's velocity.
; Use this same routine for both the wind and slope 'final' vectors (since
; they're never used at the same time)...
; INPUTS: P0 = multiplier (for scaling up the unit vector)
; P1 = initial delay
!zone {
.MULTIPLICAND = CAMERA0
.NEG = CAMERA1
winslp_s_calc_final_vector
lda P0
sta .MULTIPLICAND
lda P1
sta winslp_v_delay
; First get a unit vector (of the rotated vector) and then multiply by
; whatever's in .MULTIPLICAND.
ldx #3
-
lda winslp_v_rot_vx_lo,x
sta winslp_v_final_vx_lo,x
dex
bpl -
; Divisions.
+clr .NEG
lda winslp_v_final_vx_hi
bpl +
+neg16 winslp_v_final_vx_lo
inc .NEG
+
lda #0
sta P0
lda winslp_v_final_vx_lo
sta P1
lda #<winslp_c_ARROW_LEN
sta P2
lda #>winslp_c_ARROW_LEN
sta P3
jsr maths_div16
; Multiplier now already in P0-P1.
lda .MULTIPLICAND
sta P2
lda #0
sta P3
jsr maths_mul16
; Use msb as low byte - discard low byte of result.
lda P5
sta winslp_v_final_vx_lo
lda #0
sta winslp_v_final_vx_hi
; Does final result need to be negated?
lda .NEG
beq +
+neg16 winslp_v_final_vx_lo
+
; Now for vz.
+clr .NEG
lda winslp_v_final_vz_hi
bpl +
+neg16 winslp_v_final_vz_lo
inc .NEG
+
lda #0
sta P0
lda winslp_v_final_vz_lo
sta P1
lda #<winslp_c_ARROW_LEN
sta P2
lda #>winslp_c_ARROW_LEN
sta P3
jsr maths_div16
; Multiplier now already in P0-P1.
lda .MULTIPLICAND
sta P2
lda #0
sta P3
jsr maths_mul16
; Use msb as low byte - discard low byte of result.
lda P5
sta winslp_v_final_vz_lo
lda #0
sta winslp_v_final_vz_hi
; Does final result need to be negated?
lda .NEG
beq +
+neg16 winslp_v_final_vz_lo
+
; FIXME: is this right?!
lda winslp_v_delay
sta winslp_v_count
rts
; end sub winslp_s_calc_final_vector
} ; !zone
; **************************************************
; **************************************************
; **************************************************
; **************************************************
; **************************************************
; **************************************************
; **************************************************
; **************************************************
; **************************************************
; **************************************************
; **************************************************
; **************************************************
; **************************************************
; **************************************************
; **************************************************
; **************************************************
winslp_c_SIZE = *-winslp_c_BEGIN
| 20.569482 | 75 | 0.538085 |
fea8636e29a22068e51d3d8d32069a51e89b5aea | 13,177 | asm | Assembly | Cameras/Mafia3/InjectableGenericCameraSystem/Interceptor.asm | Cyberim/InjectableGenericCameraSystem | d74f8786a903211e72c5da7f2f3be30826bb8329 | [
"BSD-2-Clause"
] | 623 | 2016-12-02T16:01:05.000Z | 2022-03-29T19:59:10.000Z | Cameras/Mafia3/InjectableGenericCameraSystem/Interceptor.asm | Cyberim/InjectableGenericCameraSystem | d74f8786a903211e72c5da7f2f3be30826bb8329 | [
"BSD-2-Clause"
] | 113 | 2016-12-10T17:34:24.000Z | 2022-02-06T21:59:42.000Z | Cameras/Mafia3/InjectableGenericCameraSystem/Interceptor.asm | Cyberim/InjectableGenericCameraSystem | d74f8786a903211e72c5da7f2f3be30826bb8329 | [
"BSD-2-Clause"
] | 232 | 2016-12-17T06:32:08.000Z | 2022-03-27T16:51:29.000Z | ;////////////////////////////////////////////////////////////////////////////////////////////////////////
;// Part of Injectable Generic Camera System
;// Copyright(c) 2017, Frans Bouma
;// All rights reserved.
;// https://github.com/FransBouma/InjectableGenericCameraSystem
;//
;// 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.
;//
;// 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.
;////////////////////////////////////////////////////////////////////////////////////////////////////////
;---------------------------------------------------------------
; Game specific asm file to intercept execution flow to obtain addresses, prevent writes etc.
;---------------------------------------------------------------
;---------------------------------------------------------------
; Public definitions so the linker knows which names are present in this file
PUBLIC cameraStructInterceptor
PUBLIC cameraWrite1Interceptor
PUBLIC cameraWrite2Interceptor
PUBLIC cameraWrite3Interceptor
PUBLIC cameraWrite4Interceptor
;---------------------------------------------------------------
;---------------------------------------------------------------
; Externs which are used and set by the system. Read / write these
; values in asm to communicate with the system
EXTERN g_cameraEnabled: byte
EXTERN g_cameraStructAddress: qword
EXTERN g_cameraMatrixAddress: qword
EXTERN g_hudToggleAddress: qword
;---------------------------------------------------------------
;---------------------------------------------------------------
; Own externs, defined in InterceptorHelper.cpp
EXTERN _cameraStructInterceptionContinue: qword
EXTERN _cameraWrite1InterceptionContinue: qword
EXTERN _cameraWrite2InterceptionContinue: qword
EXTERN _cameraWrite3InterceptionContinue: qword
EXTERN _cameraWrite4InterceptionContinue: qword
EXTERN _hudToggleInterceptionContinue: qword
.data
;---------------------------------------------------------------
; Scratch pad
; Timestop address is read from here:
; AOB Scan: 53 48 83 EC ?? 48 8B D9 48 8B 0D | ?? ?? ?? ?? E8 ?? ?? ?? ?? 84 C0 75 ?? E8 ?? ?? ?? ??.
; This address isn't intercepted, blocks are used in AOB scan to obtain RIP relative addresses
;mafia3.exe+3621116 - 53 - push rbx << START OF FUNCTION
;mafia3.exe+3621117 - 48 83 EC 20 - sub rsp,20 { 32 }
;mafia3.exe+362111B - 48 8B D9 - mov rbx,rcx
;mafia3.exe+362111E - 48 8B 0D 63B4BA02 - mov rcx,[mafia3.exe+61CC588] { [DC5929CBF0] } <<<< TIMESTOP is at this address + 4
;mafia3.exe+3621125 - E8 F6DA0AFE - call mafia3.exe+16CEC20
;mafia3.exe+362112A - 84 C0 - test al,al
;mafia3.exe+362112C - 75 16 - jne mafia3.exe+3621144
;mafia3.exe+362112E - E8 6D9B08FE - call mafia3.exe+16AACA0
;
.code
cameraStructInterceptor PROC
; Struct interceptor is also a write interceptor for matrix
;mafia3.exe+96628A - F3 0F59 81 84000000 - mulss xmm0,[rcx+00000084] << INTERCEPT HERE
;mafia3.exe+966292 - 4C 89 65 7F - mov [rbp+7F],r12
;mafia3.exe+966296 - F3 0F59 89 88000000 - mulss xmm1,[rcx+00000088]
;mafia3.exe+96629E - F3 0F59 99 8C000000 - mulss xmm3,[rcx+0000008C]
;mafia3.exe+9662A6 - F3 0F58 41 48 - addss xmm0,[rcx+48] << CONTINUE HERE
;mafia3.exe+9662AB - F3 0F58 49 4C - addss xmm1,[rcx+4C]
;mafia3.exe+9662B0 - F3 0F58 59 50 - addss xmm3,[rcx+50]
;mafia3.exe+9662B5 - F3 0F11 41 48 - movss [rcx+48],xmm0 << WRITE X
;mafia3.exe+9662BA - F3 0F11 49 4C - movss [rcx+4C],xmm1 << WRITE Y
;mafia3.exe+9662BF - F3 0F11 59 50 - movss [rcx+50],xmm3 << WRITE Z
;mafia3.exe+9662C4 - 48 8B 81 C0010000 - mov rax,[rcx+000001C0]
;mafia3.exe+9662CB - 48 2B 81 B8010000 - sub rax,[rcx+000001B8]
mov [g_cameraStructAddress], rcx
; always do the original code, we're not intercepting anything here.
originalCode:
mulss xmm0, dword ptr [rcx+00000084h]
mov [rbp+7Fh],r12
mulss xmm1, dword ptr [rcx+00000088h]
mulss xmm3, dword ptr [rcx+0000008Ch]
exit:
jmp qword ptr [_cameraStructInterceptionContinue] ; jmp back into the original game code, which is the location after the original statements above.
cameraStructInterceptor ENDP
cameraWrite1Interceptor PROC
;mafia3.exe+963D11 - F3 0F59 C7 - mulss xmm0,xmm7
;mafia3.exe+963D15 - 0F28 7C 24 50 - movaps xmm7,[rsp+50]
;mafia3.exe+963D1A - F3 0F59 CD - mulss xmm1,xmm5
;mafia3.exe+963D1E - F3 0F5C E0 - subss xmm4,xmm0
;mafia3.exe+963D22 - F3 0F11 17 - movss [rdi],xmm2 << INTERCEPT HERE << WRITE _11
;mafia3.exe+963D26 - F3 0F5C CB - subss xmm1,xmm3
;mafia3.exe+963D2A - F3 0F11 67 10 - movss [rdi+10],xmm4 << WRITE _21
;mafia3.exe+963D2F - F3 0F11 4F 20 - movss [rdi+20],xmm1 << WRITE _31
;mafia3.exe+963D34 - 48 83 C4 70 - add rsp,70 { 112 } << CONTINUE HERE
;mafia3.exe+963D38 - 5F - pop rdi
cmp byte ptr [g_cameraEnabled], 1 ; check if the user enabled the camera. If so, just skip the write statements, otherwise just execute the original code.
jne originalCode ; our own camera is enabled, just skip the writes
cmp qword ptr rdi, [g_cameraMatrixAddress]
je exit ; destination is the matrix we're after, do skip everything
originalCode:
movss dword ptr [rdi],xmm2
subss xmm1,xmm3
movss dword ptr [rdi+10h],xmm4
movss dword ptr [rdi+20h],xmm1
exit:
jmp qword ptr [_cameraWrite1InterceptionContinue] ; jmp back into the original game code, which is the location after the original statements above.
cameraWrite1Interceptor ENDP
cameraWrite2Interceptor PROC
;mafia3.exe+963B43 - 8B 06 - mov eax,[rsi]
;mafia3.exe+963B45 - 89 47 04 - mov [rdi+04],eax << INTERCEPT HERE << WRITE _12
;mafia3.exe+963B48 - 8B 46 04 - mov eax,[rsi+04]
;mafia3.exe+963B4B - 89 47 14 - mov [rdi+14],eax << WRITE _22
;mafia3.exe+963B4E - 8B 46 08 - mov eax,[rsi+08]
;mafia3.exe+963B51 - 89 47 24 - mov [rdi+24],eax << WRITE _32
;mafia3.exe+963B54 - F3 0F10 6B 04 - movss xmm5,[rbx+04] << CONTINUE HERE
;mafia3.exe+963B59 - F3 0F10 33 - movss xmm6,[rbx]
;mafia3.exe+963B5D - 0F28 DD - movaps xmm3,xmm5
;mafia3.exe+963B60 - F3 0F10 7B 08 - movss xmm7,[rbx+08]
;mafia3.exe+963B65 - 0F28 C6 - movaps xmm0,xmm6
;mafia3.exe+963B68 - F3 44 0F10 46 04 - movss xmm8,[rsi+04]
;mafia3.exe+963B6E - 0F28 CF - movaps xmm1,xmm7
cmp byte ptr [g_cameraEnabled], 1 ; check if the user enabled the camera. If so, just skip the write statements, otherwise just execute the original code.
jne originalCode ; our own camera is enabled, just skip the writes
cmp qword ptr rdi, [g_cameraMatrixAddress]
je exit ; destination is the matrix we're after, do skip everything
originalCode:
mov [rdi+04h],eax
mov eax,[rsi+04h]
mov [rdi+14h],eax
mov eax,[rsi+08h]
mov [rdi+24h],eax
exit:
jmp qword ptr [_cameraWrite2InterceptionContinue] ; jmp back into the original game code, which is the location after the original statements above.
cameraWrite2Interceptor ENDP
cameraWrite3Interceptor PROC
;mafia3.exe+963CBE - F3 0F59 F2 - mulss xmm6,xmm2
;mafia3.exe+963CC2 - F3 0F59 EA - mulss xmm5,xmm2
;mafia3.exe+963CC6 - F3 0F59 FA - mulss xmm7,xmm2
;mafia3.exe+963CCA - F3 0F11 77 08 - movss [rdi+08],xmm6 << INTERCEPT HERE << WRITE _13
;mafia3.exe+963CCF - F3 0F11 6F 18 - movss [rdi+18],xmm5 << WRITE _23
;mafia3.exe+963CD4 - F3 0F11 7F 28 - movss [rdi+28],xmm7 << WRITE _33
;mafia3.exe+963CD9 - F3 0F10 5E 04 - movss xmm3,[rsi+04] << CONTINUE HERE
;mafia3.exe+963CDE - F3 0F10 66 08 - movss xmm4,[rsi+08]
;mafia3.exe+963CE3 - 0F28 D3 - movaps xmm2,xmm3
;mafia3.exe+963CE6 - F3 0F10 0E - movss xmm1,[rsi]
;mafia3.exe+963CEA - 0F28 C4 - movaps xmm0,xmm4
cmp byte ptr [g_cameraEnabled], 1 ; check if the user enabled the camera. If so, just skip the write statements, otherwise just execute the original code.
jne originalCode ; our own camera is enabled, just skip the writes
cmp qword ptr rdi, [g_cameraMatrixAddress]
je exit ; destination is the matrix we're after, do skip everything
originalCode:
movss dword ptr [rdi+08h],xmm6
movss dword ptr [rdi+18h],xmm5
movss dword ptr [rdi+28h],xmm7
exit:
jmp qword ptr [_cameraWrite3InterceptionContinue] ; jmp back into the original game code, which is the location after the original statements above.
cameraWrite3Interceptor ENDP
cameraWrite4Interceptor PROC
;mafia3.exe+9666AF - 89 47 50 - mov [rdi+50],eax
;mafia3.exe+9666B2 - 8B 44 24 58 - mov eax,[rsp+58]
;mafia3.exe+9666B6 - 89 47 5C - mov [rdi+5C],eax
;mafia3.exe+9666B9 - 8B 44 24 48 - mov eax,[rsp+48]
;mafia3.exe+9666BD - 41 89 40 08 - mov [r8+08],eax
;mafia3.exe+9666C1 - F3 44 0F11 47 70 - movss [rdi+70],xmm8
;mafia3.exe+9666C7 - F3 44 0F11 4F 6C - movss [rdi+6C],xmm9 << INTERCEPT HERE << WRITE FOV
;mafia3.exe+9666CD - 8B 47 48 - mov eax,[rdi+48]
;mafia3.exe+9666D0 - 89 47 24 - mov [rdi+24],eax <<< X
;mafia3.exe+9666D3 - 8B 47 4C - mov eax,[rdi+4C]
;mafia3.exe+9666D6 - 89 47 34 - mov [rdi+34],eax <<< Y
;mafia3.exe+9666D9 - 8B 47 50 - mov eax,[rdi+50]
;mafia3.exe+9666DC - 89 47 44 - mov [rdi+44],eax <<< Z
;mafia3.exe+9666DF - F3 0F10 47 54 - movss xmm0,[rdi+54] << CONTINUE HERE
;mafia3.exe+9666E4 - F3 0F5C 47 48 - subss xmm0,[rdi+48]
cmp byte ptr [g_cameraEnabled], 1 ; check if the user enabled the camera. If so, just skip the write statements, otherwise just execute the original code.
jne originalCode ; our own camera is enabled, just skip the writes
cmp qword ptr rdi, [g_cameraStructAddress]
je exit ; destination is the matrix we're after, do skip everything
originalCode:
movss dword ptr [rdi+6Ch],xmm9 ; write fov
mov eax,[rdi+48h]
mov [rdi+24h],eax
mov eax,[rdi+4Ch]
mov [rdi+34h],eax
mov eax,[rdi+50h]
mov [rdi+44h],eax
exit:
jmp qword ptr [_cameraWrite4InterceptionContinue] ; jmp back into the original game code, which is the location after the original statements above.
cameraWrite4Interceptor ENDP
hudToggleInterceptor PROC
;mafia3.exe+2994D51 - 48 8B 43 20 - mov rax,[rbx+20] << INTERCEPT HERE
;mafia3.exe+2994D55 - 4C 8D 73 60 - lea r14,[rbx+60]
;mafia3.exe+2994D59 - 44 0FB6 38 - movzx r15d,byte ptr [rax] << HUD Toggle var read
;mafia3.exe+2994D5D - 45 3A 3E - cmp r15l,[r14]
;mafia3.exe+2994D60 - 0F84 A5000000 - je mafia3.exe+2994E0B << CONTINUE HERE
;mafia3.exe+2994D66 - 48 8B 7B 28 - mov rdi,[rbx+28]
;mafia3.exe+2994D6A - C7 44 24 40 01000000 - mov [rsp+40],00000001 { 1 }
;mafia3.exe+2994D72 - 48 89 44 24 48 - mov [rsp+48],rax
;mafia3.exe+2994D77 - C7 44 24 50 01000000 - mov [rsp+50],00000001 { 1 }
;mafia3.exe+2994D7F - 4C 89 74 24 58 - mov [rsp+58],r14
; The original code is used to check an array of bytes with either 1 or 0. We need the first byte, so we'll check whether
; the pointer in rax is smaller than the one we already have. If so, use it, otherwise skip it.
preambleOriginalCode:
mov rax, [rbx+20h]
cmp qword ptr [g_hudToggleAddress], 0
je setAddress
cmp qword ptr rax, [g_hudToggleAddress]
jg originalCode
setAddress:
mov [g_hudToggleAddress], rax
originalCode:
lea r14, [rbx+60h]
movzx r15d, byte ptr [rax]
cmp r15b,[r14]
exit:
jmp qword ptr [_hudToggleInterceptionContinue] ; jmp back into the original game code, which is the location after the original statements above.
hudToggleInterceptor ENDP
END | 53.565041 | 159 | 0.64051 |
f9dc08d34522f9933c140631202e8201226e25b9 | 1,555 | asm | Assembly | src/AtriumOS.asm | bomsi/AtriumOS | 7e91cce1059613b6529dc17e3c42b4d85b5b97bc | [
"BSD-2-Clause"
] | 2 | 2019-05-06T19:10:25.000Z | 2019-08-01T08:14:13.000Z | src/AtriumOS.asm | bomsi/AtriumOS | 7e91cce1059613b6529dc17e3c42b4d85b5b97bc | [
"BSD-2-Clause"
] | null | null | null | src/AtriumOS.asm | bomsi/AtriumOS | 7e91cce1059613b6529dc17e3c42b4d85b5b97bc | [
"BSD-2-Clause"
] | null | null | null | ; AtriumOS "linker script"
; Copyright (c) 2017-2021 Mislav Bozicevic
; 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.
; 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.
; Assemble with:
; nasm AtriumOS.asm -fbin -o atrium.flp
%include "boot.asm"
%include "display.asm"
%include "kernel.asm"
; fill the rest with zeroes
times 1474560 - ($ - $$) db 0
| 40.921053 | 79 | 0.774277 |
f2b2e7ed962f29fa597ed1514c53289ff18bb5ac | 994 | asm | Assembly | oeis/113/A113479.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/113/A113479.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/113/A113479.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A113479: Starting with the fraction 4/1 as the first term, a(n) is the numerator of the reduced fraction of the n-th term according to the rule: if n is even, multiply the previous term by n/(n+1); otherwise multiply the previous term by (n+1)/n.
; 4,8,32,128,256,512,4096,32768,65536,131072,524288,2097152,4194304,8388608,134217728,2147483648,4294967296,8589934592,34359738368,137438953472,274877906944,549755813888,4398046511104,35184372088832,70368744177664,140737488355328,562949953421312,2251799813685248,4503599627370496,9007199254740992,288230376151711744,9223372036854775808,18446744073709551616,36893488147419103232,147573952589676412928,590295810358705651712,1180591620717411303424,2361183241434822606848,18889465931478580854784
seq $0,92054 ; Base-2 logarithm of the sum of numerator and denominator of the convergents of the continued fraction expansion [1; 1/2, 1/3, 1/4, ..., 1/n, ...].
seq $0,198633 ; Total number of round trips, each of length 2*n on the graph P_3 (o-o-o).
| 165.666667 | 491 | 0.816901 |
21803bd599cf57b062df36d85c3dbe57ccf8efb6 | 363 | asm | Assembly | oeis/047/A047359.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/047/A047359.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/047/A047359.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A047359: Numbers that are congruent to {0, 2, 3} mod 7.
; Submitted by Christian Krause
; 0,2,3,7,9,10,14,16,17,21,23,24,28,30,31,35,37,38,42,44,45,49,51,52,56,58,59,63,65,66,70,72,73,77,79,80,84,86,87,91,93,94,98,100,101,105,107,108,112,114,115,119,121,122,126,128,129,133,135,136,140
mul $0,36
div $0,27
add $0,1
mul $0,6
div $0,4
mul $0,7
div $0,6
sub $0,1
| 27.923077 | 197 | 0.666667 |
6f8187b0ced0a8c8cbe430933f9d0fc5b30108ed | 395 | asm | Assembly | asm/kernels/fourth.asm | icefoxen/lang | 628185020123aabe4753f96c6ab4378637a2dbf5 | [
"MIT"
] | null | null | null | asm/kernels/fourth.asm | icefoxen/lang | 628185020123aabe4753f96c6ab4378637a2dbf5 | [
"MIT"
] | null | null | null | asm/kernels/fourth.asm | icefoxen/lang | 628185020123aabe4753f96c6ab4378637a2dbf5 | [
"MIT"
] | null | null | null | global _start
_start:
jmp main
align 4
dd 0x1badb002
dd 0
dd 0 - 0x1badb002
main:
call _pushstack
mov dword [esp], 0x20
mov eax, [esp]
imul eax, 0x02
mov [esp], eax
mov edx, [esp]
call _printedx
;call times2
call _popstack
leave
ret
_pushstack:
sub esp, byte 0x04
leave
ret
_popstack:
add esp, byte 0x04
leave
ret
_printedx:
mov [0x000b8010], edx
leave
ret
| 9.186047 | 22 | 0.683544 |
76e84fef60ede1d3f71078f64a8ddf98089e28db | 352 | asm | Assembly | programs/oeis/010/A010986.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/010/A010986.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/010/A010986.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A010986: Binomial coefficient C(n,33).
; 1,34,595,7140,66045,501942,3262623,18643560,95548245,445891810,1917334783,7669339132,28760021745,101766230790,341643774795,1093260079344,3348108992991,9847379391150,27900908274925,76360380541900,202355008436035,520341450264090,1300853625660225,3167295784216200,7522327487513475
add $0,33
mov $1,$0
bin $1,33
| 50.285714 | 279 | 0.852273 |
b1e8c8e04ec7749fd0754cad3e7ea209a9c62f9f | 454 | asm | Assembly | programs/oeis/083/A083878.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/083/A083878.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/083/A083878.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A083878: a(0)=1, a(1)=3, a(n)=6a(n-1)-7a(n-2), n>=2.
; 1,3,11,45,193,843,3707,16341,72097,318195,1404491,6199581,27366049,120799227,533233019,2353803525,10390190017,45864515427,202455762443,893682966669,3944907462913,17413664010795,76867631824379
mov $2,$0
add $2,1
mov $5,$0
lpb $2
mov $0,$5
sub $2,1
sub $0,$2
sub $0,1
cal $0,86351 ; T(n,3) of A086350.
mov $3,2
mul $3,$0
mov $4,$3
mov $6,$3
cmp $6,0
add $4,$6
add $1,$4
lpe
| 21.619048 | 193 | 0.643172 |
acb2cc8a3a03c1b707b8ba405df8d287d26c04be | 687 | asm | Assembly | oeis/274/A274682.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/274/A274682.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/274/A274682.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A274682: Numbers n such that 8*n-1 is a triangular number.
; Submitted by Simon Strandgaard
; 2,7,29,44,88,113,179,214,302,347,457,512,644,709,863,938,1114,1199,1397,1492,1712,1817,2059,2174,2438,2563,2849,2984,3292,3437,3767,3922,4274,4439,4813,4988,5384,5569,5987,6182,6622,6827,7289,7504,7988,8213,8719,8954,9482,9727,10277,10532,11104,11369,11963,12238,12854,13139,13777,14072,14732,15037,15719,16034,16738,17063,17789,18124,18872,19217,19987,20342,21134,21499,22313,22688,23524,23909,24767,25162,26042,26447,27349,27764,28688,29113,30059,30494,31462,31907,32897,33352,34364,34829,35863
mov $1,$0
gcd $0,2
pow $0,2
add $0,2
mul $1,8
add $0,$1
bin $0,2
mul $0,8
div $0,64
add $0,1
| 45.8 | 498 | 0.764192 |
c1b808a08b9fd432fdce32cb5d1d0dde84f3becc | 595 | asm | Assembly | oeis/036/A036548.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/036/A036548.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/036/A036548.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A036548: a(n) = T(7,n), array T given by A048471.
; 1,129,513,1665,5121,15489,46593,139905,419841,1259649,3779073,11337345,34012161,102036609,306109953,918329985,2754990081,8264970369,24794911233,74384733825,223154201601,669462604929,2008387814913,6025163444865,18075490334721,54226471004289,162679413012993,488038239039105,1464114717117441,4392344151352449,13177032454057473,39531097362172545,118593292086517761,355779876259553409,1067339628778660353,3202018886335981185,9606056659007943681,28818169977023831169,86454509931071493633
mov $1,3
pow $1,$0
div $1,2
mul $1,128
add $1,1
mov $0,$1
| 59.5 | 483 | 0.852101 |
65f5210b4902f1332ea7ac1de4e4c2b7c0ca7a25 | 669 | asm | Assembly | oeis/086/A086665.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/086/A086665.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/086/A086665.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A086665: Difference between sum of divisors of n and integer log of n, i.e., A000203(n) - A001414(n).
; Submitted by Christian Krause
; 1,1,1,3,1,7,1,9,7,11,1,21,1,15,16,23,1,31,1,33,22,23,1,51,21,27,31,45,1,62,1,53,34,35,36,81,1,39,40,79,1,84,1,69,67,47,1,113,43,81,52,81,1,109,56,107,58,59,1,156
add $0,1
mov $1,1
lpb $0
mov $3,$0
add $8,$1
lpb $3
mov $1,$8
mov $4,$0
mov $6,$2
cmp $6,0
add $2,$6
mod $4,$2
cmp $4,0
cmp $4,0
mov $5,$2
add $2,1
cmp $5,1
max $4,$5
sub $3,$4
lpe
mov $5,1
lpb $0
dif $0,$2
mul $0,$5
mul $5,$2
lpe
mul $1,$5
sub $7,$5
add $7,$1
lpe
mov $0,$7
add $0,1
| 18.081081 | 163 | 0.527653 |
e54650b5594fee3f1e55798d4d86bd8caf6a1718 | 2,954 | asm | Assembly | source/core/tointeger.asm | paulscottrobson/rpl-65 | 73f85a6b0f230fa03a41e1a9416c2511cf67f0c0 | [
"MIT"
] | 1 | 2019-11-20T09:18:22.000Z | 2019-11-20T09:18:22.000Z | source/core/tointeger.asm | paulscottrobson/rpl-65 | 73f85a6b0f230fa03a41e1a9416c2511cf67f0c0 | [
"MIT"
] | null | null | null | source/core/tointeger.asm | paulscottrobson/rpl-65 | 73f85a6b0f230fa03a41e1a9416c2511cf67f0c0 | [
"MIT"
] | null | null | null | ; ******************************************************************************
; ******************************************************************************
;
; Name : tointeger.asm
; Purpose : Try to convert string to a constant integer.
; Author : Paul Robson (paul@robsons.org.uk)
; Created : 12th November 2019
;
; ******************************************************************************
; ******************************************************************************
; ******************************************************************************
;
; Convert String YX to Integer in YX. CS = Okay, CC = Failed.
; if okay returns characters consumed in A.
;
; ******************************************************************************
StringToInt:
stx zTemp3 ; save string
sty zTemp3+1
stz signCount ; signcount is the number of chars copied.
ldx #16 ; base to use.
ldy #1 ; character offset.
;
lda (zTemp3) ; first character
cmp #"$" ; is it hexadecimal
beq _STIConvert ; convert from character 1, base 16.
;
dey ; from character 0
ldx #10 ; base 10.
;
; Offset in token buffer in X, base to use in Y.
;
_STIConvert:
stx zTemp1 ; save base in zTemp1
lda (zTemp3),y ; get first character
beq _STIFail ; if zero, then it has failed anyway.
;
stz zTemp0 ; clear the result.
stz zTemp0+1
;
_STILoop:
lda (zTemp3),y ; check in range 0-9 A-F
cmp #"0"
bcc _STIFail
cmp #"9"+1
bcc _STIOkay
cmp #"A"
bcc _STIFail
cmp #"F"+1
bcs _STIFail
_STIOkay:
lda zTemp0 ; copy current to zTemp2
sta zTemp2
lda zTemp0+1
sta zTemp2+1
stz zTemp0 ; clear result
stz zTemp0+1
ldx zTemp1 ; X contains the base.
;
_STIMultiply:
txa ; shift Y right into carry.
lsr a
tax
bcc _STINoAdd ; skip if CC, e.g. LSB was zero
;
clc
lda zTemp2 ; add zTemp2 into zTemp0
adc zTemp0
sta zTemp0
lda zTemp2+1
adc zTemp0+1
sta zTemp0+1
;
_STINoAdd:
asl zTemp2 ; shift zTemp2 left e.g. x 2
rol zTemp2+1
cpx #0 ; multiply finished ?
bne _STIMultiply
;
;
sec ; hex adjust
lda (zTemp3),y ; get digit.
cmp #58
bcc _STIDecimal
sec
sbc #7
_STIDecimal:
sec
sbc #48
cmp zTemp1 ; if >= base then fail.
bcs _STIFail
;
cld
adc zTemp0 ; add into the current value
sta zTemp0
bcc _STINoCarry
inc zTemp0+1
_STINoCarry:
;
lda (zTemp3),y ; get character just done.
iny ; point to next
inc SignCount
bra _STILoop ; and go round again.
;
_STIFail: ; done the conversion.
lda SignCount ; if converted 0 charactes, fail.
beq _STINoConvert
tya ; convert count in A.
ldx zTemp0 ; return result
ldy zTemp0+1
sec
rts
_STINoConvert:
clc
rts
| 24.01626 | 80 | 0.493568 |
0a6b325d32db37e563f923ead8c2a89d1f3fd4a8 | 574 | asm | Assembly | oeis/053/A053128.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/053/A053128.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/053/A053128.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A053128: Binomial coefficients C(2*n-5,6).
; 7,84,462,1716,5005,12376,27132,54264,100947,177100,296010,475020,736281,1107568,1623160,2324784,3262623,4496388,6096454,8145060,10737573,13983816,18009460,22957480,28989675,36288252,45057474,55525372,67945521,82598880,99795696,119877472,143218999,170230452,201359550,237093780,277962685,324540216,377447148,437353560,504981379,581106988,666563898,762245484,869107785,988172368,1120529256,1267339920,1429840335,1609344100,1807245622,2025023364,2264243157,2526561576,2813729380,3127595016,3470108187
add $0,1
mul $0,-2
bin $0,6
| 82 | 499 | 0.850174 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.