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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1e8fe8244202b6c78cf68377d7851b82b3a9b581 | 234 | asm | Assembly | noshim.asm | imneme/spectrum-minilib | e3b999f209f8cf1014aeb240accff8b7b15270d6 | [
"MIT"
] | 1 | 2020-09-22T09:18:19.000Z | 2020-09-22T09:18:19.000Z | noshim.asm | imneme/spectrum-minilib | e3b999f209f8cf1014aeb240accff8b7b15270d6 | [
"MIT"
] | null | null | null | noshim.asm | imneme/spectrum-minilib | e3b999f209f8cf1014aeb240accff8b7b15270d6 | [
"MIT"
] | null | null | null | INCLUDE "romdefs.inc"
SECTION code_clib
GLOBAL _zx_rom_cls
GLOBAL _zx_rom_cls_lower
GLOBAL _zx_rom_set_min
defc _zx_rom_cls = ROM3_CLS
defc _zx_rom_cls_lower = ROM3_CLS_LOWER
defc _zx_rom_set_min = ROM3_SET_MIN
| 21.272727 | 41 | 0.782051 |
3085f98045a407370e07f980f4691db86c7fada8 | 459 | asm | Assembly | programs/oeis/084/A084860.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/084/A084860.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/084/A084860.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A084860: Expansion of (1-2x+2x^2-x^3)/(1-2x)^2.
; 1,2,6,15,36,84,192,432,960,2112,4608,9984,21504,46080,98304,208896,442368,933888,1966080,4128768,8650752,18087936,37748736,78643200,163577856,339738624,704643072,1459617792,3019898880,6241124352
mov $3,2
mov $5,$0
lpb $3
mov $0,$5
sub $3,1
add $0,$3
trn $0,1
seq $0,84858 ; Binomial transform of A001651.
mov $2,$3
mul $2,$0
add $1,$2
mov $4,$0
lpe
min $5,1
mul $5,$4
sub $1,$5
mov $0,$1
| 21.857143 | 196 | 0.668845 |
e56c5b034d3744390d637bc5db3cef52f00b3a74 | 3,768 | asm | Assembly | falling.asm | gasman/kisskill | 9f8112a8fb282dc1cf1d0c8ed5f91eacbb59485d | [
"MIT"
] | 2 | 2015-05-26T12:49:13.000Z | 2018-09-09T16:43:06.000Z | falling.asm | gasman/kisskill | 9f8112a8fb282dc1cf1d0c8ed5f91eacbb59485d | [
"MIT"
] | null | null | null | falling.asm | gasman/kisskill | 9f8112a8fb282dc1cf1d0c8ed5f91eacbb59485d | [
"MIT"
] | null | null | null | falling
; ld b,50 ; 300 frames, 6 frames on each iteration
ld b,44 ; a bit less, so that we have fuzz afterwards
fall_lp
push bc
halt
call do_wall
call upd_spr32
call upd_spr24
call upd_spr16
halt
call do_wall
call upd_spr32
halt
call do_wall
call upd_spr32
call upd_spr24
halt
call do_wall
call upd_spr32
call upd_spr16
halt
call do_wall
call upd_spr32
call upd_spr24
halt
call do_wall
call upd_spr32
pop bc
djnz fall_lp
ret
upd_spr32
spr32pos
ld b,0 ; y
ld c,16 ; x
call sprite32
ld a,(spr32pos+1)
inc a
cp 192
ret z
ld (spr32pos+1),a
ret
upd_spr24
spr24pos
ld b,32
ld c,0x1c
call sprite24
ld a,(spr24pos+1)
inc a
cp 192
ret z
ld (spr24pos+1),a
ret
upd_spr16
spr16pos
ld b,88
ld c,0x02
call sprite16
ld a,(spr16pos+1)
inc a
cp 192
ret z
ld (spr16pos+1),a
ret
do_wall
wall_pos
ld hl,wall_bg
ld de,0x5800
ld b,24
wall_row
push bc
rept 32
ldi
endm
pop bc
ld a,h
and 1 + (high wall_bg)
ld h,a
djnz wall_row
ld hl,(wall_pos+1)
ld bc,32
add hl,bc
ld a,h
and 1 + (high wall_bg)
ld h,a
ld (wall_pos+1),hl
ret
; enter with b=y (pix), c=x (char); return with screen address in de
calc_screen_addr
ld l,b ; y
ld h,high ypositions
ld a,(hl)
add a,c ; x
ld e,a
inc h
ld d,(hl)
ret
sprite32
call calc_screen_addr
ld hl,falling_32
ld b,96
sprite32lp
push bc
push de
ldi
ldi
ldi
ldi
pop de
call upde
pop bc
ld a,0x58
cp d
ret z
djnz sprite32lp
ret
sprite24
call calc_screen_addr
ld hl,falling_24
ld b,72
sprite24lp
push bc
push de
ldi
ldi
ldi
pop de
call upde
pop bc
ld a,0x58
cp d
ret z
djnz sprite24lp
ret
sprite16
call calc_screen_addr
ld hl,falling_16
ld b,48
sprite16lp
push bc
push de
ldi
ldi
pop de
call upde
pop bc
ld a,0x58
cp d
ret z
djnz sprite16lp
ret
;upde
; inc d
; ld a,d
; and 7
; ret nz
; ld a,e
; add a,32
; ld e,a
; ret c
; ld a,d
; sub 8
; ld d,a
; ret
falling_32
incbin "falling-32x96.bin"
falling_24
incbin "falling-24x72.bin"
falling_16
incbin "falling-16x48.bin"
align 0x0200
wall_bg
db 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,23, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
db 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,23, 7, 7, 7, 7, 7, 7, 7, 7,23, 7, 7, 7,23, 7, 7, 7, 7, 7, 7
db 23, 7, 7, 7, 7,23, 7, 7, 7, 7, 7, 7, 7,23, 7, 7, 7, 7, 7, 7, 7, 7,23, 7,23, 7, 7, 7, 7, 7, 7, 7
db 7,23, 7, 7,23, 7, 7, 7, 7, 7, 7, 7, 7, 7,23, 7, 7, 7,23, 7, 7, 7, 7,23, 7, 7, 7, 7,23, 7, 7, 7
db 7, 7,23, 7, 7, 7,23, 7, 7, 7, 7, 7, 7, 7, 7,23, 7,23, 7, 7, 7, 7, 7, 7, 7, 7, 7,23, 7, 7, 7, 7
db 7, 7, 7,23, 7, 7, 7,23, 7,23, 7, 7, 7, 7, 7, 7,23, 7, 7, 7, 7, 7, 7, 7, 7, 7,23, 7, 7, 7, 7, 7
db 7, 7, 7, 7, 7, 7, 7, 7,23, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
db 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
db 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,23, 7, 7, 7, 7, 7, 7, 7
db 7,23, 7, 7, 7, 7, 7, 7, 7, 7,23, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,23, 7, 7, 7, 7, 7, 7
db 7, 7,23, 7, 7, 7,23, 7, 7, 7, 7,23, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,23, 7, 7, 7,23, 7, 7, 7, 7, 7
db 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,23, 7, 7, 7, 7,23, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
db 7, 7, 7, 7,23, 7, 7, 7, 7,23, 7, 7, 7,23, 7,23, 7, 7, 7, 7,23, 7, 7, 7, 7, 7, 7, 7,23, 7, 7, 7
db 7, 7, 7,23, 7, 7, 7, 7,23, 7, 7, 7, 7, 7,23, 7, 7,23, 7,23, 7, 7, 7, 7, 7, 7, 7,23, 7, 7, 7,23
db 7, 7, 7, 7, 7, 7, 7,23, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,23, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,23, 7
db 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,23, 7, 7
ypositions
rept 256, n
db (n & 0x38)<<2
endm
rept 256, n
db 0x40|(n & 0x07)|(n & 0xc0)>>3
endm
| 16.102564 | 99 | 0.551221 |
b3239fe6da35c5eff6ee1102af2f326081d2809f | 1,363 | asm | Assembly | print_array.asm | danielzy95/x86-funz | 67763837b7ed236379359f51ab87d8200d141bd6 | [
"MIT"
] | null | null | null | print_array.asm | danielzy95/x86-funz | 67763837b7ed236379359f51ab87d8200d141bd6 | [
"MIT"
] | null | null | null | print_array.asm | danielzy95/x86-funz | 67763837b7ed236379359f51ab87d8200d141bd6 | [
"MIT"
] | null | null | null | main:
push ebp
mov ebp, esp
sub esp, 20
; 4-Byte Element Array
mov dword [ ebp - 4 ], 5 ; arr[4]
mov dword [ ebp - 8 ], 7 ; arr[3]
mov dword [ ebp - 12 ], 12 ; arr[2]
mov dword [ ebp - 16 ], 50 ; arr[1]
mov dword [ ebp - 20 ], 1 ; arr[0]
mov eax, ebp
sub eax, 20
push 5
push eax
call print_array_4b
; 1-Byte Element Array
mov dword [ ebp - 24 ], 0x00001002
mov dword [ ebp - 28 ], 0x34678999
mov eax, ebp
sub eax, 28
push 6
push eax
call print_array_1b
jmp end
print_array_4b: ; Args: (int* arr, int n)
push ebp
mov ebp, esp
sub esp, 4 ; int i;
mov dword [ ebp - 4 ], 0 ; i = 0
for_pa4b:
mov ebx, dword [ ebp + 12 ]
cmp dword [ ebp - 4 ], ebx
je end_pa4b
mov eax, dword [ ebp - 4 ]
mov ebx, dword [ ebp + 8 ]
mov ebx, dword [ ebx + eax*4 ]
#show ebx
inc dword [ ebp - 4 ]
jmp for_pa4b
end_pa4b:
mov esp, ebp
pop ebp
ret
print_array_1b: ; Args: (char* arr, int n)
push ebp
mov ebp, esp
sub esp, 4 ; int i;
mov dword [ ebp - 4 ], 0 ; i = 0
for_pa1b:
mov ebx, dword [ ebp + 12 ]
cmp dword [ ebp - 4 ], ebx
je end_pa1b
mov eax, dword [ ebp - 4 ]
mov ebx, dword [ ebp + 8 ]
movzx ebx, byte [ ebx + eax ]
#show bl hex
inc dword [ ebp - 4 ]
jmp for_pa1b
end_pa1b:
mov esp, ebp
pop ebp
ret
; @Todo: Print Multidimensional Array
end:
; Cleanup
mov esp, ebp
pop ebp | 14.978022 | 42 | 0.588408 |
b5cf23f3f8fc6b9e7261748ac727528541beb413 | 490 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/math48/c/sdcc_iy/cm48_sdcciyp_dseq_callee.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/math/float/math48/c/sdcc_iy/cm48_sdcciyp_dseq_callee.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/math/float/math48/c/sdcc_iy/cm48_sdcciyp_dseq_callee.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
; char __fseq_callee(float left, float right)
SECTION code_clib
SECTION code_fp_math48
PUBLIC cm48_sdcciyp_dseq_callee
EXTERN cm48_sdcciyp_dcallee2, am48_deq
cm48_sdcciyp_dseq_callee:
; (left == right)
;
; enter : sdcc_float right, sdcc_float left, ret
;
; exit : HL = 0 and carry reset if false
; HL = 1 and carry set if true
;
; uses : af, bc, de, hl, bc', de', hl'
call cm48_sdcciyp_dcallee2
; AC'= right
; AC = left
jp am48_deq
| 17.5 | 51 | 0.655102 |
ee603f952644fb1ff5670f6faeba55e02ef192db | 147 | asm | Assembly | other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/ドイツ_PAL/Ger_asm1/zel_bms1.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/ドイツ_PAL/Ger_asm1/zel_bms1.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/ドイツ_PAL/Ger_asm1/zel_bms1.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | Name: zel_bms1.asm
Type: file
Size: 119253
Last-Modified: '2016-05-13T04:23:03Z'
SHA-1: 4A0A18249350B514EC532FDE6C030BCC4195DE68
Description: null
| 21 | 47 | 0.816327 |
087fc88eb292565c92eab48c3c66f0940eda7d82 | 99 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/math16/lm16/c/sdcc/exp2.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/math/float/math16/lm16/c/sdcc/exp2.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/math/float/math16/lm16/c/sdcc/exp2.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
SECTION code_fp_math16
PUBLIC _exp2f16
EXTERN cm16_sdcc_exp2
defc _exp2f16 = cm16_sdcc_exp2
| 12.375 | 31 | 0.818182 |
3fd1b1f5ce8203ffcb0af1d5a46164750b1cd423 | 6,928 | asm | Assembly | Transynther/x86/_processed/NC/_ht_zr_un_/i7-7700_9_0x48.log_21829_1928.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NC/_ht_zr_un_/i7-7700_9_0x48.log_21829_1928.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NC/_ht_zr_un_/i7-7700_9_0x48.log_21829_1928.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 %r14
push %r15
push %r8
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x18d98, %r15
add %rax, %rax
movups (%r15), %xmm2
vpextrq $0, %xmm2, %rsi
nop
nop
and %r15, %r15
lea addresses_UC_ht+0x17598, %r13
and %r8, %r8
mov (%r13), %r14d
nop
cmp $36341, %rsi
lea addresses_A_ht+0xa898, %rsi
lea addresses_A_ht+0x1ab38, %rdi
cmp $52845, %r15
mov $26, %rcx
rep movsb
nop
nop
nop
xor %r15, %r15
lea addresses_UC_ht+0x10d98, %r14
clflush (%r14)
nop
nop
nop
nop
nop
sub $9260, %r8
vmovups (%r14), %ymm3
vextracti128 $0, %ymm3, %xmm3
vpextrq $1, %xmm3, %rcx
nop
nop
nop
nop
dec %r8
lea addresses_WC_ht+0x10ac8, %r15
nop
sub %r14, %r14
movw $0x6162, (%r15)
nop
nop
sub %rcx, %rcx
lea addresses_A_ht+0x19d98, %rax
nop
xor %rsi, %rsi
movups (%rax), %xmm7
vpextrq $0, %xmm7, %r15
nop
nop
nop
cmp $3982, %rcx
lea addresses_UC_ht+0xad98, %rsi
lea addresses_WT_ht+0x1c158, %rdi
clflush (%rdi)
nop
nop
cmp %r13, %r13
mov $42, %rcx
rep movsw
nop
nop
nop
add $30608, %r14
lea addresses_UC_ht+0x1b018, %rsi
lea addresses_A_ht+0x16998, %rdi
clflush (%rsi)
nop
cmp $42038, %r15
mov $13, %rcx
rep movsb
nop
nop
sub %r15, %r15
lea addresses_WC_ht+0x6498, %rsi
lea addresses_WC_ht+0x1d798, %rdi
nop
nop
sub $19828, %rax
mov $29, %rcx
rep movsw
inc %rdi
lea addresses_WC_ht+0x5798, %rcx
nop
nop
nop
dec %r15
mov $0x6162636465666768, %r14
movq %r14, %xmm3
movups %xmm3, (%rcx)
nop
nop
nop
xor $59918, %r13
lea addresses_A_ht+0x12ad4, %r13
nop
sub $55892, %r8
mov $0x6162636465666768, %rdi
movq %rdi, %xmm3
and $0xffffffffffffffc0, %r13
vmovaps %ymm3, (%r13)
nop
nop
nop
nop
inc %r14
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r8
pop %r15
pop %r14
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r13
push %r14
push %rax
push %rsi
// Faulty Load
mov $0x4879db0000000d98, %rsi
nop
nop
nop
nop
nop
xor %rax, %rax
vmovups (%rsi), %ymm5
vextracti128 $1, %ymm5, %xmm5
vpextrq $1, %xmm5, %r11
lea oracles, %r13
and $0xff, %r11
shlq $12, %r11
mov (%r13,%r11,1), %r11
pop %rsi
pop %rax
pop %r14
pop %r13
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 7, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 9, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 8, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 3, 'size': 2, 'same': True, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 11, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': True}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 8, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': True, 'congruent': 1, 'size': 32, 'same': False, 'NT': False}}
{'08': 7725, '47': 8235, '00': 82, '72': 5697, '04': 90}
04 04 47 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 47 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 47 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 47 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 08 08 08 08 08 08 08 08 08 08 00 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 47 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 47 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 47 47 47 47 47 47 47 00 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 72 72 72 72 72 72 72 47 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 47 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 47 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 47 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 00 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 47 08 08 08 08 08 08 08 08 08 08 47 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 47 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 00 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 47 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 47 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 47 47 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08
*/
| 38.276243 | 2,999 | 0.657621 |
8725dff63c678c54e4b4049afe295a928f026451 | 289 | asm | Assembly | programs/oeis/040/A040419.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/040/A040419.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/040/A040419.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A040419: Continued fraction for sqrt(440).
; 20,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40
mov $1,20
lpb $0
mod $0,2
mul $1,2
lpe
gcd $1,$0
| 28.9 | 189 | 0.605536 |
4c9c678972666ec06b3bde904fffd7a51a5da1d1 | 1,449 | asm | Assembly | programs/oeis/229/A229093.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/229/A229093.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/229/A229093.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A229093: The clubs patterns appearing in n X n coins.
; 0,0,1,2,4,6,9,12,17,22,27,34,41,48,57,66,75,86,97,108,121,134,147,162,177,192,209,226,243,262,281,300,321,342,363,386,409,432,457,482,507,534,561,588,617,646,675,706,737,768,801,834,867,902,937,972,1009,1046,1083,1122,1161,1200,1241,1282,1323,1366,1409,1452,1497,1542,1587,1634,1681,1728,1777,1826,1875,1926,1977,2028,2081,2134,2187,2242,2297,2352,2409,2466,2523,2582,2641,2700,2761,2822,2883,2946,3009,3072,3137,3202,3267,3334,3401,3468,3537,3606,3675,3746,3817,3888,3961,4034,4107,4182,4257,4332,4409,4486,4563,4642,4721,4800,4881,4962,5043,5126,5209,5292,5377,5462,5547,5634,5721,5808,5897,5986,6075,6166,6257,6348,6441,6534,6627,6722,6817,6912,7009,7106,7203,7302,7401,7500,7601,7702,7803,7906,8009,8112,8217,8322,8427,8534,8641,8748,8857,8966,9075,9186,9297,9408,9521,9634,9747,9862,9977,10092,10209,10326,10443,10562,10681,10800,10921,11042,11163,11286,11409,11532,11657,11782,11907,12034,12161,12288,12417,12546,12675,12806,12937,13068,13201,13334,13467,13602,13737,13872,14009,14146,14283,14422,14561,14700,14841,14982,15123,15266,15409,15552,15697,15842,15987,16134,16281,16428,16577,16726,16875,17026,17177,17328,17481,17634,17787,17942,18097,18252,18409,18566,18723,18882,19041,19200,19361,19522,19683,19846,20009,20172,20337,20502
mov $2,$0
lpb $0
add $1,$0
sub $1,1
add $2,1
trn $2,$0
sub $0,$2
sub $0,1
trn $0,1
trn $2,$1
add $1,$0
sub $0,1
add $2,3
lpe
| 80.5 | 1,244 | 0.760524 |
74b23c13dc34b224ca14efb064e9559455a6c33c | 3,142 | asm | Assembly | sem1/asc/Quads/sir.asm | itsbratu/bachelor | b3bcae07fc8297fb0557a4bf752b20c6104c2563 | [
"MIT"
] | null | null | null | sem1/asc/Quads/sir.asm | itsbratu/bachelor | b3bcae07fc8297fb0557a4bf752b20c6104c2563 | [
"MIT"
] | null | null | null | sem1/asc/Quads/sir.asm | itsbratu/bachelor | b3bcae07fc8297fb0557a4bf752b20c6104c2563 | [
"MIT"
] | null | null | null | bits 32
global start
extern exit , printf
import exit msvcrt.dll
import printf msvcrt.dll
segment data use32 class=data
s dq 12345678h , 0AABBCCDDh , 12345678AABBCCDDh , 2h , 0Dh , 22AA22AA22AAAh
len equ ($-s)/8
copie dd -1
index dd 0
carry dd -1
secv_curr dd 0
secv_max dd -1
index_max dd 0
mesaj db "Elementul la index %d are %d astfel de secvente" , 0
segment code use32 class=code
start:
mov esi , s
mov ecx , len
repeta:
mov ebx , -1
mov dword[carry] , ebx
mov ebx , 0
mov dword[secv_curr] , ebx
mov dword[copie] , ecx
lodsd
mov ecx , 32
shiftare1:
xor ebx , ebx
shr eax , 1
adc ebx , 0
cmp ebx , 0
je is_zero
mov ebx , 0
cmp ebx , dword[carry]
jne not_good
mov ebx , dword[secv_curr]
inc ebx
mov dword[secv_curr] , ebx
jmp not_good
is_zero:
mov ebx , 0
mov dword[carry] , ebx
not_good:
mov ebx , -1
mov dword[carry] , ebx
loop shiftare1
jmp salt
revenire1:
mov ecx , dword[copie]
loop repeta
jmp final_gasire_element
salt:
lodsd
mov ecx , 32
shiftare2:
xor ebx , ebx
shr eax , 1
adc ebx , 0
cmp ebx , 0
je is_zero2
mov ebx , 0
cmp ebx , dword[carry]
jne not_good2
mov ebx , dword[secv_curr]
inc ebx
mov dword[secv_curr] , ebx
jmp not_good2
is_zero2:
mov ebx , 0
mov dword[carry] , ebx
not_good2:
mov ebx , -1
mov dword[carry] , ebx
loop shiftare2
mov ebx , dword[secv_curr]
cmp ebx , dword[secv_max]
jl final_repeta
mov ebx , dword[secv_curr]
mov dword[secv_max] , ebx
mov ebx , dword[index]
mov dword[index_max] , ebx
inc ebx
mov dword[index] , ebx
mov ecx , dword[copie]
final_repeta:
cmp ecx , 0
ja revenire1
final_gasire_element:
push dword [secv_max]
push dword [index_max]
push dword mesaj
call [printf]
add esp , 4*3
push dword 0
call [exit]
| 25.544715 | 79 | 0.38606 |
9fd3585755612c165de224cc56006d84af5698cc | 356 | asm | Assembly | programs/oeis/218/A218723.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/218/A218723.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/218/A218723.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A218723: a(n) = (256^n-1)/255.
; 0,1,257,65793,16843009,4311810305,1103823438081,282578800148737,72340172838076673,18519084246547628289,4740885567116192841985,1213666705181745367548161,310698676526526814092329217,79538861190790864407636279553,20361948464842461288354887565569,5212658806999670089818851216785665
mov $1,256
pow $1,$0
div $1,255
mov $0,$1
| 44.5 | 279 | 0.851124 |
fa5f5cac8663e892746c10bf0f6aedd338c6f1e3 | 464 | asm | Assembly | programs/oeis/047/A047529.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/047/A047529.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/047/A047529.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A047529: Numbers that are congruent to {1, 3, 7} mod 8.
; 1,3,7,9,11,15,17,19,23,25,27,31,33,35,39,41,43,47,49,51,55,57,59,63,65,67,71,73,75,79,81,83,87,89,91,95,97,99,103,105,107,111,113,115,119,121,123,127,129,131,135,137,139,143,145,147,151,153,155,159,161,163,167,169,171,175,177,179,183,185,187,191,193,195,199,201,203,207,209,211,215,217,219,223,225,227,231,233,235,239,241,243,247,249,251,255,257,259,263,265
mul $0,4
add $0,1
div $0,3
mul $0,2
add $0,1
| 51.555556 | 359 | 0.693966 |
48d2edff6221a9173ebcdcb322fb5a4f5f74fa31 | 855 | asm | Assembly | programs/oeis/145/A145127.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/145/A145127.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/145/A145127.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A145127: a(n) = 1 + (144 + (50 + (35 + (10 + n)*n)*n)*n)*n/120.
; 1,3,9,25,61,132,259,470,801,1297,2013,3015,4381,6202,8583,11644,15521,20367,26353,33669,42525,53152,65803,80754,98305,118781,142533,169939,201405,237366,278287,324664,377025,435931,501977,575793,658045,749436,850707,962638,1086049,1221801,1370797,1533983,1712349,1906930,2118807,2349108,2599009,2869735,3162561,3478813,3819869,4187160,4582171,5006442,5461569,5949205,6471061,7028907,7624573,8259950,8936991,9657712,10424193,11238579,12103081,13019977,13991613,15020404,16108835,17259462,18474913,19757889,21111165,22537591,24040093,25621674,27285415,29034476,30872097,32801599,34826385,36949941,39175837,41507728,43949355,46504546,49177217,51971373,54891109,57940611,61124157,64446118,67910959,71523240,75287617,79208843,83291769,87541345
add $0,4
mov $1,$0
bin $0,5
add $0,$1
sub $0,3
| 95 | 740 | 0.808187 |
2d6c4470685f41759b5251ec587be38d1edd0e2f | 7,223 | asm | Assembly | Appl/dil/bbxmail/asmcode/stylesStack.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Appl/dil/bbxmail/asmcode/stylesStack.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Appl/dil/bbxmail/asmcode/stylesStack.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) Designs in Light 2002 -- All Rights Reserved
PROJECT: Mail
FILE: stylesStack.asm
AUTHOR: Gene Anderson
DESCRIPTION:
A small stack for saving state about style information when
parsing HTML/rich-text documents
$Id$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
udata segment
styleStack hptr
udata ends
AsmCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
StyleStackInit
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: initialize the style stack
CALLED BY: FilterMailStyles (C)
PASS: none
RETURN: none
DESTROYED: ax, bx, cx
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
STYLE_STACK_CHUNK equ (size LMemBlockHeader)
STYLESTACKINIT proc far
uses ds
.enter
segmov ds, udata, bx
EC < tst ds:styleStack ;>
EC < ERROR_NZ -1 ;>
mov ax, LMEM_TYPE_GENERAL ;ax <- LMemType
clr cx ;cx <- extra header
call MemAllocLMem
mov ds:styleStack, bx
call MemLock
mov ds, ax
clr cx ;cx <- size
call LMemAlloc
EC < cmp ax, STYLE_STACK_CHUNK ;>
EC < ERROR_NE -1 ;>
call MemUnlock
.leave
ret
STYLESTACKINIT endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
StyleStackFree
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: free the style stack
CALLED BY: FilterMailStyles (C)
PASS: none
RETURN: none
DESTROYED: bx
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
STYLESTACKFREE proc far
uses ds
.enter
segmov ds, udata, bx
clr bx ;clear old
xchg bx, ds:styleStack ;bx <- stack handle
EC < tst bx ;>
EC < ERROR_Z -1 ;>
call MemFree
.leave
ret
STYLESTACKFREE endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
StyleStackLock
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: lock the style stack
CALLED BY: UTILITY
PASS: none
RETURN: ds - seg addr of style stack
DESTROYED: none
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
StyleStackLock proc near
uses ax, bx
.enter
segmov ds, udata, bx
mov bx, ds:styleStack
call MemLock
mov ds, ax ;ds <- seg of stack
.leave
ret
StyleStackLock endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
StyleStackUnlock
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: unlock the style stack
CALLED BY: UTILITY
PASS: none
RETURN: none
DESTROYED: none (flags preserved)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
StyleStackUnlock proc near
uses bx, ds
.enter
segmov ds, udata, bx
mov bx, ds:styleStack
call MemUnlock
.leave
ret
StyleStackUnlock endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
StyleStackPush
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Push data on the style stack
CALLED BY: UTILITY
PASS: al - StyleStackTag
ah - size (0-6)
bx, cx, dx - data as needed
RETURN: none
DESTROYED: none
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
StyleStackPush proc near
uses ax, ds, es, si, di
.enter
call StyleStackLock
;
; insert space at the end start of the chunk
;
push ax, bx, cx
mov cl, ah
add cl, (size StyleStackElement)
clr ch ;cx <- size to add
mov ax, STYLE_STACK_CHUNK ;*ds:ax <- chunk
clr bx ;bx <- offset
call LMemInsertAt
pop ax, bx, cx
;
; copy the data as needed
;
mov si, ds:[STYLE_STACK_CHUNK] ;ds:si <- ptr to chunk
mov ds:[si], ax ;store tag, size
segmov es, ds
lea di, ds:[si].SSE_data ;es:di <- ptr to data
tst ah
jz done ;branch if done
mov al, bl
stosb ;store bl
dec ah ;ah <- 1 less byte
jz done ;branch if done
mov al, bh
stosb ;store bh
dec ah ;ah <- 1 less byte
jz done ;branch if done
mov al, cl
stosb ;store cl
dec ah ;ah <- 1 less byte
jz done ;branch if done
mov al, ch
stosb ;store ch
dec ah ;ah <- 1 less byte
jz done ;branch if done
mov al, dl
stosb ;store dl
dec ah ;ah <- 1 less byte
jz done ;branch if done
mov al, dh
stosb ;store dh
EC < dec ah ;>
EC < ERROR_NZ -1 ;>
done:
call StyleStackUnlock
.leave
ret
StyleStackPush endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
StyleStackPop
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Pop data from the style stack
CALLED BY: UTILITY
PASS: al - StyleStackTag
RETURN: bx, cx, dx - data as needed
carry - set if tag not found
DESTROYED: none
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
StyleStackPop proc near
uses ds, si, di
.enter
call StyleStackLock
mov si, STYLE_STACK_CHUNK ;*ds:si <- chunk
push bx, cx
ChunkSizeHandle ds, si, cx ;cx <- size of chunk
LONG jcxz notFoundPop ;branch if no data
mov si, ds:[si] ;ds:si <- chunk
clr di ;di <- offset
;
; find the first matching tag
;
findLoop:
cmp ds:[si].SSE_type, al ;right tag?
je foundTag ;branch if found tag
mov bl, ds:[si].SSE_size
add bl, (size StyleStackElement)
clr bh ;bx <- element size
add si, bx ;ds:si <- ptr to next
add di, bx ;di <- next offset
sub cx, bx ;cx <- # bytes left
jz notFoundPop ;branch if none left
EC < ERROR_C -1 ;die if underflow >
jmp findLoop
foundTag:
pop bx, cx
;
; found the tag, get the data
;
mov ah, ds:[si].SSE_size ;ah <- size
push ax
add si, (size StyleStackElement) ;ds:si <- data
tst ah
jz doneData ;branch if done
lodsb
mov bl, al ;bl <- byte #1
dec ah ;ah <- one less byte
jz doneData ;branch if done
lodsb
mov bh, al ;bh <- byte #2
dec ah ;ah <- one less byte
jz doneData ;branch if done
lodsb
mov cl, al ;cl <- byte #3
dec ah ;ah <- one less byte
jz doneData ;branch if done
lodsb
mov ch, al ;ch <- byte #4
dec ah ;ah <- one less byte
jz doneData ;branch if done
lodsb
mov dl, al ;dl <- byte #5
dec ah ;ah <- one less byte
jz doneData ;branch if done
lodsb
mov dh, al ;dh <- byte #6
EC < dec ah ;>
EC < ERROR_NZ -1 ;>
doneData:
pop ax ;ah <- size
;
; delete the space
;
push bx, cx, dx
mov cl, ah
clr ch ;cx <- # bytes data
add cx, (size StyleStackElement) ;cx <- # bytes total
mov ax, STYLE_STACK_CHUNK ;ax <- chunk
mov bx, di ;bx <- offset
call LMemDeleteAt
pop bx, cx, dx
clc ;carry <- found
done:
call StyleStackUnlock
.leave
ret
notFoundPop:
pop bx, cx
stc ;carry <- not found
jmp done
StyleStackPop endp
AsmCode ends
| 21.690691 | 79 | 0.49287 |
9306cbbe0de20119f987216b2b4ba5e5e87af4e0 | 433 | asm | Assembly | oeis/025/A025948.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/025/A025948.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/025/A025948.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A025948: Expansion of 1/((1-2x)(1-3x)(1-8x)(1-9x)).
; Submitted by Jon Maiga
; 1,22,321,3938,44045,465894,4751017,47229226,460842789,4433881166,42195474113,398084143314,3729357886333,34737030515638,322015765266009,2973201855377402,27359296571272277,251037508511614110
mov $1,1
mov $2,$0
mov $3,$0
lpb $2
mov $0,$3
sub $2,1
sub $0,$2
seq $0,16316 ; Expansion of 1/((1-2x)(1-8x)(1-9x)).
mul $1,3
add $1,$0
lpe
mov $0,$1
| 25.470588 | 190 | 0.699769 |
c01ad54eef55a0d68eb1cb1d1cc267789f307344 | 293 | asm | Assembly | libsrc/_DEVELOPMENT/string/c/sccz80/strchr.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/string/c/sccz80/strchr.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/string/c/sccz80/strchr.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1 | 2019-12-03T23:28:20.000Z | 2019-12-03T23:28:20.000Z |
; char *strchr(const char *s, int c)
SECTION code_clib
SECTION code_string
PUBLIC strchr
EXTERN asm_strchr
strchr:
pop af
pop bc
pop hl
push hl
push bc
push af
jp asm_strchr
; SDCC bridge for Classic
IF __CLASSIC
PUBLIC _strchr
defc _strchr = strchr
ENDIF
| 10.103448 | 36 | 0.692833 |
e3c31cc573462a5646c5de543def5f170d820526 | 479 | asm | Assembly | programs/oeis/020/A020549.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/020/A020549.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/020/A020549.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A020549: a(n) = (n!)^2 + 1.
; 2,2,5,37,577,14401,518401,25401601,1625702401,131681894401,13168189440001,1593350922240001,229442532802560001,38775788043632640001,7600054456551997440001,1710012252724199424000001,437763136697395052544000001,126513546505547170185216000001,40990389067797283140009984000001,14797530453474819213543604224000001
seq $0,142 ; Factorial numbers: n! = 1*2*3*4*...*n (order of symmetric group S_n, number of permutations of n letters).
pow $0,2
add $0,1
| 68.428571 | 309 | 0.820459 |
b906a8435b663f88fb33a5386a04470c2b74bb67 | 1,226 | asm | Assembly | programs/oeis/287/A287553.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/287/A287553.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/287/A287553.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A287553: Positions of 1 in A053839.
; 2,5,12,15,17,24,27,30,36,39,42,45,51,54,57,64,65,72,75,78,84,87,90,93,99,102,105,112,114,117,124,127,132,135,138,141,147,150,153,160,162,165,172,175,177,184,187,190,195,198,201,208,210,213,220,223,225,232,235,238,244,247,250,253,257,264,267,270,276,279,282,285,291,294,297,304,306,309,316,319,324,327,330,333,339,342,345,352,354,357,364,367,369,376,379,382,387,390,393,400,402,405,412,415,417,424,427,430,436,439,442,445,450,453,460,463,465,472,475,478,484,487,490,493,499,502,505,512,516,519,522,525,531,534,537,544,546,549,556,559,561,568,571,574,579,582,585,592,594,597,604,607,609,616,619,622,628,631,634,637,642,645,652,655,657,664,667,670,676,679,682,685,691,694,697,704,705,712,715,718,724,727,730,733,739,742,745,752,754,757,764,767,771,774,777,784,786,789,796,799,801,808,811,814,820,823,826,829,834,837,844,847,849,856,859,862,868,871,874,877,883,886,889,896,897,904,907,910,916,919,922,925,931,934,937,944,946,949,956,959,964,967,970,973,979,982,985,992,994,997
mov $2,$0
mov $3,$0
mul $3,8
add $3,4
mov $0,$3
mov $5,$3
lpb $0
add $0,$5
lpb $0
add $3,$0
div $0,4
lpe
lpe
sub $0,1
mov $1,$0
lpb $3
mod $3,4
lpe
mul $1,$3
add $1,4
mov $4,$2
mul $4,4
add $1,$4
| 45.407407 | 974 | 0.699021 |
e02d009399cac77c5c5e8857bb6e5b73b8b826c1 | 1,000 | asm | Assembly | libsrc/sprites/software/sp1/ts2068hr/tiles/SP1PSPUSH.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 38 | 2021-06-18T12:56:15.000Z | 2022-03-12T20:38:40.000Z | libsrc/sprites/software/sp1/ts2068hr/tiles/SP1PSPUSH.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 2 | 2021-06-20T16:28:12.000Z | 2021-11-17T21:33:56.000Z | libsrc/sprites/software/sp1/ts2068hr/tiles/SP1PSPUSH.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 6 | 2021-06-18T18:18:36.000Z | 2021-12-22T08:01:32.000Z | ; subroutine for writing registers to "struct sp1_pss"
; 02.2008 aralbrec
; ts2068 hi-res version
PUBLIC SP1PSPUSH
; exit : hl = & struct sp1_pss to write to
; e = flags (bit 0 = invalidate?, bit 1 = xwrap?, bit 2 = yinc?, bit3 = ywrap?)
; b = current x coordinate (relative to bounds rect IY)
; c = current y coordinate (relative to bounds rect IY)
; de' = current struct sp1_update *
; ix = visit function
; iy = bounds rectangle
.SP1PSPUSH
ld a,iyl ; write bounds rectangle
ld (hl),a
inc hl
ld a,iyh
ld (hl),a
inc hl
ld (hl),e ; write flags
inc hl
ld (hl),b ; write x coordinate
inc hl
ld (hl),c ; write y coordinate
inc hl
push hl
exx
pop hl
ld (hl),e ; write sp1_update
inc hl
ld (hl),d
inc hl
ld a,ixl ; write visit function
ld (hl),a
inc hl
ld a,ixh
ld (hl),a
ret
| 23.255814 | 88 | 0.534 |
9f3e163ed1d9354179ae23eae6d4e7c6e5499487 | 203 | asm | Assembly | mc-sema/validator/x86/tests/SUB32rr.asm | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | 2 | 2021-08-07T16:21:29.000Z | 2021-11-17T10:58:37.000Z | mc-sema/validator/x86/tests/SUB32rr.asm | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | null | null | null | mc-sema/validator/x86/tests/SUB32rr.asm | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | null | null | null | BITS 32
;TEST_FILE_META_BEGIN
;TEST_TYPE=TEST_F
;TEST_IGNOREFLAGS=
;TEST_FILE_META_END
; Sub32RR
mov eax, 0x1
mov ebx, 0x2
;TEST_BEGIN_RECORDING
sub ebx, eax
;TEST_END_RECORDING
| 15.615385 | 25 | 0.724138 |
1bb7f10b5740ddb648a0a16c645aaab245db90ba | 477 | asm | Assembly | programs/oeis/089/A089109.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/089/A089109.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/089/A089109.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A089109: Convoluted convolved Fibonacci numbers G_5^(r).
; 5,9,17,25,38,51,70,89,115,141,175,209,252,295,348,401,465,529,605,681,770,859,962,1065,1183,1301,1435,1569,1720,1871,2040,2209,2397,2585,2793,3001,3230,3459,3710,3961,4235,4509,4807,5105,5428,5751,6100,6449
mov $3,$0
add $0,2
mov $2,$0
mov $4,2
lpb $2,1
sub $2,1
add $1,$2
trn $1,$0
mov $0,$4
add $4,1
lpb $0,1
sub $0,1
add $1,$2
lpe
sub $2,1
lpe
lpb $3,1
add $1,2
sub $3,1
lpe
add $1,3
| 19.08 | 208 | 0.637317 |
4f7ffe2ede81257a4ba6ca3425c8f512ff9c6095 | 410 | asm | Assembly | II-sem/Microprocessor/Assembly Language Programs/sum.asm | ASHD27/JMI-MCA | 61995cd2c8306b089a9b40d49d9716043d1145db | [
"MIT"
] | 3 | 2020-03-18T16:27:33.000Z | 2021-06-07T12:39:32.000Z | II-sem/Microprocessor/Assembly Language Programs/sum.asm | ASHD27/JMI-MCA | 61995cd2c8306b089a9b40d49d9716043d1145db | [
"MIT"
] | null | null | null | II-sem/Microprocessor/Assembly Language Programs/sum.asm | ASHD27/JMI-MCA | 61995cd2c8306b089a9b40d49d9716043d1145db | [
"MIT"
] | 10 | 2019-11-11T06:49:10.000Z | 2021-06-07T12:41:20.000Z | .model small
.stack 10h
.data
num db 23
d db 10
sum db 0
.code
mov ax,@data
mov ds,ax
lbl1:
mov al,num
mov ah,0 ;clearing ah R
div d
mov num,al
mov al,ah
add al,sum
mov sum,al
cmp num,0
jne lbl1
mov al,sum
add al,48
mov dl,al
mov ah,02h
int 21h
mov ah,4ch
int 21h
end | 12.8125 | 30 | 0.465854 |
2280a4dd6057488ed126f1c3111f4239bab0e221 | 630 | asm | Assembly | Sample/SampleAsm.asm | absindx/L6502 | f1b57ef51682392156dbbfd034999179a9ca98d4 | [
"MIT"
] | null | null | null | Sample/SampleAsm.asm | absindx/L6502 | f1b57ef51682392156dbbfd034999179a9ca98d4 | [
"MIT"
] | null | null | null | Sample/SampleAsm.asm | absindx/L6502 | f1b57ef51682392156dbbfd034999179a9ca98d4 | [
"MIT"
] | null | null | null | ;--------------------------------------------------
; Vector
.org $FFFA
.dw NMI
.dw Reset
.dw Interrupt
.org $FFF0
NMI:
Interrupt:
BRK
RTI
.org $8000
Reset:
LDA #$42
STA <Argument_A
LDA #42
STA <Argument_B
JSR Multiply
NOP
BRK
;--------------------------------------------------
; Calculation
Argument = $00
Argument_A = Argument
Argument_B = Argument + 1
Result = $02
Result_Low = Result
Result_High = Result + 1
Multiply:
DEC <Argument_B
LDA <Argument_A
LSR A
STA <Result_Low
LDA #$00
LDY #$08
.Loop BCC +
ADC <Argument_B
+ ROR A
ROR <Result_Low
DEY
BNE .Loop
STA <Result_High
RTS
| 12.857143 | 51 | 0.557143 |
a28e4debb5b6fd3e9a000b786f0a865009e6d69b | 144 | asm | Assembly | other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/kart/risc.lzh/risc/join/Over-p.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/kart/risc.lzh/risc/join/Over-p.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/NEWS.7z/NEWS/テープリストア/NEWS_05/NEWS_05.tar/home/kimura/kart/risc.lzh/risc/join/Over-p.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | Name: Over-p.asm
Type: file
Size: 16237
Last-Modified: '1992-07-30T05:00:33Z'
SHA-1: 05AA3B7910E74362885E6980DC9C75AA999F2CE3
Description: null
| 20.571429 | 47 | 0.805556 |
bf5ffedbe96d97c7870cfd54aef877920a165cab | 11,507 | asm | Assembly | Universe/Sun/SunApplyMyRollAndPitch.asm | ped7g/EliteNext | 6e930f9b9924b295d7281ee6acb879600d7e597f | [
"Unlicense"
] | null | null | null | Universe/Sun/SunApplyMyRollAndPitch.asm | ped7g/EliteNext | 6e930f9b9924b295d7281ee6acb879600d7e597f | [
"Unlicense"
] | null | null | null | Universe/Sun/SunApplyMyRollAndPitch.asm | ped7g/EliteNext | 6e930f9b9924b295d7281ee6acb879600d7e597f | [
"Unlicense"
] | null | null | null |
; Full version
; 1. K2 = y - alpha * x
; 2. z = z + beta * K2
; 3. y = K2 - beta * z
; 4. x = x + alpha * y
; SunrollWork holds Alpha intermidate results
SunRollResult: DS 3 ; equivalent of K
SunRollResultp1 equ SunRollResult
SunRollResultp2 equ SunRollResult+1
SunRollResultp3 equ SunRollResult+2
SunRollResultp4 DB 0
;SunRollResult2: DS 3 ; do we need this? TODO
SunZResult: DS 3
; 1. K2 = y - alpha * x
; 2. z = z + beta * K2
; 3. y = K2 - beta * z
; 4. x = x + alpha * y
;.... or
; 2. z = z + (beta * (y - alpha * x))
; 3. y = (y - alpha * x) - (beta * z)
; 4. x = x + (alpha * y)
;----------------------------------------------------------------------------------------------------------------------------------
; based on MV40
SunApplyMyRollAndPitch: ld a,(ALPHA) ; no roll or pitch, no calc needed
ld hl,BETA
or (hl)
and SignMask8Bit
jp z,.NoRotation
.CalcZ: ;break
ld a,(ALPHA) ; get roll magnitude
cp 0
jr nz,.ApplyAlpha
.NoAlpha: ld de,(SBnKyhi) ; its going to be just Y if alpha is 0
ld a,(SBnKylo) ; .
ld l,a ; .
jp .SaveResult1 ; .
.ApplyAlpha: xor SignOnly8Bit ; get Q = -alpha
ld d,a ; d reg represents Q (abount to roll)
ld a,(SBnKxlo) ; HLE = x sgn, hi, lo
ld e,a ;
ld hl,(SBnKxhi) ;
call mulHLEbyDSigned ; DELC = x * -alpha, so DEL = X * -alpha / 256
.SkipAlphaMultiply: ld a,d
ld (SunRollResultp4),a ; save D (I guess we need the sign?)
.CalcYPlusDEL: ld a,(SBnKylo) ; BCH = Y sgn, hi, lo
ld h,a
ld bc,(SBnKyhi)
call AddBCHtoDELsigned ; DEL = Y - ( X * alpha /256) (which is K2)
.SaveResult1: ld a,d ; SunPitchWork = AHL = DEL
ld h,e ;
.CopyResultTo2: ld (SunRollResult+2),a ; .
ld (SunRollResult) ,hl ; .
.CalcY: ld e,l ; HLE = result (K2)
ld l,h ; .
ld h,a ; .
ld a,(BETA) ; get pitch
ld d,a ; now D = BETA
call mulHLEbyDSigned ; DELC = (y - alpha * x /256 ) * Beta or K2 * beta
ld bc,(SBnKzhi) ; BCH = z
ld a,(SBnKzlo) ; .
ld h,a ; .
call AddBCHtoDELsigned ; DEL = z + ((y - alpha * x /256 ) * Beta) /256
.SaveZResult: ld (SunZResult+1),de ; We now have a z result which we save
ld (SBnKzhi),de ; .
ld a,l ; .
ld (SunZResult),a ; .
ld (SBnKzlo),a ; .
.CalcMinusBetaMulZ: ex de,hl ; HLE = DEL = z post calculation
; not needed bugld e,l ; .
ld a,(BETA) ; d = - BETA
xor SignOnly8Bit ; .
ld d,a ; .
call mulHLEbyDSigned ; DELC = z * - BETA
ld bc, (SunRollResult+1) ; BCH = (y - alpha * x) (or K2)
ld a,(SunRollResult) ; .
ld h,a ; .
call AddBCHtoDELsigned ; DEL = (y - alpha * x) - (Z * BETA) (K2+ (Z * -BETA)
ld (SBnKyhi),de ; y = (y - alpha * x) - (Z * BETA)
ld a,l ; .
ld (SBnKylo),a ; .
.CalcX: ex de,hl ; HLE = DEL = Y
ld e,l ; .
ld a,(ALPHA) ; D = alpha
cp 0 ; if alpha is 0 then don't update x
jp z,.NoRotation
ld d,a ; .
call mulHLEbyDSigned ; DELC = Y * alpha
ld bc,(SBnKxhi) ; BCH = x
ld a,(SBnKxlo) ; .
ld h,a ; .
call AddBCHtoDELsigned ; DEL = x + (alpha * y /256 )
ld (SBnKxhi),de ; x = x + (alpha * y /256 )
ld a,h ; .
ld (SBnKxlo),a ; .
ret
.NoRotation: ld a,(DELTA) ; BCH = - Delta
cp 0
ret z
ld c,0 ;
ld h,a ;
ld b,$80 ;
ld de,(SBnKzhi) ; DEL = z position
ld a,(SBnKzlo) ; .
ld l,a ; .
call AddBCHtoDELsigned ; update speed
ld (SBnKzhi),DE ; write back to zpos
ld a,l
ld (SBnKzlo),a ;
ret
;
;SunApplyMyRollAndPitch: ld a,(ALPHA) ; no roll or pitch, no calc needed
; ld hl,BETA
; or (hl)
; and SignMask8Bit
; ret z
;.CalcZ: ;break
; ld a,(ALPHA) ; get roll magnitude
; xor SignOnly8Bit ; get Q = -alpha
; ld d,a ; d reg represents Q (abount to roll)
; ld a,(SBnKxlo) ; HLE = x sgn, hi, lo
; ld e,a ;
; ld hl,(SBnKxhi) ;
; call mulHLEbyDSigned ; DELC = x * -alpha, so DEL = X * -alpha / 256
; ld a,d
; ld (SunRollResultp4),a ; save D (I guess we need the sign?)
;.CalcYPlusDEL: ld a,(SBnKylo) ; BCH = Y sgn, hi, lo
; ld h,a
; ld bc,(SBnKyhi)
; call AddBCHtoDELsigned ; DEL = Y - ( X * alpha /256)
;.SaveResult1: ld a,l ; SunPitchWork = DEL
; ;ld (SunRollResult), a ; SunPitchWork + 0 = L
; ex de,hl ; SunPitchWork + 1 = E
;.CopyResultTo2: ld (SunRollResult+1),a ; SunPitchWork + 2 = D
; ld (SunRollResult+1) ,hl ; Copy K to K2 (y - alpha * x)
; ;ld (SunRollResult2+1),hl ; also HLA = result
; ld a,(SunRollResult) ; .
; ;ld (SunRollResult2),a ; .
;.CalcY: ld e,a ; so now HLE = result
; ld a,(BETA) ; get pitch
; ld d,a ; now D = BETA
; call mulHLEbyDSigned ; DELC = (y - alpha * x /256 ) * Beta
; ld bc,(SBnKzhi) ; BCH = z
; ld a,(SBnKzlo) ;
; ld h,a ;
; call AddBCHtoDELsigned ; DEL = z + ((y - alpha * x /256 ) * Beta) /256
;.SaveZResult: ld (SunZResult+1),de ; We now have a z result which we save
; ld (SBnKzhi),de ; .
; ld a,l ; .
; ld (SunZResult),a ; .
; ld (SBnKzlo),a ; .
;.CalcMinusBetaMulZ: ex de,hl ; HLE = DEL = z post calculation
; ld e,l ;
; ld a,(BETA) ; d = - BETA
; ld d,a ;
; xor SignOnly8Bit ;
; call mulHLEbyDSigned ; DELC = z * - BETA
; ld bc, (SunRollResult+1) ; BCH = (y - alpha * x) (or K2)
; ld a,(SunRollResult) ;
; ld h,a ;
; call AddBCHtoDELsigned ; DEL = (y - alpha * x) - (Z * BETA)
; ld (SBnKyhi),de ; y = (y - alpha * x) - (Z * BETA)
; ld a,l ;
; ld (SBnKylo),a ;
;.CalcX: ex de,hl ; HLE = DEL = Y
; ld e,l ;
; ld a,(ALPHA)
; ld d,a ; D = alpha
; call mulHLEbyDSigned ; DELC = Y * alpha
; ld bc,(SBnKxhi) ; BCH = x
; ld a,(SBnKxlo) ;
; ld h,a ;
; call AddBCHtoDELsigned ; DEL = x + (alpha * y /256 )
; ld (SBnKxhi),de ; x = x + (alpha * y /256 )
; ld a,h ;
; ld (SBnKxlo),a ;
; ret
; | 62.538043 | 131 | 0.270096 |
e0ee56ad3c1db3db831bcf7113d761199b413332 | 7,176 | asm | Assembly | P6/data_P6_2/cal_R_test5.asm | alxzzhou/BUAA_CO_2020 | b54bf367081a5a11701ebc3fc78a23494aecca9e | [
"Apache-2.0"
] | 1 | 2022-01-23T09:24:47.000Z | 2022-01-23T09:24:47.000Z | P6/data_P6_2/cal_R_test5.asm | alxzzhou/BUAA_CO_2020 | b54bf367081a5a11701ebc3fc78a23494aecca9e | [
"Apache-2.0"
] | null | null | null | P6/data_P6_2/cal_R_test5.asm | alxzzhou/BUAA_CO_2020 | b54bf367081a5a11701ebc3fc78a23494aecca9e | [
"Apache-2.0"
] | null | null | null | lui $1,56145
ori $1,$1,31040
lui $2,27941
ori $2,$2,58121
lui $3,53946
ori $3,$3,27352
lui $4,42852
ori $4,$4,7399
lui $5,43065
ori $5,$5,51556
lui $6,49312
ori $6,$6,2627
mthi $1
mtlo $2
sec0:
nop
nop
nop
or $1,$6,$2
sec1:
nop
nop
and $6,$3,$5
or $3,$6,$2
sec2:
nop
nop
slti $6,$1,2534
or $5,$6,$2
sec3:
nop
nop
mfhi $6
or $5,$6,$2
sec4:
nop
nop
lhu $6,12($0)
or $5,$6,$2
sec5:
nop
slt $6,$3,$4
nop
or $2,$6,$2
sec6:
nop
addu $6,$6,$5
xor $6,$4,$3
or $2,$6,$2
sec7:
nop
and $6,$3,$5
addiu $6,$3,4532
or $4,$6,$2
sec8:
nop
sltu $6,$1,$4
mflo $6
or $0,$6,$2
sec9:
nop
or $6,$5,$1
lb $6,11($0)
or $0,$6,$2
sec10:
nop
xori $6,$2,29199
nop
or $2,$6,$2
sec11:
nop
addiu $6,$2,12168
subu $6,$2,$1
or $3,$6,$2
sec12:
nop
andi $6,$2,17717
ori $6,$2,59153
or $2,$6,$2
sec13:
nop
andi $6,$3,27954
mflo $6
or $3,$6,$2
sec14:
nop
andi $6,$5,42310
lbu $6,0($0)
or $3,$6,$2
sec15:
nop
mfhi $6
nop
or $4,$6,$2
sec16:
nop
mfhi $6
xor $6,$2,$1
or $4,$6,$2
sec17:
nop
mflo $6
slti $6,$4,17059
or $3,$6,$2
sec18:
nop
mflo $6
mfhi $6
or $4,$6,$2
sec19:
nop
mfhi $6
lbu $6,16($0)
or $2,$6,$2
sec20:
nop
lhu $6,14($0)
nop
or $2,$6,$2
sec21:
nop
lbu $6,6($0)
xor $6,$3,$0
or $4,$6,$2
sec22:
nop
lh $6,8($0)
sltiu $6,$5,12057
or $6,$6,$2
sec23:
nop
lb $6,12($0)
mflo $6
or $1,$6,$2
sec24:
nop
lhu $6,14($0)
lb $6,15($0)
or $4,$6,$2
sec25:
sltu $6,$4,$4
nop
nop
or $1,$6,$2
sec26:
nor $6,$3,$2
nop
subu $6,$2,$3
or $1,$6,$2
sec27:
xor $6,$3,$3
nop
andi $6,$0,41180
or $2,$6,$2
sec28:
sltu $6,$4,$0
nop
mfhi $6
or $6,$6,$2
sec29:
nor $6,$3,$2
nop
lh $6,12($0)
or $4,$6,$2
sec30:
subu $6,$1,$5
xor $6,$1,$6
nop
or $1,$6,$2
sec31:
xor $6,$3,$4
or $6,$2,$3
or $6,$6,$3
or $2,$6,$2
sec32:
and $6,$2,$2
addu $6,$4,$2
xori $6,$2,64125
or $3,$6,$2
sec33:
xor $6,$4,$3
and $6,$0,$2
mflo $6
or $0,$6,$2
sec34:
or $6,$1,$2
addu $6,$3,$0
lh $6,0($0)
or $0,$6,$2
sec35:
addu $6,$1,$4
lui $6,16995
nop
or $3,$6,$2
sec36:
slt $6,$3,$3
sltiu $6,$4,-1481
xor $6,$3,$2
or $4,$6,$2
sec37:
xor $6,$2,$4
lui $6,37323
addiu $6,$0,-5378
or $0,$6,$2
sec38:
or $6,$0,$3
slti $6,$3,4446
mflo $6
or $3,$6,$2
sec39:
or $6,$3,$0
slti $6,$3,26362
lw $6,4($0)
or $4,$6,$2
sec40:
nor $6,$3,$4
mflo $6
nop
or $3,$6,$2
sec41:
subu $6,$3,$3
mflo $6
slt $6,$2,$3
or $2,$6,$2
sec42:
or $6,$0,$5
mfhi $6
ori $6,$3,25828
or $2,$6,$2
sec43:
subu $6,$4,$2
mfhi $6
mflo $6
or $4,$6,$2
sec44:
slt $6,$2,$4
mfhi $6
lw $6,0($0)
or $3,$6,$2
sec45:
subu $6,$2,$2
lb $6,6($0)
nop
or $5,$6,$2
sec46:
addu $6,$2,$6
lhu $6,12($0)
slt $6,$3,$3
or $4,$6,$2
sec47:
subu $6,$6,$1
lh $6,14($0)
addiu $6,$5,23852
or $3,$6,$2
sec48:
or $6,$3,$1
lhu $6,2($0)
mfhi $6
or $4,$6,$2
sec49:
or $6,$3,$3
lhu $6,16($0)
lh $6,14($0)
or $2,$6,$2
sec50:
xori $6,$0,15945
nop
nop
or $5,$6,$2
sec51:
lui $6,3992
nop
sltu $6,$2,$2
or $2,$6,$2
sec52:
addiu $6,$5,-26894
nop
slti $6,$1,20512
or $4,$6,$2
sec53:
lui $6,55012
nop
mfhi $6
or $3,$6,$2
sec54:
sltiu $6,$1,24822
nop
lw $6,4($0)
or $6,$6,$2
sec55:
andi $6,$0,7801
xor $6,$2,$5
nop
or $1,$6,$2
sec56:
sltiu $6,$2,-1250
nor $6,$1,$3
xor $6,$2,$2
or $1,$6,$2
sec57:
addiu $6,$4,32732
or $6,$0,$5
xori $6,$0,58119
or $5,$6,$2
sec58:
addiu $6,$1,-12289
and $6,$4,$0
mfhi $6
or $3,$6,$2
sec59:
addiu $6,$4,-32013
subu $6,$4,$2
lb $6,2($0)
or $1,$6,$2
sec60:
sltiu $6,$4,-7540
andi $6,$1,13257
nop
or $5,$6,$2
sec61:
addiu $6,$3,31016
ori $6,$5,15049
slt $6,$2,$5
or $3,$6,$2
sec62:
addiu $6,$3,-26218
slti $6,$5,4888
slti $6,$2,23781
or $2,$6,$2
sec63:
addiu $6,$1,-4025
xori $6,$4,34592
mfhi $6
or $4,$6,$2
sec64:
sltiu $6,$2,-7475
sltiu $6,$6,-6887
lbu $6,1($0)
or $2,$6,$2
sec65:
xori $6,$3,21566
mflo $6
nop
or $5,$6,$2
sec66:
addiu $6,$2,28248
mflo $6
addu $6,$1,$4
or $3,$6,$2
sec67:
ori $6,$3,60574
mfhi $6
slti $6,$1,2451
or $3,$6,$2
sec68:
xori $6,$5,40463
mflo $6
mfhi $6
or $5,$6,$2
sec69:
addiu $6,$1,20977
mflo $6
lhu $6,8($0)
or $1,$6,$2
sec70:
andi $6,$0,41382
lbu $6,15($0)
nop
or $1,$6,$2
sec71:
xori $6,$4,12829
lb $6,5($0)
slt $6,$3,$0
or $2,$6,$2
sec72:
lui $6,22595
lbu $6,6($0)
lui $6,58026
or $0,$6,$2
sec73:
slti $6,$1,31763
lh $6,8($0)
mfhi $6
or $2,$6,$2
sec74:
ori $6,$0,52706
lhu $6,10($0)
lh $6,2($0)
or $5,$6,$2
sec75:
mfhi $6
nop
nop
or $0,$6,$2
sec76:
mflo $6
nop
subu $6,$4,$2
or $4,$6,$2
sec77:
mflo $6
nop
ori $6,$3,18752
or $2,$6,$2
sec78:
mfhi $6
nop
mflo $6
or $2,$6,$2
sec79:
mfhi $6
nop
lbu $6,14($0)
or $4,$6,$2
sec80:
mflo $6
nor $6,$4,$4
nop
or $2,$6,$2
sec81:
mflo $6
sltu $6,$2,$3
slt $6,$1,$6
or $3,$6,$2
sec82:
mfhi $6
xor $6,$5,$4
lui $6,43568
or $4,$6,$2
sec83:
mflo $6
and $6,$1,$2
mfhi $6
or $1,$6,$2
sec84:
mfhi $6
subu $6,$4,$5
lbu $6,8($0)
or $0,$6,$2
sec85:
mfhi $6
slti $6,$4,-8513
nop
or $3,$6,$2
sec86:
mfhi $6
ori $6,$5,41535
subu $6,$1,$4
or $5,$6,$2
sec87:
mflo $6
slti $6,$4,874
andi $6,$3,3061
or $5,$6,$2
sec88:
mflo $6
andi $6,$5,30446
mflo $6
or $3,$6,$2
sec89:
mfhi $6
xori $6,$4,53016
lbu $6,1($0)
or $1,$6,$2
sec90:
mflo $6
mflo $6
nop
or $0,$6,$2
sec91:
mflo $6
mflo $6
and $6,$1,$3
or $0,$6,$2
sec92:
mflo $6
mfhi $6
addiu $6,$3,4725
or $0,$6,$2
sec93:
mflo $6
mfhi $6
mfhi $6
or $4,$6,$2
sec94:
mfhi $6
mfhi $6
lh $6,6($0)
or $6,$6,$2
sec95:
mflo $6
lw $6,8($0)
nop
or $6,$6,$2
sec96:
mfhi $6
lb $6,13($0)
subu $6,$2,$3
or $3,$6,$2
sec97:
mflo $6
lbu $6,12($0)
ori $6,$2,17704
or $2,$6,$2
sec98:
mflo $6
lh $6,0($0)
mfhi $6
or $4,$6,$2
sec99:
mfhi $6
lh $6,0($0)
lw $6,4($0)
or $0,$6,$2
sec100:
lhu $6,10($0)
nop
nop
or $1,$6,$2
sec101:
lhu $6,14($0)
nop
subu $6,$2,$4
or $2,$6,$2
sec102:
lb $6,1($0)
nop
ori $6,$2,54546
or $2,$6,$2
sec103:
lw $6,16($0)
nop
mfhi $6
or $4,$6,$2
sec104:
lw $6,0($0)
nop
lhu $6,14($0)
or $6,$6,$2
sec105:
lbu $6,7($0)
xor $6,$4,$2
nop
or $3,$6,$2
sec106:
lw $6,8($0)
sltu $6,$2,$4
xor $6,$5,$3
or $3,$6,$2
sec107:
lh $6,0($0)
nor $6,$4,$0
xori $6,$4,31282
or $3,$6,$2
sec108:
lw $6,0($0)
nor $6,$0,$3
mflo $6
or $3,$6,$2
sec109:
lhu $6,8($0)
subu $6,$2,$3
lhu $6,14($0)
or $5,$6,$2
sec110:
lh $6,2($0)
addiu $6,$3,17288
nop
or $1,$6,$2
sec111:
lh $6,12($0)
sltiu $6,$3,15504
slt $6,$3,$5
or $6,$6,$2
sec112:
lw $6,16($0)
xori $6,$4,33812
slti $6,$3,5071
or $3,$6,$2
sec113:
lh $6,0($0)
sltiu $6,$5,3809
mflo $6
or $5,$6,$2
sec114:
lw $6,0($0)
slti $6,$2,-22740
lh $6,8($0)
or $1,$6,$2
sec115:
lhu $6,8($0)
mflo $6
nop
or $3,$6,$2
sec116:
lh $6,2($0)
mfhi $6
and $6,$0,$2
or $2,$6,$2
sec117:
lbu $6,3($0)
mfhi $6
sltiu $6,$6,9413
or $4,$6,$2
sec118:
lh $6,8($0)
mflo $6
mfhi $6
or $2,$6,$2
sec119:
lbu $6,16($0)
mfhi $6
lw $6,8($0)
or $2,$6,$2
sec120:
lw $6,4($0)
lh $6,0($0)
nop
or $5,$6,$2
sec121:
lhu $6,4($0)
lh $6,8($0)
and $6,$6,$3
or $5,$6,$2
sec122:
lb $6,0($0)
lb $6,11($0)
lui $6,29853
or $5,$6,$2
sec123:
lh $6,14($0)
lhu $6,12($0)
mfhi $6
or $3,$6,$2
sec124:
lh $6,2($0)
lh $6,6($0)
lw $6,0($0)
or $4,$6,$2
| 11.2125 | 19 | 0.513935 |
bebf1f10a90d7e3af45eddec4765d95ffcf9f353 | 490 | asm | Assembly | programs/oeis/099/A099254.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/099/A099254.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/099/A099254.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A099254: Self-convolution of A010892. The g.f. is 1/(Alexander polynomial of granny knot).
; 1,2,1,-2,-4,-2,3,6,3,-4,-8,-4,5,10,5,-6,-12,-6,7,14,7,-8,-16,-8,9,18,9,-10,-20,-10,11,22,11,-12,-24,-12,13,26,13,-14,-28,-14,15,30,15,-16,-32,-16,17,34,17,-18,-36,-18,19,38,19,-20,-40,-20,21,42,21,-22,-44,-22,23,46,23,-24,-48,-24,25,50,25,-26,-52,-26,27,54,27,-28,-56,-28,29,58,29,-30,-60,-30,31,62,31,-32,-64,-32,33,66,33,-34
seq $0,99470 ; A sequence generated from the Quadrifoil.
mul $0,-1
| 81.666667 | 328 | 0.606122 |
40215afee7199ef921db0556b39295b4172ea980 | 732 | asm | Assembly | oeis/081/A081903.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/081/A081903.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/081/A081903.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A081903: A sequence related to binomial(n+5, 5).
; Submitted by Jon Maiga
; 1,10,85,660,4830,33876,230030,1522400,9866375,62828750,394146875,2440812500,14944687500,90590625000,544242187500,3243437500000,19189111328125,112777832031250,658804931640625,3827075195312500,22117736816406250,127216186523437500,728480529785156250,4154296875000000000,23599224090576171875,133574485778808593750,753476619720458984375,4236650466918945312500,23749828338623046875000,132756233215332031250000,740067958831787109375000,4115009307861328125000000,22824861109256744384765625
mov $1,1
mov $2,1
mov $3,$0
mov $0,5
mov $4,1
lpb $3
add $0,1
mul $1,$3
mul $1,$0
mul $2,4
sub $3,1
add $5,$4
div $1,$5
add $2,$1
add $4,2
lpe
mov $0,$2
| 33.272727 | 483 | 0.800546 |
2eb49e1a9edbca75b4f64a08d6b60fd66619248d | 1,033 | asm | Assembly | programs/oeis/065/A065827.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/065/A065827.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/065/A065827.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A065827: Sum of squares of divisors of square numbers.
; 1,21,91,341,651,1911,2451,5461,7381,13671,14763,31031,28731,51471,59241,87381,83811,155001,130683,221991,223041,310023,280371,496951,406901,603351,597871,835791,708123,1244061,924483,1398101,1343433,1760031,1595601,2516921,1875531,2744343,2614521,3555111,2827443,4683861,3420651,5034183,4805031,5887791,4881891,7951671,5884901,8544921,7626801,9797271,7893291,12555291,9610713,13384911,11892153,14870583,12120843,20201181,13849563,19414143,18090831,22369621,18703881,28212093,20155611,28579551,25513761,33507621,25416723,40307641,28403571,39386151,37027991,44562903,36184113,54904941,38956323,56885031,48427561,59376303,47465211,76056981,54560961,71833671,64439193,80620743,62750163,100905651,70419681,95606511,84127953,102519711,85074633,127227191,88538691,123582921,108965703,138753241
add $0,1
pow $0,2
mov $2,$0
lpb $0
mov $3,$2
mov $4,$0
cmp $4,0
add $0,$4
dif $3,$0
cmp $3,$2
cmp $3,0
mul $3,$0
sub $0,1
pow $3,2
add $1,$3
lpe
add $1,1
mov $0,$1
| 46.954545 | 788 | 0.791868 |
0e4346cffd0969b494abd9a83a846a2dab53d4b2 | 471 | asm | Assembly | unordnung_auch_assembler/asm/attiny13/IR-sensitive/tinyProg.asm | no-go/Blink_atmega328p | a81e41906c4a6d843a7fb87962288a0894105bd7 | [
"Unlicense"
] | null | null | null | unordnung_auch_assembler/asm/attiny13/IR-sensitive/tinyProg.asm | no-go/Blink_atmega328p | a81e41906c4a6d843a7fb87962288a0894105bd7 | [
"Unlicense"
] | null | null | null | unordnung_auch_assembler/asm/attiny13/IR-sensitive/tinyProg.asm | no-go/Blink_atmega328p | a81e41906c4a6d843a7fb87962288a0894105bd7 | [
"Unlicense"
] | null | null | null | .include "myTiny13.h"
.equ TASTER,3
.equ LEDB,1
;irq Vector
.org 0x0000
rjmp RESET
nop
rjmp PCINT0
.org 0x0010
RESET:
sbi DDRB,LEDB ; output
cbi DDRB,TASTER ; input
ldi A,0b00100000 ; IRQ react on PCINT
out GIMSK,A
sbi PCMSK,TASTER ; set PCINT on TASTER IRQ
sei
mainLoop:
rjmp mainLoop
.org 0x0030
PCINT0:
sbic PINB,TASTER ; IF tester clear
rjmp bitSet
cbi PORTB,LEDB ; then clear LED
reti
bitSet:
sbi PORTB,LEDB ; ELSE set bit
reti
| 13.457143 | 44 | 0.698514 |
579371beb5c0a11fd484b65a11b87edb05fb2360 | 4,048 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1718.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_0xca_notsx.log_21829_1718.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_0xca_notsx.log_21829_1718.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 %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x1b825, %rsi
lea addresses_WT_ht+0x18275, %rdi
nop
nop
cmp $26858, %r11
mov $127, %rcx
rep movsq
nop
cmp %r13, %r13
pop %rsi
pop %rdi
pop %rcx
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %rax
push %rdi
push %rdx
// Faulty Load
lea addresses_WT+0x1825, %r11
nop
add %rax, %rax
mov (%r11), %edx
lea oracles, %rdi
and $0xff, %rdx
shlq $12, %rdx
mov (%rdi,%rdx,1), %rdx
pop %rdx
pop %rdi
pop %rax
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WT', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WT', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}}
{'39': 21829}
39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39
*/
| 68.610169 | 2,999 | 0.663785 |
b6482cbd58e9df09ed14eb4bb4998b4cc4f4597b | 2,719 | asm | Assembly | source/tokeniser/tokenise/tokinteger.asm | paulscottrobson/6502-basic | d4c360041bfa49427a506465e58bb0ef94beaa44 | [
"MIT"
] | 3 | 2021-09-30T19:34:11.000Z | 2021-10-31T06:55:50.000Z | source/tokeniser/tokenise/tokinteger.asm | paulscottrobson/6502-Basic | d4c360041bfa49427a506465e58bb0ef94beaa44 | [
"MIT"
] | null | null | null | source/tokeniser/tokenise/tokinteger.asm | paulscottrobson/6502-Basic | d4c360041bfa49427a506465e58bb0ef94beaa44 | [
"MIT"
] | 1 | 2021-12-07T21:58:44.000Z | 2021-12-07T21:58:44.000Z | ; ************************************************************************************************
; ************************************************************************************************
;
; Name: tokint.asm
; Purpose: Tokenise an integer
; Created: 8th March 2021
; Reviewed: 16th March 2021
; Author: Paul Robson (paul@robsons.org.uk)
;
; ************************************************************************************************
; ************************************************************************************************
.section code
; ************************************************************************************************
;
; Tokenise string at (codePtr) into an integer base A
; CS if tokenising successful.
;
; ************************************************************************************************
TokeniseInteger:
;
; First thing is to load the tokenisable text into the convertBuffer
;
sta temp1 ; save base
ldx #0 ; count of chars so far
;
; Copy allowed characters into the buffer.
;
stx convertBuffer
_TIGetChars:
lda (codePtr),y ; check character is numeric
cmp #"0"
bcc _TIEndGet
cmp #"9"+1
bcc _TIHaveChar
;
lda temp1 ; fail if not hex mode
cmp #10
beq _TIEndGet
;
lda (codePtr),y ; check legitimate hex.
cmp #"A"
bcc _TIEndGet
cmp #"Z"+1
bcs _TIEndGet
_TIHaveChar:
inx ; write into buffer.
stx convertBuffer
sta convertBuffer,x
iny ; next char
jmp _TIGetChars
;
; Convert to integer if one character was tokenised
;
_TIEndGet:
cpx #0 ; no char acquired.
beq _TIFail
.pshy
set16 temp0,convertBuffer ; convert to integer
lda #0 ; stack level 0
ldy temp1 ; base Y
.main_strtoint
.puly
bcc _TIFail ; didn't convert.
jsr TIRecursiveOut ; recursive output ?
sec
rts
_TIFail:
clc
rts
; ************************************************************************************************
;
; Recursive output of value in TOS
;
; ************************************************************************************************
TIRecursiveOut:
lda esInt0 ; get value to output after possible recursion
and #$3F
ora #$40
pha
;
lda esInt0 ; are we recursing ?
and #$C0
ora esInt1
ora esInt2
ora esInt3
beq _TIRONoRecursion
ldx #6 ; shift right x 6
_TIROShift:
lsr esInt3
ror esInt2
ror esInt1
ror esInt0
dex
bne _TIROShift
jsr TIRecursiveOut ; call recursively
_TIRONoRecursion:
pla ; pull the old bit.
jmp TokenWrite
.send code
| 24.944954 | 98 | 0.438029 |
24efec286e623ba27fd96efbe5da02b0e4a3fe2d | 363 | asm | Assembly | programs/oeis/119/A119693.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/119/A119693.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/119/A119693.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A119693: Binomial(2*n,n)*fib(n)/2.
; 0,1,3,20,105,630,3696,22308,135135,826540,5080790,31391724,194699232,1211669900,7561979100,47310843600,296633172465,1863384566670,11725074807600,73889273973900,466265883733650,2945885346810120
mov $1,$0
mul $0,2
bin $0,$1
seq $1,45 ; Fibonacci numbers: F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1.
mul $0,$1
div $0,2
| 36.3 | 194 | 0.721763 |
4799aadfa6952db4767780eab7be34fde83dee3f | 2,665 | asm | Assembly | external/source/shellcode/windows/x86/src/migrate/migrate.asm | loathsomeguy/metasploit-framework | 86ae268af14899ccedaa5716b5905e18104bddca | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 47 | 2021-01-20T15:30:47.000Z | 2022-03-31T07:51:01.000Z | external/source/shellcode/windows/x86/src/migrate/migrate.asm | hellorubbish/vipermsf | 9df632bd854160175600d97271694240030cb9fe | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2021-05-31T13:03:30.000Z | 2021-05-31T13:03:30.000Z | external/source/shellcode/windows/x86/src/migrate/migrate.asm | hellorubbish/vipermsf | 9df632bd854160175600d97271694240030cb9fe | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 27 | 2021-01-22T05:06:46.000Z | 2022-03-31T03:28:15.000Z | ;-----------------------------------------------------------------------------;
; Author: Stephen Fewer (stephen_fewer[at]harmonysecurity[dot]com)
; Compatible: Windows 7, 2008, Vista, 2003, XP, 2000, NT4
; Architecture: x86
; Version: 1.0 (Jan 2010)
; Size: 219 bytes
; Build: >build.py migrate
;-----------------------------------------------------------------------------;
; typedef struct MigrateContext
; {
; union
; {
; HANDLE hEvent;
; BYTE bPadding1[8];
; } e;
; union
; {
; LPVOID lpPayload;
; BYTE bPadding2[8];
; } p;
; WSAPROTOCOL_INFO info;
; } MIGRATECONTEXT, * LPMIGRATECONTEXT;
[BITS 32]
[ORG 0]
cld ; Clear the direction flag.
mov esi, [esp+4] ; ESI is a pointer to our migration stub context
sub esp, 0x2000 ; Alloc some space on stack
call start ; Call start, this pushes the address of 'api_call' onto the stack.
delta: ;
%include "./src/block/block_api.asm" ;
start: ;
pop ebp ; Pop off the address of 'api_call' for calling later.
push 0x00003233 ; Push the bytes 'ws2_32',0,0 onto the stack.
push 0x5F327377 ; ...
push esp ; Push a pointer to the "ws2_32" string on the stack.
push 0x0726774C ; hash( "kernel32.dll", "LoadLibraryA" )
call ebp ; LoadLibraryA( "ws2_32" )
mov eax, 0x0190 ; EAX = sizeof( struct WSAData )
sub esp, eax ; alloc some space for the WSAData structure
push esp ; push a pointer to this stuct
push eax ; push the wVersionRequested parameter
push 0x006B8029 ; hash( "ws2_32.dll", "WSAStartup" )
call ebp ; WSAStartup( 0x0190, &WSAData );
push eax ; If we succeed, eax wil be zero, push zero for the flags param.
push eax ; Push null for reserved parameter
lea ebx, [esi+16] ;
push ebx ; We specify the WSAPROTOCOL_INFO structure from the MigrateContext
push eax ; We do not specify a protocol
inc eax ;
push eax ; Push SOCK_STREAM
inc eax ;
push eax ; Push AF_INET
push 0xE0DF0FEA ; hash( "ws2_32.dll", "WSASocketA" )
call ebp ; WSASocketA( AF_INET, SOCK_STREAM, 0, &info, 0, 0 );
xchg edi, eax ; Save the socket for later, we don't care about the value of eax after this
push dword [esi] ; Push the event
push 0x35269F1D ; hash( "kernel32.dll", "SetEvent" )
call ebp ; SetEvent( hEvent );
call dword [esi+8] ; Call the payload...
| 39.191176 | 101 | 0.54409 |
e9dddf085833fcce1ea0369478f0a83ce997bd93 | 7,916 | asm | Assembly | Transynther/x86/_processed/NC/_zr_/i7-7700_9_0x48.log_21829_449.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NC/_zr_/i7-7700_9_0x48.log_21829_449.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NC/_zr_/i7-7700_9_0x48.log_21829_449.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 %r15
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0xc19c, %rsi
lea addresses_D_ht+0xa39c, %rdi
nop
nop
sub %r12, %r12
mov $75, %rcx
rep movsw
nop
dec %r9
lea addresses_D_ht+0x1199c, %rsi
lea addresses_WT_ht+0x77fc, %rdi
nop
nop
nop
nop
sub %r11, %r11
mov $67, %rcx
rep movsq
nop
nop
nop
nop
nop
mfence
lea addresses_UC_ht+0x11ec, %rsi
lea addresses_UC_ht+0x1499c, %rdi
cmp %r12, %r12
mov $69, %rcx
rep movsw
nop
nop
nop
nop
cmp $65071, %rdi
lea addresses_WC_ht+0x1b2dc, %rsi
lea addresses_D_ht+0x4d9c, %rdi
nop
nop
nop
nop
and %r15, %r15
mov $56, %rcx
rep movsb
nop
nop
nop
cmp $5022, %rcx
lea addresses_WC_ht+0xf49c, %rcx
nop
nop
nop
nop
nop
cmp %rdi, %rdi
movl $0x61626364, (%rcx)
nop
nop
nop
nop
nop
xor %rsi, %rsi
lea addresses_A_ht+0x8d9c, %rdi
nop
nop
and %r11, %r11
mov (%rdi), %r9d
nop
nop
nop
nop
dec %r12
lea addresses_UC_ht+0xa054, %rsi
lea addresses_UC_ht+0xd9c, %rdi
nop
nop
nop
sub %rax, %rax
mov $52, %rcx
rep movsb
nop
nop
nop
nop
and %rcx, %rcx
lea addresses_normal_ht+0x1b29c, %rax
nop
nop
nop
nop
sub %rsi, %rsi
mov $0x6162636465666768, %r15
movq %r15, (%rax)
nop
nop
nop
nop
nop
inc %r12
lea addresses_WT_ht+0x15bac, %rsi
lea addresses_UC_ht+0x14e1c, %rdi
clflush (%rdi)
nop
dec %r15
mov $81, %rcx
rep movsw
nop
nop
xor $59216, %r11
lea addresses_UC_ht+0x1607c, %rsi
lea addresses_WT_ht+0x33ec, %rdi
nop
nop
nop
and $2564, %r9
mov $81, %rcx
rep movsw
nop
nop
sub %r11, %r11
lea addresses_normal_ht+0x17c1c, %rsi
lea addresses_A_ht+0x18aac, %rdi
clflush (%rsi)
inc %r9
mov $47, %rcx
rep movsl
nop
sub $2087, %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r15
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r9
push %rbp
push %rcx
push %rdi
push %rdx
// Store
lea addresses_RW+0x1479c, %rbp
clflush (%rbp)
nop
nop
nop
nop
nop
add $14206, %rdx
movw $0x5152, (%rbp)
nop
inc %r12
// Store
lea addresses_WT+0x1301c, %rcx
inc %rdi
mov $0x5152535455565758, %rbp
movq %rbp, %xmm2
vmovups %ymm2, (%rcx)
nop
nop
nop
dec %rbp
// Store
lea addresses_D+0x82a, %r12
nop
nop
nop
nop
nop
sub %rbp, %rbp
movb $0x51, (%r12)
nop
nop
nop
nop
add $11804, %rbp
// Load
lea addresses_WT+0x15f9c, %rbp
nop
nop
nop
nop
cmp %r9, %r9
mov (%rbp), %r10w
nop
xor %rcx, %rcx
// Faulty Load
mov $0x1c6170000000d9c, %r12
nop
nop
nop
nop
nop
dec %rcx
mov (%r12), %dx
lea oracles, %rdi
and $0xff, %rdx
shlq $12, %rdx
mov (%rdi,%rdx,1), %rdx
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': True, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 9, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 5, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 9, 'size': 2, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 3, 'size': 4, 'same': True, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 11, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 7, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 4, 'same': True}}
{'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
*/
| 31.043137 | 2,999 | 0.658413 |
295fd32c3223688ea7b24082dccc8b0c2a1e24f6 | 392 | asm | Assembly | oeis/095/A095836.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/095/A095836.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/095/A095836.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A095836: Triangle read by rows: T(n,k) = k^((n-k)^2), n>=1, 1<=k<=n.
; Submitted by Jamie Morken(s4)
; 1,1,1,1,2,1,1,16,3,1,1,512,81,4,1,1,65536,19683,256,5,1,1,33554432,43046721,262144,625,6,1,1,68719476736,847288609443,4294967296,1953125,1296,7,1,1,562949953421312,150094635296999121,1125899906842624
lpb $0
add $1,1
sub $0,$1
mov $2,$1
sub $2,$0
lpe
add $0,1
pow $2,2
pow $0,$2
| 28 | 201 | 0.670918 |
656f61b25cd14f1ff7430391db887e621886bb9f | 1,710 | asm | Assembly | Project2/01map.asm | blackbird52/MIPS-CPU | 45d75e52742df04c1e1e08e78b574c6b70b0b523 | [
"Apache-2.0"
] | 4 | 2019-07-10T12:43:16.000Z | 2020-10-28T08:10:37.000Z | Project2/01map.asm | blackbird52/MIPS-CPU | 45d75e52742df04c1e1e08e78b574c6b70b0b523 | [
"Apache-2.0"
] | null | null | null | Project2/01map.asm | blackbird52/MIPS-CPU | 45d75e52742df04c1e1e08e78b574c6b70b0b523 | [
"Apache-2.0"
] | null | null | null | .data
map: .space 49
visit:.space 49
.text
li $v0,5
syscall
move $s0,$v0 #s0=n
li $v0,5
syscall
move $s1,$v0 #s1=m
move $t0,$zero #t0=i
move $t1,$zero #t1=j
move $t2,$zero
read: mult $t0,$s1
mflo $t2
add $t2,$t2,$t1
li $v0,5
syscall
sb $v0,map($t2)
addi $t1,$t1,1
bne $t1,$s1,read
move $t1,$zero
addi $t0,$t0,1
bne $t0,$s0,read
li $v0,5
syscall
addi $s2,$v0,-1 #s2=x1
li $v0,5
syscall
addi $s3,$v0,-1 #s3=y1
li $v0,5
syscall
addi $s4,$v0,-1 #s4=x2
li $v0,5
syscall
addi $s5,$v0,-1 #s5=y2
move $a0,$zero #a0=x
move $a1,$zero #a1=y
move $v0,$zero #v0=sum
jal dfs
move $a0,$a3
li $v0,1
syscall
li $v0,10
syscall
dfs: bne $a0,$s4,judge
bne $a1,$s5,judge
addi $a3,$a3,1
j return
judge:beq $a0,-1,return
beq $a0,$s0,return
beq $a1,-1,return
beq $a1,$s1,return
mult $a0,$s1
mflo $t0
add $t0,$t0,$a1
lb $t1,map($t0) #t1=map[x][y]
bne $t1,$zero,return
lb $t2,visit($t0) #t2=visit[x][y]
bne $t2,$zero,return
addi $t2,$t2,1
sb $t2,visit($t0) #visit[x][y]=1
addi $sp,$sp,-16
sw $a0,12($sp)
sw $a1,8($sp)
sw $t0,4($sp)
sw $ra,0($sp)
addi $a0,$a0,1
jal dfs
lw $ra,0($sp)
lw $t0,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $t0,4($sp)
sw $ra,0($sp)
addi $a0,$a0,-1
jal dfs
lw $ra,0($sp)
lw $t0,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $t0,4($sp)
sw $ra,0($sp)
addi $a1,$a1,1
jal dfs
lw $ra,0($sp)
lw $t0,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $t0,4($sp)
sw $ra,0($sp)
addi $a1,$a1,-1
jal dfs
lw $ra,0($sp)
lw $t0,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
addi $sp,$sp,16
sb $zero,visit($t0) #visit[x][y]=0
return:jr $ra
| 12.666667 | 35 | 0.554386 |
0167561ec9935eb4b67cb2311a4542830a59ea41 | 8,225 | asm | Assembly | main.asm | microwave89-hv/min-hello-world | 6e3414f641e907c2f75dbdbb1745bff0acf29ef7 | [
"Apache-2.0"
] | null | null | null | main.asm | microwave89-hv/min-hello-world | 6e3414f641e907c2f75dbdbb1745bff0acf29ef7 | [
"Apache-2.0"
] | 2 | 2020-01-06T20:38:25.000Z | 2020-01-06T21:36:23.000Z | main.asm | microwave89-hv/min-hello-world | 6e3414f641e907c2f75dbdbb1745bff0acf29ef7 | [
"Apache-2.0"
] | null | null | null | ; Copyright (c) 2019 microwave89-hv
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
; derived from https://raw.githubusercontent.com/charlesap/nasm-uefi/master/yo.asm
; and the compiled and linked output of hello-world2.c.
%include "consts.inc"
BITS 64
; DOS signature not needed by Apple EFI implementation. This correllates to behavior of PeCoffLoader.c & co. in EDK 1.10.
IMAGE_NT_SIGNATURE equ 0x4550 ; 'PE\0\0'
IMAGE_NT_HEADERS64:
istruc _IMAGE_NT_HEADERS64
at _IMAGE_NT_HEADERS64.Signature, dd IMAGE_NT_SIGNATURE ; MUST but could be 'VZ' too for Terse image. Header would be quite different then.
iend
IMAGE_FILE_MACHINE_AMD64 equ 0x8664
IMAGE_FILE_EXECUTABLE_IMAGE equ (1 << 1)
IMAGE_FILE_LARGE_ADDRESS_AWARE equ (1 << 5)
IMAGE_FILE_HEADER:
istruc _IMAGE_FILE_HEADER
at _IMAGE_FILE_HEADER.Machine, dw IMAGE_FILE_MACHINE_AMD64 ; MUST
at _IMAGE_FILE_HEADER.NumberOfSections, dw 2 ; MUST
at _IMAGE_FILE_HEADER.TimeDateStamp, dd 0
at _IMAGE_FILE_HEADER.PointerToSymbolTable, dd 0
at _IMAGE_FILE_HEADER.NumberOfSymbols, dd 0
at _IMAGE_FILE_HEADER.SizeOfOptionalHeader, dw 0x70 ; MUST
at _IMAGE_FILE_HEADER.Characteristics, dw 0 ; IMAGE_FILE_EXECUTABLE_IMAGE | IMAGE_FILE_LARGE_ADDRESS_AWARE ; 0x22 ; not needed
iend
IMAGE_NT_OPTIONAL_HDR64_MAGIC equ 0x20b
IMAGE_SUBSYSTEM_EFI_APPLICATION equ 0xa
IMAGE_OPTIONAL_HEADER64:
istruc _IMAGE_OPTIONAL_HEADER64
at _IMAGE_OPTIONAL_HEADER64.Magic, dw IMAGE_NT_OPTIONAL_HDR64_MAGIC ; MUST
at _IMAGE_OPTIONAL_HEADER64.MajorLinkerVersion, db 0
at _IMAGE_OPTIONAL_HEADER64.MinorLinkerVersion, db 0
at _IMAGE_OPTIONAL_HEADER64.SizeOfCode, dd 0
at _IMAGE_OPTIONAL_HEADER64.SizeOfInitializedData, dd 0
at _IMAGE_OPTIONAL_HEADER64.SizeOfUninitializedData, dd 0
at _IMAGE_OPTIONAL_HEADER64.AddressOfEntryPoint, dd 0x1000 ; MUST
at _IMAGE_OPTIONAL_HEADER64.BaseOfCode, dd 0
at _IMAGE_OPTIONAL_HEADER64.ImageBase, dq 0x100000000 ; MUST?
at _IMAGE_OPTIONAL_HEADER64.SectionAlignment, dd 0x1000 ; MUST?
at _IMAGE_OPTIONAL_HEADER64.FileAlignment, dd 0 ; 0x200
at _IMAGE_OPTIONAL_HEADER64.MajorOperatingSystemVersion, dw 0
at _IMAGE_OPTIONAL_HEADER64.MinorOperatingSystemVersion, dw 0
at _IMAGE_OPTIONAL_HEADER64.MajorImageVersion, dw 0
at _IMAGE_OPTIONAL_HEADER64.MinorImageVersion, dw 0
at _IMAGE_OPTIONAL_HEADER64.MajorSubsystemVersion, dw 0
at _IMAGE_OPTIONAL_HEADER64.MinorSubsystemVersion, dw 0
at _IMAGE_OPTIONAL_HEADER64.Win32VersionValue, dd 0
at _IMAGE_OPTIONAL_HEADER64.SizeOfImage, dd 0x3000 ; MUST
at _IMAGE_OPTIONAL_HEADER64.SizeOfHeaders, dd 0x400 ; MUST
at _IMAGE_OPTIONAL_HEADER64.CheckSum, dd 0
at _IMAGE_OPTIONAL_HEADER64.Subsystem, dw IMAGE_SUBSYSTEM_EFI_APPLICATION ; MUST
at _IMAGE_OPTIONAL_HEADER64.DllCharacteristics, dw 0
at _IMAGE_OPTIONAL_HEADER64.SizeOfStackReserve, dq 0 ; 0x100000
at _IMAGE_OPTIONAL_HEADER64.SizeOfStackCommit, dq 0 ; 0x1000
at _IMAGE_OPTIONAL_HEADER64.SizeOfHeapReserve, dq 0 ; 0x100000
at _IMAGE_OPTIONAL_HEADER64.SizeOfHeapCommit, dq 0 ; 0x1000
at _IMAGE_OPTIONAL_HEADER64.LoaderFlags, dd 0
at _IMAGE_OPTIONAL_HEADER64.NumberOfRvaAndSizes, dd IMAGE_NUMBEROF_DIRECTORY_ENTRIES
; at _IMAGE_OPTIONAL_HEADER64.DataDirectory, times IMAGE_NUMBEROF_DIRECTORY_ENTRIES dq 0
iend
IMAGE_SCN_CNT_CODE equ (1 << 5)
IMAGE_SCN_CNT_INITIALIZED_DATA equ (1 << 6)
IMAGE_SCN_MEM_EXECUTE equ (1 << 29)
IMAGE_SCN_MEM_READ equ (1 << 30)
SECTION_HEADER1:
istruc _IMAGE_SECTION_HEADER
at _IMAGE_SECTION_HEADER.Name, db '.text',0,0,0
at _IMAGE_SECTION_HEADER.VirtualSize, dd 0 ; Also called "PhysicalAddress"
at _IMAGE_SECTION_HEADER.VirtualAddress, dd 0x1000 ; MUST
at _IMAGE_SECTION_HEADER.SizeOfRawData, dd 0x200 ; MUST
at _IMAGE_SECTION_HEADER.PointerToRawData, dd 0x400 ; MUST
at _IMAGE_SECTION_HEADER.PointerToRelocations, dd 0
at _IMAGE_SECTION_HEADER.PointerToLinenumbers, dd 0
at _IMAGE_SECTION_HEADER.NumberOfRelocations, dw 0
at _IMAGE_SECTION_HEADER.NumberOfLinenumbers, dw 0
at _IMAGE_SECTION_HEADER.Characteristics, dd 0 ; IMAGE_SCN_CNT_CODE | IMAGE_SCN_MEM_EXECUTE | IMAGE_SCN_MEM_READ ; not needed
iend
SECTION_HEADER2:
istruc _IMAGE_SECTION_HEADER
at _IMAGE_SECTION_HEADER.Name, db '.data',0,0,0
at _IMAGE_SECTION_HEADER.VirtualSize, dd 0 ; Also called "PhysicalAddress"
at _IMAGE_SECTION_HEADER.VirtualAddress, dd 0x2000 ; MUST
at _IMAGE_SECTION_HEADER.SizeOfRawData, dd 0x200 ; MUST
at _IMAGE_SECTION_HEADER.PointerToRawData, dd 0x600 ; MUST
at _IMAGE_SECTION_HEADER.PointerToRelocations, dd 0
at _IMAGE_SECTION_HEADER.PointerToLinenumbers, dd 0
at _IMAGE_SECTION_HEADER.NumberOfRelocations, dw 0
at _IMAGE_SECTION_HEADER.NumberOfLinenumbers, dw 0
at _IMAGE_SECTION_HEADER.Characteristics, dd 0 ; IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_READ ; not needed
iend
times 0x400 - ($-$$) db 0 ; Align next section at 512 bytes boundary
push rbx ; Callers consider rbx to be non-volatile according to MSFT x64 convention.
sub rsp, 0x30 ; 32 bytes shadow space + EFI_CONSOLE_CONTROL_PROTOCOL* pConsoleControlInterface; + fix aligning broken by push
mov rbx, rdx
mov rcx, [rbx + 0x58] ; EFI_RUNTIME_SERVICES* pRuntimeServices = pEfiSystemTable->pRuntimeServices;
mov rax, [rbx + 0x60] ; EFI_BOOT_SERVICES* pBootServices = pEfiSystemTable->pBootServices;
lea rcx, [rel gEfiConsoleControlProtocolGuid - 0x200 + 0x1000]
xor edx, edx
lea r8, [rsp + 0x28] ; &pConsoleControlInterface
call [rax + 0x140]; pBootServices->fpLocateProtocol(&gEfiConsoleControlProtocolGuid, NULL, &pConsoleControlInterface); ; Non-standard protocol, which first must be located before use.
test rax, rax
jne fail
xor edx, edx
mov rcx, [rsp + 0x28] ; *&pConsoleControlInterface
call [rcx + 8] ; pConsoleControlInterface->fpSetMode(pConsoleControlInterface, EfiConsoleControlScreenText); ; With MacBook Pro's, BOOTX64.EFI's are loaded when graphics is on.
test rax, rax
jne fail
mov rcx, [rbx + 0x40] ; SIMPLE_TEXT_OUTPUT_INTERFACE* con_out = pEfiSystemTable->pConOut;
lea rdx, [rel myvar - 0x200 + 0x1000] ; myvar - raw_code_size + (virtual_data_address - virtual_code_address)
call [rcx + 8] ; Only now printed text will be visible!
jmp infloop ; "Prevent" deleting the text so it can be read by humans...when done reset platform by pressing Ctrl+Option+Shift+Power.
fail:
xor ecx, ecx
mov rdx, rcx
mov r8, rcx
mov r9, rcx
shl ecx, 1 ; EfiResetShutdown
jmp [rax + 0x68] ; no_return fpResetSystem(EfiResetShutdown, EFI_SUCCESS, 0, NULL); ; In case the machine turns off as opposed to hanging this code must have been executed.
infloop:
jmp infloop
add rsp, 0x30 ; never reachable...
pop rbx
ret
times 0x600 - ($-$$) int3 ; Align next section at 512 bytes boundary
myvar dw __utf16__('h3l10 W0rld?'), 0xd, 0xa, 0 ; In the EFI realm, which has been
; heavily influenced by the Microsoft
; world, wide chars are required to
; have 2 bytes, as opposed to 4 bytes
; on *nixes.
; Moreover both carriage return and
; line feed are required for a new line.
gEfiConsoleControlProtocolGuid dd 0xf42f7782
dw 0x12e,
dw 0x4c12,
db 0x99, 0x56, 0x49, 0xf9, 0x43, 0x4, 0xf7, 0x21
times 0x800 - ($-$$) db 0 | 49.848485 | 183 | 0.739453 |
a4fd5a41ee0a76a093d73a14e23f220ede04061c | 165 | asm | Assembly | libsrc/_DEVELOPMENT/stdlib/c/sdcc_iy/atexit.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/stdlib/c/sdcc_iy/atexit.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/stdlib/c/sdcc_iy/atexit.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
; int atexit(void (*func)(void))
SECTION code_stdlib
PUBLIC _atexit
EXTERN asm_atexit
_atexit:
pop af
pop hl
push hl
push af
jp asm_atexit
| 8.684211 | 32 | 0.660606 |
641c92882daf096cc09ec413a8f894abfbd765e8 | 618 | asm | Assembly | oeis/048/A048580.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/048/A048580.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/048/A048580.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A048580: Pisot sequence L(3,10).
; 3,10,34,116,396,1352,4616,15760,53808,183712,627232,2141504,7311552,24963200,85229696,290992384,993510144,3392055808,11581202944,39540700160,135000394752,460920178688,1573679925248,5372879343616,18344157523968,62630871408640,213835170586624,730078939529216,2492645416943616,8510423788716032,29056404320976896,99204769706475520,338706270183948288,1156415541322842112,3948249624923471872,13480167417048203264,46024170418345869312,157136346839287070720,536497046520456544256,1831715492403252035584
add $0,1
mov $1,1
lpb $0
sub $0,1
add $2,$1
mul $1,2
add $1,$2
lpe
mov $0,$1
| 47.538462 | 496 | 0.843042 |
0a7e3ccaf77d6286b4835d894d1d8f63631cc19e | 267 | asm | Assembly | libsrc/_DEVELOPMENT/adt/wa_priority_queue/c/sdcc_iy/wa_priority_queue_size.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/adt/wa_priority_queue/c/sdcc_iy/wa_priority_queue_size.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/adt/wa_priority_queue/c/sdcc_iy/wa_priority_queue_size.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
; size_t wa_priority_queue_size(wa_priority_queue_t *q)
SECTION code_adt_wa_priority_queue
PUBLIC _wa_priority_queue_size
EXTERN asm_wa_priority_queue_size
_wa_priority_queue_size:
pop af
pop hl
push hl
push af
jp asm_wa_priority_queue_size
| 14.052632 | 55 | 0.805243 |
eb583d53d096c0984751b1c991040f979715fc2d | 3,149 | asm | Assembly | data/sprites/facings.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | 1 | 2022-02-15T00:19:44.000Z | 2022-02-15T00:19:44.000Z | data/sprites/facings.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | null | null | null | data/sprites/facings.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | null | null | null | SpriteFacingAndAnimationTable:
; This table is used for overworld sprites $1-$9.
dw .StandingDown, .NormalOAM ; facing down, walk animation frame 0
dw .WalkingDown, .NormalOAM ; facing down, walk animation frame 1
dw .StandingDown, .NormalOAM ; facing down, walk animation frame 2
dw .WalkingDown, .FlippedOAM ; facing down, walk animation frame 3
dw .StandingUp, .NormalOAM ; facing up, walk animation frame 0
dw .WalkingUp, .NormalOAM ; facing up, walk animation frame 1
dw .StandingUp, .NormalOAM ; facing up, walk animation frame 2
dw .WalkingUp, .FlippedOAM ; facing up, walk animation frame 3
dw .StandingLeft, .NormalOAM ; facing left, walk animation frame 0
dw .WalkingLeft, .NormalOAM ; facing left, walk animation frame 1
dw .StandingLeft, .NormalOAM ; facing left, walk animation frame 2
dw .WalkingLeft, .NormalOAM ; facing left, walk animation frame 3
dw .StandingLeft, .FlippedOAM ; facing right, walk animation frame 0
dw .WalkingLeft, .FlippedOAM ; facing right, walk animation frame 1
dw .StandingLeft, .FlippedOAM ; facing right, walk animation frame 2
dw .WalkingLeft, .FlippedOAM ; facing right, walk animation frame 3
; The rest of this table is used for sprites $a and $b.
; All orientation and animation parameters lead to the same result.
; Used for immobile sprites like items on the ground.
dw .StandingDown, .NormalOAM ; facing down, walk animation frame 0
dw .StandingDown, .NormalOAM ; facing down, walk animation frame 1
dw .StandingDown, .NormalOAM ; facing down, walk animation frame 2
dw .StandingDown, .NormalOAM ; facing down, walk animation frame 3
dw .StandingDown, .NormalOAM ; facing up, walk animation frame 0
dw .StandingDown, .NormalOAM ; facing up, walk animation frame 1
dw .StandingDown, .NormalOAM ; facing up, walk animation frame 2
dw .StandingDown, .NormalOAM ; facing up, walk animation frame 3
dw .StandingDown, .NormalOAM ; facing left, walk animation frame 0
dw .StandingDown, .NormalOAM ; facing left, walk animation frame 1
dw .StandingDown, .NormalOAM ; facing left, walk animation frame 2
dw .StandingDown, .NormalOAM ; facing left, walk animation frame 3
dw .StandingDown, .NormalOAM ; facing right, walk animation frame 0
dw .StandingDown, .NormalOAM ; facing right, walk animation frame 1
dw .StandingDown, .NormalOAM ; facing right, walk animation frame 2
dw .StandingDown, .NormalOAM ; facing right, walk animation frame 3
; four tile ids compose an overworld sprite
.StandingDown: db $00, $01, $02, $03
.WalkingDown: db $80, $81, $82, $83
.StandingUp: db $04, $05, $06, $07
.WalkingUp: db $84, $85, $86, $87
.StandingLeft: db $08, $09, $0a, $0b
.WalkingLeft: db $88, $89, $8a, $8b
.NormalOAM:
; y, x, attributes
db 0, 0, $00 ; top left
db 0, 8, $00 ; top right
db 8, 0, OAMFLAG_CANBEMASKED ; bottom left
db 8, 8, OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA ; bottom right
.FlippedOAM:
; y, x, attributes
db 0, 8, OAM_HFLIP ; top left
db 0, 0, OAM_HFLIP ; top right
db 8, 8, OAM_HFLIP | OAMFLAG_CANBEMASKED ; bottom left
db 8, 0, OAM_HFLIP | OAMFLAG_CANBEMASKED | OAMFLAG_ENDOFDATA ; bottom right
| 52.483333 | 76 | 0.731661 |
f310a5d81f1748035ff55978810f3f4e985a58e1 | 6,493 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_21829_1519.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_21829_1519.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_21829_1519.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 %r14
push %r15
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0x19d7, %rsi
lea addresses_WC_ht+0x1d6a3, %rdi
nop
and %r13, %r13
mov $37, %rcx
rep movsb
nop
sub $51840, %r14
lea addresses_WC_ht+0x1c5c3, %rsi
nop
nop
inc %rdx
movl $0x61626364, (%rsi)
nop
nop
nop
nop
add $29511, %r14
lea addresses_UC_ht+0xdf1f, %rsi
lea addresses_WT_ht+0xbf37, %rdi
clflush (%rsi)
clflush (%rdi)
sub $64583, %rbp
mov $73, %rcx
rep movsb
nop
nop
nop
nop
nop
dec %rbp
lea addresses_A_ht+0x1e3d7, %rdx
nop
nop
and $28171, %r13
vmovups (%rdx), %ymm4
vextracti128 $1, %ymm4, %xmm4
vpextrq $0, %xmm4, %rcx
nop
nop
add %r13, %r13
lea addresses_A_ht+0xfed7, %rsi
lea addresses_WT_ht+0x151d7, %rdi
clflush (%rdi)
and $24554, %r15
mov $20, %rcx
rep movsb
add %r13, %r13
lea addresses_A_ht+0x194af, %rcx
nop
nop
nop
nop
sub $22297, %rdx
movb (%rcx), %r15b
nop
xor %rdi, %rdi
lea addresses_A_ht+0x65d7, %r13
nop
nop
nop
nop
inc %rcx
mov $0x6162636465666768, %r15
movq %r15, %xmm4
vmovups %ymm4, (%r13)
nop
nop
nop
nop
nop
cmp %r13, %r13
lea addresses_A_ht+0x83d7, %rdx
cmp $27814, %rsi
mov (%rdx), %rbp
nop
and $51642, %rsi
lea addresses_normal_ht+0x3017, %r14
nop
nop
nop
nop
xor $39206, %rdx
movb $0x61, (%r14)
nop
nop
sub $50481, %r14
lea addresses_A_ht+0xcbd7, %rdi
nop
and $21909, %rdx
mov $0x6162636465666768, %r13
movq %r13, (%rdi)
nop
nop
nop
add $2309, %r15
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r15
pop %r14
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r8
push %rax
push %rbp
push %rbx
push %rdi
push %rsi
// Faulty Load
lea addresses_WT+0x18dd7, %rax
nop
nop
nop
nop
cmp $33449, %rbx
movb (%rax), %r12b
lea oracles, %r8
and $0xff, %r12
shlq $12, %r12
mov (%r8,%r12,1), %r12
pop %rsi
pop %rdi
pop %rbx
pop %rbp
pop %rax
pop %r8
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 2, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 4, 'same': True}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 1, 'AVXalign': True, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
{'39': 21829}
39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39
*/
| 38.64881 | 2,999 | 0.659017 |
639bf674ec028ae203e886182b217e9b53d1461d | 144 | asm | Assembly | other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/ツール/tool/sfxdos/sfxdos.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/ツール/tool/sfxdos/sfxdos.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/ツール/tool/sfxdos/sfxdos.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | Name: sfxdos.asm
Type: file
Size: 12441
Last-Modified: '2016-05-13T04:52:55Z'
SHA-1: 74E2EA47EAF9BB60CB109404EA67F787B18522D3
Description: null
| 20.571429 | 47 | 0.8125 |
d5682488be0c9e1367d795b1ed356b1fdf29a454 | 990 | asm | Assembly | bin/JWASM/Samples/FreeBSD1.asm | Abd-Beltaji/ASMEMU | 4122099e188e951357407152c4666346e45871d3 | [
"MIT"
] | 3 | 2022-03-08T16:53:42.000Z | 2022-03-18T21:55:57.000Z | bin/JWASM/Samples/FreeBSD1.asm | Abd-Beltaji/ASMEMU | 4122099e188e951357407152c4666346e45871d3 | [
"MIT"
] | null | null | null | bin/JWASM/Samples/FreeBSD1.asm | Abd-Beltaji/ASMEMU | 4122099e188e951357407152c4666346e45871d3 | [
"MIT"
] | null | null | null | ;------------------------------------------------------------------------------
;
; Hello, world !! for FreeBSD with JWasm's BIN format.
; Written by Ito Toshimitsu.
;
; > jwasm -q -bin -Fo=FreeBSD1. FreeBSD1.asm
; > chmod 755 FreeBSD1
;
; How to:
; 1. file elf32.inc must be included.
; 2. Macro 'elf32_header' is to be put before start label '_start'.
; 3. Macro 'elf32_footer' is to be put before last 'end _start'.
;
; Restrictions:
; - It is only one section.
; - Start label is '_start'.
;------------------------------------------------------------------------------
.386
.model flat
include elf32.inc
.code
elf32_header ELF_FreeBSD
_start:
push sizeof msg
push offset msg
push 1 ; stdout
mov eax, 4 ; sys_write
push 0 ; dummy argument
int 080h
xor eax, eax ; sys_exit
int 080h
msg db 'Hello World !!', 0ah
elf32_footer
end _start
| 23.023256 | 79 | 0.487879 |
182b8f185822920905cbe935add178422d315300 | 5,961 | asm | Assembly | gnutls/nettle/x86_64/md5-compress.asm | TheShellLand/crossover-source | 247b5591f1b059b95553352adb56c45b775c0c24 | [
"MIT"
] | null | null | null | gnutls/nettle/x86_64/md5-compress.asm | TheShellLand/crossover-source | 247b5591f1b059b95553352adb56c45b775c0c24 | [
"MIT"
] | null | null | null | gnutls/nettle/x86_64/md5-compress.asm | TheShellLand/crossover-source | 247b5591f1b059b95553352adb56c45b775c0c24 | [
"MIT"
] | null | null | null | C x86_64/md5-compress.asm
ifelse(<
Copyright (C) 2005, 2013 Niels Möller
This file is part of GNU Nettle.
GNU Nettle is free software: you can redistribute it and/or
modify it under the terms of either:
* the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your
option) any later version.
or
* the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your
option) any later version.
or both in parallel, as here.
GNU Nettle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received copies of the GNU General Public License and
the GNU Lesser General Public License along with this program. If
not, see http://www.gnu.org/licenses/.
>)
C Registers:
define(<STATE>, <%rdi>)
define(<INPUT>, <%rsi>)
define(<SA>,<%rax>)
define(<SB>,<%rbx>)
define(<SC>,<%rcx>)
define(<SD>,<%rbp>)
define(<TMP>, <%r8>)
C F1(x,y,z) = (z ^ (x & (y ^ z)))
define(<F1>, <
movl XREG($3), XREG(TMP)
xorl XREG($2), XREG(TMP)
andl XREG($1), XREG(TMP)
xorl XREG($3), XREG(TMP)>)
define(<F2>,<F1($3, $1, $2)>)
C F3(x,y,z) = x ^ y ^ z
define(<F3>,<
movl XREG($1), XREG(TMP)
xorl XREG($2), XREG(TMP)
xorl XREG($3), XREG(TMP)>)
C F4(x,y,z) = y ^ (x | ~z)
define(<F4>,<
movl XREG($3), XREG(TMP)
notl XREG(TMP)
orl XREG($1), XREG(TMP)
xorl XREG($2), XREG(TMP)>)
C Index to 4*i, or to the empty string if zero
define(<REF>,<ifelse($1,0,,eval(4*$1))(INPUT)>)
C ROUND(f, w, x, y, z, k, data, s):
C w += f(x,y,z) + data + k
C w <<< s
C w += x
define(<ROUND>,<
addl <$>$7, XREG($2)
$1($3, $4, $5)
addl $6, XREG($2)
addl XREG(TMP), XREG($2)
roll <$>$8, XREG($2)
addl XREG($3), XREG($2)>)
.file "md5-compress.asm"
C nettle_md5_compress(uint32_t *state, uint8_t *input)
.text
ALIGN(16)
PROLOGUE(nettle_md5_compress)
W64_ENTRY(2,0)
C save all registers that need to be saved
push %rbp
push %rbx
C load the state vector
movl (STATE), XREG(SA)
movl 4(STATE), XREG(SB)
movl 8(STATE), XREG(SC)
movl 12(STATE), XREG(SD)
ROUND(<F1>, SA, SB, SC, SD, REF( 0), 0xd76aa478, 7)
ROUND(<F1>, SD, SA, SB, SC, REF( 1), 0xe8c7b756, 12)
ROUND(<F1>, SC, SD, SA, SB, REF( 2), 0x242070db, 17)
ROUND(<F1>, SB, SC, SD, SA, REF( 3), 0xc1bdceee, 22)
ROUND(<F1>, SA, SB, SC, SD, REF( 4), 0xf57c0faf, 7)
ROUND(<F1>, SD, SA, SB, SC, REF( 5), 0x4787c62a, 12)
ROUND(<F1>, SC, SD, SA, SB, REF( 6), 0xa8304613, 17)
ROUND(<F1>, SB, SC, SD, SA, REF( 7), 0xfd469501, 22)
ROUND(<F1>, SA, SB, SC, SD, REF( 8), 0x698098d8, 7)
ROUND(<F1>, SD, SA, SB, SC, REF( 9), 0x8b44f7af, 12)
ROUND(<F1>, SC, SD, SA, SB, REF(10), 0xffff5bb1, 17)
ROUND(<F1>, SB, SC, SD, SA, REF(11), 0x895cd7be, 22)
ROUND(<F1>, SA, SB, SC, SD, REF(12), 0x6b901122, 7)
ROUND(<F1>, SD, SA, SB, SC, REF(13), 0xfd987193, 12)
ROUND(<F1>, SC, SD, SA, SB, REF(14), 0xa679438e, 17)
ROUND(<F1>, SB, SC, SD, SA, REF(15), 0x49b40821, 22)
ROUND(<F2>, SA, SB, SC, SD, REF( 1), 0xf61e2562, 5)
ROUND(<F2>, SD, SA, SB, SC, REF( 6), 0xc040b340, 9)
ROUND(<F2>, SC, SD, SA, SB, REF(11), 0x265e5a51, 14)
ROUND(<F2>, SB, SC, SD, SA, REF( 0), 0xe9b6c7aa, 20)
ROUND(<F2>, SA, SB, SC, SD, REF( 5), 0xd62f105d, 5)
ROUND(<F2>, SD, SA, SB, SC, REF(10), 0x02441453, 9)
ROUND(<F2>, SC, SD, SA, SB, REF(15), 0xd8a1e681, 14)
ROUND(<F2>, SB, SC, SD, SA, REF( 4), 0xe7d3fbc8, 20)
ROUND(<F2>, SA, SB, SC, SD, REF( 9), 0x21e1cde6, 5)
ROUND(<F2>, SD, SA, SB, SC, REF(14), 0xc33707d6, 9)
ROUND(<F2>, SC, SD, SA, SB, REF( 3), 0xf4d50d87, 14)
ROUND(<F2>, SB, SC, SD, SA, REF( 8), 0x455a14ed, 20)
ROUND(<F2>, SA, SB, SC, SD, REF(13), 0xa9e3e905, 5)
ROUND(<F2>, SD, SA, SB, SC, REF( 2), 0xfcefa3f8, 9)
ROUND(<F2>, SC, SD, SA, SB, REF( 7), 0x676f02d9, 14)
ROUND(<F2>, SB, SC, SD, SA, REF(12), 0x8d2a4c8a, 20)
ROUND(<F3>, SA, SB, SC, SD, REF( 5), 0xfffa3942, 4)
ROUND(<F3>, SD, SA, SB, SC, REF( 8), 0x8771f681, 11)
ROUND(<F3>, SC, SD, SA, SB, REF(11), 0x6d9d6122, 16)
ROUND(<F3>, SB, SC, SD, SA, REF(14), 0xfde5380c, 23)
ROUND(<F3>, SA, SB, SC, SD, REF( 1), 0xa4beea44, 4)
ROUND(<F3>, SD, SA, SB, SC, REF( 4), 0x4bdecfa9, 11)
ROUND(<F3>, SC, SD, SA, SB, REF( 7), 0xf6bb4b60, 16)
ROUND(<F3>, SB, SC, SD, SA, REF(10), 0xbebfbc70, 23)
ROUND(<F3>, SA, SB, SC, SD, REF(13), 0x289b7ec6, 4)
ROUND(<F3>, SD, SA, SB, SC, REF( 0), 0xeaa127fa, 11)
ROUND(<F3>, SC, SD, SA, SB, REF( 3), 0xd4ef3085, 16)
ROUND(<F3>, SB, SC, SD, SA, REF( 6), 0x04881d05, 23)
ROUND(<F3>, SA, SB, SC, SD, REF( 9), 0xd9d4d039, 4)
ROUND(<F3>, SD, SA, SB, SC, REF(12), 0xe6db99e5, 11)
ROUND(<F3>, SC, SD, SA, SB, REF(15), 0x1fa27cf8, 16)
ROUND(<F3>, SB, SC, SD, SA, REF( 2), 0xc4ac5665, 23)
ROUND(<F4>, SA, SB, SC, SD, REF( 0), 0xf4292244, 6)
ROUND(<F4>, SD, SA, SB, SC, REF( 7), 0x432aff97, 10)
ROUND(<F4>, SC, SD, SA, SB, REF(14), 0xab9423a7, 15)
ROUND(<F4>, SB, SC, SD, SA, REF( 5), 0xfc93a039, 21)
ROUND(<F4>, SA, SB, SC, SD, REF(12), 0x655b59c3, 6)
ROUND(<F4>, SD, SA, SB, SC, REF( 3), 0x8f0ccc92, 10)
ROUND(<F4>, SC, SD, SA, SB, REF(10), 0xffeff47d, 15)
ROUND(<F4>, SB, SC, SD, SA, REF( 1), 0x85845dd1, 21)
ROUND(<F4>, SA, SB, SC, SD, REF( 8), 0x6fa87e4f, 6)
ROUND(<F4>, SD, SA, SB, SC, REF(15), 0xfe2ce6e0, 10)
ROUND(<F4>, SC, SD, SA, SB, REF( 6), 0xa3014314, 15)
ROUND(<F4>, SB, SC, SD, SA, REF(13), 0x4e0811a1, 21)
ROUND(<F4>, SA, SB, SC, SD, REF( 4), 0xf7537e82, 6)
ROUND(<F4>, SD, SA, SB, SC, REF(11), 0xbd3af235, 10)
ROUND(<F4>, SC, SD, SA, SB, REF( 2), 0x2ad7d2bb, 15)
ROUND(<F4>, SB, SC, SD, SA, REF( 9), 0xeb86d391, 21)
C Update the state vector
addl XREG(SA), (STATE)
addl XREG(SB), 4(STATE)
addl XREG(SC), 8(STATE)
addl XREG(SD), 12(STATE)
pop %rbx
pop %rbp
W64_EXIT(2,0)
ret
EPILOGUE(nettle_md5_compress)
| 33.677966 | 72 | 0.607448 |
8e5c02a4ad64f04123efe6f5ac5890f61349d391 | 10,270 | nasm | Assembly | x86_dynamic_addresses/rebind_bind_shell/rebind_socket.nasm | danf42/vulnserver | 1b01aaa0f0b5706b5bc24c5f64d99dddcdcfe913 | [
"MIT"
] | null | null | null | x86_dynamic_addresses/rebind_bind_shell/rebind_socket.nasm | danf42/vulnserver | 1b01aaa0f0b5706b5bc24c5f64d99dddcdcfe913 | [
"MIT"
] | null | null | null | x86_dynamic_addresses/rebind_bind_shell/rebind_socket.nasm | danf42/vulnserver | 1b01aaa0f0b5706b5bc24c5f64d99dddcdcfe913 | [
"MIT"
] | null | null | null | ;
; Rebind shellcode
; Use Stephen Fewer hashing algorithm to dynamically find addresses of API methods
;
; Code uses techniques from
; - https://github.com/BorjaMerino/Windows-One-Way-Stagers/blob/master/Rebind-Socket/migrate_rebind_socket.asm
; - https://raw.githubusercontent.com/rapid7/metasploit-framework/master/external/source/shellcode/windows/x86/src/block/block_api.asm
;
[BITS 32]
cld
call start
; Input: The hash of the API to call and all its parameters must be pushed onto stack.
; Output: The return value from the API call will be in EAX.
; Clobbers: EAX, ECX and EDX (ala the normal stdcall calling convention)
; Un-Clobbered: EBX, ESI, EDI, ESP and EBP can be expected to remain un-clobbered.
; Note: This function assumes the direction flag has allready been cleared via a CLD instruction.
; Note: This function is unable to call forwarded exports.
api_call:
pushad ; We preserve all the registers for the caller, bar EAX and ECX.
mov ebp, esp ; Create a new stack frame
xor edx, edx ; Zero EDX
mov edx, [fs:edx+0x30] ; Get a pointer to the PEB
mov edx, [edx+0xc] ; Get PEB->Ldr
mov edx, [edx+0x14] ; Get the first module from the InMemoryOrder module list
next_mod: ;
mov esi, [edx+0x28] ; Get pointer to modules name (unicode string)
movzx ecx, word [edx+0x26] ; Set ECX to the length we want to check
xor edi, edi ; Clear EDI which will store the hash of the module name
loop_modname: ;
xor eax, eax ; Clear EAX
lodsb ; Read in the next byte of the name
cmp al, 'a' ; Some versions of Windows use lower case module names
jl not_lowercase ;
sub al, 0x20 ; If so normalise to uppercase
not_lowercase: ;
ror edi, 0xd ; Rotate right our hash value
add edi, eax ; Add the next byte of the name
dec ecx
jnz loop_modname ; Loop until we have read enough
; We now have the module hash computed
push edx ; Save the current position in the module list for later
push edi ; Save the current module hash for later
; Proceed to iterate the export address table,
mov edx, [edx+0x10] ; Get this modules base address
mov eax, [edx+0x3c] ; Get PE header
add eax, edx ; Add the modules base address
mov eax, [eax+0x78] ; Get export tables RVA
test eax, eax ; Test if no export address table is present
jz get_next_mod1 ; If no EAT present, process the next module
add eax, edx ; Add the modules base address
push eax ; Save the current modules EAT
mov ecx, [eax+0x18] ; Get the number of function names
mov ebx, [eax+0x20] ; Get the rva of the function names
add ebx, edx ; Add the modules base address
; Computing the module hash + function hash
get_next_func: ;
test ecx, ecx ; Changed from jecxz to accomodate the larger offset produced by random jmps below
jz get_next_mod ; When we reach the start of the EAT (we search backwards), process the next module
dec ecx ; Decrement the function name counter
mov esi, [ebx+ecx*4] ; Get rva of next module name
add esi, edx ; Add the modules base address
xor edi, edi ; Clear EDI which will store the hash of the function name
; And compare it to the one we want
loop_funcname: ;
xor eax, eax ; Clear EAX
lodsb ; Read in the next byte of the ASCII function name
ror edi, 0xd ; Rotate right our hash value
add edi, eax ; Add the next byte of the name
cmp al, ah ; Compare AL (the next byte from the name) to AH (null)
jne loop_funcname ; If we have not reached the null terminator, continue
add edi, [ebp-8] ; Add the current module hash to the function hash
cmp edi, [ebp+0x24] ; Compare the hash to the one we are searchnig for
jnz get_next_func ; Go compute the next function hash if we have not found it
; If found, fix up stack, call the function and then value else compute the next one...
pop eax ; Restore the current modules EAT
mov ebx, [eax+0x24] ; Get the ordinal table rva
add ebx, edx ; Add the modules base address
mov cx, [ebx+2*ecx] ; Get the desired functions ordinal
mov ebx, [eax+0x1c] ; Get the function addresses table rva
add ebx, edx ; Add the modules base address
mov eax, [ebx+4*ecx] ; Get the desired functions RVA
add eax, edx ; Add the modules base address to get the functions actual VA
; We now fix up the stack and perform the call to the desired function...
finish:
mov [esp+0x24], eax ; Overwrite the old EAX value with the desired api address for the upcoming popad
pop ebx ; Clear off the current modules hash
pop ebx ; Clear off the current position in the module list
popad ; Restore all of the callers registers, bar EAX, ECX and EDX which are clobbered
pop ecx ; Pop off the origional return address our caller will have pushed
pop edx ; Pop off the hash value our caller will have pushed
push ecx ; Push back the correct return value
jmp eax ; Jump into the required function
; We now automagically return to the correct caller...
get_next_mod: ;
pop eax ; Pop off the current (now the previous) modules EAT
get_next_mod1: ;
pop edi ; Pop off the current (now the previous) modules hash
pop edx ; Restore our position in the module list
mov edx, [edx] ; Get the next module
jmp next_mod ; Process this module
;
; Begin Rebind Shellcode
;
start:
pop ebp ; pop off the address of 'api_call' for calling later
push 0x00003233 ; Push the bytes 'ws2_32',0,0 onto the stack.
push 0x5F327377 ; ...
push esp ; Push a pointer to the "ws2_32" string on the stack.
push 0x0726774C ; hash( "kernel32.dll", "LoadLibraryA" )
call ebp ; LoadLibraryA( "ws2_32" )
mov eax, 0x0190 ; EAX = sizeof( struct WSAData )
sub esp, eax ; alloc some space for the WSAData structure
push esp ; push a pointer to this stuct
push eax ; push the wVersionRequested parameter
push 0x006B8029 ; hash( "ws2_32.dll", "WSAStartup" )
call ebp ; WSAStartup( 0x0190, &WSAData );
xor eax, eax
mov eax, [fs:0x30 + eax] ; PEB
mov eax, [ds:eax+0x10] ; _RTL_USER_PROCESS_PARAMETERS* ProcessParameters;
mov esi, [ds:eax+0x74] ; Path Binary
add esp,-400 ; adjust the stack to avoid corruption
lea edx,[esp+0x60]
push edx
push 0xB16B4AB1 ; hash( "kernel32.dll", "GetStartupInfoA" )
call ebp ; GetStartupInfoA( &si );
lea eax,[esp+0x60] ; Put startupinfo pointer back in eax
mov [eax+0x4], ecx ; Clean lpReserved (change me)
mov [eax+0x8], ecx ; Clean lpDesktop (change me)
mov [eax+0xC], ecx ; Clean lpTitle (change me)
lea edi,[eax+0x60] ; Offset of empty space for lpProcessInformation
push edi ; lpProcessInformation : write processinfo here
push eax ; lpStartupInfo : current info (read)
xor ebx,ebx
push ebx ; lpCurrentDirectory
push ebx ; lpEnvironment
push 0x08000004 ; dwCreationFlags CREATE_NO_WINDOW | CREATE_SUSPENDED
push ebx ; bInHeritHandles
push ebx ; lpThreadAttributes
push ebx ; lpProcessAttributes
push esi ; lpCommandLine
push ebx ; lpApplicationName
push 0x86EFCC79 ; hash( "kernel32.dll", "CreateProcessW" )
call ebp ; CreateProcessW( &si );
; if we didn't get a new process, use this one
test eax,eax
jz payload ; If process creation failed, jump to shellcode
push 0x40 ; RWX
add bh, 0x10 ; ebx = 0x1000
push ebx ; MEM_COMMIT
mov ebx, 0x253 ; Bufer size
push ebx
xor ebx,ebx
push ebx ; address
push dword [edi] ; handle
push 0x3F9287AE ; hash( "kernel32.dll", "VirtualAllocEx" )
call ebp ; VirtualAllocEx( ...);
; eax now contains the destination
push esp ; lpNumberOfBytesWritten
push 0x253 ; nSize
; pick up pointer to shellcode & keep it on stack
jmp begin_of_payload
begin_of_payload_return: ; lpBuffer
push eax ; lpBaseAddress
XCHG eax, esi ; record base address
push dword [edi] ; hProcess
push 0xE7BDD8C5 ; hash( "kernel32.dll", "WriteProcessMemory" )
call ebp ; WriteProcessMemory( ...)
; Let's Thread Hijack
mov ebx, dword [edi+0x4]
push 0x10001
push esp ; lpContext
push ebx ; hThread
push 0xD1425C18 ; hash( "kernel32.dll", "GetThreadContext" )
call ebp ; GetThreadContext( ...);
xor ecx, ecx
mov ecx, 0xb8
mov dword [esp+ecx], esi ; Change EIP Context
; mov dword [esp+0xB8], esi ; Change EIP Context
push esp ; lpContext
push ebx ; hThread
push 0xD14E5C18 ; hash( "kernel32.dll", "SetThreadContext" )
call ebp
push ebx ; hThread
push 0x8EF4092B ; hash( "kernel32.dll", "ResumeThread" )
call ebp
; End the current process to release socket
xor eax, eax
push eax
push 0x56A2B5F0 ; ExitProcess(0)
call ebp
begin_of_payload:
call begin_of_payload_return
payload:
| 46.261261 | 134 | 0.597858 |
dbd675ea56cf609df619c53583c2bffc66e0b2a7 | 3,286 | asm | Assembly | Transynther/x86/_processed/US/_zr_/i3-7100_9_0x84_notsx.log_40_3057.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/US/_zr_/i3-7100_9_0x84_notsx.log_40_3057.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/US/_zr_/i3-7100_9_0x84_notsx.log_40_3057.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 %r14
push %r8
push %r9
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x102bf, %rax
nop
nop
nop
nop
nop
add %r11, %r11
mov $0x6162636465666768, %r9
movq %r9, %xmm6
movups %xmm6, (%rax)
nop
nop
nop
nop
add %r14, %r14
lea addresses_UC_ht+0x10ae5, %rbx
nop
nop
dec %r13
mov (%rbx), %r14
nop
nop
sub $35181, %r11
lea addresses_D_ht+0x15e65, %r9
nop
nop
nop
and %r8, %r8
mov (%r9), %r14w
nop
add $60614, %r11
lea addresses_A_ht+0xc7fd, %r8
nop
nop
nop
nop
cmp %r11, %r11
mov (%r8), %eax
nop
nop
nop
nop
nop
cmp %r8, %r8
lea addresses_normal_ht+0x188a5, %rsi
lea addresses_UC_ht+0x98e5, %rdi
nop
nop
nop
nop
inc %r14
mov $89, %rcx
rep movsl
add $12561, %r13
lea addresses_WT_ht+0x1ae5, %rcx
nop
nop
nop
nop
inc %r11
mov (%rcx), %r9d
nop
nop
nop
nop
nop
add %rdi, %rdi
lea addresses_WC_ht+0x5cff, %r8
clflush (%r8)
nop
nop
nop
nop
cmp %rdi, %rdi
mov (%r8), %rcx
nop
nop
add $51071, %r9
lea addresses_WC_ht+0x1006d, %r9
nop
nop
sub %r14, %r14
mov $0x6162636465666768, %rax
movq %rax, (%r9)
nop
nop
and $48472, %rsi
lea addresses_normal_ht+0x1c531, %rsi
lea addresses_WT_ht+0x27e5, %rdi
nop
nop
nop
nop
nop
inc %rbx
mov $99, %rcx
rep movsb
nop
nop
nop
sub %rbx, %rbx
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r9
pop %r8
pop %r14
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r15
push %r8
push %rbx
push %rsi
// Faulty Load
lea addresses_US+0x132e5, %rsi
nop
nop
cmp %r11, %r11
movups (%rsi), %xmm3
vpextrq $1, %xmm3, %r8
lea oracles, %rbx
and $0xff, %r8
shlq $12, %r8
mov (%rbx,%r8,1), %r8
pop %rsi
pop %rbx
pop %r8
pop %r15
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_US', 'same': False, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_US', 'same': True, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 16, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 8, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D_ht', 'same': False, 'size': 2, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'same': False, 'size': 4, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WT_ht', 'same': False, 'size': 4, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 8, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM'}
{'00': 40}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 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.216374 | 152 | 0.649422 |
3a61a2d936bec155f4a88a2dcf2a4d7ed759c402 | 384 | asm | Assembly | oeis/050/A050483.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/050/A050483.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/050/A050483.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A050483: Partial sums of A051947.
; Submitted by Jamie Morken(s4)
; 1,11,60,228,690,1782,4092,8580,16731,30745,53768,90168,145860,228684,348840,519384,756789,1081575,1519012,2099900,2861430,3848130,5112900,6718140,8736975,11254581,14369616,18195760,22863368,28521240,35338512
mov $2,$0
mul $0,4
add $0,7
add $2,5
mov $1,$2
bin $1,5
mul $0,$1
add $2,1
mul $2,$0
mov $0,$2
div $0,42
| 24 | 209 | 0.739583 |
d0079de92b880d0b9ccf9750d1e577241984c3b4 | 6,035 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_33.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_33.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_33.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 %r13
push %r14
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0x1c4a3, %r14
nop
xor %rcx, %rcx
movw $0x6162, (%r14)
nop
and %r14, %r14
lea addresses_A_ht+0x10aa3, %r13
clflush (%r13)
nop
nop
nop
nop
nop
add %rcx, %rcx
mov (%r13), %rdi
nop
and %rdi, %rdi
lea addresses_WC_ht+0x15536, %rdi
sub %r13, %r13
mov $0x6162636465666768, %r14
movq %r14, (%rdi)
nop
nop
sub %r11, %r11
lea addresses_normal_ht+0x15aa3, %rsi
nop
nop
nop
nop
nop
add $55563, %rax
mov $0x6162636465666768, %r13
movq %r13, %xmm1
and $0xffffffffffffffc0, %rsi
vmovntdq %ymm1, (%rsi)
nop
nop
nop
nop
add $54603, %rsi
lea addresses_WT_ht+0xee1b, %rsi
lea addresses_normal_ht+0x18261, %rdi
nop
dec %rax
mov $23, %rcx
rep movsl
nop
xor %r11, %r11
lea addresses_D_ht+0x1dca3, %rsi
lea addresses_WT_ht+0x19f23, %rdi
clflush (%rdi)
inc %r12
mov $7, %rcx
rep movsw
nop
nop
nop
nop
nop
and %rdi, %rdi
lea addresses_normal_ht+0x16717, %rax
nop
nop
nop
nop
nop
and %rcx, %rcx
mov $0x6162636465666768, %r13
movq %r13, %xmm5
movups %xmm5, (%rax)
nop
nop
nop
nop
nop
add $14603, %rax
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r14
pop %r13
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r14
push %r8
push %rcx
push %rsi
// Store
lea addresses_RW+0xbde3, %rcx
nop
mfence
mov $0x5152535455565758, %rsi
movq %rsi, %xmm7
vmovups %ymm7, (%rcx)
nop
nop
nop
xor $26391, %rcx
// Faulty Load
lea addresses_normal+0x2ca3, %rcx
nop
nop
and $4087, %r12
mov (%rcx), %r14w
lea oracles, %rsi
and $0xff, %r14
shlq $12, %r14
mov (%rsi,%r14,1), %r14
pop %rsi
pop %rcx
pop %r8
pop %r14
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_normal', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 6}}
[Faulty Load]
{'src': {'type': 'addresses_normal', 'AVXalign': False, 'size': 2, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': True, 'size': 2, 'NT': False, 'same': False, 'congruent': 11}}
{'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 8}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 32, 'NT': True, 'same': True, 'congruent': 9}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': True}}
{'src': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 2}}
{'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
*/
| 39.703947 | 2,999 | 0.662635 |
6b975efc7c226f7b6d3c5f06c46432460055d37d | 291 | asm | Assembly | libsrc/msx/gen_ldirvm.asm | andydansby/z88dk-mk2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | 1 | 2020-09-15T08:35:49.000Z | 2020-09-15T08:35:49.000Z | libsrc/msx/gen_ldirvm.asm | andydansby/z88dk-MK2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | null | null | null | libsrc/msx/gen_ldirvm.asm | andydansby/z88dk-MK2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | null | null | null | ;
; z88dk library: Generic VDP support code
;
; FILVRM
;
;
; $Id: gen_ldirvm.asm,v 1.1 2010/06/30 13:21:38 stefano Exp $
;
XLIB LDIRVM
LIB SETWRT
INCLUDE "msx/vdp.inc"
LDIRVM:
ex de,hl
call SETWRT
loop: ld a,(de)
out (VDP_DATA),a
inc de
dec bc
ld a,b
or c
jr nz,loop
ret
| 10.777778 | 61 | 0.642612 |
53e8144d4366078916633a3fe6c7336823d8a6d1 | 3,334 | asm | Assembly | sdk-6.5.20/tools/led/example/bcm953547k.asm | copslock/broadcom_cpri | 8e2767676e26faae270cf485591902a4c50cf0c5 | [
"Spencer-94"
] | null | null | null | sdk-6.5.20/tools/led/example/bcm953547k.asm | copslock/broadcom_cpri | 8e2767676e26faae270cf485591902a4c50cf0c5 | [
"Spencer-94"
] | null | null | null | sdk-6.5.20/tools/led/example/bcm953547k.asm | copslock/broadcom_cpri | 8e2767676e26faae270cf485591902a4c50cf0c5 | [
"Spencer-94"
] | null | null | null | ;
; $Id: bcm953547k.asm, v 1.0 2017/08/17 15:30:14 leonlee Exp $
;
; This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
;
; Copyright 2007-2020 Broadcom Inc. All rights reserved.
;
; This example is used for showing the serial EGPHY LEDs on
; BCM953547K.
;
; To start it, use the following commands from BCM:
;
; led load bcm953547k.hex
; led auto on
; led start
;
; Each port needs to output 2 bits stream,
; bit 0: LED_0
; bit 1: LED_1
;
; Totally 24 ports need be outputed, i.e. 48 (= 24 * 2) bits.
; The output sequence for EGPHY will follow the user port sequence.
;
; The LED sequence is (User Port, Front Panel Order)
; 2, 3, ... 25
; Mapping onto physical port view, the sequence is:
; 13, 12, ..., 2, 18, 19, ..., 29
; The output order should be the inverted sequence of the physical
; mapping view
; 29, 28, ..., 18, 2, 3, ..., 13
;
; Link up/down info cannot be derived from LINKEN, as the LED
; processor does not always have access to link status. This program
; assumes link status is kept current in bit 0 of RAM byte (0xA0 + portnum).
; Generally, a program running on the main CPU must update these
; locations on link change; see linkscan callback in
; $SDK/src/appl/diag/ledproc.c.
;
;
; Constants
;
NUM_PORTS equ 24
;START_PORT_0 equ 13
;END_PORT_0 equ 2
;START_PORT_1 equ 18
;END_PORT_1 equ 29
START_PORT_0 equ 29
END_PORT_0 equ 18
START_PORT_1 equ 2
END_PORT_1 equ 13
;
; LED process
;
start_sec0:
ld a, START_PORT_0
iter_sec0:
port a
ld (PORT_NUM), a
call get_activity_hw
ld a, (PORT_NUM)
port a
call get_link_hw
ld a, (PORT_NUM)
dec a
cmp a, END_PORT_0 - 1
jnz iter_sec0
start_sec1:
ld a, START_PORT_1
iter_sec1:
port a
ld (PORT_NUM), a
call get_activity_hw
ld a, (PORT_NUM)
port a
call get_link_hw
ld a, (PORT_NUM)
inc a
cmp a, END_PORT_1 + 1
jnz iter_sec1
end:
send 2*NUM_PORTS
;
; get_link_hw
;
; This routine finds the link status LED for a port from HW.
; Inputs: (PORT_NUM)
; Outputs: Carry flag set if link is up, clear if link is down.
; Destroys: a, b
get_link_hw:
pushst LINKEN
pop
jc led_on
jmp led_off
;
; get_activity_hw
;
; This routine finds the link status LED for a port from HW.
; Inputs: (PORT_NUM)
; Outputs: Carry flag set if RX or TX is up, clear if link is down.
; Destroys: a, b
get_activity_hw:
pushst RX
pushst TX
tor
pop
jc led_on
jmp led_off
;
; led_on
;
; Outputs: Bits to the LED stream indicating ON
;
led_on:
push 0
pack
ret
;
; led_off
;
; Outputs: Bits to the LED stream indicating OFF
;
led_off:
push 1
pack
ret
; Variables (SDK software initializes LED memory from 0xA0-0xff to 0)
PORTDATA equ 0xA0
PORT_NUM equ 0xE0
; Symbolic names for the bits of the port status fields
RX equ 0x0 ; received packet
TX equ 0x1 ; transmitted packet
COLL equ 0x2 ; collision indicator
SPEED_C equ 0x3 ; 100 Mbps
SPEED_M equ 0x4 ; 1000 Mbps
DUPLEX equ 0x5 ; half/full duplex
FLOW equ 0x6 ; flow control capable
LINKUP equ 0x7 ; link down/up status
LINKEN equ 0x8 ; link disabled/enabled status
ZERO equ 0xE ; always 0
ONE equ 0xF ; always 1
| 20.968553 | 133 | 0.676665 |
a150de292363c5cc7df5143e10b9ddbf0c9f648d | 7,805 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_192.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_0xca_notsx.log_21829_192.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_0xca_notsx.log_21829_192.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 %r14
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x10cec, %rsi
lea addresses_WT_ht+0xf18f, %rdi
nop
nop
nop
nop
nop
xor $59328, %rax
mov $76, %rcx
rep movsw
nop
nop
nop
nop
nop
xor $37910, %r10
lea addresses_D_ht+0x1dd0f, %r14
nop
nop
nop
nop
nop
sub %r11, %r11
movb $0x61, (%r14)
nop
nop
cmp $51198, %r14
lea addresses_D_ht+0x6d8f, %rsi
lea addresses_WT_ht+0x1108f, %rdi
nop
nop
nop
nop
add %rbp, %rbp
mov $69, %rcx
rep movsw
nop
nop
dec %rax
lea addresses_normal_ht+0x13e8f, %r14
xor $50709, %rbp
movups (%r14), %xmm6
vpextrq $1, %xmm6, %r10
nop
nop
nop
nop
nop
add %rbp, %rbp
lea addresses_normal_ht+0xbea7, %rbp
sub %r10, %r10
mov $0x6162636465666768, %rax
movq %rax, %xmm5
movups %xmm5, (%rbp)
nop
nop
nop
nop
nop
add %rdi, %rdi
lea addresses_WT_ht+0x38f, %r14
nop
nop
add $37, %rsi
and $0xffffffffffffffc0, %r14
vmovaps (%r14), %ymm3
vextracti128 $1, %ymm3, %xmm3
vpextrq $1, %xmm3, %rcx
nop
nop
and $58983, %r10
lea addresses_D_ht+0x648f, %rcx
nop
nop
nop
nop
nop
add %rax, %rax
mov $0x6162636465666768, %rbp
movq %rbp, %xmm7
vmovups %ymm7, (%rcx)
nop
sub %r11, %r11
lea addresses_normal_ht+0x6535, %r10
nop
nop
nop
nop
nop
add %rbp, %rbp
movb (%r10), %al
nop
nop
and $8128, %r11
lea addresses_WC_ht+0x13a0f, %r11
nop
cmp $29131, %rdi
and $0xffffffffffffffc0, %r11
movaps (%r11), %xmm6
vpextrq $0, %xmm6, %r14
cmp $26593, %rbp
lea addresses_A_ht+0x10fcf, %rax
clflush (%rax)
nop
nop
add $35999, %r14
mov (%rax), %r11
sub $27633, %rbp
lea addresses_A_ht+0x1e48f, %rsi
lea addresses_D_ht+0x10737, %rdi
nop
dec %r14
mov $66, %rcx
rep movsq
nop
nop
nop
xor $50373, %rcx
lea addresses_WT_ht+0xa889, %rcx
nop
nop
nop
nop
nop
sub %rax, %rax
movw $0x6162, (%rcx)
nop
nop
add $29648, %rsi
lea addresses_WT_ht+0x1988f, %rdi
clflush (%rdi)
nop
add $24436, %rax
movb $0x61, (%rdi)
xor $30309, %rbp
lea addresses_WC_ht+0xbd0f, %rax
nop
nop
nop
nop
nop
sub %rcx, %rcx
movb $0x61, (%rax)
nop
and $13977, %rcx
lea addresses_normal_ht+0x13fbf, %rcx
nop
nop
xor %rbp, %rbp
mov $0x6162636465666768, %r10
movq %r10, (%rcx)
nop
nop
nop
dec %r14
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r14
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r15
push %rax
push %rbp
push %rsi
// Faulty Load
lea addresses_WT+0x16c8f, %r11
nop
xor $3025, %r10
mov (%r11), %rax
lea oracles, %rsi
and $0xff, %rax
shlq $12, %rax
mov (%rsi,%rax,1), %rax
pop %rsi
pop %rbp
pop %rax
pop %r15
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'congruent': 0, 'type': 'addresses_WT_ht'}, 'dst': {'same': False, 'congruent': 8, 'type': 'addresses_WT_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 4}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 8, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_WT_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 7}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 3}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': True, 'size': 32, 'congruent': 8}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 11}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': True, 'size': 16, 'congruent': 5}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 6}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 2, 'type': 'addresses_D_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 1}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 10}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 6}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 2}}
{'39': 21829}
39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39
*/
| 34.38326 | 2,999 | 0.657783 |
4240de9ff71e588d35bc9effd49fb2bd80985b46 | 932 | asm | Assembly | examples/ivt.asm | michalmalik/pvm | 59def05cd36437c99f665afdc57ef87f6652b999 | [
"MIT"
] | 2 | 2018-11-13T09:48:06.000Z | 2021-06-30T09:29:50.000Z | examples/ivt.asm | michalmalik/pvm | 59def05cd36437c99f665afdc57ef87f6652b999 | [
"MIT"
] | null | null | null | examples/ivt.asm | michalmalik/pvm | 59def05cd36437c99f665afdc57ef87f6652b999 | [
"MIT"
] | 2 | 2017-03-06T20:46:09.000Z | 2018-06-15T02:09:53.000Z | #define IVT_ADDRESS 0x500
#define IVT_SYSCALL 0x80
.ivt_size DAT 0
; IN
; +1 Interrupt handler
; +2 Offset
; OUT
; None
:register_irq
STO Z,SP
STO Y,[Z+1] ; interrupt handler
STO C,[Z+2] ; interrupt offset
STO [IVT_ADDRESS+C],Y ; save the interrupt handler
ADD [ivt_size],1
STO SP,Z
RET
; IN
; None
; OUT
; None
:build_ivt
IAR handle_software_interrupt
PUSH IVT_SYSCALL
PUSH handle_ivt_syscall
JTR register_irq
ADD SP,2
RET
; IN
; A IA
; OUT
; None
:handle_software_interrupt
STO Y,[IVT_ADDRESS+A]
JTR Y
RETI
#define SYSCALL_WRITE_MEM 0x1
; System call is fully defined by
; register B, which defines what
; type of system call will be called
; IN
; B syscall type
; OUT
; None
:handle_ivt_syscall
IFE B,SYSCALL_WRITE_MEM
JTR syscall_write_mem
RET
; IN
; X destination address
; C value
; D count
; OUT
; None
:syscall_write_mem
PUSH D
PUSH C
PUSH X
JTR write_mem
ADD SP,3
RET | 12.767123 | 51 | 0.7103 |
3c827bae7dd2938dbe1a006e4692c482d554fae1 | 1,818 | asm | Assembly | mastersystem/zxb-sms-2012-02-23/zxb-sms/wip/zxb/library-asm/random.asm | gb-archive/really-old-stuff | ffb39a518cad47e23353b3420b88e2f3521fd3d7 | [
"Apache-2.0"
] | 10 | 2016-10-27T20:46:02.000Z | 2021-11-01T15:49:13.000Z | mastersystem/zxb-sms-2012-02-23/zxb-sms/wip/zxb/library-asm/random.asm | gb-archive/really-old-stuff | ffb39a518cad47e23353b3420b88e2f3521fd3d7 | [
"Apache-2.0"
] | null | null | null | mastersystem/zxb-sms-2012-02-23/zxb-sms/wip/zxb/library-asm/random.asm | gb-archive/really-old-stuff | ffb39a518cad47e23353b3420b88e2f3521fd3d7 | [
"Apache-2.0"
] | 2 | 2015-03-11T14:28:08.000Z | 2017-11-02T10:57:57.000Z | ; RANDOM functions
#include once <mul32.asm>
RANDOMIZE:
; Randomize with 32 bit seed in DE HL
; if SEED = 0, calls ROM to take frames as seed
PROC
LOCAL TAKE_FRAMES
LOCAL FRAMES
ld a, h
or l
or d
or e
jr z, TAKE_FRAMES
ld (RANDOM_SEED_LOW), hl
ld (RANDOM_SEED_HIGH), de
ret
TAKE_FRAMES:
; Takes the seed from frames
ld hl, (FRAMES)
ld (RANDOM_SEED_LOW), hl
ld hl, (FRAMES + 2)
ld (RANDOM_SEED_HIGH), hl
ret
FRAMES EQU 23672
ENDP
RANDOM_SEED_HIGH: ; RANDOM seed, 16 higher bits
DEFW 0000h ; HIGH RANDOM SEED
RANDOM_SEED_LOW EQU 23670 ; RANDOM seed, 16 lower bits
RAND:
; Returns a 32 bit random integer based on seed.
; This is a very fast and interesting generator
; See Numerical Recipes, 2nd ED
ld de, 25
ld hl, 26125
push de
push hl ; PUSH 32bit value 1664525
ld de, (RANDOM_SEED_HIGH)
ld hl, (RANDOM_SEED_LOW)
call __MUL32 ; DE HL = 166425 * SEED
ld bc, 62303 ; DEHL = 1013904223 = 15470 * 65536 + 62303
add hl, bc
ld (RANDOM_SEED_LOW), hl
ex de, hl
ld bc, 15470
adc hl, bc
ld (RANDOM_SEED_HIGH), hl
ex de, hl
ret
RND:
; Returns a FLOATING point integer
; using RAND as a mantissa
PROC
LOCAL RND_LOOP
LOCAL RND_END
call RAND
ld a, d
or e
or h
or l
ld b, h
ld c, l
ret z ; Return 0 if 0
; We already have a random 32 bit mantissa in ED CB
ld l, 81h ; Exponent
set 7, e ; Recover highest mantissa bit
; At this point we have 1 .. 2) FP number;
; We subtract 1 to obtain the 0..1) Range
; To subtract 1, we only have to subtract the highest byte (40h)
ld a, e
sub 40h
ld e, a
; Now we must shift left until highest bit is 1
RND_LOOP:
dec l
sla b
rl c
rl d
rla
jp p, RND_LOOP ; Loop if bit 7 is not one
RND_END:
and 7Fh ; Clear highest bit (positive sign)
ld e, a
ld a, l ; saves exponent in A
ret
ENDP
| 16.678899 | 65 | 0.680968 |
51f76070681f3bd4d16899f0a33ce95862053e4d | 618 | asm | Assembly | oeis/069/A069477.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/069/A069477.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/069/A069477.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A069477: a(n) = 60*n^2 + 180*n + 150.
; Submitted by Christian Krause
; 390,750,1230,1830,2550,3390,4350,5430,6630,7950,9390,10950,12630,14430,16350,18390,20550,22830,25230,27750,30390,33150,36030,39030,42150,45390,48750,52230,55830,59550,63390,67350,71430,75630,79950,84390,88950,93630,98430,103350,108390,113550,118830,124230,129750,135390,141150,147030,153030,159150,165390,171750,178230,184830,191550,198390,205350,212430,219630,226950,234390,241950,249630,257430,265350,273390,281550,289830,298230,306750,315390,324150,333030,342030,351150,360390,369750,379230
add $0,3
bin $0,2
sub $0,3
mul $0,120
add $0,390
| 61.8 | 495 | 0.794498 |
abaab1055413b79aa110ca311b3ddc793ca266f9 | 679 | asm | Assembly | libsrc/_DEVELOPMENT/stdio/c/sdcc_ix/vfscanf_callee.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/stdio/c/sdcc_ix/vfscanf_callee.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/stdio/c/sdcc_ix/vfscanf_callee.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
; int vfscanf_callee(FILE *stream, const char *format, void *arg)
INCLUDE "clib_cfg.asm"
SECTION code_stdio
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
IF __CLIB_OPT_MULTITHREAD & $02
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
PUBLIC _vfscanf_callee, l0_vfscanf_callee
EXTERN asm_vfscanf
_vfscanf_callee:
pop af
pop hl
pop de
pop bc
push af
l0_vfscanf_callee:
push hl
ex (sp),ix
call asm_vfscanf
pop ix
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ELSE
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
PUBLIC _vfscanf_callee
EXTERN _vfscanf_unlocked_callee
defc _vfscanf_callee = _vfscanf_unlocked_callee
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ENDIF
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
| 14.446809 | 65 | 0.531664 |
b54abc09b692e183b4dd189ecece9ecb61ee547e | 273 | asm | Assembly | libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sccz80/esx_f_opendir_ex.asm | Toysoft/z88dk | f930bef9ac4feeec91a07303b79ddd9071131a24 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sccz80/esx_f_opendir_ex.asm | Toysoft/z88dk | f930bef9ac4feeec91a07303b79ddd9071131a24 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sccz80/esx_f_opendir_ex.asm | Toysoft/z88dk | f930bef9ac4feeec91a07303b79ddd9071131a24 | [
"ClArtistic"
] | null | null | null | ; unsigned char esx_f_opendir_ex(unsigned char *dirname,uint8_t mode)
SECTION code_esxdos
PUBLIC esx_f_opendir_ex
EXTERN asm_esx_f_opendir_ex
esx_f_opendir_ex:
pop af
pop bc
pop hl
push hl
push bc
push af
ld b,c
jp asm_esx_f_opendir_ex
| 13 | 69 | 0.728938 |
daaaf6c54cc79eba0b72a9656a9c09901017bf3c | 299 | asm | Assembly | programs/oeis/023/A023808.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/023/A023808.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/023/A023808.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A023808: Xenodromes: all digits in base 14 are different.
; 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,31,32,33,34,35,36,37,38,39,40,41,42,43,44,46,47,48,49,50,51,52,53,54,55,56,57,58,59,61,62,63,64,65,66,67,68,69,70,71,72
mov $1,$0
sub $0,1
div $0,14
add $1,$0
| 37.375 | 198 | 0.652174 |
dd011c6ee796a3e8f432b6378f127845781ccf4c | 1,937 | asm | Assembly | programs/oeis/053/A053698.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/053/A053698.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/053/A053698.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A053698: a(n) = n^3 + n^2 + n + 1.
; 1,4,15,40,85,156,259,400,585,820,1111,1464,1885,2380,2955,3616,4369,5220,6175,7240,8421,9724,11155,12720,14425,16276,18279,20440,22765,25260,27931,30784,33825,37060,40495,44136,47989,52060,56355,60880,65641,70644,75895,81400,87165,93196,99499,106080,112945,120100,127551,135304,143365,151740,160435,169456,178809,188500,198535,208920,219661,230764,242235,254080,266305,278916,291919,305320,319125,333340,347971,363024,378505,394420,410775,427576,444829,462540,480715,499360,518481,538084,558175,578760,599845,621436,643539,666160,689305,712980,737191,761944,787245,813100,839515,866496,894049,922180,950895,980200,1010101,1040604,1071715,1103440,1135785,1168756,1202359,1236600,1271485,1307020,1343211,1380064,1417585,1455780,1494655,1534216,1574469,1615420,1657075,1699440,1742521,1786324,1830855,1876120,1922125,1968876,2016379,2064640,2113665,2163460,2214031,2265384,2317525,2370460,2424195,2478736,2534089,2590260,2647255,2705080,2763741,2823244,2883595,2944800,3006865,3069796,3133599,3198280,3263845,3330300,3397651,3465904,3535065,3605140,3676135,3748056,3820909,3894700,3969435,4045120,4121761,4199364,4277935,4357480,4438005,4519516,4602019,4685520,4770025,4855540,4942071,5029624,5118205,5207820,5298475,5390176,5482929,5576740,5671615,5767560,5864581,5962684,6061875,6162160,6263545,6366036,6469639,6574360,6680205,6787180,6895291,7004544,7114945,7226500,7339215,7453096,7568149,7684380,7801795,7920400,8040201,8161204,8283415,8406840,8531485,8657356,8784459,8912800,9042385,9173220,9305311,9438664,9573285,9709180,9846355,9984816,10124569,10265620,10407975,10551640,10696621,10842924,10990555,11139520,11289825,11441476,11594479,11748840,11904565,12061660,12220131,12379984,12541225,12703860,12867895,13033336,13200189,13368460,13538155,13709280,13881841,14055844,14231295,14408200,14586565,14766396,14947699,15130480,15314745,15500500
mov $1,$0
mul $1,$0
add $1,1
mul $0,$1
add $1,$0
| 215.222222 | 1,849 | 0.845638 |
dd7cf77d7f4dc51ebc34b89a0fec0c1f5240b75e | 4,304 | asm | Assembly | libsrc/_DEVELOPMENT/l/sccz80/8-8080/i32/l_long_div_u.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 4 | 2021-12-23T15:34:05.000Z | 2021-12-23T15:36:16.000Z | libsrc/_DEVELOPMENT/l/sccz80/8-8080/i32/l_long_div_u.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/l/sccz80/8-8080/i32/l_long_div_u.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | null | null | null | ; Z88 Small C+ Run Time Library
; Long functions
;
; feilipu 10/2021
SECTION code_clib
SECTION code_l_sccz80
PUBLIC l_long_div_u, l_long_div_u_0
EXTERN l_long_rl_mde, l_long_rl_mhl, l_long_cp_mhl, l_long_sub_mhl
;quotient = primary / secondary
;enter with secondary (divisor) in dehl, primary (dividend | quotient) on stack
;exit with quotient in dehl
.l_long_div_u
ld a,d ;check for divide by zero
or e
or h
or l ;clear Carry to quotient
jp Z, divide_by_zero
push de ;put secondary (divisor) on stack
push hl
ld bc,0 ;establish remainder on stack
push bc
push bc
push bc ;save null sign info
call l_long_div_u_0 ;unsigned division
;tidy up with quotient to dehl
ld hl,sp+14 ;get quotient MSW
ld c,(hl)
inc hl
ld b,(hl)
ld hl,sp+10 ;get return from stack
ld e,(hl)
inc hl
ld d,(hl)
ld hl,sp+14 ;place return on stack
ld (hl),e
inc hl
ld (hl),d
ld hl,sp+2 ;get remainder LSB (for __printf_number)
ld a,(hl)
ld hl,sp+12 ;get quotient LSW
ld e,(hl)
inc hl
ld d,(hl)
; ld hl,sp+14
inc hl ;point to return again
ld sp,hl ;remove stacked parameters
ex de,hl ;quotient LSW
ld de,bc ;quotient MSW
ret
.l_long_div_u_0
ld b,32 ;set up div_loop counter
.div_loop
rra ;save Carry
ld hl,sp+4 ;remainder (hl)
ex de,hl
ld hl,sp+14 ;dividend (hl)
rla ;restore Carry
IF 1
call l_long_rl_mhl ;rotate left dividend + quotient Carry
call l_long_rl_mde ;rotate left remainder + dividend Carry
ld hl,sp+4 ;compare (remainder - divisor)
ex de,hl
ld hl,sp+8
call l_long_cp_mhl
jp C,skip_subtract ;skip if remainder < divisor
ld hl,sp+4 ;subtract (remainder - divisor)
ex de,hl
ld hl,sp+8
call l_long_sub_mhl
ELSE
;rotate left dividend + quotient Carry
ld a,(hl)
rla
ld (hl),a
inc hl
ld a,(hl)
rla
ld (hl),a
inc hl
ld a,(hl)
rla
ld (hl),a
inc hl
ld a,(hl)
rla
ld (hl),a
;rotate left remainder + dividend Carry
ld a,(de)
rla
ld (de),a
inc de
ld a,(de)
rla
ld (de),a
inc de
ld a,(de)
rla
ld (de),a
inc de
ld a,(de)
rla
ld (de),a
;compare (remainder - divisor)
ld hl,sp+4
ex de,hl
ld hl,sp+8
ld a,(de)
sub a,(hl)
inc de
inc hl
ld a,(de)
sbc a,(hl)
inc de
inc hl
ld a,(de)
sbc a,(hl)
inc de
inc hl
ld a,(de)
sbc a,(hl)
jp C,skip_subtract ;skip if remainder < divisor
;subtract (remainder - divisor)
ld hl,sp+4
ex de,hl
ld hl,sp+8
ld a,(de)
sub a,(hl)
ld (de),a
inc de
inc hl
ld a,(de)
sbc a,(hl)
ld (de),a
inc de
inc hl
ld a,(de)
sbc a,(hl)
ld (de),a
inc de
inc hl
ld a,(de)
sbc a,(hl)
ld (de),a
ENDIF
.skip_subtract
ccf ;prepare Carry for quotient
dec b
jp NZ,div_loop
rra ;save Carry
ld hl,sp+14
rla ;restore Carry
call l_long_rl_mhl ;rotate left quotient Carry
ret
.divide_by_zero
pop bc ;pop return
pop hl ;pop dividend
pop de
push bc ;replace return
ld de,$ffff ;return ULONG_MAX
ld hl,de
ret
| 21.306931 | 79 | 0.448652 |
ae45353a56f395e9602c5d50b21eb27a16904493 | 212 | asm | Assembly | tests/nasm/emms.asm | Tuna0128/Tuna0128.github.io | 7976c8236209a09f82fddd7c74ebcec86119d491 | [
"BSD-2-Clause-FreeBSD"
] | 12,700 | 2015-01-04T15:03:42.000Z | 2022-03-31T06:43:06.000Z | tests/nasm/emms.asm | Tuna0128/Tuna0128.github.io | 7976c8236209a09f82fddd7c74ebcec86119d491 | [
"BSD-2-Clause-FreeBSD"
] | 566 | 2015-01-01T18:16:40.000Z | 2022-03-31T19:59:10.000Z | tests/nasm/emms.asm | Tuna0128/Tuna0128.github.io | 7976c8236209a09f82fddd7c74ebcec86119d491 | [
"BSD-2-Clause-FreeBSD"
] | 1,182 | 2015-01-05T09:20:48.000Z | 2022-03-31T12:16:52.000Z | global _start
section .data
align 16
myquad:
dq 0xad0000ceadad00ff
mydword:
dd 0xcafebabe
myaddress:
dq 0x00adbeefc0de00ce
%include "header.inc"
emms
; TODO: Check tag word
%include "footer.inc"
| 11.777778 | 30 | 0.735849 |
78fdd71cea957967abec8eb5684a0384d44dc210 | 1,076 | asm | Assembly | programs/oeis/020/A020721.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/020/A020721.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/020/A020721.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A020721: Pisot sequences E(7,10), P(7,10).
; 7,10,14,20,29,42,61,89,130,190,278,407,596,873,1279,1874,2746,4024,5897,8642,12665,18561,27202,39866,58426,85627,125492,183917,269543,395034,578950,848492,1243525,1822474,2670965,3914489,5736962,8407926,12322414,18059375,26467300,38789713,56849087,83316386,122106098,178955184,262271569,384377666,563332849,825604417,1209982082,1773314930,2598919346,3808901427,5582216356,8181135701,11990037127,17572253482,25753389182,37743426308,55315679789,81069068970,118812495277,174128175065,255197244034,374009739310,548137914374,803335158407,1177344897716,1725482812089,2528817970495,3706162868210,5431645680298,7960463650792,11666626519001,17098272199298,25058735850089,36725362369089,53823634568386,78882370418474,115607732787562,169431367355947,248313737774420,363921470561981,533352837917927,781666575692346,1145588046254326,1678940884172252,2460607459864597,3606195506118922,5285136390291173,7745743850155769
add $0,4
lpb $0
sub $0,1
trn $2,$3
add $2,$4
mov $4,$3
sub $3,$3
add $3,$1
add $1,$2
add $1,1
lpe
add $1,2
| 67.25 | 906 | 0.835502 |
f5768b25e50ba393b8d1ec3a57fa257439df70e0 | 6,113 | asm | Assembly | src/shaders/h264/ildb/Transpose_Cur_Y_4x16.asm | martin-kokos/intel-vaapi-driver | 3ed3f6a783fdfff3fa1b567888518dcbda7eb2a3 | [
"MIT"
] | 192 | 2018-01-26T11:51:55.000Z | 2022-03-25T20:04:19.000Z | src/shaders/h264/ildb/Transpose_Cur_Y_4x16.asm | martin-kokos/intel-vaapi-driver | 3ed3f6a783fdfff3fa1b567888518dcbda7eb2a3 | [
"MIT"
] | 256 | 2017-01-23T02:10:27.000Z | 2018-01-23T10:00:05.000Z | src/shaders/h264/ildb/Transpose_Cur_Y_4x16.asm | martin-kokos/intel-vaapi-driver | 3ed3f6a783fdfff3fa1b567888518dcbda7eb2a3 | [
"MIT"
] | 64 | 2018-01-30T19:51:53.000Z | 2021-11-24T01:26:14.000Z | /*
* Copyright © <2010>, Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
* IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* This file was originally licensed under the following license
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
//////////////////////////////////////////////////////////////////////////////////////////
// Module name: Transpose_Y_4x16.asm
//
// Transpose a 4x16 internal planar to 16x4 internal planar block.
// The src block is 16x16. Right moft 4 columns are transposed.
//
//----------------------------------------------------------------------------------------
// Symbols need to be defined before including this module
//
// Source region is :ub
// SRC_YB: SRC_YB Base=rxx ElementSize=1 SrcRegion=REGION(16,1) Type=ub // 8 GRFs
//
// Temp buffer:
// BUF_B: BUF_B Base=rxx ElementSize=1 SrcRegion=REGION(16,1) Type=ub // 8 GRFs
//
//////////////////////////////////////////////////////////////////////////////////////////
#if defined(_DEBUG)
mov (1) EntrySignatureC:w 0xDDDB:w
#endif
// Transpose Y (4x16) right most 4 columns
// +-----------------------+-----------------------+-----------------------+-----------------------+
// |1f 1e 1d 1c 1b 1a 19 18 17 16 15 14 13 12 11 10 0f 0e 0d 0c 0b 0a 09 08 07 06 05 04 03 02 01 00|
// +-----------------------+-----------------------+-----------------------+-----------------------+
// |3f 3e 3d 3c 3b 3a 39 38 37 36 35 34 33 32 31 30 2f 2e 2d 2c 2b 2a 29 28 27 26 25 24 23 22 21 20|
// +-----------------------+-----------------------+-----------------------+-----------------------+
// |5f 5e 5d 5c 5b 5a 59 58 57 56 55 54 53 52 51 50 4f 4e 4d 4c 4b 4a 49 48 47 46 45 44 43 42 41 40|
// +-----------------------+-----------------------+-----------------------+-----------------------+
// |7f 7e 7d 7c 7b 7a 79 78 77 76 75 74 73 72 71 70 6f 6e 6d 6c 6b 6a 69 68 67 66 65 64 63 62 61 60|
// +-----------------------+-----------------------+-----------------------+-----------------------+
// |9f 9e 9d 9c 9b 9a 99 98 97 96 95 94 93 92 91 90 8f 8e 8d 8c 8b 8a 89 88 87 86 85 84 83 82 81 80|
// +-----------------------+-----------------------+-----------------------+-----------------------+
// |bf be bd bc bb ba b9 b8 b7 b6 b5 b4 b3 b2 b1 b0 af ae ad ac ab aa a9 a8 a7 a6 a5 a4 a3 a2 a1 a0|
// +-----------------------+-----------------------+-----------------------+-----------------------+
// |df de dd dc db da d9 d8 d7 d6 d5 d4 d3 d2 d1 d0 cf ce cd cc cb ca c9 c8 c7 c6 c5 c4 c3 c2 c1 c0|
// +-----------------------+-----------------------+-----------------------+-----------------------+
// |ff fe fd fc fb fa f9 f8 f7 f6 f5 f4 f3 f2 f1 f0 ef ee ed ec eb ea e9 e8 e7 e6 e5 e4 e3 e2 e1 e0|
// +-----------------------+-----------------------+-----------------------+-----------------------+
// The first step
// +-----------------------+-----------------------+-----------------------+-----------------------+
// |7f 7e 7d 7c 6f 6e 6d 6c 5f 5e 5d 5c 4f 4e 4d 4c 3f 3e 3d 3c 2f 2e 2d 2c 1f 1e 1d 1c 0f 0e 0d 0c|
// +-----------------------+-----------------------+-----------------------+-----------------------+
// |ff fe fd fc ef ee ed ec df de dd dc cf ce cd cc bf be bd bc af ae ad ac 9f 9e 9d 9c 8f 8e 8d 8c|
// +-----------------------+-----------------------+-----------------------+-----------------------+
// The second step
// +-----------------------+-----------------------+-----------------------+-----------------------+
// |fd ed dd cd bd ad 9d 8d 7d 6d 5d 4d 3d 2d 1d 0d fc ec dc cc bc ac 9c 8c 7c 6c 5c 4c 3c 2c 1c 0c|
// +-----------------------+-----------------------+-----------------------+-----------------------+
// |ff ef df cf bf af 9f 8f 7f 6f 5f 4f 3f 2f 1f 0f fe ee de ce be ae 9e 8e 7e 6e 5e 4e 3e 2e 1e 0e|
// +-----------------------+-----------------------+-----------------------+-----------------------+
mov (16) LEFT_TEMP_B(0,0)<1> SRC_YB(0,12)<16;4,1> { NoDDClr }
mov (16) LEFT_TEMP_B(0,16)<1> SRC_YB(2,12)<16;4,1> { NoDDChk }
mov (16) LEFT_TEMP_B(1,0)<1> SRC_YB(4,12)<16;4,1> { NoDDClr }
mov (16) LEFT_TEMP_B(1,16)<1> SRC_YB(6,12)<16;4,1> { NoDDChk }
// The second step
mov (16) LEFT_TEMP_B(2,0)<1> LEFT_TEMP_B(0,0)<32;8,4> { NoDDClr }
mov (16) LEFT_TEMP_B(2,16)<1> LEFT_TEMP_B(0,1)<32;8,4> { NoDDChk }
mov (16) LEFT_TEMP_B(3,0)<1> LEFT_TEMP_B(0,2)<32;8,4> { NoDDClr }
mov (16) LEFT_TEMP_B(3,16)<1> LEFT_TEMP_B(0,3)<32;8,4> { NoDDChk }
// Y is now transposed. the result is in LEFT_TEMP_B(2) and LEFT_TEMP_B(3).
| 57.669811 | 101 | 0.482087 |
82792b2ebe3598a86595efcdca881e8e53b207a6 | 502 | asm | Assembly | programs/oeis/076/A076509.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/076/A076509.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/076/A076509.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A076509: Expansion of 3*x*(1-x)*(1+2*x+6*x^2)/(1-24*x^3).
; 3,3,12,54,72,288,1296,1728,6912,31104,41472,165888,746496,995328,3981312,17915904,23887872,95551488,429981696,573308928,2293235712,10319560704,13759414272,55037657088,247669456896,330225942528
add $0,1
max $0,2
seq $0,76507 ; Three people (P1, P2, P3) are in a circle and are saying Hello to each other. They start with P2 saying "Hello, Hello". Thereafter Pn says "Hello" for n times the total number of Hello's so far.
div $0,8
mul $0,3
| 55.777778 | 209 | 0.74502 |
9ad53fb983e651e27d7329fd02d2807571d73bc6 | 1,381 | asm | Assembly | programs/oeis/184/A184550.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/184/A184550.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/184/A184550.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A184550: Super-birthdays (falling on the same weekday), version 2 (birth within 1 and 2 years after a February 29).
; 0,6,11,17,28,34,39,45,56,62,67,73,84,90,95,101,112,118,123,129,140,146,151,157,168,174,179,185,196,202,207,213,224,230,235,241,252,258,263,269,280,286,291,297,308,314,319,325,336,342,347,353,364,370,375,381,392,398,403,409,420,426,431,437,448,454,459,465,476,482,487,493,504,510,515,521,532,538,543,549,560,566,571,577,588,594,599,605,616,622,627,633,644,650,655,661,672,678,683,689,700,706,711,717,728,734,739,745,756,762,767,773,784,790,795,801,812,818,823,829,840,846,851,857,868,874,879,885,896,902,907,913,924,930,935,941,952,958,963,969,980,986,991,997,1008,1014,1019,1025,1036,1042,1047,1053,1064,1070,1075,1081,1092,1098,1103,1109,1120,1126,1131,1137,1148,1154,1159,1165,1176,1182,1187,1193,1204,1210,1215,1221,1232,1238,1243,1249,1260,1266,1271,1277,1288,1294,1299,1305,1316,1322,1327,1333,1344,1350,1355,1361,1372,1378,1383,1389,1400,1406,1411,1417,1428,1434,1439,1445,1456,1462,1467,1473,1484,1490,1495,1501,1512,1518,1523,1529,1540,1546,1551,1557,1568,1574,1579,1585,1596,1602,1607,1613,1624,1630,1635,1641,1652,1658,1663,1669,1680,1686,1691,1697,1708,1714,1719,1725,1736,1742
mov $2,$0
lpb $0,1
mov $3,$0
lpb $3,1
sub $0,2
add $1,7
mov $3,3
lpe
trn $0,2
add $4,1
add $1,$4
mov $4,0
lpe
lpb $2,1
add $1,5
sub $2,1
lpe
| 65.761905 | 1,090 | 0.729182 |
a5e2554a392032041c0e188baf9d361b09148d09 | 546 | asm | Assembly | oeis/120/A120656.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/120/A120656.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/120/A120656.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A120656: 6 X 6 trigonal prism bonding graph matrix Markov: this molecular structure is the major symmetry between the tetrahedron and cube: characteristic polynomial:12 x^2 - 4 x^3 - 9 x^4 + x^6.
; Submitted by Jon Maiga
; 0,4,18,50,166,474,1478,4330,13206,39194,118438,353610,1064246,3185914,9571398,28686890,86115286,258236634,774928358,2324348170,6973918326,20920007354,62763517318,188283561450,564864665366,1694566034074
mov $3,1
lpb $0
sub $0,1
mov $2,$3
mul $2,6
mov $3,4
add $3,$1
add $1,$2
lpe
add $1,$2
mov $0,$1
div $0,3
| 32.117647 | 203 | 0.738095 |
bd698f147633d47bfdb73e1868443f7faaf4702e | 311 | asm | Assembly | oeis/021/A021439.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/021/A021439.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/021/A021439.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A021439: Decimal expansion of 1/435.
; Submitted by Jon Maiga
; 0,0,2,2,9,8,8,5,0,5,7,4,7,1,2,6,4,3,6,7,8,1,6,0,9,1,9,5,4,0,2,2,9,8,8,5,0,5,7,4,7,1,2,6,4,3,6,7,8,1,6,0,9,1,9,5,4,0,2,2,9,8,8,5,0,5,7,4,7,1,2,6,4,3,6,7,8,1,6,0,9,1,9,5,4,0,2,2,9,8,8,5,0,5,7,4,7,1,2
seq $0,199689 ; 8*10^n+1
div $0,348
mod $0,10
| 38.875 | 199 | 0.562701 |
dacd8d48be2491d8550a1a8618bcf544da944fe1 | 838 | asm | Assembly | oeis/211/A211421.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/211/A211421.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/211/A211421.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A211421: Integral factorial ratio sequence: a(n) = (8*n)!*(3*n)!/((6*n)!*(4*n)!*n!).
; Submitted by Jon Maiga
; 1,14,390,12236,404550,13777764,478273692,16825310040,597752648262,21397472070260,770557136489140,27884297395587240,1013127645555452700,36935287875280348776,1350441573221798941560,49498889739033621986736,1818284097150186829038150,66920769700528547057908500,2467167492130768182080453700,91095235149726756910334373000,3368099426962326804363735573300,124683505899828792470448523810104,4620814774829824363618645711873800,171423637044076905982892148876150480,6365433935222442622152802301782499100
mov $1,1
mov $2,1
mov $3,$0
mul $3,2
lpb $3
mul $1,$0
mul $1,6
sub $3,1
mul $2,$3
add $1,$2
mov $2,$1
mov $4,$5
cmp $4,0
add $5,$4
div $1,$5
div $2,$5
add $2,$1
mul $1,2
sub $3,1
add $5,1
lpe
mov $0,$2
| 31.037037 | 492 | 0.763723 |
40f719dd5998a2395a89ebb183ff0cfd8f17ed57 | 345 | asm | Assembly | programs/oeis/095/A095827.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/095/A095827.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/095/A095827.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A095827: a(n) is the smallest k such that ((A007953)^k)(9n)=9.
; 0,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,2,2,2,1,1,1,1,1,1,1,2,2,2,2,1,1,1,1,1,1,2,2,2,2,2,1,1,1,1,1,2,2,2,2,2,2,1,1,1,1,2,2,2,2,2,2,2,1,1,1,2,2,2,2,2,2,2,2,1,1,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2
mov $2,$0
mul $0,2
lpb $0,1
sub $0,$2
div $0,10
add $1,1
lpe
| 31.363636 | 211 | 0.524638 |
0019d406ff87dd1408a4cc1314aa6b9355e72003 | 173 | asm | Assembly | solutions/28 - Neural Pathways/size-4_speed-51.asm | behrmann/7billionhumans | 36d53daf278ef4f3729bc5cba2f2398d5411bd6d | [
"MIT"
] | 45 | 2018-09-05T04:56:59.000Z | 2021-11-22T08:57:26.000Z | solutions/28 - Neural Pathways/size-4_speed-51.asm | behrmann/7billionhumans | 36d53daf278ef4f3729bc5cba2f2398d5411bd6d | [
"MIT"
] | 36 | 2018-09-01T11:34:26.000Z | 2021-05-19T23:20:49.000Z | solutions/28 - Neural Pathways/size-4_speed-51.asm | behrmann/7billionhumans | 36d53daf278ef4f3729bc5cba2f2398d5411bd6d | [
"MIT"
] | 36 | 2018-09-01T07:44:19.000Z | 2021-09-10T19:07:35.000Z | -- 7 Billion Humans (2053) --
-- 28: Neural Pathways --
-- Author: soerface
-- Size: 4
-- Speed: 51
mem1 = nearest shredder
mem2 = nearest datacube
pickup mem2
giveto mem1 | 15.727273 | 29 | 0.682081 |
f30d1096abd0491b476a98bf49410118cc996843 | 1,241 | asm | Assembly | strCbyC.asm | ahmedibrahimq/asm | 474128a2d2201a53c1631a3dd0117f4297ddf97e | [
"MIT"
] | null | null | null | strCbyC.asm | ahmedibrahimq/asm | 474128a2d2201a53c1631a3dd0117f4297ddf97e | [
"MIT"
] | null | null | null | strCbyC.asm | ahmedibrahimq/asm | 474128a2d2201a53c1631a3dd0117f4297ddf97e | [
"MIT"
] | 1 | 2021-08-28T19:04:21.000Z | 2021-08-28T19:04:21.000Z | page 60,132
TITLE INPUT SRING (char by char) & PRINT IT
.MODEL SMALL
.STACK
.DATA
_Name DB 30 dup("$")
.CODE
MAIN PROC FAR
MOV AX,@DATA
MOV DS,AX
;------------
MOV SI,0 ; to index array's (_Name) items
MOV CL,0 ; to count length of input (to know how many times it will print)
READCHAR:
MOV AH, 10H
INT 16H
MOV _NAME+SI, AL ; store inputted character before overriding AL
INC SI
INC CL
CMP AL,13 ; (13 => ASCII of Break -enter- Key) stop when enter is pressed
JE BREAKLN
CMP SI,30 ; (30-1 => is the last index of _NAME)
JL READCHAR ; stop if index out of range
BREAKLN :
MOV SI,0 ; indexing from _Name[0] to _Name[CL]
PRINT:
MOV AH,02H ; (02H => Displays character), (09H) displays from address [DX] to ... there's no '$'
MOV DL,_NAME +SI
INT 21H
INC SI
DEC CL ; holds number of inputted characters
JNZ PRINT ; stop printing at the last stored character
;------------
MOV AX,4C00H
INT 21H
MAIN ENDP
END MAIN
| 32.657895 | 112 | 0.510878 |
43816aedd564ada16d7a7d943db6dd3e1d064dfb | 567 | asm | Assembly | programs/oeis/181/A181972.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/181/A181972.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/181/A181972.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A181972: Number of integer pairs (x,y) such that 0<x<y<=n and x*y<=floor(n/2).
; 0,0,0,1,1,2,2,3,3,4,4,6,6,7,7,9,9,10,10,12,12,13,13,16,16,17,17,19,19,21,21,23,23,24,24,27,27,28,28,31,31,33,33,35,35,36,36,40,40,41,41,43,43,45,45,48,48,49,49,53,53,54,54,57,57,59,59,61,61,63,63,67
mov $29,$0
add $29,1
lpb $29
clr $0,27
sub $29,1
sub $0,$29
mov $2,$0
pow $0,2
div $0,2
mov $26,$2
cmp $26,0
add $2,$26
mod $0,$2
cal $0,5 ; d(n) (also called tau(n) or sigma_0(n)), the number of divisors of n.
mov $1,$0
div $1,2
add $28,$1
lpe
mov $1,$28
| 24.652174 | 200 | 0.583774 |
40318345428353a98aab12fce835e7ab48016f0e | 1,085 | asm | Assembly | _build/dispatcher/jmp_ippsAESEncryptOFB_cfa056da.asm | zyktrcn/ippcp | b0bbe9bbb750a7cf4af5914dd8e6776a8d544466 | [
"Apache-2.0"
] | 1 | 2021-10-04T10:21:54.000Z | 2021-10-04T10:21:54.000Z | _build/dispatcher/jmp_ippsAESEncryptOFB_cfa056da.asm | zyktrcn/ippcp | b0bbe9bbb750a7cf4af5914dd8e6776a8d544466 | [
"Apache-2.0"
] | null | null | null | _build/dispatcher/jmp_ippsAESEncryptOFB_cfa056da.asm | zyktrcn/ippcp | b0bbe9bbb750a7cf4af5914dd8e6776a8d544466 | [
"Apache-2.0"
] | null | null | null | extern m7_ippsAESEncryptOFB:function
extern n8_ippsAESEncryptOFB:function
extern y8_ippsAESEncryptOFB:function
extern e9_ippsAESEncryptOFB:function
extern l9_ippsAESEncryptOFB:function
extern n0_ippsAESEncryptOFB:function
extern k0_ippsAESEncryptOFB:function
extern ippcpJumpIndexForMergedLibs
extern ippcpSafeInit:function
segment .data
align 8
dq .Lin_ippsAESEncryptOFB
.Larraddr_ippsAESEncryptOFB:
dq m7_ippsAESEncryptOFB
dq n8_ippsAESEncryptOFB
dq y8_ippsAESEncryptOFB
dq e9_ippsAESEncryptOFB
dq l9_ippsAESEncryptOFB
dq n0_ippsAESEncryptOFB
dq k0_ippsAESEncryptOFB
segment .text
global ippsAESEncryptOFB:function (ippsAESEncryptOFB.LEndippsAESEncryptOFB - ippsAESEncryptOFB)
.Lin_ippsAESEncryptOFB:
db 0xf3, 0x0f, 0x1e, 0xfa
call ippcpSafeInit wrt ..plt
align 16
ippsAESEncryptOFB:
db 0xf3, 0x0f, 0x1e, 0xfa
mov rax, qword [rel ippcpJumpIndexForMergedLibs wrt ..gotpc]
movsxd rax, dword [rax]
lea r11, [rel .Larraddr_ippsAESEncryptOFB]
mov r11, qword [r11+rax*8]
jmp r11
.LEndippsAESEncryptOFB:
| 27.820513 | 95 | 0.797235 |
82de7583ebd36b78bb207a4d1156720533ce4e53 | 3,227 | asm | Assembly | nine/constants.asm | sgadrat/nine-gine | 67270342ac022c703d2ba64e9490c1b8fb76470a | [
"WTFPL"
] | 6 | 2018-05-22T16:19:36.000Z | 2021-03-28T22:11:10.000Z | nine/constants.asm | sgadrat/nine-gine | 67270342ac022c703d2ba64e9490c1b8fb76470a | [
"WTFPL"
] | null | null | null | nine/constants.asm | sgadrat/nine-gine | 67270342ac022c703d2ba64e9490c1b8fb76470a | [
"WTFPL"
] | null | null | null | #define INITIAL_GAME_STATE $00
#define TILENUM_NT_CHAR_0 #$04
#define CONTROLLER_BTN_A %10000000
#define CONTROLLER_BTN_B %01000000
#define CONTROLLER_BTN_SELECT %00100000
#define CONTROLLER_BTN_START %00010000
#define CONTROLLER_BTN_UP %00001000
#define CONTROLLER_BTN_DOWN %00000100
#define CONTROLLER_BTN_LEFT %00000010
#define CONTROLLER_BTN_RIGHT %00000001
#define ZERO_PAGE_GLOBAL_FIELDS_BEGIN $d0
#define AUDIO_CHANNEL_SQUARE $00
#define AUDIO_CHANNEL_TRIANGLE $01
#define PARTICLE_BLOCK_OFFSET_PARAM 0
#define PARTICLE_BLOCK_OFFSET_TILENUM 1
#define PARTICLE_BLOCK_OFFSET_TILEATTR 2
#define PARTICLE_BLOCK_OFFSET_POSITIONS 4
#define PARTICLE_POSITION_OFFSET_X_LSB 0
#define PARTICLE_POSITION_OFFSET_X_MSB 1
#define PARTICLE_POSITION_OFFSET_Y_LSB 2
#define PARTICLE_POSITION_OFFSET_Y_MSB 3
#define PARTICLE_BLOCK_SIZE 32
#define PARTICLE_BLOCK_NB_PARTICLES 7
#define PARTICLE_NB_BLOCKS 2
#define PARTICLE_FIRST_SPRITE 50
#define NOTE_O0_C $7ff
#define NOTE_O0_Cs $7ff
#define NOTE_O0_D $7ff
#define NOTE_O0_Ds $7ff
#define NOTE_O0_E $7ff
#define NOTE_O0_F $7ff
#define NOTE_O0_Fs $7ff
#define NOTE_O0_G $7ff
#define NOTE_O0_Gs $7d1
#define NOTE_O0_A $760
#define NOTE_O0_As $6f6
#define NOTE_O0_B $692
#define NOTE_O1_C $634
#define NOTE_O1_Cs $5da
#define NOTE_O1_D $586
#define NOTE_O1_Ds $537
#define NOTE_O1_E $4ec
#define NOTE_O1_F $4a5
#define NOTE_O1_Fs $462
#define NOTE_O1_G $423
#define NOTE_O1_Gs $3e8
#define NOTE_O1_A $3b0
#define NOTE_O1_As $37b
#define NOTE_O1_B $349
#define NOTE_O2_C $319
#define NOTE_O2_Cs $2ed
#define NOTE_O2_D $2c3
#define NOTE_O2_Ds $29b
#define NOTE_O2_E $276
#define NOTE_O2_F $252
#define NOTE_O2_Fs $231
#define NOTE_O2_G $211
#define NOTE_O2_Gs $1f3
#define NOTE_O2_A $1d7
#define NOTE_O2_As $1bd
#define NOTE_O2_B $1a4
#define NOTE_O3_C $18c
#define NOTE_O3_Cs $176
#define NOTE_O3_D $161
#define NOTE_O3_Ds $14d
#define NOTE_O3_E $13a
#define NOTE_O3_F $129
#define NOTE_O3_Fs $118
#define NOTE_O3_G $108
#define NOTE_O3_Gs $0f9
#define NOTE_O3_A $0eb
#define NOTE_O3_As $0de
#define NOTE_O3_B $0d1
#define NOTE_O4_C $0c6
#define NOTE_O4_Cs $0ba
#define NOTE_O4_D $0b0
#define NOTE_O4_Ds $0a6
#define NOTE_O4_E $09d
#define NOTE_O4_F $094
#define NOTE_O4_Fs $08b
#define NOTE_O4_G $084
#define NOTE_O4_Gs $07c
#define NOTE_O4_A $075
#define NOTE_O4_As $06e
#define NOTE_O4_B $068
#define NOTE_O5_C $062
#define NOTE_O5_Cs $05d
#define NOTE_O5_D $057
#define NOTE_O5_Ds $052
#define NOTE_O5_E $04e
#define NOTE_O5_F $049
#define NOTE_O5_Fs $045
#define NOTE_O5_G $041
#define NOTE_O5_Gs $03e
#define NOTE_O5_A $03a
#define NOTE_O5_As $037
#define NOTE_O5_B $034
#define NOTE_O6_C $031
#define NOTE_O6_Cs $02e
#define NOTE_O6_D $02b
#define NOTE_O6_Ds $029
#define NOTE_O6_E $026
#define NOTE_O6_F $024
#define NOTE_O6_Fs $022
#define NOTE_O6_G $020
#define NOTE_O6_Gs $01e
#define NOTE_O6_A $01d
#define NOTE_O6_As $01b
#define NOTE_O6_B $019
#define NOTE_O7_C $018
#define NOTE_O7_Cs $016
#define NOTE_O7_D $015
#define NOTE_O7_Ds $014
#define NOTE_O7_E $013
#define NOTE_O7_F $012
#define NOTE_O7_Fs $011
#define NOTE_O7_G $010
#define NOTE_O7_Gs $00f
#define NOTE_O7_A $00e
#define NOTE_O7_As $00d
#define NOTE_O7_B $00c
#define TILE_SAMPLE $00
| 24.823077 | 41 | 0.806012 |
eeb76c6f43b7464598c37c1564d9915ecb1c617e | 1,291 | asm | Assembly | libsrc/_DEVELOPMENT/stdlib/z80/asm_qsort.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/stdlib/z80/asm_qsort.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/stdlib/z80/asm_qsort.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | 1 | 2019-12-03T23:57:48.000Z | 2019-12-03T23:57:48.000Z |
; ===============================================================
; Nov 2014
; ===============================================================
;
; void qsort(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *))
;
; Sort the array using the comparison function supplied and
; the sorting algorithm indicated in clib_cfg.
;
; ===============================================================
INCLUDE "clib_cfg.asm"
SECTION code_clib
SECTION code_stdlib
PUBLIC asm_qsort
; enter : ix = int (*compar)(de=const void *, hl=const void *)
; bc = void *base
; hl = size_t nmemb
; de = size_t size
;
; exit : none
;
; if an error below occurs, no sorting is done.
;
; einval if size == 0
; einval if array size > 64k
; erange if array wraps 64k boundary
;
; uses : af, bc, de, hl, compare function
IF __CLIB_OPT_SORT = 0
; insertion sort selected
EXTERN asm_insertion_sort
defc asm_qsort = asm_insertion_sort
ENDIF
IF __CLIB_OPT_SORT = 1
; shellsort selected
EXTERN asm_shellsort
defc asm_qsort = asm_shellsort
ENDIF
IF __CLIB_OPT_SORT >= 2
; quicksort selected
EXTERN asm_quicksort
defc asm_qsort = asm_quicksort
ENDIF
| 21.881356 | 94 | 0.542215 |
0f13e0534f73902b5c0d2db9c27887c3e1f1378c | 930 | asm | Assembly | libsrc/_DEVELOPMENT/error/z80/error_enolck_mc.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/error/z80/error_enolck_mc.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/error/z80/error_enolck_mc.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | 1 | 2019-12-03T23:57:48.000Z | 2019-12-03T23:57:48.000Z |
INCLUDE "clib_cfg.asm"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
IF __CLIB_OPT_ERROR
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; verbose mode
SECTION code_clib
SECTION code_error
PUBLIC error_enolck_mc
EXTERN __ENOLCK, errno_mc
pop hl
error_enolck_mc:
; set hl = -1
; set carry flag
; set errno = ENOLCK
ld l,__ENOLCK
jp errno_mc
SECTION rodata_clib
SECTION rodata_error_strings
IF __CLIB_OPT_ERROR & $02
defb __ENOLCK
defm "ENOLCK - Attempt to lock failed"
defb 0
ELSE
defb __ENOLCK
defm "ENOLCK"
defb 0
ENDIF
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ELSE
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
SECTION code_clib
SECTION code_error
PUBLIC error_enolck_mc
EXTERN errno_mc
defc error_enolck_mc = errno_mc - 2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ENDIF
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
| 15 | 44 | 0.48172 |
8c880442a9b577f787763bddedf8fbde31e0044e | 420 | asm | Assembly | programs/oeis/105/A105471.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/105/A105471.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/105/A105471.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A105471: a(n) = Fibonacci(n) mod 100.
; Coded manually 2021-03-31 by Simon Strandgaard, https://github.com/neoneye
; 0,1,1,2,3,5,8,13,21,34,55,89,44,33,77,10,87,97,84,81,65,46,11,57,68,25,93,18,11,29,40,69,9,78,87,65,52,17,69,86,55,41,96,37,33,70,3,73,76,49,25,74,99,73,72,45,17,62,79,41,20,61,81,42,23,65,88,53,41,94,35,29,64
mov $3,1
lpb $0
sub $0,1
mov $2,$1
add $1,$3
mod $1,100
mov $3,$2
lpe
mov $0,$1
| 30 | 211 | 0.633333 |
4ebd622c3e95c535ef63c1a7a240e56df512715a | 1,446 | asm | Assembly | Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_1_1044.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_1_1044.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_1_1044.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:
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r14
push %r8
push %rbx
push %rdx
push %rsi
// Store
lea addresses_RW+0xd000, %r12
nop
nop
nop
and $38761, %r8
mov $0x5152535455565758, %rsi
movq %rsi, (%r12)
nop
nop
sub %r13, %r13
// Load
lea addresses_D+0x19f00, %r13
nop
nop
nop
nop
nop
add %rdx, %rdx
mov (%r13), %r8w
sub %r13, %r13
// Store
lea addresses_A+0x3a00, %r13
clflush (%r13)
nop
nop
cmp $33299, %rbx
movl $0x51525354, (%r13)
nop
nop
sub %r8, %r8
// Faulty Load
lea addresses_A+0xa200, %rbx
nop
nop
nop
cmp $28026, %r14
mov (%rbx), %r12w
lea oracles, %rdx
and $0xff, %r12
shlq $12, %r12
mov (%rdx,%r12,1), %r12
pop %rsi
pop %rdx
pop %rbx
pop %r8
pop %r14
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_A', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_RW', 'same': False, 'AVXalign': False, 'congruent': 7}}
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_D', 'same': False, 'AVXalign': False, 'congruent': 7}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_A', 'same': False, 'AVXalign': False, 'congruent': 10}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_A', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'00': 1}
00
*/
| 17.634146 | 121 | 0.635546 |
27da0709227e3f5ef5b2fd1b37b6808bb3e078ac | 1,016 | asm | Assembly | data/pokemon/base_stats/bronzong.asm | AtmaBuster/pokeplat-gen2 | fa83b2e75575949b8f72cb2c48f7a1042e97f70f | [
"blessing"
] | 6 | 2021-06-19T06:41:19.000Z | 2022-02-15T17:12:33.000Z | data/pokemon/base_stats/bronzong.asm | AtmaBuster/pokeplat-gen2-old | 01e42c55db5408d72d89133dc84a46c699d849ad | [
"blessing"
] | null | null | null | data/pokemon/base_stats/bronzong.asm | AtmaBuster/pokeplat-gen2-old | 01e42c55db5408d72d89133dc84a46c699d849ad | [
"blessing"
] | 2 | 2021-08-11T19:47:07.000Z | 2022-01-01T07:07:56.000Z | db 0 ; species ID placeholder
db 67, 89, 116, 33, 79, 116
; hp atk def spd sat sdf
db STEEL, PSYCHIC ; type
db 90 ; catch rate
db 175 ; base exp
db NO_ITEM, METAL_COAT ; items
db GENDER_UNKNOWN ; gender ratio
db 20 ; step cycles to hatch
INCBIN "gfx/pokemon/bronzong/front.dimensions"
db GROWTH_MEDIUM_FAST ; growth rate
dn EGG_MINERAL, EGG_MINERAL ; egg groups
db 70 ; happiness
; tm/hm learnset
tmhm CALM_MIND, TOXIC, HIDDEN_POWER, SUNNY_DAY, HYPER_BEAM, LIGHT_SCREEN, PROTECT, RAIN_DANCE, SAFEGUARD, FRUSTRATION, SOLARBEAM, EARTHQUAKE, RETURN, PSYCHIC_M, SHADOW_BALL, DOUBLE_TEAM, REFLECT, SANDSTORM, ROCK_TOMB, FACADE, SECRET_POWER, REST, SKILL_SWAP, CHARGE_BEAM, ENDURE, EXPLOSION, PAYBACK, RECYCLE, GIGA_IMPACT, ROCK_POLISH, FLASH, GYRO_BALL, STEALTH_ROCK, PSYCH_UP, ROCK_SLIDE, SLEEP_TALK, NATURAL_GIFT, DREAM_EATER, GRASS_KNOT, SWAGGER, SUBSTITUTE, FLASH_CANNON, TRICK_ROOM, STRENGTH, ROCK_SMASH, ANCIENTPOWER, IRON_HEAD, ROLLOUT, SIGNAL_BEAM, SNORE, TRICK, ZEN_HEADBUTT
; end
| 50.8 | 583 | 0.766732 |
f06eb873958f7dd12c238b95a54f31b803933f4c | 731 | asm | Assembly | sound/sfxasm/83.asm | NatsumiFox/Sonic-3-93-Nov-03 | 032e4fc25f243636d458639c4a4311caca898f96 | [
"MIT"
] | 7 | 2019-12-05T00:35:57.000Z | 2022-02-27T20:00:33.000Z | sound/sfxasm/83.asm | NatsumiFox/Sonic-3-93-Nov-03 | 032e4fc25f243636d458639c4a4311caca898f96 | [
"MIT"
] | null | null | null | sound/sfxasm/83.asm | NatsumiFox/Sonic-3-93-Nov-03 | 032e4fc25f243636d458639c4a4311caca898f96 | [
"MIT"
] | null | null | null | 83_Header:
sHeaderInit ; Z80 offset is $CD96
sHeaderPatch 83_Patches
sHeaderTick $01
sHeaderCh $01
sHeaderSFX $80, $05, 83_FM5, $15, $05
83_FM5:
sPatFM $00
ssModZ80 $01, $01, $20, $85
dc.b nD0, $03, nB0, $1E
sStop
83_Patches:
; Patch $00
; $35
; $02, $FD, $01, $F6, $0F, $16, $14, $11
; $06, $04, $0F, $08, $02, $03, $03, $04
; $7F, $6F, $3F, $2F, $31, $28, $0E, $80
spAlgorithm $05
spFeedback $06
spDetune $00, $00, $0F, $0F
spMultiple $02, $01, $0D, $06
spRateScale $00, $00, $00, $00
spAttackRt $0F, $14, $16, $11
spAmpMod $00, $00, $00, $00
spSustainRt $06, $0F, $04, $08
spSustainLv $07, $03, $06, $02
spDecayRt $02, $03, $03, $04
spReleaseRt $0F, $0F, $0F, $0F
spTotalLv $31, $0E, $28, $00
| 22.151515 | 41 | 0.578659 |
02d4c445ab3cefd1d34ac0fc55d78c9388217e04 | 203 | asm | Assembly | data/pokemon/dex_entries/mantine.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 28 | 2019-11-08T07:19:00.000Z | 2021-12-20T10:17:54.000Z | data/pokemon/dex_entries/mantine.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 13 | 2020-01-11T17:00:40.000Z | 2021-09-14T01:27:38.000Z | data/pokemon/dex_entries/mantine.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 22 | 2020-05-28T17:31:38.000Z | 2022-03-07T20:49:35.000Z | db "KITE@" ; species name
dw 611, 4850 ; height, weight
db "It swims along"
next "freely, eating"
next "things that swim"
page "into its mouth."
next "Its whole body is"
next "very coarse.@"
| 18.454545 | 30 | 0.660099 |
77aa4c8ded44506bbe0082dba1fb0320d043f7e7 | 356 | asm | Assembly | programs/oeis/089/A089279.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/089/A089279.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/089/A089279.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A089279: a(n) = 2 + sum(k=1 to n) [(-1)^k A001511(k)].
; 1,3,2,5,4,6,5,9,8,10,9,12,11,13,12,17,16,18,17,20,19,21,20,24,23,25,24,27,26,28,27,33,32,34,33,36,35,37,36,40,39,41,40,43,42,44,43,48,47,49,48,51,50,52,51,55,54,56,55,58,57,59,58,65,64,66,65,68,67,69,68,72
mov $2,$0
add $0,1
pow $2,2
mod $2,4
mov $1,$2
lpb $0
div $0,2
add $1,$0
lpe
add $1,1
| 25.428571 | 207 | 0.587079 |
81286b60a8126debd2424f015bb9613da8148b2c | 285 | asm | Assembly | libsrc/_DEVELOPMENT/arch/zx/display/c/sccz80/zx_cyx2aaddr_callee.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/arch/zx/display/c/sccz80/zx_cyx2aaddr_callee.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/arch/zx/display/c/sccz80/zx_cyx2aaddr_callee.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | 1 | 2019-12-03T23:57:48.000Z | 2019-12-03T23:57:48.000Z |
; void *zx_cyx2aaddr(uchar row, uchar col)
SECTION code_clib
SECTION code_arch
PUBLIC zx_cyx2aaddr_callee, l0_zx_cyx2aaddr_callee
EXTERN asm_zx_cyx2aaddr
zx_cyx2aaddr_callee:
pop af
pop hl
pop de
push af
l0_zx_cyx2aaddr_callee:
ld h,e
jp asm_zx_cyx2aaddr
| 12.391304 | 50 | 0.761404 |
828d410c7a525aae28fbb5420a4432a305a80bc8 | 349 | asm | Assembly | libsrc/stdio/zx81/getk.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/stdio/zx81/getk.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/stdio/zx81/getk.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | ;
; ZX81 Stdio
;
; getk() Read key status
;
; Stefano Bodrato - 8/5/2000
;
;
; $Id: getk.asm,v 1.5 2015/01/19 01:33:22 pauloscustodio Exp $
;
PUBLIC getk
EXTERN zx81toasc
EXTERN restore81
.getk
call restore81
call 699
ld a,h
add a,2
ld b,h
ld c,l
ld a,0
jr c,nokey
call 1981
call zx81toasc
nokey:
ld l,a
ld h,0
ret
| 9.694444 | 62 | 0.627507 |
d8fe084ea70562eba28fa09df6b3f7eb364de206 | 650 | asm | Assembly | notes/nasm.asm | orz-forks/ass-js | 0f32482da6e454764cd50e1a4264e69b6d26edb6 | [
"Unlicense"
] | 137 | 2016-06-11T13:42:28.000Z | 2022-02-16T02:46:26.000Z | notes/nasm.asm | orz-forks/ass-js | 0f32482da6e454764cd50e1a4264e69b6d26edb6 | [
"Unlicense"
] | 7 | 2017-09-22T21:21:26.000Z | 2021-08-25T04:35:53.000Z | notes/nasm.asm | orz-forks/ass-js | 0f32482da6e454764cd50e1a4264e69b6d26edb6 | [
"Unlicense"
] | 13 | 2017-05-22T04:24:32.000Z | 2021-12-26T23:01:30.000Z | ; nasm -f bin -o nasm.o nasm.asm
; objdump -D -b binary -mi386 -Maddr16,data16 -M intel nasm.o > nasm.dump
; nasm -f bin -o notes/nasm.o notes/nasm.asm && objdump -D -b binary -mi386 -Mx86-64 -M intel notes/nasm.o > notes/nasm.dump
BITS 64
section .text
global _start ;must be declared for linker (ld)
_start: ;tell linker entry point
syscall
int 0x80
mov rbx, rax
mov rsi, rax
mov rax, 1
jmp 0xffffffff
jmp -0xffffffff
jmp 0
jmp rax
bs jmp rax
fs jmp rax
| 24.074074 | 125 | 0.507692 |
2b57dab0e90253feef614e3f4e7da132d03a469f | 129 | asm | Assembly | libsrc/graphics/sv8000/xor_MODE1.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | null | null | null | libsrc/graphics/sv8000/xor_MODE1.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | null | null | null | libsrc/graphics/sv8000/xor_MODE1.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1 | 2019-12-03T23:28:20.000Z | 2019-12-03T23:28:20.000Z |
SECTION code_clib
PUBLIC xor_MODE1
.xor_MODE1
defc NEEDxor = 1
INCLUDE "graphics/pc6001/pixel_MODE1.asm"
| 14.333333 | 49 | 0.674419 |
c378792a814814dbe262d97736f1aa8af811f5c6 | 433 | asm | Assembly | programs/oeis/282/A282563.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/282/A282563.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/282/A282563.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A282563: One third of the number of edges in the metrically regular triangulation of the n-th approximation of the Koch snowflake fractal.
; 1,8,68,596,5300,47444,425972,3829652,34450484,309988820,2789637236,25105686548,225946984628,2033506084436,18301487651060,164713120424084,1482417010074932,13341748795707092,120075721981494644,1080681429113975060
mul $0,2
seq $0,133467 ; a(n) = a(n-1) + 6*a(n-2) for n >= 2, a(0)=1, a(1)=2.
| 72.166667 | 212 | 0.785219 |
962c297464f7950d9cbdc0ae0ec493d5999e78ff | 6,913 | asm | Assembly | source/jni/u2/glenz/math.asm | Falken42/SecondReality | b998d193a066523cb4ca2b86c8041bea1bddfcb4 | [
"Unlicense"
] | 9 | 2015-05-13T21:02:00.000Z | 2018-04-15T16:32:27.000Z | source/jni/u2/glenz/math.asm | falken42/SecondReality | b998d193a066523cb4ca2b86c8041bea1bddfcb4 | [
"Unlicense"
] | null | null | null | source/jni/u2/glenz/math.asm | falken42/SecondReality | b998d193a066523cb4ca2b86c8041bea1bddfcb4 | [
"Unlicense"
] | null | null | null | include asm.inc
text__math SEGMENT para public 'CODE'
ASSUME cs:text__math
.386
include mathsin.inc
;rotate sins/coss
rxsin dw 0
rxcos dw 0
rysin dw 0
rycos dw 0
rzsin dw 0
rzcos dw 0
checkdeg MACRO reg
local l0,l1,l2
l0: cmp reg,3600
jb l1
jl l2
;>3600
sub reg,3600
jmp l0
l2: ;<0
add reg,3600
jmp l0
l1: ENDM
public _cmatrix_yxz
_cmatrix_yxz PROC FAR
CBEG
movpar ds,4
movpar si,3
mov di,si
movpar ax,0 ;rotx
mov ds:[si+2],ax
movpar ax,1 ;roty
mov ds:[si+0],ax
movpar ax,2 ;rotz
mov ds:[si+4],ax
call calcmatrix
CEND
_cmatrix_yxz ENDP
calcmatrix PROC NEAR ;rY*rX*rZ
;ds:[si+0]=rotx
;ds:[si+2]=roty
;ds:[si+4]=rotz
;dest: ds:[di]
;load values, check 'em and calc sin/cos
;ROT-X
mov bx,ds:[si]
checkdeg bx
mov ds:[si],bx
shl bx,1
mov ax,cs:sintable16[bx]
mov cs:rxsin,ax
mov ax,cs:costable16[bx]
mov cs:rxcos,ax
;ROT-Y
mov bx,ds:[si+2]
checkdeg bx
mov ds:[si+2],bx
shl bx,1
mov ax,cs:sintable16[bx]
mov cs:rysin,ax
mov ax,cs:costable16[bx]
mov cs:rycos,ax
;ROT-Z
mov bx,ds:[si+4]
checkdeg bx
mov ds:[si+4],bx
shl bx,1
mov ax,cs:sintable16[bx]
mov cs:rzsin,ax
mov ax,cs:costable16[bx]
mov cs:rzcos,ax
;matrix equations: rY*rX*rZ
; 0=Ycos*Zcos- 2=Xsin*Ysin*Zcos+ 4=-Xcos*Ysin
; Xsin*Ysin*Zsin Ycos*Zsin
; 6=-Xcos*Zsin 8=Xcos*Zcos 10=Xsin
;
;12=Xsin*Ycos*Zsin+ 14=Ysin*Zsin- 16=Xcos*Ycos
; Ysin*Zcos Xsin*Ycos*Zcos\
mov ax,cs:rysin
imul cs:rzsin
shld dx,ax,1
mov ds:[di+14],dx ;14a
mov ax,cs:rycos
imul cs:rzcos
shld dx,ax,1
mov ds:[di+0],dx ;0a
mov ax,dx
imul cs:rxsin
shld dx,ax,1
sub ds:[di+14],dx ;14b
mov ax,cs:rxsin
imul cs:rysin
shld dx,ax,1
mov cx,dx
mov ax,cs:rzsin
imul dx
shld dx,ax,1
sub ds:[di+0],dx ;0b
mov ax,cs:rzcos
imul cx
shld dx,ax,1
mov ds:[di+2],dx ;2a
mov ax,cs:rycos
imul cs:rzsin
shld dx,ax,1
add ds:[di+2],dx ;2b
mov ax,cs:rxsin
imul dx
shld dx,ax,1
mov ds:[di+12],dx ;12a
mov ax,cs:rysin
imul cs:rzcos
shld dx,ax,1
add ds:[di+12],dx ;12b
mov ax,cs:rxcos
imul cs:rzsin
shld dx,ax,1
neg dx
mov ds:[di+6],dx ;6
mov ax,cs:rxcos
imul cs:rzcos
shld dx,ax,1
mov ds:[di+8],dx ;8
mov ax,cs:rxcos
imul cs:rysin
shld dx,ax,1
neg dx
mov ds:[di+4],dx ;4
mov ax,cs:rxcos
imul cs:rycos
shld dx,ax,1
mov ds:[di+16],dx ;16
mov ax,cs:rxsin
mov ds:[di+10],ax ;10
ret
calcmatrix ENDP
calcmatrixsep PROC NEAR ;calc 3 separate matrices
;ds:[si+0]=rotx
;ds:[si+2]=roty
;ds:[si+4]=rotz
;dest: ds:[di]
;load values, check 'em and calc sin/cos
;ROT-X
mov bx,ds:[si]
checkdeg bx
mov ds:[si],bx
shl bx,1
mov ax,cs:sintable16[bx]
mov cs:rxsin,ax
mov ax,cs:costable16[bx]
mov cs:rxcos,ax
;ROT-Y
mov bx,ds:[si+2]
checkdeg bx
mov ds:[si+2],bx
shl bx,1
mov ax,cs:sintable16[bx]
mov cs:rysin,ax
mov ax,cs:costable16[bx]
mov cs:rycos,ax
;ROT-Z
mov bx,ds:[si+4]
checkdeg bx
mov ds:[si+4],bx
shl bx,1
mov ax,cs:sintable16[bx]
mov cs:rzsin,ax
mov ax,cs:costable16[bx]
mov cs:rzcos,ax
mov bx,0
mov cx,32767
;rX
mov ds:[di+0],cx
mov ds:[di+2],bx
mov ds:[di+4],bx
mov ds:[di+6],bx
mov ax,cs:rxcos
mov ds:[di+8],ax
mov ax,cs:rxsin
mov ds:[di+10],ax
mov ds:[di+12],bx
mov ax,cs:rxsin
neg ax
mov ds:[di+14],ax
mov ax,cs:rxcos
mov ds:[di+16],ax
add di,18
;rY
mov ax,cs:rycos
mov ds:[di+0],ax
mov ds:[di+2],bx
mov ax,cs:rysin
neg ax
mov ds:[di+4],ax
mov ds:[di+6],bx
mov ds:[di+8],cx
mov ds:[di+10],bx
mov ax,cs:rysin
mov ds:[di+12],ax
mov ds:[di+14],bx
mov ax,cs:rycos
mov ds:[di+16],ax
add di,18
;rZ
mov ax,cs:rzcos
mov ds:[di+0],ax
mov ax,cs:rzsin
mov ds:[di+2],ax
mov ds:[di+4],bx
mov ax,cs:rzsin
neg ax
mov ds:[di+6],ax
mov ax,cs:rzcos
mov ds:[di+8],ax
mov ds:[di+10],bx
mov ds:[di+12],bx
mov ds:[di+14],bx
mov ds:[di+16],cx
add di,18
ret
calcmatrixsep ENDP
calcmatrix0 PROC NEAR ;rX*rY*rZ
;ds:[si]=rotx
;ds:[si]=roty
;ds:[si]=rotz
;dest: ds:[di]
;load values, check 'em and calc sin/cos
;ROT-X
mov bx,ds:[si]
checkdeg bx
mov ds:[si],bx
shl bx,1
mov ax,cs:sintable16[bx]
mov cs:rxsin,ax
mov ax,cs:costable16[bx]
mov cs:rxcos,ax
;ROT-Y
mov bx,ds:[si+2]
checkdeg bx
mov ds:[si+2],bx
shl bx,1
mov ax,cs:sintable16[bx]
mov cs:rysin,ax
mov ax,cs:costable16[bx]
mov cs:rycos,ax
;ROT-Z
mov bx,ds:[si+4]
checkdeg bx
mov ds:[si+4],bx
shl bx,1
mov ax,cs:sintable16[bx]
mov cs:rzsin,ax
mov ax,cs:costable16[bx]
mov cs:rzcos,ax
;matrix equations: rX*rY*rZ ;rZ*rY*rX
; 0=Ycos*Zcos 2=Ycos*Zsin 4=-Ysin
; 6=Xsin*Zcos*Ysin 8=Xsin*Ysin*Zsin 10=Ycos*Xsin
; -Xcos*Zsin +Xcos*Zcos
;12=Xcos*Zcos*Ysin 14=Xcos*Ysin*Zsin 16=Ycos*Xcos
; +Xsin*Zsin -Xsin*Zcos
;calculate rotation matrix
;0,2,10,16,4
mov bx,cs:rycos
mov ax,cs:rzcos
imul bx
shld dx,ax,1
mov ds:[di+0],dx
;
mov ax,cs:rzsin
imul bx
shld dx,ax,1
mov ds:[di+2],dx
;
mov ax,cs:rxsin
imul bx
shld dx,ax,1
mov ds:[di+10],dx
;
mov ax,cs:rxcos
imul bx
shld dx,ax,1
mov ds:[di+16],dx
;
mov ax,cs:rysin
neg ax
mov ds:[di+4],ax
;6,8
mov ax,cs:rxsin
imul cs:rysin
shld dx,ax,1
mov cx,dx
;
mov ax,cx
imul cs:rzcos
shld dx,ax,1
mov ds:[di+6],dx
;
mov ax,cx
imul cs:rzsin
shld dx,ax,1
mov ds:[di+8],dx
;
mov bx,cs:rxcos
mov ax,cs:rzsin
imul bx
shld dx,ax,1
sub ds:[di+6],dx
;
mov ax,cs:rzcos
imul bx
shld dx,ax,1
add ds:[di+8],dx
;12,14
mov ax,cs:rxcos
imul cs:rysin
shld dx,ax,1
mov cx,dx
;
mov ax,cx
imul cs:rzcos
shld dx,ax,1
mov ds:[di+12],dx
;
mov ax,cx
imul cs:rzsin
shld dx,ax,1
mov ds:[di+14],dx
;
mov bx,cs:rxsin
mov ax,cs:rzsin
imul bx
shld dx,ax,1
add ds:[di+12],dx
;
mov ax,cs:rzcos
imul bx
shld dx,ax,1
sub ds:[di+14],dx
ret
calcmatrix0 ENDP
mulmacro MACRO row,col
mov ax,ds:[si+0+row*6]
imul word ptr es:[di+0+col*2]
mov cx,dx
mov bx,ax
mov ax,ds:[si+2+row*6]
imul word ptr es:[di+6+col*2]
add cx,dx
add bx,ax
mov ax,ds:[si+4+row*6]
imul word ptr es:[di+12+col*2]
add cx,dx
add bx,ax
shld cx,bx,1
ENDM
mulmatrices PROC NEAR
;ds:si=matrix1,es:di=matrix2 => ds:si (overwrite)
mulmacro 0,0
push cx
mulmacro 0,1
push cx
mulmacro 0,2
push cx
mulmacro 1,0
push cx
mulmacro 1,1
push cx
mulmacro 1,2
push cx
mulmacro 2,0
push cx
mulmacro 2,1
push cx
mulmacro 2,2
mov ds:[si+4+12],cx
pop word ptr ds:[si+2+12]
pop word ptr ds:[si+0+12]
pop word ptr ds:[si+4+6]
pop word ptr ds:[si+2+6]
pop word ptr ds:[si+0+6]
pop word ptr ds:[si+4]
pop word ptr ds:[si+2]
pop word ptr ds:[si+0]
ret
mulmatrices ENDP
text__math ENDS
END
| 16.2277 | 51 | 0.607696 |
ca97c6f80ee9aceab24c2bba63ccaebfb729c3c2 | 433 | asm | Assembly | examples/blink.asm | python36/d0xfa | d035c8fdeee7453ba63cd9f4211c9e73fc692db5 | [
"BSD-2-Clause"
] | null | null | null | examples/blink.asm | python36/d0xfa | d035c8fdeee7453ba63cd9f4211c9e73fc692db5 | [
"BSD-2-Clause"
] | null | null | null | examples/blink.asm | python36/d0xfa | d035c8fdeee7453ba63cd9f4211c9e73fc692db5 | [
"BSD-2-Clause"
] | null | null | null | .include "mcu/msp430g2553.inc"
.macro delay(cnt)
mov #{cnt}, r8
delay_loop:
dec r8
jnz delay_loop
.end_macro
{mem_code}:
mov #{mem_ram_end + 1}, r1 ; MUST HAVE
mov #{wdtctl_wdtpw + wdtctl_wdthold}, &{wdtctl} ; stop wdt
mov.b &{cal_bc1_1mhz}, &{bcsctl1}
mov.b &{cal_dco_1mhz}, &{dcoctl}
bis.b #{pin6}, &{p1dir}
main_loop:
delay(32000)
xor.b #{pin6}, &{p1out}
jmp main_loop
{reset_vector}: {mem_code}
| 16.653846 | 62 | 0.644342 |
85d28f85446aad3bd02078fa318d9c9fb45563fa | 509 | asm | Assembly | oeis/060/A060308.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/060/A060308.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/060/A060308.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A060308: Largest prime <= 2n.
; Submitted by Jamie Morken(s3)
; 2,3,5,7,7,11,13,13,17,19,19,23,23,23,29,31,31,31,37,37,41,43,43,47,47,47,53,53,53,59,61,61,61,67,67,71,73,73,73,79,79,83,83,83,89,89,89,89,97,97,101,103,103,107,109,109,113,113,113,113,113,113,113,127,127,131,131,131,137,139,139,139,139,139,149,151,151,151,157,157,157,163,163,167,167,167,173,173,173,179,181,181,181,181,181,191,193,193,197,199
mul $0,2
trn $0,1
seq $0,151799 ; Version 2 of the "previous prime" function: largest prime < n.
| 63.625 | 346 | 0.701375 |
7f073b9ec95d5f264340c269a584c4fed2efd843 | 2,632 | asm | Assembly | src/apricotosint.asm | drdanick/apricot-os | 65fcc85313986f9c6a8aa5738c4b19fa5544caac | [
"MIT"
] | null | null | null | src/apricotosint.asm | drdanick/apricot-os | 65fcc85313986f9c6a8aa5738c4b19fa5544caac | [
"MIT"
] | null | null | null | src/apricotosint.asm | drdanick/apricot-os | 65fcc85313986f9c6a8aa5738c4b19fa5544caac | [
"MIT"
] | 1 | 2018-07-10T19:35:07.000Z | 2018-07-10T19:35:07.000Z | ; asmsyntax=apricos
; ===================================
; == ==
; == ApricotOS Internal System ==
; == Header ==
; == ==
; == Revision 1 ==
; == ==
; == (C) 2014-17 Nick Stones-Havas ==
; == ==
; == ==
; == Provides standard labels and ==
; == macros for programs running ==
; == under ApricotOS. ==
; == ==
; ===================================
;
#name "OS"
; Macro for library function calls
;
; Arguments:
; Func - Label of function
;
; Notes:
; -The currently selected accumulator will
; be used as temporary storage.
#macro SYSCALL Func {
; Push the return address segment to the stack
LDI OS_SYSCALL_RETURN ; LDI will load $mar with the full return address
LDah
SPUSH
LDal
SPUSH
; Load the address of the function to be called
LAh Func
LAl Func
JMP
SYSCALL_RETURN:
}
; Macro for library function jumps
;
; Arguments:
; Func - Label of the function being jumped to
;
; Notes:
; - This macro will not set up the stack
; for a SYSCALL_RET. Only use with functions
; that never return to the caller.
#macro SYSJUMP Func {
LAh Func
LAl Func
JMP
}
; Macro for local function calls
;
; Arguments:
; Func - Label of function
;
; Notes:
; -The callee must be in the same segment as the caller
; -The currently selected accumulator will
; be used as temporary storage.
#macro LOCALSYSCALL Func {
LDI OS_LOCALCALL_RETURN ; LDI will load $mar with the full return address
LDah
SPUSH
LDal
SPUSH
; Load the address of the function to be called
LAl Func
JMP
LOCALCALL_RETURN:
}
; Macro for returning from a syscall
;
; Notes:
; -The currently selected accumulator will
; be used as temporary storage.
#macro SYSCALL_RET {
SPOP
STal
SPOP
STah
JMP
}
; Macro for setting up $mr in preparation for a syscall return
;
; Notes:
; -The currently selected accumulator will
; be used as temporary storage.
#macro SYSCALL_RET_PREP {
SPOP
STal
SPOP
STah
}
; Macro for pushing the contents of $mar into the stack.
;
; Notes:
; -The currently selected accumulator will
; be used as temporary storage.
#macro PUSH_MAR {
LDah
SPUSH
LDal
SPUSH
}
; Macro for popping the contents of $mar from the stack.
;
; Notes:
; -The currently selected accumulator will
; be used as temporary storage.
#macro POP_MAR {
SPOP
STal
SPOP
STah
}
| 20.5625 | 81 | 0.583207 |
027212c2bc3ddea031c11e5228fc795383dfaa9b | 442 | asm | Assembly | libsrc/_DEVELOPMENT/string/c/sccz80/strrcspn_callee.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/string/c/sccz80/strrcspn_callee.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/string/c/sccz80/strrcspn_callee.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
; size_t strrcspn(const char *str, const char *cset)
SECTION code_clib
SECTION code_string
PUBLIC strrcspn_callee
EXTERN asm_strrcspn
strrcspn_callee:
IF __CPU_GBZ80__
pop bc
pop de
pop hl
push bc
call asm_strrcspn
ld d,h
ld e,l
ret
ELSE
pop hl
pop de
ex (sp),hl
jp asm_strrcspn
ENDIF
; SDCC bridge for Classic
IF __CLASSIC
PUBLIC _strrcspn_callee
defc _strrcspn_callee = strrcspn_callee
ENDIF
| 12.277778 | 52 | 0.728507 |
778053429a20520437ba174521d437b02f458423 | 856 | asm | Assembly | libsrc/z80_crt0s/crt0_long/8080/l_long_sub.asm | grancier/z180 | e83f35e36c9b4d1457e40585019430e901c86ed9 | [
"ClArtistic"
] | null | null | null | libsrc/z80_crt0s/crt0_long/8080/l_long_sub.asm | grancier/z180 | e83f35e36c9b4d1457e40585019430e901c86ed9 | [
"ClArtistic"
] | null | null | null | libsrc/z80_crt0s/crt0_long/8080/l_long_sub.asm | grancier/z180 | e83f35e36c9b4d1457e40585019430e901c86ed9 | [
"ClArtistic"
] | 1 | 2019-12-03T23:57:48.000Z | 2019-12-03T23:57:48.000Z | ; Z88 Small C+ Run Time Library
; Long functions
; "8080" mode
; Stefano - 29/4/2002
; $Id: l_long_sub.asm,v 1.3 2016/06/16 20:31:05 dom Exp $
;
SECTION code_crt0_sccz80
PUBLIC l_long_sub
;primary = secondary - primary
;enter with secondary, primary on stack
.l_long_sub
ex (sp),hl
ld (retloc+1),hl
pop bc
ld hl,0
add hl,sp ;points to hl on stack
ld a,(hl)
sub c
inc hl
ld c,a
ld a,(hl)
sbc a,b
inc hl
ld b,a
ld a,(hl)
sbc a,e
inc hl
ld e,a
ld a,(hl)
sbc a,d
inc hl
ld d,a
ld sp,hl
ld l,c ;get the lower 16 back into hl
ld h,b
.retloc jp 0
| 17.12 | 57 | 0.434579 |
88a181666015acd803547881fddf26fcf11a15ef | 574 | asm | Assembly | programs/oeis/147/A147568.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/147/A147568.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/147/A147568.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A147568: a(n) = 2*A000695(n)+3.
; 3,5,11,13,35,37,43,45,131,133,139,141,163,165,171,173,515,517,523,525,547,549,555,557,643,645,651,653,675,677,683,685,2051,2053,2059,2061,2083,2085,2091,2093,2179,2181,2187,2189,2211,2213,2219,2221,2563,2565,2571
mov $2,$0
mov $5,$0
lpb $2,1
mov $0,$5
sub $2,1
sub $0,$2
mov $3,$0
lpb $0,1
add $3,$0
mov $0,0
gcd $3,281474976710656
mov $4,3
mov $6,0
add $6,$3
mov $7,1
lpe
sub $4,$7
mul $6,$4
pow $6,2
add $6,$4
mov $3,$6
div $3,6
add $3,1
add $1,$3
lpe
div $1,4
mul $1,2
add $1,3
| 17.9375 | 214 | 0.576655 |
37b0af55638cc00039c42f6f50a408ebd2e79205 | 21,868 | asm | Assembly | common/obj_mod.asm | DigitalMars/optlink | 493de158282046641ef2a3a60a88e25e26d88ec4 | [
"BSL-1.0"
] | 28 | 2015-02-03T01:38:24.000Z | 2022-03-23T05:48:24.000Z | common/obj_mod.asm | DigitalMars/optlink | 493de158282046641ef2a3a60a88e25e26d88ec4 | [
"BSL-1.0"
] | 20 | 2015-01-02T14:51:20.000Z | 2021-01-09T21:37:19.000Z | common/obj_mod.asm | DigitalMars/optlink | 493de158282046641ef2a3a60a88e25e26d88ec4 | [
"BSL-1.0"
] | 9 | 2015-02-11T17:43:56.000Z | 2019-09-05T11:07:02.000Z | TITLE OBJ_MOD - Copyright (c) SLR Systems 1994
INCLUDE MACROS
INCLUDE IO_STRUC
INCLUDE SECTS
INCLUDE MODULES
INCLUDE CDDATA
INCLUDE FIXTEMPS
if fg_td
INCLUDE TDBG
endif
PUBLIC OBJ_MOD,MODEND_RETURN,DO_DEFINE_MODULE,VERBOSE_MODULENAME
PUBLIC LAST_MODULE_GINDEX_EXT
.DATA
EXTERNDEF MODULE_NAME:BYTE,OUTBUF:BYTE,OVR_EXTRN:BYTE,BYTES:BYTE,TEMP_RECORD:BYTE,CACHE_BYTE:BYTE
EXTERNDEF MOD_PLTYPE:BYTE,DEBUG_TYPES_SELECTED:BYTE,SYMBOL_TEXT:BYTE
EXTERNDEF SYMBOL_LENGTH:DWORD,OVR_EXTRN_TABLE:DWORD,OBJ_DEVICE:DWORD,RECORD_LENGTH:DWORD,SRC_COUNT:DWORD
EXTERNDEF END_OF_RECORD:DWORD,FILE_FLAGS:DWORD,SECTION_NUMBER:DWORD,CURNLIB_NUMBER:DWORD,LIB_PAGE_SIZE:DWORD
EXTERNDEF TYPDEF_ANDER:DWORD,LINNUM_DELTA:DWORD,EXTDEF_DELTA:DWORD,DEFAULT_SIZE:DWORD,CURNMOD_GINDEX:DWORD
EXTERNDEF TD_N_LSCOPES:DWORD,LDATA_SEGMOD_GINDEX:DWORD,MOD_FIRST_PUBLIC_GINDEX:DWORD
EXTERNDEF CURN_FILE_LIST_GINDEX:DWORD,XR_CURNMOD_GINDEX:DWORD,LAST_MYCOMDAT_LINDEX:DWORD
EXTERNDEF MOD_FIRST_SRC_GINDEX:DWORD,MOD_PREV_CSEGS:DWORD,N_MDB_STRUCTS:DWORD,MOD_CSEG_COUNT:DWORD
EXTERNDEF MOD_FIRST_CSEGMOD_GINDEX:DWORD,MOD_TD_LOCALS_INDEX32:DWORD,MOD_TD_LOCALS_COUNT:DWORD
EXTERNDEF MOD_TD_COMP_PARAMS:DWORD,TD_OPTIMIZATIONS_FLAG:DWORD,LAST_EXTDEF_GINDEX:DWORD
EXTERNDEF LAST_PUBDEF_GINDEX:DWORD,STACK_AREA1:DWORD,MYSTACK:DWORD,MATCHED_COUNT:DWORD,MATCHED_BUFFER:DWORD
EXTERNDEF MOD_CV_TYPES_SEGMOD:DWORD,MOD_CV_SYMBOLS_SEGMOD:DWORD,RECORD_TYPE:DWORD,OVR_INIT_ADDR:DWORD
EXTERNDEF MOD_SECTION:DWORD,FILE_SECTION:DWORD,VIRDEF_MCD_HASH_TABLE_PTR:DWORD,MOD_TD_OPTFLAGS:DWORD
EXTERNDEF MOD_TD_FIRST_LOCAL:DWORD,MATCHED_PTR:DWORD,LAST_TD_MATCHED:DWORD,LOCAL_HASH_TABLE_PTR:DWORD
EXTERNDEF MOD_LAST_SRC_GINDEX:DWORD,MDB_STRUCT_SIZE:DWORD,LAST_MDB_GINDEX:DWORD,FIRST_MDB_GINDEX:DWORD
EXTERNDEF SYMBOL_LARRAY:LARRAY_STRUCT,GROUP_LARRAY:LARRAY_STRUCT,LNAME_LARRAY:LARRAY_STRUCT
EXTERNDEF SEGMOD_LARRAY:LARRAY_STRUCT
EXTERNDEF LNAME_STUFF:ALLOCS_STRUCT,MODULE_GARRAY:STD_PTR_S,_FILE_LIST_GARRAY:STD_PTR_S,CSEG_GARRAY:STD_PTR_S
EXTERNDEF FILNAM:NFN_STRUCT,PRE_THREADS:THREAD_STUFF_STRUCT,SYMBOL_TPTR:TPTR_STRUCT
EXTERNDEF OPTI_MOVE:DWORD
EXTERNDEF LAST_MODULE_GINDEX_EXT:DWORD
.CODE PASS1_TEXT
EXTERNDEF GET_RECORD:PROC,FORREF:PROC,FORREF32:PROC,_check_checksum:proc
EXTERNDEF PROCESS_EXTERNALS:PROC,BAD_RECORD:PROC,THEADR:PROC,COMENT:PROC,MODEND:PROC,MODEND32:PROC
EXTERNDEF EXTDEF:PROC,RHEADR:PROC,PUBDEF:PROC,PUBDEF32:PROC,LINNUM:PROC,LINNUM32:PROC,LNAMES:PROC,SEGDEF:PROC
EXTERNDEF SEGDEF32:PROC,GRPDEF:PROC,FIXUPP:PROC,FIXUPP32:PROC,LEDATA:PROC,LEDATA32:PROC
EXTERNDEF LIDATA:PROC,LIDATA32:PROC,COMDEF:PROC,_err_abort:proc,LEXTDF:PROC,LPUBDF:PROC,LPUBDF32:PROC
EXTERNDEF RELEASE_ARRAYS:PROC,INIT_ARRAYS:PROC,RIDATA:PROC,RIDATA32:PROC,REDATA32:PROC,REDATA:PROC
EXTERNDEF PEDATA:PROC,PEDATA32:PROC,PIDATA:PROC,PIDATA32:PROC,LCOMDF:PROC,INSTALL_MODULE:PROC
EXTERNDEF ALLOC_MODULE:PROC,MOVE_ESI_EDI_STG:PROC,MOVE_ASCIZ_ESI_EDI:PROC,FLUSH_OUTBUF:PROC,ALIASS:PROC,CEXTDEF:PROC
EXTERNDEF COMDAT:PROC,COMDAT32:PROC,LINSYM:PROC,LINSYM32:PROC,FLUSH_COMDAT:PROC,HEXWOUT:PROC,NBKPAT:PROC
EXTERNDEF NBKPAT32:PROC,LLNAMES:PROC,LNAME_INSTALL:PROC
EXTERNDEF INIT_LOCAL_STORAGE:PROC,RELEASE_LOCAL_STORAGE:PROC,_move_file_list_gindex_path_prim_ext:proc
EXTERNDEF INIT_PARALLEL_ARRAY:PROC,PROCESS_MODEND_TD:PROC,RELEASE_PARALLEL_ARRAY:PROC,SAY_VERBOSE:PROC
EXTERNDEF GET_FIRST_RECORD:PROC
EXTERNDEF TOO_COMPLEX_ERR:ABS,OVR_EXTRN_COUNT:ABS,CEXTDEF_ERR:ABS
public _obj_mod
_obj_mod proc
push EBX
push ESI
push EDI
call OBJ_MOD
pop EDI
pop ESI
pop EBX
ret
_obj_mod endp
OBJ_MOD PROC
;
;WELL, FIRST WE WILL CLEAR OUT THE THREAD ARRAYS
;
CALL GET_FIRST_RECORD
MOV EAX,RECORD_TYPE
MOV ECX,RECORD_LENGTH
CMP AL,0F0H
JNZ OBJ_NORM
;
;MUST BE A LIBRARY FILE
;
MOV AL,-1
ADD ECX,3
SETT LIB_OR_NOT,AL
MOV LIB_PAGE_SIZE,ECX ;FOR ROUNDING ADDRESSES...
if fgh_inthreads
BITT _HOST_THREADED
JNZ OS_1
endif
MOV EAX,OBJ_DEVICE ;ADJUST MAX FILE SIZE TO READ
MOV ECX,[ESI]
MOV EAX,[EAX].MYI_STRUCT.MYI_FILE_LIST_GINDEX
CONVERT EAX,EAX,_FILE_LIST_GARRAY
MOV [EAX].FILE_LIST_STRUCT.FILE_LIST_NFN.NFN_FILE_LENGTH,ECX
OS_1:
LIB_LOOP LABEL PROC
CALL GET_RECORD
CMP RECORD_TYPE,0F1H
JZ LIB_DONE
CALL OBJ_NORM ;HANDLE LIKE STANDARD MODULE
;
;NOW, ROUND POINTER AND COUNTER
;
MOV EBX,OBJ_DEVICE
ASSUME EBX:PTR MYI_STRUCT
MOV ECX,LIB_PAGE_SIZE
MOV EAX,[EBX].MYI_PTRA
DEC ECX
MOV EDX,EAX
ADD EAX,ECX
NOT ECX
AND EAX,ECX
SUB EAX,EDX
SUB [EBX].MYI_COUNT,EAX
JC FAIL
ADD EAX,EDX
MOV [EBX].MYI_PTRA,EAX
JMP LIB_LOOP
FAIL LABEL PROC
MOV [EBX].MYI_COUNT,0 ;UNEXPECTED EOF NEXT
JMP LIB_LOOP
LIB_DONE LABEL PROC
XOR AL,AL
RESS REC_TYPE_VALID,AL
RESS LIB_OR_NOT,AL
RET
OBJ_NORM LABEL PROC
MOV EAX,0FFH
PUSH ESI
RESS FOUND_THEADR,AH
GETT CL,DEBUG_ALL
SETT DEBUGGING_THIS,AL
GETT CH,FANCY_DEBUG
MOV DEBUG_TYPES_SELECTED,AL ;SELECT ALL TYPES TO KEEP
TEST CL,CL
JNZ L19$
TEST CH,CH
JZ L19$
MOV EAX,CURN_FILE_LIST_GINDEX ;HANDLE DEBUG SELECTION BY FILE
RESS DEBUGGING_THIS,CL
if fg_winpack
TEST EAX,EAX
JZ L1$
endif
CONVERT EAX,EAX,_FILE_LIST_GARRAY
MOV AL,[EAX].FILE_LIST_STRUCT.FILE_LIST_PLINK_FLAGS
TEST AL,MASK FL_DEBUG_TYPES+MASK FL_DEBUG_LINNUMS+MASK FL_DEBUG_LOCALS+MASK FL_DEBUG_PUBLICS+MASK FL_DEBUG_COVERAGES+MASK FL_DEBUG_BROWSERDEFS+MASK FL_DEBUG_BROWSERREFS
JZ L1$
SETT DEBUGGING_THIS,CH
L1$:
MOV DEBUG_TYPES_SELECTED,AL
L19$:
;
;INITIALIZE FIXUPP THREADS
;
MOV EDI,OFF PRE_THREADS.FS_FILLER
XOR EAX,EAX
MOV ECX,8
MOV LDATA_SEGMOD_GINDEX,EAX
L2$:
MOV [EDI],EAX
ADD EDI,SIZE THREAD_STUFF_STRUCT
DEC ECX
JNZ L2$
;
;IF ARRAYS HAVE BEEN EXPANDED, RELEASE ANY EXCESS... GO BACK
;TO SINGLE SEGMENT STUFF
;
;
;INITIALIZE LNAME_STUFF
;
CALL INIT_LOCAL_STORAGE ;DOES INIT_ARRAYS TOO
XOR EAX,EAX
MOV MOD_FIRST_PUBLIC_GINDEX,EAX
MOV TYPDEF_ANDER,EAX ;IGNORE TYPES...
MOV LINNUM_DELTA,EAX
MOV EXTDEF_DELTA,EAX
MOV LOCAL_HASH_TABLE_PTR,EAX ;NEED TO CLEAR OUT LOCAL HASH TABLE BEFORE USING
MOV LAST_MYCOMDAT_LINDEX,EAX
RESS ANY_LNAMES,AL
if fg_td
MOV LAST_EXTDEF_GINDEX,EAX
MOV LAST_PUBDEF_GINDEX,EAX
RESS KEEPING_THIS_TDBG,AL
MOV LAST_TD_MATCHED,EAX
MOV MATCHED_PTR,OFF MATCHED_BUFFER
MOV MATCHED_COUNT,16
endif
POP ESI
RESS LAST_DATA_KEEP,AL
BITT DO_CHECKSUMING
JNZ DO_LOOP1
JMP DONT_LOOP1
;start processing records
DO_LOOP:
SUB AL,6EH
CMP AL,0D0H-6EH
JNC DO_FAIL
DO_LOOP2:
CALL REC_TABLE[EAX*4]
CALL GET_RECORD
DO_LOOP1:
push ESI
call _check_checksum
add ESP,4
MOV EAX,RECORD_TYPE
JMP DO_LOOP
DO_FAIL:
MOV AL,0CFH-6EH ;FORCE BAD_RECORD
JMP DO_LOOP2
;start processing records
DONT_LOOP:
SUB AL,6EH
CMP AL,0D0H-6EH
JNC DONT_FAIL
DONT_LOOP2:
CALL REC_TABLE[EAX*4]
; MOV EAX,OFF SAY_OMF_RET_MSG
; CALL SAY_OMF_VERBOSE
CALL GET_RECORD
DONT_LOOP1:
; CALL SAY_OMF_TYPE
MOV EAX,RECORD_TYPE
JMP DONT_LOOP
DONT_FAIL:
MOV AL,0CFH-6EH
JMP DONT_LOOP2
OBJ_MOD ENDP
DO_DEFINE_MODULE PROC
;
;build list of modules
;
PUSHM EDI,ESI
MOV EAX,DPTR MODULE_NAME
MOV ESI,OFF MODULE_NAME+4
MOV EDI,OFF SYMBOL_TEXT
MOV SYMBOL_LENGTH,EAX
CALL OPTI_MOVE
;
;FIRST DETERMINE IF THERE ARE ANY FIXUPPS
;
MOV EAX,OFF SYMBOL_TPTR
CALL INSTALL_MODULE
ASSUME ECX:PTR MODULE_STRUCT
PUSH EBX
MOV CURNMOD_GINDEX,EAX
if fg_xref
MOV XR_CURNMOD_GINDEX,EAX
endif
;
;SEE IF THAT MODULE RECORD ALREADY USED (DUPLICATE MOD NAME..)
;
;
;HANDLE DEBUG BY MODULE NAME
;
MOV AL,[ECX]._M_FLAGS
MOV DL,-1
TEST AL,MASK M_DEBUG_GLOBAL
JZ L1$
SETT DEBUGGING_THIS,DL
MOV DEBUG_TYPES_SELECTED,DL ;SELECT ALL DEBUGGING TYPES...
L1$:
OR AL,MASK M_USED
MOV EDX,CURNLIB_NUMBER
MOV [ECX]._M_FLAGS,AL
MOV EAX,CURN_FILE_LIST_GINDEX
MOV [ECX]._M_LIBNUM,EDX
MOV [ECX]._M_FILE_LIST_GINDEX,EAX
if fg_plink
MOV EAX,[ECX]._M_SECTION_GINDEX
MOV DL,[ECX]._M_PLTYPE
MOV MOD_SECTION_GINDEX,EAX
MOV MOD_PLTYPE,DL
endif
if any_overlays
TEST FILE_FLAGS,MASK SECT_AUTOSECT
JZ L8$
CALL CLONE_SECTION
L8$:
endif
CALL VERBOSE_MODULENAME
; CMP DPTR MODULE_NAME+4,'gniw'
; JNZ L2$
; SETT VERBOSE_OMF
;L2$:
;
;KEEP TYPES IF TYPES ARE SELECTED FOR THIS MODULE, AND WE ARE DOING CODEVIEW INFORMATION
;
GETT CL,CODEVIEW_FLAG
MOV AL,DEBUG_TYPES_SELECTED
OR CL,CL
JZ L5$
TEST AL,MASK FL_DEBUG_TYPES
JZ L5$
MOV TYPDEF_ANDER,-1 ;KEEP TYPES NOW...
L5$:
if fg_td
BITT TD_FLAG
JZ 9$
BITT DEBUGGING_THIS
JZ 9$
SETT KEEPING_THIS_TDBG
LEA SI,TD_LSCOPE_PARRAY
MOV AX,SIZE TD_LSCOPES_STRUCT
CALL INIT_PARALLEL_ARRAY
LEA SI,TD_LSRC_PARRAY
MOV AX,SIZE TD_LSRC_STRUCT
CALL INIT_PARALLEL_ARRAY
; LEA SI,TD_LTYPES_PARRAY
; MOV AX,4
; CALL INIT_PARALLEL_ARRAY
; LEA SI,TD_LCLASS_PARRAY
; MOV AX,4
; CALL INIT_PARALLEL_ARRAY
XOR AX,AX
MOV TD_N_LSCOPES,AX
MOV AX,CSEG_GARRAY._STD_LIMIT
MOV MOD_PREV_CSEGS,AX
endif
L9$:
POPM EBX,ESI,EDI
RET
DO_DEFINE_MODULE ENDP
if any_overlays
CLONE_SECTION PROC NEAR
;
;NEED ANOTHER SECTION JUST LIKE THIS ONE...
;
;
MOV AX,SIZE SECTION_STRUCT ;ALLOCATE ANOTHER SECTION
SYM_POOL_ALLOC #T
XCHG AX,DX
MOV BX,DI
LDS SI,FILE_SECTION
SYM_CONV_DS
MOV AX,[SI]._SECT_LAST_CLONE.OFFS
MOV CX,[SI]._SECT_LAST_CLONE.SEGM
MOV [SI]._SECT_LAST_CLONE.OFFS,BX
MOV [SI]._SECT_LAST_CLONE.SEGM,DX
MOV FILE_SECTION.OFFS,BX
MOV FILE_SECTION.SEGM,DX
JCXZ 1$
MOV DS,CX
XCHG AX,SI
SYM_CONV_DS
1$:
MOV CX,(SIZE SECTION_STRUCT)/2 ;DUPLICATE ENTRIES
REP MOVSW
;
;CLEAR OUT FIRST_AREA, LAST_AREA, NAME, CHILDREN, FIRST_SEGMOD, LAST_SEGMOD
;
LEA DI,[BX]._SECT_FIRST_AREA
XOR AX,AX
STOSW
STOSW
LEA DI,_SECT_LAST_AREA-(_SECT_FIRST_AREA+4)[DI]
STOSW
STOSW
LEA DI,_SECT_NAME-(_SECT_LAST_AREA+4)[DI]
STOSW
STOSW
LEA DI,_SECT_CHILDREN[BX]
STOSW
LEA DI,_SECT_FIRST_SEGMOD[BX]
STOSW
STOSW
LEA DI,_SECT_LAST_SEGMOD-(_SECT_FIRST_SEGMOD+4)[DI]
STOSW
STOSW
LEA SI,-SIZE SECTION_STRUCT[SI]
MOV [SI]._SECT_NEXT_SECTION.OFFS,BX
MOV [SI]._SECT_NEXT_SECTION.SEGM,DX
MOV [SI]._SECT_NEXT_SECTION_ORDER.OFFS,BX
MOV [SI]._SECT_NEXT_SECTION_ORDER.SEGM,DX
CMP ES:[BX]._SECT_NEXT_SECTION.SEGM,0 ;NEXT SECTION THIS AREA...
JNZ 2$
LDS SI,[SI]._SECT_PARENT_AREA
SYM_CONV_DS
MOV [SI]._AREA_LAST_SECTION.OFFS,BX
MOV [SI]._AREA_LAST_SECTION.SEGM,DX
2$:
;
;INC OUTFILE COUNT
;
LDS SI,ES:[BX]._SECT_OUTFILE
MOV CX,DS
JCXZ 3$
SYM_CONV_DS
INC [SI]._OF_SECTIONS
3$:
;
;INC SECTION NUMBERS
;
PUSHM DX,BX
LDS SI,ES:[BX]._SECT_PARENT_AREA
4$:
MOV CX,DS
JCXZ 5$
SYM_CONV_DS
LDS SI,[SI]._AREA_PARENT_SECTION
MOV CX,DS
JCXZ 5$
SYM_CONV_DS
INC [SI]._SECT_CHILDREN
LDS SI,[SI]._SECT_PARENT_AREA
JMP 4$
5$:
;
;INC SECTION # IN LINKED LIST
;
POPM SI,DS
6$:
SYM_CONV_DS
INC [SI]._SECT_NUMBER
LDS SI,[SI]._SECT_NEXT_SECTION_ORDER
MOV AX,DS
OR AX,AX
JNZ 6$
INC SECTION_NUMBER
RET
CLONE_SECTION ENDP
endif
VERBOSE_MODULENAME PROC
;
;
;
GETT AL,INFORMATION_FLAG
OR AL,AL
JZ L9$
PUSHM EDI,ESI
PUSH EBX
MOV EDI,OFF OUTBUF
MOV ESI,OFF READINGMOD_MSG
CALL MOVE_ESI_EDI_STG
MOV EAX,CURNMOD_GINDEX
CONVERT EAX,EAX,MODULE_GARRAY
ASSUME EAX:PTR MODULE_STRUCT
MOV ECX,[EAX]._M_FILE_LIST_GINDEX
LEA ESI,[EAX]._M_TEXT
PUSH ECX
CALL MOVE_ASCIZ_ESI_EDI ;PHYSICAL
MOV ESI,OFF FROMFILE_MSG
CALL MOVE_ESI_EDI_STG
POP ECX
TEST ECX,ECX
JZ L2$
MOV EAX,EDI
push ECX
push EAX
call _move_file_list_gindex_path_prim_ext
add ESP,8
MOV EDI,EAX
L2$:
CALL FLUSH_OUTBUF
POPM EBX,ESI,EDI
L9$:
RET
VERBOSE_MODULENAME ENDP
if any_overlays
DO_OVR_EXTRN_SYMBOL PROC NEAR
;
;
;
PUSH CX
LEA DI,TEMP_RECORD
LODSW ;PTR TO TEXT STRING
XCHG AX,BX ;BX PTS TO TEXT STRING
LODSB ;AL IS # OF Y/N BYTES TO ADD
CBW
XCHG AX,DX ;DX IS COUNT OF Y/N BYTES
XCHG BX,SI ;SI PTS TO STRING LEN, BX PTS TO FIRST Y/N OFFSET
LODSB
CBW
MOV CX,AX ;CX IS BYTES IN STRING
ADD AX,DX ;AL IS TOTAL LENGTH WITH Y/N'S
STOSB
REP MOVSB ;MOVE HEAD OF STRING
MOV SI,BX ;SI POINTS TO Y/N OFFSET
MOV CX,DX ;CX IS COUNT OF Y/N'S
4$:
LODSB ;OFFSET OF NEXT Y/N
LEA BX,BYTES
ADD BX,AX
MOV AL,[BX] ;LOAD Y/N
STOSB
LOOP 4$
XOR AL,AL
STOSB ;TYP-INDEX
MOV END_OF_RECORD,DI
PUSH SI
LEA SI,TEMP_RECORD
CALL EXTDEF
POPM SI,CX
FIXDS
FIXES
RET
DO_OVR_EXTRN_SYMBOL ENDP
endif
if any_overlays
FIRSTT PROC
;
;
;
BITT DOING_OVERLAYS
JZ FIRSTT1
PUSHM DI,AX
;
;REFERENCE EXTERN...
;
FIXDS
LEA SI,OVR_EXTRN_TABLE
CALL DO_OVR_EXTRN_SYMBOL
MOV OVR_INIT_ADDR.OFFS,BX
MOV OVR_INIT_ADDR.SEGM,AX
MOV CX,OVR_EXTRN_COUNT-1
; CMP CACHE_BYTE,'Y'
; JZ FIRSTT0
; DEC CX
FIRSTT0:
CALL DO_OVR_EXTRN_SYMBOL
LOOP FIRSTT0
POPM AX,DI
FIRSTT1:
JMP FIRSTT_RET
FIRSTT ENDP
endif
MODEND_RETURN PROC
NO_FIXUPPS LABEL PROC
;
;OK, END OF MODULE, FIRST WE SCAN LIST OF EXTERNALS AND PROCESS THEM
;
GETT DL,ANY_LNAMES
XOR EAX,EAX
TEST DL,DL
JNZ MR_1
CMP MOD_FIRST_PUBLIC_GINDEX,EAX
JZ MR_99
MR_1:
MOV ESI,CURNMOD_GINDEX
RESS LAST_DATA_COMDAT,AL
if any_overlays
MOV BX,LAST_MODULE_GINDEX_EXT
OR BX,BX
JZ FIRSTT
FIRSTT_RET:
endif
MOV LAST_MODULE_GINDEX_EXT,ESI ;BECAUSE PROCESS EXTERNALS MESSES UP CURNMOD_GINDEX
CONVERT ESI,ESI,MODULE_GARRAY
ASSUME ESI:PTR MODULE_STRUCT
MOV EAX,MOD_FIRST_PUBLIC_GINDEX
MOV ECX,MOD_FIRST_SRC_GINDEX
MOV [ESI]._M_FIRST_PUB_GINDEX,EAX
MOV AL,[ESI]._M_FLAGS
XOR DL,DL
TEST ECX,ECX
JZ MR_8
OR AL,MASK M_SRCS_PRESENT
MR_8:
BITT DEBUGGING_THIS,DL
JZ MR_9
OR AL,MASK M_DEBUGGING_THIS
MR_9:
BITT PCODE_OMIT_PUBLICS,DL
JZ MR_91
OR AL,MASK M_OMIT_$$PUBLICS
RESS PCODE_OMIT_PUBLICS,DL
MR_91:
BITT PCH_HERE,DL
JZ MR_92
OR AL,MASK M_PRECOMPILED_CV
RESS PCH_HERE,DL
MR_92:
MOV [ESI]._M_FLAGS,AL
if fg_td
BITT TD_FLAG
JZ MR_93
XOR AX,AX
XCHG AX,MOD_TD_COMP_PARAMS
MOV [SI]._M_TD_COMP_PARAMS,AX
MR_93:
endif
MR_99:
RESS REC_TYPE_VALID,DL
if fg_td
CALL PROCESS_MODEND_TD ;HANDLE TURBO DEBUGGER MODEND STUFF...
endif
; MOV EAX,OFF FLUSHING_COMDATS
; CALL SAY_OMF_VERBOSE
CALL FLUSH_COMDATS
; MOV EAX,OFF PROCESSING_EXTERNALS
; CALL SAY_OMF_VERBOSE
CALL PROCESS_EXTERNALS
if fg_td
FIXDS ;SO DS IS VALID AFTER
LEA SI,TD_LSRC_PARRAY ;RELEASE
CALL RELEASE_PARALLEL_ARRAY
endif
; MOV EAX,OFF RELEASING_LOCAL_STORAGE
; CALL SAY_OMF_VERBOSE
CALL RELEASE_LOCAL_STORAGE
;
;ANY REASON TO DO MDB RECORD?
;
BITT NEED_MDB_RECORD
JZ MR_10
; MOV EAX,OFF PROCESSING_MDB
; CALL SAY_OMF_VERBOSE
CALL PROCESS_MDB
MR_10:
XOR EAX,EAX
MOV DEFAULT_SIZE,EAX
MOV MOD_FIRST_PUBLIC_GINDEX,EAX
MOV MOD_FIRST_SRC_GINDEX,EAX
MOV MOD_LAST_SRC_GINDEX,EAX
; MOV MOD_SRC_COUNT,EAX
MOV MOD_FIRST_CSEGMOD_GINDEX,EAX
MOV MOD_CSEG_COUNT,EAX
MOV EBX,OBJ_DEVICE
ASSUME EBX:PTR MYI_STRUCT
MOV CURNMOD_GINDEX,EAX
BITT LIB_OR_NOT,AL
JNZ MODEND_DONE
;
;NORMAL OBJ, ANYTHING LEFT IN THE BUFFER?
;
CHECK_MORE_RET:
MOV ECX,[EBX].MYI_COUNT
MOV ESI,[EBX].MYI_PTRA
TEST ECX,ECX ;SOMETHING LEFT IN BUFFER, CHECK IT
JNZ CHECK_MORE_NOW
SUB ESI,[EBX].MYI_BLOCK
MOV EAX,EBX
CMP ESI,PAGE_SIZE ;PAGE BOUNDARY, TRY ANOTHER READ
JZ CHECK_MORE
RET
CHECK_MORE_NOW:
CMP BPTR [ESI],80H ;IS IT A THEADR RECORD?
JZ OBJ_MOD1
MODEND_DONE:
RET
CHECK_MORE:
push EAX
CALL [EBX].MYI_FILLBUF
add ESP,4
MOV ECX,[EBX].MYI_COUNT
TEST ECX,ECX
JNZ CHECK_MORE_RET
RET
OBJ_MOD1:
JMP OBJ_MOD
MODEND_RETURN ENDP
PROCESS_MDB PROC NEAR
;
;
;
MOV EAX,MDB_STRUCT_SIZE
MOV ESI,LAST_MODULE_GINDEX_EXT
MOV ECX,EAX
TILLP2_POOL_ALLOC
MOV EBX,EAX
ASSUME EBX:PTR MDB_STRUCT
INSTALL_POINTER_GINDEX MDB_GARRAY
MOV EDX,LAST_MDB_GINDEX
MOV EDI,EBX
TEST EDX,EDX
JZ DO_FIRST
CONVERT EDX,EDX,MDB_GARRAY
ASSUME EDX:PTR MDB_STRUCT
MOV [EDX]._MD_NEXT_MDB_GINDEX,EAX
DF_9:
MOV LAST_MDB_GINDEX,EAX
SHR ECX,2
XOR EAX,EAX
REP STOSD
RESS NEED_MDB_RECORD,CL
MOV EAX,N_MDB_STRUCTS
MOV ECX,ESI
CONVERT ESI,ESI,MODULE_GARRAY
ASSUME ESI:PTR MODULE_STRUCT
INC EAX
MOV EDX,LAST_MDB_GINDEX
MOV N_MDB_STRUCTS,EAX
MOV [ESI]._M_MDB_GINDEX,EDX
MOV EAX,MOD_FIRST_SRC_GINDEX
XOR EDX,EDX
MOV [EBX]._MD_FIRST_SRC_GINDEX,EAX
TEST EAX,EAX
JZ L2$
CONVERT EAX,EAX,SRC_GARRAY
ASSUME EAX:PTR SRC_STRUCT
MOV EAX,[EAX]._SRC_NUMBER
MOV EDX,SRC_COUNT
SUB EDX,EAX
INC EDX
L2$:
MOV [EBX]._MD_SRC_COUNT,EDX
MOV EAX,MOD_FIRST_CSEGMOD_GINDEX
MOV EDX,MOD_CSEG_COUNT
MOV [EBX]._MD_FIRST_CSEGMOD_GINDEX,EAX
MOV [EBX]._MD_CSEG_COUNT,EDX
if fg_cv
GETT AL,CODEVIEW_FLAG
MOV ECX,MOD_CV_TYPES_SEGMOD
OR AL,AL
JZ L5$
MOV EDX,MOD_CV_SYMBOLS_SEGMOD
MOV [EBX]._MD_CV_TYPES_GINDEX,ECX
XOR EAX,EAX
MOV [EBX]._MD_CV_SYMBOLS_GINDEX,EDX
MOV MOD_CV_TYPES_SEGMOD,EAX
MOV MOD_CV_SYMBOLS_SEGMOD,EAX
L5$:
endif
if fg_td
BITT TD_FLAG
JZ 9$
MOV [SI]._MD_TD_MOTHER_GINDEX,CX
MOV AX,MOD_TD_OPTFLAGS.LW
MOV BX,MOD_TD_OPTFLAGS.HW
MOV [SI]._MD_TD_OPTFLAGS.LW,AX
MOV [SI]._MD_TD_OPTFLAGS.HW,BX
OR AX,BX
OR AX,TD_OPTIMIZATIONS_FLAG
MOV TD_OPTIMIZATIONS_FLAG,AX
MOV AX,MOD_TD_LOCALS_INDEX32.LW
MOV BX,MOD_TD_LOCALS_INDEX32.HW
MOV [SI]._MD_TD_LOCALS_INDEX32.LW,AX
MOV [SI]._MD_TD_LOCALS_INDEX32.HW,BX
MOV AX,MOD_TD_LOCALS_COUNT
MOV [SI]._MD_TD_LOCALS_COUNT,AX
XOR AX,AX
MOV MOD_TD_OPTFLAGS.LW,AX
MOV MOD_TD_OPTFLAGS.HW,AX
MOV MOD_TD_LOCALS_INDEX32.LW,AX
MOV MOD_TD_LOCALS_INDEX32.HW,AX
MOV MOD_TD_LOCALS_COUNT,AX
endif
L9$:
RET
DO_FIRST:
MOV FIRST_MDB_GINDEX,EAX
JMP DF_9
PROCESS_MDB ENDP
FLUSH_COMDATS PROC NEAR
;
;THIS GUY SCANS LIST OF MYCOMDATS MAKING SURE THEY ARE FLUSHED
;
MOV EAX,LAST_MYCOMDAT_LINDEX
TEST EAX,EAX
JZ L9$
PUSHM EDI,ESI,EBX
MOV EBX,EAX
L1$:
MOV EAX,EBX
CONVERT_MYCOMDAT_EAX_ECX
ASSUME ECX:PTR MYCOMDAT_STRUCT
MOV EDX,[ECX]._MCD_SYMBOL_GINDEX ;CEXTDEF WITH NO DEFINITION?
MOV EBX,[ECX]._MCD_NEXT_MCD_LINDEX
OR EDX,EDX
JZ L5$
CALL FLUSH_COMDAT ;EAX IS LINDEX, ECX IS COMDAT PHYSICAL
L6$:
L8$:
TEST EBX,EBX
JNZ L1$
;
;ZERO OUT MCD HASH TABLE
;
MOV EDI,VIRDEF_MCD_HASH_TABLE_PTR
MOV ECX,VIRDEF_MCD_HASH_SIZE
XOR EAX,EAX
POP EBX
OPTI_STOSD
POPM ESI,EDI
L9$:
RET
L5$:
MOV AL,CEXTDEF_ERR
push EAX
call _err_abort
JMP L6$
FLUSH_COMDATS ENDP
IGNORES PROC
LOCSYM::
RET
LOCSYM32::
RET
TYPDEF::
MOV TYPDEF_ANDER,0
RET
BLKDEF:: RET
BLKEND:: RET
DEBSYM1:: RET
OVLDEF:: RET
ENDREC:: RET
LIBHED:: RET
LIBNAM:: RET
LIBLOC:: RET
LIBDIC:: RET
AC_WHAT::
REGINT:: RET
IGNORE_RECORD::
REGINT32:: RET
IGNORES ENDP
if debug
SAY_OMF_VERBOSE PROC
BITT VERBOSE_OMF
JZ L9$
CALL SAY_VERBOSE
L9$:
RET
SAY_OMF_VERBOSE ENDP
SAY_OMF_TYPE PROC
BITT VERBOSE_OMF
JZ L9$
PUSH EDI
MOV EAX,RECORD_TYPE
MOV EDI,OFF OMF_TYPE_HEX
CALL HEXWOUT
POP EDI
MOV EAX,OFF SAY_OMF_TYP_MSG
CALL SAY_VERBOSE
L9$:
RET
SAY_OMF_TYPE ENDP
endif
.CONST
ALIGN 4
REC_TABLE DCA RHEADR ;6E
DCA RHEADR ;6F
DCA REGINT ;70
DCA REGINT32 ;71
DCA REDATA ;72
DCA REDATA32 ;73
DCA RIDATA ;74
DCA RIDATA32 ;75
DCA OVLDEF ;76
DCA BAD_RECORD ;77
DCA ENDREC ;78
DCA BAD_RECORD ;79
DCA BLKDEF ;7A
DCA BLKDEF ;7B
DCA BLKEND ;7C
DCA BAD_RECORD ;7D
DCA DEBSYM1 ;7E
DCA BAD_RECORD ;7F
DCA THEADR ;80
DCA BAD_RECORD
DCA THEADR ;82 LHEADR
DCA THEADR ;83 LHEADR...
; DCA PEDATA ;84
; DCA PEDATA32 ;85
; DCA PIDATA ;86
; DCA PIDATA32 ;87
DCA BAD_RECORD ;84
DCA BAD_RECORD ;85
DCA BAD_RECORD ;86
DCA BAD_RECORD ;87
DCA COMENT ;88
DCA BAD_RECORD ;89
DCA MODEND ;8A
DCA MODEND32 ;8B
DCA EXTDEF ;8C
DCA EXTDEF ;8D
DCA TYPDEF ;8E
DCA BAD_RECORD ;8F
DCA PUBDEF ;90
DCA PUBDEF32 ;91
DCA LOCSYM ;92
DCA LOCSYM32 ;93
DCA LINNUM ;94
DCA LINNUM32 ;95
DCA LNAMES ;96
DCA BAD_RECORD ;97
DCA SEGDEF ;98
DCA SEGDEF32 ;99
DCA GRPDEF ;9A
DCA BAD_RECORD ;9B
DCA FIXUPP ;9C
DCA FIXUPP32 ;9D
DCA 2 DUP(BAD_RECORD)
DCA LEDATA ;A0
DCA LEDATA32 ;A1
DCA LIDATA ;A2
DCA LIDATA32 ;A3
DCA LIBHED ;A4
DCA BAD_RECORD ;A5
DCA LIBNAM ;A6
DCA BAD_RECORD ;A7
DCA LIBLOC ;A8
DCA BAD_RECORD ;A9
DCA LIBDIC ;AA
DCA BAD_RECORD ;AB
DCA AC_WHAT ;AC IGNORE FOR MICROFOCUS
DCA 3 DUP(BAD_RECORD)
DCA COMDEF ;B0
DCA BAD_RECORD
DCA FORREF ;B2 FORREF
DCA FORREF32 ;B3
DCA LEXTDF ;B4
DCA LEXTDF ;B5
DCA LPUBDF ;B6
DCA LPUBDF32 ;B7
DCA LCOMDF ;B8
DCA BAD_RECORD
DCA BAD_RECORD ;BA
DCA BAD_RECORD ;BB
DCA CEXTDEF ;BC COMDAT EXTERNAL NAMES
DCA BAD_RECORD ;BD
DCA BAD_RECORD ;BE
DCA BAD_RECORD ;BF
DCA BAD_RECORD ;C0
DCA BAD_RECORD ;C1
DCA COMDAT ;C2
DCA COMDAT32 ;C3
DCA LINSYM ;C4
DCA LINSYM32 ;C5
DCA ALIASS ;C6
DCA BAD_RECORD ;C7
DCA NBKPAT ;C8
DCA NBKPAT32 ;C9
DCA LLNAMES ;CA
DCA BAD_RECORD ;CB
DCA IGNORE_RECORD ;CC VERNUM
DCA BAD_RECORD ;CD
DCA BAD_RECORD ;CE
DCA BAD_RECORD ;CF
DCA BAD_RECORD ;D0
READINGMOD_MSG DB SIZEOF READINGMOD_MSG-1,'Loading '
FROMFILE_MSG DB SIZEOF FROMFILE_MSG-1,' from '
if debug
SAY_OMF_RET_MSG DB SIZEOF SAY_OMF_RET_MSG-1,' Returned',0DH,0AH
FLUSHING_COMDATS DB SIZEOF FLUSHING_COMDATS-1,'Flushing COMDATs',0DH,0AH
PROCESSING_EXTERNALS DB SIZEOF PROCESSING_EXTERNALS-1,'Processing Externals',0DH,0AH
PROCESSING_MDB DB SIZEOF PROCESSING_MDB-1,'Processing MDB',0DH,0AH
RELEASING_LOCAL_STORAGE DB SIZEOF RELEASING_LOCAL_STORAGE-1,'Releasing Local Storage',0DH,0AH
endif
.DATA
if debug
SAY_OMF_TYP_MSG DB SIZEOF SAY_OMF_TYP_MSG-1+4,'Calling RecTyp '
OMF_TYPE_HEX DB 'XXXX'
endif
END
| 18.547922 | 170 | 0.744284 |
968cdad4ad4d4fd58e919a66ff31158ee39c2343 | 47,599 | asm | Assembly | Driver/Swap/XMS/xms.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Driver/Swap/XMS/xms.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Driver/Swap/XMS/xms.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1989 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: Swap Driver -- XMS Manager version
FILE: xms.asm
AUTHOR: Adam de Boor, May 21, 1990
ROUTINES:
XmsStrategy Driver strategy routine
INT XmsStrategy Entry point for this here driver
INT XmsCheckFinal64K Verify that we can actually read and write
the final 64K of our extended memory block.
It is sufficient to ensure we can read and
write the first 128 bytes of the final 64K.
This is to detect a buggy version of
Microsoft's HIMEM.SYS that erroneously
includes the HMA in the total extended
memory available.
INT XmsAllocDos5UMBs Attempt to allocate upper memory blocks The
DOS 5 Way.
INT XmsInit Initialization routine for driver. In
separate resource so it can go away if need
be.
INT XmsExit Release external resources allocated by the
driver
INT XmsDoNothing Do-nothing routine for suspend/unsuspend
INT XmsSwapOut Swap a block out to extended memory with
the XMM's help
INT XmsSwapIn Swap a block in from xms
INT XmsDiscard Delete the swap space associated with a
block
INT XmsGetMap Return the segment of the swap map used by
the driver
INT XmsCompact Reduce the memory usage of the swap driver to
the desired target.
INT XmsFindPageAndLimit Figure the XMS handle to use for a
transfer, as well as the number of bytes we
can actually transfer.
INT XmsTransfer Perform a move to or from extended memory
or the HMA
INT XmsReadPage Read page(s) in from extended memory via
the XMM
INT XmsWritePage Write page(s) to extended memory via the
XMM
REVISION HISTORY:
Name Date Description
---- ---- -----------
Adam 5/90 Initial revision (from extmem.asm)
DESCRIPTION:
A driver to make use of memory above the 1Mb limit by means of a
manager/driver that obeys the XMS protocol.
Some implementation details:
When a block is swapped out, it is broken into pages and written
out that way. We use a smaller page size than is used in disk swapping
to reduce internal fragmentation, since the paging itself is
faster and much less is gained from paging out in large pieces.
We currently use a page size of 1K, just because.
Like all swap drivers, we use the Swap library to maintain our
swap map, allocate pages and tell us what to do. In general, the
DR_SWAP functions we export are implemented by loading the segment
of the swap map allocated for us by the library and calling a routine
in the library. It will then determine what pages are affected, or
allocate a list of pages, and call us back to perform the actual
transfer to or from XMS memory.
In the past, we would find how much extended memory was available
and allocate it all at once. This can screw up task-switching,
however, so we do things differently now. We still find how much
extended memory is available, and allocate the HMA if it's available,
and use that amount to size our swap map. We allocate extended
memory blocks only on demand, however. When we've been told to write
to a page for which we don't have an extended memory block, we
attempt to allocate a block for the page. If we can't, we return failure
and the Swap library deals with it.
TO DO:
$Id: xms.asm,v 1.1 97/04/18 11:58:03 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
_SwapDriver = 1
;------------------------------------------------------------------------------
; Include files
;------------------------------------------------------------------------------
include geos.def
include heap.def
include geode.def
include resource.def
include ec.def
include driver.def
include sem.def
include system.def
include file.def
include initfile.def
include drive.def
include disk.def
include Internal/interrup.def
include Internal/fileInt.def ;includes dos.def as well
include Internal/xms.def
DefDriver Internal/swapDr.def
UseLib Internal/swap.def
;------------------------------------------------------------------------------
; Constants
;------------------------------------------------------------------------------
;
; Constants we use
;
ERR_XMS_NESTED_INIT enum FatalErrors
ERR_XMS_BAD_PU_COUNT enum FatalErrors
ERR_XMS_GU_ERROR enum FatalErrors
ERR_XMS_CUR_NOT_NULL enum FatalErrors
ERR_XMS_SO_BAD_OFFSET enum FatalErrors
ERR_XMS_BAD_PAGE_INDEX enum FatalErrors
ERR_XMS_BIOS_ERROR enum FatalErrors
ERR_XMS_ADDR_OUT_OF_RANGE enum FatalErrors
ERR_XMS_INVALID_PROCESSOR enum FatalErrors
CANNOT_READ_SWAPPED_BLOCK enum FatalErrors
ERR_XMS_TOO_MUCH_MEMORY enum FatalErrors
ERR_XMS_USED_SPACE_MISMATCH enum FatalErrors
;
; Driver flags:
;
XmsFlags record
XF_INITIALIZED:1, ; Non-zero if DR_INIT called
XF_HAVE_HMA:1, ; Non-zero if we could allocate the HMA
XF_HAVE_PURPOSE:1, ; Non-zero if we have a reason to be here,
; either b/c of the HMA, an EMB or the UMBs
XF_DOS5:1, ; Non-zero if UMBs were allocated with new
; NIH DOS5 protocol.
XmsFlags end
XMS_PAGE_SIZE equ 1024
XMS_TEST_SIZE equ 128 ; Number of bytes to copy in and out of the
; first K in the final 64K of any extended
; memory block we allocate.
NUM_HMA_PAGES equ (64 * 1024 - 16) / XMS_PAGE_SIZE
HMA_SEGMENT equ 0xffff
HMA_BASE equ 0x10
HMA_SIZE equ (NUM_HMA_PAGES * XMS_PAGE_SIZE)
MAX_UMBS equ 8 ; Largest number of upper memory blocks we
; can allocate and give to the heap.
MAX_EMBS equ 8 ; The number of extended memory blocks we'll
; allocate, at most
SMALLEST_UMB equ 16 ; Number of paragraphs a UMB must be before
; we're willing to allocate it. There's a point
; of diminishing returns here, as the heap gets
; fragmented with small free UMBs separated
; by larger locked blocks. 256 bytes seems a
; reasonable threshold for now.
LOG_ACTIONS equ FALSE
;==============================================================================
; VARIABLES AND SUCH
;==============================================================================
idata segment
;
; Driver information table
;
DriverTable DriverInfoStruct <XmsStrategy,<>,DRIVER_TYPE_SWAP>
;
; State flags
;
xmsFlags XmsFlags <0,0,0,0,0>
idata ends
;------------------------------------------------------------------------------
; Uninitialized Variables
;------------------------------------------------------------------------------
udata segment
xmsSwapMap sptr.SwapMap (?)
xmsMoveParams XMSMoveParams
xmsUMBs sptr MAX_UMBS dup(0) ; Segments of allocated UMBs
xmsEMBs XMSExtendedMemoryBlock MAX_EMBS dup(<>) ; data for EMBs we've
; allocated so far
xmsAllocSize word ; Kb to try and allocate for each
; EMB (total size/MAX_EMBS)
xmsAllocPages word ; # pages in xmsAllocSize, so we don't
; try and allocate beyond our swap
; map.
;
; Entry point for the Extended Memory Manager, if it's around.
;
xmsAddr fptr.far ; Entry point for the XMM
XMS_PRESENT? = 0x4300 ; value in AX for int 2fh to determine
; if XMM is present
XMS_HERE = 0x80 ; value returned in al if manager is
; around
XMS_ADDRESS? = 0x4310 ; value in AX for int 2fh to fetch
; the entry point for the XMM
if LOG_ACTIONS
%out TURN OFF ACTION LOGGING BEFORE YOU INSTALL
MAX_LOG equ 128
logPtr word 0
OpType etype word
OP_READ enum OpType
OP_WRITE enum OpType
opLog OpType MAX_LOG dup(?)
segLog sptr MAX_LOG dup(?)
offLog word MAX_LOG dup(?)
sizeLog sword MAX_LOG dup(?)
pageLog word MAX_LOG dup(?)
endif
udata ends
idata segment
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
XmsStrategy
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Entry point for this here driver
CALLED BY: Kernel
PASS: di = function code
refer to swapDriver.def for interface
RETURN: depends on function invoked
DESTROYED: depends on function invoked
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 6/12/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
xmsFunctions nptr XmsExit, XmsDoNothing, XmsDoNothing,
XmsSwapOut, XmsSwapIn, XmsDiscard,
XmsGetMap, XmsCompact, XmsDealloc, XmsDoNothing
XmsStrategy proc far uses ds, es
.enter
segmov ds, dgroup, ax ; ds <- data segment
mov es, ax
;
; Special-case DR_INIT as it's in a movable module.
;
cmp di, DR_INIT
jne notInit
call XmsInit
done:
.leave
ret
notInit:
call cs:xmsFunctions-2[di]
jmp done
XmsStrategy endp
idata ends
Init segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
XmsCheckFinal64K
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Verify that we can actually read and write the final 64K
of our extended memory block. It is sufficient to ensure we
can read and write the first 128 bytes of the final 64K.
This is to detect a buggy version of Microsoft's HIMEM.SYS
that erroneously includes the HMA in the total extended
memory available.
CALLED BY: XmsInit
PASS: ds = dgroup
ax = number of Kb in our extended memory block
dx = the handle of our extended memory block
RETURN: ax = number of usable Kb in our extended memory block
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 5/ 6/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
XmsCheckFinal64K proc near
kbUsable local word \
push ax ; assume all of it's usable
kbTrimmed local word
uses bx, cx, dx, ds, es, si, di
.enter
mov ds:[xmsMoveParams].XMSMP_dest.XMSA_handle, dx
;
; Figure the Kb offset to which to copy. It should be 64 less than
; the total size. If the total size is less than 64K, however, just
; use an offset of 0.
;
sub ax, 64
jge setDest
clr ax ; just check offset 0
setDest:
mov ss:[kbTrimmed], ax
;
; Shift to multiply the result by 2**10 (1024)
;
clr bx
shl ax
rcl bx
shl ax
rcl bx
mov ds:[xmsMoveParams].XMSMP_dest.XMSA_offset.low.low, 0
mov ds:[xmsMoveParams].XMSMP_dest.XMSA_offset.low.high, al
mov ds:[xmsMoveParams].XMSMP_dest.XMSA_offset.high.low, ah
mov ds:[xmsMoveParams].XMSMP_dest.XMSA_offset.high.high, bl
;
; Allocate a block twice the size of the test sample so we've got
; a source from which to copy the test pattern out and a destination
; to which to copy it back.
;
mov cx, mask HF_FIXED
mov ax, XMS_TEST_SIZE*2
call MemAlloc
mov es, ax ; es <- test block
;
; Initialize the low half of the block to some nice pattern, in this
; case b[0] = block handle, b[i+1] = b[i]+17.
;
clr di
mov ax, bx
mov cx, XMS_TEST_SIZE/2
initLoop:
stosw
add ax, 17
loop initLoop
;
; Perform the move out to extended memory.
;
mov ds:[xmsMoveParams].XMSMP_source.XMSA_handle, 0
mov ds:[xmsMoveParams].XMSMP_source.XMSA_offset.offset, 0
mov ds:[xmsMoveParams].XMSMP_source.XMSA_offset.segment, es
mov ds:[xmsMoveParams].XMSMP_count.low, XMS_TEST_SIZE
mov ah, XMS_MOVE_EMB
mov si, offset xmsMoveParams
call ds:[xmsAddr]
tst ax
jz trim
;
; Now swap the source and dest, setting the dest to the second half of
; the test staging area we allocated.
;
clr ax
xchg ax, ds:[xmsMoveParams].XMSMP_dest.XMSA_handle
mov ds:[xmsMoveParams].XMSMP_source.XMSA_handle, ax
mov ax, XMS_TEST_SIZE
xchg ax, ds:[xmsMoveParams].XMSMP_dest.XMSA_offset.offset
mov ds:[xmsMoveParams].XMSMP_source.XMSA_offset.offset, ax
mov ax, es
xchg ax, ds:[xmsMoveParams].XMSMP_dest.XMSA_offset.segment
mov ds:[xmsMoveParams].XMSMP_source.XMSA_offset.segment, ax
mov ah, XMS_MOVE_EMB
call ds:[xmsAddr]
tst ax
jz trim
;
; Compare the two halves.
;
push ds
segmov ds, es
clr si
mov di, XMS_TEST_SIZE
mov cx, XMS_TEST_SIZE/2
repe cmpsw
pop ds
je done
trim:
mov ax, ss:[kbTrimmed]
mov ss:[kbUsable], ax
done:
;
; Recover the staging-area's handle from its first word (clever of us
; to use that pattern, wot?) and free the bloody thing.
;
mov bx, es:[0]
call MemFree
;
; Fetch the number of usable K on which we decided..
;
mov ax, ss:[kbUsable]
.leave
ret
XmsCheckFinal64K endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
XmsAllocDos5UMBs
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Attempt to allocate upper memory blocks The DOS 5 Way.
CALLED BY: XmsInit
PASS: es:di = xmsUMBs
ds = dgroup
RETURN: xmsFlags.XF_DOS5 if UMBs couldn't be allocated
xmsUMBs filled in (up to XMS_MAX_UMBS) with segments of
allocated upper (or conventional, actually) memory
blocks if they could be allocated.
DESTROYED: ax, bx, cx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 5/ 6/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
XmsAllocDos5UMBs proc near
.enter
;
; Get current allocator state so we can restore it.
;
mov ax, MSDOS_GET_UMB_LINK
call FileInt21
push ax ; save UMB link status for end
mov ax, MSDOS_GET_STRAT
call FileInt21
push ax ; save previous allocation strategy
;
; Now give us access to the upper memory, dammit.
;
mov ax, MSDOS_SET_UMB_LINK
; DOS may only care about the byte in bl, but NTVDM looks
; at the whole word. Go figure. Thanks to Marcus Groeber
; for finding this one. -dhunter 1/17/2000
mov bx, 1 ; include upper memory in your fascist
; search
call FileInt21
jc done
;
; First fit in UMB, please oh mighty Microsoft, God of
; All Operating Systems...
;
mov ax, MSDOS_SET_STRAT
mov bl, DosAllocStrat <1, DAS_FIRST_FIT>
call FileInt21
jc done
;
; Keep trying to allocate useful blocks until everything is ours.
; ha ha ha ha ha ha!
;
allocLoop:
mov bx, 0xffff ; return largest value, please
mov ah, MSDOS_ALLOC_MEM_BLK
call FileInt21
jnc haveBlock ; wheeeeeee. unlikely, but what the
; f***. It could happen. It could!
cmp ax, ERROR_INSUFFICIENT_MEMORY
jne done
cmp bx, SMALLEST_UMB; too small to be useful?
jb done ; yes -- ignore it
mov ah, MSDOS_ALLOC_MEM_BLK
call FileInt21
jc done
haveBlock:
; ax = segment of allocated block.
stosw
mov cx, bx ; cx <- block length (paras)
; ax already segment
call MemExtendHeap
cmp di, offset xmsUMBs + size xmsUMBs
jb allocLoop
done:
;
; Restore the allocation strategy, etc.
;
pop bx
mov ax, MSDOS_SET_STRAT
call FileInt21
pop bx
clr bh ; GET_UMB_LINK returns only a
; byte, but SET_UMB_LINK insists
; on a word... -- ardeb 6/7/91
mov ax, MSDOS_SET_UMB_LINK
call FileInt21
;
; See if we netted any UMBs out of this. If not, clear the XF_DOS5
; flag. If so, set the XF_HAVE_PURPOSE
;
mov al, ds:[xmsFlags]
andnf al, not mask XF_DOS5 ; assume the worst
cmp di, offset xmsUMBs
je exit
ornf al, mask XF_DOS5 or mask XF_HAVE_PURPOSE
exit:
mov ds:[xmsFlags], al
.leave
ret
XmsAllocDos5UMBs endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
XmsInit
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Initialization routine for driver. In separate
resource so it can go away if need be.
CALLED BY: XmsInit
PASS: DS = dgroup
RETURN: Carry set on error
DESTROYED: AX, BX, ...
PSEUDO CODE/STRATEGY:
Set the XF_INITIALIZED flag
Attempt to allocate the HMA, setting XF_HAVE_HMA if we can
Find the largest free block in extended memory and allocate it.
Allocate a swap map big enough to cover the space allocated.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 6/ 7/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
XmsInit proc far uses es, di, si
numPages local word
.enter
mov numPages, 0
;
; Make sure DOS is >= 3.0
;
mov ax, MSDOS_GET_VERSION shl 8
call FileInt21
cmp al, 3
LONG jb outtaHere ; => major version < 3, so no XMS
; possible.
;
; If version is 5.0+, flag a possible need for DOS5 UMB support.
;
cmp al, 5
jb checkXms
ornf ds:[xmsFlags], mask XF_DOS5
checkXms:
;
; See if an Extended Memory Manager is present.
;
mov ax, XMS_PRESENT?
int 2fh
cmp al, XMS_HERE
je fetchXMSAddr
stc
jmp outtaHere
fetchXMSAddr:
;
; Fetch the entry address for the thing.
;
EC < push es ; avoid segment-checking death >
mov ax, XMS_ADDRESS?
int 2fh
mov ds:xmsAddr.offset, bx
mov ds:xmsAddr.segment, es
EC < pop es >
;
; Allocate the HMA if possible.
;
mov ah, XMS_ALLOC_HMA
mov dx, 0xffff ; Give us all of it, precioussss
call ds:xmsAddr
tst ax
jz tryForEMB
;
; Turn on A20 until we exit -- no one around here relies on the wrapping
; at 1Mb... XXX: Of course, lord knows about Other People's Software
;
mov ah, XMS_GLOBAL_ENABLE_A20
call ds:xmsAddr
;
; Note that we have the HMA and a purpose, adding the number of
; pages in the HMA to our total.
;
ornf ds:xmsFlags, mask XF_HAVE_HMA or mask XF_HAVE_PURPOSE
add numPages, NUM_HMA_PAGES
tryForEMB:
;
; Allocate the largest free EMB.
; XXX: Allocate them all, if more than one?
;
mov ah, XMS_QUERY_FREE_EMB
call ds:xmsAddr
tst ax
jz checkUMB
push ax ; Save block size...
mov dx, ax ; Give me THIS much
mov ah, XMS_ALLOC_EMB
call ds:xmsAddr
tst ax ; success?
pop ax
jz checkUMB ; Nope. Yuck
call XmsCheckFinal64K
tst ax ; anything useful?
jnz haveEMB ; yup -- keep it
mov ah, XMS_FREE_EMB; bleah
call ds:[xmsAddr]
jmp checkUMB
haveEMB:
ornf ds:xmsFlags, mask XF_HAVE_PURPOSE
;
; Free the thing again. We allocated it only so we could call
; XmsCheckFinal64K
;
push ax
mov ah, XMS_FREE_EMB
call ds:[xmsAddr]
pop ax
;
; If not working in Kb pages, adjust AX to reflect the number of
; pages, given it's the number of Kb available.
;
IF XMS_PAGE_SIZE LT 1024
; smaller than a K, must multiply by ratio
mov di, 1024/XMS_PAGE_SIZE
mul di
ELSEIF XMS_PAGE_SIZE GT 1024
; more than a K, must divide by ratio
mov di, XMS_PAGE_SIZE/1024
clr dx
div di
ENDIF
;
; All pages are free at this point.
;
add numPages, ax
;
; Figure the number to allocate for each EMB
;
add ax, MAX_EMBS-1
IF MAX_EMBS ne 8
cbw
mov cx, MAX_EMBS
div cx
ELSE
shr ax
shr ax
shr ax
ENDIF
mov ds:[xmsAllocPages], ax
IF XMS_PAGE_SIZE ne 1024
mov dx, XMS_PAGE_SIZE
mul dx
add ax, 1023 ; round allocation up to be sure
adc dx, 0 ; all pages will fit
mov cx, 1024
div cx
ENDIF
mov ds:[xmsAllocSize], ax
checkUMB:
;
; Now allocate up to MAX_UMBS upper memory blocks for the heap, if
; they're available.
;
segmov es, ds ; es <- dgroup to make life easier
mov di, offset xmsUMBs
umbLoop:
;
; Find the size of the next largest UMB. The initial ALLOC call
; must fail, since we're asking for 1Mb (DX is in paragraphs).
;
mov dx, 0xffff
mov ah, XMS_ALLOC_UMB
call ds:xmsAddr
cmp bl, XMS_SMALLER_UMB_AROUND
jne checkDos5UMB ;some other error, so we're done
;
; If any UMB is around, DOS5 can't have snagged them all...
;
andnf ds:[xmsFlags], not mask XF_DOS5
;
; See if the block is too small to be useful. If so, break
; out, as we assume nothing larger is around...
;
cmp dx, SMALLEST_UMB
jb checkDos5UMB
;
; Allocate the returned amount.
;
mov ah, XMS_ALLOC_UMB
call ds:xmsAddr
tst ax
jz checkDos5UMB ; shouldn't happen
ornf ds:xmsFlags, mask XF_HAVE_PURPOSE
xchg ax, bx ; ax <- segment
stosw ; save the segment
mov cx, dx ; cx <- block length (paras)
call MemExtendHeap
cmp di, offset xmsUMBs + size xmsUMBs
jb umbLoop
checkDos5UMB:
cmp di, offset xmsUMBs
jne seeIfUseful
test ds:[xmsFlags], mask XF_DOS5
jz seeIfUseful
;
; Well, it looks like DOS 5 has snagged them all, so let's get down to
; the business of allocating the blocks Their Way.
;
call XmsAllocDos5UMBs
seeIfUseful:
;
; We've done all we can do. See if we've accomplished anything.
;
test ds:xmsFlags, mask XF_HAVE_PURPOSE
stc
jz outtaHere
ornf ds:[xmsFlags], mask XF_INITIALIZED
;
; Allocate a swap map if we actually have some swap space.
;
mov ax, numPages
tst ax
jz noSwapMap
push bp
mov bx, handle 0
mov cx, XMS_PAGE_SIZE
mov si, segment XmsWritePage
mov di, offset XmsWritePage
mov dx, segment XmsReadPage
mov bp, offset XmsReadPage
call SwapInit
pop bp
jc outtaHere
mov ds:[xmsSwapMap], ax
;
; Tell the kernel we're here...
;
mov cx, segment XmsStrategy
mov dx, offset XmsStrategy
mov ax, SS_PRETTY_FAST
call MemAddSwapDriver
jc outtaHere ; Couldn't register, so return error.
noSwapMap:
;
; Make the init code be discard-only now, since we need it no
; longer.
;
mov bx, handle Init
mov ax, mask HF_DISCARDABLE or (mask HF_SWAPABLE shl 8)
call MemModifyFlags
clc
outtaHere:
.leave
ret
XmsInit endp
Init ends
idata segment
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
XmsExit
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Release external resources allocated by the driver
CALLED BY: DR_EXIT
PASS: ds=es=dgroup
RETURN: nothing
DESTROYED: ax, dx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 6/16/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
XmsExit proc near
uses es, si
.enter
;
; Release the HMA and turn off A20 if we were able to allocate the
; sucker.
;
test ds:xmsFlags, mask XF_HAVE_HMA
jz releaseEMBs
mov ah, XMS_FREE_HMA
call ds:xmsAddr
mov ah, XMS_GLOBAL_DISABLE_A20
call ds:xmsAddr
releaseEMBs:
;
; Free any extended memory blocks we were able to allocate.
;
mov si, offset xmsEMBs
freeEMBLoop:
clr dx
xchg dx, ds:[si].XMSEMB_handle
tst dx
jz releaseUMBs
mov ah, XMS_FREE_EMB
call ds:[xmsAddr]
add si, size XMSExtendedMemoryBlock
cmp si, offset xmsEMBs + size xmsEMBs
jb freeEMBLoop
releaseUMBs:
;
; Release any upper-memory blocks we allocated. We are guaranteed
; that nothing of interest resides in them now...
;
mov si, offset xmsUMBs
freeUMBLoop:
lodsw
tst ax
jz done
test ds:[xmsFlags], mask XF_DOS5
jnz freeDOS5UMB
xchg ax, dx
mov ah, XMS_FREE_UMB
call ds:xmsAddr
nextUMB:
cmp si, offset xmsUMBs + size xmsUMBs
jb freeUMBLoop
done:
andnf ds:xmsFlags, not mask XF_INITIALIZED
.leave
ret
freeDOS5UMB:
mov es, ax
mov ah, MSDOS_FREE_MEM_BLK
call FileInt21
jmp nextUMB
XmsExit endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
XmsDoNothing
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Do-nothing routine for suspend/unsuspend
CALLED BY: DR_SUSPEND, DR_UNSUSPEND
PASS: who cares?
RETURN: carry clear
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 5/19/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
XmsDoNothing proc near
.enter
clc
.leave
ret
XmsDoNothing endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
XmsUnsuspend
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Coming back from an unsuspend, reallocate UMBs and HMA.
Re-enable A20.
CALLED BY: Special circumstances...
PASS:
RETURN:
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
CL 2/ 2/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
XmsUnsuspend proc near
uses ax,bx,cx,dx,si,di,bp
.enter
;
; Get HMA back if necessary.
;
test ds:[xmsFlags], mask XF_HAVE_HMA
jz reallocUMBs
mov ah, XMS_ALLOC_HMA
mov dx, 0xffff
call ds:xmsAddr
tst ax
jz error
mov ah, XMS_GLOBAL_ENABLE_A20
call ds:xmsAddr
reallocUMBs:
;
; Oh boy...
;
exit:
.leave
ret
error:
;
; Unexpectedly, something we should be able to reallocate could
; not be reallocated. What now?
;
stc
jmp exit
XmsUnsuspend endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
XmsSwapOut
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Swap a block out to extended memory with the XMM's help
CALLED BY: DR_SWAP_SWAP_OUT
PASS: dx = segment of data block
cx = size of data block (bytes)
RETURN: carry clear if no error
ax = swap ID of block
DESTROYED: cx, di
PSEUDO CODE/STRATEGY:
Allocate room for the block in the HMA or our EMB. If can't, return
error.
Write each page out to the memory via the XMM (XXX: do things
contiguously?)
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 6/14/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
XmsSwapOut proc near
.enter
mov ax, ds:[xmsSwapMap]
call SwapWrite
.leave
ret
XmsSwapOut endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
XmsSwapIn
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Swap a block in from xms
CALLED BY: DR_SWAP_SWAP_IN
PASS: ds = dgroup
bx = ID of swapped data (initial page)
dx = segment of destination block
cx = size of data block (bytes)
RETURN: carry clear if no error
DESTROYED: ax, bx, cx (ds, es preserved by XmsStrategy)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 3/89 Initial version
ardeb 12/ 9/89 Changed to single-swapfile model
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
XmsSwapIn proc near
.enter
mov ax, ds:[xmsSwapMap]
call SwapRead
.leave
ret
XmsSwapIn endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
XmsDiscard
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Delete the swap space associated with a block
CALLED BY: DR_SWAP_DISCARD
PASS: bx = ID returned from DR_SWAP_SWAP_OUT (first page #)
ds = dgroup
RETURN: carry clear if no error
DESTROYED: ax, bx
PSEUDO CODE/STRATEGY:
Free up the page list whose head is bx
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 4/88 Initial version
Tony 10/88 Comments from Jim's code review added
ardeb 12/9/89 Changed to single-swapfile model
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
XmsDiscard proc near
.enter
mov ax, ds:[xmsSwapMap]
call SwapFree
.leave
ret
XmsDiscard endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
XmsGetMap
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Return the segment of the swap map used by the driver
CALLED BY: DR_SWAP_GET_MAP
PASS: ds = dgroup
RETURN: ax = segment of SwapMap
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 8/22/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
XmsGetMap proc near
.enter
mov ax, ds:[xmsSwapMap]
.leave
ret
XmsGetMap endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
XmsCompact
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Relocate the data in XMS extended memory so that there
is at least a certain amount of free space left.
CALLED BY: DR_SWAP_COMPACT
PASS: bx = in Kbytes, the desired amount of free space.
dx = swap driver ID (i.e., what's stored in
HSM_swapDriver for blocks swapped to this
device.)
ds = dgroup
RETURN: if success:
carry clear
ax = Kbytes used by this swap driver
else:
carry set.
DESTROYED: nothing
SIDE EFFECTS:
- Mucks with the handle table...
PSEUDO CODE/STRATEGY:
- figure out the maximum page number below which we have to stay
in order to satisfy the target.
- walk the handle table looking for blocks marked swapped to this
driver. For each block, check if any pages are above the desired
target. If so, look in the free list for a slot below the limit
page number.
- stop if we either run out of free pages below the limit (fail)
or we have run through the whole handle table (success).
REVISION HISTORY:
Name Date Description
---- ---- -----------
CL 12/ 9/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
XmsCompact proc near
uses bx,cx,dx,es,di
.enter
mov cx, dx ;swap driver ID
;
; How much total swap space do we have?
;
mov ax, ds:[xmsSwapMap]
mov es, ax
mov ax, es:[SM_total]
;
; don't count the HMA pages
;
test ds:xmsFlags, mask XF_HAVE_HMA
jz havePages
sub ax, NUM_HMA_PAGES
havePages:
IF XMS_PAGE_SIZE LT 1024
; smaller than a K, must multiply by ratio
mov di, 1024/XMS_PAGE_SIZE
mul di
ELSEIF XMS_PAGE_SIZE GT 1024
; more than a K, must divide by ratio
mov di, XMS_PAGE_SIZE/1024
clr dx
div di
ENDIF
;
; What is the maximum space this swap device can occupy?
;
sub ax, bx
mov dx, ax ;dx = maximum Kbytes
mov ax, ds:[xmsSwapMap]
call SwapCompact
mov ax, dx ;ax = maximum Kbytes
.leave
ret
XmsCompact endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
XmsDealloc
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Free all Upper Memory Blocks and all possible Extended
Memory Blocks.
CALLED BY: DR_SWAP_DEALLOC
PASS: bx = Kbytes used by this swap driver.
ds = dgroup
RETURN: if success:
carry clear
else:
carry set
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
CL 2/ 1/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
XmsDealloc proc near
uses ax,bx,cx,dx,si,di
.enter
if 0
;;
;; This error check code is only useful in limited cases.
;;
push ax,bx,cx,es,di
;
; The number of used bytes passed in ax should equal the total swap
; space minus the number of free pages.
;
mov ax, ds:[xmsSwapMap]
mov es, ax
mov ax, es:[SM_total]
sub ax, es:[SM_numFree] ;ax = total pages used
;
; don't count the HMA pages
;
test ds:xmsFlags, mask XF_HAVE_HMA
jz havePages
sub ax, NUM_HMA_PAGES
havePages:
IF XMS_PAGE_SIZE LT 1024
; smaller than a K, must multiply by ratio
mov di, 1024/XMS_PAGE_SIZE
mul di
ELSEIF XMS_PAGE_SIZE GT 1024
; more than a K, must divide by ratio
mov di, XMS_PAGE_SIZE/1024
clr dx
div di
ENDIF
cmp ax, bx
ERROR_NE ERR_XMS_USED_SPACE_MISMATCH
pop ax,bx,es,di
endif
;
; All the pages used by the XMS swap driver have been compacted
; into the lower ax kbytes of the allocated EMBs.
; Now walk through xmsEMBs, and free or don't touch each EMB.
;
mov ax, bx ;used space
mov bx, ds:[xmsAllocSize] ;size of each EMB.
mov cx, MAX_EMBS
mov si, offset xmsEMBs
embLoop:
; when ax becomes negative, start freeing those blocks.
sub ax, bx
jge dontFree
mov dx, ds:[si].XMSEMB_handle
tst dx
jz dontFree
push ax
mov ah, XMS_FREE_EMB
call ds:[xmsAddr]
EC < cmp ax, 0 >
EC < ERROR_Z -1 >
jz error
clr ds:[si].XMSEMB_handle
pop ax
dontFree:
add si, size XMSExtendedMemoryBlock
loop embLoop
;
; Don't release UMBs and HMA for now... HACK.
;
jmp done
;
; Release HMA and turn off A20 if we were able to allocate it.
;
test ds:xmsFlags, mask XF_HAVE_HMA
jz releaseUMBs
mov ah, XMS_FREE_HMA
call ds:xmsAddr
mov ah, XMS_GLOBAL_DISABLE_A20
call ds:xmsAddr
releaseUMBs:
;
; Release any upper-memory blocks we allocated. We are guaranteed
; that nothing of interest resides in them now...
;
mov si, offset xmsUMBs
freeUMBLoop:
lodsw
tst ax
jz noMore
test ds:[xmsFlags], mask XF_DOS5
jnz freeDOS5UMB
xchg ax, dx
mov ah, XMS_FREE_UMB
call ds:xmsAddr
nextUMB:
cmp si, offset xmsUMBs + size xmsUMBs
jb freeUMBLoop
noMore:
clc
done:
.leave
ret
error:
stc
jmp done
freeDOS5UMB:
mov es, ax
mov ah, MSDOS_FREE_MEM_BLK
call FileInt21
jmp nextUMB
XmsDealloc endp
;==============================================================================
;
; UTILITY AND CALLBACK ROUTINES
;
;==============================================================================
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
XmsFindPageAndLimit
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Figure the XMS handle to use for a transfer, as well as the
number of bytes we can actually transfer.
CALLED BY: XmsTransfer
PASS: ax = page number (always from the start of the extended
area, i.e. if we've got the HMA, NUM_HMA_PAGES
will have been subtracted from what the Swap
library passed us)
xmsMoveParams.XMSMP_count.low total bytes left in the transfer
ds:bx = XMSAddr in which the EMB address should be placed when
we've found it.
es = segment of swap map
RETURN: carry set if transfer cannot take place (couldn't allocate
an EMB for the page)
carry clear if all set:
cx = bytes left to transfer after this one
ax = starting page of transfer after this one
xmsMoveParams.XMSMP_count.low adjusted to hold the
number of bytes that can be transferred
this time
ds:[bx] set up appropriately
DESTROYED: si
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 10/2/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
XmsFindPageAndLimit proc near
uses di, dx
.enter
;
; Look for the block that contains the starting page.
;
mov si, offset xmsEMBs
mov di, ax
findLoop:
tst ds:[si].XMSEMB_handle ; any memory?
jz allocNew ; no -- allocate some
sub ax, ds:[si].XMSEMB_pages; reduce page by number in
; this block
jb foundBlock ; => starting page is in
; this block
add si, size XMSExtendedMemoryBlock
cmp si, offset xmsEMBs + size xmsEMBs
jb findLoop
fail:
stc ; page beyond all allocated blocks and no
; room to store the handle for a new one,
; so return carry set to signal our
; displeasure.
done:
.leave
ret
foundBlock:
add ax, ds:[si].XMSEMB_pages ; ax <- pages into
; emb at which to start
; transfer
;
; Calculate pages left to transfer, rounding count up, of course
;
push ax ; save page offset into EMB for later
mov ax, ds:[xmsMoveParams].XMSMP_count.low
clr dx
mov cx, es:[SM_page]
dec cx
add ax, cx ; + page_size-1...
adc dx, 0
inc cx
div cx ; ax <- # pages left to transfer
pop dx ; dx <- page w/in this EMB
add ax, dx ; ax <- ending page + 1
sub ax, ds:[si].XMSEMB_pages ; all in this block?
jbe transferFits ; yes
;
; Transfer spans a block boundary, so adjust the byte count for our
; caller and figure the parameters for the transfer after this one.
; dx = page w/in EMB, di = global starting page
; end up w/di = global starting page for next transfer, cx =
; bytes left after this transfer.
;
mov ax, ds:[si].XMSEMB_pages
sub ax, dx ; ax <- # pages to transfer this time
add di, ax ; di <- starting global page for next
; time
push dx
mul cx ; ax <- # bytes to transfer
pop dx
mov cx, ax ; save that in CX
xchg ds:[xmsMoveParams].XMSMP_count.low, ax
sub ax, cx ; ax <- # bytes to transfer next time
mov_trash cx, ax
figureStart:
;
; Finally, figure the handle and transfer offset w/in the EMB we've
; selected.
;
; di = starting global page for next time
; cx = bytes for next transfer
; dx = starting page w/in this EMB
; ds:si = XMSExtendedMemoryBlock
; ds:bx = XMSAddr to fill in
; es = SwapMap
; xmsMoveParams.XMSMP_count set
;
mov ax, es:[SM_page]
mul dx
mov ds:[bx].XMSA_offset.low, ax
mov ds:[bx].XMSA_offset.high, dx
mov ax, ds:[si].XMSEMB_handle
mov ds:[bx].XMSA_handle, ax
mov_trash ax, di ; ax <- page for next time
clc
jmp done
transferFits:
;
; Transfer fits wholy within the block we found, so set CX to 0 so
; our caller knows there's nothing more it needs to do. No other
; registers need adjusting, since we won't be back again.
;
clr cx
jmp figureStart
;--------------------
allocNew:
;
; Allocate a new extended memory block, if possible. First figure the
; number of pages we think we should allocate (1/MAX_EMBSth of the
; total that were available when we started), making sure that adding
; that many pages won't overshoot our swap map
;
push ax, bx
sub ax, di
neg ax ; ax <- pages in previous blocks
mov dx, ds:[xmsAllocPages]
add ax, dx
sub ax, es:[SM_total]
jbe allocIt
sub dx, ax
allocIt:
IF XMS_PAGE_SIZE ne 1024
;
; Convert pages to Kb
;
mov ax, XMS_PAGE_SIZE
mul dx
add ax, 1023
adc dx, 0
mov cx, 1024
div cx
mov dx, ax
ENDIF
;
; See if there's that much around. We'll settle for less if that's
; all we'll get.
;
mov cx, dx ; preserve #K we'd like
mov ah, XMS_QUERY_FREE_EMB
call ds:[xmsAddr] ; ax <- largest free block
cmp ax, cx ; more than we need?
jae doAlloc ; yup.
mov_trash cx, ax ; reduce our expectations
doAlloc:
;
; Allocate however much we've decided on.
;
mov dx, cx
mov ah, XMS_ALLOC_EMB
call ds:[xmsAddr]
tst ax ; alloc successful?
pop ax, bx
jz fail ; nope -- transfer fails
;
; Store away the handle and the number of pages we actually allocated.
;
mov ds:[si].XMSEMB_handle, dx
if XMS_PAGE_SIZE ne 1024
;
; Compute pages from Kb...
;
push ax
mov_trash ax, cx
mov cx, 1024
mul cx
mov cx, XMS_PAGE_SIZE
div cx
mov ds:[si].XMSEMB_pages, ax
pop ax
else
;
; Pages & Kb are one and the same, so just store the size we alloced
;
mov ds:[si].XMSEMB_pages, cx
endif
;
; Go see if that was enough.
;
jmp findLoop
XmsFindPageAndLimit endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
XmsTransfer
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Perform a move to or from extended memory or the HMA
CALLED BY: XmsReadPage, XmsWritePage
PASS: ax = page number
cx = number of bytes to read
bx = XMSAddr in which to store EMB address from page
number
di = XMSAddr for conventional address
es = segment of SwapMap
RETURN: carry set on error:
cx = bytes actually transferred
DESTROYED: ax, bx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 6/17/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
XmsTransfer proc near uses dx, ds, si
.enter
call SwapLockDOS ; XMS is supposed to be re-entrant,
; but we try to be careful w.r.t.
; Other People's Software
segmov ds, cs
;
; Store the count first so we can handle fall-through gracefully
;
mov ds:[xmsMoveParams].XMSMP_count.low, cx
;
; See if we're accessing the HMA or the EMB.
;
test ds:[xmsFlags], mask XF_HAVE_HMA
jz doEMB
sub ax, NUM_HMA_PAGES
jae doEMB
push ds, es, di, bx ; Save additional registers
;
; Accessing the HMA, but might overlap into the EMB. Do as much
; as we can in real mode, then fall through, if necessary.
;
add ax, NUM_HMA_PAGES ; Bring it back up...
mul es:[SM_page] ; Figure offset in HMA
mov si, ax ; adjusting for starting
add si, HMA_BASE ; offset of the HMA itself
mov ds:[bx].XMSA_offset.offset, si ; Store in proper place
mov ds:[bx].XMSA_offset.segment, HMA_SEGMENT
;
; Save conventional offset in BX for "overflow" handler.
;
mov bx, di
;
; Set up ds:si and es:di to point to the source/dest for the move.
;
lds si, cs:xmsMoveParams.XMSMP_source.XMSA_offset
les di, cs:xmsMoveParams.XMSMP_dest.XMSA_offset
;
; See if the move crosses the boundary from the HMA to the EMB.
;
add ax, cx ; dx:ax = ending offset
adc dx, 0
jnz overflow ; => carried into high word
cmp ax, HMA_SIZE ; bigger than HMA?
jae overflow ; ja...
doHMA:
shr cx ; move words please
rep movsw
pop ds, es, di, bx ; Restore additional registers
tst dx ; fall through?
jz done ; nope...we're done
clr ax ; start transfer at EMB page 0
doEMB:
segmov ds, cs ; ds:bx = XMSAddr in EMB
embLoop:
;
; Read/write the extended memory block.
; ax = page number in the EMB.
; ds:bx = XMSAddr in EMB
; ds:di = XMSAddr in conventional
; ds:[xmsMoveParams].XMSMP_count = bytes to transfer
; dx = bytes transferred so far
;
call XmsFindPageAndLimit
jc fail
push ax, bx
mov si, offset xmsMoveParams
mov ah, XMS_MOVE_EMB
call ds:[xmsAddr]
shr ax ; Set carry if AX == 0
cmc
pop ax, bx ; recover extended XMSAddr & next page
jc fail
;
; Record those bytes as transferred.
;
add dx, ds:[xmsMoveParams].XMSMP_count.low
jcxz done ; => nothing more to move
;
; Adjust conventional address by amount transferred, setting
; count for next transfer.
;
xchg ds:[xmsMoveParams].XMSMP_count.low, cx
add ds:[di].XMSA_offset.offset, cx
jmp embLoop
done:
call SwapUnlockDOS
.leave
ret
fail:
mov cx, dx ; return # bytes actually written
jmp done
overflow:
;
; Handle boundary crossing:
; - subtract HMA_SIZE from the ending offset to get the number of
; bytes in the EMB affected by the move, storing this as the
; count for the move (for when we fall into doEMB).
; - Reduce the number of bytes affected in the HMA by the same
; amount, adding the final number to the offset in conventional
; for the fall-through.
; - set DX to the number of bytes that'll be transferred. This
; will be non-zero, so we use that above to note that we need
; to fall through to copy things to extended memory.
; Note: conventional XMSAddr offset was shifted into BX for our
; use up above.
;
sub ax, HMA_SIZE
mov cs:xmsMoveParams.XMSMP_count.low, ax
sub cx, ax ; adjust amt to move by amt not moved
mov dx, cx ; signal overflow/record amt moved
add cs:[bx].XMSA_offset.offset, cx
jmp doHMA
XmsTransfer endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
XmsReadPage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Read page(s) in from extended memory via the XMM
CALLED BY: SwapRead
PASS: ds:dx = address to which to read the page(s)
ax = starting page number
cx = number of bytes to read
es = segment of SwapMap
RETURN: carry set if all bytes could not be read
DESTROYED: ax, bx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 6/17/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
XmsReadPage proc far
uses di, cx
.enter
if LOG_ACTIONS
mov bx, cs:[logPtr]
mov cs:opLog[bx], OP_READ
mov cs:segLog[bx], ds
mov cs:offLog[bx], dx
mov cs:sizeLog[bx], cx
mov cs:pageLog[bx], ax
inc bx
inc bx
cmp bx, MAX_LOG * word
jne 10$
clr bx
10$:
mov cs:[logPtr], bx
endif
mov cs:xmsMoveParams.XMSMP_dest.XMSA_handle, 0
mov cs:xmsMoveParams.XMSMP_dest.XMSA_offset.offset, dx
mov cs:xmsMoveParams.XMSMP_dest.XMSA_offset.segment, ds
mov bx, offset xmsMoveParams.XMSMP_source
mov di, offset xmsMoveParams.XMSMP_dest
call XmsTransfer
EC < ERROR_C CANNOT_READ_SWAPPED_BLOCK >
.leave
ret
XmsReadPage endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
XmsWritePage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Write page(s) to extended memory via the XMM
CALLED BY: SwapWrite
PASS: ds:dx = address from which to write the page(s)
ax = starting page number
cx = number of bytes to write
es = segment of SwapMap
RETURN: carry set if all bytes could not be written
cx = # bytes actually written
DESTROYED: ax, bx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 6/17/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
XmsWritePage proc far
uses di
.enter
if LOG_ACTIONS
mov bx, cs:[logPtr]
mov cs:opLog[bx], OP_WRITE
mov cs:segLog[bx], ds
mov cs:offLog[bx], dx
mov cs:sizeLog[bx], cx
mov cs:pageLog[bx], ax
inc bx
inc bx
cmp bx, MAX_LOG * word
jne 10$
clr bx
10$:
mov cs:[logPtr], bx
endif
mov cs:xmsMoveParams.XMSMP_source.XMSA_handle, 0
mov cs:xmsMoveParams.XMSMP_source.XMSA_offset.offset, dx
mov cs:xmsMoveParams.XMSMP_source.XMSA_offset.segment, ds
mov bx, offset xmsMoveParams.XMSMP_dest
mov di, offset xmsMoveParams.XMSMP_source
call XmsTransfer
.leave
ret
XmsWritePage endp
idata ends
| 25.038927 | 80 | 0.607555 |
11771b0d61c14e496b1a7d2bbe76f84cb6c8bd65 | 661 | asm | Assembly | src/boss_jingle_bass.asm | Gegel85/SpaceShooterGB | 7f1ff08708fd3ad91c911c7c91f8d07e1c7b2366 | [
"MIT"
] | 3 | 2020-02-24T14:31:36.000Z | 2020-03-28T22:38:57.000Z | src/boss_jingle_bass.asm | Gegel85/SpaceShooterGB | 7f1ff08708fd3ad91c911c7c91f8d07e1c7b2366 | [
"MIT"
] | 4 | 2020-02-24T16:35:26.000Z | 2020-02-26T16:47:11.000Z | src/boss_jingle_bass.asm | Gegel85/SpaceShooterGB | 7f1ff08708fd3ad91c911c7c91f8d07e1c7b2366 | [
"MIT"
] | 1 | 2020-02-24T14:31:39.000Z | 2020-02-24T14:31:39.000Z | bossJingleBass::
;patt1
db $80, $00, $40, $17, $84, QUAVER ;DO 0
db $80, $00, $40, $DF, $83, QUAVER ;SI B
db $80, $00, $40, $A0, $83, QUAVER ;LA# B
db $80, $00, $40, $58, $83, QUAVER ;LA B
db $80, $00, $40, $14, $83, QUAVER ;SOL# B
db $80, $00, $40, $C7, $82, QUAVER ;SOL B
db $80, $00, $40, $7F, $82, QUAVER ;FA# B
db $80, $00, $40, $1D, $82, QUAVER ;FA B
db $80, $00, $40, $D5, $81, QUAVER ;MI B
db $80, $00, $40, $70, $81, QUAVER ;RE# B
db $80, $00, $40, $15, $81, QUAVER ;RE B
db $80, $00, $40, $94, $80, QUAVER ;DO# B
db $80, $00, $40, $20, $80, QUAVER * 4;DO B
db $80, $00, $00, $17, $84, $FF ;DO 0
| 38.882353 | 47 | 0.472012 |
ca48ae14e16242ef0b10cded1cafab0b0f675ffa | 1,035 | asm | Assembly | programs/oeis/185/A185048.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/185/A185048.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/185/A185048.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A185048: Length of the continued fraction for floor(Fibonacci(n)*(1+sqrt(5))/2) / Fibonacci(n).
; 1,1,2,2,4,2,6,4,8,4,10,6,12,6,14,8,16,8,18,10,20,10,22,12,24,12,26,14,28,14,30,16,32,16,34,18,36,18,38,20,40,20,42,22,44,22,46,24,48,24,50,26,52,26,54,28,56,28,58,30,60,30,62,32,64,32,66,34,68,34,70,36,72,36,74,38,76,38,78,40,80,40,82,42,84,42,86,44,88,44,90,46,92,46,94,48,96,48,98,50,100,50,102,52,104,52,106,54,108,54,110,56,112,56,114,58,116,58,118,60,120,60,122,62,124,62,126,64,128,64,130,66,132,66,134,68,136,68,138,70,140,70,142,72,144,72,146,74,148,74,150,76,152,76,154,78,156,78,158,80,160,80,162,82,164,82,166,84,168,84,170,86,172,86,174,88,176,88,178,90,180,90,182,92,184,92,186,94,188,94,190,96,192,96,194,98,196,98,198,100,200,100,202,102,204,102,206,104,208,104,210,106,212,106,214,108,216,108,218,110,220,110,222,112,224,112,226,114,228,114,230,116,232,116,234,118,236,118,238,120,240,120,242,122,244,122,246,124,248,124
mov $1,1
mov $2,$0
lpb $2
div $0,2
mov $1,$0
add $0,1
mul $1,2
add $2,1
gcd $2,2
lpe
| 73.928571 | 838 | 0.680193 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.