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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
188d3982a9ca041bf714f0fad0adf37f0fc391f9 | 314 | asm | Assembly | libsrc/adt/stack/adt_StackPush.asm | andydansby/z88dk-mk2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | 1 | 2020-09-15T08:35:49.000Z | 2020-09-15T08:35:49.000Z | libsrc/adt/stack/adt_StackPush.asm | dex4er/deb-z88dk | 9ee4f23444fa6f6043462332a1bff7ae20a8504b | [
"ClArtistic"
] | null | null | null | libsrc/adt/stack/adt_StackPush.asm | dex4er/deb-z88dk | 9ee4f23444fa6f6043462332a1bff7ae20a8504b | [
"ClArtistic"
] | null | null | null | ; int adt_StackPush(struct adt_Stack *s, void *item)
; CALLER linkage for function pointers
XLIB adt_StackPush
LIB adt_StackPush_callee
XREF ASMDISP_ADT_STACKPUSH_CALLEE
.adt_StackPush
pop bc
pop de
pop hl
push hl
push de
push bc
jp adt_StackPush_callee + ASMDISP_ADT_STACKPUSH_CALLEE
| 16.526316 | 57 | 0.764331 |
474f72d9a1db61f7e90c9a96646cbeb5d56a3f61 | 5,315 | asm | Assembly | dino/lc/1p y.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | 6 | 2020-10-14T15:29:10.000Z | 2022-02-12T18:58:54.000Z | dino/lc/1p y.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | null | null | null | dino/lc/1p y.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | 1 | 2020-12-17T08:59:10.000Z | 2020-12-17T08:59:10.000Z | copyright zengfr site:http://github.com/zengfr/romhack
013620 move.b ($3,A6), D0
013624 add.w D0, D0
013626 move.w ($7e,PC,D0.w), D1
01362A add.w ($c,A6), D1
01362E add.w ($10,A6), D1
013632 move.w ($8,A6), D0
013636 tst.b ($4dc,A5)
;--------
012D02 bne $12d2e
012D06 move.w ($54,A6), D0
012D0A add.w ($56,A6), D0
012D0E move.w ($c,A6), D1
012D12 cmp.w D1, D0
012D14 beq $12d4c
012D18 bgt $12d24
;--------
004D8E lea (A0), A1
004D90 moveq #$5f, D0
004D92 moveq #$0, D1
004D94 move.l D1, (A1)+
004D96 dbra D0, $4d94
004D9A move.w #$64, ($6c,A0)
004DA0 move.w #$64, ($6e,A0)
;--------
0AAAC2 movea.l A0, A3
0AAAC4 move.l #$0, D0
0AAACA move.l (A0), D2
0AAACC move.w D0, (A0)
0AAACE move.w D0, ($2,A0)
0AAAD2 cmp.l (A0), D0
0AAAD4 bne $aaafc
;--------
004E44 add.w D1, D0
004E46 adda.w D0, A0
004E48 move.w (A0)+, ($8,A6)
004E4C move.w (A0)+, ($c,A6)
004E50 move.w (A0)+, ($10,A6)
004E54 rts
004FCE tst.b ($4dc,A5)
;--------
014252 move.w (A1)+, D0
014254 add.w D0, ($69b2,A5)
014258 move.w ($8,A0), D4
01425C move.w ($c,A0), D5
014260 add.w ($10,A0), D5
014264 btst #$7, ($25,A0)
01426A bne $14276
;--------
0AAABC jmp $4ce.l
0AAAC2 movea.l A0, A3
0AAAC4 move.l #$0, D0
0AAACA move.l (A0), D2
0AAACC move.w D0, (A0)
0AAACE move.w D0, ($2,A0)
0AAAD2 cmp.l (A0), D0
;--------
0016F4 move #$1, CCR
0016F8 rts
0016FA move.w ($8,A6), D0
0016FE move.w ($c,A6), D1
001702 add.w ($10,A6), D1
001706 tst.b ($4dc,A5)
00170A bne $1716
;--------
014156 neg.w D0
014158 add.w D0, ($8,A0)
01415C move.w ($3e,A0), D0
014160 add.w D0, ($c,A0)
014164 bsr $14230
014168 movem.w (A7)+, D0-D2
01416C move.b D0, ($53,A0)
;--------
012846 move.w D4, D2
012848 add.w D2, D0
01284A lsr.w #1, D0
01284C move.w ($c,A2), D1
012850 add.w (A4)+, D1
012852 move.w ($c,A3), D2
012856 add.w (A6)+, D2
;--------
014EE8 tst.b ($53,A0)
014EEC beq $14f06
014F06 move.w D1, D4
014F08 sub.w ($c,A0), D4
014F0C beq $14f92
014F10 add.w ($10,A0), D1
014F14 sub.w ($69b8,A5), D1
;--------
0018BC move.w D0, ($16,A6)
0018C0 swap D0
0018C2 asr.l #8, D0
0018C4 add.l D0, ($c,A6)
0018C8 moveq #$0, D0
0018CA move.w ($18,A6), D0
0018CE add.w ($1e,A6), D0
;--------
012D60 bne $12d8c
012D64 move.w ($54,A6), D0
012D68 add.w ($56,A6), D0
012D6C move.w ($c,A6), D1
012D70 cmp.w D1, D0
012D72 beq $12daa
012D8C move.w ($54,A6), D0
;--------
0AAADC bne $aaaca
0AAADE movea.l A3, A0
0AAAE0 move.l #$ffffffff, D0
0AAAE6 move.l (A0), D2
0AAAE8 move.w D0, (A0)
0AAAEA move.w D0, ($2,A0)
0AAAEE cmp.l (A0), D0
;--------
012D32 add.w ($56,A6), D0
012D36 cmp.w ($c,A6), D0
012D3A ble $12d4c
012D3E move.w D0, ($c,A6)
012D42 moveq #$0, D1
012D44 move.w D1, ($e,A6)
012D48 move.b D1, ($51,A6)
;--------
014168 movem.w (A7)+, D0-D2
01416C move.b D0, ($53,A0)
014170 move.w D1, ($8,A0)
014174 move.w D2, ($c,A0)
014178 movea.l ($30,A0), A3
01417C bra $14234
014180 move.w (A3), D0
;--------
01A70E rts
01A710 move.w ($20,A6), D0
01A714 lea ($1e,PC,D0.w), A0
01A718 move.w ($c,A6), D0
01A71C sub.w ($54,A6), D0
01A720 sub.w ($56,A6), D0
01A724 cmp.w (A0)+, D0
;--------
012D22 rts
012D2E move.w ($54,A6), D0
012D32 add.w ($56,A6), D0
012D36 cmp.w ($c,A6), D0
012D3A ble $12d4c
012D3E move.w D0, ($c,A6)
012D42 moveq #$0, D1
;--------
01277C add.l D2, D0
01277E lsr.l #1, D0
012780 subi.w #$400, D0
012784 move.w ($c,A2), D1
012788 add.w (A4)+, D1
01278A move.w ($c,A3), D2
01278E add.w (A6)+, D2
;--------
0AAACE move.w D0, ($2,A0)
0AAAD2 cmp.l (A0), D0
0AAAD4 bne $aaafc
0AAAD8 move.l D2, (A0)+
0AAADA cmpa.l A0, A1
0AAADC bne $aaaca
0AAADE movea.l A3, A0
;--------
00041E movea.l #$ff0000, A0
000424 move.w #$3fff, D0
000428 moveq #$0, D1
00042A move.l D1, (A0)+
00042C dbra D0, $42a
000430 reset
000432 move.b #$80, $800030.l
;--------
01297C add.w D4, D2
01297E cmp.w D2, D0
012980 bhi $129a4
012984 move.w ($c,A2), D0
012988 add.w (A4)+, D0
01298A move.w ($c,A3), D1
01298E add.w (A6)+, D1
;--------
0AAACA move.l (A0), D2
0AAACC move.w D0, (A0)
0AAACE move.w D0, ($2,A0)
0AAAD2 cmp.l (A0), D0
0AAAD4 bne $aaafc
0AAAD8 move.l D2, (A0)+
0AAADA cmpa.l A0, A1
;--------
0AAAEA move.w D0, ($2,A0)
0AAAEE cmp.l (A0), D0
0AAAF0 bne $aaafc
0AAAF4 move.l D2, (A0)+
0AAAF6 cmpa.l A0, A1
0AAAF8 bne $aaae6
0AAAFA jmp (A6)
;--------
005B2C bhi $5bd6
005B30 move.w ($c,A1), D0
005B34 subq.w #8, D0
005B36 sub.w ($c,A6), D0
005B3A moveq #$10, D1
005B3C add.w D1, D0
005B3E cmp.w D1, D0
;--------
01A64E bmi $1a6b4
01A652 tst.b ($80,A6)
01A656 bne $1a6d0
01A65A move.w ($c,A6), D0
01A65E sub.w ($54,A6), D0
01A662 sub.w ($56,A6), D0
01A666 cmpi.w #$30, D0
;--------
copyright zengfr site:http://github.com/zengfr/romhack
| 24.953052 | 54 | 0.532455 |
9a2d8892de66ac910758e4e5a02649b61144b969 | 16,047 | asm | Assembly | apps/telnet/io.asm | vipoo/msxrc2014 | 7b083ca6d46d6f47179fb95082ca9297e5fcf9e2 | [
"MIT"
] | 1 | 2021-03-16T20:43:54.000Z | 2021-03-16T20:43:54.000Z | apps/telnet/io.asm | vipoo/msxrc2014 | 7b083ca6d46d6f47179fb95082ca9297e5fcf9e2 | [
"MIT"
] | null | null | null | apps/telnet/io.asm | vipoo/msxrc2014 | 7b083ca6d46d6f47179fb95082ca9297e5fcf9e2 | [
"MIT"
] | null | null | null | ; ___________________________________________________________
;/ __ _ \
;| / _| (_) |
;| | |_ _ _ ___ _ ___ _ __ |
;| | _| | | / __| |/ _ \| '_ \ |
;| | | | |_| \__ \ | (_) | | | | |
;| |_| \__,_|___/_|\___/|_| |_| * |
;| |
;| The MSX C Library for SDCC |
;| V1.0 - 09-10-11 2018 |
;| |
;| Eric Boez & Fernando Garcia |
;| |
;| A S M S O U R C E C O D E |
;| |
;| |
;\___________________________________________________________/
;
;
; IO.H
; Disk operations
;
; (c) 1995, SOLID MSX C
;
; SDCC port 2015
;
; MSXDOS1, MSXDOS2 disk operations
;
SECTION CODE
;--- proc FCBs
;
; INIT for IO operations
; Returns pointer to FCB list
;
PUBLIC _FCBs
_FCBs:
call _OS_version
call _prep_fcbs
ld hl, __buf8_fcbs
ret
;--- end of proc
;--- proc GET_OS_VERSION
;
; int GetOSVersion( )
;
;
PUBLIC _GetOSVersion
_GetOSVersion:
call _OS_version
ld h, 0
ld a,(__os_ver)
ld l, a
ret
_OS_version:
ld c,0xC
call 5
cp 5
jr z,lb_v1
lb_va:
ld bc,0x6F
call 5
ld (__mx_ver),de ;MSXDOS2.SYS version number
ld a,b ;MSX-DOS kernel version
cp 2
jr c,lb_v1
ld a,2
lb_vb:
ld (__os_ver),a
ret
lb_v1:
ld a,1
jr lb_vb
;.area _DATA
PUBLIC __os_ver
__os_ver: db 0 ;1 -> MSXDOS 1.X, 2-> MSXDOS2
PUBLIC __mx_ver
__mx_ver: db 0
;--- end of proc
SECTION CODE
;-
; Variables and temporary FCBs for DOS1 functions
;-
;.area _DATA
PUBLIC __buf8_fcbs
__buf8_fcbs: ;allocate 8 FCBs for DOS1
ds 38*8 ;304 bytes = 0xff
PUBLIC __io_errno
__io_errno:
db 0,0
_xfcb:
ds 38
_ffcb:
ds 38
lb_con:
db 0
db "CON "
db 0
SECTION CODE
;--- proc prep_fcbs
_prep_fcbs:
xor a
ld (de),a
;allocate 8 FCBs for DOS1
ld hl, __buf8_fcbs
;set 2 FCBs to CON
call _opencon
ld de,38
add hl,de
call _opencon
ret
_opencon:
push hl
ex de,hl
push de
ld hl,lb_con
ld bc,13
ldir
pop de
push de
ld c,0xF
call 5
pop ix
ld (ix+14),1
ld (ix+15),0
pop hl
ret
;
;--- end of proc
;--- proc setfcb
; setup FCB, used for DOS1 file IO functions
PUBLIC __setupfcb
__setupfcb:
push hl
push de
ld l,e
ld h,d
inc de
ld bc,16
ld (hl),0
ldir
pop de
pop hl
;
xor a
ld (de),a
inc hl
ld a,(hl)
cp ':'
dec hl
jr nz,lb_setu5
ld a,(hl)
and 0xF
ld (de),a
inc hl
inc hl
lb_setu5:
inc de
lb_setu6:
ld b,8
call lb_setu7
ld a,(hl)
cp '.'
jr nz,lb_setu8
inc hl
lb_setu8:
ld b,3
call lb_setu7
xor a
ret
;
lb_setu7:
ld a,(hl)
cp '.'
jr z,lb_setu9
cp '*'
jr z,lb_setu12
cp '!'
jr c,lb_setu9
ld (de),a
inc hl
inc de
djnz lb_setu7
ret
lb_setu12:
inc hl
ld a,'?'
jr lb_setu10
;
lb_setu9:
ld a,' '
lb_setu10:
ld (de),a
inc de
djnz lb_setu10
ret
;--- end of proc
;--- proc dos1fd
; convert FD to FCB address for DOS1
PUBLIC _get_fd
_get_fd:
ld h,0
add hl,hl
ld d,h
ld e,l
add hl,hl
ld b,h
ld c,l
add hl,hl
add hl,hl
add hl,hl
add hl,de
add hl,bc
ld de, __buf8_fcbs
add hl,de
ret
;--- end of proc
;--- proc open
;
; FD Open(char *name, int mode) -- DOS1 (attributes ignored), DOS2
; FD OpenAttrib(char *name, int mode, int attrib) -- DOS2
;
; Attributes are for MSXDOS2 only
;
PUBLIC _Open
_Open:
push ix
ld ix,0
add ix,sp
ld l,(ix+4)
ld h,(ix+5)
ld e,(ix+6)
ld d,(ix+7)
ld bc,0
pop ix
jr _iopen
PUBLIC _OpenAttrib
_OpenAttrib:
push ix
ld ix,0
add ix,sp
ld l,(ix+4)
ld h,(ix+5)
ld e,(ix+6)
ld d,(ix+7)
ld c,(ix+8)
ld b,(ix+9)
pop ix
PUBLIC _iopen
_iopen:
push ix
ld a,(__os_ver)
or a
jr nz,lb_opC
; maybe not initiated
push hl
push de
push bc
call _OS_version
call _prep_fcbs
pop bc
pop de
pop hl
ld a,(__os_ver)
or a
jr z, lb_op15 ; if can not manage
lb_opC:
dec a
dec a
jr z,lb_op2 ; MSXDOS2 can do the same as MSXDOS1
xor a
jr lb_op1 ; MSXDOS1
lb_op25:
pop ix
or a
ld (__io_errno),a
ld h,0
ret z
lb_op14:
ld hl,-1
ret
;
lb_op2:
xor a
ld b,c ;attributes
bit 0,e ;O_WRITE
jr nz,lb_op21
or 1
lb_op21:
bit 2,e ;O_EXCL?
jr z,lb_op22
set 7,b
lb_op22:
bit 5,e
ld c,0x43
jr z,lb_op23
bit 4,e
jr z,lb_op23
inc c
lb_op23:
ex de,hl
push hl
call 5
ld (__io_errno),a
pop de
bit 6,e
jr z,lb_op24
push bc
ld hl,0 ;O_APPEND
ld d,h
ld e,l
ld a,2
ld c,0x4A ; seek to end
call 5
pop bc
lb_op24:
ld h,0
ld l,b
jr lb_op25
;
lb_op1:
push de
push hl ;attributes ignored in DOS-1
ld hl, __buf8_fcbs
ld de,38
ld b,8 ; 8-fcbs
lb_op11:
ld a,(hl)
inc a
jr z,lb_op12
add hl,de
djnz lb_op11
pop de
pop hl
lb_op15:
pop ix
jr lb_op14
;
lb_op12:
ld a,8 ; 8-fcbs
sub b
ld (lb_fdd),a
ex de,hl
pop hl
push de
call __setupfcb
pop de
pop bc
bit 5,c ;CREATE?
push bc
ld c,0xF
jr z,lb_op13
ld c,0x16
lb_op13:
push de
call 5
ld (__io_errno),a
pop de
pop bc
or a
jr nz,lb_op15
ld hl,14
add hl,de
ld (hl),1 ;set reclen = 1
inc hl
ld (hl),0
push hl
ld de,18
add hl,de ;hl -> RANDOMREC
ex de,hl
pop hl
inc hl
bit 6,c
jr nz,lb_op16
ld hl,lb_po0
lb_op16:
ld bc,4
ldir
ld hl,(lb_fdd)
jp lb_op25
;
;.area _DATA
lb_po0:
db 0,0,0,0 ;pointer position for OPEN
;--- end of proc
SECTION CODE
;--- proc close
;
; int Close(FD fd); -- DOS1, DOS2
;
PUBLIC _Close
_Close:
push ix
ld ix,0
add ix,sp
ld l,(ix+4)
ld h,(ix+5)
pop ix
PUBLIC _iclose
_iclose:
ld h,0
ld a,(__os_ver)
dec a
dec a
jr z,lb_cl2 ; MSXDOS2 can do the same as MSXDOS1
xor a
jr lb_cl1 ; MSXDOS1
lb_cl0:
push ix
call 5
lb_cl00:
pop ix
or a
ld hl,0
ld (__io_errno),a
ret z
dec hl
ret
;
lb_cl1:
call _get_fd
ex de,hl
ld c,0x10
push ix
push de
call 5
pop hl
ld (hl),255
jr lb_cl00
;
lb_cl2:
ld b,l
ld c,0x45
jr lb_cl0
;
;.area _DATA
lb_fdd:
dw 0
;--- end of proc
SECTION CODE
;--- proc create
;
; FD Create(char *name) -- DOS1(attributes ignored), DOS2
; FD CreateAttrib(char *name, int attr) -- DOS2
;
PUBLIC _Create
_Create:
push ix
ld ix,0
add ix,sp
ld l,(ix+4)
ld h,(ix+5)
pop ix
ld de,0
jr lb_crt
PUBLIC _CreateAttrib
_CreateAttrib:
push ix
ld ix,0
add ix,sp
ld l,(ix+4)
ld h,(ix+5)
ld e,(ix+6)
ld d,(ix+7)
pop ix
lb_crt:
ld c,e
ld b,d
ld e,0x39
jp _iopen
;--- end of proc
;--- proc read
;
; int Read(FD fd, void *buf, int nbytes); -- DOS1, DOS2
;
PUBLIC _Read
_Read:
push ix
ld ix,0
add ix,sp
ld l,(ix+4)
ld h,(ix+5)
ld e,(ix+6)
ld d,(ix+7)
ld c,(ix+8)
ld b,(ix+9)
pop ix
PUBLIC _iread
_iread:
push ix
ld a,(__os_ver)
dec a
dec a
jr z,lb_rd2 ; MSXDOS2 can do the same as MSXDOS1
xor a
jr lb_rd1 ; MSXDOS1
lb_rd3:
call 5
lb_rd3a:
pop ix
cp 2
ret c
ld (__io_errno),a
ld hl,0
ret
;
lb_rd1:
push bc
push hl
ld c,0x1A
call 5
pop hl
call _get_fd
ex de,hl
pop hl ;byte cnt
ld c,0x27
push de
call 5
pop ix
bit 7,(ix+24)
jr z,lb_rd3a
set 6,(ix+24)
jr lb_rd3a
;
lb_rd2:
ld a,l
ld l,c
ld h,b
ld b,a
ld c,0x48
jr lb_rd3
;--- end of proc
;--- proc write
;
; int Write(FD fd,void *buf,int nbytes); -- DOS1, DOS2
;
PUBLIC _Write
_Write:
push ix
ld ix,0
add ix,sp
ld l,(ix+4)
ld h,(ix+5)
ld e,(ix+6)
ld d,(ix+7)
ld c,(ix+8)
ld b,(ix+9)
pop ix
PUBLIC _iwrite
_iwrite:
push ix
ld a,(__os_ver)
dec a
dec a
jr z,lb_wr2 ; MSXDOS2 can do the same as MSXDOS1
xor a
jr lb_wr1 ; MSXDOS1
lb_wr3:
call 5
pop ix
cp 2
ret c
ld (__io_errno),a
ld hl,0
ret
;
lb_wr1:
push bc
push hl
ld c,0x1A
call 5
pop hl
call _get_fd
ex de,hl
pop hl ;byte cnt
ld c,0x26
jr lb_wr3
;
lb_wr2:
ld a,l
ld l,c
ld h,b
ld b,a
ld c,0x49
jr lb_wr3
;--- end of proc
;--- proc lseek
;
; char Lseek(FD fd,long *where, char ot); -- DOS1, DOS2
;
;
PUBLIC _Lseek
_Lseek:
push ix
ld ix,0
add ix,sp
ld l,(ix+4)
ld h,(ix+5)
ld e,(ix+6)
ld d,(ix+7)
ld c,(ix+8)
ld b,(ix+9)
pop ix
call _ilseek
ld l,a
ld h,0
ret
PUBLIC _ilseek
_ilseek:
push ix
ld a,(__os_ver)
dec a
dec a
jr z,lb_sk2 ; MSXDOS2 can do the same as MSXDOS1
xor a
jr lb_sk1 ; MSXDOS1
lb_sk0:
call 5
pop ix
ld (__io_errno),a
ret
;
lb_sk2:
ld a,c
ld b,l
push de
pop ix
ld l,(ix+0)
ld h,(ix+1)
ld e,(ix+2)
ld d,(ix+3)
ld c,0x4A
jr lb_sk0
;
lb_sk1:
push de
push bc
call _get_fd
ex de,hl ;where to put
pop bc
ld a,c
or a
ld hl,lb_p00
jr z,lb_sk11
ld hl,33
add hl,de
dec a
jr z,lb_sk11
ld hl,16
add hl,de
lb_sk11:
ld b,h
ld c,l ;where to get
ld hl,33
add hl,de
ex de,hl ;where to put
pop hl ;pop offset pointer
ld a,(bc)
add a,(hl)
ld (de),a
inc bc
inc de
inc hl
ld a,(bc)
adc a,(hl)
ld (de),a
inc bc
inc de
inc hl
ld a,(bc)
adc a,(hl)
ld (de),a
inc bc
inc de
inc hl
ld a,(bc)
adc a,(hl)
ld (de),a
xor a
pop ix
ret
;.area _DATA
lb_p00:
db 0,0,0,0
;--- end of proc
SECTION CODE
;--- proc ltell
;
; char _Ltell(FD fd, long *where); -- DOS1, DOS2
;
PUBLIC _Ltell
_Ltell:
push ix
ld ix,0
add ix,sp
ld l,(ix+4)
ld h,(ix+5)
ld e,(ix+6)
ld d,(ix+7)
pop ix
call _iltell
ld l,a
ld h,0
ret
PUBLIC _iltell
_iltell:
push ix
ld a,(__os_ver)
dec a
dec a
jr z,lb_tl2 ; MSXDOS2 can do the same as MSXDOS1
xor a
jr lb_tl1 ; MSXDOS1
lb_tl2a:
pop ix
ld (__io_errno),a
ret
;
lb_tl2:
push de
ld a,1
ld b,l
ld hl,0
ld de,0
ld c,0x4A
call 5
pop ix
ld (ix+0),l
ld (ix+1),h
ld (ix+2),e
ld (ix+3),d
jr lb_tl2a
;
lb_tl1:
push de
call _get_fd
ld de,33
add hl,de
pop de
ld bc,4
ldir
xor a
pop ix
ret
;--- end of proc
;--- proc getcwd
;
; char GetCWD(char *buf, int size); -- DOS1, DOS2
;
PUBLIC _GetCWD
_GetCWD:
push ix
ld ix,0
add ix,sp
ld l,(ix+4)
ld h,(ix+5)
ld c,(ix+6)
ld b,(ix+7)
pop ix
call _igetcwd
ld l,a
ld h,0
ret
PUBLIC _igetcwd
_igetcwd:
push ix
push hl
push bc
ld c,0x19
call 5
ld l,a
ld a,(__os_ver)
dec a
dec a
jr z,lb_gc2 ; MSXDOS2 can do the same as MSXDOS1
xor a
jr lb_gc1 ; MSXDOS1
lb_gc3:
pop bc
pop de
ld hl,(0xF34D)
push de
ldir
dec de
lb_gc0:
xor a
ld (de),a
pop hl
pop ix
ret
;
lb_gc1:
pop bc
pop de
push de
ld a,'A'
add a,l
ld (de),a
inc de
ld a,':'
ld (de),a
inc de
jr lb_gc0
;
lb_gc2:
ld b,l
ld de,(0xF34D)
ld c,0x59
call 5
jr lb_gc3
;--- end of proc
;--- proc REMOVE
;
; char Remove(char *filename) -- DOS1, DOS2
;
PUBLIC _Remove
_Remove:
push ix
ld ix,0
add ix,sp
ld l,(ix+4)
ld h,(ix+5)
pop ix
call _iremove
ld l,a
ld h,0
ret
PUBLIC _iremove
_iremove:
ld a,(__os_ver)
dec a
dec a
jr z,lb_re2 ; MSXDOS2 can do the same as MSXDOS1
xor a
jr lb_re1 ; MSXDOS1
lb_re3:
push ix
call 5
pop ix
ld (__io_errno),a
ret
lb_re2:
ex de,hl
ld c,0x4D
ld hl,0
jr lb_re3
lb_re1:
ld de,_xfcb
call __setupfcb
ld de,_xfcb
ld c,0x13
jr lb_re3
;--- end of proc
;--- proc RENAME
;
; char Rename(char *old_name, char *new_name); -- DOS1, DOS2
;
PUBLIC _Rename
_Rename:
push ix
ld ix,0
add ix,sp
ld l,(ix+4)
ld h,(ix+5)
ld e,(ix+6)
ld d,(ix+7)
pop ix
call _irename
ld l,a
ld h,0
ret
PUBLIC _irename
_irename:
push ix
ld a,(__os_ver)
dec a
dec a
jr z,lb_ren2 ; MSXDOS2 can do the same as MSXDOS1
xor a
jr lb_ren1 ; MSXDOS1
lb_ren0:
call 5
pop ix
ld (__io_errno),a
ret
;
lb_ren2:
push hl
push de
ld c,0x4D
call 5 ;delete new
pop hl
pop de
ld c,0x4E
jr lb_ren0
;
lb_ren1:
push de
ld de,_xfcb
call __setupfcb
pop hl
ld de,_xfcb+16
call __setupfcb
ld de,_xfcb+16
ld c,0x13
call 5
ld de,_xfcb
ld c,0x17
jr lb_ren0
;--- end of proc
;--- proc CHDIR
;
; char ChangeDir(char *path); -- DOS2
;
PUBLIC _ChangeDir
_ChangeDir:
push ix
ld ix,0
add ix,sp
ld l,(ix+4)
ld h,(ix+5)
pop ix
call _ichdir
ld l,a
ld h,0
ret
PUBLIC _ichdir
_ichdir:
ld a,(__os_ver)
dec a
dec a
ret m
ex de,hl
ld c,0x5A
push ix
call 5
pop ix
ld (__io_errno),a
ret
;--- end of proc
;--- proc MKDIR
;
; char MakeDir(char *name); -- DOS2
;
PUBLIC _MakeDir
_MakeDir:
push ix
ld ix,0
add ix,sp
ld l,(ix+4)
ld h,(ix+5)
pop ix
call _imkdir
ld l,a
ld h,0
ret
PUBLIC _imkdir
_imkdir:
ld a,(__os_ver)
dec a
dec a
ret m
push ix
ex de,hl
jr z,lb_mkd1
ld c,0x41
lb_mkd0:
call 5
pop ix
ld (__io_errno),a
ret
;
lb_mkd1:
ld bc,0x9044
xor a
jr lb_mkd0
;--- end of proc
;--- proc RMDIR
;
; char Removedir(char *name); -- DOS2
;
PUBLIC _RemoveDir
_RemoveDir:
push ix
ld ix,0
add ix,sp
ld l,(ix+4)
ld h,(ix+5)
pop ix
call _irmdir
ld l,a
ld h,0
ret
PUBLIC _irmdir
_irmdir:
ex de,hl
ld a,(__os_ver)
dec a
dec a
ret m
push ix
ld c,0x4D
jr z,lb_rmd0
ld c,0x42
lb_rmd0:
call 5
pop ix
ld (__io_errno),a
ret
;--- end of proc
;--- proc FINDFIRST
;
; char FindFirst(char *willcard, char *result, int attrib); -- DOS1, DOS2
;
; For MSXDOS2 attrib:
; 0 - only non-hidden, non-system files
;
PUBLIC _FindFirst
_FindFirst:
push ix
ld ix,0
add ix,sp
ld l,(ix+4)
ld h,(ix+5)
ld e,(ix+6)
ld d,(ix+7)
ld c,(ix+8)
ld b,(ix+9)
call _ifindfirst
pop ix
ld l,a
ld h,0
ret
_ifindfirst:
ld a,(__os_ver)
dec a
dec a
jr z,lb_ff2 ; MSXDOS2 can do the same as MSXDOS1
xor a
; other use FCB way to get filename, attribute is ignored
push de
ld de,_ffcb
push de
call __setupfcb
pop de
push de
ld de,_xfcb
ld c,0x1A
call 5
pop de
ld c,0x11
PUBLIC lb_ff1c
lb_ff1c:
call 5
ld (__io_errno),a
pop de
or a
ret nz
ld c,12
ld hl,_xfcb+1
lb_ffo:
ld a,(hl)
cp a, 32
jr z, lb_ff0
ld (de),a
inc de
lb_ff0:
inc hl
dec c
jr z, lb_ffe
ld a,4
cp c
jr nz, lb_ffo
ld a, '.'
ld (de),a
inc de
jr lb_ffo
lb_ffe:
dec de
ld a,(de)
cp '.'
jr nz, lb_ffe2
inc de
lb_ffe2:
xor a
ld (de),a
ret
lb_ff2:
push de
ld c,0x40
ld b,c
ld d,h
ld e,l
PUBLIC lb_ff2c
lb_ff2c:
xor a
ld h,a
ld l,a
ld ix, _xfcb
call 5
ld (__io_errno),a
pop de
or a
ret nz
ld hl, _xfcb+1
lb_ff2a:
ld a, (hl)
ld (de),a
inc hl
inc de
or a
jr nz, lb_ff2a
ret
;--- end of proc
;--- proc FINDNEXT
;
; char FindNext(char *result); -- DOS1, DOS2
;
;
PUBLIC _FindNext
_FindNext:
push ix
ld ix,0
add ix,sp
ld l,(ix+4)
ld h,(ix+5)
ld c,(ix+6)
ld b,(ix+7)
call _ifindnext
pop ix
ld l,a
ld h,0
ret
_ifindnext:
push hl
ld a,(__os_ver)
dec a
dec a
jr z,lb_fn2 ; MSXDOS2 can do the same as MSXDOS1
xor a
ld c,0x12
jr lb_ff1c
lb_fn2:
ld c,0x41
jr lb_ff2c
;--- end of proc
;--- proc setdisk
;
; void SetDisk(int diskno)
;
PUBLIC _SetDisk
_SetDisk:
push ix
ld ix,0
add ix,sp
ld a,(ix+4)
ld e,a
ld c,0xE
call 5
pop ix
ret
;--- end of proc
;--- proc getdisk
;
; int GetDisk();
;
PUBLIC _GetDisk
_GetDisk:
push ix
ld c,0x19
call 5
ld h,0
ld l,a
pop ix
ret
;--- end of proc
;
; Diskload - load binary file from disk to RAM.
;
; Compile on SDCC for MSX
;
SECTION CODE
PUBLIC _DiskLoad
_DiskLoad:
push ix
ld ix,0
add ix,sp
ld l,(ix+4)
ld h,(ix+5)
ld e,(ix+6)
ld d,(ix+7)
ld c,(ix+8)
ld b,(ix+9)
push bc
push de
ld a,1
ld (loadflag),a
; prepare FCB
push hl
ld hl,f_fcb
ld de,f_fn
push de
ld bc,36
xor a
ld (hl),a
ldir
pop de
pop hl
; copy filename into FCB
ld bc,11
ldir
; open file for reading
ld de,f_fcb
ld c, 0xF
call 5
ld hl,1
ld (f_groot),hl
dec hl
ld (f_blok),hl
ld (f_blok+2),hl
ld hl,(f_bleng) ; obtain file size
pop de
push hl
; set writing to RAM address
ld c,0x1A
call 5
pop hl
; read from file
ld de,f_fcb
ld c,0x27
call 5
ld (loadflag),a ;sets 0 if ok, 1 if can not load
ld de,f_fcb
ld c,0x10
call 5
pop bc
ld (lb_calladdr),bc
pop ix
xor a
or b
or c
jr z, lb_exit_
db 0xCD ; call to address
lb_calladdr:
db 0
db 0
lb_exit_:
ld a,(loadflag)
ld l,a
ld h,0
ret
; .area _DATA
loadflag: db 0
f_fcb: db 0
f_fn: db "???????????" ;11 chars
dw 0
f_groot: dw 0
f_bleng: ds 17
f_blok: dw 0
dw 0
db 0
SECTION CODE
;
| 11.332627 | 73 | 0.60248 |
596e6095bc704e5bcf658d48daa4cf8f66d566d5 | 530 | asm | Assembly | programs/oeis/014/A014689.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/014/A014689.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/014/A014689.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A014689: a(n) = prime(n)-n, the number of nonprimes less than prime(n).
; 1,1,2,3,6,7,10,11,14,19,20,25,28,29,32,37,42,43,48,51,52,57,60,65,72,75,76,79,80,83,96,99,104,105,114,115,120,125,128,133,138,139,148,149,152,153,164,175,178,179,182,187,188,197,202,207,212,213,218,221,222,231,244,247,248,251,264,269,278,279,282,287,294,299,304,307,312,319,322,329,338,339,348,349,354,357,362,369,372,373,376,387,394,397,404,407,412,423,424,441
mov $2,$0
seq $0,6005 ; The odd prime numbers together with 1.
sub $0,$2
trn $0,2
add $0,1
| 58.888889 | 363 | 0.7 |
a28fce02dbcd174efcd65df931eeceb8a10d6711 | 11,216 | asm | Assembly | src/MFORTH/mforthwords/breg.asm | malyn/MFORTH | 7a6f6c44a192fee4c40b21a7d7d4d6cb51e53169 | [
"BSD-3-Clause"
] | 10 | 2017-10-26T14:10:27.000Z | 2020-06-07T15:06:02.000Z | src/MFORTH/mforthwords/breg.asm | malyn/MFORTH | 7a6f6c44a192fee4c40b21a7d7d4d6cb51e53169 | [
"BSD-3-Clause"
] | 2 | 2019-03-03T19:47:51.000Z | 2020-07-02T09:33:51.000Z | src/MFORTH/mforthwords/breg.asm | malyn/MFORTH | 7a6f6c44a192fee4c40b21a7d7d4d6cb51e53169 | [
"BSD-3-Clause"
] | 2 | 2017-07-23T14:34:19.000Z | 2017-12-16T04:24:28.000Z | ; Copyright (c) 2009-2010, Michael Alyn Miller <malyn@strangeGizmo.com>.
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are met:
;
; 1. Redistributions of source code must retain the above copyright notice
; unmodified, this list of conditions, and the following disclaimer.
; 2. Redistributions in binary form must reproduce the above copyright notice,
; this list of conditions and the following disclaimer in the documentation
; and/or other materials provided with the distribution.
; 3. Neither the name of Michael Alyn Miller nor the names of the contributors
; to this software may be used to endorse or promote products derived from
; this software without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
; ======================================================================
; B ("byte") Register Words
; ======================================================================
; ----------------------------------------------------------------------
; 'B [MFORTH] ( -- c-addr)
;
; Push the address of the B register (a USER variable) to the stack.
LINKTO(LINK_BREG,0,2,'B',"\'")
TICKB: JMP DOUSER
.BYTE USERB
; ----------------------------------------------------------------------
; 'Bend [MFORTH] ( -- c-addr)
;
; Push the address of the Bend register (a USER variable) to the stack.
LINKTO(TICKB,0,5,'d',"neB\'")
TICKBEND: JMP DOUSER
.BYTE USERBEND
; ----------------------------------------------------------------------
; 2>B [MFORTH] "two-to-b" ( c-addr u -- )
;
; Pop an address and length from the stack and store the range in B.
;
; ---
; : 2>B ( c-addr u --) OVER + 'Bend ! 'B ! ;
LINKTO(TICKBEND,0,3,'B',">2")
TWOTOB: JMP ENTER
.WORD OVER,PLUS,TICKBEND,STORE,TICKB,STORE,EXIT
; ----------------------------------------------------------------------
; >B [MFORTH] "to-b" ( c-addr -- )
;
; Pop an address from the stack and put the address into the B register.
;
; ---
; : >B ( c-addr --) 'B ! ;
LINKTO(TWOTOB,0,2,'B',">")
TOB: JMP ENTER
.WORD TICKB,STORE,EXIT
; ----------------------------------------------------------------------
; ?ENDB [MFORTH] "question-end-b"
;
; Interpretation:
; Interpretation semantics for this word are undefined.
;
; Execution: ( flag -- )
; Continue execution immediately following the innermost syntactically
; enclosing FORB ... NEXTB if flag is true. Otherwise continue execution
; at the next instruction.
;
; ---
; ?ENDB POSTPONE IF
; ['] branch COMPILE, HERE 'PREVENDB @ , 'PREVENDB !
; POSTPONE THEN ; IMMEDIATE
LINKTO(TOB,1,5,'B',"DNE?")
QENDB: JMP ENTER
.WORD IF,LIT,branch,COMPILECOMMA
.WORD HERE,LIT,TICKPREVENDB,FETCH,COMMA,LIT,TICKPREVENDB,STORE
.WORD THEN,EXIT
; ----------------------------------------------------------------------
; B [MFORTH] ( -- c-addr)
;
; Push the B register to the stack.
;
; ---
; : B ( -- c-addr) 'B @ ;
LINKTO(QENDB,0,1,'B',"")
B: MOV H,B
MVI L,USERB
MOV A,M ; Load LSB of cell value into A
INX H ; Increment to MSB of the cell value
MOV H,M ; Load MSB of the cell value into H
MOV L,A ; Move LSB of cell value from A to L
PUSH H ; Push cell value onto stack.
NEXT
; ----------------------------------------------------------------------
; B! [MFORTH] "b-store" ( c -- )
;
; Pop a byte from the stack and store it at B.
;
; ---
; : B! (c --) B C! ;
LINKTO(B,0,2,'!',"B")
BSTORE: MOV H,B
MVI L,USERB
MOV A,M ; Load LSB of cell value into A
INX H ; Increment to MSB of the cell value
MOV H,M ; Load MSB of the cell value into H
MOV L,A ; Move LSB of cell value from A to L
XTHL ; Get c into L,
MOV A,L ; ..then move c into A,
POP H ; ..restore store HL.
MOV M,A ; ..and store c at HL.
NEXT
; ----------------------------------------------------------------------
; B!+ [MFORTH] "b-store-plus" ( c -- )
;
; Pop a byte from the stack, store it at B, then increment the B register
; by one (byte address location).
;
; ---
; : B!+ ( c --) B! B+ ;
LINKTO(BSTORE,0,3,'+',"!B")
BSTOREPLUS: JMP ENTER
.WORD BSTORE,BPLUS,EXIT
; ----------------------------------------------------------------------
; B# [MFORTH] "b-number" ( -- u )
;
; Push the number of bytes remaining in the range defined by B.
;
; ---
; : B# ( -- u) 'Bend @ B - ;
LINKTO(BSTOREPLUS,0,2,'#',"B")
BNUMBER: PUSH B
MOV H,B
MVI L,USERB
MOV C,M ; Load LSB of cell value into C
INX H ; Increment to MSB of the cell value
MOV B,M ; Load MSB of the cell value into B.
MVI L,USERBEND
MOV A,M ; Load LSB of cell value into A
INX H ; Increment to MSB of the cell value
MOV H,M ; Load MSB of the cell value into H
MOV L,A ; Move LSB of cell value from A to L
DSUB
XTHL
MOV B,H
MOV C,L
NEXT
; ----------------------------------------------------------------------
; B+ [MFORTH] "b-plus" ( -- c-addr)
;
; Increment the B register by one (byte address location).
;
; ---
; : B+ ( --) 1 CHARS 'B +! ;
LINKTO(BNUMBER,0,2,'+',"B")
BPLUS: MOV H,B ; Get the address of the B user variable
MVI L,USERB ; ..into HL.
INR M ; Increment the B user variable;
JNZ _bplusDONE ; ..we're done if the low byte didn't roll.
INX H ; Otherwise increment to the high byte
INR M ; ..and propagate the overflow.
_bplusDONE: NEXT
; ----------------------------------------------------------------------
; B? [MFORTH] "b-question" ( -- flag )
;
; flag is true if and only if there are more bytes in B.
;
; ---
; : B? ( -- f) B# 0 > ;
LINKTO(BPLUS,0,2,'?',"B")
BQUES: PUSH B
MOV H,B
MVI L,USERB
MOV C,M ; Load LSB of cell value into C
INX H ; Increment to MSB of the cell value
MOV B,M ; Load MSB of the cell value into B.
MVI L,USERBEND
MOV A,M ; Load LSB of cell value into A
INX H ; Increment to MSB of the cell value
MOV H,M ; Load MSB of the cell value into H
MOV L,A ; Move LSB of cell value from A to L
DSUB
JZ _bquesDONE ; Leave zero in HL and we're done; otherwise
LXI H,0FFFFh ; ..put true in HL.
_bquesDONE: XTHL
MOV B,H
MOV C,L
NEXT
; ----------------------------------------------------------------------
; B@ [MFORTH] "b-fetch" ( -- c-addr)
;
; Fetch the byte at B.
;
; ---
; : B@ ( -- c) B C@ ;
LINKTO(BQUES,0,2,'@',"B")
BFETCH: MOV H,B
MVI L,USERB
MOV A,M ; Load LSB of cell value into A
INX H ; Increment to MSB of the cell value
MOV H,M ; Load MSB of the cell value into H
MOV L,A ; Move LSB of cell value from A to L
MOV A,M ; Load target byte into A,
MOV L,A ; ..put target byte into L,
MVI H,0 ; ..clear the high byte,
PUSH H ; ..and then push the byte to the stack.
NEXT
; ----------------------------------------------------------------------
; B@+ [MFORTH] "b-fetch-plus" ( -- c )
;
; Fetch the byte at B, then increment the B register by one (byte address
; location.
;
; ---
; : B@+ ( -- c) B@ B+ ;
LINKTO(BFETCH,0,3,'+',"@B")
BFETCHPLUS: JMP ENTER
.WORD BFETCH,BPLUS,EXIT
; ----------------------------------------------------------------------
; FORB [MFORTH] "for-b"
;
; Interpretation:
; Interpretation semantics for this word are undefined.
;
; Compilation: ( C: -- forb-sys )
; Place forb-sys onto the control-flow stack. Append the run-time
; semantics given below to the current definition. The semantics are
; incomplete until resolved by a consumer of forb-sys such as NEXTB.
;
; Run-time: ( -- )
; Set up a loop that iterates over the bytes from 'B to 'Bend.
;
; ---
; forb-sys in MFORTH is ( forb-orig ). ?ENDB locations chain from the most
; recent ?ENDB to the oldest ?ENDB and then to zero, which signifies the
; end of the ?ENDB list. NEXTB goes through the ?ENDB list and fixes up
; the addresses.
;
; : FORB 0 'PREVENDB ! POSTPONE BEGIN
; POSTPONE B# POSTPONE 0= POSTPONE ?ENDB
; ; IMMEDIATE
LINKTO(BFETCHPLUS,1,4,'B',"ROF")
FORB: JMP ENTER
.WORD ZERO,LIT,TICKPREVENDB,STORE,BEGIN
.WORD LIT,BNUMBER,COMPILECOMMA,LIT,ZEROEQUALS,COMPILECOMMA,QENDB
.WORD EXIT
; ----------------------------------------------------------------------
; NEXTB [MFORTH] "next-b"
;
; Interpretation:
; Interpretation semantics for this word are undefined.
;
; Compilation: ( C: dest -- )
; Append the run-time semantics given below to the current definition.
; Resolve the destination of all unresolved occurrences of ?ENDB between
; the location given by dest and the next location for a transfer of
; control, to execute the words following the NEXTB.
;
; Run-time: ( -- )
; Increment 'B and continue execution at the location specified by dest.
;
; ---
; NEXTB POSTPONE B+ POSTPONE AGAIN 'PREVENDB @ HERE>CHAIN ; IMMEDIATE
LINKTO(FORB,1,5,'B',"TXEN")
LAST_BREG:
NEXTB: JMP ENTER
.WORD LIT,BPLUS,COMPILECOMMA,AGAIN
.WORD LIT,TICKPREVENDB,FETCH,HERETOCHAIN,EXIT
| 35.05 | 78 | 0.49572 |
b220421708b9a1984a0845c218c6c57b5d379466 | 3,940 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_752.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_752.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_752.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r13
push %r15
push %rbp
push %rbx
// Store
lea addresses_WC+0x17f20, %r15
nop
nop
nop
nop
add $56548, %rbx
movw $0x5152, (%r15)
nop
nop
and $53086, %r15
// Faulty Load
lea addresses_RW+0xb4c0, %r12
nop
nop
nop
xor $20971, %rbx
mov (%r12), %r13d
lea oracles, %r12
and $0xff, %r13
shlq $12, %r13
mov (%r12,%r13,1), %r13
pop %rbx
pop %rbp
pop %r15
pop %r13
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_RW', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 5}}
[Faulty Load]
{'src': {'type': 'addresses_RW', 'AVXalign': False, 'size': 4, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'32': 21829}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
| 70.357143 | 2,999 | 0.661675 |
875407b48bc33487498064d0db989aa663f5c266 | 683 | asm | Assembly | oeis/058/A058308.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/058/A058308.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/058/A058308.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A058308: a(n) = (n+2)*a(n-1) + a(n-2), with a(0)=0, a(1)=1.
; Submitted by Christian Krause
; 0,1,4,21,130,931,7578,69133,698908,7757121,93784360,1226953801,17271137574,260294017411,4181975416150,71353876091961,1288551745071448,24553837032449473,492365292394060908,10364224977307728541,228505314793164088810,5265986465220081771171,126612180480075126596914,3170570498467098246694021,82561445140624629540641460,2232329589295332095844013441,62587789945409923313173017808,1817278238006183108177861529873,54580934930130903168649018913998,1693826261072064181336297447863811
mov $2,1
lpb $0
sub $0,1
add $3,$2
mov $2,$1
mul $1,3
add $1,$3
mov $3,$1
mul $3,$0
lpe
mov $0,$1
| 42.6875 | 475 | 0.803807 |
e217ef23ceced635579bdec02c073892e59252a8 | 5,562 | asm | Assembly | Layer2Graphics/layer2_bank_select.asm | TinfoilAsteroid/EliteNext | 417511cefd3d5c7dd7a46b0354eec801ea2c9ca2 | [
"Unlicense"
] | 9 | 2021-09-29T22:08:15.000Z | 2022-03-23T05:35:43.000Z | Layer2Graphics/layer2_bank_select.asm | TinfoilAsteroid/EliteNext | 417511cefd3d5c7dd7a46b0354eec801ea2c9ca2 | [
"Unlicense"
] | 1 | 2022-01-21T12:35:42.000Z | 2022-01-21T17:47:24.000Z | Layer2Graphics/layer2_bank_select.asm | TinfoilAsteroid/EliteNext | 417511cefd3d5c7dd7a46b0354eec801ea2c9ca2 | [
"Unlicense"
] | 1 | 2022-01-15T10:13:49.000Z | 2022-01-15T10:13:49.000Z |
varL2_BANK_SELECTED DB 0
varL2_BUFFER_MODE DB 0
varL2_ACCESS_MODE DB 0
asm_l2_double_buffer_on: ld a,8
ld (varL2_BUFFER_MODE),a
ret
asm_l2_double_buffer_off: xor a
ld (varL2_BUFFER_MODE),a
ret
asm_disable_l2_readwrite: ld bc, IO_LAYER2_PORT
in (c)
ld (varL2_ACCESS_MODE),a
and LAYER2_DISABLE_MEM_ACCESS
out (c),a
ret
asm_restore_l2_readwrite: ld a,(varL2_ACCESS_MODE)
and LAYER2_READ_WRITE_MASK
ld d,a
ld bc, IO_LAYER2_PORT
in (c)
ld (varL2_ACCESS_MODE),a
and d
out (c),a
ret
asm_enable_l2_readwrite: ld bc, IO_LAYER2_PORT
in (c)
or LAYER2_READ_WRITE_MASK
out (c),a
ret
; "asm_l2_bank_select"
; " a = sepecific bank mask value to select, does not set varL2_BANK_SELECTED"
asm_l2_bank_select: ld d,a
cp 0
jr z,.NotBreakDebug
cp $40
jr z,.NotBreakDebug
cp $80
jr z,.NotBreakDebug
break
.NotBreakDebug:
ld a,(varL2_BUFFER_MODE)
or LAYER2_VISIBLE_MASK | LAYER2_WRITE_ENABLE_MASK
or d; | LAYER2_SHADOW_SCREEN_MASK
ld bc, IO_LAYER2_PORT
out (c),a
ret
; "asm_l2_bank_select a = sepecific bank number to select, dsets varL2_BANK_SELECTED"
asm_l2_bank_n_select: ld (varL2_BANK_SELECTED),a
cp 0
jr nz,.nottopbank
.topbank: ld a,LAYER2_SHIFTED_SCREEN_TOP
jr asm_l2_bank_select
.nottopbank: cp 1
jr nz,.notmiddlebank
.middlebank: ld a,LAYER2_SHIFTED_SCREEN_MIDDLE
jr asm_l2_bank_select
.notmiddlebank: ld a,LAYER2_SHIFTED_SCREEN_BOTTOM ; default to bottom
jr asm_l2_bank_select
; Note no ret as its handled by above routines
; "asm_l2_row_bank_select"
; "A (unsinged) = y row of pixel line from top, sets the bank to top middle or bottom and adjusts a reg to row memory address"
; "Could optimise by holding the previous bank but given its only an out statement it may not save T states at all"
; "destroys BC call de is safe a = adjusted poke pixel row"
asm_l2_row_bank_select: cp 64 ; row < 64?
jr nc, .l2rowGTE64
.l2rowLT64: ex af,af'
;ld a, LAYER2_VISIBLE_MASK | LAYER2_WRITE_ENABLE_MASK | LAYER2_SHIFTED_SCREEN_TOP | LAYER2_SHADOW_SCREEN_MASK
ld a,(varL2_BUFFER_MODE)
or LAYER2_VISIBLE_MASK | LAYER2_WRITE_ENABLE_MASK | LAYER2_SHIFTED_SCREEN_TOP
ld bc, IO_LAYER2_PORT
out (c),a
xor a ; set a to 0
ld (varL2_BANK_SELECTED),a ; save selected bank number 0
ex af,af' ; return pixel poke unharmed
ret
.l2rowGTE64: cp 128
jr nc, .l2rowGTE128
.l2row64to127: ex af,af'
; ld a, LAYER2_VISIBLE_MASK | LAYER2_WRITE_ENABLE_MASK | LAYER2_SHIFTED_SCREEN_MIDDLE | LAYER2_SHADOW_SCREEN_MASK
ld a,(varL2_BUFFER_MODE)
or LAYER2_VISIBLE_MASK | LAYER2_WRITE_ENABLE_MASK | LAYER2_SHIFTED_SCREEN_MIDDLE
ld bc, IO_LAYER2_PORT
out (c),a
ld a,1 ; set a to 1
ld (varL2_BANK_SELECTED),a ; save selected bank
ex af,af'
sub 64
ret
.l2rowGTE128: ex af,af'
; ld a, LAYER2_VISIBLE_MASK | LAYER2_WRITE_ENABLE_MASK | LAYER2_SHIFTED_SCREEN_BOTTOM | LAYER2_SHADOW_SCREEN_MASK
ld a,(varL2_BUFFER_MODE)
or LAYER2_VISIBLE_MASK | LAYER2_WRITE_ENABLE_MASK | LAYER2_SHIFTED_SCREEN_BOTTOM
ld bc, IO_LAYER2_PORT
out (c),a
ld a,1 ; set a to 2
ld (varL2_BANK_SELECTED),a ; save selected bank
ex af,af'
sub 128
ret
| 50.563636 | 141 | 0.427724 |
46b82246399ef321110828566b025c84df74a551 | 708 | asm | Assembly | kernel/hdisk/include/syshd_opt.inc.asm | ucrux/ucrux | dd385038c296ed7ccaddc3227d6a57cbc826c395 | [
"MIT"
] | 2 | 2018-11-08T01:30:22.000Z | 2019-07-11T23:56:00.000Z | kernel/hdisk/include/syshd_opt.inc.asm | ucrux/ucrux | dd385038c296ed7ccaddc3227d6a57cbc826c395 | [
"MIT"
] | null | null | null | kernel/hdisk/include/syshd_opt.inc.asm | ucrux/ucrux | dd385038c296ed7ccaddc3227d6a57cbc826c395 | [
"MIT"
] | 2 | 2018-09-17T09:28:05.000Z | 2020-08-31T04:50:27.000Z | ; 硬盘相关常量
DISK_CMD_READ equ 0x20
DISK_LBA_MODE equ 0xe0
DISK_MASTER equ 0x00
PRI_DATA_PORT equ 0x01f0
PRI_SEC_COUNT_PORT equ 0x01f2
PRI_LBA_LOW_PORT equ 0x01f3
PRI_LBA_MID_PORT equ 0x01f4
PRI_LBA_HIGH_PORT equ 0x01f5
PRI_DEVICE_PORT equ 0x01f6
PRI_STAT_CMD_PORT equ 0x01f7
; 等待硬盘不忙的宏
%macro wait_hd 0
.wait_disk :
mov edx, PRI_STAT_CMD_PORT
in al, dx
nop
nop
and al, 0x88
cmp al, 0x08
jnz .wait_disk ;不忙,且硬盘已准备好数据传输
%endmacro | 27.230769 | 52 | 0.501412 |
257d87d8d7beac8f3ce3665621e055c9fac37521 | 24,376 | asm | Assembly | Appl/SDK_Asm/no_go/SndPlay/sndplayUI.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Appl/SDK_Asm/no_go/SndPlay/sndplayUI.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Appl/SDK_Asm/no_go/SndPlay/sndplayUI.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1992 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: SndPlay (Sample PC GEOS application)
FILE: sndplayUI.asm
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 6/16/93 Initial version
DESCRIPTION:
This file contains routines called by the UI objects.
For example, if you press the "Play" button, the button
will send MSG_SND_PLAY_PLAY to your process. The handler
for that message is in this file, along with many others.
RCS STAMP:
$Id: sndplayUI.asm,v 1.1 97/04/04 16:34:45 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CommonCode segment resource ;start of code resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SoundPlayPressedNote
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Someone pressed a button. Do something.
CALLED BY: MSG_SND_PLAY_PRESSED_NOTE
PASS: ds = dgroup
cx = NoteType pressed
RETURN: nothing
DESTROYED: nothing
(bx, si, di, es, ds allowed)
SIDE EFFECTS:
Sends a note event to the Music Stream
<plus anything YOU do>
PSEUDO CODE/STRATEGY:
play a note
See if we are recording new notes, or
editing existing ones
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 6/16/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SoundPlayPressedNote method dynamic SndPlayGenProcessClass,
MSG_SND_PLAY_PRESSED_NOTE
uses ax, cx, dx, bp
.enter
;
; No matter which mode we are in, we want
; to make a beep appropriate to the
; current duration and note selection
;
mov bx, cx ; bx = NoteType
mov si, ds:[currentDuration] ; si = SoundNoteDuration
call SoundPlayPlayEvent ; destroys nothing
;
; If we're recording, then we insert the note into
; the list, otherwise we just bail.
;
cmp ds:[currentState], SCS_RECORDING
jne done
mov dx, ds:[currentDuration]
call SoundPlayInsertNote
;
; Update current position to reflect new note
;
call SoundPlayUpdateCurrentPosition
;
; Update Scan UI to reflect new note
;
call SoundPlayUpdateScan
done:
.leave
ret
SoundPlayPressedNote endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SoundPlayUpdateDuration
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Change the current duration
CALLED BY: MSG_SND_PLAY_UPDATE_DURATION
PASS: ds = dgroup
cx = SoundNoteDuration selected
RETURN: nothing
DESTROYED: nothing
(bx, si, di, es, ds allowed)
SIDE EFFECTS:
Sets currentDuration in idata
PSEUDO CODE/STRATEGY:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 6/16/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SoundPlayUpdateDuration method dynamic SndPlayGenProcessClass,
MSG_SND_PLAY_UPDATE_DURATION
.enter
mov ds:[currentDuration], cx
.leave
ret
SoundPlayUpdateDuration endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SoundPlayStop
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Stop the current state
CALLED BY: MSG_SND_PLAY_STOP
PASS: ds = dgroup
RETURN: nothing
DESTROYED: nothing
(bx, si, di, es, ds allowed)
SIDE EFFECTS:
Can stop Music stream if playing
PSEUDO CODE/STRATEGY:
Determine current state
If recording,
stop recording
If playing,
stop playing
Enter Edit State
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 6/18/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SoundPlayStop method dynamic SndPlayGenProcessClass,
MSG_SND_PLAY_STOP
uses ax, cx, dx, bp
.enter
mov ax, ds:[currentState]
;
; If we are already in edit mode, we don't need
; to do anything -- just quit.
;
cmp ax, SCS_EDITING
je done
;
; If we are recording, we just return to edit mode,
; but if we are playing, we need to stop the Music stream.
;
cmp ax, SCS_RECORDING
je returnToEditMode
;
; Turn off all the voices
;
call SoundPlayClearVoice
returnToEditMode:
;
; Set up the UI for editing-mode.
;
call SetupUIForEditing
mov ds:[currentState], SCS_EDITING
call SoundPlayUpdateCurrentState
done:
.leave
ret
SoundPlayStop endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SetupUIForEditing
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Enables/disables appropriate UI objects for editing songs.
CALLED BY: SoundPlayStop
PASS: nothing
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
stevey 6/20/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SetupUIForEditing proc near
uses ax,bx,cx,dx,si,di,bp
.enter
;
; Enable the "record" trigger.
;
GetResourceHandleNS Interface, bx
mov si, offset SndPlayRecordTrigger ; ^lbx:si = object
mov ax, MSG_GEN_SET_ENABLED ; ax = message
mov di, mask MF_CALL ; di = MessageFlags
mov dl, VUM_NOW ; dl = VisUpdateMode
call ObjMessage ; nukes ax, cx, dx, bp
;
; Enable the "play" trigger.
;
mov si, offset SndPlayPlayTrigger
mov ax, MSG_GEN_SET_ENABLED
mov di, mask MF_CALL
mov dl, VUM_NOW
call ObjMessage
;
; Enable the editing controls.
;
mov si, offset SndPlayEditBar
mov ax, MSG_GEN_SET_ENABLED
mov di, mask MF_CALL
mov dl, VUM_NOW
call ObjMessage
;
; Enable all the notes and durations.
;
GetResourceHandleNS Interface, bx ; ^lbx:si <- object
mov si, offset SndPlayNoteInteraction
mov ax, MSG_GEN_SET_ENABLED ; ax <- message
mov di, mask MF_CALL ; di <- MessageFlags
mov dl, VUM_NOW
call ObjMessage ; di <- MessageError
;
; Enable the fast-forward & rewind stuff.
;
mov si, offset SndPlayPositionBar ; ^lbx:si <- object
mov ax, MSG_GEN_SET_ENABLED ; ax <- message
mov di, mask MF_CALL ; di <- MessageFlags
mov dl, VUM_NOW
call ObjMessage ; di <- MessageError
;
; Enable the current-note glyph.
;
mov si, offset SndPlayCurrentNoteGlyph
mov ax, MSG_GEN_SET_ENABLED ; ax <- message
mov di, mask MF_CALL ; di <- MessageFlags
mov dl, VUM_NOW
call ObjMessage ; di <- MessageError
.leave
ret
SetupUIForEditing endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SoundPlayPlay
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Play buffer to voice
CALLED BY: MSG_SND_PLAY_PLAY
PASS: es = ds = dgroup
RETURN: nothing
DESTROYED: nothing
(bx, si, di, es, ds allowed)
SIDE EFFECTS:
Disables the following GenObjects:
SndPlayNoteInteraction
SndPlayPositionBar
SndPlayPlayTigger
SndPlayRecordTrigger
SndPlayEditBar
Enters play state
Plays currently defined buffer to Music stream
PSEUDO CODE/STRATEGY:
enter playing state
disable appropriate Gen objects
Send first message to ourselves to play next note
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 6/18/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SoundPlayPlay method dynamic SndPlayGenProcessClass,
MSG_SND_PLAY_PLAY
.enter
;
; First disable all the UI, so the user can't do anything
; while the song is playing.
;
call SetupUIForPlaying
;
; Update the status moniker to read "Playing".
;
mov ds:[currentState], SCS_PLAYING
call SoundPlayUpdateCurrentState
;
; Now actually start playing the notes.
;
call GeodeGetProcessHandle ; bx <- process handle
mov ax, MSG_SND_PLAY_PLAY_NEXT_NOTE ; ax <- message
mov cx, ds:[currentPosition] ; cx <- starting note
mov di, mask MF_FORCE_QUEUE ; di <- MessageFlags
call ObjMessage ; di <- MessageError
.leave
ret
SoundPlayPlay endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SetupUIForPlaying
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Disables the necessary UI objects when we start playing
a song.
CALLED BY: SoundPlayPlay
PASS: nothing
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
stevey 6/20/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SetupUIForPlaying proc near
uses ax,bx,cx,dx,si,di,bp
.enter
;
; Disable everything except the Stop button and the
; Status glyph.
;
GetResourceHandleNS Interface, bx
mov si, offset SndPlayNoteInteraction
mov ax, MSG_GEN_SET_NOT_ENABLED
mov di, mask MF_CALL
mov dl, VUM_NOW
call ObjMessage
mov si, offset SndPlayPositionBar
mov ax, MSG_GEN_SET_NOT_ENABLED
mov di, mask MF_CALL
mov dl, VUM_NOW
call ObjMessage
mov si, offset SndPlayPlayTrigger
mov ax, MSG_GEN_SET_NOT_ENABLED
mov di, mask MF_CALL
mov dl, VUM_NOW
call ObjMessage
mov si, offset SndPlayRecordTrigger
mov ax, MSG_GEN_SET_NOT_ENABLED
mov di, mask MF_CALL
mov dl, VUM_NOW
call ObjMessage
mov si, offset SndPlayEditBar
mov ax, MSG_GEN_SET_NOT_ENABLED
mov di, mask MF_CALL
mov dl, VUM_NOW
call ObjMessage
mov si, offset SndPlayCurrentNoteGlyph
mov ax, MSG_GEN_SET_NOT_ENABLED
mov di, mask MF_CALL
mov dl, VUM_NOW
call ObjMessage
.leave
ret
SetupUIForPlaying endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SoundPlayRecord
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Start recording notes from current position.
CALLED BY: MSG_SND_PLAY_RECORD
PASS: es = ds = dgroup
RETURN: nothing
DESTROYED: nothing
(bx, si, di, es, ds allowed)
SIDE EFFECTS:
disables the following GenObjects:
SndPlayPlayTrigger
SndPlayRecordTrigger
SndPlayEditBar
enters record-mode
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 6/18/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SoundPlayRecord method dynamic SndPlayGenProcessClass,
MSG_SND_PLAY_RECORD
uses ax, cx, dx, bp
.enter
;
; Enable/disable the appropriate UI objects onscreen.
;
call SetupUIForRecording
;
; Set the status moniker to read "Recording".
;
mov ds:[currentState], SCS_RECORDING
call SoundPlayUpdateCurrentState
.leave
ret
SoundPlayRecord endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SetupUIForRecording
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set all the UI objects appropriate for record-mode.
CALLED BY: SoundPlayRecord
PASS: nothing
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
stevey 6/20/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SetupUIForRecording proc near
uses ax,bx,cx,dx,si,di,bp
.enter
;
; Diable the play & record triggers
;
GetResourceHandleNS Interface, bx
mov si, offset SndPlayPlayTrigger
mov ax, MSG_GEN_SET_NOT_ENABLED
mov di, mask MF_CALL
mov dl, VUM_NOW
call ObjMessage
mov si, offset SndPlayRecordTrigger
mov ax, MSG_GEN_SET_NOT_ENABLED
mov di, mask MF_CALL
mov dl, VUM_NOW
call ObjMessage
;
; Disable the editing controls (insert, delete, etc).
;
mov si, offset SndPlayEditBar
mov ax, MSG_GEN_SET_NOT_ENABLED
mov di, mask MF_CALL
mov dl, VUM_NOW
call ObjMessage
.leave
ret
SetupUIForRecording endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SoundPlayRewind
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Rewind to the beginning of the song.
CALLED BY: MSG_SND_PLAY_REWIND
PASS: es = ds = dgroup
RETURN: nothing
DESTROYED: nothing
(bx, si, di, es, ds allowed)
SIDE EFFECTS: sets currentPosition to zero
PSEUDO CODE/STRATEGY:
- set current position to zero
- update the "current note" glyph
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 6/18/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SoundPlayRewind method dynamic SndPlayGenProcessClass,
MSG_SND_PLAY_REWIND
uses ax, cx, dx, bp
.enter
;
; Set position to beginning of list.
;
clr ds:[currentPosition]
;
; Update Display To Reflect Changes.
;
call SoundPlayUpdateCurrentPosition
;
; Update the "Scan" GenValue.
;
call SoundPlayUpdateScan
.leave
ret
SoundPlayRewind endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SoundPlayScan
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Manually set the current position.
CALLED BY: MSG_SND_PLAY_SCAN
PASS: es = ds = dgroup
dx = new current position
RETURN: nothing
DESTROYED: nothing
(bx, si, di, es, ds allowed)
SIDE EFFECTS: updates currentPosition in dgroup
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 6/18/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SoundPlayScan method dynamic SndPlayGenProcessClass,
MSG_SND_PLAY_SCAN
uses ax, cx, dx, bp
.enter
mov ds:[currentPosition], dx
;
; Update "Current Note" glyph to show the new position.
;
call SoundPlayUpdateCurrentPosition
.leave
ret
SoundPlayScan endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SoundPlayAdvance
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Advance to the end of the song. Why? So you can add
notes on the end!
CALLED BY: MSG_SND_PLAY_ADVANCE
PASS: es = ds = dgroup
RETURN: nothing
DESTROYED: nothing
(bx, si, di, es, ds allowed)
SIDE EFFECTS: updates currentPosition in dgroup
PSEUDO CODE/STRATEGY:
You probably don't have to mess with this code.
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 6/18/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SoundPlayAdvance method dynamic SndPlayGenProcessClass,
MSG_SND_PLAY_ADVANCE
uses ax, cx, dx, bp
.enter
mov ds:[currentPosition], MAX_NUMBER_OF_NOTES
;
; Update current-note glyph to show new note.
;
call SoundPlayUpdateCurrentPosition
;
; Update the "Scan" GenValue.
;
call SoundPlayUpdateScan
.leave
ret
SoundPlayAdvance endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SoundPlayInsert
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Insert a note into the list.
CALLED BY: MSG_SND_PLAY_INSERT
PASS: es = ds = dgroup
RETURN: nothing
DESTROYED: nothing
(bx, si, di, es, ds allowed)
SIDE EFFECTS: none
PSEUDO CODE/STRATEGY:
This message is sent when you hit the "OK" trigger in
the "Insert Note" dialog. We've already written the code
for getting the note and duration from that dialog. This
routine then calls the one *you* should write: namely,
SoundPlayInsertNote, in sndplayList.asm
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 6/18/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SoundPlayInsert method dynamic SndPlayGenProcessClass,
MSG_SND_PLAY_INSERT
uses ax, cx, dx, bp
.enter
;
; Find out the frequency and duration of the new note.
;
GetResourceHandleNS InsertNoteFrequencyList, bx
mov si, offset InsertNoteFrequencyList
mov di, mask MF_CALL
mov ax, MSG_GEN_ITEM_GROUP_GET_SELECTION
call ObjMessage ; ax = selection
push ax ; save note
GetResourceHandleNS InsertNoteDurationList, bx
mov si, offset InsertNoteDurationList
mov di, mask MF_CALL
mov ax, MSG_GEN_ITEM_GROUP_GET_SELECTION
call ObjMessage ; ax = selection
mov_tr dx, ax ; dx <- duration
pop cx ; cx <- note
;
; Call the data-structure insert routine (it's blank right
; now). The routine should be in sndplayList.asm.
;
call SoundPlayInsertNote
;
; Update Display To Reflect Changes
;
call SoundPlayUpdateCurrentPosition
.leave
ret
SoundPlayInsert endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SoundPlayDelete
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Delete the current note from the piece
CALLED BY: MSG_SND_PLAY_DELETE
PASS: es = ds = dgroup
RETURN: nothing
DESTROYED: nothing
(bx, si, di, es, ds allowed)
SIDE EFFECTS: none
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 6/18/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SoundPlayDelete method dynamic SndPlayGenProcessClass,
MSG_SND_PLAY_DELETE
uses ax, cx, dx, bp
.enter
;
; Call the data structure routine for deleting a note.
;
call SoundPlayDeleteNote
;
; Update current-note glyph to show the new current note.
;
call SoundPlayUpdateCurrentPosition
.leave
ret
SoundPlayDelete endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SoundPlayChange
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Change the values of the current note
CALLED BY: MSG_SND_PLAY_CHANGE
PASS: ds = es = dgroup
RETURN: nothing
DESTROYED: nothing
(bx, si, di, es, ds allowed)
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 6/18/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SoundPlayChange method dynamic SndPlayGenProcessClass,
MSG_SND_PLAY_CHANGE
uses ax, cx, dx, bp
.enter
;
; First get the new note & duration.
;
GetResourceHandleNS ChangeNoteFrequencyList, bx
mov si, offset ChangeNoteFrequencyList
mov di, mask MF_CALL
mov ax, MSG_GEN_ITEM_GROUP_GET_SELECTION
call ObjMessage ; ax = selection
push ax ; save note
GetResourceHandleNS ChangeNoteDurationList, bx
mov si, offset ChangeNoteDurationList
mov di, mask MF_CALL
mov ax, MSG_GEN_ITEM_GROUP_GET_SELECTION
call ObjMessage ; ax = selection
mov_tr dx, ax ; dx <- duration
pop cx ; cx <- note
;
; Now call the data-structure routine for setting
; the new values for the current note.
;
call SoundPlaySetNoteValue
;
; Update Display To Reflect Changes
;
call SoundPlayUpdateCurrentPosition
.leave
ret
SoundPlayChange endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SoundPlayUpdateCurrentState
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Adjust display to reflect current state
CALLED BY: INTERNAL
PASS: ds = dgroup
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS:
Modifies GenGlyph
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 6/18/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SoundPlayUpdateCurrentState proc near
uses ax, cx, dx, si, bp
.enter
;
; Get current state from dgroup and use as offset
; into table of offsets to retrieve the
; text moniker appropriate to the status
;
mov si, ds:[currentState] ; si = SoundCurrentState
mov cx, cs ; cx:dx <- text,0
mov dx, cs:stateVisMonikerOffsetTable[si]
;
; Update the GenGlyph displaying the state.
;
GetResourceHandleNS SndPlayCurrentStatusGlyph, bx
mov si, offset SndPlayCurrentStatusGlyph
mov di, mask MF_CALL
mov ax, MSG_GEN_REPLACE_VIS_MONIKER_TEXT
mov bp, VUM_NOW
call ObjMessage ; ax, cx, dx, bp destroyed
.leave
ret
stateVisMonikerOffsetTable nptr recordingStatusText,
editingStatusText,
playingStatusText
recordingStatusText byte "Recording",0
editingStatusText byte "Editing",0
playingStatusText byte "Playing",0
SoundPlayUpdateCurrentState endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SoundPlayUpdateCurrentPosition
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Adjust display to reflect current note
CALLED BY: INTERNAL
PASS: ds = dgroup
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS:
Modifies GenGlyph
PSEUDO CODE/STRATEGY:
Allocate buffer on stack
Call Kernel routine to convert reg to text
Change Moniker in GenObject
Free up buffer
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 6/18/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SoundPlayUpdateCurrentPosition proc near
uses ax,bx,cx,dx,si,di,bp,es
.enter
;
; Get the tone out of the note at the current position.
;
mov cx, ds:[currentPosition]
call SoundPlayFindNote ; si = offset
jc done
call SoundPlayGetNoteValue ; bx = SoundNoteType
mov_tr ax, bx
;
; Convert the SoundNoteType into a character.
;
clr dx ; high word of dividend
mov bx, (LENGTH_OF_EVENT * 4) ; bl = divisor
div bx ; ax = table offset
mov bx, ax ; bx is index register
mov bl, cs:[NoteToAsciiTable][bx] ; bl <- character
;
; Make the char into a string on the stack.
;
sub sp, 2 ; one char & one null
mov bp, sp
movdw cxdx, ssbp
mov {byte} ss:[bp], bl ; the character
mov {byte} ss:[bp+1], 0 ; null-terminator
;
; Update SndPlayCurrentNoteGlyph.
;
GetResourceHandleNS SndPlayCurrentNoteGlyph, bx
mov si, offset SndPlayCurrentNoteGlyph
mov ax, MSG_GEN_REPLACE_VIS_MONIKER_TEXT
mov di, mask MF_CALL
mov bp, VUM_NOW
call ObjMessage ; destroys ax, cx, dx, bp
;
; Clean up the stack.
;
add sp, 2
done:
.leave
ret
NoteToAsciiTable byte "R","C","D","E","F","G","A","B","C"
SoundPlayUpdateCurrentPosition endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SoundPlayUpdateScan
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Adjust the GenValue's value to currentPosition
CALLED BY: GLOBAL
PASS: ds = dgroup
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
Get the curentPosition
Adjust the GenValue
REVISION HISTORY:
Name Date Description
---- ---- -----------
stevey 6/20/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SoundPlayUpdateScan proc near
uses ax, bx, cx, dx, si, di, bp
.enter
;
; Get the current position in the song from dgroup
;
mov cx, ds:[currentPosition]
;
; Tell the GenValue which value to display
;
clr bp ; not indeterminate
GetResourceHandleNS SndPlayScan, bx
mov si, offset SndPlayScan
mov di, mask MF_CALL
mov ax, MSG_GEN_VALUE_SET_INTEGER_VALUE
call ObjMessage
.leave
ret
SoundPlayUpdateScan endp
CommonCode ends ;end of CommonCode resource
| 23.46102 | 80 | 0.571792 |
684c4b365a1f10c56387b7f2fbc2e1f36274c8b7 | 640 | asm | Assembly | programs/oeis/165/A165751.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/165/A165751.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/165/A165751.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A165751: a(n) = 4 - 3*2^n.
; 1,-2,-8,-20,-44,-92,-188,-380,-764,-1532,-3068,-6140,-12284,-24572,-49148,-98300,-196604,-393212,-786428,-1572860,-3145724,-6291452,-12582908,-25165820,-50331644,-100663292,-201326588,-402653180,-805306364,-1610612732,-3221225468,-6442450940,-12884901884,-25769803772,-51539607548,-103079215100,-206158430204,-412316860412,-824633720828,-1649267441660,-3298534883324,-6597069766652,-13194139533308,-26388279066620,-52776558133244,-105553116266492,-211106232532988,-422212465065980,-844424930131964,-1688849860263932,-3377699720527868,-6755399441055740
mov $1,2
pow $1,$0
mul $1,-1
add $1,1
mul $1,3
add $1,1
| 64 | 553 | 0.76875 |
4aa968d6abe8b201a2522cda762b543fbb5cf5be | 146 | asm | Assembly | other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/NES_Ver2/us_asm/zel_sub0.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/NES_Ver2/us_asm/zel_sub0.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/NES_Ver2/us_asm/zel_sub0.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | Name: zel_sub0.asm
Type: file
Size: 21912
Last-Modified: '2016-05-13T04:27:09Z'
SHA-1: 2E0B1ED8BF46004FFB5AD7DAFED0D01684B00CEF
Description: null
| 20.857143 | 47 | 0.815068 |
ab400979a5931dec85cbbf5a486c0d0ced7715d1 | 928 | asm | Assembly | libsrc/_DEVELOPMENT/error/z80/error_eacces_mc.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/error/z80/error_eacces_mc.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/error/z80/error_eacces_mc.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | 1 | 2019-12-03T23:57:48.000Z | 2019-12-03T23:57:48.000Z |
INCLUDE "clib_cfg.asm"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
IF __CLIB_OPT_ERROR
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; verbose mode
SECTION code_clib
SECTION code_error
PUBLIC error_eacces_mc
EXTERN __EACCES, errno_mc
pop hl
error_eacces_mc:
; set hl = -1
; set carry flag
; set errno = EACCES
ld l,__EACCES
jp errno_mc
SECTION rodata_clib
SECTION rodata_error_strings
IF __CLIB_OPT_ERROR & $02
defb __EACCES
defm "EACCES - Permission denied"
defb 0
ELSE
defb __EACCES
defm "EACCES"
defb 0
ENDIF
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ELSE
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
SECTION code_clib
SECTION code_error
PUBLIC error_eacces_mc
EXTERN errno_mc
defc error_eacces_mc = errno_mc - 2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ENDIF
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
| 14.967742 | 39 | 0.479526 |
8efdd578d9d4c73d4ef41a27c3768c1977ccf774 | 8,457 | asm | Assembly | Transynther/x86/_processed/US/_zr_/i7-7700_9_0xca.log_21829_1352.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/US/_zr_/i7-7700_9_0xca.log_21829_1352.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/US/_zr_/i7-7700_9_0xca.log_21829_1352.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 %r12
push %r15
push %r8
push %r9
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0xc2e3, %rsi
lea addresses_WC_ht+0x1e2e3, %rdi
nop
nop
nop
xor $53866, %r15
mov $86, %rcx
rep movsq
nop
inc %r12
lea addresses_normal_ht+0xeae3, %rsi
lea addresses_normal_ht+0x32e3, %rdi
nop
nop
nop
nop
nop
and %r8, %r8
mov $36, %rcx
rep movsl
nop
nop
nop
sub $27133, %rsi
lea addresses_A_ht+0x8963, %rdi
nop
nop
nop
cmp %r10, %r10
movb $0x61, (%rdi)
nop
nop
nop
nop
dec %rsi
lea addresses_WC_ht+0x146e3, %r15
nop
nop
nop
nop
nop
inc %rsi
vmovups (%r15), %ymm6
vextracti128 $0, %ymm6, %xmm6
vpextrq $1, %xmm6, %r12
nop
nop
cmp %r15, %r15
lea addresses_normal_ht+0xdb63, %r12
and %rcx, %rcx
vmovups (%r12), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $1, %xmm4, %r8
nop
nop
nop
nop
nop
add $59973, %rsi
lea addresses_A_ht+0x11c0b, %rsi
lea addresses_WC_ht+0x1a52f, %rdi
nop
nop
nop
sub %r9, %r9
mov $123, %rcx
rep movsl
nop
sub $27103, %r10
lea addresses_WC_ht+0x1e895, %rdi
nop
nop
inc %rsi
mov (%rdi), %rcx
xor $54437, %r12
lea addresses_WC_ht+0x19ae3, %rsi
lea addresses_normal_ht+0x17ee3, %rdi
nop
nop
nop
nop
nop
sub $25769, %r8
mov $18, %rcx
rep movsb
nop
nop
nop
sub %r8, %r8
lea addresses_UC_ht+0x123c3, %rsi
lea addresses_UC_ht+0x13023, %rdi
nop
nop
nop
nop
nop
xor %r15, %r15
mov $124, %rcx
rep movsb
nop
nop
nop
cmp %rcx, %rcx
lea addresses_D_ht+0x1ce3, %rsi
lea addresses_UC_ht+0x82e3, %rdi
clflush (%rsi)
clflush (%rdi)
nop
nop
nop
and $15150, %r12
mov $52, %rcx
rep movsb
nop
nop
nop
nop
nop
cmp %r8, %r8
lea addresses_WT_ht+0x1fe3, %rsi
lea addresses_D_ht+0x2a03, %rdi
add $22733, %r10
mov $92, %rcx
rep movsb
nop
nop
nop
nop
xor %rsi, %rsi
lea addresses_WC_ht+0x973, %r8
nop
xor $23524, %r12
movups (%r8), %xmm5
vpextrq $1, %xmm5, %r10
and %r10, %r10
lea addresses_normal_ht+0x6ebf, %r12
nop
cmp %r9, %r9
mov (%r12), %r10d
nop
nop
nop
inc %r12
pop %rsi
pop %rdi
pop %rcx
pop %r9
pop %r8
pop %r15
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r14
push %r15
push %r9
push %rbp
push %rsi
// Store
mov $0x763, %r9
nop
nop
nop
nop
inc %rbp
movb $0x51, (%r9)
nop
nop
cmp $63529, %r9
// Store
lea addresses_WC+0x17ce3, %r14
sub $49725, %r15
movl $0x51525354, (%r14)
nop
nop
nop
nop
nop
and %r9, %r9
// Store
lea addresses_D+0xb023, %r14
nop
nop
nop
nop
cmp %r12, %r12
mov $0x5152535455565758, %rbp
movq %rbp, (%r14)
nop
nop
nop
nop
nop
add %r15, %r15
// Store
lea addresses_A+0xa4e3, %rbp
nop
nop
nop
nop
dec %r14
mov $0x5152535455565758, %r10
movq %r10, %xmm5
movups %xmm5, (%rbp)
dec %rbp
// Faulty Load
lea addresses_US+0x1ae3, %r12
nop
inc %r15
movups (%r12), %xmm0
vpextrq $1, %xmm0, %rbp
lea oracles, %r12
and $0xff, %rbp
shlq $12, %rbp
mov (%r12,%rbp,1), %rbp
pop %rsi
pop %rbp
pop %r9
pop %r15
pop %r14
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_US'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_P'}}
{'OP': 'STOR', 'dst': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 4, 'NT': True, 'type': 'addresses_WC'}}
{'OP': 'STOR', 'dst': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_D'}}
{'OP': 'STOR', 'dst': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_A'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 16, 'NT': False, 'type': 'addresses_US'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 10, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_WC_ht'}}
{'src': {'congruent': 11, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_normal_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 1, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 0, 'same': True, 'type': 'addresses_WC_ht'}}
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 8, 'NT': True, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 10, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 6, 'same': True, 'type': 'addresses_normal_ht'}}
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 7, 'same': True, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 4, 'same': False, 'type': 'addresses_D_ht'}}
{'src': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 31.206642 | 2,999 | 0.656498 |
396d20dbc49f0454b0ca08b80b0bbc28e6451d7a | 831 | asm | Assembly | oeis/142/A142123.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/142/A142123.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/142/A142123.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A142123: Primes congruent to 14 mod 37.
; Submitted by Jon Maiga
; 199,347,421,569,643,1013,1087,1531,1753,1901,2789,3011,3307,3529,3677,4639,4787,4861,5009,5231,5527,5749,5897,6563,6637,7229,7451,7673,8117,8191,8783,9227,9967,10337,10559,10781,11003,11299,11447,11743,12113,12409,12853,13001,13297,13963,14407,14629,14851,15073,15443,15739,15887,16183,16553,17293,17737,17959,18181,18329,18773,19069,19661,20327,20549,20771,21067,21881,22621,22769,23509,23879,24767,24841,24989,25951,26099,26321,26839,26987,27061,27283,27431,27653,28097,28319,28393,28541,28837
mov $2,$0
add $2,2
pow $2,2
lpb $2
mul $1,$4
mov $3,$1
add $1,9
add $3,50
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,65
sub $2,1
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
lpe
mov $0,$1
sub $0,23
| 34.625 | 497 | 0.724428 |
d512b1ee1ea2d17488ad6401d06aeb85581d339f | 823 | asm | Assembly | programs/oeis/301/A301726.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/301/A301726.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/301/A301726.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A301726: Coordination sequence for node of type V2 in "kra" 2-D tiling (or net).
; 1,5,11,16,21,27,33,38,43,49,54,59,65,70,75,81,87,92,97,103,108,113,119,124,129,135,141,146,151,157,162,167,173,178,183,189,195,200,205,211,216,221,227,232,237,243,249,254,259,265,270,275,281,286,291,297,303,308,313,319,324,329,335,340,345,351,357,362,367,373,378,383,389,394,399,405,411,416,421,427,432,437,443,448,453,459,465,470,475,481,486,491,497,502,507,513,519,524,529,535,540
mov $4,$0
add $4,1
mov $7,$0
lpb $4
mov $0,$7
sub $4,1
sub $0,$4
mul $0,3
lpb $0
mov $2,$0
mov $3,$0
sub $3,$5
sub $0,$3
add $0,$6
div $0,20
add $2,5
mod $2,10
mov $3,3
sub $3,$0
add $3,2
mov $0,$3
mov $5,6
mov $6,$2
mul $6,3
add $6,3
lpe
mov $6,$0
add $6,1
add $1,$6
lpe
| 24.205882 | 384 | 0.592953 |
7bd83f5b4679187ea12c9743d3385459b87540a5 | 2,281 | asm | Assembly | sway-core/tests/ir_to_asm/storage_store.asm | yirenlu92/ren-sway-fork | 85032fb96c55efa9fbe3ac00eb5b3b0c5c2af051 | [
"Apache-2.0"
] | null | null | null | sway-core/tests/ir_to_asm/storage_store.asm | yirenlu92/ren-sway-fork | 85032fb96c55efa9fbe3ac00eb5b3b0c5c2af051 | [
"Apache-2.0"
] | null | null | null | sway-core/tests/ir_to_asm/storage_store.asm | yirenlu92/ren-sway-fork | 85032fb96c55efa9fbe3ac00eb5b3b0c5c2af051 | [
"Apache-2.0"
] | null | null | null | .program:
ji i4
noop
DATA_SECTION_OFFSET[0..32]
DATA_SECTION_OFFSET[32..64]
lw $ds $is 1
add $$ds $$ds $is
lw $r1 $fp i73 ; load input function selector
lw $r0 data_4 ; load fn selector for comparison
eq $r0 $r1 $r0 ; function selector comparison
jnei $zero $r0 i14 ; jump to selected function
lw $r0 data_5 ; load fn selector for comparison
eq $r0 $r1 $r0 ; function selector comparison
jnei $zero $r0 i26 ; jump to selected function
rvrt $zero ; revert if no selectors matched
move $r2 $sp ; save locals base register
cfei i32 ; allocate 32 bytes for all locals
lw $r0 data_0 ; literal instantiation
addi $r0 $r2 i0 ; get_ptr
lw $r1 data_1 ; literal instantiation
addi $r0 $r2 i0 ; get store offset
mcpi $r0 $r1 i32 ; store value
lw $r1 data_0 ; literal instantiation
addi $r0 $r2 i0 ; get offset
sww $r0 $r1 ; single word state access
ret $zero ; returning unit as zero
move $r1 $sp ; save locals base register
cfei i64 ; allocate 64 bytes for all locals
addi $r0 $r1 i32 ; get_ptr
lw $r2 data_2 ; literal instantiation
addi $r0 $r1 i32 ; get store offset
mcpi $r0 $r2 i32 ; store value
addi $r0 $r1 i0 ; get_ptr
lw $r2 data_3 ; literal instantiation
addi $r0 $r1 i0 ; get store offset
mcpi $r0 $r2 i32 ; store value
addi $r0 $r1 i32 ; get_ptr
addi $r2 $r1 i32 ; get offset
addi $r0 $r1 i0 ; get offset
swwq $r0 $r2 ; quad word state access
ret $zero ; returning unit as zero
noop ; word-alignment of data section
.data:
data_0 .u64 0x00
data_1 .b256 0x7fbd1192666bfac3767b890bd4d048c940879d316071e20c7c8c81bce2ca41c5
data_2 .b256 0x0000000000000000000000000000000000000000000000000000000000000000
data_3 .b256 0xa15d6d36b54df993ed1fbe4544a45d4c4f70d81b4229861dfde0e20eb652202c
data_4 .u32 0x1b9b478f
data_5 .u32 0x858a3d18
| 45.62 | 79 | 0.577817 |
417763a121bd4b5bedcacd039769d6f178243b55 | 277 | asm | Assembly | programs/oeis/112/A112742.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/112/A112742.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/112/A112742.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A112742: a(n) = n^2*(n^2-1)/3.
; 0,0,4,24,80,200,420,784,1344,2160,3300,4840,6864,9464,12740,16800,21760,27744,34884,43320,53200,64680,77924,93104,110400,130000,152100,176904,204624,235480,269700,307520,349184,394944,445060,499800,559440
pow $0,2
bin $0,2
div $0,6
mul $0,4
| 34.625 | 206 | 0.732852 |
f940aa9976393b7b36d03cb03a6da966c33617a5 | 843 | asm | Assembly | oeis/142/A142216.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/142/A142216.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/142/A142216.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A142216: Primes congruent to 19 mod 41.
; Submitted by Simon Strandgaard
; 19,101,347,593,757,839,1249,1741,1823,1987,2069,2971,3217,3299,3463,3709,4201,4283,4447,5021,5431,5923,6661,6907,7481,7727,8219,8629,9203,9613,9859,9941,10433,10597,11171,11827,11909,12073,12401,12647,12893,13877,14369,14533,14779,15107,15271,16091,16747,16829,16993,17239,17321,17977,18059,18223,18797,19207,19289,19699,20929,21011,21503,22159,22651,23143,24373,25111,25357,25439,25603,25849,25931,26177,26423,26669,26833,27407,27653,27817,28309,29129,29867,30113,30851,32327,32491,32573,32983
mov $1,9
mov $2,$0
add $2,2
pow $2,2
lpb $2
sub $2,2
mov $3,$1
add $1,4
mul $3,2
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,37
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
lpe
mul $1,2
mov $0,$1
sub $0,81
| 33.72 | 496 | 0.727165 |
6481b57b6d7c7e7c66d89d51114d2b8268897693 | 47,670 | asm | Assembly | stressfs.asm | ShwetiMahajan/xv6_schedulersOS | 35efdf3d33562ec290331a7ee246e65af19e7e2e | [
"MIT-0"
] | null | null | null | stressfs.asm | ShwetiMahajan/xv6_schedulersOS | 35efdf3d33562ec290331a7ee246e65af19e7e2e | [
"MIT-0"
] | null | null | null | stressfs.asm | ShwetiMahajan/xv6_schedulersOS | 35efdf3d33562ec290331a7ee246e65af19e7e2e | [
"MIT-0"
] | null | null | null |
_stressfs: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
#include "fs.h"
#include "fcntl.h"
int
main(int argc, char *argv[])
{
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 83 e4 f0 and $0xfffffff0,%esp
6: 57 push %edi
7: 56 push %esi
8: 53 push %ebx
printf(1, "stressfs starting\n");
memset(data, 'a', sizeof(data));
for(i = 0; i < 4; i++)
if(fork() > 0)
9: 31 db xor %ebx,%ebx
#include "fs.h"
#include "fcntl.h"
int
main(int argc, char *argv[])
{
b: 81 ec 24 02 00 00 sub $0x224,%esp
int fd, i;
char path[] = "stressfs0";
char data[512];
printf(1, "stressfs starting\n");
memset(data, 'a', sizeof(data));
11: 8d 74 24 16 lea 0x16(%esp),%esi
int
main(int argc, char *argv[])
{
int fd, i;
char path[] = "stressfs0";
15: c7 84 24 16 02 00 00 movl $0x65727473,0x216(%esp)
1c: 73 74 72 65
20: c7 84 24 1a 02 00 00 movl $0x73667373,0x21a(%esp)
27: 73 73 66 73
2b: 66 c7 84 24 1e 02 00 movw $0x30,0x21e(%esp)
32: 00 30 00
char data[512];
printf(1, "stressfs starting\n");
35: c7 44 24 04 26 08 00 movl $0x826,0x4(%esp)
3c: 00
3d: c7 04 24 01 00 00 00 movl $0x1,(%esp)
44: e8 77 04 00 00 call 4c0 <printf>
memset(data, 'a', sizeof(data));
49: c7 44 24 08 00 02 00 movl $0x200,0x8(%esp)
50: 00
51: c7 44 24 04 61 00 00 movl $0x61,0x4(%esp)
58: 00
59: 89 34 24 mov %esi,(%esp)
5c: e8 9f 01 00 00 call 200 <memset>
for(i = 0; i < 4; i++)
if(fork() > 0)
61: e8 1a 03 00 00 call 380 <fork>
66: 85 c0 test %eax,%eax
68: 7f 2b jg 95 <main+0x95>
6a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
70: e8 0b 03 00 00 call 380 <fork>
75: b3 01 mov $0x1,%bl
77: 85 c0 test %eax,%eax
79: 7f 1a jg 95 <main+0x95>
7b: e8 00 03 00 00 call 380 <fork>
80: b3 02 mov $0x2,%bl
82: 85 c0 test %eax,%eax
84: 7f 0f jg 95 <main+0x95>
86: e8 f5 02 00 00 call 380 <fork>
8b: 31 db xor %ebx,%ebx
8d: 85 c0 test %eax,%eax
8f: 0f 9e c3 setle %bl
92: 83 c3 03 add $0x3,%ebx
break;
printf(1, "write %d\n", i);
95: 89 5c 24 08 mov %ebx,0x8(%esp)
99: c7 44 24 04 39 08 00 movl $0x839,0x4(%esp)
a0: 00
a1: c7 04 24 01 00 00 00 movl $0x1,(%esp)
a8: e8 13 04 00 00 call 4c0 <printf>
path[8] += i;
fd = open(path, O_CREATE | O_RDWR);
ad: 8d 84 24 16 02 00 00 lea 0x216(%esp),%eax
if(fork() > 0)
break;
printf(1, "write %d\n", i);
path[8] += i;
b4: 00 9c 24 1e 02 00 00 add %bl,0x21e(%esp)
fd = open(path, O_CREATE | O_RDWR);
bb: 31 db xor %ebx,%ebx
bd: c7 44 24 04 02 02 00 movl $0x202,0x4(%esp)
c4: 00
c5: 89 04 24 mov %eax,(%esp)
c8: e8 fb 02 00 00 call 3c8 <open>
cd: 89 c7 mov %eax,%edi
cf: 90 nop
for(i = 0; i < 20; i++)
d0: 83 c3 01 add $0x1,%ebx
// printf(fd, "%d\n", i);
write(fd, data, sizeof(data));
d3: c7 44 24 08 00 02 00 movl $0x200,0x8(%esp)
da: 00
db: 89 74 24 04 mov %esi,0x4(%esp)
df: 89 3c 24 mov %edi,(%esp)
e2: e8 c1 02 00 00 call 3a8 <write>
printf(1, "write %d\n", i);
path[8] += i;
fd = open(path, O_CREATE | O_RDWR);
for(i = 0; i < 20; i++)
e7: 83 fb 14 cmp $0x14,%ebx
ea: 75 e4 jne d0 <main+0xd0>
// printf(fd, "%d\n", i);
write(fd, data, sizeof(data));
close(fd);
ec: 89 3c 24 mov %edi,(%esp)
printf(1, "read\n");
fd = open(path, O_RDONLY);
ef: 30 db xor %bl,%bl
path[8] += i;
fd = open(path, O_CREATE | O_RDWR);
for(i = 0; i < 20; i++)
// printf(fd, "%d\n", i);
write(fd, data, sizeof(data));
close(fd);
f1: e8 ba 02 00 00 call 3b0 <close>
printf(1, "read\n");
f6: c7 44 24 04 43 08 00 movl $0x843,0x4(%esp)
fd: 00
fe: c7 04 24 01 00 00 00 movl $0x1,(%esp)
105: e8 b6 03 00 00 call 4c0 <printf>
fd = open(path, O_RDONLY);
10a: 8d 84 24 16 02 00 00 lea 0x216(%esp),%eax
111: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
118: 00
119: 89 04 24 mov %eax,(%esp)
11c: e8 a7 02 00 00 call 3c8 <open>
121: 89 c7 mov %eax,%edi
123: 90 nop
124: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
for (i = 0; i < 20; i++)
128: 83 c3 01 add $0x1,%ebx
read(fd, data, sizeof(data));
12b: c7 44 24 08 00 02 00 movl $0x200,0x8(%esp)
132: 00
133: 89 74 24 04 mov %esi,0x4(%esp)
137: 89 3c 24 mov %edi,(%esp)
13a: e8 61 02 00 00 call 3a0 <read>
close(fd);
printf(1, "read\n");
fd = open(path, O_RDONLY);
for (i = 0; i < 20; i++)
13f: 83 fb 14 cmp $0x14,%ebx
142: 75 e4 jne 128 <main+0x128>
read(fd, data, sizeof(data));
close(fd);
144: 89 3c 24 mov %edi,(%esp)
147: e8 64 02 00 00 call 3b0 <close>
wait();
14c: e8 3f 02 00 00 call 390 <wait>
exit();
151: e8 32 02 00 00 call 388 <exit>
156: 90 nop
157: 90 nop
158: 90 nop
159: 90 nop
15a: 90 nop
15b: 90 nop
15c: 90 nop
15d: 90 nop
15e: 90 nop
15f: 90 nop
00000160 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, char *t)
{
160: 55 push %ebp
161: 31 d2 xor %edx,%edx
163: 89 e5 mov %esp,%ebp
165: 8b 45 08 mov 0x8(%ebp),%eax
168: 53 push %ebx
169: 8b 5d 0c mov 0xc(%ebp),%ebx
16c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
char *os;
os = s;
while((*s++ = *t++) != 0)
170: 0f b6 0c 13 movzbl (%ebx,%edx,1),%ecx
174: 88 0c 10 mov %cl,(%eax,%edx,1)
177: 83 c2 01 add $0x1,%edx
17a: 84 c9 test %cl,%cl
17c: 75 f2 jne 170 <strcpy+0x10>
;
return os;
}
17e: 5b pop %ebx
17f: 5d pop %ebp
180: c3 ret
181: eb 0d jmp 190 <strcmp>
183: 90 nop
184: 90 nop
185: 90 nop
186: 90 nop
187: 90 nop
188: 90 nop
189: 90 nop
18a: 90 nop
18b: 90 nop
18c: 90 nop
18d: 90 nop
18e: 90 nop
18f: 90 nop
00000190 <strcmp>:
int
strcmp(const char *p, const char *q)
{
190: 55 push %ebp
191: 89 e5 mov %esp,%ebp
193: 8b 4d 08 mov 0x8(%ebp),%ecx
196: 53 push %ebx
197: 8b 55 0c mov 0xc(%ebp),%edx
while(*p && *p == *q)
19a: 0f b6 01 movzbl (%ecx),%eax
19d: 84 c0 test %al,%al
19f: 75 14 jne 1b5 <strcmp+0x25>
1a1: eb 25 jmp 1c8 <strcmp+0x38>
1a3: 90 nop
1a4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
p++, q++;
1a8: 83 c1 01 add $0x1,%ecx
1ab: 83 c2 01 add $0x1,%edx
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
1ae: 0f b6 01 movzbl (%ecx),%eax
1b1: 84 c0 test %al,%al
1b3: 74 13 je 1c8 <strcmp+0x38>
1b5: 0f b6 1a movzbl (%edx),%ebx
1b8: 38 d8 cmp %bl,%al
1ba: 74 ec je 1a8 <strcmp+0x18>
1bc: 0f b6 db movzbl %bl,%ebx
1bf: 0f b6 c0 movzbl %al,%eax
1c2: 29 d8 sub %ebx,%eax
p++, q++;
return (uchar)*p - (uchar)*q;
}
1c4: 5b pop %ebx
1c5: 5d pop %ebp
1c6: c3 ret
1c7: 90 nop
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
1c8: 0f b6 1a movzbl (%edx),%ebx
1cb: 31 c0 xor %eax,%eax
1cd: 0f b6 db movzbl %bl,%ebx
1d0: 29 d8 sub %ebx,%eax
p++, q++;
return (uchar)*p - (uchar)*q;
}
1d2: 5b pop %ebx
1d3: 5d pop %ebp
1d4: c3 ret
1d5: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
1d9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
000001e0 <strlen>:
uint
strlen(char *s)
{
1e0: 55 push %ebp
int n;
for(n = 0; s[n]; n++)
1e1: 31 d2 xor %edx,%edx
return (uchar)*p - (uchar)*q;
}
uint
strlen(char *s)
{
1e3: 89 e5 mov %esp,%ebp
int n;
for(n = 0; s[n]; n++)
1e5: 31 c0 xor %eax,%eax
return (uchar)*p - (uchar)*q;
}
uint
strlen(char *s)
{
1e7: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
for(n = 0; s[n]; n++)
1ea: 80 39 00 cmpb $0x0,(%ecx)
1ed: 74 0c je 1fb <strlen+0x1b>
1ef: 90 nop
1f0: 83 c2 01 add $0x1,%edx
1f3: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1)
1f7: 89 d0 mov %edx,%eax
1f9: 75 f5 jne 1f0 <strlen+0x10>
;
return n;
}
1fb: 5d pop %ebp
1fc: c3 ret
1fd: 8d 76 00 lea 0x0(%esi),%esi
00000200 <memset>:
void*
memset(void *dst, int c, uint n)
{
200: 55 push %ebp
201: 89 e5 mov %esp,%ebp
203: 8b 55 08 mov 0x8(%ebp),%edx
206: 57 push %edi
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" :
207: 8b 4d 10 mov 0x10(%ebp),%ecx
20a: 8b 45 0c mov 0xc(%ebp),%eax
20d: 89 d7 mov %edx,%edi
20f: fc cld
210: f3 aa rep stos %al,%es:(%edi)
stosb(dst, c, n);
return dst;
}
212: 89 d0 mov %edx,%eax
214: 5f pop %edi
215: 5d pop %ebp
216: c3 ret
217: 89 f6 mov %esi,%esi
219: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000220 <strchr>:
char*
strchr(const char *s, char c)
{
220: 55 push %ebp
221: 89 e5 mov %esp,%ebp
223: 8b 45 08 mov 0x8(%ebp),%eax
226: 0f b6 4d 0c movzbl 0xc(%ebp),%ecx
for(; *s; s++)
22a: 0f b6 10 movzbl (%eax),%edx
22d: 84 d2 test %dl,%dl
22f: 75 11 jne 242 <strchr+0x22>
231: eb 15 jmp 248 <strchr+0x28>
233: 90 nop
234: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
238: 83 c0 01 add $0x1,%eax
23b: 0f b6 10 movzbl (%eax),%edx
23e: 84 d2 test %dl,%dl
240: 74 06 je 248 <strchr+0x28>
if(*s == c)
242: 38 ca cmp %cl,%dl
244: 75 f2 jne 238 <strchr+0x18>
return (char*)s;
return 0;
}
246: 5d pop %ebp
247: c3 ret
}
char*
strchr(const char *s, char c)
{
for(; *s; s++)
248: 31 c0 xor %eax,%eax
if(*s == c)
return (char*)s;
return 0;
}
24a: 5d pop %ebp
24b: 90 nop
24c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
250: c3 ret
251: eb 0d jmp 260 <atoi>
253: 90 nop
254: 90 nop
255: 90 nop
256: 90 nop
257: 90 nop
258: 90 nop
259: 90 nop
25a: 90 nop
25b: 90 nop
25c: 90 nop
25d: 90 nop
25e: 90 nop
25f: 90 nop
00000260 <atoi>:
return r;
}
int
atoi(const char *s)
{
260: 55 push %ebp
int n;
n = 0;
while('0' <= *s && *s <= '9')
261: 31 c0 xor %eax,%eax
return r;
}
int
atoi(const char *s)
{
263: 89 e5 mov %esp,%ebp
265: 8b 4d 08 mov 0x8(%ebp),%ecx
268: 53 push %ebx
int n;
n = 0;
while('0' <= *s && *s <= '9')
269: 0f b6 11 movzbl (%ecx),%edx
26c: 8d 5a d0 lea -0x30(%edx),%ebx
26f: 80 fb 09 cmp $0x9,%bl
272: 77 1c ja 290 <atoi+0x30>
274: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
n = n*10 + *s++ - '0';
278: 0f be d2 movsbl %dl,%edx
27b: 83 c1 01 add $0x1,%ecx
27e: 8d 04 80 lea (%eax,%eax,4),%eax
281: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax
atoi(const char *s)
{
int n;
n = 0;
while('0' <= *s && *s <= '9')
285: 0f b6 11 movzbl (%ecx),%edx
288: 8d 5a d0 lea -0x30(%edx),%ebx
28b: 80 fb 09 cmp $0x9,%bl
28e: 76 e8 jbe 278 <atoi+0x18>
n = n*10 + *s++ - '0';
return n;
}
290: 5b pop %ebx
291: 5d pop %ebp
292: c3 ret
293: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
299: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
000002a0 <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
2a0: 55 push %ebp
2a1: 89 e5 mov %esp,%ebp
2a3: 56 push %esi
2a4: 8b 45 08 mov 0x8(%ebp),%eax
2a7: 53 push %ebx
2a8: 8b 5d 10 mov 0x10(%ebp),%ebx
2ab: 8b 75 0c mov 0xc(%ebp),%esi
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
2ae: 85 db test %ebx,%ebx
2b0: 7e 14 jle 2c6 <memmove+0x26>
n = n*10 + *s++ - '0';
return n;
}
void*
memmove(void *vdst, void *vsrc, int n)
2b2: 31 d2 xor %edx,%edx
2b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
*dst++ = *src++;
2b8: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
2bc: 88 0c 10 mov %cl,(%eax,%edx,1)
2bf: 83 c2 01 add $0x1,%edx
{
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
2c2: 39 da cmp %ebx,%edx
2c4: 75 f2 jne 2b8 <memmove+0x18>
*dst++ = *src++;
return vdst;
}
2c6: 5b pop %ebx
2c7: 5e pop %esi
2c8: 5d pop %ebp
2c9: c3 ret
2ca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
000002d0 <stat>:
return buf;
}
int
stat(char *n, struct stat *st)
{
2d0: 55 push %ebp
2d1: 89 e5 mov %esp,%ebp
2d3: 83 ec 18 sub $0x18,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
2d6: 8b 45 08 mov 0x8(%ebp),%eax
return buf;
}
int
stat(char *n, struct stat *st)
{
2d9: 89 5d f8 mov %ebx,-0x8(%ebp)
2dc: 89 75 fc mov %esi,-0x4(%ebp)
int fd;
int r;
fd = open(n, O_RDONLY);
if(fd < 0)
2df: be ff ff ff ff mov $0xffffffff,%esi
stat(char *n, struct stat *st)
{
int fd;
int r;
fd = open(n, O_RDONLY);
2e4: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
2eb: 00
2ec: 89 04 24 mov %eax,(%esp)
2ef: e8 d4 00 00 00 call 3c8 <open>
if(fd < 0)
2f4: 85 c0 test %eax,%eax
stat(char *n, struct stat *st)
{
int fd;
int r;
fd = open(n, O_RDONLY);
2f6: 89 c3 mov %eax,%ebx
if(fd < 0)
2f8: 78 19 js 313 <stat+0x43>
return -1;
r = fstat(fd, st);
2fa: 8b 45 0c mov 0xc(%ebp),%eax
2fd: 89 1c 24 mov %ebx,(%esp)
300: 89 44 24 04 mov %eax,0x4(%esp)
304: e8 d7 00 00 00 call 3e0 <fstat>
close(fd);
309: 89 1c 24 mov %ebx,(%esp)
int r;
fd = open(n, O_RDONLY);
if(fd < 0)
return -1;
r = fstat(fd, st);
30c: 89 c6 mov %eax,%esi
close(fd);
30e: e8 9d 00 00 00 call 3b0 <close>
return r;
}
313: 89 f0 mov %esi,%eax
315: 8b 5d f8 mov -0x8(%ebp),%ebx
318: 8b 75 fc mov -0x4(%ebp),%esi
31b: 89 ec mov %ebp,%esp
31d: 5d pop %ebp
31e: c3 ret
31f: 90 nop
00000320 <gets>:
return 0;
}
char*
gets(char *buf, int max)
{
320: 55 push %ebp
321: 89 e5 mov %esp,%ebp
323: 57 push %edi
324: 56 push %esi
325: 31 f6 xor %esi,%esi
327: 53 push %ebx
328: 83 ec 2c sub $0x2c,%esp
32b: 8b 7d 08 mov 0x8(%ebp),%edi
int i, cc;
char c;
for(i=0; i+1 < max; ){
32e: eb 06 jmp 336 <gets+0x16>
cc = read(0, &c, 1);
if(cc < 1)
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
330: 3c 0a cmp $0xa,%al
332: 74 39 je 36d <gets+0x4d>
334: 89 de mov %ebx,%esi
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
336: 8d 5e 01 lea 0x1(%esi),%ebx
339: 3b 5d 0c cmp 0xc(%ebp),%ebx
33c: 7d 31 jge 36f <gets+0x4f>
cc = read(0, &c, 1);
33e: 8d 45 e7 lea -0x19(%ebp),%eax
341: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
348: 00
349: 89 44 24 04 mov %eax,0x4(%esp)
34d: c7 04 24 00 00 00 00 movl $0x0,(%esp)
354: e8 47 00 00 00 call 3a0 <read>
if(cc < 1)
359: 85 c0 test %eax,%eax
35b: 7e 12 jle 36f <gets+0x4f>
break;
buf[i++] = c;
35d: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
361: 88 44 1f ff mov %al,-0x1(%edi,%ebx,1)
if(c == '\n' || c == '\r')
365: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
369: 3c 0d cmp $0xd,%al
36b: 75 c3 jne 330 <gets+0x10>
36d: 89 de mov %ebx,%esi
break;
}
buf[i] = '\0';
36f: c6 04 37 00 movb $0x0,(%edi,%esi,1)
return buf;
}
373: 89 f8 mov %edi,%eax
375: 83 c4 2c add $0x2c,%esp
378: 5b pop %ebx
379: 5e pop %esi
37a: 5f pop %edi
37b: 5d pop %ebp
37c: c3 ret
37d: 90 nop
37e: 90 nop
37f: 90 nop
00000380 <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
380: b8 01 00 00 00 mov $0x1,%eax
385: cd 40 int $0x40
387: c3 ret
00000388 <exit>:
SYSCALL(exit)
388: b8 02 00 00 00 mov $0x2,%eax
38d: cd 40 int $0x40
38f: c3 ret
00000390 <wait>:
SYSCALL(wait)
390: b8 03 00 00 00 mov $0x3,%eax
395: cd 40 int $0x40
397: c3 ret
00000398 <pipe>:
SYSCALL(pipe)
398: b8 04 00 00 00 mov $0x4,%eax
39d: cd 40 int $0x40
39f: c3 ret
000003a0 <read>:
SYSCALL(read)
3a0: b8 05 00 00 00 mov $0x5,%eax
3a5: cd 40 int $0x40
3a7: c3 ret
000003a8 <write>:
SYSCALL(write)
3a8: b8 10 00 00 00 mov $0x10,%eax
3ad: cd 40 int $0x40
3af: c3 ret
000003b0 <close>:
SYSCALL(close)
3b0: b8 15 00 00 00 mov $0x15,%eax
3b5: cd 40 int $0x40
3b7: c3 ret
000003b8 <kill>:
SYSCALL(kill)
3b8: b8 06 00 00 00 mov $0x6,%eax
3bd: cd 40 int $0x40
3bf: c3 ret
000003c0 <exec>:
SYSCALL(exec)
3c0: b8 07 00 00 00 mov $0x7,%eax
3c5: cd 40 int $0x40
3c7: c3 ret
000003c8 <open>:
SYSCALL(open)
3c8: b8 0f 00 00 00 mov $0xf,%eax
3cd: cd 40 int $0x40
3cf: c3 ret
000003d0 <mknod>:
SYSCALL(mknod)
3d0: b8 11 00 00 00 mov $0x11,%eax
3d5: cd 40 int $0x40
3d7: c3 ret
000003d8 <unlink>:
SYSCALL(unlink)
3d8: b8 12 00 00 00 mov $0x12,%eax
3dd: cd 40 int $0x40
3df: c3 ret
000003e0 <fstat>:
SYSCALL(fstat)
3e0: b8 08 00 00 00 mov $0x8,%eax
3e5: cd 40 int $0x40
3e7: c3 ret
000003e8 <link>:
SYSCALL(link)
3e8: b8 13 00 00 00 mov $0x13,%eax
3ed: cd 40 int $0x40
3ef: c3 ret
000003f0 <mkdir>:
SYSCALL(mkdir)
3f0: b8 14 00 00 00 mov $0x14,%eax
3f5: cd 40 int $0x40
3f7: c3 ret
000003f8 <chdir>:
SYSCALL(chdir)
3f8: b8 09 00 00 00 mov $0x9,%eax
3fd: cd 40 int $0x40
3ff: c3 ret
00000400 <dup>:
SYSCALL(dup)
400: b8 0a 00 00 00 mov $0xa,%eax
405: cd 40 int $0x40
407: c3 ret
00000408 <getpid>:
SYSCALL(getpid)
408: b8 0b 00 00 00 mov $0xb,%eax
40d: cd 40 int $0x40
40f: c3 ret
00000410 <sbrk>:
SYSCALL(sbrk)
410: b8 0c 00 00 00 mov $0xc,%eax
415: cd 40 int $0x40
417: c3 ret
00000418 <sleep>:
SYSCALL(sleep)
418: b8 0d 00 00 00 mov $0xd,%eax
41d: cd 40 int $0x40
41f: c3 ret
00000420 <set_tickets>:
SYSCALL(set_tickets)
420: b8 16 00 00 00 mov $0x16,%eax
425: cd 40 int $0x40
427: c3 ret
428: 90 nop
429: 90 nop
42a: 90 nop
42b: 90 nop
42c: 90 nop
42d: 90 nop
42e: 90 nop
42f: 90 nop
00000430 <printint>:
write(fd, &c, 1);
}
static void
printint(int fd, int xx, int base, int sgn)
{
430: 55 push %ebp
431: 89 e5 mov %esp,%ebp
433: 57 push %edi
434: 89 cf mov %ecx,%edi
436: 56 push %esi
437: 89 c6 mov %eax,%esi
439: 53 push %ebx
43a: 83 ec 4c sub $0x4c,%esp
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
43d: 8b 4d 08 mov 0x8(%ebp),%ecx
440: 85 c9 test %ecx,%ecx
442: 74 04 je 448 <printint+0x18>
444: 85 d2 test %edx,%edx
446: 78 68 js 4b0 <printint+0x80>
neg = 1;
x = -xx;
} else {
x = xx;
448: 89 d0 mov %edx,%eax
44a: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp)
451: 31 c9 xor %ecx,%ecx
453: 8d 5d d7 lea -0x29(%ebp),%ebx
456: 66 90 xchg %ax,%ax
}
i = 0;
do{
buf[i++] = digits[x % base];
458: 31 d2 xor %edx,%edx
45a: f7 f7 div %edi
45c: 0f b6 92 50 08 00 00 movzbl 0x850(%edx),%edx
463: 88 14 0b mov %dl,(%ebx,%ecx,1)
466: 83 c1 01 add $0x1,%ecx
}while((x /= base) != 0);
469: 85 c0 test %eax,%eax
46b: 75 eb jne 458 <printint+0x28>
if(neg)
46d: 8b 45 c4 mov -0x3c(%ebp),%eax
470: 85 c0 test %eax,%eax
472: 74 08 je 47c <printint+0x4c>
buf[i++] = '-';
474: c6 44 0d d7 2d movb $0x2d,-0x29(%ebp,%ecx,1)
479: 83 c1 01 add $0x1,%ecx
while(--i >= 0)
47c: 8d 79 ff lea -0x1(%ecx),%edi
47f: 90 nop
480: 0f b6 04 3b movzbl (%ebx,%edi,1),%eax
484: 83 ef 01 sub $0x1,%edi
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
487: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
48e: 00
48f: 89 34 24 mov %esi,(%esp)
buf[i++] = digits[x % base];
}while((x /= base) != 0);
if(neg)
buf[i++] = '-';
while(--i >= 0)
492: 88 45 e7 mov %al,-0x19(%ebp)
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
495: 8d 45 e7 lea -0x19(%ebp),%eax
498: 89 44 24 04 mov %eax,0x4(%esp)
49c: e8 07 ff ff ff call 3a8 <write>
buf[i++] = digits[x % base];
}while((x /= base) != 0);
if(neg)
buf[i++] = '-';
while(--i >= 0)
4a1: 83 ff ff cmp $0xffffffff,%edi
4a4: 75 da jne 480 <printint+0x50>
putc(fd, buf[i]);
}
4a6: 83 c4 4c add $0x4c,%esp
4a9: 5b pop %ebx
4aa: 5e pop %esi
4ab: 5f pop %edi
4ac: 5d pop %ebp
4ad: c3 ret
4ae: 66 90 xchg %ax,%ax
uint x;
neg = 0;
if(sgn && xx < 0){
neg = 1;
x = -xx;
4b0: 89 d0 mov %edx,%eax
4b2: f7 d8 neg %eax
4b4: c7 45 c4 01 00 00 00 movl $0x1,-0x3c(%ebp)
4bb: eb 94 jmp 451 <printint+0x21>
4bd: 8d 76 00 lea 0x0(%esi),%esi
000004c0 <printf>:
}
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
4c0: 55 push %ebp
4c1: 89 e5 mov %esp,%ebp
4c3: 57 push %edi
4c4: 56 push %esi
4c5: 53 push %ebx
4c6: 83 ec 3c sub $0x3c,%esp
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
4c9: 8b 45 0c mov 0xc(%ebp),%eax
4cc: 0f b6 10 movzbl (%eax),%edx
4cf: 84 d2 test %dl,%dl
4d1: 0f 84 c1 00 00 00 je 598 <printf+0xd8>
char *s;
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
4d7: 8d 4d 10 lea 0x10(%ebp),%ecx
4da: 31 ff xor %edi,%edi
4dc: 89 4d d4 mov %ecx,-0x2c(%ebp)
4df: 31 db xor %ebx,%ebx
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
4e1: 8d 75 e7 lea -0x19(%ebp),%esi
4e4: eb 1e jmp 504 <printf+0x44>
4e6: 66 90 xchg %ax,%ax
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
4e8: 83 fa 25 cmp $0x25,%edx
4eb: 0f 85 af 00 00 00 jne 5a0 <printf+0xe0>
4f1: 66 bf 25 00 mov $0x25,%di
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
4f5: 83 c3 01 add $0x1,%ebx
4f8: 0f b6 14 18 movzbl (%eax,%ebx,1),%edx
4fc: 84 d2 test %dl,%dl
4fe: 0f 84 94 00 00 00 je 598 <printf+0xd8>
c = fmt[i] & 0xff;
if(state == 0){
504: 85 ff test %edi,%edi
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
c = fmt[i] & 0xff;
506: 0f b6 d2 movzbl %dl,%edx
if(state == 0){
509: 74 dd je 4e8 <printf+0x28>
if(c == '%'){
state = '%';
} else {
putc(fd, c);
}
} else if(state == '%'){
50b: 83 ff 25 cmp $0x25,%edi
50e: 75 e5 jne 4f5 <printf+0x35>
if(c == 'd'){
510: 83 fa 64 cmp $0x64,%edx
513: 0f 84 3f 01 00 00 je 658 <printf+0x198>
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
519: 83 fa 70 cmp $0x70,%edx
51c: 0f 84 a6 00 00 00 je 5c8 <printf+0x108>
522: 83 fa 78 cmp $0x78,%edx
525: 0f 84 9d 00 00 00 je 5c8 <printf+0x108>
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
52b: 83 fa 73 cmp $0x73,%edx
52e: 66 90 xchg %ax,%ax
530: 0f 84 ba 00 00 00 je 5f0 <printf+0x130>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
536: 83 fa 63 cmp $0x63,%edx
539: 0f 84 41 01 00 00 je 680 <printf+0x1c0>
putc(fd, *ap);
ap++;
} else if(c == '%'){
53f: 83 fa 25 cmp $0x25,%edx
542: 0f 84 00 01 00 00 je 648 <printf+0x188>
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
548: 8b 4d 08 mov 0x8(%ebp),%ecx
54b: 89 55 cc mov %edx,-0x34(%ebp)
54e: c6 45 e7 25 movb $0x25,-0x19(%ebp)
552: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
559: 00
55a: 89 74 24 04 mov %esi,0x4(%esp)
55e: 89 0c 24 mov %ecx,(%esp)
561: e8 42 fe ff ff call 3a8 <write>
566: 8b 55 cc mov -0x34(%ebp),%edx
569: 88 55 e7 mov %dl,-0x19(%ebp)
56c: 8b 45 08 mov 0x8(%ebp),%eax
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
56f: 83 c3 01 add $0x1,%ebx
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
572: 31 ff xor %edi,%edi
574: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
57b: 00
57c: 89 74 24 04 mov %esi,0x4(%esp)
580: 89 04 24 mov %eax,(%esp)
583: e8 20 fe ff ff call 3a8 <write>
588: 8b 45 0c mov 0xc(%ebp),%eax
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
58b: 0f b6 14 18 movzbl (%eax,%ebx,1),%edx
58f: 84 d2 test %dl,%dl
591: 0f 85 6d ff ff ff jne 504 <printf+0x44>
597: 90 nop
putc(fd, c);
}
state = 0;
}
}
}
598: 83 c4 3c add $0x3c,%esp
59b: 5b pop %ebx
59c: 5e pop %esi
59d: 5f pop %edi
59e: 5d pop %ebp
59f: c3 ret
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
5a0: 8b 45 08 mov 0x8(%ebp),%eax
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
5a3: 88 55 e7 mov %dl,-0x19(%ebp)
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
5a6: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
5ad: 00
5ae: 89 74 24 04 mov %esi,0x4(%esp)
5b2: 89 04 24 mov %eax,(%esp)
5b5: e8 ee fd ff ff call 3a8 <write>
5ba: 8b 45 0c mov 0xc(%ebp),%eax
5bd: e9 33 ff ff ff jmp 4f5 <printf+0x35>
5c2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
} else if(state == '%'){
if(c == 'd'){
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
printint(fd, *ap, 16, 0);
5c8: 8b 45 d4 mov -0x2c(%ebp),%eax
5cb: b9 10 00 00 00 mov $0x10,%ecx
ap++;
5d0: 31 ff xor %edi,%edi
} else if(state == '%'){
if(c == 'd'){
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
printint(fd, *ap, 16, 0);
5d2: c7 04 24 00 00 00 00 movl $0x0,(%esp)
5d9: 8b 10 mov (%eax),%edx
5db: 8b 45 08 mov 0x8(%ebp),%eax
5de: e8 4d fe ff ff call 430 <printint>
5e3: 8b 45 0c mov 0xc(%ebp),%eax
ap++;
5e6: 83 45 d4 04 addl $0x4,-0x2c(%ebp)
5ea: e9 06 ff ff ff jmp 4f5 <printf+0x35>
5ef: 90 nop
} else if(c == 's'){
s = (char*)*ap;
5f0: 8b 55 d4 mov -0x2c(%ebp),%edx
ap++;
if(s == 0)
5f3: b9 49 08 00 00 mov $0x849,%ecx
ap++;
} else if(c == 'x' || c == 'p'){
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
s = (char*)*ap;
5f8: 8b 3a mov (%edx),%edi
ap++;
5fa: 83 c2 04 add $0x4,%edx
5fd: 89 55 d4 mov %edx,-0x2c(%ebp)
if(s == 0)
600: 85 ff test %edi,%edi
602: 0f 44 f9 cmove %ecx,%edi
s = "(null)";
while(*s != 0){
605: 0f b6 17 movzbl (%edi),%edx
608: 84 d2 test %dl,%dl
60a: 74 33 je 63f <printf+0x17f>
60c: 89 5d d0 mov %ebx,-0x30(%ebp)
60f: 8b 5d 08 mov 0x8(%ebp),%ebx
612: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
putc(fd, *s);
s++;
618: 83 c7 01 add $0x1,%edi
} else if(c == 's'){
s = (char*)*ap;
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
61b: 88 55 e7 mov %dl,-0x19(%ebp)
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
61e: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
625: 00
626: 89 74 24 04 mov %esi,0x4(%esp)
62a: 89 1c 24 mov %ebx,(%esp)
62d: e8 76 fd ff ff call 3a8 <write>
} else if(c == 's'){
s = (char*)*ap;
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
632: 0f b6 17 movzbl (%edi),%edx
635: 84 d2 test %dl,%dl
637: 75 df jne 618 <printf+0x158>
639: 8b 5d d0 mov -0x30(%ebp),%ebx
63c: 8b 45 0c mov 0xc(%ebp),%eax
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
63f: 31 ff xor %edi,%edi
641: e9 af fe ff ff jmp 4f5 <printf+0x35>
646: 66 90 xchg %ax,%ax
s++;
}
} else if(c == 'c'){
putc(fd, *ap);
ap++;
} else if(c == '%'){
648: c6 45 e7 25 movb $0x25,-0x19(%ebp)
64c: e9 1b ff ff ff jmp 56c <printf+0xac>
651: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
} else {
putc(fd, c);
}
} else if(state == '%'){
if(c == 'd'){
printint(fd, *ap, 10, 1);
658: 8b 45 d4 mov -0x2c(%ebp),%eax
65b: b9 0a 00 00 00 mov $0xa,%ecx
ap++;
660: 66 31 ff xor %di,%di
} else {
putc(fd, c);
}
} else if(state == '%'){
if(c == 'd'){
printint(fd, *ap, 10, 1);
663: c7 04 24 01 00 00 00 movl $0x1,(%esp)
66a: 8b 10 mov (%eax),%edx
66c: 8b 45 08 mov 0x8(%ebp),%eax
66f: e8 bc fd ff ff call 430 <printint>
674: 8b 45 0c mov 0xc(%ebp),%eax
ap++;
677: 83 45 d4 04 addl $0x4,-0x2c(%ebp)
67b: e9 75 fe ff ff jmp 4f5 <printf+0x35>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
680: 8b 55 d4 mov -0x2c(%ebp),%edx
putc(fd, *ap);
ap++;
683: 31 ff xor %edi,%edi
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
685: 8b 4d 08 mov 0x8(%ebp),%ecx
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
688: 8b 02 mov (%edx),%eax
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
68a: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
691: 00
692: 89 74 24 04 mov %esi,0x4(%esp)
696: 89 0c 24 mov %ecx,(%esp)
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
699: 88 45 e7 mov %al,-0x19(%ebp)
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
69c: e8 07 fd ff ff call 3a8 <write>
6a1: 8b 45 0c mov 0xc(%ebp),%eax
putc(fd, *s);
s++;
}
} else if(c == 'c'){
putc(fd, *ap);
ap++;
6a4: 83 45 d4 04 addl $0x4,-0x2c(%ebp)
6a8: e9 48 fe ff ff jmp 4f5 <printf+0x35>
6ad: 90 nop
6ae: 90 nop
6af: 90 nop
000006b0 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
6b0: 55 push %ebp
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
6b1: a1 6c 08 00 00 mov 0x86c,%eax
static Header base;
static Header *freep;
void
free(void *ap)
{
6b6: 89 e5 mov %esp,%ebp
6b8: 57 push %edi
6b9: 56 push %esi
6ba: 53 push %ebx
6bb: 8b 5d 08 mov 0x8(%ebp),%ebx
Header *bp, *p;
bp = (Header*)ap - 1;
6be: 8d 4b f8 lea -0x8(%ebx),%ecx
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
6c1: 39 c8 cmp %ecx,%eax
6c3: 73 1d jae 6e2 <free+0x32>
6c5: 8d 76 00 lea 0x0(%esi),%esi
6c8: 8b 10 mov (%eax),%edx
6ca: 39 d1 cmp %edx,%ecx
6cc: 72 1a jb 6e8 <free+0x38>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
6ce: 39 d0 cmp %edx,%eax
6d0: 72 08 jb 6da <free+0x2a>
6d2: 39 c8 cmp %ecx,%eax
6d4: 72 12 jb 6e8 <free+0x38>
6d6: 39 d1 cmp %edx,%ecx
6d8: 72 0e jb 6e8 <free+0x38>
6da: 89 d0 mov %edx,%eax
free(void *ap)
{
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
6dc: 39 c8 cmp %ecx,%eax
6de: 66 90 xchg %ax,%ax
6e0: 72 e6 jb 6c8 <free+0x18>
6e2: 8b 10 mov (%eax),%edx
6e4: eb e8 jmp 6ce <free+0x1e>
6e6: 66 90 xchg %ax,%ax
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
6e8: 8b 71 04 mov 0x4(%ecx),%esi
6eb: 8d 3c f1 lea (%ecx,%esi,8),%edi
6ee: 39 d7 cmp %edx,%edi
6f0: 74 19 je 70b <free+0x5b>
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
6f2: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
6f5: 8b 50 04 mov 0x4(%eax),%edx
6f8: 8d 34 d0 lea (%eax,%edx,8),%esi
6fb: 39 ce cmp %ecx,%esi
6fd: 74 23 je 722 <free+0x72>
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
6ff: 89 08 mov %ecx,(%eax)
freep = p;
701: a3 6c 08 00 00 mov %eax,0x86c
}
706: 5b pop %ebx
707: 5e pop %esi
708: 5f pop %edi
709: 5d pop %ebp
70a: c3 ret
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
bp->s.size += p->s.ptr->s.size;
70b: 03 72 04 add 0x4(%edx),%esi
70e: 89 71 04 mov %esi,0x4(%ecx)
bp->s.ptr = p->s.ptr->s.ptr;
711: 8b 10 mov (%eax),%edx
713: 8b 12 mov (%edx),%edx
715: 89 53 f8 mov %edx,-0x8(%ebx)
} else
bp->s.ptr = p->s.ptr;
if(p + p->s.size == bp){
718: 8b 50 04 mov 0x4(%eax),%edx
71b: 8d 34 d0 lea (%eax,%edx,8),%esi
71e: 39 ce cmp %ecx,%esi
720: 75 dd jne 6ff <free+0x4f>
p->s.size += bp->s.size;
722: 03 51 04 add 0x4(%ecx),%edx
725: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
728: 8b 53 f8 mov -0x8(%ebx),%edx
72b: 89 10 mov %edx,(%eax)
} else
p->s.ptr = bp;
freep = p;
72d: a3 6c 08 00 00 mov %eax,0x86c
}
732: 5b pop %ebx
733: 5e pop %esi
734: 5f pop %edi
735: 5d pop %ebp
736: c3 ret
737: 89 f6 mov %esi,%esi
739: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000740 <malloc>:
return freep;
}
void*
malloc(uint nbytes)
{
740: 55 push %ebp
741: 89 e5 mov %esp,%ebp
743: 57 push %edi
744: 56 push %esi
745: 53 push %ebx
746: 83 ec 2c sub $0x2c,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
749: 8b 5d 08 mov 0x8(%ebp),%ebx
if((prevp = freep) == 0){
74c: 8b 0d 6c 08 00 00 mov 0x86c,%ecx
malloc(uint nbytes)
{
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
752: 83 c3 07 add $0x7,%ebx
755: c1 eb 03 shr $0x3,%ebx
758: 83 c3 01 add $0x1,%ebx
if((prevp = freep) == 0){
75b: 85 c9 test %ecx,%ecx
75d: 0f 84 9b 00 00 00 je 7fe <malloc+0xbe>
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
763: 8b 01 mov (%ecx),%eax
if(p->s.size >= nunits){
765: 8b 50 04 mov 0x4(%eax),%edx
768: 39 d3 cmp %edx,%ebx
76a: 76 27 jbe 793 <malloc+0x53>
p->s.size -= nunits;
p += p->s.size;
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
76c: 8d 3c dd 00 00 00 00 lea 0x0(,%ebx,8),%edi
morecore(uint nu)
{
char *p;
Header *hp;
if(nu < 4096)
773: be 00 80 00 00 mov $0x8000,%esi
778: 89 7d e4 mov %edi,-0x1c(%ebp)
77b: 90 nop
77c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
780: 3b 05 6c 08 00 00 cmp 0x86c,%eax
786: 74 30 je 7b8 <malloc+0x78>
788: 89 c1 mov %eax,%ecx
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){
78a: 8b 01 mov (%ecx),%eax
if(p->s.size >= nunits){
78c: 8b 50 04 mov 0x4(%eax),%edx
78f: 39 d3 cmp %edx,%ebx
791: 77 ed ja 780 <malloc+0x40>
if(p->s.size == nunits)
793: 39 d3 cmp %edx,%ebx
795: 74 61 je 7f8 <malloc+0xb8>
prevp->s.ptr = p->s.ptr;
else {
p->s.size -= nunits;
797: 29 da sub %ebx,%edx
799: 89 50 04 mov %edx,0x4(%eax)
p += p->s.size;
79c: 8d 04 d0 lea (%eax,%edx,8),%eax
p->s.size = nunits;
79f: 89 58 04 mov %ebx,0x4(%eax)
}
freep = prevp;
7a2: 89 0d 6c 08 00 00 mov %ecx,0x86c
return (void*)(p + 1);
7a8: 83 c0 08 add $0x8,%eax
}
if(p == freep)
if((p = morecore(nunits)) == 0)
return 0;
}
}
7ab: 83 c4 2c add $0x2c,%esp
7ae: 5b pop %ebx
7af: 5e pop %esi
7b0: 5f pop %edi
7b1: 5d pop %ebp
7b2: c3 ret
7b3: 90 nop
7b4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
morecore(uint nu)
{
char *p;
Header *hp;
if(nu < 4096)
7b8: 8b 45 e4 mov -0x1c(%ebp),%eax
7bb: 81 fb 00 10 00 00 cmp $0x1000,%ebx
7c1: bf 00 10 00 00 mov $0x1000,%edi
7c6: 0f 43 fb cmovae %ebx,%edi
7c9: 0f 42 c6 cmovb %esi,%eax
nu = 4096;
p = sbrk(nu * sizeof(Header));
7cc: 89 04 24 mov %eax,(%esp)
7cf: e8 3c fc ff ff call 410 <sbrk>
if(p == (char*)-1)
7d4: 83 f8 ff cmp $0xffffffff,%eax
7d7: 74 18 je 7f1 <malloc+0xb1>
return 0;
hp = (Header*)p;
hp->s.size = nu;
7d9: 89 78 04 mov %edi,0x4(%eax)
free((void*)(hp + 1));
7dc: 83 c0 08 add $0x8,%eax
7df: 89 04 24 mov %eax,(%esp)
7e2: e8 c9 fe ff ff call 6b0 <free>
return freep;
7e7: 8b 0d 6c 08 00 00 mov 0x86c,%ecx
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
if((p = morecore(nunits)) == 0)
7ed: 85 c9 test %ecx,%ecx
7ef: 75 99 jne 78a <malloc+0x4a>
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){
if(p->s.size >= nunits){
7f1: 31 c0 xor %eax,%eax
7f3: eb b6 jmp 7ab <malloc+0x6b>
7f5: 8d 76 00 lea 0x0(%esi),%esi
if(p->s.size == nunits)
prevp->s.ptr = p->s.ptr;
7f8: 8b 10 mov (%eax),%edx
7fa: 89 11 mov %edx,(%ecx)
7fc: eb a4 jmp 7a2 <malloc+0x62>
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
if((prevp = freep) == 0){
base.s.ptr = freep = prevp = &base;
7fe: c7 05 6c 08 00 00 64 movl $0x864,0x86c
805: 08 00 00
base.s.size = 0;
808: b9 64 08 00 00 mov $0x864,%ecx
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
if((prevp = freep) == 0){
base.s.ptr = freep = prevp = &base;
80d: c7 05 64 08 00 00 64 movl $0x864,0x864
814: 08 00 00
base.s.size = 0;
817: c7 05 68 08 00 00 00 movl $0x0,0x868
81e: 00 00 00
821: e9 3d ff ff ff jmp 763 <malloc+0x23>
| 29.102564 | 60 | 0.421628 |
7291e0567ecad2cf3b99b8d44923984f1f12fb61 | 3,854 | asm | Assembly | Projects/PJZ2/Template/SectionData_PublicData.asm | jonathanbennett73/amiga-pjz-planet-disco-balls | 1890f797ec7e8061ce4bfb9a8e6844f2ce9f6e1b | [
"MIT"
] | 21 | 2021-04-04T06:00:44.000Z | 2022-01-19T19:12:24.000Z | Projects/PJZ2/Template/SectionData_PublicData.asm | jonathanbennett73/amiga-pjz-planet-disco-balls | 1890f797ec7e8061ce4bfb9a8e6844f2ce9f6e1b | [
"MIT"
] | null | null | null | Projects/PJZ2/Template/SectionData_PublicData.asm | jonathanbennett73/amiga-pjz-planet-disco-balls | 1890f797ec7e8061ce4bfb9a8e6844f2ce9f6e1b | [
"MIT"
] | null | null | null | *****************************************************************************
* Included at the end of the code section (for (pc) data)
*****************************************************************************
rsreset
CTRL_SINE_OFFSET rs.w 1
CTRL_SINE_SPEED rs.w 1
CTRL_SINE_FREQ rs.w 1
CTRL_SINE_SPEEDNEW rs.w 1
CTRL_SINE_FREQNEW rs.w 1
CTRL_SINESET_ACTIVE rs.w 1 ;>0 if sine values are being changed over time
CTRL_SINESET_COUNTER rs.w 1 ;Change counter speed
CTRL_SINE_SIZEOF rs.w 0
rsreset
CTRL_SCRIPT_PTR rs.l 1 ;Script Ptr
CTRL_FINISHED rs.w 1 ;1 if quitting
CTRL_PRECALC_INTROSTART_DONE rs.w 1 ;1 if intro precalc done
CTRL_PHASE rs.w 1 ;Current phase
CTRL_FRAME_COUNT rs.w 1 ;Local (effect) frame counter
CTRL_PAUSE_COUNTER rs.w 1 ;Pause counter, 0=running
CTRL_ISFRAMEOVER_COUNTER rs.w 1 ;Waiting for frame, 0=inactive
CTRL_ISMASTERFRAMEOVER_COUNTER rs.w 1 ;Waiting for frame, 0=inactive
CTRL_MUSICSYNC rs.w 1 ;Value returned from music E8x (may be further processed)
CTRL_MUSICSYNCMASK rs.w 1 ;The music sync value will be anded with this mask to allow script to "hide" events
CTRL_MUSICSYNCMASKWAIT rs.w 1 ;A music mask to wait for before continuing, if 00 then no wait
CTRL_MUSICSYNC_LASTFRAME rs.w 1 ;The CTRL_FRAME_COUNT value of the last music trigger
CTRL_P0_PRECALC_DONE rs.w 1 ;1 if effect precalc done
CTRL_PALETTE_LOAD_FLAG rs.w 1 ;set to >1 to force palette load
CTRL_PALETTE_ACTIVE rs.w 1 ;Palette change active
CTRL_PALETTE_PTR rs.l 1 ;src Palette ptr (16 words of colors)
CTRL_PALETTE_COUNTER rs.w 1 ;Palette counter, speed
CTRL_PALETTE_SPEED rs.w 1 ;How often to update, higher is slower, 0 = instant
CTRL_PALETTE_STEP rs.w 1 ;Current step to interpolate between current color and final 0-15
CTRL_BPL_PHYS_PTR rs.l 1 ;bpl and cl ptrs must stay in order as accessed as group.
CTRL_BPL_LOG1_PTR rs.l 1 ;Logical1
CTRL_CL_PHYS_PTR rs.l 1 ;Copper ptr - physical
CTRL_CL_LOG1_PTR rs.l 1 ;Logical1
CTRL_USERVALWAIT_ACTIVE rs.w 1 ;0=inactive
CTRL_USERVALWAIT_OFFSET rs.w 1 ;Offset into CTRL_xxx for value to check
CTRL_USERVALWAIT_VAL rs.w 1 ;The value to wait for
CTRL_USERVAL1 rs.w 1 ;Example general purpose value
CTRL_SINE1 rs.b CTRL_SINE_SIZEOF
CTRL_SINE2 rs.b CTRL_SINE_SIZEOF
CTRL_ZERODATA_SIZE rs.w 0 ;size of all zeroed data - START OF NONZERO
CTRL_SIZE rs.w 0
even
Controller_Info:
dcb.b CTRL_ZERODATA_SIZE,0 ;Init all to zero by default
even
*****************************************************************************
; Master palette poked into the copperlist each frame
PAL_Current: dcb.w PAL_NUMCOLS_MAIN,0 ;main colours
dcb.w PAL_NUMCOLS_ALT,0 ;dark/reflection colours
; This holds the old source palette used during transitions in FX_PALETTE. The
; source value is interpolated from this value to the destination value + step size.
PAL_Current_Src: dcb.w PAL_NUMCOLS_MAIN,0 ;main colours
dcb.w PAL_NUMCOLS_ALT,0 ;dark/reflection colours
*****************************************************************************
*****************************************************************************
; Include the intro script
include "Script.asm"
*****************************************************************************
*****************************************************************************
*****************************************************************************
section FW_PublicBss,bss
*****************************************************************************
;CUR_PUB_BUF set FW_Public_Buffer_1
; Screen height mult by screen bytewidth and number of bitplanes (interleaved)
Mult_SCR_Height_ByteWidth_NumPlanes:
ds.w BPL_BUF_HEIGHT
;Mult_SCR_Height_ByteWidth_NumPlanes equ CUR_PUB_BUF
;CUR_PUB_BUF set CUR_PUB_BUF+(BPL_BUF_HEIGHT*2)
*****************************************************************************
| 39.731959 | 110 | 0.633368 |
d04ef214966efa8310d5475c6f4eee17d45ed9f8 | 396 | asm | Assembly | oeis/052/A052687.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/052/A052687.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/052/A052687.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A052687: E.g.f. (1+x-x^3)/((1-x)(1-x^2)).
; 1,2,6,18,96,480,3600,25200,241920,2177280,25401600,279417600,3832012800,49816166400,784604620800,11769069312000,209227898880000,3556874280960000,70426110763008000,1338096104497152000
mov $2,$0
lpb $0
div $0,2
mov $1,$0
mov $0,$2
add $1,1
add $3,1
div $0,$3
lpb $0
mul $1,$0
sub $0,$3
add $1,$0
lpe
lpe
mov $0,$1
add $0,1
| 19.8 | 184 | 0.646465 |
7f445aeaef24aca8c09fb63c195d263349f8bbc3 | 6,341 | asm | Assembly | iod/con2/ql/shad.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | iod/con2/ql/shad.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | iod/con2/ql/shad.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | ; Routine to put a shadow "behind" a window.
;
; This is an improved version of the previous routine,
; in that it allows the user to specify x and y shadow
; displacements: it does not yet alter the displacment depending
; on the "height" above the windows behind.
;
section driver
;
include 'dev8_keys_con'
include 'dev8_keys_qdos_sms'
;
xdef pt_shad
;
; This is the main entry point: it determines the required size
; and position of the shadow blocks from the parameters
; passed and the window size, and calls the shading routine
; to put them up.
;
; Registers:
; Entry Exit
; D1 shadow offset (x,y) smashed
; A0 base of cdb preserved
; A1 smashed
;
reglist reg d1-d7
;
pt_shad
movem.l reglist,-(sp)
;
; Top/bottom shadow
;
shade
movem.l sd_xhits(a0),d4/d5/d6/d7 ; get parameters
bsr.s shad_area ; and shadow size / position
bsr.s block_sh ; shade that bit
;
; Side shadow - calculations as for top, but swapping x and y.
;
swap d4
swap d5
swap d6
swap d7
bsr.s shad_area
swap d2
swap d3
bsr.s block_sh
moveq #0,d0 ; no error
movem.l (sp)+,reglist
rts
page
;
; This routine calculates a shadow block size and origin
;
; d2 r shadow sizes
; d3 r shadow origin
; d4 c hit size
; d5 c hit origin
; d6 c outline size
; d7 c outline origin
;
; comments refer to top / bottom shadow
;
shad_area
move.l d4,d2 set x,y sizes
sub.w d6,d2 ... y is difference
neg.w d2 ... positive!!
;
move.l d7,d3 assume left
swap d3
move.l d5,d0
swap d0
cmp.w d3,d0 is it left?
bne.s shad_side ... yes
move.l d6,d0 ... no, add outline width
sub.l d4,d0 ... less hit width
swap d0
add.w d0,d3
shad_side
swap d3
;
move.w d7,d3 assume top
cmp.w d5,d7 is it at top or bottom?
bne.s shad_sdone ... top
add.w d4,d3 ... bottom
shad_sdone
rts
;
page
;
; This routine puts up a block of shading of specified size
; at a given position. If the shading would overlap the screen
; edges then it is clipped to fall within the screen.
;
; Registers:
; Entry Exit
; D2 shadow size
; D3 shadow origin
; A0 base of cdb
;
block_sh
movem.l d5/a0-a2/a4/a5,-(sp)
move.l d3,-(a7) ; copy parameters
move.l d2,-(a7) ; to make a smashable copy
;
prm.xs equ $00 ; xsize
prm.ys equ $02 ; ysize
prm.x equ $04 ; xorg
prm.y equ $06 ; yorg
;
move.l a7,a1 ; set pointer
;
moveq #-1,d1 ; read...
move.b d1,d2
moveq #sms.dmod,d0 ; ...the display mode
trap #1
lea pat4_tab(pc),a5 ; assume mode 4
tst.b d1 ; is it?
beq.s mode_ok ; yes, ok then
lea pat8_tab(pc),a5 ; no, use mode 8 pattern
mode_ok
;
sub.w #12,a7 ; make a bit more working space
move.w prm.y(a1),d0 ; the y position...
mulu pt_bytel(a3),d0 ; ...becomes the offset...
move.l sd_scrb(a0),a2 ; ...with the screen base...
add.l d0,a2 ; ...gives the line address
;
prm.xl equ -2
prm.xls equ -4
prm.xm equ -6
prm.xms equ -8
prm.xr equ -10
prm.xrs equ -12
;
move.w prm.x(a1),d0 ; the x position...
and.w #6,d0 ; ...becomes the number...
sub.w #8,d0 ; ...of pixels...
neg.w d0 ; ...at the left hand edge
move.w d0,prm.xls(a1)
;
move.w prm.x(a1),d0 ; it also becomes...
lsr.w #2,d0 ; ...the address offset...
and.w #$fffe,d0 ; ...of the left hand edge
move.w d0,prm.xl(a1)
;
addq.w #2,d0 ; the middle starts 2 bytes...
move.w d0,prm.xm(a1) ; ...higher in memory
;
move.w prm.x(a1),d0 ; the...
add.w prm.xs(a1),d0 ; ...right hand edge...
move.w d0,d1
and.w #6,d0 ; ...becomes the number...
move.w d0,prm.xrs(a1) ; ...of pixels at the right
;
lsr.w #2,d1 ; and the address offset...
and.w #$fffe,d1 ; ...of the right hand edge
move.w d1,prm.xr(a1)
;
move.w prm.xs(a1),d0 ; the width of the middle...
sub.w prm.xls(a1),d0 ; ...is what's not at the left...
sub.w prm.xrs(a1),d0 ; ...or the right...
move.w d0,prm.xms(a1)
;
ble.s no_mid ; there is no middle
move.w prm.xm(a1),a4
lea 0(a2,a4.w),a4 ; start of middle
move.w prm.ys(a1),d3 ; number of lines to fill
moveq #0,d5 ; fill everything
lsr.w #3,d0 ; this many columns to fill
bra.s end_mid
st_mid
bsr.s fil_col
addq.w #2,a4
end_mid
dbra d0,st_mid
no_mid
;
; If there was a middle it's now shaded, so we can fill in
; the left and right edges.
;
moveq #8,d0 ; get pixel mask number...
sub.w prm.xls(a1),d0 ; ...on left hand side
lea mask_tab(pc),a4 ; turn it into...
move.w 0(a4,d0.w),d5 ; ...a mask
not.w d5
move.w prm.xl(a1),d0 ; get x left offset
cmp.w prm.xr(a1),d0 ; same as right?
beq.s fil_rt ; yes, only one column to do
lea 0(a2,d0.w),a4 ; it's here
move.w prm.ys(a1),d3 ; this many lines
bsr.s fil_col ; do it
moveq #0,d5 ; use full right mask
fil_rt
move.w prm.xrs(a1),d0 ; pixel mask number for rhs
lea mask_tab(pc),a4
or.w 0(a4,d0.w),d5 ; modify mask
cmp.w #$ffff,d5 ; no pixels allowed?
beq.s no_rt ; no, don't bother shading then
move.w prm.xr(a1),a4 ; right column is put in...
add.l a2,a4 ; ...here
move.w prm.ys(a1),d3 ; this many lines
bsr.s fil_col
no_rt
;
; Now we've finished, just tidy up and exit
;
exit
move.l a1,a7 ; remove temporary storage
addq.l #8,a7 ; and parameter copies
movem.l (sp)+,d5/a0-a2/a4/a5 ; pop smashed registers
rts
;
; This subroutine fills in one column of shading. It assumes
; that successive rows of the same column are 128 bytes apart.
; The shade mask has a clear bit wherever shading is permitted.
;
; Registers:
; Entry Exit
; D3 no. of lines to fill preserved
; D5 shade mask preserved
; A4 column to fill preserved
; A5 pattern to use preserved
;
fil_col
movem.l d0/d1/d3/a4/a5,-(sp)
move.l a4,d0 ; start address...
and.l #$40000,d0 ; in 256k space!!!!!!!!!!!!!!!!!
divu #6,d0 ; ...MOD 6 is the first...
swap d0 ; ...shade pattern number
bra.s end_fil
st_fil
move.w 0(a5,d0.w),d1 ; get a pattern
or.w d5,d1 ; mask unused bits
and.w d1,(a4) ; stuff it into the screen
add.w pt_bytel(a3),a4 ; next screen address
addq.w #2,d0 ; next pattern
cmp.w #6,d0 ; off end?
blt.s end_fil ; no
moveq #0,d0 ; restart pattern
end_fil
dbra d3,st_fil
movem.l (sp)+,d0/d1/d3/a4/a5
rts
;
pat4_tab
dc.w %1101101111011011
dc.w %0110110101101101
dc.w %1011011010110110
;
pat8_tab
dc.w %0111110100111100
dc.w %1111011111110011
dc.w %1101111111001111
;
mask_tab
dc.w %1111111111111111
dc.w %0011111100111111
dc.w %0000111100001111
dc.w %0000001100000011
;
end
| 24.110266 | 64 | 0.660148 |
0fe00f428e049646fc59382e061ac5d79bfab804 | 400 | asm | Assembly | oeis/028/A028901.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/028/A028901.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/028/A028901.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A028901: Map n = Sum c_i 10^i to a(n) = Sum c_i 6^i.
; Submitted by Simon Strandgaard
; 0,1,2,3,4,5,6,7,8,9,6,7,8,9,10,11,12,13,14,15,12,13,14,15,16,17,18,19,20,21,18,19,20,21,22,23,24,25,26,27,24,25,26,27,28,29,30,31,32,33,30,31,32,33,34,35,36,37,38,39,36,37,38,39,40,41,42,43,44,45,42,43,44,45
mov $3,1
lpb $0
mov $2,$0
mod $2,10
mul $2,$3
add $1,$2
mul $3,6
div $0,10
lpe
mov $0,$1
| 26.666667 | 209 | 0.605 |
759e24ff8611a425fc0fe5fc7fab905a96a6851e | 276 | asm | Assembly | libsrc/_DEVELOPMENT/sound/bit/c/sdcc_iy/bit_beep_raw_di_callee.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/sound/bit/c/sdcc_iy/bit_beep_raw_di_callee.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/sound/bit/c/sdcc_iy/bit_beep_raw_di_callee.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
; void bit_beep_raw_di_callee(uint_16t num_cycles, uint16_t tone_period_T)
SECTION code_clib
SECTION code_sound_bit
PUBLIC _bit_beep_raw_di_callee
EXTERN asm_bit_beep_raw_di
_bit_beep_raw_di_callee:
pop af
pop hl
pop de
push af
jp asm_bit_beep_raw_di
| 14.526316 | 74 | 0.800725 |
c272bcf02ea33a8e1ea997b9b7556db36e5d9495 | 19 | asm | Assembly | source/features/basic.asm | alco-debug/browki-mod | 7b741a6d01c44f4768eacd763c327a2c52707148 | [
"BSD-3-Clause"
] | null | null | null | source/features/basic.asm | alco-debug/browki-mod | 7b741a6d01c44f4768eacd763c327a2c52707148 | [
"BSD-3-Clause"
] | null | null | null | source/features/basic.asm | alco-debug/browki-mod | 7b741a6d01c44f4768eacd763c327a2c52707148 | [
"BSD-3-Clause"
] | null | null | null | os_run_basic:
ret | 9.5 | 14 | 0.789474 |
56604dcd3117d0b8c42e78371a9642197ab39045 | 3,657 | asm | Assembly | testkb.asm | LoopZ/BIOS-Keys | 1edf84dfe484debcc82419ff630af84902d1d925 | [
"Unlicense"
] | 2 | 2020-06-01T00:33:56.000Z | 2022-01-13T22:59:29.000Z | testkb.asm | LoopZ/BIOS-Keys | 1edf84dfe484debcc82419ff630af84902d1d925 | [
"Unlicense"
] | null | null | null | testkb.asm | LoopZ/BIOS-Keys | 1edf84dfe484debcc82419ff630af84902d1d925 | [
"Unlicense"
] | null | null | null | ; Copyright 2020 Jerome Shidel
; Released to Public Domain
org 0x100
use16
call InitTraps
mov si, Message
call PrintString
BIOSInputLoop:
; Key keboard status
mov ah, 0x01
int 0x16
jnz BIOSInputLoop
; Check if scan code is available
; test ax, ax
; jz BIOSInputLoop
; pull keystroke from buffer
mov ah, 0
int 0x16
cli
push ax
mov si, ScanCode
call PrintString
mov al, ah
call PrintHexAL
pop ax
push ax
mov si, AsciiValue
call PrintString
call PrintHexAL
push es
mov ax, 0x0040
push ax
pop es
mov al, [es:0x0017]
pop es
mov si, ShiftState
call PrintString
call PrintBinAL
mov si, CountInt1B
call PrintString
mov ax, [DataInt1B]
call PrintHexAX
call PrintCRLF
pop ax
sti
cmp al, 27
jne BIOSInputLoop
Terminate:
call DoneTraps
; Terminate with no error
mov ax, 0x4c00
int 0x21
Vector1B:
dw 0,0
DataInt1B:
dw 0
MyInt1B:
cli
push ax
mov ax, [CS:DataInt1B]
inc ax
mov [CS:DataInt1B], ax
pop ax
iret ; automatic sti with iret/popf
InitTraps:
cli
mov [Vector1B], word MyInt1B
mov [Vector1B+2],ds
mov al, 0x1b
mov di, Vector1B
call SwapVectors
sti
ret
DoneTraps:
cli
mov al, 0x1b
mov di, Vector1B
call SwapVectors
sti
ret
SwapVectors:
; AL = Vector
; [di] = pointer
push bx
push dx
push es
push ds
call GetIntVector
mov dx, [di]
mov ds, [di+2]
call SetIntVector
pop ds
mov [di], bx
mov [di+2], es
pop es
pop dx
pop bx
ret
GetIntVector:
; AL = vector
; Returns ES:BX
push ax
mov ah, 0x35
int 0x21 ; returns es:bx
pop ax
ret
SetIntVector:
; AL = vector
; DS:DX = Pointer
push ax
mov ah, 0x25
int 0x21
pop ax
ret
PrintHexAX:
push ax
push ax
mov al, ah
call PrintHexAL
pop ax
call PrintHexAL
pop ax
ret
PrintHexAL:
push cx
push ax
and al, 0xf0
mov cl, 0x04
shr al, cl
call MapToHex
call PrintAL
pop ax
push ax
and al, 0x0f
call MapToHex
call PrintAL
pop ax
pop cx
ret
PrintBinAL:
push ax
push cx
mov cx, 8
mov ah, al
.Repeat:
test ah, 10000000b
jz .Zero
mov al, '1'
jmp .Display
.Zero:
mov al, '0'
.Display:
shl ah, 1
call PrintAL
loop .Repeat
pop ax
pop cx
ret
MapToHex:
add al, 0x30
cmp al, 0x3a
jb .Done
add al, 0x07
.Done:
ret
PrintAL:
push ax
push bx
mov bx, 0x0007
mov ah, 0x0e
int 0x10
pop bx
pop ax
ret
PrintString:
push ax
push bx
.Repeat:
mov al, [si]
cmp al, 0
je .Done
inc si
call PrintAL
jmp .Repeat
.Done:
pop bx
pop ax
ret
PrintCRLF:
push si
mov si, CRLF
call PrintString
pop si
ret
ScanCode:
db 'Scancode: ',0
AsciiValue:
db ', Ascii: ', 0
ShiftState:
db ', Flags: ', 0
CountInt1B:
db ', Count Int1B: ',0
Message:
db 'Press the ESC key to exit'
CRLF:
db 0xd,0xa,0
| 15.2375 | 39 | 0.500957 |
c81c645cd460ea84f85e72ddc840ca4b5cce74b0 | 4,410 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_st_/i9-9900K_12_0xa0_notsx.log_21829_1175.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_st_/i9-9900K_12_0xa0_notsx.log_21829_1175.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_st_/i9-9900K_12_0xa0_notsx.log_21829_1175.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 %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0x81f3, %rsi
lea addresses_WT_ht+0x1d973, %rdi
nop
nop
dec %rdx
mov $109, %rcx
rep movsq
nop
nop
nop
nop
nop
add $12318, %rcx
lea addresses_A_ht+0x3c03, %rsi
lea addresses_UC_ht+0x96ac, %rdi
clflush (%rsi)
nop
nop
and %r11, %r11
mov $15, %rcx
rep movsq
nop
nop
nop
nop
nop
cmp %rcx, %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r14
push %r8
push %r9
push %rax
push %rdx
// Faulty Load
lea addresses_normal+0x11ff3, %r13
nop
nop
nop
nop
sub %rdx, %rdx
mov (%r13), %r8d
lea oracles, %r9
and $0xff, %r8
shlq $12, %r8
mov (%r9,%r8,1), %r8
pop %rdx
pop %rax
pop %r9
pop %r8
pop %r14
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_normal', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_normal', 'AVXalign': False, 'size': 4, 'NT': True, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}}
{'src': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': False}}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
| 53.13253 | 2,999 | 0.665306 |
98ef70b8c18cb7d9ebd280bc414309fa21f08c55 | 477 | asm | Assembly | TRAIN/TRAIN_CHAR/vett.asm | mich2k/CE_LAB | 31a5d5ab8f9465fd884343e4425fe2267cae32e7 | [
"MIT"
] | null | null | null | TRAIN/TRAIN_CHAR/vett.asm | mich2k/CE_LAB | 31a5d5ab8f9465fd884343e4425fe2267cae32e7 | [
"MIT"
] | null | null | null | TRAIN/TRAIN_CHAR/vett.asm | mich2k/CE_LAB | 31a5d5ab8f9465fd884343e4425fe2267cae32e7 | [
"MIT"
] | null | null | null | .586
.model flat
.code
_spazi proc
push ebp
mov ebp,esp
push esi
push edi
push ebx
mov ebx, dword ptr[ebp+8] ; arr
mov edi, 0
mov esi, 0
ciclo:
mov al, byte ptr [ebx+esi]
cmp al, 0
je fine
cmp al, 32
je found
inc esi
jmp ciclo
; bh 4 bit mov bh, 1
; bl 8 bit mov bl, 44
; bx 16 bit
; ebx 32 bit cambiato
found:
mov byte ptr [ebx+esi], ','
;pop eax
inc edi
inc esi
jmp ciclo
fine:
mov eax, edi
pop ebx
pop edi
pop esi
mov esp, ebp
pop ebp
ret
_spazi endp
end | 9.9375 | 31 | 0.666667 |
2cc719e2bae1dfde0bd0bf340e2efadbb42e014c | 804 | asm | Assembly | programs/oeis/213/A213498.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/213/A213498.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/213/A213498.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A213498: Number of (w,x,y) with all terms in {0,...,n} and w != max(|w-x|,|x-y|,|y-w|)
; 0,4,15,43,88,164,267,415,600,844,1135,1499,1920,2428,3003,3679,4432,5300,6255,7339,8520,9844,11275,12863,14568,16444,18447,20635,22960,25484,28155,31039,34080,37348,40783,44459,48312,52420,56715,61279,66040,71084,76335,81883,87648,93724,100027,106655,113520,120724,128175,135979,144040,152468,161163,170239,179592,189340,199375,209819,220560,231724,243195,255103,267328,280004,293007,306475,320280,334564,349195,364319,379800,395788,412143,429019,446272,464060,482235,500959,520080,539764,559855,580523,601608,623284,645387,668095,691240,715004,739215,764059,789360,815308,841723,868799,896352,924580,953295,982699
mov $1,$0
add $0,1
div $0,2
pow $0,2
add $0,$1
mov $2,$1
mul $2,$1
add $0,$2
mul $2,$1
add $0,$2
| 57.428571 | 616 | 0.761194 |
e0dcd85cc3e9d0e19a77248fdb5fbfcc68e4d3ee | 337 | asm | Assembly | programs/oeis/185/A185115.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/185/A185115.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/185/A185115.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A185115: Number of connected 2-regular simple graphs on n vertices with girth at least 5.
; 1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
mov $1,4
bin $1,$0
cmp $1,0
pow $1,$0
| 42.125 | 205 | 0.575668 |
7311816583f20a27c0b758c5735bc27a7898e814 | 1,891 | asm | Assembly | tests/parsing/cpp_literals.asm | cizo2000/sjasmplus | 615d7c0e09a44aa2a923095fc9ed6dca6ecae4a4 | [
"BSD-3-Clause"
] | 220 | 2016-10-22T19:44:39.000Z | 2022-03-29T20:57:04.000Z | tests/parsing/cpp_literals.asm | ped7g/sjasmplus | 487635c8057cd5594c372d9b70bc00a3f3a1ecc4 | [
"BSD-3-Clause"
] | 153 | 2018-05-07T10:31:23.000Z | 2022-03-30T04:35:59.000Z | tests/parsing/cpp_literals.asm | ped7g/sjasmplus | 487635c8057cd5594c372d9b70bc00a3f3a1ecc4 | [
"BSD-3-Clause"
] | 51 | 2016-05-12T21:27:36.000Z | 2022-03-27T15:16:16.000Z | ; new syntax did break legacy sources in specific case like "0b800h"
dw 0b100h, 0xb100
; new syntax to define: 0b..|0B.. = binary number (C++ rule), 0q..|0Q.. = octal number
db %01011101, 01011101b, 01011101B, 0b01011101, 0B01011101
db 111q, 111Q, 111o, 111O, 0q111, 0Q111
; other old syntax, just verifying syntax highlight of editor and functionality
db 65, 65d, 65D
db $42, #42, 0x42, 0X42, 42h, 42H
111:
jr 111B ; temporary labels will steal "binary" highlight up to 3 chars
1001:
jr 1001B ; four+ chars: the binary value highlight wins even for label
; digit-group ticks tests - fully valid ones
db %01'01'11'01, 01'01'11'01b, 01'01'11'01B, 0b01'01'11'01, 0B01'01'11'01
db 1'1'1q, 1'1'1Q, 1'1'1o, 1'1'1O, 0q1'1'1, 0Q1'1'1
dw 1'6'961, 1'6'961d, 1'6'961D
dw $4'4'43, #4'4'43, 0x4'4'43, 0X4'4'43, 4'4'43h, 4'4'43H
; digit-group ticks tests - invalid beginning
db %'01'01'11'01
db '01'01'11'01B,
db 0B'01'01'11'01
db '1'1'1Q
db '1'1'1O
db 0Q'1'1'1
dw '1'6'961
dw '1'6'961D
dw $'4'4'43
dw #'4'4'43
dw 0X'4'4'43
dw '4'4'43H
; digit-group ticks tests - invalid end
db %01'01'11'01'
db 01'01'11'01'B
db 0B01'01'11'01'
db 1'1'1'Q
db 1'1'1'O
db 0Q1'1'1'
dw 1'6'961'
dw 1'6'961'D
dw $4'4'43'
dw #4'4'43'
dw 0X4'4'43'
dw 4'4'43'H
; digit-group ticks tests - two ticks are invalid too
db %0101''1101
db 0101''1101B
db 0B0101''1101
db 11''1Q
db 11''1O
db 0Q11''1
dw 16''961
dw 16''961D
dw $44''43
dw #44''43
dw 0X44''43
dw 44''43H
| 30.5 | 90 | 0.507668 |
063503bfbbe3ab9499eefe3dd8d2bc33dd5c196b | 550 | asm | Assembly | programs/oeis/254/A254460.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/254/A254460.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/254/A254460.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A254460: a(n) is the number of predecessors of the all-ones state of the binary cellular automaton on the n X n grid graph with edges joining diagonal neighbors as well as vertical and horizontal neighbors, whose local rule is f(i,j) = sum of the state at vertex (i,j) and the states at all of its neighbors mod 2.
; 1,8,1,1,512,1,1,32768,1,1,2097152,1,1,134217728,1,1,8589934592,1,1,549755813888,1,1,35184372088832,1,1,2251799813685248,1,1,144115188075855872,1
mov $1,$0
add $0,1
add $1,1
add $1,$0
mod $0,3
pow $0,$1
div $0,14
mul $0,7
add $0,1
| 42.307692 | 316 | 0.736364 |
868978449b5a78631b693720daf6b0af9ac8342b | 234 | asm | Assembly | src/tests/valid_loads_with_miss.asm | microsoft/sca-fuzzer | b9bb7fa7f464672f40d4346fb3279c939aedbb14 | [
"MIT"
] | 2 | 2021-06-15T08:16:18.000Z | 2021-09-13T02:26:30.000Z | src/tests/valid_loads_with_miss.asm | microsoft/sca-fuzzer | b9bb7fa7f464672f40d4346fb3279c939aedbb14 | [
"MIT"
] | null | null | null | src/tests/valid_loads_with_miss.asm | microsoft/sca-fuzzer | b9bb7fa7f464672f40d4346fb3279c939aedbb14 | [
"MIT"
] | 2 | 2021-02-17T14:16:00.000Z | 2021-09-13T12:36:08.000Z | .intel_syntax noprefix
MFENCE
MOV rax, [r14]
MOV rax, [r14 + 4096]
MOV rax, [r14 + 8192]
MOV rax, [r14 + 12288]
MOV rax, [r14 + 16384]
MOV rax, [r14 + 20480]
MOV rax, [r14 + 24576]
MOV rax, [r14 + 28672]
MOV rax, [r14 + 32768]
MFENCE
| 18 | 22 | 0.645299 |
1b8f0f338987e34d11774b56d8242fda4516c4e0 | 777 | asm | Assembly | 8086/8array/larinarr.asm | iamvk1437k/mpmc | 3640b29f29b3ffa78747b13b2ca8ac77c49695eb | [
"MIT"
] | 1 | 2022-01-01T11:27:43.000Z | 2022-01-01T11:27:43.000Z | 8086/8array/larinarr.asm | iamvk1437k/mpmc | 3640b29f29b3ffa78747b13b2ca8ac77c49695eb | [
"MIT"
] | null | null | null | 8086/8array/larinarr.asm | iamvk1437k/mpmc | 3640b29f29b3ffa78747b13b2ca8ac77c49695eb | [
"MIT"
] | null | null | null | ;mov si,1100h
;mov di,1200h
;mov cl,[si]
;inc si
;mov al,[si]
;dec cl
;again:
;inc si
;mov bl,[si]
;cmp al,bl
;ahead:
;dec cl
;jnz again
;mov [di],al
;hlt
org 100h
MOV SI,1100H ;Set SI register as point.
MOV CL,[SI] ;Set CL as count for element.
INC SI ;Increment address point
MOV AL,[SI] ;Get first data
DEC CL ;Decrement count
L2: INC SI ;Increment SI
CMP AL,[SI] ;Compare current smallest and next
JNB L1 ;If carry is not set,AL is largest and go to ahead
MOV AL,[SI] ;MOV BL to AL
L1: DEC CL ;Decrement count register
JNZ L2 ; If ZF=0,repeat comparison
MOV DI,1200H ; Store largest data in memory
MOV [DI],AL ; Initialize DI with1200h
HLT ;Halt the program. | 25.064516 | 67 | 0.608752 |
cc5c8690214e450cc4a4a565333a5678281d5a20 | 504 | asm | Assembly | oeis/293/A293903.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/293/A293903.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/293/A293903.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A293903: Sum of proper divisors of form 4k+3.
; Submitted by Christian Krause
; 0,0,0,0,0,3,0,0,3,0,0,3,0,7,3,0,0,3,0,0,10,11,0,3,0,0,3,7,0,18,0,0,14,0,7,3,0,19,3,0,0,10,0,11,18,23,0,3,7,0,3,0,0,30,11,7,22,0,0,18,0,31,10,0,0,14,0,0,26,42,0,3,0,0,18,19,18,42,0,0,30,0,0,10,0,43,3,11,0,18,7,23,34,47,19,3,0,7,14,0
add $0,1
mov $2,$0
lpb $0
mod $1,$2
mov $3,$2
dif $3,$0
cmp $3,$2
cmp $3,0
mul $3,$0
sub $0,1
mov $4,1
lpb $4
add $1,$3
add $4,$3
mod $4,4
lpe
lpe
mov $0,$1
| 21.913043 | 233 | 0.549603 |
defcd16aac105acf2aa36c0ecc6454e3d4534dd2 | 847 | asm | Assembly | oeis/252/A252631.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/252/A252631.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/252/A252631.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A252631: Numbers n such that the heptagonal number H(n) is equal to the sum of the hexagonal numbers X(m), X(m+1), X(m+2) and X(m+3) for some m.
; Submitted by Christian Krause
; 92,29524,9506540,3061076260,985657049084,317378508728692,102194894153589644,32906438538947136580,10595771014646824389020,3411805360277738506127764,1098590730238417152148750892,353742803331410045253391659364,113904084081983796154439965564220,36676761331595450951684415520019380,11809803244689653222646227357480676044,3802719968028736742241133524693257666692,1224464019902008541348422348723871487998684,394273611688478721577449755155561925877909460,126954878499670246339397472737742216261198847340
add $0,1
mov $2,4
mov $3,$0
mul $3,4
mov $5,53
lpb $3
add $1,$5
mul $5,$4
add $5,$2
mov $2,$1
mul $1,4
sub $3,1
lpe
mov $0,$5
sub $0,917
div $0,10
add $0,92
| 38.5 | 497 | 0.817001 |
0111f5a6d8e36c47aead3055263efbbede4d5091 | 599 | asm | Assembly | programs/oeis/189/A189479.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/189/A189479.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/189/A189479.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A189479: Fixed point starting with 0 of the morphism 0->01, 1->101.
; 0,1,1,0,1,1,0,1,0,1,1,0,1,1,0,1,0,1,1,0,1,0,1,1,0,1,1,0,1,0,1,1,0,1,1,0,1,0,1,1,0,1,0,1,1,0,1,1,0,1,0,1,1,0,1,0,1,1,0,1,1,0,1,0,1,1,0,1,1,0,1,0,1,1,0,1,0,1,1,0,1,1,0,1,0,1,1,0,1,1,0,1,0,1,1,0,1,0,1,1,0,1,1,0,1,0,1,1,0,1,0,1,1,0,1,1,0,1,0,1,1,0,1,1,0,1,0,1,1,0,1
mov $4,2
mov $6,$0
lpb $4
mov $0,$6
sub $4,1
add $0,$4
sub $0,1
mov $2,$0
mul $2,$0
lpb $2
sub $2,$0
add $0,2
trn $2,1
lpe
mov $3,$4
mov $5,$0
lpb $3
mov $1,$5
sub $3,1
lpe
lpe
lpb $6
sub $1,$5
mov $6,0
lpe
div $1,2
| 19.966667 | 263 | 0.499165 |
1fb8f81d22cf573b99d87bd7fe3c9a0f5f2a3ff3 | 14,954 | asm | Assembly | dino/lc/scrollx.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | 6 | 2020-10-14T15:29:10.000Z | 2022-02-12T18:58:54.000Z | dino/lc/scrollx.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | null | null | null | dino/lc/scrollx.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | 1 | 2020-12-17T08:59:10.000Z | 2020-12-17T08:59:10.000Z | copyright zengfr site:http://github.com/zengfr/romhack
009D52 swap D1
009D54 move.w #$2000, D1
009D58 move.w ($8,A6), D0
009D5C sub.w ($744,A5), D0
009D60 bpl $9d64
009D64 cmpi.w #$180, D0
009D68 bcs $9d6e
;--------
033A64 jsr $17a4.l
033A6A moveq #$8, D1
033A6C moveq #$1, D2
033A6E move.w ($744,A5), D0
033A72 addi.w #$c0, D0
033A76 sub.w ($b4,A6), D0
033A7A bge $33a80
;--------
020C1A tst.b ($4dc,A5)
020C1E beq $20c32
020C32 bsr $20b68
020C36 move.w ($4c,A6), ($8,A6)
020C3C tst.b ($6d,A6)
020C40 beq $20cb6
020C44 addq.b #2, ($6,A6)
;--------
022E0E bne $22e50
022E10 moveq #$0, D1
022E12 move.b ($5f,A6), D1
022E16 move.w ($744,A5), D0
022E1A lsr.w D1, D0
022E1C move.w D0, ($8,A6)
022E20 moveq #$0, D0
;--------
0098F2 swap D1
0098F4 move.w #$600, D1
0098F8 move.w ($8,A6), D2
0098FC sub.w ($744,A5), D2
009900 bpl $9904
009904 cmpi.w #$180, D2
009908 bcs $990e
;--------
020D9A clr.b ($6,A6)
020D9E jmp $892c.l
020F12 bsr $20a22
020F16 move.w ($8,A6), D0
020F1A sub.w ($5a,A6), D0
020F1E bsr $20f42
020F22 moveq #$0, D2
;--------
0AAAC2 movea.l A0, A3
0AAAC4 move.l #$0, D0
0AAACA move.l (A0), D2
0AAACC move.w D0, (A0)
0AAACE move.w D0, ($2,A0)
0AAAD2 cmp.l (A0), D0
0AAAD4 bne $aaafc
;--------
0096A8 rts
009796 moveq #$0, D1
009798 move.w ($8,A6), D0
00979C sub.w ($744,A5), D0
0097A0 bpl $97a4
0097A2 moveq #$0, D0
0097A4 cmpi.w #$180, D0
;--------
00A392 bra $a63c
00A396 moveq #$0, D1
00A398 move.w ($8,A6), D0
00A39C sub.w ($744,A5), D0
00A3A0 bpl $a3a4
00A3A4 cmpi.w #$180, D0
00A3A8 bcs $a3ae
;--------
00FC7E tst.b ($4dc,A5)
00FC82 beq $fc96
00FC96 move.w (A2), D0
00FC98 move.w ($744,A5), D1
00FC9C cmp.w D1, D0
00FC9E bhi $fd02
00FCA2 move.w ($2,A2), D0
;--------
0AAABC jmp $4ce.l
0AAAC2 movea.l A0, A3
0AAAC4 move.l #$0, D0
0AAACA move.l (A0), D2
0AAACC move.w D0, (A0)
0AAACE move.w D0, ($2,A0)
0AAAD2 cmp.l (A0), D0
;--------
0099F6 move.b (A0,D0.w), D0
0099FA moveq #$0, D1
0099FC move.w ($8,A6), D2
009A00 sub.w ($744,A5), D2
009A04 bpl $9a08
009A08 cmpi.w #$180, D2
009A0C bcs $9a12
;--------
009F54 move.l #$70000, D1
009F5A moveq #$0, D2
009F5C move.w ($8,A6), D0
009F60 sub.w ($744,A5), D0
009F64 bpl $9f68
009F68 cmpi.w #$180, D0
009F6C bcs $9f72
;--------
012C2E rts
012C90 movea.l ($6ac,A5), A0
012C94 move.w ($e,A0), D0
012C98 cmp.w ($744,A5), D0
012C9C blt $12ca2
012CA0 rts
012CAC bsr $12cb4
;--------
00173C tst.b ($4dc,A5)
001740 bne $1782
001744 move.w ($8,A6), D0
001748 sub.w ($744,A5), D0
00174C addi.w #$c0, D0
001750 cmpi.w #$300, D0
001754 bcs $175e
;--------
0836F2 bra $836fe
0836FE move.w #$8, ($6c,A6)
083704 move.w #$8, ($6e,A6)
08370A move.w ($744,A5), D0
08370E addi.w #$20, D0
083712 cmp.w ($8,A6), D0
083716 bcc $83804
;--------
097912 jsr $fbe8.l
097918 clr.w (-$7034,A5)
09791C move.w #$0, ($7e4,A5)
097922 move.w #$0, ($744,A5)
097928 move.w #$0, ($748,A5)
09792E moveq #$0, D0
097930 jsr $89e6.l
;--------
009940 swap D1
009942 move.w #$10, D1
009946 move.w ($8,A6), D2
00994A sub.w ($744,A5), D2
00994E bpl $9952
009952 cmpi.w #$180, D2
009956 bcs $995c
;--------
056EFA move.w #$150, ($10,A6)
056F00 move.l #$80000, ($aa,A6)
056F08 bra $56f36
056F0C move.w ($744,A5), D0
056F10 subi.w #$30, D0
056F14 move.w D0, ($8,A6)
056F18 move.w ($748,A5), D0
;--------
009FB6 move.l A0, -(A7)
009FB8 moveq #$0, D1
009FBA move.w ($8,A6), D0
009FBE sub.w ($744,A5), D0
009FC2 bpl $9fc6
009FC6 cmpi.w #$180, D0
009FCA bcs $9fd0
;--------
02B524 subi.w #$400, D0
02B528 move.w D0, ($8,A6)
02B52C rts
02B52E move.w ($744,A5), D0
02B532 addi.w #$5d0, D0
02B536 move.w ($8,A6), D1
02B53A addi.w #$400, D1
;--------
07BC08 bne $7bc0e
07BC0C rts
07BC0E move.w #$b4, ($4fe,A5)
07BC14 move.w ($744,A5), D0
07BC18 move.w D0, ($a0,A6)
07BC1C rts
07BC90 lea ($1a,PC) ; ($7bcac), A0
;--------
056E10 moveq #$3, D0
056E12 jsr $120e.l
056E18 rts
056E1A move.w ($744,A5), D0
056E1E subi.w #$30, D0
056E22 move.w D0, ($8,A6)
056E26 move.w ($748,A5), D0
;--------
013FBA tst.w ($69b4,A5)
013FBE bne $13fc8
013FC2 lea $904000.l, A4
013FC8 move.w ($744,A5), D0
013FCC subi.w #$40, D0
013FD0 move.w D0, ($69b6,A5)
013FD4 move.w ($748,A5), D0
;--------
020D18 move.b #$1, ($78,A6)
020D1E clr.b ($6d,A6)
020D22 bsr $20b68
020D26 move.w ($4c,A6), ($8,A6)
020D2C tst.b ($6d,A6)
020D30 beq $20d7e
020D34 addq.b #2, ($6,A6)
;--------
0186DC tst.b ($4d5,A5)
0186E0 bne $187b6
0186E4 lea ($5ec,A5), A6
0186E8 move.w ($744,A5), D0
0186EC cmp.w ($6,A6), D0
0186F0 bcc $186fe
0186F4 move.w ($8,A6), ($0,A6)
;--------
01E648 move.b #$1, ($c0,A0)
01E64E rts
020402 clr.l ($740,A5)
020406 clr.l ($744,A5)
02040A clr.l ($748,A5)
02040E clr.l ($796,A5)
020412 clr.l ($7e0,A5)
;--------
0458D8 move.b ($5b,A6), ($24,A6)
0458DE moveq #$3, D0
0458E0 jmp $120e.l
045926 move.w ($744,A5), D0
04592A addi.w #$c0, D0
04592E sub.w ($8,A6), D0
045932 addi.w #$c0, D0
;--------
024CBA movea.l #$b64d2, A1
024CC0 bra $24b56
024CC4 rts
024CE6 move.w ($744,A5), D0
024CEA addi.w #$410, D0
024CEE move.w ($8,A6), D1
024CF2 addi.w #$400, D1
;--------
00FD06 tst.b ($4dc,A5)
00FD0A beq $fd1e
00FD1E move.w (A2), D0
00FD20 move.w ($744,A5), D1
00FD24 cmp.w D1, D0
00FD26 bhi $fd44
00FD2A bsr $fdae
;--------
009652 swap D1
009654 move.w #$2000, D1
009658 move.w ($8,A2), D2
00965C sub.w ($744,A5), D2
009660 bpl $9664
009664 cmpi.w #$180, D2
009668 bcs $966e
;--------
033B1A move.b ($5b,A6), ($24,A6)
033B20 moveq #$b, D0
033B22 jmp $120e.l
033B68 move.w ($744,A5), D0
033B6C addi.w #$c0, D0
033B70 sub.w ($8,A6), D0
033B74 addi.w #$c0, D0
;--------
02128C cmp.w D0, D1
02128E bcc $21298
021298 bsr $21386
02129C move.w ($8,A6), D0
0212A0 sub.w ($46,A6), D0
0212A4 bsr $212ee
0212A8 cmpi.w #$20, D0
;--------
0AAACE move.w D0, ($2,A0)
0AAAD2 cmp.l (A0), D0
0AAAD4 bne $aaafc
0AAAD8 move.l D2, (A0)+
0AAADA cmpa.l A0, A1
0AAADC bne $aaaca
0AAADE movea.l A3, A0
;--------
004FCE tst.b ($4dc,A5)
004FD2 bne $500c
004FD6 move.w ($8,A6), D0
004FDA sub.w ($744,A5), D0
004FDE subi.w #$10, D0
004FE2 bmi $4fea
004FE4 subi.w #$160, D0
;--------
008E8C rts
0095CE moveq #$0, D1
0095D0 move.w ($8,A6), D0
0095D4 sub.w ($744,A5), D0
0095D8 bpl $95dc
0095DC cmpi.w #$180, D0
0095E0 bcs $95e6
;--------
0339D8 bsr $35812
0339DC moveq #$8, D1
0339DE moveq #$1, D2
0339E0 move.w ($744,A5), D0
0339E4 addi.w #$c0, D0
0339E8 sub.w ($b4,A6), D0
0339EC bge $339f2
;--------
02B01C rts
02B01E tst.b ($79,A6)
02B022 bne $2b154
02B026 move.w ($744,A5), D0
02B02A cmp.w ($8,A6), D0
02B02E bge $2b154
02B032 addi.w #$180, D0
;--------
0AAACA move.l (A0), D2
0AAACC move.w D0, (A0)
0AAACE move.w D0, ($2,A0)
0AAAD2 cmp.l (A0), D0
0AAAD4 bne $aaafc
0AAAD8 move.l D2, (A0)+
0AAADA cmpa.l A0, A1
;--------
00A360 swap D1
00A362 move.w #$2000, D1
00A366 move.w ($8,A6), D0
00A36A sub.w ($744,A5), D0
00A36E bpl $a372
00A370 moveq #$0, D0
00A372 cmpi.w #$180, D0
;--------
000A98 rts
000AE0 clr.w ($6c4,A5)
000AE4 clr.w ($6c8,A5)
000AE8 clr.w ($744,A5)
000AEC clr.w ($748,A5)
000AF0 clr.w ($7e4,A5)
000AF4 clr.w ($7e8,A5)
;--------
056CC6 jsr $12cb4.l
056CCC addq.b #2, ($4,A6)
056CD0 rts
056CE0 move.w ($744,A5), D0
056CE4 subi.w #$30, D0
056CE8 move.w D0, ($8,A6)
056CEC move.w ($748,A5), D0
;--------
056ED4 moveq #$4, D0
056ED6 jsr $120e.l
056EDC rts
056EDE move.w ($744,A5), D0
056EE2 subi.w #$18, D0
056EE6 move.w D0, ($8,A6)
056EEA move.w ($748,A5), D0
;--------
09A3F2 jsr $fbe8.l
09A3F8 clr.w (-$701c,A5)
09A3FC move.w #$0, ($7e4,A5)
09A402 move.w #$0, ($744,A5)
09A408 jsr $ae0.l
09A40E moveq #$0, D0
09A410 jsr $89e6.l
;--------
0327BC rts
0327BE lea ($c0,A0), A0
0327C2 dbra D0, $32768
03282A move.w ($744,A5), D0
03282E addi.w #$400, D0
032832 subi.w #$18, D0
032836 move.w ($8,A6), D1
;--------
0212A4 bsr $212ee
0212A8 cmpi.w #$20, D0
0212AC bmi $212c4
0212AE move.w ($8,A6), D0
0212B2 btst #$4, D0
0212B6 beq $212bc
0212BC andi.w #$ffe0, D0
;--------
097C2C jsr $89e6.l
097C32 jsr $892c.l
097C38 clr.w ($6c4,A5)
097C3C clr.w ($744,A5)
097C40 jsr $a76.l
097C46 move.w #$18d6, ($28,A5)
097C4C bsr $97c94
;--------
020A5A cmpi.w #$6, D0
020A5E ble $20a64
020A60 move.w #$6, D0
020A64 add.w D0, ($8,A6)
020A68 rts
020A8C move.w #$0, D0
020A90 move.w #$ffff, D1
;--------
020AAC bsr $20af2
020AB0 lea $ffb574.l, A0
020AB6 bsr $20af2
020ABA cmp.w ($8,A6), D1
020ABE bge $20aca
020ACA move.b ($3274,A5), D4
020ACE or.b ($33f4,A5), D4
;--------
001760 tst.b ($4dc,A5)
001764 bne $1782
001768 move.w ($8,A6), D0
00176C sub.w ($744,A5), D0
001770 addi.w #$40, D0
001774 cmpi.w #$240, D0
001778 bcs $175e
;--------
009C10 bge $9c20
009C20 moveq #$0, D1
009C22 move.w ($8,A6), D0
009C26 sub.w ($744,A5), D0
009C2A bpl $9c2e
009C2E cmpi.w #$180, D0
009C32 bcs $9c38
;--------
009E60 move.l A0, -(A7)
009E62 moveq #$0, D1
009E64 move.w ($8,A6), D0
009E68 sub.w ($744,A5), D0
009E6C bpl $9e70
009E70 cmpi.w #$180, D0
009E74 bcs $9e7a
;--------
02B504 rts
02B506 tst.w ($14,A6)
02B50A bpl $2b52e
02B50E move.w ($744,A5), D0
02B512 addi.w #$3b0, D0
02B516 move.w ($8,A6), D1
02B51A addi.w #$400, D1
;--------
0AAADC bne $aaaca
0AAADE movea.l A3, A0
0AAAE0 move.l #$ffffffff, D0
0AAAE6 move.l (A0), D2
0AAAE8 move.w D0, (A0)
0AAAEA move.w D0, ($2,A0)
0AAAEE cmp.l (A0), D0
;--------
056BEE moveq #$0, D0
056BF0 moveq #$0, D1
056BF2 move.w ($82,A6), D0
056BF6 move.w ($744,A5), D1
056BFA cmp.w ($744,A5), D0
056BFE beq $56c0e
056C02 sub.w D0, D1
;--------
056E72 moveq #$4, D0
056E74 jsr $120e.l
056E7A rts
056E7C move.w ($744,A5), D0
056E80 addi.w #$190, D0
056E84 move.w D0, ($8,A6)
056E88 move.w ($748,A5), D0
;--------
009A44 move.b (A0,D0.w), D0
009A48 moveq #$0, D1
009A4A move.w ($8,A6), D2
009A4E sub.w ($744,A5), D2
009A52 bpl $9a56
009A56 cmpi.w #$180, D2
009A5A bcs $9a60
;--------
001702 add.w ($10,A6), D1
001706 tst.b ($4dc,A5)
00170A bne $1716
00170E sub.w ($744,A5), D0
001712 sub.w ($748,A5), D1
001716 addi.w #$100, D0
00171A cmpi.w #$380, D0
;--------
02109E beq $210b2
0210B2 tst.b ($79,A6)
0210B6 bne $210c0
0210B8 move.w ($4c,A6), ($8,A6)
0210BE bra $210c6
0210C6 tst.b ($6d,A6)
0210CA beq $210da
;--------
056D3E moveq #$1, D0
056D40 jsr $120e.l
056D46 rts
056DB0 move.w ($744,A5), D1
056DB4 addi.w #$190, D1
056DB8 jsr $119c.l
056DBE andi.w #$30, D0
;--------
056BAC moveq #$0, D0
056BAE moveq #$0, D1
056BB0 move.w ($82,A6), D0
056BB4 move.w ($744,A5), D1
056BB8 cmp.w ($744,A5), D0
056BBC beq $56bcc
056BC0 sub.w D0, D1
;--------
001946 tst.b ($4dc,A5)
00194A bne $198c
00194E move.w ($8,A6), D0
001952 sub.w ($744,A5), D0
001956 addi.w #$50, D0
00195A bmi $1966
00195E subi.w #$220, D0
;--------
021206 bcs $2120c
021208 move.w ($3580,A5), D0
02120C rts
021266 addq.w #3, ($8,A6)
02126A bra $2126e
02126E move.w ($8,A6), D0
021272 move.w ($46,A6), D1
;--------
0099A6 move.b (A0,D0.w), D0
0099AA move.l #$70000, D1
0099B0 move.w ($8,A6), D2
0099B4 sub.w ($744,A5), D2
0099B8 bpl $99bc
0099BC cmpi.w #$180, D2
0099C0 bcs $99c6
;--------
020A22 bsr $20b4c
020A26 move.w ($8,A6), ($14,A6)
020A2C move.w ($60,A6), D0
020A30 sub.w ($8,A6), D0
020A34 cmpi.w #$40, D0
020A38 bgt $20a3c
020A3C cmp.w ($50,A6), D0
;--------
020812 blt $2081c
020814 cmpi.b #$10, ($5,A6)
02081A nop
02081C move.w ($46,A6), ($8,A6)
020822 move.w ($48,A6), ($c,A6)
020828 bra $20836
020836 jsr $b6c.l
;--------
00041E movea.l #$ff0000, A0
000424 move.w #$3fff, D0
000428 moveq #$0, D1
00042A move.l D1, (A0)+
00042C dbra D0, $42a
000430 reset
000432 move.b #$80, $800030.l
;--------
0208E6 cmpi.b #$6, ($4d9,A5)
0208EC bne $208f6
0208F6 move.w ($0,A4), D0
0208FA cmp.w ($8,A6), D0
0208FE bhi $20918
020900 bra $2090c
020902 move.w ($2,A4), D0
;--------
004D1C moveq #$0, D0
004D1E move.l D0, (A4)+
004D20 move.l D0, (A4)+
004D22 move.l D0, (A4)+
004D24 move.l D0, (A4)+
004D26 move.l D0, (A4)+
004D28 move.l D0, (A4)+
;--------
009A70 bra $a63c
009BCE moveq #$0, D1
009BD0 move.w ($8,A6), D0
009BD4 sub.w ($744,A5), D0
009BD8 bpl $9bdc
009BDC cmpi.w #$180, D0
009BE0 bcs $9be6
;--------
0AAAEA move.w D0, ($2,A0)
0AAAEE cmp.l (A0), D0
0AAAF0 bne $aaafc
0AAAF4 move.l D2, (A0)+
0AAAF6 cmpa.l A0, A1
0AAAF8 bne $aaae6
0AAAFA jmp (A6)
;--------
056BF0 moveq #$0, D1
056BF2 move.w ($82,A6), D0
056BF6 move.w ($744,A5), D1
056BFA cmp.w ($744,A5), D0
056BFE beq $56c0e
056C02 sub.w D0, D1
056C04 add.w D1, ($8,A6)
;--------
02120C rts
021266 addq.w #3, ($8,A6)
02126A bra $2126e
02126E move.w ($8,A6), D0
021272 move.w ($46,A6), D1
021276 cmp.w D0, D1
021278 bcc $21280
;--------
009CE6 swap D1
009CE8 move.w #$2000, D1
009CEC move.w ($8,A6), D0
009CF0 sub.w ($744,A5), D0
009CF4 bpl $9cf8
009CF8 cmpi.w #$180, D0
009CFC bcs $9d02
;--------
056BAE moveq #$0, D1
056BB0 move.w ($82,A6), D0
056BB4 move.w ($744,A5), D1
056BB8 cmp.w ($744,A5), D0
056BBC beq $56bcc
056BC0 sub.w D0, D1
056BC2 add.w D1, ($8,A6)
;--------
copyright zengfr site:http://github.com/zengfr/romhack
| 24.717355 | 54 | 0.532633 |
ba04c314ea568f55da2ba0a4a462964464170f8c | 579 | asm | Assembly | oeis/052/A052944.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/052/A052944.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/052/A052944.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A052944: a(n) = 2^n + n - 1.
; 0,2,5,10,19,36,69,134,263,520,1033,2058,4107,8204,16397,32782,65551,131088,262161,524306,1048595,2097172,4194325,8388630,16777239,33554456,67108889,134217754,268435483,536870940,1073741853,2147483678,4294967327,8589934624,17179869217,34359738402,68719476771,137438953508,274877906981,549755813926,1099511627815,2199023255592,4398046511145,8796093022250,17592186044459,35184372088876,70368744177709,140737488355374,281474976710703,562949953421360,1125899906842673,2251799813685298,4503599627370547
mov $1,2
pow $1,$0
add $1,$0
sub $1,1
mov $0,$1
| 64.333333 | 498 | 0.83247 |
dc89a6703e5c19d200b63a89ed1e4ec14ce4e85b | 354 | asm | Assembly | programs/oeis/154/A154533.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/154/A154533.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/154/A154533.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A154533: Number of constants of the form a^3*u + b*c*v, where a, b, c are linear, u of order n-3 and v of order n-2.
; 10,9,10,13,18,25,34,45,58,73,90,109,130,153,178,205,234,265,298,333,370,409,450,493,538,585,634,685,738,793,850,909,970,1033,1098,1165,1234,1305,1378,1453,1530,1609,1690,1773,1858,1945,2034,2125,2218,2313
sub $0,1
pow $0,2
add $0,9
| 50.571429 | 206 | 0.70339 |
d8bf511b07088844add918997d8151b52b802ea8 | 51,796 | asm | Assembly | middle.asm | hamedmiir/Synchronized-xv6 | 359fb38e9d740a69116913812d3fe27894596166 | [
"MIT-0"
] | null | null | null | middle.asm | hamedmiir/Synchronized-xv6 | 359fb38e9d740a69116913812d3fe27894596166 | [
"MIT-0"
] | null | null | null | middle.asm | hamedmiir/Synchronized-xv6 | 359fb38e9d740a69116913812d3fe27894596166 | [
"MIT-0"
] | null | null | null |
_middle: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
#define O_CREATE 0x200
int
main(int argc, char* argv[])
{
0: 8d 4c 24 04 lea 0x4(%esp),%ecx
4: 83 e4 f0 and $0xfffffff0,%esp
7: ff 71 fc pushl -0x4(%ecx)
a: 55 push %ebp
b: 89 e5 mov %esp,%ebp
d: 57 push %edi
e: 56 push %esi
f: 53 push %ebx
10: 51 push %ecx
11: 81 ec f8 07 00 00 sub $0x7f8,%esp
if(argc != 8) {
17: 83 39 08 cmpl $0x8,(%ecx)
#define O_CREATE 0x200
int
main(int argc, char* argv[])
{
1a: 8b 71 04 mov 0x4(%ecx),%esi
if(argc != 8) {
1d: 74 13 je 32 <main+0x32>
printf(1, "please insert exactly 7 numbers \n");
1f: 57 push %edi
20: 57 push %edi
21: 68 60 08 00 00 push $0x860
26: 6a 01 push $0x1
28: e8 13 05 00 00 call 540 <printf>
exit();
2d: e8 b0 03 00 00 call 3e2 <exit>
32: 31 db xor %ebx,%ebx
34: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
}
int array[7], i, j, temp, num = 7;
for(i = 0; i < 7; i++){
array[i] = atoi(argv[i+1]);
38: 83 ec 0c sub $0xc,%esp
3b: ff 74 9e 04 pushl 0x4(%esi,%ebx,4)
3f: e8 2c 03 00 00 call 370 <atoi>
44: 89 84 9d fc f7 ff ff mov %eax,-0x804(%ebp,%ebx,4)
printf(1, "please insert exactly 7 numbers \n");
exit();
}
int array[7], i, j, temp, num = 7;
for(i = 0; i < 7; i++){
4b: 83 c3 01 add $0x1,%ebx
4e: 83 c4 10 add $0x10,%esp
51: 83 fb 07 cmp $0x7,%ebx
54: 75 e2 jne 38 <main+0x38>
56: bb 06 00 00 00 mov $0x6,%ebx
5b: 90 nop
5c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
60: 31 c0 xor %eax,%eax
array[i] = atoi(argv[i+1]);
}
for (i = 0; i < num; i++)
{
for (j = 0; j < (num - i - 1); j++)
62: 39 d8 cmp %ebx,%eax
64: 7d 27 jge 8d <main+0x8d>
{
if (array[j] > array[j + 1])
66: 8b 94 85 fc f7 ff ff mov -0x804(%ebp,%eax,4),%edx
6d: 83 c0 01 add $0x1,%eax
70: 8b 8c 85 fc f7 ff ff mov -0x804(%ebp,%eax,4),%ecx
77: 39 ca cmp %ecx,%edx
79: 7e e7 jle 62 <main+0x62>
array[i] = atoi(argv[i+1]);
}
for (i = 0; i < num; i++)
{
for (j = 0; j < (num - i - 1); j++)
7b: 39 d8 cmp %ebx,%eax
{
if (array[j] > array[j + 1])
{
temp = array[j];
array[j] = array[j + 1];
7d: 89 8c 85 f8 f7 ff ff mov %ecx,-0x808(%ebp,%eax,4)
array[j + 1] = temp;
84: 89 94 85 fc f7 ff ff mov %edx,-0x804(%ebp,%eax,4)
array[i] = atoi(argv[i+1]);
}
for (i = 0; i < num; i++)
{
for (j = 0; j < (num - i - 1); j++)
8b: 7c d9 jl 66 <main+0x66>
8d: 83 eb 01 sub $0x1,%ebx
int array[7], i, j, temp, num = 7;
for(i = 0; i < 7; i++){
array[i] = atoi(argv[i+1]);
}
for (i = 0; i < num; i++)
90: 83 fb ff cmp $0xffffffff,%ebx
93: 75 cb jne 60 <main+0x60>
}
}
}
char t, midInverse[1000];
int cnt = 0, mid = array[3];
95: 8b 8d 08 f8 ff ff mov -0x7f8(%ebp),%ecx
while(mid != 0) {
9b: 85 c9 test %ecx,%ecx
9d: 0f 84 e8 00 00 00 je 18b <main+0x18b>
a3: 31 db xor %ebx,%ebx
t = (mid % 10) + '0';
midInverse[cnt] = t;
a5: be 67 66 66 66 mov $0x66666667,%esi
aa: eb 06 jmp b2 <main+0xb2>
ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
mid = mid / 10;
cnt ++;
b0: 89 fb mov %edi,%ebx
char t, midInverse[1000];
int cnt = 0, mid = array[3];
while(mid != 0) {
t = (mid % 10) + '0';
midInverse[cnt] = t;
b2: 89 c8 mov %ecx,%eax
mid = mid / 10;
cnt ++;
b4: 8d 7b 01 lea 0x1(%ebx),%edi
char t, midInverse[1000];
int cnt = 0, mid = array[3];
while(mid != 0) {
t = (mid % 10) + '0';
midInverse[cnt] = t;
b7: f7 ee imul %esi
b9: 89 c8 mov %ecx,%eax
bb: c1 f8 1f sar $0x1f,%eax
be: c1 fa 02 sar $0x2,%edx
c1: 29 c2 sub %eax,%edx
c3: 8d 04 92 lea (%edx,%edx,4),%eax
c6: 01 c0 add %eax,%eax
c8: 29 c1 sub %eax,%ecx
ca: 83 c1 30 add $0x30,%ecx
}
}
char t, midInverse[1000];
int cnt = 0, mid = array[3];
while(mid != 0) {
cd: 85 d2 test %edx,%edx
t = (mid % 10) + '0';
midInverse[cnt] = t;
cf: 88 8c 1d 18 f8 ff ff mov %cl,-0x7e8(%ebp,%ebx,1)
mid = mid / 10;
d6: 89 d1 mov %edx,%ecx
}
}
char t, midInverse[1000];
int cnt = 0, mid = array[3];
while(mid != 0) {
d8: 75 d6 jne b0 <main+0xb0>
da: 8d 85 18 f8 ff ff lea -0x7e8(%ebp),%eax
e0: 8d 95 00 fc ff ff lea -0x400(%ebp),%edx
e6: 01 d8 add %ebx,%eax
e8: 8d 9d 17 f8 ff ff lea -0x7e9(%ebp),%ebx
ee: 66 90 xchg %ax,%ax
}
int n = 0;
char middle[1000];
for(i = cnt-1; i >= 0; i--) {
middle[n] = midInverse[i];
f0: 0f b6 08 movzbl (%eax),%ecx
f3: 83 e8 01 sub $0x1,%eax
f6: 83 c2 01 add $0x1,%edx
f9: 88 4a ff mov %cl,-0x1(%edx)
cnt ++;
}
int n = 0;
char middle[1000];
for(i = cnt-1; i >= 0; i--) {
fc: 39 d8 cmp %ebx,%eax
fe: 75 f0 jne f0 <main+0xf0>
middle[n] = midInverse[i];
n++;
}
middle[n] = '\n';
100: c6 84 3d 00 fc ff ff movb $0xa,-0x400(%ebp,%edi,1)
107: 0a
printf(1, "proccess Id is %d \n", getpid());
108: e8 55 03 00 00 call 462 <getpid>
10d: 51 push %ecx
10e: 50 push %eax
10f: 68 a4 08 00 00 push $0x8a4
114: 6a 01 push $0x1
116: e8 25 04 00 00 call 540 <printf>
int fileDesc;
if( (fileDesc = open("result.txt", O_CREATE | O_WRONLY)) < 0) {
11b: 5b pop %ebx
11c: 5e pop %esi
11d: 68 01 02 00 00 push $0x201
122: 68 c8 08 00 00 push $0x8c8
127: e8 f6 02 00 00 call 422 <open>
12c: 83 c4 10 add $0x10,%esp
12f: 85 c0 test %eax,%eax
131: 89 c6 mov %eax,%esi
133: 78 3e js 173 <main+0x173>
printf(1, "can't open file result.txt");
exit();
}
if(write(fileDesc, middle, strlen(middle)) != strlen(middle)) {
135: 8d 9d 00 fc ff ff lea -0x400(%ebp),%ebx
13b: 83 ec 0c sub $0xc,%esp
13e: 53 push %ebx
13f: e8 dc 00 00 00 call 220 <strlen>
144: 83 c4 0c add $0xc,%esp
147: 50 push %eax
148: 53 push %ebx
149: 56 push %esi
14a: e8 b3 02 00 00 call 402 <write>
14f: 89 c6 mov %eax,%esi
151: 89 1c 24 mov %ebx,(%esp)
154: e8 c7 00 00 00 call 220 <strlen>
159: 83 c4 10 add $0x10,%esp
15c: 39 c6 cmp %eax,%esi
15e: 74 26 je 186 <main+0x186>
printf(1, "Eror when writing in result.txt");
160: 50 push %eax
161: 50 push %eax
162: 68 84 08 00 00 push $0x884
167: 6a 01 push $0x1
169: e8 d2 03 00 00 call 540 <printf>
exit();
16e: e8 6f 02 00 00 call 3e2 <exit>
middle[n] = '\n';
printf(1, "proccess Id is %d \n", getpid());
int fileDesc;
if( (fileDesc = open("result.txt", O_CREATE | O_WRONLY)) < 0) {
printf(1, "can't open file result.txt");
173: 52 push %edx
174: 52 push %edx
175: 68 b8 08 00 00 push $0x8b8
17a: 6a 01 push $0x1
17c: e8 bf 03 00 00 call 540 <printf>
exit();
181: e8 5c 02 00 00 call 3e2 <exit>
if(write(fileDesc, middle, strlen(middle)) != strlen(middle)) {
printf(1, "Eror when writing in result.txt");
exit();
}
exit();
186: e8 57 02 00 00 call 3e2 <exit>
midInverse[cnt] = t;
mid = mid / 10;
cnt ++;
}
int n = 0;
18b: 31 ff xor %edi,%edi
18d: e9 6e ff ff ff jmp 100 <main+0x100>
192: 66 90 xchg %ax,%ax
194: 66 90 xchg %ax,%ax
196: 66 90 xchg %ax,%ax
198: 66 90 xchg %ax,%ax
19a: 66 90 xchg %ax,%ax
19c: 66 90 xchg %ax,%ax
19e: 66 90 xchg %ax,%ax
000001a0 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, const char *t)
{
1a0: 55 push %ebp
1a1: 89 e5 mov %esp,%ebp
1a3: 53 push %ebx
1a4: 8b 45 08 mov 0x8(%ebp),%eax
1a7: 8b 4d 0c mov 0xc(%ebp),%ecx
char *os;
os = s;
while((*s++ = *t++) != 0)
1aa: 89 c2 mov %eax,%edx
1ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
1b0: 83 c1 01 add $0x1,%ecx
1b3: 0f b6 59 ff movzbl -0x1(%ecx),%ebx
1b7: 83 c2 01 add $0x1,%edx
1ba: 84 db test %bl,%bl
1bc: 88 5a ff mov %bl,-0x1(%edx)
1bf: 75 ef jne 1b0 <strcpy+0x10>
;
return os;
}
1c1: 5b pop %ebx
1c2: 5d pop %ebp
1c3: c3 ret
1c4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
1ca: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
000001d0 <strcmp>:
int
strcmp(const char *p, const char *q)
{
1d0: 55 push %ebp
1d1: 89 e5 mov %esp,%ebp
1d3: 56 push %esi
1d4: 53 push %ebx
1d5: 8b 55 08 mov 0x8(%ebp),%edx
1d8: 8b 4d 0c mov 0xc(%ebp),%ecx
while(*p && *p == *q)
1db: 0f b6 02 movzbl (%edx),%eax
1de: 0f b6 19 movzbl (%ecx),%ebx
1e1: 84 c0 test %al,%al
1e3: 75 1e jne 203 <strcmp+0x33>
1e5: eb 29 jmp 210 <strcmp+0x40>
1e7: 89 f6 mov %esi,%esi
1e9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
p++, q++;
1f0: 83 c2 01 add $0x1,%edx
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
1f3: 0f b6 02 movzbl (%edx),%eax
p++, q++;
1f6: 8d 71 01 lea 0x1(%ecx),%esi
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
1f9: 0f b6 59 01 movzbl 0x1(%ecx),%ebx
1fd: 84 c0 test %al,%al
1ff: 74 0f je 210 <strcmp+0x40>
201: 89 f1 mov %esi,%ecx
203: 38 d8 cmp %bl,%al
205: 74 e9 je 1f0 <strcmp+0x20>
p++, q++;
return (uchar)*p - (uchar)*q;
207: 29 d8 sub %ebx,%eax
}
209: 5b pop %ebx
20a: 5e pop %esi
20b: 5d pop %ebp
20c: c3 ret
20d: 8d 76 00 lea 0x0(%esi),%esi
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
210: 31 c0 xor %eax,%eax
p++, q++;
return (uchar)*p - (uchar)*q;
212: 29 d8 sub %ebx,%eax
}
214: 5b pop %ebx
215: 5e pop %esi
216: 5d pop %ebp
217: c3 ret
218: 90 nop
219: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
00000220 <strlen>:
uint
strlen(const char *s)
{
220: 55 push %ebp
221: 89 e5 mov %esp,%ebp
223: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
for(n = 0; s[n]; n++)
226: 80 39 00 cmpb $0x0,(%ecx)
229: 74 12 je 23d <strlen+0x1d>
22b: 31 d2 xor %edx,%edx
22d: 8d 76 00 lea 0x0(%esi),%esi
230: 83 c2 01 add $0x1,%edx
233: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1)
237: 89 d0 mov %edx,%eax
239: 75 f5 jne 230 <strlen+0x10>
;
return n;
}
23b: 5d pop %ebp
23c: c3 ret
uint
strlen(const char *s)
{
int n;
for(n = 0; s[n]; n++)
23d: 31 c0 xor %eax,%eax
;
return n;
}
23f: 5d pop %ebp
240: c3 ret
241: eb 0d jmp 250 <memset>
243: 90 nop
244: 90 nop
245: 90 nop
246: 90 nop
247: 90 nop
248: 90 nop
249: 90 nop
24a: 90 nop
24b: 90 nop
24c: 90 nop
24d: 90 nop
24e: 90 nop
24f: 90 nop
00000250 <memset>:
void*
memset(void *dst, int c, uint n)
{
250: 55 push %ebp
251: 89 e5 mov %esp,%ebp
253: 57 push %edi
254: 8b 55 08 mov 0x8(%ebp),%edx
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" :
257: 8b 4d 10 mov 0x10(%ebp),%ecx
25a: 8b 45 0c mov 0xc(%ebp),%eax
25d: 89 d7 mov %edx,%edi
25f: fc cld
260: f3 aa rep stos %al,%es:(%edi)
stosb(dst, c, n);
return dst;
}
262: 89 d0 mov %edx,%eax
264: 5f pop %edi
265: 5d pop %ebp
266: c3 ret
267: 89 f6 mov %esi,%esi
269: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000270 <strchr>:
char*
strchr(const char *s, char c)
{
270: 55 push %ebp
271: 89 e5 mov %esp,%ebp
273: 53 push %ebx
274: 8b 45 08 mov 0x8(%ebp),%eax
277: 8b 5d 0c mov 0xc(%ebp),%ebx
for(; *s; s++)
27a: 0f b6 10 movzbl (%eax),%edx
27d: 84 d2 test %dl,%dl
27f: 74 1d je 29e <strchr+0x2e>
if(*s == c)
281: 38 d3 cmp %dl,%bl
283: 89 d9 mov %ebx,%ecx
285: 75 0d jne 294 <strchr+0x24>
287: eb 17 jmp 2a0 <strchr+0x30>
289: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
290: 38 ca cmp %cl,%dl
292: 74 0c je 2a0 <strchr+0x30>
}
char*
strchr(const char *s, char c)
{
for(; *s; s++)
294: 83 c0 01 add $0x1,%eax
297: 0f b6 10 movzbl (%eax),%edx
29a: 84 d2 test %dl,%dl
29c: 75 f2 jne 290 <strchr+0x20>
if(*s == c)
return (char*)s;
return 0;
29e: 31 c0 xor %eax,%eax
}
2a0: 5b pop %ebx
2a1: 5d pop %ebp
2a2: c3 ret
2a3: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
2a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
000002b0 <gets>:
char*
gets(char *buf, int max)
{
2b0: 55 push %ebp
2b1: 89 e5 mov %esp,%ebp
2b3: 57 push %edi
2b4: 56 push %esi
2b5: 53 push %ebx
int i, cc;
char c;
for(i=0; i+1 < max; ){
2b6: 31 f6 xor %esi,%esi
cc = read(0, &c, 1);
2b8: 8d 7d e7 lea -0x19(%ebp),%edi
return 0;
}
char*
gets(char *buf, int max)
{
2bb: 83 ec 1c sub $0x1c,%esp
int i, cc;
char c;
for(i=0; i+1 < max; ){
2be: eb 29 jmp 2e9 <gets+0x39>
cc = read(0, &c, 1);
2c0: 83 ec 04 sub $0x4,%esp
2c3: 6a 01 push $0x1
2c5: 57 push %edi
2c6: 6a 00 push $0x0
2c8: e8 2d 01 00 00 call 3fa <read>
if(cc < 1)
2cd: 83 c4 10 add $0x10,%esp
2d0: 85 c0 test %eax,%eax
2d2: 7e 1d jle 2f1 <gets+0x41>
break;
buf[i++] = c;
2d4: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
2d8: 8b 55 08 mov 0x8(%ebp),%edx
2db: 89 de mov %ebx,%esi
if(c == '\n' || c == '\r')
2dd: 3c 0a cmp $0xa,%al
for(i=0; i+1 < max; ){
cc = read(0, &c, 1);
if(cc < 1)
break;
buf[i++] = c;
2df: 88 44 1a ff mov %al,-0x1(%edx,%ebx,1)
if(c == '\n' || c == '\r')
2e3: 74 1b je 300 <gets+0x50>
2e5: 3c 0d cmp $0xd,%al
2e7: 74 17 je 300 <gets+0x50>
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
2e9: 8d 5e 01 lea 0x1(%esi),%ebx
2ec: 3b 5d 0c cmp 0xc(%ebp),%ebx
2ef: 7c cf jl 2c0 <gets+0x10>
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
2f1: 8b 45 08 mov 0x8(%ebp),%eax
2f4: c6 04 30 00 movb $0x0,(%eax,%esi,1)
return buf;
}
2f8: 8d 65 f4 lea -0xc(%ebp),%esp
2fb: 5b pop %ebx
2fc: 5e pop %esi
2fd: 5f pop %edi
2fe: 5d pop %ebp
2ff: c3 ret
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
300: 8b 45 08 mov 0x8(%ebp),%eax
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
303: 89 de mov %ebx,%esi
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
305: c6 04 30 00 movb $0x0,(%eax,%esi,1)
return buf;
}
309: 8d 65 f4 lea -0xc(%ebp),%esp
30c: 5b pop %ebx
30d: 5e pop %esi
30e: 5f pop %edi
30f: 5d pop %ebp
310: c3 ret
311: eb 0d jmp 320 <stat>
313: 90 nop
314: 90 nop
315: 90 nop
316: 90 nop
317: 90 nop
318: 90 nop
319: 90 nop
31a: 90 nop
31b: 90 nop
31c: 90 nop
31d: 90 nop
31e: 90 nop
31f: 90 nop
00000320 <stat>:
int
stat(const char *n, struct stat *st)
{
320: 55 push %ebp
321: 89 e5 mov %esp,%ebp
323: 56 push %esi
324: 53 push %ebx
int fd;
int r;
fd = open(n, O_RDONLY);
325: 83 ec 08 sub $0x8,%esp
328: 6a 00 push $0x0
32a: ff 75 08 pushl 0x8(%ebp)
32d: e8 f0 00 00 00 call 422 <open>
if(fd < 0)
332: 83 c4 10 add $0x10,%esp
335: 85 c0 test %eax,%eax
337: 78 27 js 360 <stat+0x40>
return -1;
r = fstat(fd, st);
339: 83 ec 08 sub $0x8,%esp
33c: ff 75 0c pushl 0xc(%ebp)
33f: 89 c3 mov %eax,%ebx
341: 50 push %eax
342: e8 f3 00 00 00 call 43a <fstat>
347: 89 c6 mov %eax,%esi
close(fd);
349: 89 1c 24 mov %ebx,(%esp)
34c: e8 b9 00 00 00 call 40a <close>
return r;
351: 83 c4 10 add $0x10,%esp
354: 89 f0 mov %esi,%eax
}
356: 8d 65 f8 lea -0x8(%ebp),%esp
359: 5b pop %ebx
35a: 5e pop %esi
35b: 5d pop %ebp
35c: c3 ret
35d: 8d 76 00 lea 0x0(%esi),%esi
int fd;
int r;
fd = open(n, O_RDONLY);
if(fd < 0)
return -1;
360: b8 ff ff ff ff mov $0xffffffff,%eax
365: eb ef jmp 356 <stat+0x36>
367: 89 f6 mov %esi,%esi
369: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00000370 <atoi>:
return r;
}
int
atoi(const char *s)
{
370: 55 push %ebp
371: 89 e5 mov %esp,%ebp
373: 53 push %ebx
374: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
n = 0;
while('0' <= *s && *s <= '9')
377: 0f be 11 movsbl (%ecx),%edx
37a: 8d 42 d0 lea -0x30(%edx),%eax
37d: 3c 09 cmp $0x9,%al
37f: b8 00 00 00 00 mov $0x0,%eax
384: 77 1f ja 3a5 <atoi+0x35>
386: 8d 76 00 lea 0x0(%esi),%esi
389: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
n = n*10 + *s++ - '0';
390: 8d 04 80 lea (%eax,%eax,4),%eax
393: 83 c1 01 add $0x1,%ecx
396: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax
atoi(const char *s)
{
int n;
n = 0;
while('0' <= *s && *s <= '9')
39a: 0f be 11 movsbl (%ecx),%edx
39d: 8d 5a d0 lea -0x30(%edx),%ebx
3a0: 80 fb 09 cmp $0x9,%bl
3a3: 76 eb jbe 390 <atoi+0x20>
n = n*10 + *s++ - '0';
return n;
}
3a5: 5b pop %ebx
3a6: 5d pop %ebp
3a7: c3 ret
3a8: 90 nop
3a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
000003b0 <memmove>:
void*
memmove(void *vdst, const void *vsrc, int n)
{
3b0: 55 push %ebp
3b1: 89 e5 mov %esp,%ebp
3b3: 56 push %esi
3b4: 53 push %ebx
3b5: 8b 5d 10 mov 0x10(%ebp),%ebx
3b8: 8b 45 08 mov 0x8(%ebp),%eax
3bb: 8b 75 0c mov 0xc(%ebp),%esi
char *dst;
const char *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
3be: 85 db test %ebx,%ebx
3c0: 7e 14 jle 3d6 <memmove+0x26>
3c2: 31 d2 xor %edx,%edx
3c4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
*dst++ = *src++;
3c8: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
3cc: 88 0c 10 mov %cl,(%eax,%edx,1)
3cf: 83 c2 01 add $0x1,%edx
char *dst;
const char *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
3d2: 39 da cmp %ebx,%edx
3d4: 75 f2 jne 3c8 <memmove+0x18>
*dst++ = *src++;
return vdst;
}
3d6: 5b pop %ebx
3d7: 5e pop %esi
3d8: 5d pop %ebp
3d9: c3 ret
000003da <fork>:
3da: b8 01 00 00 00 mov $0x1,%eax
3df: cd 40 int $0x40
3e1: c3 ret
000003e2 <exit>:
3e2: b8 02 00 00 00 mov $0x2,%eax
3e7: cd 40 int $0x40
3e9: c3 ret
000003ea <wait>:
3ea: b8 03 00 00 00 mov $0x3,%eax
3ef: cd 40 int $0x40
3f1: c3 ret
000003f2 <pipe>:
3f2: b8 04 00 00 00 mov $0x4,%eax
3f7: cd 40 int $0x40
3f9: c3 ret
000003fa <read>:
3fa: b8 05 00 00 00 mov $0x5,%eax
3ff: cd 40 int $0x40
401: c3 ret
00000402 <write>:
402: b8 10 00 00 00 mov $0x10,%eax
407: cd 40 int $0x40
409: c3 ret
0000040a <close>:
40a: b8 15 00 00 00 mov $0x15,%eax
40f: cd 40 int $0x40
411: c3 ret
00000412 <kill>:
412: b8 06 00 00 00 mov $0x6,%eax
417: cd 40 int $0x40
419: c3 ret
0000041a <exec>:
41a: b8 07 00 00 00 mov $0x7,%eax
41f: cd 40 int $0x40
421: c3 ret
00000422 <open>:
422: b8 0f 00 00 00 mov $0xf,%eax
427: cd 40 int $0x40
429: c3 ret
0000042a <mknod>:
42a: b8 11 00 00 00 mov $0x11,%eax
42f: cd 40 int $0x40
431: c3 ret
00000432 <unlink>:
432: b8 12 00 00 00 mov $0x12,%eax
437: cd 40 int $0x40
439: c3 ret
0000043a <fstat>:
43a: b8 08 00 00 00 mov $0x8,%eax
43f: cd 40 int $0x40
441: c3 ret
00000442 <link>:
442: b8 13 00 00 00 mov $0x13,%eax
447: cd 40 int $0x40
449: c3 ret
0000044a <mkdir>:
44a: b8 14 00 00 00 mov $0x14,%eax
44f: cd 40 int $0x40
451: c3 ret
00000452 <chdir>:
452: b8 09 00 00 00 mov $0x9,%eax
457: cd 40 int $0x40
459: c3 ret
0000045a <dup>:
45a: b8 0a 00 00 00 mov $0xa,%eax
45f: cd 40 int $0x40
461: c3 ret
00000462 <getpid>:
462: b8 0b 00 00 00 mov $0xb,%eax
467: cd 40 int $0x40
469: c3 ret
0000046a <sbrk>:
46a: b8 0c 00 00 00 mov $0xc,%eax
46f: cd 40 int $0x40
471: c3 ret
00000472 <sleep>:
472: b8 0d 00 00 00 mov $0xd,%eax
477: cd 40 int $0x40
479: c3 ret
0000047a <uptime>:
47a: b8 0e 00 00 00 mov $0xe,%eax
47f: cd 40 int $0x40
481: c3 ret
00000482 <incNum>:
482: b8 16 00 00 00 mov $0x16,%eax
487: cd 40 int $0x40
489: c3 ret
0000048a <getprocs>:
48a: b8 17 00 00 00 mov $0x17,%eax
48f: cd 40 int $0x40
491: c3 ret
00000492 <printstack>:
492: b8 18 00 00 00 mov $0x18,%eax
497: cd 40 int $0x40
499: c3 ret
49a: 66 90 xchg %ax,%ax
49c: 66 90 xchg %ax,%ax
49e: 66 90 xchg %ax,%ax
000004a0 <printint>:
write(fd, &c, 1);
}
static void
printint(int fd, int xx, int base, int sgn)
{
4a0: 55 push %ebp
4a1: 89 e5 mov %esp,%ebp
4a3: 57 push %edi
4a4: 56 push %esi
4a5: 53 push %ebx
4a6: 89 c6 mov %eax,%esi
4a8: 83 ec 3c sub $0x3c,%esp
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
4ab: 8b 5d 08 mov 0x8(%ebp),%ebx
4ae: 85 db test %ebx,%ebx
4b0: 74 7e je 530 <printint+0x90>
4b2: 89 d0 mov %edx,%eax
4b4: c1 e8 1f shr $0x1f,%eax
4b7: 84 c0 test %al,%al
4b9: 74 75 je 530 <printint+0x90>
neg = 1;
x = -xx;
4bb: 89 d0 mov %edx,%eax
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
neg = 1;
4bd: c7 45 c4 01 00 00 00 movl $0x1,-0x3c(%ebp)
x = -xx;
4c4: f7 d8 neg %eax
4c6: 89 75 c0 mov %esi,-0x40(%ebp)
} else {
x = xx;
}
i = 0;
4c9: 31 ff xor %edi,%edi
4cb: 8d 5d d7 lea -0x29(%ebp),%ebx
4ce: 89 ce mov %ecx,%esi
4d0: eb 08 jmp 4da <printint+0x3a>
4d2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
do{
buf[i++] = digits[x % base];
4d8: 89 cf mov %ecx,%edi
4da: 31 d2 xor %edx,%edx
4dc: 8d 4f 01 lea 0x1(%edi),%ecx
4df: f7 f6 div %esi
4e1: 0f b6 92 dc 08 00 00 movzbl 0x8dc(%edx),%edx
}while((x /= base) != 0);
4e8: 85 c0 test %eax,%eax
x = xx;
}
i = 0;
do{
buf[i++] = digits[x % base];
4ea: 88 14 0b mov %dl,(%ebx,%ecx,1)
}while((x /= base) != 0);
4ed: 75 e9 jne 4d8 <printint+0x38>
if(neg)
4ef: 8b 45 c4 mov -0x3c(%ebp),%eax
4f2: 8b 75 c0 mov -0x40(%ebp),%esi
4f5: 85 c0 test %eax,%eax
4f7: 74 08 je 501 <printint+0x61>
buf[i++] = '-';
4f9: c6 44 0d d8 2d movb $0x2d,-0x28(%ebp,%ecx,1)
4fe: 8d 4f 02 lea 0x2(%edi),%ecx
501: 8d 7c 0d d7 lea -0x29(%ebp,%ecx,1),%edi
505: 8d 76 00 lea 0x0(%esi),%esi
508: 0f b6 07 movzbl (%edi),%eax
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
50b: 83 ec 04 sub $0x4,%esp
50e: 83 ef 01 sub $0x1,%edi
511: 6a 01 push $0x1
513: 53 push %ebx
514: 56 push %esi
515: 88 45 d7 mov %al,-0x29(%ebp)
518: e8 e5 fe ff ff call 402 <write>
buf[i++] = digits[x % base];
}while((x /= base) != 0);
if(neg)
buf[i++] = '-';
while(--i >= 0)
51d: 83 c4 10 add $0x10,%esp
520: 39 df cmp %ebx,%edi
522: 75 e4 jne 508 <printint+0x68>
putc(fd, buf[i]);
}
524: 8d 65 f4 lea -0xc(%ebp),%esp
527: 5b pop %ebx
528: 5e pop %esi
529: 5f pop %edi
52a: 5d pop %ebp
52b: c3 ret
52c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
neg = 0;
if(sgn && xx < 0){
neg = 1;
x = -xx;
} else {
x = xx;
530: 89 d0 mov %edx,%eax
static char digits[] = "0123456789ABCDEF";
char buf[16];
int i, neg;
uint x;
neg = 0;
532: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp)
539: eb 8b jmp 4c6 <printint+0x26>
53b: 90 nop
53c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
00000540 <printf>:
}
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, const char *fmt, ...)
{
540: 55 push %ebp
541: 89 e5 mov %esp,%ebp
543: 57 push %edi
544: 56 push %esi
545: 53 push %ebx
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
546: 8d 45 10 lea 0x10(%ebp),%eax
}
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, const char *fmt, ...)
{
549: 83 ec 2c sub $0x2c,%esp
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
54c: 8b 75 0c mov 0xc(%ebp),%esi
}
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, const char *fmt, ...)
{
54f: 8b 7d 08 mov 0x8(%ebp),%edi
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
552: 89 45 d0 mov %eax,-0x30(%ebp)
555: 0f b6 1e movzbl (%esi),%ebx
558: 83 c6 01 add $0x1,%esi
55b: 84 db test %bl,%bl
55d: 0f 84 b0 00 00 00 je 613 <printf+0xd3>
563: 31 d2 xor %edx,%edx
565: eb 39 jmp 5a0 <printf+0x60>
567: 89 f6 mov %esi,%esi
569: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
570: 83 f8 25 cmp $0x25,%eax
573: 89 55 d4 mov %edx,-0x2c(%ebp)
state = '%';
576: ba 25 00 00 00 mov $0x25,%edx
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
57b: 74 18 je 595 <printf+0x55>
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
57d: 8d 45 e2 lea -0x1e(%ebp),%eax
580: 83 ec 04 sub $0x4,%esp
583: 88 5d e2 mov %bl,-0x1e(%ebp)
586: 6a 01 push $0x1
588: 50 push %eax
589: 57 push %edi
58a: e8 73 fe ff ff call 402 <write>
58f: 8b 55 d4 mov -0x2c(%ebp),%edx
592: 83 c4 10 add $0x10,%esp
595: 83 c6 01 add $0x1,%esi
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
598: 0f b6 5e ff movzbl -0x1(%esi),%ebx
59c: 84 db test %bl,%bl
59e: 74 73 je 613 <printf+0xd3>
c = fmt[i] & 0xff;
if(state == 0){
5a0: 85 d2 test %edx,%edx
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
c = fmt[i] & 0xff;
5a2: 0f be cb movsbl %bl,%ecx
5a5: 0f b6 c3 movzbl %bl,%eax
if(state == 0){
5a8: 74 c6 je 570 <printf+0x30>
if(c == '%'){
state = '%';
} else {
putc(fd, c);
}
} else if(state == '%'){
5aa: 83 fa 25 cmp $0x25,%edx
5ad: 75 e6 jne 595 <printf+0x55>
if(c == 'd'){
5af: 83 f8 64 cmp $0x64,%eax
5b2: 0f 84 f8 00 00 00 je 6b0 <printf+0x170>
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
5b8: 81 e1 f7 00 00 00 and $0xf7,%ecx
5be: 83 f9 70 cmp $0x70,%ecx
5c1: 74 5d je 620 <printf+0xe0>
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
5c3: 83 f8 73 cmp $0x73,%eax
5c6: 0f 84 84 00 00 00 je 650 <printf+0x110>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
5cc: 83 f8 63 cmp $0x63,%eax
5cf: 0f 84 ea 00 00 00 je 6bf <printf+0x17f>
putc(fd, *ap);
ap++;
} else if(c == '%'){
5d5: 83 f8 25 cmp $0x25,%eax
5d8: 0f 84 c2 00 00 00 je 6a0 <printf+0x160>
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
5de: 8d 45 e7 lea -0x19(%ebp),%eax
5e1: 83 ec 04 sub $0x4,%esp
5e4: c6 45 e7 25 movb $0x25,-0x19(%ebp)
5e8: 6a 01 push $0x1
5ea: 50 push %eax
5eb: 57 push %edi
5ec: e8 11 fe ff ff call 402 <write>
5f1: 83 c4 0c add $0xc,%esp
5f4: 8d 45 e6 lea -0x1a(%ebp),%eax
5f7: 88 5d e6 mov %bl,-0x1a(%ebp)
5fa: 6a 01 push $0x1
5fc: 50 push %eax
5fd: 57 push %edi
5fe: 83 c6 01 add $0x1,%esi
601: e8 fc fd ff ff call 402 <write>
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
606: 0f b6 5e ff movzbl -0x1(%esi),%ebx
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
60a: 83 c4 10 add $0x10,%esp
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
60d: 31 d2 xor %edx,%edx
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
60f: 84 db test %bl,%bl
611: 75 8d jne 5a0 <printf+0x60>
putc(fd, c);
}
state = 0;
}
}
}
613: 8d 65 f4 lea -0xc(%ebp),%esp
616: 5b pop %ebx
617: 5e pop %esi
618: 5f pop %edi
619: 5d pop %ebp
61a: c3 ret
61b: 90 nop
61c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
} else if(state == '%'){
if(c == 'd'){
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
printint(fd, *ap, 16, 0);
620: 83 ec 0c sub $0xc,%esp
623: b9 10 00 00 00 mov $0x10,%ecx
628: 6a 00 push $0x0
62a: 8b 5d d0 mov -0x30(%ebp),%ebx
62d: 89 f8 mov %edi,%eax
62f: 8b 13 mov (%ebx),%edx
631: e8 6a fe ff ff call 4a0 <printint>
ap++;
636: 89 d8 mov %ebx,%eax
638: 83 c4 10 add $0x10,%esp
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
63b: 31 d2 xor %edx,%edx
if(c == 'd'){
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
printint(fd, *ap, 16, 0);
ap++;
63d: 83 c0 04 add $0x4,%eax
640: 89 45 d0 mov %eax,-0x30(%ebp)
643: e9 4d ff ff ff jmp 595 <printf+0x55>
648: 90 nop
649: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
} else if(c == 's'){
s = (char*)*ap;
650: 8b 45 d0 mov -0x30(%ebp),%eax
653: 8b 18 mov (%eax),%ebx
ap++;
655: 83 c0 04 add $0x4,%eax
658: 89 45 d0 mov %eax,-0x30(%ebp)
if(s == 0)
s = "(null)";
65b: b8 d3 08 00 00 mov $0x8d3,%eax
660: 85 db test %ebx,%ebx
662: 0f 44 d8 cmove %eax,%ebx
while(*s != 0){
665: 0f b6 03 movzbl (%ebx),%eax
668: 84 c0 test %al,%al
66a: 74 23 je 68f <printf+0x14f>
66c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
670: 88 45 e3 mov %al,-0x1d(%ebp)
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
673: 8d 45 e3 lea -0x1d(%ebp),%eax
676: 83 ec 04 sub $0x4,%esp
679: 6a 01 push $0x1
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
67b: 83 c3 01 add $0x1,%ebx
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
67e: 50 push %eax
67f: 57 push %edi
680: e8 7d fd ff ff call 402 <write>
} else if(c == 's'){
s = (char*)*ap;
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
685: 0f b6 03 movzbl (%ebx),%eax
688: 83 c4 10 add $0x10,%esp
68b: 84 c0 test %al,%al
68d: 75 e1 jne 670 <printf+0x130>
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
68f: 31 d2 xor %edx,%edx
691: e9 ff fe ff ff jmp 595 <printf+0x55>
696: 8d 76 00 lea 0x0(%esi),%esi
699: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
6a0: 83 ec 04 sub $0x4,%esp
6a3: 88 5d e5 mov %bl,-0x1b(%ebp)
6a6: 8d 45 e5 lea -0x1b(%ebp),%eax
6a9: 6a 01 push $0x1
6ab: e9 4c ff ff ff jmp 5fc <printf+0xbc>
} else {
putc(fd, c);
}
} else if(state == '%'){
if(c == 'd'){
printint(fd, *ap, 10, 1);
6b0: 83 ec 0c sub $0xc,%esp
6b3: b9 0a 00 00 00 mov $0xa,%ecx
6b8: 6a 01 push $0x1
6ba: e9 6b ff ff ff jmp 62a <printf+0xea>
6bf: 8b 5d d0 mov -0x30(%ebp),%ebx
#include "user.h"
static void
putc(int fd, char c)
{
write(fd, &c, 1);
6c2: 83 ec 04 sub $0x4,%esp
6c5: 8b 03 mov (%ebx),%eax
6c7: 6a 01 push $0x1
6c9: 88 45 e4 mov %al,-0x1c(%ebp)
6cc: 8d 45 e4 lea -0x1c(%ebp),%eax
6cf: 50 push %eax
6d0: 57 push %edi
6d1: e8 2c fd ff ff call 402 <write>
6d6: e9 5b ff ff ff jmp 636 <printf+0xf6>
6db: 66 90 xchg %ax,%ax
6dd: 66 90 xchg %ax,%ax
6df: 90 nop
000006e0 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
6e0: 55 push %ebp
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
6e1: a1 80 0b 00 00 mov 0xb80,%eax
static Header base;
static Header *freep;
void
free(void *ap)
{
6e6: 89 e5 mov %esp,%ebp
6e8: 57 push %edi
6e9: 56 push %esi
6ea: 53 push %ebx
6eb: 8b 5d 08 mov 0x8(%ebp),%ebx
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
6ee: 8b 10 mov (%eax),%edx
void
free(void *ap)
{
Header *bp, *p;
bp = (Header*)ap - 1;
6f0: 8d 4b f8 lea -0x8(%ebx),%ecx
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
6f3: 39 c8 cmp %ecx,%eax
6f5: 73 19 jae 710 <free+0x30>
6f7: 89 f6 mov %esi,%esi
6f9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
700: 39 d1 cmp %edx,%ecx
702: 72 1c jb 720 <free+0x40>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
704: 39 d0 cmp %edx,%eax
706: 73 18 jae 720 <free+0x40>
static Header base;
static Header *freep;
void
free(void *ap)
{
708: 89 d0 mov %edx,%eax
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
70a: 39 c8 cmp %ecx,%eax
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
70c: 8b 10 mov (%eax),%edx
free(void *ap)
{
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
70e: 72 f0 jb 700 <free+0x20>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
710: 39 d0 cmp %edx,%eax
712: 72 f4 jb 708 <free+0x28>
714: 39 d1 cmp %edx,%ecx
716: 73 f0 jae 708 <free+0x28>
718: 90 nop
719: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
break;
if(bp + bp->s.size == p->s.ptr){
720: 8b 73 fc mov -0x4(%ebx),%esi
723: 8d 3c f1 lea (%ecx,%esi,8),%edi
726: 39 d7 cmp %edx,%edi
728: 74 19 je 743 <free+0x63>
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
72a: 89 53 f8 mov %edx,-0x8(%ebx)
if(p + p->s.size == bp){
72d: 8b 50 04 mov 0x4(%eax),%edx
730: 8d 34 d0 lea (%eax,%edx,8),%esi
733: 39 f1 cmp %esi,%ecx
735: 74 23 je 75a <free+0x7a>
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
737: 89 08 mov %ecx,(%eax)
freep = p;
739: a3 80 0b 00 00 mov %eax,0xb80
}
73e: 5b pop %ebx
73f: 5e pop %esi
740: 5f pop %edi
741: 5d pop %ebp
742: c3 ret
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
bp->s.size += p->s.ptr->s.size;
743: 03 72 04 add 0x4(%edx),%esi
746: 89 73 fc mov %esi,-0x4(%ebx)
bp->s.ptr = p->s.ptr->s.ptr;
749: 8b 10 mov (%eax),%edx
74b: 8b 12 mov (%edx),%edx
74d: 89 53 f8 mov %edx,-0x8(%ebx)
} else
bp->s.ptr = p->s.ptr;
if(p + p->s.size == bp){
750: 8b 50 04 mov 0x4(%eax),%edx
753: 8d 34 d0 lea (%eax,%edx,8),%esi
756: 39 f1 cmp %esi,%ecx
758: 75 dd jne 737 <free+0x57>
p->s.size += bp->s.size;
75a: 03 53 fc add -0x4(%ebx),%edx
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
freep = p;
75d: a3 80 0b 00 00 mov %eax,0xb80
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
if(p + p->s.size == bp){
p->s.size += bp->s.size;
762: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
765: 8b 53 f8 mov -0x8(%ebx),%edx
768: 89 10 mov %edx,(%eax)
} else
p->s.ptr = bp;
freep = p;
}
76a: 5b pop %ebx
76b: 5e pop %esi
76c: 5f pop %edi
76d: 5d pop %ebp
76e: c3 ret
76f: 90 nop
00000770 <malloc>:
return freep;
}
void*
malloc(uint nbytes)
{
770: 55 push %ebp
771: 89 e5 mov %esp,%ebp
773: 57 push %edi
774: 56 push %esi
775: 53 push %ebx
776: 83 ec 0c sub $0xc,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
779: 8b 45 08 mov 0x8(%ebp),%eax
if((prevp = freep) == 0){
77c: 8b 15 80 0b 00 00 mov 0xb80,%edx
malloc(uint nbytes)
{
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
782: 8d 78 07 lea 0x7(%eax),%edi
785: c1 ef 03 shr $0x3,%edi
788: 83 c7 01 add $0x1,%edi
if((prevp = freep) == 0){
78b: 85 d2 test %edx,%edx
78d: 0f 84 a3 00 00 00 je 836 <malloc+0xc6>
793: 8b 02 mov (%edx),%eax
795: 8b 48 04 mov 0x4(%eax),%ecx
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
if(p->s.size >= nunits){
798: 39 cf cmp %ecx,%edi
79a: 76 74 jbe 810 <malloc+0xa0>
79c: 81 ff 00 10 00 00 cmp $0x1000,%edi
7a2: be 00 10 00 00 mov $0x1000,%esi
7a7: 8d 1c fd 00 00 00 00 lea 0x0(,%edi,8),%ebx
7ae: 0f 43 f7 cmovae %edi,%esi
7b1: ba 00 80 00 00 mov $0x8000,%edx
7b6: 81 ff ff 0f 00 00 cmp $0xfff,%edi
7bc: 0f 46 da cmovbe %edx,%ebx
7bf: eb 10 jmp 7d1 <malloc+0x61>
7c1: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
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){
7c8: 8b 02 mov (%edx),%eax
if(p->s.size >= nunits){
7ca: 8b 48 04 mov 0x4(%eax),%ecx
7cd: 39 cf cmp %ecx,%edi
7cf: 76 3f jbe 810 <malloc+0xa0>
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
7d1: 39 05 80 0b 00 00 cmp %eax,0xb80
7d7: 89 c2 mov %eax,%edx
7d9: 75 ed jne 7c8 <malloc+0x58>
char *p;
Header *hp;
if(nu < 4096)
nu = 4096;
p = sbrk(nu * sizeof(Header));
7db: 83 ec 0c sub $0xc,%esp
7de: 53 push %ebx
7df: e8 86 fc ff ff call 46a <sbrk>
if(p == (char*)-1)
7e4: 83 c4 10 add $0x10,%esp
7e7: 83 f8 ff cmp $0xffffffff,%eax
7ea: 74 1c je 808 <malloc+0x98>
return 0;
hp = (Header*)p;
hp->s.size = nu;
7ec: 89 70 04 mov %esi,0x4(%eax)
free((void*)(hp + 1));
7ef: 83 ec 0c sub $0xc,%esp
7f2: 83 c0 08 add $0x8,%eax
7f5: 50 push %eax
7f6: e8 e5 fe ff ff call 6e0 <free>
return freep;
7fb: 8b 15 80 0b 00 00 mov 0xb80,%edx
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
if((p = morecore(nunits)) == 0)
801: 83 c4 10 add $0x10,%esp
804: 85 d2 test %edx,%edx
806: 75 c0 jne 7c8 <malloc+0x58>
return 0;
808: 31 c0 xor %eax,%eax
80a: eb 1c jmp 828 <malloc+0xb8>
80c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
if(p->s.size >= nunits){
if(p->s.size == nunits)
810: 39 cf cmp %ecx,%edi
812: 74 1c je 830 <malloc+0xc0>
prevp->s.ptr = p->s.ptr;
else {
p->s.size -= nunits;
814: 29 f9 sub %edi,%ecx
816: 89 48 04 mov %ecx,0x4(%eax)
p += p->s.size;
819: 8d 04 c8 lea (%eax,%ecx,8),%eax
p->s.size = nunits;
81c: 89 78 04 mov %edi,0x4(%eax)
}
freep = prevp;
81f: 89 15 80 0b 00 00 mov %edx,0xb80
return (void*)(p + 1);
825: 83 c0 08 add $0x8,%eax
}
if(p == freep)
if((p = morecore(nunits)) == 0)
return 0;
}
}
828: 8d 65 f4 lea -0xc(%ebp),%esp
82b: 5b pop %ebx
82c: 5e pop %esi
82d: 5f pop %edi
82e: 5d pop %ebp
82f: c3 ret
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
if(p->s.size >= nunits){
if(p->s.size == nunits)
prevp->s.ptr = p->s.ptr;
830: 8b 08 mov (%eax),%ecx
832: 89 0a mov %ecx,(%edx)
834: eb e9 jmp 81f <malloc+0xaf>
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
if((prevp = freep) == 0){
base.s.ptr = freep = prevp = &base;
836: c7 05 80 0b 00 00 84 movl $0xb84,0xb80
83d: 0b 00 00
840: c7 05 84 0b 00 00 84 movl $0xb84,0xb84
847: 0b 00 00
base.s.size = 0;
84a: b8 84 0b 00 00 mov $0xb84,%eax
84f: c7 05 88 0b 00 00 00 movl $0x0,0xb88
856: 00 00 00
859: e9 3e ff ff ff jmp 79c <malloc+0x2c>
| 30.612293 | 67 | 0.411209 |
2bf89d13014dcdf7d0ce77be46ca7fc8a82142aa | 740 | asm | Assembly | oeis/055/A055779.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/055/A055779.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/055/A055779.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A055779: Number of fat trees on n labeled vertices.
; Submitted by Christian Krause
; 1,2,10,89,1156,19897,428002,11067457,334667368,11593751921,452892057454,19699549177585,944416040000044,49480473036710185,2812998429218735986,172475808692526176513,11345688093224067380176,797061449235413571104737,59561550009489127251893590,4717456190161796770946771761,394765592493160399700290015636,34803568687024173685914448094297,3224377474150276176813891751516954,313180196566061686100446602043006273,31823503410989668107475493551420646776,3376483900501134003640117024477080223057
mov $4,$0
add $4,1
lpb $0
sub $0,1
mov $2,$4
sub $2,$1
pow $2,$1
mov $3,$4
bin $3,$1
add $1,1
mul $3,$2
mul $5,$4
add $5,$3
lpe
mov $0,$5
add $0,1
| 35.238095 | 485 | 0.813514 |
29ae2c85af6f2125841f79b9c9c632fcb60f0e5a | 2,903 | asm | Assembly | projects/08/FunctionCalls/NestedCall/NestedCall.asm | ITFS777/n2t | 5e794244d83c0b31fd172c183b6101dff466d0ee | [
"MIT"
] | null | null | null | projects/08/FunctionCalls/NestedCall/NestedCall.asm | ITFS777/n2t | 5e794244d83c0b31fd172c183b6101dff466d0ee | [
"MIT"
] | null | null | null | projects/08/FunctionCalls/NestedCall/NestedCall.asm | ITFS777/n2t | 5e794244d83c0b31fd172c183b6101dff466d0ee | [
"MIT"
] | null | null | null | @256
D=A
@SP
M=D
@MAIN
0;JMP
(PUSH_TRUE)
@SP
A=M
M=0
M=M-1
@SP
M=M+1
@LCL
A=M
0;JMP
(MAIN)
(Sys.init)
@4000
D=A
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
A=M
D=M
@3
M=D
@5000
D=A
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
A=M
D=M
@4
M=D
@Sys.call0
D=A
@SP
A=M
M=D
@SP
M=M+1
@LCL
D=M
@SP
A=M
M=D
@SP
M=M+1
@ARG
D=M
@SP
A=M
M=D
@SP
M=M+1
@THIS
D=M
@SP
A=M
M=D
@SP
M=M+1
@THAT
D=M
@SP
A=M
M=D
@SP
M=M+1
@5
D=A
@SP
D=M-D
@ARG
M=D
@SP
D=M
@LCL
M=D
@Sys.main
0;JMP
(Sys.call0)
@SP
M=M-1
A=M
D=M
@5
A=A+1
M=D
(LOOP)
@LOOP
0;JMP
(Sys.main)
@0
D=A
@SP
A=M
M=D
@SP
M=M+1
@0
D=A
@SP
A=M
M=D
@SP
M=M+1
@0
D=A
@SP
A=M
M=D
@SP
M=M+1
@0
D=A
@SP
A=M
M=D
@SP
M=M+1
@0
D=A
@SP
A=M
M=D
@SP
M=M+1
@4001
D=A
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
A=M
D=M
@3
M=D
@5001
D=A
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
A=M
D=M
@4
M=D
@200
D=A
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
A=M
D=M
@LCL
A=M
A=A+1
M=D
@40
D=A
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
A=M
D=M
@LCL
A=M
A=A+1
A=A+1
M=D
@6
D=A
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
A=M
D=M
@LCL
A=M
A=A+1
A=A+1
A=A+1
M=D
@123
D=A
@SP
A=M
M=D
@SP
M=M+1
@Sys.call1
D=A
@SP
A=M
M=D
@SP
M=M+1
@LCL
D=M
@SP
A=M
M=D
@SP
M=M+1
@ARG
D=M
@SP
A=M
M=D
@SP
M=M+1
@THIS
D=M
@SP
A=M
M=D
@SP
M=M+1
@THAT
D=M
@SP
A=M
M=D
@SP
M=M+1
@6
D=A
@SP
D=M-D
@ARG
M=D
@SP
D=M
@LCL
M=D
@Sys.add12
0;JMP
(Sys.call1)
@SP
M=M-1
A=M
D=M
@5
M=D
@LCL
D=M
@0
A=A+D
D=M
@SP
A=M
M=D
@SP
M=M+1
@LCL
D=M
@1
A=A+D
D=M
@SP
A=M
M=D
@SP
M=M+1
@LCL
D=M
@2
A=A+D
D=M
@SP
A=M
M=D
@SP
M=M+1
@LCL
D=M
@3
A=A+D
D=M
@SP
A=M
M=D
@SP
M=M+1
@LCL
D=M
@4
A=A+D
D=M
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
A=M
D=M
@SP
M=M-1
A=M
M=M+D
@SP
M=M+1
@SP
M=M-1
A=M
D=M
@SP
M=M-1
A=M
M=M+D
@SP
M=M+1
@SP
M=M-1
A=M
D=M
@SP
M=M-1
A=M
M=M+D
@SP
M=M+1
@SP
M=M-1
A=M
D=M
@SP
M=M-1
A=M
M=M+D
@SP
M=M+1
@LCL
D=M
@R13
M=D
@5
A=D-A
D=M
@R14
M=D
@SP
M=M-1
A=M
D=M
@ARG
A=M
M=D
@ARG
D=M+1
@SP
M=D
@R13
A=M-1
D=M
@THAT
M=D
@R13
D=M
@2
A=D-A
D=M
@THIS
M=D
@R13
D=M
@3
A=D-A
D=M
@ARG
M=D
@R13
D=M
@4
A=D-A
D=M
@LCL
M=D
@R14
A=M
0;JMP
(Sys.add12)
@4002
D=A
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
A=M
D=M
@3
M=D
@5002
D=A
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
A=M
D=M
@4
M=D
@ARG
D=M
@0
A=A+D
D=M
@SP
A=M
M=D
@SP
M=M+1
@12
D=A
@SP
A=M
M=D
@SP
M=M+1
@SP
M=M-1
A=M
D=M
@SP
M=M-1
A=M
M=M+D
@SP
M=M+1
@LCL
D=M
@R13
M=D
@5
A=D-A
D=M
@R14
M=D
@SP
M=M-1
A=M
D=M
@ARG
A=M
M=D
@ARG
D=M+1
@SP
M=D
@R13
A=M-1
D=M
@THAT
M=D
@R13
D=M
@2
A=D-A
D=M
@THIS
M=D
@R13
D=M
@3
A=D-A
D=M
@ARG
M=D
@R13
D=M
@4
A=D-A
D=M
@LCL
M=D
@R14
A=M
0;JMP
| 5.625969 | 12 | 0.429556 |
c4274fdc3ac157368dfb1945635a6bacf84dd44f | 483 | asm | Assembly | programs/oeis/087/A087432.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/087/A087432.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/087/A087432.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A087432: Expansion of 1+x*(1-x-4*x^2)/((1+x)*(1-2*x)*(1-3*x)).
; 1,1,3,7,19,51,143,407,1179,3451,10183,30207,89939,268451,802623,2402407,7196299,21567051,64657463,193885007,581480259,1744091251,5231574703,15693326007,47077181819,141225953051,423666674343,1270977653407,3812888220979,11438575184451,34315546596383,102946281875207,308838129797739,926512957737451,2779536009900823,8338602303079407
cal $0,94374 ; a(n) = (3^n-1)/2 + 2^n.
div $0,2
mov $1,$0
div $1,3
mul $1,2
add $1,1
| 48.3 | 331 | 0.763975 |
f43d7bf06e2235dad9304be28874340608de9230 | 209 | asm | Assembly | programs/oeis/005/A005095.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/005/A005095.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/005/A005095.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A005095: a(n) = n! + n.
; 1,2,4,9,28,125,726,5047,40328,362889,3628810,39916811,479001612,6227020813,87178291214,1307674368015,20922789888016,355687428096017,6402373705728018
mov $1,$0
cal $1,142
add $1,$0
| 29.857143 | 150 | 0.755981 |
9c5b26eb83dd25067849180872aeffeeb9094bfd | 714 | asm | Assembly | data/pokemon/base_stats/omastar.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | 1 | 2022-02-15T00:19:44.000Z | 2022-02-15T00:19:44.000Z | data/pokemon/base_stats/omastar.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | null | null | null | data/pokemon/base_stats/omastar.asm | opiter09/ASM-Machina | 75d8e457b3e82cc7a99b8e70ada643ab02863ada | [
"CC0-1.0"
] | null | null | null | db DEX_OMASTAR ; pokedex id
db 70, 60, 125, 55, 115
; hp atk def spd spc
db ROCK, WATER ; type
db 45 ; catch rate
db 199 ; base exp
INCBIN "gfx/pokemon/front/omastar.pic", 0, 1 ; sprite dimensions
dw OmastarPicFront, OmastarPicBack
db BUBBLE, HARDEN, FIRE_SPIN, NO_MOVE ; level 1 learnset
db GROWTH_MEDIUM_FAST ; growth rate
; tm/hm learnset
tmhm TOXIC, COUNTER, BODY_SLAM, TAKE_DOWN, DOUBLE_EDGE, \
BUBBLEBEAM, WATER_GUN, ICE_BEAM, BLIZZARD, HYPER_BEAM, \
SUBMISSION, SEISMIC_TOSS, RAGE, MIMIC, DOUBLE_TEAM, \
REFLECT, BIDE, SKULL_BASH, REST, SUBSTITUTE, \
SURF
; end
db 0 ; padding
| 28.56 | 77 | 0.616246 |
e6dd1c837c30791f6c4e23374452b0a1245564cf | 385 | asm | Assembly | programs/oeis/049/A049563.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/049/A049563.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/049/A049563.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A049563: a(n) = ((prime(n)-1)! + 1) mod (prime(n) + 2).
; 2,3,4,1,7,1,10,1,1,16,1,1,22,1,1,1,31,1,1,37,1,1,1,1,1,52,1,55,1,1,1,1,70,1,76,1,1,1,1,1,91,1,97,1,100,1,1,1,115,1,1,121,1,1,1,1,136,1,1,142,1,1,1,157,1,1,1,1,175,1,1,1,1,1,1,1,1,1,1,1,211,1,217,1,1,1,1,1
seq $0,6005 ; The odd prime numbers together with 1.
add $0,1
seq $0,166260 ; a(n) = A089026(n) - 1.
div $0,2
add $0,1
| 42.777778 | 206 | 0.568831 |
52c2e2cb83b8b47341babcf361e93e8c8728ba3b | 12,684 | asm | Assembly | Library/GrObj/Body/bodySortableArray.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/GrObj/Body/bodySortableArray.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/GrObj/Body/bodySortableArray.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1989 -- All Rights Reserved
PROJECT: PC GEOS
MODULE:
FILE: graphicBodySelectionList
AUTHOR: Jon Witort, Nov 19, 1991
ROUTINES:
Name Description
---- -----------
METHOD HANDLERS
Name Description
---- -----------
GrObjBodyCreateSortableArray Allocates a sortable array
GrObjBodyDestroySortableArray Frees a sortable array
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jon 19 Nov 1991 Initial revision
DESCRIPTION:
$Id: bodySortableArray.asm,v 1.1 97/04/04 18:07:59 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjObscureExtNonInteractiveCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyCreateSortableArray
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Description: GrObjBody method for MSG_GRAPHIC_BODY_CREATE_SORTABLE_ARRAY
Allocates a block for a sortable selected array, and changes
the graphic body's instance data to point to it. The original
array's descriptor is stored in the new array's header.
Pass: *ds:si = graphic body
Return: nothing
Destroyed: nothing
Comments:
Revision History:
Name Date Description
---- ------------ -----------
jon Nov 18, 1991 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyCreateSortableArray method GrObjBodyClass, MSG_GB_CREATE_SORTABLE_ARRAY
uses ax,bx,cx,dx,di,es
.enter
push ds, si ;save graphic body
call GrObjBodySelectionArrayLock
EC < ERROR_C GROBJ_BODY_SELECTION_ARRAY_NOT_FOUND >
push bx ;save selected array handle
; Allocate a chunk array to keep track of selected objects. We'll
; allocate enough so that we won't need to realloc.
;
; size = (n elements) * (size element) + chunk array header size
; + lmem block header size + fudge factor
;
call ChunkArrayGetCount
mov ax, size SortableArrayElement
mul cx
add ax, size SortableArrayHeader + size LMemBlockHeader + 16
mov cx, ALLOC_DYNAMIC_NO_ERR or (mask HAF_LOCK shl 8)
call MemAlloc
push bx ;save new mem handle
push ds, si ;save selected array chunk
mov ds, ax ;ax <- new block segment
mov cx, 4 ;4 initial handles?
mov ax, LMEM_TYPE_GENERAL
mov dx, size LMemBlockHeader
mov si, size SortableArrayHeader ;make room for header
clr di ;no lmem flags
call LMemInitHeap
mov al, mask OCF_IGNORE_DIRTY ;is this right?
mov bx, size SortableArrayElement ;element size
mov cx, size SortableArrayHeader
clr si
call ChunkArrayCreate
; Save a pointer to the original array in our new array
;
mov di, ds:[si]
segmov es, ds
pop ds, ax ;*ds:ax <- selected array
mov bx, ds:[LMBH_handle]
mov es:[di].SAH_originalArray.chunk, ax
mov es:[di].SAH_originalArray.segment, bx
; Unlock the new array
;
pop bx ;bx <- new array handle
call MemUnlock
mov_tr ax, bx ;ax <- new array handle
; Unlock the original array
;
pop bx ;bx <- original array handle
call MemUnlock
; Point the GB's instance data to our new sortable array
;
mov dx, si ;dx <- new array chunk
pop ds, si ;*ds:si <- graphic body
mov di, ds:[si]
add di, ds:[di].GrObjBody_offset
mov ds:[di].GBI_selectionArray.handle, ax
mov ds:[di].GBI_selectionArray.chunk, dx
.leave
ret
GrObjBodyCreateSortableArray endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyDestroySortableArray
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Description: GrObjBody method for MSG_GRAPHIC_BODY_DESTROY_SORTABLE_ARRAY
Frees the block previously allocated for a sortable selected
array, (in handler for MSG_GB_CREATE_SORTABLE_ARRAY) and
changes the graphic body's instance data to point back to the
original array.
Pass: *ds:si = graphic body
Return: nothing
Destroyed: nothing
Comments:
Revision History:
Name Date Description
---- ------------ -----------
jon Nov 18, 1991 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyDestroySortableArray method GrObjBodyClass, MSG_GB_DESTROY_SORTABLE_ARRAY
uses ax,bx,di,si,es
.enter
; Lock the sortable array
;
push ds, si ;save graphic body ptr
call GrObjBodySelectionArrayLock
EC < ERROR_C GROBJ_BODY_SELECTION_ARRAY_NOT_FOUND >
; Copy the original array into the graphic body's instance data
;
segmov es, ds
mov di, ds:[si] ;es:di <- sortable array
pop ds, si ;*ds:si <- graphic body
mov si, ds:[si]
add si, ds:[si].GrObjBody_offset ;ds:si <- graphic body
mov ax, es:[di].SAH_originalArray.handle
mov ds:[si].GBI_selectionArray.handle, ax
mov ax, es:[di].SAH_originalArray.chunk
mov ds:[si].GBI_selectionArray.chunk, ax
; Free the sortable array
;
call MemFree
.leave
ret
GrObjBodyDestroySortableArray endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodyFillSortableArray
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Description: GrObjBody method for MSG_GB_FILL_SORTABLE_ARRAY_USING_GO_DWF_BOUNDS
Fills the Sortable array from the original array contained in
its header. The sortable array element is the OD from the
original element, plus a DWFixed key from the object specified
by the OD. The caller passes an offset into RectDWFixed to
specify which parameter from the object's bounds is to be
the key.
Pass: *ds:si = graphic body
dx = offset into RectDWFixed (e.g., if the array is to be
sorted by vertical position, dx = offset RDWF_top)
Return: nothing
Destroyed: nothing
Comments:
Revision History:
Name Date Description
---- ------------ -----------
jon Nov 18, 1991 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodyFillSortableArrayUsingODWFBounds method GrObjBodyClass, MSG_GB_FILL_SORTABLE_ARRAY_USING_GO_DWF_BOUNDS
uses cx
.enter
mov cx, MSG_GO_GET_DWF_PARENT_BOUNDS
call GrObjBodyFillSortableArrayCommon
.leave
ret
GrObjBodyFillSortableArrayUsingODWFBounds endm
GrObjBodyFillSortableArrayUsingOCenters method GrObjBodyClass, MSG_GB_FILL_SORTABLE_ARRAY_USING_GO_CENTERS
uses cx
.enter
mov cx, MSG_GO_GET_CENTER
call GrObjBodyFillSortableArrayCommon
.leave
ret
GrObjBodyFillSortableArrayUsingOCenters endm
GrObjBodyFillSortableArrayCommon proc near
uses ax,bx,cx,dx,di,si,es,ds
; This is the RectDWFixed that the object's wil use to return
; their bounds
;
utilRect local RectDWFixed
.enter
; Lock the sortable array
;
call GrObjBodySelectionArrayLock
EC < ERROR_C GROBJ_BODY_SELECTION_ARRAY_NOT_FOUND >
push bx ;save sortable handle
segmov es, ds, ax ;es <- sortable segment
mov di, si ;*es:si <- sortable array
; Lock the original array
;
mov si, ds:[si]
mov bx, ds:[si].SAH_originalArray.handle
mov si, ds:[si].SAH_originalArray.chunk
call MemLock
mov ds, ax ;ds <- original array segment
mov_tr ax, di ;*es:ax <- sortable array
push bx ;save original array handle
; Enumerate the objects in the original array, telling each to
; add themselves to the sortable array
;
mov bx, cs
mov di, offset FillArrayCB
push bp ;save local ptr
lea bp, ss:utilRect
call ChunkArrayEnum
pop bp ;bp <- local ptr
; Unlock the original array
;
pop bx ;bx <- original array handle
call MemUnlock
; Unlock the sortable array
;
pop bx
call MemUnlock
.leave
ret
GrObjBodyFillSortableArrayCommon endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FillArrayCB
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Description: Copy the OD of the OD array element into a new sortable array
element, along with one of the object's DWF bounds.
Pass: ds:di = OD array element
*ds:si = OD chunk array
*es:ax = sortable array
ss:bp = RectDWFixed or PointDWFixed
dx = offset into RectDWFixed to the PointDWFixed to copy into
the sortable array
cx = message to send to object
Return: nothing
Destroyed: bx, si, di
Comments:
Revision History:
Name Date Description
---- ------------ -----------
jon Nov 19, 1991 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
FillArrayCB proc far
uses ax, ds
.enter
push ax ;save sortable array chunk
; Get the object's bounds
;
mov bx, ds:[di].handle
mov si, ds:[di].chunk
mov ax, cx ;ax <- message
mov di, mask MF_FIXUP_DS or mask MF_FIXUP_ES or mask MF_CALL
call ObjMessage
; Append a new entry to the sortable array
;
segmov ds, es, ax ;ds <- sortable array segment
pop ax ;*ds:ax <- sortable array
xchg ax, si ;*ds:si <- sortable array,
;ax <- object chunk
call ChunkArrayAppend
; Store the OD in the new element
;
mov ds:[di].SAE_OD.handle, bx
mov ds:[di].SAE_OD.chunk, ax
; Store the DWFixed key from the object's bounds
;
add bp, dx ;ss:bp <- DWF of interest
MovDWF ds:[di].SAE_key, ss:[bp], ax
sub bp, dx ;ss:bp <- RectDWFixed
.leave
ret
FillArrayCB endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrObjBodySortSortableArray
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Description: GrObjBody method for MSG_GB_SORT_SORTABLE_ARRAY
Sort the sortable array based on each element's key.
Pass: *ds:si = graphic body instance
Return: nothing
Destroyed: nothing
Comments:
Revision History:
Name Date Description
---- ------------ -----------
jon Nov 18, 1991 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrObjBodySortSortableArray method GrObjBodyClass, MSG_GB_SORT_SORTABLE_ARRAY
uses cx, dx, ds, si
.enter
; Lock the sortable array
;
call GrObjBodySelectionArrayLock
EC < ERROR_C GROBJ_BODY_SELECTION_ARRAY_NOT_FOUND >
; Sort the array
;
mov cx, SEGMENT_CS
mov dx, offset SortableArrayElementCompare
call ChunkArraySort
; Unlock the array
;
call MemUnlock
.leave
ret
GrObjBodySortSortableArray endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SortableArrayElementCompare
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Description: Compares two SortableArrayElements, setting the flags as though
a signed comparison were made between their keys.
Pass: ds:si = first SortableArrayElement
es:di = second SortableArrayElement
Return: flags set so that jl, je, jg would "do the right thing"
if SAE #1 were less than, equal to, or greater than SAE #2,
respectively
Destroyed: nothing
Comments:
Revision History:
Name Date Description
---- ------------ -----------
jon Nov 19, 1991 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SortableArrayElementCompare proc far
uses ax
.enter
; compare the singed int.high's. If they're not equal,
; then the flags are set properly, and we can exit.
;
mov ax, ds:[si].SAE_key.DWF_int.high ;ax <- int.high
cmp ax, es:[di].SAE_key.DWF_int.high
jne done
; compare the unsigned int.low's. If they're equal, then
; we check the fractional parts. If they aren't equal, we
; have to effect an unsigned comparison before returning.
;
mov ax, ds:[si].SAE_key.DWF_int.low
cmp ax, es:[di].SAE_key.DWF_int.low
ja greaterThan
je checkFrac
; the first element is "less than" the second, so set the
; flags to mimic a less-than signed comparison
;
lessThan:
mov al, -1
cmp al, 0
done:
.leave
ret
; Check the unsigned fractional portions of the DWFixed's. If
; they're equal, return. If not, check the sign of the number's
; to see which side of the origin we're on, which determine's
; whether a bigger fraction means a bigger or small (bigger
; negative) number.
;
checkFrac:
mov ax, ds:[si].SAE_key.DWF_frac
cmp ax, es:[di].SAE_key.DWF_frac
je done
jb lessThan
greaterThan:
mov al, 1
cmp al, 0
jmp done
SortableArrayElementCompare endp
GrObjObscureExtNonInteractiveCode ends
| 25.728195 | 112 | 0.615815 |
0a96680eaf419f64cc2b5f253b2d4a0190be7336 | 59 | asm | Assembly | audio/sfx/snare6_2.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | 16 | 2018-08-28T21:47:01.000Z | 2022-02-20T20:29:59.000Z | audio/sfx/snare6_2.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | 5 | 2019-04-03T19:53:11.000Z | 2022-03-11T22:49:34.000Z | audio/sfx/snare6_2.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | 2 | 2019-12-09T19:46:02.000Z | 2020-12-05T21:36:30.000Z | SFX_Snare6_2_Ch1:
unknownnoise0x20 0, 129, 16
endchannel
| 14.75 | 28 | 0.813559 |
71a183a27ecd24c9b485f7415da7f2240072bf75 | 272 | asm | Assembly | pika/ASM_Emulator/helloworld.asm | Tiffanylqc/Compiler-Design | b0a638a84fb11f1facff94438d28fcf4394bd2b2 | [
"MIT"
] | null | null | null | pika/ASM_Emulator/helloworld.asm | Tiffanylqc/Compiler-Design | b0a638a84fb11f1facff94438d28fcf4394bd2b2 | [
"MIT"
] | null | null | null | pika/ASM_Emulator/helloworld.asm | Tiffanylqc/Compiler-Design | b0a638a84fb11f1facff94438d28fcf4394bd2b2 | [
"MIT"
] | 1 | 2020-06-26T12:36:57.000Z | 2020-06-26T12:36:57.000Z | DLabel Hello
DataC 72 // H
DataC 101 // e
DataC 108 // l
DataC 108 // l
DataC 111 // o
DataC 32 // <space>
DataC 119 // w
DataC 111 // o
DataC 114 // r
DataC 108 // l
DataC 100 // d
DataC 33 // !
DataC 0
PushD Hello
Printf
Halt
| 15.111111 | 22 | 0.533088 |
ee034514ae7d4e3db6e16cba11f8fe204614cfad | 2,131 | asm | Assembly | Linux/removedir.asm | EgeBalci/Shellcode | 2475af53b20186283b3eb1572d4de58650ad4652 | [
"MIT"
] | 2 | 2017-04-11T21:58:34.000Z | 2020-05-18T02:04:41.000Z | Linux/removedir.asm | EgeBalci/Shellcode | 2475af53b20186283b3eb1572d4de58650ad4652 | [
"MIT"
] | null | null | null | Linux/removedir.asm | EgeBalci/Shellcode | 2475af53b20186283b3eb1572d4de58650ad4652 | [
"MIT"
] | 4 | 2017-04-11T21:58:35.000Z | 2021-05-14T04:53:15.000Z | Linux/x86 Force-rmdir
--- WE ARE BOMBERMANS ---
#Greetz : Bomberman(Leader)
#Author : B3mB4m
#Bomberman's owned this section BACK OFF !
/*Shellcode length depend file path.*/
#https://github.com/b3mb4m/Shellcode/blob/master/Auxiliary/convertstack.py
#Use my own stack converter that's will help you ;)
Disassembly of section .text:
08048060 <.text>:
8048060: 31 c0 xor %eax,%eax
8048062: 50 push %eax
8048063: 68 6e 2f 72 6d push $0x6d722f6e
8048068: 68 2f 2f 62 69 push $0x69622f2f
804806d: 89 e3 mov %esp,%ebx
804806f: 50 push %eax
8048070: 68 2d 72 66 76 push $0x7666722d
8048075: 89 e1 mov %esp,%ecx
8048077: 50 push %eax
8048078: 68 bc 2f 71 65 push $0x65712fbc
804807d: 68 bc 73 74 c3 push $0xc37473bc
8048082: 68 61 73 61 c3 push $0xc3617361 ;File path
8048087: 68 34 6d 2f 4d push $0x4d2f6d34 ;Change it with converstack.py
804808c: 68 62 33 6d 62 push $0x626d3362
8048091: 68 6f 6d 65 2f push $0x2f656d6f
8048096: 68 2f 2f 2f 68 push $0x682f2f2f
804809b: 89 e2 mov %esp,%edx
804809d: 50 push %eax
804809e: 52 push %edx
804809f: 51 push %ecx
80480a0: 53 push %ebx
80480a1: 89 e7 mov %esp,%edi
80480a3: b0 0b mov $0xb,%al
80480a5: 89 f9 mov %edi,%ecx
80480a7: 31 d2 xor %edx,%edx
80480a9: cd 80 int $0x80
#include <stdio.h>
#include <string.h>
char *shellcode = "\x31\xc0\x50\x68\x6e\x2f\x72\x6d\x68\x2f\x2f\x62"
"\x69\x89\xe3\x50\x68\x2d\x72\x66\x76\x89\xe1\x50\x68\xbc\x2f\x71\x65"
"\x68\xbc\x73\x74\xc3\x68\x61\x73\x61\xc3\x68\x34\x6d\x2f\x4d\x68\x62"
"\x33\x6d\x62\x68\x6f\x6d\x65\x2f\x68\x2f\x2f\x2f\x68\x89\xe2\x50\x52"
"\x51\x53\x89\xe7\xb0\x0b\x89\xf9\x31\xd2\xcd\x80";
int main(void){
fprintf(stdout,"Length: %d\n",strlen(shellcode));
(*(void(*)()) shellcode)();
}
| 34.370968 | 81 | 0.57297 |
be4d6fef4a6a4742dbe61daf9c4cba7daf224a46 | 2,900 | asm | Assembly | cs-basic/2-base64/base64encoder.asm | janlauber/bfh | 321581c68d4eb8de7713dc5101a3a2a0426381b0 | [
"MIT"
] | 5 | 2022-02-03T15:10:42.000Z | 2022-02-03T18:38:53.000Z | cs-basic/2-base64/base64encoder.asm | janlauber/bfh | 321581c68d4eb8de7713dc5101a3a2a0426381b0 | [
"MIT"
] | null | null | null | cs-basic/2-base64/base64encoder.asm | janlauber/bfh | 321581c68d4eb8de7713dc5101a3a2a0426381b0 | [
"MIT"
] | null | null | null | SECTION .data ; Section containing initialised data
Base64Characters: db "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
OutputStr: db " "
OutputStrLen: equ $-OutputStr
SECTION .bss ; Section containing uninitialized data
BufLen: equ 3
Buf: resb BufLen
SECTION .text ; Section containing code
global _start ; Linker needs this to find the entry point!
_start:
call read ; call read proc
cmp rax, 0 ; when input = 0 -> quit
je exit
cmp rax, 1 ; when input 1 byte -> jump encoding with 1 byte
je enc_chr1
cmp rax, 2 ; when input 2 byte -> jump encoding with 2 byte
je enc_chr2
cmp rax, 3 ; when input 3 byte -> jump encoding with 3 byte
je enc_chr3
enc_chr1:
xor rax, rax
mov al, byte [Buf]
call first_chr
and al, 0x03
shl al, 4
mov al, byte [Base64Characters+rax]
mov byte [OutputStr+1], al
mov al, 0x3d
mov byte [OutputStr+2], al
mov byte [OutputStr+3], al
call printEnc
jmp _start
enc_chr2:
xor rax, rax
xor rbx, rbx
mov al, byte [Buf]
mov bl, byte [Buf+1]
call first_chr
call second_chr
and bl, 0x0f
shl bl, 2
mov bl, byte [Base64Characters+rbx]
mov byte [OutputStr+2], bl
mov bl, 0x3d
mov byte [OutputStr+3], bl
call printEnc
jmp _start
enc_chr3:
xor rax, rax
xor rbx, rbx
xor rdx, rdx
mov al, byte [Buf]
mov bl, byte [Buf+1]
mov dl, byte [Buf+2]
call first_chr
call second_chr
call third_chr
and dl, 0x3f
mov dl, byte [Base64Characters+rdx]
mov byte [OutputStr+3], dl
call printEnc
jmp _start
first_chr:
push rax
and al, 0xfc
shr al, 2
mov al, byte [Base64Characters+rax]
mov byte [OutputStr], al
pop rax
ret
second_chr:
and al, 0x03
shl al, 4
push rbx
and bl, 0xf0
shr bl, 4
or al, bl
mov al, byte [Base64Characters+rax]
mov byte [OutputStr+1], al
pop rbx
ret
third_chr:
and bl, 0x0f
shl bl, 2
push rdx
and dl, 0xc0
shr dl, 6
or bl, dl
mov bl, byte [Base64Characters+rbx]
mov byte [OutputStr+2], bl
pop rdx
ret
exit:
mov rax, 60 ; exit
mov rdi, 0 ; on
syscall ; success
read:
mov rax, 0
mov rbx, 0
mov rdi, 0
mov rsi, Buf
mov rdx, BufLen
syscall
ret
printEnc:
mov rax, 1 ; sys_write
mov rdi, 1 ; stdout
mov rsi, OutputStr ; source buffer
mov rdx, OutputStrLen ; number of bytes to write
syscall
ret | 19.863014 | 97 | 0.542414 |
27b22f9fbb035a0cb69da8c3c0f71cf47b08ed62 | 647 | asm | Assembly | oeis/050/A050190.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/050/A050190.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/050/A050190.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A050190: T(n,5), array T as in A050186; a count of aperiodic binary words.
; Submitted by Jon Maiga
; 0,6,21,56,126,250,462,792,1287,2002,3000,4368,6188,8568,11628,15500,20349,26334,33649,42504,53125,65780,80730,98280,118755,142500,169911,201376,237336,278256,324625,376992,435897,501942,575757,658000,749398,850668,962598,1086008,1221750,1370754,1533939,1712304,1906884,2118750,2349060,2598960,2869685,3162510,3478750,3819816,4187106,4582116,5006386,5461500,5949147,6471002,7028847,7624512,8259875,8936928,9657648,10424128,11238513,12103000,13019909,13991544,15020334,16108764,17259375,18474840
add $0,5
mov $1,$0
bin $0,5
div $0,$1
mul $0,$1
| 64.7 | 495 | 0.805255 |
34490aa1db495fb33fd040eed8b0c36f75a9f799 | 249 | asm | Assembly | code/5/ex1.asm | GeekHades1/AssemblyCode | 4078d97d8e31093ff7b54b72869f77e340b98391 | [
"BSD-2-Clause"
] | 1 | 2018-07-11T12:35:45.000Z | 2018-07-11T12:35:45.000Z | code/5/ex1.asm | GeekHades1/AssemblyCode | 4078d97d8e31093ff7b54b72869f77e340b98391 | [
"BSD-2-Clause"
] | null | null | null | code/5/ex1.asm | GeekHades1/AssemblyCode | 4078d97d8e31093ff7b54b72869f77e340b98391 | [
"BSD-2-Clause"
] | null | null | null | ; 向内存 0:200-0:23f 依次传送数据0-3fh
assume cs:code
code segment
mov ax, 0020h
mov ds, ax
mov bx, 0 ; 清空累加器
mov cx, 3fh ; 循环次数
s: mov [bx], bx
inc bx
loop s
mov ax, 4c00h
int 21h
code ends
end
| 13.833333 | 36 | 0.518072 |
365d71a80c915396c5a4dca56668262eef12c90f | 1,831 | asm | Assembly | programs/oeis/083/A083705.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/083/A083705.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/083/A083705.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A083705: a(n) = 2*a(n-1) - 1 with a(0)=10.
; 10,19,37,73,145,289,577,1153,2305,4609,9217,18433,36865,73729,147457,294913,589825,1179649,2359297,4718593,9437185,18874369,37748737,75497473,150994945,301989889,603979777,1207959553,2415919105,4831838209,9663676417,19327352833,38654705665,77309411329,154618822657,309237645313,618475290625,1236950581249,2473901162497,4947802324993,9895604649985,19791209299969,39582418599937,79164837199873,158329674399745,316659348799489,633318697598977,1266637395197953,2533274790395905,5066549580791809,10133099161583617,20266198323167233,40532396646334465,81064793292668929,162129586585337857,324259173170675713,648518346341351425,1297036692682702849,2594073385365405697,5188146770730811393,10376293541461622785,20752587082923245569,41505174165846491137,83010348331692982273,166020696663385964545,332041393326771929089,664082786653543858177,1328165573307087716353,2656331146614175432705,5312662293228350865409,10625324586456701730817,21250649172913403461633,42501298345826806923265,85002596691653613846529,170005193383307227693057,340010386766614455386113,680020773533228910772225,1360041547066457821544449,2720083094132915643088897,5440166188265831286177793,10880332376531662572355585,21760664753063325144711169,43521329506126650289422337,87042659012253300578844673,174085318024506601157689345,348170636049013202315378689,696341272098026404630757377,1392682544196052809261514753,2785365088392105618523029505,5570730176784211237046059009,11141460353568422474092118017,22282920707136844948184236033,44565841414273689896368472065,89131682828547379792736944129,178263365657094759585473888257,356526731314189519170947776513,713053462628379038341895553025,1426106925256758076683791106049,2852213850513516153367582212097,5704427701027032306735164424193
mov $1,2
pow $1,$0
mul $1,9
add $1,1
mov $0,$1
| 203.444444 | 1,737 | 0.91917 |
cc9d7342a0d77473d6f96e87723e04551ce899eb | 10,093 | asm | Assembly | finalprogram.asm | AlliyahMunir/LC-3-Project | d01713007a980b806fb28b3656ed9a5aa2838324 | [
"Unlicense"
] | null | null | null | finalprogram.asm | AlliyahMunir/LC-3-Project | d01713007a980b806fb28b3656ed9a5aa2838324 | [
"Unlicense"
] | null | null | null | finalprogram.asm | AlliyahMunir/LC-3-Project | d01713007a980b806fb28b3656ed9a5aa2838324 | [
"Unlicense"
] | null | null | null | ;GROUP NAME: WE'RE ALL IN THIS TOGETHER
;GROUP MEMBERS: ALLIYAH MUNIR, ISAAC MARTINEZ, ARIANA NELSON, LISSETTE SERRATO
;PROJECT: IMPLEMENT BUBBLE SORT INTO A PROGRAM THAT OBTAINS 8 NUMBERS RANGING FROM
;0-100 AND SORTS THEM IN ASCENDING ORDER
.ORIG x3000
;begin by loading prompts
LEA R0, FIRSTPROMPT ;Load first prompt instructing user of what to input
PUTS ;Display prompt on console
AND R0, R0, x0 ;Clear R0 to initiate another prompt
LEA R0, SPACE ;SPACE allows "\n" to be used in seperating each inputted digit
PUTS ;Display prompt on console
AND R0, R0, x0 ;Clear R0 to initiate another prompt
LEA R0, SAMPLE ;Load example prompt to help user understand what to input
PUTS ;Display prompt on console
LD R3, POINTER ;Implement and load pointer in R3
LD R6, IOCOUNTER ;load R6 with User Interface(I/O) Counter
INPUT
;This manages first digit inputted
IN ;Input first digit
AND R2, R2, x0 ;Clear R2
AND R5, R5, x0 ;Clear R5
LD R5, PLACEHUNDRED ;Load value 100 to R5 to eventually counter
LD R2, HEXN48 ;R2 is loaded with negative offset
ADD R0, R0, R2 ;Add ASCII offset(negative) to inputted value(R0)
ADD R2, R0, x0 ;Move inputted value(R0) to R2
AND R0, R0, x0 ;Clear R0 since it will be used for next value
;Now we loop to obtain first digit from user
FIRST_NUM ;loop titled "FIRST_NUM" for first digit
ADD R0, R0, R2 ;first digit input value(R0) + 0
ADD R5, R5, x-1 ;decrement counter
BRp FIRST_NUM ;If positive, loop 100 times
ADD R1, R0, x0 ;R1 now contains first digit which was previously in R0
AND R0, R0, x0 ;Clear R0 since we are reusing it
;This manages second digit in input
IN ;Input second digit
AND R2, R2, x0 ;Clear R2
AND R5, R5, x0 ;Clear R5
LD R5, PLACETEN ;Load value 10 to R5 for countering
LD R2, HEXN48 ;R2 is loaded with negative offset
ADD R0, R0, R2 ;Add ASCII offset(negative) to input value(R0)
ADD R2, R0, x0 ;Move inputted value(R0) to R2
AND R0, R0, x0 ;Clear R0 since it will be used for next value
;Now we loop to obtain second digit from user
SECOND_NUM ;loop titled "SECOND_NUM" for second digit
ADD R0, R0, R2 ;second digit input value(R0) + 0
ADD R5, R5, x-1 ;decrement counter
BRp SECOND_NUM ;If positive, loop 10 times
ADD R4, R0, x0 ;R4 now contains second digit which was previously in R0
AND R0, R0, x0 ;Clear R0 since we are going to reuse it
;This manages third digit in input
IN ;Input third digit
AND R2, R2, x0 ;Clear R2
;We don't require R5 this time, due to no counter
LD R2, HEXN48 ;Load negative ASCII offset to R2
ADD R0, R0, R2 ;Add ASCII offset(negative) to input value(R0)
;Now the third digit is located in R0
AND R2, R2, x0 ;Clear R2 since we are going to reuse it
;Form the three seperately inputted values into one 3-digit number
ADD R2, R1, R4 ;R2 = First value (R1) + second value(R4)
ADD R2, R0, R2 ;R2 = (R1 + R2) + third value (R0)
STR R2, R3, x0 ;Store the 3-digit value in R2, in an array with pointer(R3)
ADD R3, R3, x1 ;Increase pointer value
ADD R6, R6, x-1 ;Decrease input loop(R6) by counter
BRp INPUT ;check condition by branching: If counter(R6) is positive, loop
JSR BUBBLESORT ;Jump to BUBBLESORT subroutine
JSR PRODUCTLOOP ;Jump to the final(output) subroutine
HALT ;HALT the program
BUBBLESORT ;sorting subroutine
;Reset pointer and counters to use for sorting loops
AND R3, R3, x0 ;Clear R3(pointer)
LD R3, POINTER ;reload register in pointer
AND R4, R4, x0 ;Clear R4(FINALOUT_LOOP COUNTER)
LD R4, IOCOUNTER ;Reload register in counter
AND R5, R5, x0 ;Clear R5(FINALIN_LOOP COUNTER)
LD R5, IOCOUNTER ;Reset counter value
FINALOUT_LOOP ;Outer loop used in array
ADD R4, R4, x-1 ;ensure loop runs 8 times, constantly decreasing by 1
BRz SORTED ;check condition by branching: If value begins with 0, it is sorted
ADD R5, R4, x0 ;Moving FINALOUT_LOOP COUNTER(R4) into FINALIN_LOOP COUNTER(R5)
LD R3, POINTER ;Reload register in pointer to start from beginning of array
FINALIN_LOOP ;Inner loop, runs through array once and sorts
LDR R0, R3, x0 ;Load first three digit number using pointer(R3), store to R0
LDR R1, R3, x1 ;Load second three digit number using pointer(R3), store to R1
AND R2, R2, x0 ;Clear R2 to reuse
NOT R2, R1 ;Two's compliment
ADD R2, R2, x1 ;NOT and AND make R2 become negative
ADD R2, R0, R2 ;R2 = first three digit number(R0) - (R2)second three digit number
BRn AUTOSWAP ;check condition by branching:swap if negative,meaning the first input is smaller than second
;Perform the swap
STR R1, R3, x0 ;Second 3 digit number, now stored before first 3 digit number
STR R0, R3, x1 ;First 3 digit number now after second 3 digit number
AUTOSWAP ;Swapping 3 digit numbers in ascending order
ADD R3, R3, x1 ;Increase pointer(R3) to view other 3 digit numbers
ADD R5, R5, x-1 ;Decreaase in counter loop
BRp FINALIN_LOOP ;Check condition by branching: If Positive, continue going through FINAL_IN loop
BRzp FINALOUT_LOOP ;check condition by branching:If Positive/Zero, go back to FINAL_OUT loop
SORTED RET ;one array is sorted, Return to calling program
RET ;else, Return to calling program
PRODUCTLOOP ;product(result) subroutine
LEA R0, PROMPTEXECUTE ;Load output prompt
PUTS ;Display prompt on console
LD R3, POINTER ;Reload Register with pointer
LD R6, IOCOUNTER ;Reload Register with counter
RESULTLOOP ;name of loop is RESULTLOOP
AND R1, R1, x0 ;Clear R1(previously:1st digit)
AND R2, R2, x0 ;Clear R2
AND R4, R4, x0 ;Clear R4(previously:2nd digit)
AND R5, R5, x0 ;Clear R5(previously:3rd digit)
AND R0, R0, x0 ;Clear R0
LD R0, SPACE ;Load "\n" for space and clean writing on console
OUT ;Display on console
AND R0, R0, x0 ;Clear R0
LDR R0, R3, x0 ;Load 3 digit inputted number using pointer (R3) value into R0
;Setup to divide by 100
LD R2, PLACEHUNDRED ;R2 = 100
NOT R2, R2 ;Two's complement
ADD R2, R2, x1 ;NOT and AND make R2 = -100
MINUS01 ;First loop subtracts 100 (since that is our largest input value)
ADD R1, R1, x1 ;fill R1 with value
ADD R0, R0, R2 ;R0 = Number(R0) + - 100(R2)
BRzp MINUS01 ;Once result is Positive/Zero, find the remainder
REMAINDER01 ;Find remainder and first digit
AND R2, R2, x0 ;Clear R2 since we are reusing
LD R2, PLACEHUNDRED ;Reload R2 = 100
ADD R0, R0, R2 ;Result + 100 = positive remainder
ADD R1, R1, x-1 ;Subtract one from counter with result of times subtracted
STI R1, FIRSTNUM ;R1 stored to FIRSTNUM
;Setup to divide by 10
AND R2, R2, x0 ;Clear R2
LD R2, PLACETEN ;load R2 = 10
NOT R2, R2 ;Two's complement
ADD R2, R2, x1 ;NOT and AND make R2 = -10
MINUS02 ;Second minus loop while dividing remainder by 10
ADD R4, R4, x1 ;Counter
ADD R0, R0, R2 ;R0 = Remainder(R0) + - 10(R2)
BRzp MINUS02 ;Once result is Positive/Zero, find the remainder
REMAINDER2 ;Find remainder, second digit, and third digit
AND R2, R2, x0 ;Clear R2 since reusing
LD R2, PLACETEN ;R2 = 10 since 2nd inputted number is in tenths place
ADD R5, R0, R2 ;R5 = (R0)Remainder + 10(R2)
STI R5, THIRDNUM ;store R5 in THIRDNUM, when R5 contains third digit
ADD R4, R4, x-1 ;number of times subtracted prior to positive result
STI R4, SECONDNUM ;Second digit now in R4, store to SECONDNUM
;Display first digit
AND R0, R0, x0 ;Clear R0
LDI R0, FIRSTNUM ;Load the first digit number to R0
AND R2, R2, x0 ;Clear R2
LD R2, HEX48 ;Load positive offset to R2
ADD R0, R0, R2 ;R0 = first digit (R0) + offset(R2)
OUT ;Display on console
;Display second digit
AND R0, R0, x0 ;Clear R0
LDI R0, SECONDNUM ;Load the second digit to R0
AND R2, R2, x0 ;Clear R2
LD R2, HEX48 ;Load positive offset to R2
ADD R0, R0, R2 ;R0 = second digit (R0) + offset(R2)
OUT ;Display on console
;Display third digit
AND R0, R0, x0 ;Clear R0
LDI R0, THIRDNUM ;Load the third digit to R0
AND R2, R2, x0 ;Clear R2
LD R2, HEX48 ;Load positive offset to R2
ADD R0, R0, R2 ;R0 = third digit (R0) + offset(R2)
OUT ;Display to console
ADD R3, R3, x1 ;Increment the pointer R3 (for balance from previous changes)
ADD R6, R6, x-1 ;Decrement the counter R6 (for balance from previous changes)
BRp RESULTLOOP ;Branch positive by continue looping If loop counter positive
HALT ;Pause program
;.FILL AND .STRINGZ BEFORE ENDING PROGRAM
FIRSTPROMPT .STRINGZ "Input 8 numbers ranging from 000 - 100 with 3 digits."
SAMPLE .STRINGZ "Ex: Input 15 as 015 or 5 as 005"
PROMPTEXECUTE .STRINGZ "Numbers in Ascending Order: "
SPACE .STRINGZ "\n"
HEXN48 .FILL xFFD0 ;negative offset in ascii
HEX48 .FILL x0030 ;positive ascii offset
PLACEHUNDRED .FILL x0064 ;used for hundredths place
PLACETEN .FILL x000A ;used for tenths place
POINTER .FILL x4000 ;Array starting point
IOCOUNTER .FILL #8 ;For our counters
FIRSTNUM .FILL x400A ;Storing first value/digit
SECONDNUM .FILL x400B ;Storing second value/digit
THIRDNUM .FILL x400C ;Storing third value/digit
.END ;End !!! :)
;REFERENCES FOR CREATING PROGRAM
;https://github.com/dideler/LC-3-Programs/blob/master/characterCounter.asm
;https://www.reddit.com/r/lc3/comments/5u636w/looping_and_asking_the_same_question_then_quit/
;https://github.com/professorkaseynguyen/CIS11/blob/master/monthofyear.asm
;https://github.com/oc-cs360/s2014/blob/master/lc3/bubblesort.asm
;https://stackoverflow.com/questions/43735625/how-to-make-a-sorting-algorithm-in-assembly-code-in-lc3ht
;Lab 6 (Month of Year) from CIS-11 Course
;Lab 3 (Suminput) from CIS-11 Course
| 42.948936 | 110 | 0.686813 |
7abe019e9b71789dca7c192e231fb3521efae985 | 435 | asm | Assembly | dino/lcs/enemy/C1.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | 6 | 2020-10-14T15:29:10.000Z | 2022-02-12T18:58:54.000Z | dino/lcs/enemy/C1.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | null | null | null | dino/lcs/enemy/C1.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | 1 | 2020-12-17T08:59:10.000Z | 2020-12-17T08:59:10.000Z | copyright zengfr site:http://github.com/zengfr/romhack
0483FC move.b D0, ($c1,A6)
048400 move.l #$49460, ($64,A6)
04DD7C move.b D0, ($c1,A6)
04DD80 move.l #$4fa30, ($64,A6)
053482 move.b D0, ($c1,A6)
053486 moveq #$22, D0
05F752 move.b #$1, ($c1,A1) [enemy+76]
05F758 or.w D0, D0 [enemy+C1]
05FAA8 clr.b ($c1,A0)
05FAAC jsr $325e6.l [enemy+C1]
copyright zengfr site:http://github.com/zengfr/romhack
| 29 | 54 | 0.632184 |
ef487db8f6f7ddb5400feade95ca816342a371fc | 1,125 | asm | Assembly | release/src/router/gmp/source/tune/ia64.asm | zhoutao0712/rtn11pb1 | 09e6b6c7ef4b91be0a9374daeacc3ac9f2fa3a05 | [
"Apache-2.0"
] | 184 | 2020-04-15T14:28:37.000Z | 2020-09-22T15:57:55.000Z | release/src/router/gmp/source/tune/ia64.asm | zhoutao0712/rtn11pb1 | 09e6b6c7ef4b91be0a9374daeacc3ac9f2fa3a05 | [
"Apache-2.0"
] | 8 | 2019-12-19T19:34:56.000Z | 2022-03-10T10:11:28.000Z | release/src/router/gmp/source/tune/ia64.asm | zhoutao0712/rtn11pb1 | 09e6b6c7ef4b91be0a9374daeacc3ac9f2fa3a05 | [
"Apache-2.0"
] | 5 | 2020-04-21T19:50:23.000Z | 2020-09-22T10:58:02.000Z | dnl IA-64 time stamp counter access routine.
dnl Copyright 2000, 2005 Free Software Foundation, Inc.
dnl
dnl This file is part of the GNU MP Library.
dnl
dnl The GNU MP Library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public License as
dnl published by the Free Software Foundation; either version 3 of the
dnl License, or (at your option) any later version.
dnl
dnl The GNU MP Library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public License
dnl along with the GNU MP Library. If not, see http://www.gnu.org/licenses/.
include(`../config.m4')
C void speed_cyclecounter (unsigned int p[2]);
C
ASM_START()
PROLOGUE(speed_cyclecounter)
mov r14 = ar.itc
;;
st4 [r32] = r14, 4
shr.u r14 = r14, 32
;;
st4 [r32] = r14
br.ret.sptk.many b0
EPILOGUE(speed_cyclecounter)
ASM_END()
| 30.405405 | 78 | 0.755556 |
50e6be99e14ec537068947afd62a1f6bc3aaf68b | 360 | asm | Assembly | oeis/329/A329964.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/329/A329964.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/329/A329964.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A329964: a(n) = (n!/floor(1+n/2)!)^2.
; 1,1,1,9,16,400,900,44100,112896,9144576,25401600,3073593600,9032601600,1526509670400,4674935865600,1051860569760000,3324398837760000,960751264112640000,3112834095724953600,1123733108556708249600,3714820193575895040000
seq $0,262033 ; Number of permutations of [n] beginning with at least floor(n/2) ascents.
pow $0,2
| 60 | 219 | 0.8 |
3c971d70a97dee717d2cc24ceb17590e212bcd50 | 440 | asm | Assembly | libsrc/stdio/cpmbios/fputc_cons.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/stdio/cpmbios/fputc_cons.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/stdio/cpmbios/fputc_cons.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ;
; Console routines
; Created for Robotron KC85 but kept generic
; By Stefano Bodrato - Sept. 2016
;
; $Id: fputc_cons.asm,v 1.1 2016-09-22 06:29:49 stefano Exp $
;
SECTION code_clib
PUBLIC fputc_cons_native
.fputc_cons_native
ld hl,2
add hl,sp
ld a,(hl)
ld c,a
IF STANDARDESCAPECHARS
cp 10
ELSE
cp 13
ENDIF
jr nz,nocr
call $f00c ; conout
IF STANDARDESCAPECHARS
ld c,13
ELSE
ld c,10
ENDIF
.nocr
jp $f00c ; conout
| 13.75 | 61 | 0.704545 |
6348bfb399e65d7161c2ce6164bfbe03c8e39d1d | 458 | asm | Assembly | libsrc/z80_crt0s/z80_emu/exxswap.asm | andydansby/z88dk-mk2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | 1 | 2020-09-15T08:35:49.000Z | 2020-09-15T08:35:49.000Z | libsrc/z80_crt0s/z80_emu/exxswap.asm | dex4er/deb-z88dk | 9ee4f23444fa6f6043462332a1bff7ae20a8504b | [
"ClArtistic"
] | null | null | null | libsrc/z80_crt0s/z80_emu/exxswap.asm | dex4er/deb-z88dk | 9ee4f23444fa6f6043462332a1bff7ae20a8504b | [
"ClArtistic"
] | null | null | null | ;
; Replacement for "exx"
;
; $Id: exxswap.asm,v 1.1 2007/11/02 10:03:32 stefano Exp $:
XLIB exxswap
.altregs defs 6
.exxswap
push hl
ld hl,(altregs)
ex (sp),hl
ld (altregs),hl
push bc
ld hl,(altregs+2)
ex (sp),hl
ld (altregs+2),hl
pop bc
push de
ld hl,(altregs+4)
ex (sp),hl
ld (altregs+4),hl
pop de
pop hl
ret | 14.774194 | 65 | 0.458515 |
4fbb5019d635cf16af5d5c2a825de16f24f7e0cf | 54 | asm | Assembly | asm/label.asm | 64/riscv-sim | 293c5bec94a4654da58fb14c3a5751abb8e1000c | [
"MIT"
] | 1 | 2022-03-25T02:19:45.000Z | 2022-03-25T02:19:45.000Z | asm/label.asm | 64/riscv-sim | 293c5bec94a4654da58fb14c3a5751abb8e1000c | [
"MIT"
] | null | null | null | asm/label.asm | 64/riscv-sim | 293c5bec94a4654da58fb14c3a5751abb8e1000c | [
"MIT"
] | null | null | null | nop
foo:
nop
nop
.bar:
nop
baz5:
nop
nop
nop
| 3.6 | 5 | 0.574074 |
94420f7a8ae55fd4dbd28bdfc32d005209544bec | 1,096 | asm | Assembly | programs/oeis/206/A206913.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/206/A206913.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/206/A206913.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A206913: Greatest binary palindrome <= n; the binary palindrome floor function.
; 0,1,1,3,3,5,5,7,7,9,9,9,9,9,9,15,15,17,17,17,17,21,21,21,21,21,21,27,27,27,27,31,31,33,33,33,33,33,33,33,33,33,33,33,33,45,45,45,45,45,45,51,51,51,51,51,51,51,51,51,51,51,51,63,63,65,65,65,65,65,65,65,65,73,73,73,73,73,73,73,73,73,73,73,73,85,85,85,85,85,85,85,85,93,93,93,93,93,93,99,99,99,99,99,99,99,99,107,107,107,107,107,107,107,107,107,107,107,107,119,119,119,119,119,119,119,119,127,127,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,153,153,153,153,153,153,153,153,153,153,153,153,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,189,189,189,189,189,189,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,195,219,219,219,219,219,219,219,219,219,219,219,219,231,231,231,231,231,231,231,231,231,231,231,231,231,231,231,231,231,231,231
lpb $0,1
mov $1,$0
cal $1,178225 ; Characteristic function of A006995 (binary palindromes).
sub $0,1
add $0,$1
lpe
mov $1,$0
| 99.636364 | 879 | 0.709854 |
494dece281ece6a8b11c1ff5a6223760fcf19ae9 | 847 | asm | Assembly | src/rotables/shot_acc.asm | battlelinegames/nesteroids | ae65d78048af68f3e735c49d77a7f37e976a7afe | [
"MIT"
] | 6 | 2018-11-14T05:51:04.000Z | 2022-01-07T13:38:42.000Z | src/rotables/shot_acc.asm | battlelinegames/nesteroids | ae65d78048af68f3e735c49d77a7f37e976a7afe | [
"MIT"
] | 1 | 2021-11-22T05:55:50.000Z | 2021-11-22T05:55:50.000Z | src/rotables/shot_acc.asm | battlelinegames/nesteroids | ae65d78048af68f3e735c49d77a7f37e976a7afe | [
"MIT"
] | 1 | 2021-11-22T05:59:54.000Z | 2021-11-22T05:59:54.000Z | .segment "CODE"
x_shot_acc_table_hi: .byte $FC, $FC, $FD, $FE
.byte $00, $01, $02, $03
.byte $03, $03, $02, $01
.byte $00, $FE, $FD, $FC
x_shot_acc_table_lo: .byte $A0, $E8, $C0, $E
.byte $00, $20, $40, $18
.byte $60, $18, $40, $20
.byte $00, $E0, $C0, $E8
y_shot_acc_table_hi: .byte $00, $01, $02, $03
.byte $03, $03, $02, $01
.byte $00, $FE, $FD, $FC
.byte $FC, $FC, $FD, $FE
y_shot_acc_table_lo: .byte $00, $20, $40, $18
.byte $60, $18, $40, $20
.byte $00, $E0, $C0, $E8
.byte $A0, $E8, $C0, $E0
| 40.333333 | 50 | 0.328217 |
004e939cd1d6033898fb4d2c9de968831359aaf6 | 3,403 | nasm | Assembly | Linux/x86/byteswapip.nasm | tobyoxborrow/msncsiasm | 3fcfff9a6779cae22da9dba48dff1201a262fc7b | [
"BSD-3-Clause"
] | null | null | null | Linux/x86/byteswapip.nasm | tobyoxborrow/msncsiasm | 3fcfff9a6779cae22da9dba48dff1201a262fc7b | [
"BSD-3-Clause"
] | null | null | null | Linux/x86/byteswapip.nasm | tobyoxborrow/msncsiasm | 3fcfff9a6779cae22da9dba48dff1201a262fc7b | [
"BSD-3-Clause"
] | null | null | null | ; IP byte swapper
;
; Takes an IP address in dotted quad format, performs a byte swap and outputs
; the result in hex for your use elsewhere.
; Use case: You need an IP address (e.g. "192.0.2.57") in network byte order
; Using numbers (or any other character) outside this range is not expected and
; the results are undefined.
;
; Usage: byteswapip <ip-address>
;
; Example usage:
; $ ./byteswapip 192.0.2.57
; 0x4D0200C0
; $ ./byteswapip 8.8.8.8
; 0x08080808
;
global _start
section .text
exit1:
mov eax, __NR_exit
mov ebx, 0x1
int 0x80
_start:
; require exactly 1 command-line argument
pop ecx
cmp ecx, 0x2
jne exit1
pop ecx ; command filename (ignored)
pop ecx ; first argument
mov eax, 0x0 ; temp for quad running total
mov edx, 0xA ; for mul instruction in loop
mov esi, 0x0 ; quad counter (to abort if there is the wrong number)
; loop over each character converting the ASCII character codes into an
; actual number
decode_loop:
mov bl, [ecx] ; current character
inc ecx
cmp bl, '0' ; sanity test, ASCII code is digit
jl exit1
cmp bl, '9'
jg exit1
sub bl, 0x30 ; subtract 0x30 from ASCII character code
add al, bl ; update quad running total
jc exit1 ; this quad is >255 (e.g. input was: 256)
cmp byte [ecx], '.' ; end of the quad?
je decode_loop_next_quad
cmp byte [ecx], 0x0 ; end of the string?
je decode_loop_end
; there is another digit, multiply current value by 10 to shift it over
; one power (i.e. 19 becomes 190) to accept the next character
mul dl
jc exit1 ; this quad is >255 (e.g. input was: 999)
jmp decode_loop
decode_loop_next_quad:
add edi, eax ; update address running total
mov eax, 0x0 ; reset quad running total
shl edi, 0x8 ; shift address to make space for next quad
inc esi ; sanity test, too many quads
cmp esi, 0x3
ja exit1
inc ecx ; skip over the '.'
jmp decode_loop
decode_loop_end:
add edi, eax ; update address running total
mov eax, edi
bswap eax
; copy template to output string
mov ecx, output_template_len
mov esi, output_template
mov edi, output
cld
rep movsb
; convert number back to ASCII for display and store in output string
mov ecx, 0x8
mov esi, output
add esi, 0x9 ; skip to the last position, write from right to left
encode_loop:
; divide the number by 0x10 to get one digit (popped into edx)
mov edx, 0x0
mov ebx, 0x10
div ebx
; lookup edx against hex_chars
mov edi, hex_chars
add edi, edx
mov dl, byte [edi]
mov byte [esi], dl ; store the result in output
dec esi
loop encode_loop
mov eax, __NR_write
mov ebx, 0x1 ; stdout
mov ecx, output
mov edx, output_template_len
int 0x80
mov eax, __NR_exit
mov ebx, 0x0
int 0x80
section .data
; asm/unistd_32.h
__NR_exit equ 1
__NR_write equ 4
hex_chars: db '0123456789ABCDEF'
output_template: db '0x????????', 0xA
output_template_len: equ $-output_template
section .bss
output: resb output_template_len
| 25.395522 | 79 | 0.616515 |
b61e5d80135849400142bc6876b36091e5c47b21 | 1,685 | asm | Assembly | programs/oeis/267/A267047.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/267/A267047.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/267/A267047.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A267047: Total number of ON (black) cells after n iterations of the "Rule 91" elementary cellular automaton starting with a single ON (black) cell.
; 1,3,5,9,14,22,27,39,44,60,65,85,90,114,119,147,152,184,189,225,230,270,275,319,324,372,377,429,434,490,495,555,560,624,629,697,702,774,779,855,860,940,945,1029,1034,1122,1127,1219,1224,1320,1325,1425,1430,1534,1539,1647,1652,1764,1769,1885,1890,2010,2015,2139,2144,2272,2277,2409,2414,2550,2555,2695,2700,2844,2849,2997,3002,3154,3159,3315,3320,3480,3485,3649,3654,3822,3827,3999,4004,4180,4185,4365,4370,4554,4559,4747,4752,4944,4949,5145,5150,5350,5355,5559,5564,5772,5777,5989,5994,6210,6215,6435,6440,6664,6669,6897,6902,7134,7139,7375,7380,7620,7625,7869,7874,8122,8127,8379,8384,8640,8645,8905,8910,9174,9179,9447,9452,9724,9729,10005,10010,10290,10295,10579,10584,10872,10877,11169,11174,11470,11475,11775,11780,12084,12089,12397,12402,12714,12719,13035,13040,13360,13365,13689,13694,14022,14027,14359,14364,14700,14705,15045,15050,15394,15399,15747,15752,16104,16109,16465,16470,16830,16835,17199,17204,17572,17577,17949,17954,18330,18335,18715,18720,19104,19109,19497,19502,19894,19899,20295,20300,20700,20705,21109,21114,21522,21527,21939,21944,22360,22365,22785,22790,23214,23219,23647,23652,24084,24089,24525,24530,24970,24975,25419,25424,25872,25877,26329,26334,26790,26795,27255,27260,27724,27729,28197,28202,28674,28679,29155,29160,29640,29645,30129,30134,30622,30627,31119,31124,31620
mov $38,$0
mov $40,$0
add $40,1
lpb $40
clr $0,38
mov $0,$38
sub $40,1
sub $0,$40
sub $0,2
mul $0,2
lpb $0
mov $7,$0
add $0,1
mul $0,3
mod $0,4
lpe
mov $1,$7
add $1,2
add $39,$1
lpe
mov $1,$39
| 67.4 | 1,302 | 0.75727 |
8edce5fa0fe3165e081eeb8ad11cf5d2f0d54ad3 | 2,103 | asm | Assembly | source/sfx_zoom.asm | AntonioND/back-to-color | 5f0d03677db28bb990c5203c64e23ac479e3fd2d | [
"Unlicense"
] | 21 | 2015-09-17T18:18:02.000Z | 2021-10-15T02:38:58.000Z | source/sfx_zoom.asm | PMArkive/back-to-color | 5f0d03677db28bb990c5203c64e23ac479e3fd2d | [
"Unlicense"
] | null | null | null | source/sfx_zoom.asm | PMArkive/back-to-color | 5f0d03677db28bb990c5203c64e23ac479e3fd2d | [
"Unlicense"
] | 5 | 2016-04-20T20:13:50.000Z | 2020-11-16T16:48:34.000Z |
; File created by mod2gbt
SECTION "zoom_sfx", ROMX, BANK[3]
zoom_sfx0:
DB $80,$a1,$12, $00, $00, $4a,$03
DB $83,$a1,$12, $00, $00, $00
DB $86,$a1,$12, $00, $00, $00
DB $89,$a1,$12, $00, $00, $00
DB $8c,$a1,$12, $00, $00, $00
DB $8f,$a1,$12, $00, $00, $00
DB $92,$a1,$12, $00, $00, $00
DB $95,$a1,$12, $00, $00, $00
DB $98,$a1,$12, $00, $00, $00
DB $9b,$a1,$12, $00, $00, $00
DB $9e,$a1,$12, $00, $00, $4a,$01
DB $a4,$2f, $00, $00, $00
DB $a3,$2f, $00, $00, $00
DB $a2,$2f, $00, $00, $00
DB $a1,$2f, $00, $00, $00
DB $a0,$2f, $00, $00, $00
DB $9f,$2f, $00, $00, $00
DB $9e,$2f, $00, $00, $00
DB $9d,$2f, $00, $00, $00
DB $9c,$2f, $00, $00, $00
DB $9b,$2f, $00, $00, $00
DB $9a,$2f, $00, $00, $00
DB $99,$2f, $00, $00, $00
DB $98,$2f, $00, $00, $00
DB $97,$2f, $00, $00, $00
DB $96,$2f, $00, $00, $00
DB $95,$2f, $00, $00, $00
DB $94,$2f, $00, $00, $00
DB $93,$2f, $00, $00, $00
DB $92,$2f, $00, $00, $00
DB $91,$2f, $00, $00, $00
DB $90,$2f, $00, $00, $00
DB $8f,$2f, $00, $00, $00
DB $8e,$2f, $00, $00, $00
DB $8d,$2f, $00, $00, $00
DB $8c,$2f, $00, $00, $00
DB $97,$2f, $00, $00, $00
DB $8a,$2f, $00, $00, $00
DB $89,$2f, $00, $00, $00
DB $88,$2f, $00, $00, $00
DB $87,$2f, $00, $00, $00
DB $86,$2f, $00, $00, $00
DB $85,$2f, $00, $00, $00
DB $84,$2f, $00, $00, $00
DB $83,$2f, $00, $00, $00
DB $82,$2f, $00, $00, $00
DB $81,$2f, $00, $00, $00
DB $80,$2f, $00, $00, $00
DB $20, $00, $00, $4a,$03
DB $00, $00, $00, $00
DB $00, $00, $00, $00
DB $00, $00, $00, $00
DB $00, $00, $00, $00
DB $00, $00, $00, $00
DB $00, $00, $00, $00
DB $00, $00, $00, $00
DB $00, $00, $00, $00
DB $00, $00, $00, $00
DB $00, $00, $00, $00
DB $00, $00, $00, $00
DB $00, $00, $00, $00
DB $00, $00, $00, $00
DB $00, $00, $00, $00
DB $00, $00, $00, $00
zoom_sfx_Data::
DW zoom_sfx0
DW $0000
| 28.04 | 38 | 0.402758 |
39587dc5630924cb1bed0b0096c6c7f6db08ecfe | 5,799 | asm | Assembly | Transynther/x86/_processed/NC/_st_zr_un_sm_/i9-9900K_12_0xca_notsx.log_21829_1572.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NC/_st_zr_un_sm_/i9-9900K_12_0xca_notsx.log_21829_1572.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NC/_st_zr_un_sm_/i9-9900K_12_0xca_notsx.log_21829_1572.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r14
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x19fa9, %rsi
lea addresses_WC_ht+0x2a99, %rdi
clflush (%rsi)
nop
add $27848, %rdx
mov $61, %rcx
rep movsl
nop
nop
nop
nop
nop
dec %rbp
lea addresses_WT_ht+0x9de9, %r10
nop
nop
nop
cmp %rbp, %rbp
vmovups (%r10), %ymm3
vextracti128 $1, %ymm3, %xmm3
vpextrq $0, %xmm3, %rsi
nop
nop
add %rdi, %rdi
lea addresses_normal_ht+0x1b7e9, %rsi
clflush (%rsi)
nop
nop
nop
nop
cmp $6960, %r14
mov (%rsi), %ebp
nop
nop
nop
xor $13118, %r10
lea addresses_normal_ht+0x11a11, %rsi
inc %r14
mov (%rsi), %r10d
nop
nop
nop
xor %rsi, %rsi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r14
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r9
push %rax
push %rbx
push %rcx
push %rdi
// Store
lea addresses_WC+0x1cecc, %rdi
nop
nop
nop
nop
xor $54640, %rbx
mov $0x5152535455565758, %r11
movq %r11, %xmm3
vmovups %ymm3, (%rdi)
nop
nop
nop
and $46380, %rbx
// Store
mov $0x26abae0000000fe9, %rbx
nop
nop
nop
add $58775, %rcx
mov $0x5152535455565758, %rdi
movq %rdi, %xmm7
movups %xmm7, (%rbx)
cmp %rbx, %rbx
// Store
lea addresses_WT+0xda85, %rcx
clflush (%rcx)
add $2133, %r9
mov $0x5152535455565758, %rax
movq %rax, %xmm3
vmovups %ymm3, (%rcx)
nop
nop
nop
cmp $16658, %rax
// Faulty Load
mov $0x26abae0000000fe9, %rdi
nop
nop
nop
nop
sub %rax, %rax
movb (%rdi), %cl
lea oracles, %r11
and $0xff, %rcx
shlq $12, %rcx
mov (%r11,%rcx,1), %rcx
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r9
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_NC', 'NT': True, 'AVXalign': False, 'size': 16, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_NC', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 2}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_NC', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_WC_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 8}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 11}}
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 3}}
{'00': 274, '58': 21401, '6d': 154}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 6d 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 00 58 58 58 58 58 00 58 58 58 58 58 58 58 58 6d 58 58 58 6d 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 6d 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 6d 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 6d 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 6d 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 6d 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 6d 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 6d 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 00 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
| 39.182432 | 2,999 | 0.658044 |
0becf430c491f0bb03b991286cbc3007f153b812 | 359 | asm | Assembly | Tests/Region/Auto/Auto.asm | Thar0/armips | 4616b009959a8675eb2c9af66470b30c4083dffb | [
"MIT"
] | 283 | 2015-01-02T01:02:28.000Z | 2022-03-28T11:16:10.000Z | Tests/Region/Auto/Auto.asm | Thar0/armips | 4616b009959a8675eb2c9af66470b30c4083dffb | [
"MIT"
] | 117 | 2015-01-04T10:24:50.000Z | 2022-03-12T19:51:13.000Z | Tests/Region/Auto/Auto.asm | Thar0/armips | 4616b009959a8675eb2c9af66470b30c4083dffb | [
"MIT"
] | 82 | 2015-02-07T15:03:47.000Z | 2022-01-09T12:18:38.000Z | .psx
.create "output.bin", 0
.region 20h
.word 1,2,3,4
.endregion
.autoregion
.notice "Allocated at " + tohex(.)
.word 5
.endautoregion
.autoregion
.notice "Allocated at " + tohex(.)
.word 6
.endautoregion
.autoregion
.notice "Allocated at " + tohex(.)
.word 7
.endautoregion
.autoregion
.notice "Allocated at " + tohex(.)
.word 8
.endautoregion
.close | 12.821429 | 34 | 0.696379 |
00395b4085fa1012bf4623ae6912ad5b7353f325 | 360 | asm | Assembly | os/lib/k_time.asm | conorm110/KoalemOS | 5480464dd3026002bd61f72eb7bd3a097b6aa74e | [
"BSD-4-Clause"
] | null | null | null | os/lib/k_time.asm | conorm110/KoalemOS | 5480464dd3026002bd61f72eb7bd3a097b6aa74e | [
"BSD-4-Clause"
] | null | null | null | os/lib/k_time.asm | conorm110/KoalemOS | 5480464dd3026002bd61f72eb7bd3a097b6aa74e | [
"BSD-4-Clause"
] | null | null | null | ; Copyright (c) 2021, Conor Mika
; All rights reserved.
; This source code is licensed under the BSD-style license found in the
; LICENSE file in the root directory of this source tree.
; Linking
global delay_cycle
; delay_cycle: delay one clk
;
; delays by one CPU cycle (nop)
; DO NOT USE FOR REAL TIMING
; JUST FOR DEBUGGING
delay_cycle:
nop
ret | 22.5 | 71 | 0.733333 |
6ea25c1b11a1f6b163e4728577878d8a53e34b5f | 7,427 | asm | Assembly | src/chars.asm | Iambian/Falldown2-CE | 3f73a7be510b8bbc24b224ccf02757476222e3ea | [
"MIT"
] | 2 | 2020-05-18T14:09:57.000Z | 2022-02-14T23:45:55.000Z | src/chars.asm | Iambian/Falldown2-CE | 3f73a7be510b8bbc24b224ccf02757476222e3ea | [
"MIT"
] | null | null | null | src/chars.asm | Iambian/Falldown2-CE | 3f73a7be510b8bbc24b224ccf02757476222e3ea | [
"MIT"
] | null | null | null | .assume adl=0
;
; Characters and strings. Relies on the defines in game.asm. Is not portable.
;
;Depends on:
; Existence of page-aligned 8->16 bit expansion lookup tables
; Text color defines
; Screen buffer at address $8000
;
;Defines the following inline memory areas:
; textcoords (LSB+X, MSB=Y)
; textcolor (two choices, each pointing to start of expansion LUTs)
;
;Defines the following functions:
; putchar [in:A=char, dstr: AF DE HL]
; putstr_centerpartial [in:HL=str A=x_offset, out:HL=next_str, dstr: AF DE]
; putstr_macro [For use in macro. see routine. Also destroys IX]
; putstr [in:HL=str, dstr: AF DE]
; putscore [in:HL=adr_of_BE_BCD_num, dstr: AF BC DE HL]
; getstrlen [in:HL=str, out:A,B=strlen HL=str, dstr: N/A]
; getstrfromidx [in:HL=strarr B=idx, out:HL=str A,B=0]
;in: A=char; out: character written to display
;rem: lazy will only do x in multiples of 4 px
;destroys: AF DE HL
putchar:
textcoords .equ $+1
textpos .equ $+1 ; convenience equates
textx .equ $+1 ;
texty .equ $+2 ;
ld hl,0 ;SMC'd: H=Y, L=X
ld e,L
ld d,0 ;DE=X offset
ld L,80
mlt hl
add hl,de ;HL=offset into buffer
set 7,h ;buffer starts at $8000
push hl
pop ix
ld e,a
ld hl,graphx_textdata
ex de,hl
add hl,hl
add hl,hl
add hl,hl ;x8
add hl,de ;HL = address to character
ld a,8
putchar_loop:
ld e,(hl) ;Character data into LSB of pagealigned LUT
textcolor .EQU $+1
ld d,TEXT_BLACK ;MSB of LUT address div 2 into MSB DE.
ex de,hl
add hl,hl ;Shift left to complete the address.
ld hl,(hl) ;Get 2bpp data from LUT
ld (ix+0),hl ;and write it to the buffer
ex de,hl
inc hl ;point to next byte of character
lea ix,ix+80 ;point to next row in buffer
dec a
jr nz,putchar_loop
ld hl,textcoords
inc (hl)
inc (hl)
ret
;ok. can't get it to work with screen quartering as it is so we'll do the calc
;separately.
;inputs and outputs the same as putstr_centerpartial
putstr_centerquarter:
ld b,-40+1
jr putstr_centercontinue
;in: HL=strlen
;out: HL=adr_after_string
;Destroys: AF DE B
putstr_centerpartial:
ld b,-80+1
putstr_centercontinue:
push hl
call getstrlen
add a,a
add a,b
cpl
srl a
sbc a,0 ;round down if a bit got shifted out
ld hl,(textcoords)
ld L,a
ld a,h
add a,12
ld h,a
ld (textcoords),hl
pop hl
jr putstr
;also destroys IX. BC is safe.
;call putstr_macro / .db XPOS,YPOS / .dw str_adr
putstr_macro:
pop ix
ld hl,(ix+0+COMPILER_BUG_OFFSET)
ld (textcoords),hl
ld hl,(ix+2+COMPILER_BUG_OFFSET)
pea ix+4+COMPILER_BUG_OFFSET
;in: HL=zero_terminated_string
;out: HL=address_after_zero_terminator
;destroys: AF DE
putstr:
ld a,(hl)
inc hl
or a
ret z
push hl
call putchar
pop hl
jr putstr
;in: HL=4_byte_BCD_bigendian
;destroys: All but IY
putscore:
xor a
ld b,8
putscore_loop:
push hl
rld
ld c,a
add a,'0'
call putchar
ld a,c
pop hl
bit 0,b
jr z,$+5
rld ;To return (HL) to way it was before. Else corrupted scores
inc hl
djnz putscore_loop
ret
;in: HL=address_of_z-term_string
;out: HL is preserved, A= numchars string, zero flag set
getstrlen:
ld a,-1
push hl
getstrlen_loop:
inc a
inc (hl)
dec (hl) ;frees up reg A for compare
inc hl
jr nz,getstrlen_loop
pop hl
ret
;in: HL=start_of_string_array, B=index_to_get
;out: HL=start_of_indexed_string
;destroys: A and B always zero.
;NOTE: This routine was used only once, so inlining it @ gametitle_printbottom
; getstrfromidx:
; xor a
; cp b
; ret z
; getstrfromidx_loop:
; cp (hl)
; inc hl
; jr nz,getstrfromidx_loop
; djnz getstrfromidx_loop
; ret
;zeroing out characters that aren't used to improve compression results
graphx_textdata .EQU $-(8*' ') ;points to what would be start of ASCII
.db $00,$00,$00,$00,$00,$00,$00,$00 ;
.db $00,$00,$00,$00,$00,$00,$00,$00 ; !
.db $00,$00,$00,$00,$00,$00,$00,$00 ; "
.db $00,$00,$00,$00,$00,$00,$00,$00 ; #
.db $00,$00,$00,$00,$00,$00,$00,$00 ; $
.db $00,$00,$00,$00,$00,$00,$00,$00 ; %
.db $00,$00,$00,$00,$00,$00,$00,$00 ; &
.db $30,$30,$60,$00,$00,$00,$00,$00 ; '
.db $30,$60,$C0,$C0,$C0,$60,$30,$00 ; (
.db $C0,$60,$30,$30,$30,$60,$C0,$00 ; )
.db $00,$00,$00,$00,$00,$00,$00,$00 ; *
.db $00,$00,$00,$00,$00,$00,$00,$00 ; +
.db $00,$00,$00,$00,$00,$60,$60,$C0 ; ,
.db $00,$00,$00,$00,$00,$00,$00,$00 ; -
.db $00,$00,$00,$00,$00,$18,$18,$00 ; .
.db $06,$0C,$18,$30,$60,$C0,$80,$00 ; /
.db $7C,$CE,$DE,$F6,$E6,$C6,$7C,$00 ; 0
.db $30,$70,$30,$30,$30,$30,$FC,$00 ; 1
.db $7C,$C6,$06,$7C,$C0,$C0,$FE,$00 ; 2
.db $FC,$06,$06,$3C,$06,$06,$FC,$00 ; 3
.db $0C,$CC,$CC,$CC,$FE,$0C,$0C,$00 ; 4
.db $FE,$C0,$FC,$06,$06,$C6,$7C,$00 ; 5
.db $7C,$C0,$C0,$FC,$C6,$C6,$7C,$00 ; 6
.db $FE,$06,$06,$0C,$18,$30,$30,$00 ; 7
.db $7C,$C6,$C6,$7C,$C6,$C6,$7C,$00 ; 8
.db $7C,$C6,$C6,$7E,$06,$06,$7C,$00 ; 9
.db $00,$C0,$C0,$00,$00,$C0,$C0,$00 ; :
.db $00,$00,$00,$00,$00,$00,$00,$00 ; ;
.db $00,$00,$00,$00,$00,$00,$00,$00 ; <
.db $00,$00,$00,$00,$00,$00,$00,$00 ; =
.db $00,$00,$00,$00,$00,$00,$00,$00 ; >
.db $00,$00,$00,$00,$00,$00,$00,$00 ; ?
.db $00,$00,$00,$00,$00,$00,$00,$00 ; @
.db $38,$6C,$C6,$C6,$FE,$C6,$C6,$00 ; A
.db $FC,$C6,$C6,$FC,$C6,$C6,$FC,$00 ; B
.db $7C,$C6,$C0,$C0,$C0,$C6,$7C,$00 ; C
.db $F8,$CC,$C6,$C6,$C6,$CC,$F8,$00 ; D
.db $FE,$C0,$C0,$F8,$C0,$C0,$FE,$00 ; E
.db $FE,$C0,$C0,$F8,$C0,$C0,$C0,$00 ; F
.db $7C,$C6,$C0,$C0,$CE,$C6,$7C,$00 ; G
.db $C6,$C6,$C6,$FE,$C6,$C6,$C6,$00 ; H
.db $7E,$18,$18,$18,$18,$18,$7E,$00 ; I
.db $06,$06,$06,$06,$06,$C6,$7C,$00 ; J
.db $C6,$CC,$D8,$F0,$D8,$CC,$C6,$00 ; K
.db $C0,$C0,$C0,$C0,$C0,$C0,$FE,$00 ; L
.db $C6,$EE,$FE,$FE,$D6,$C6,$C6,$00 ; M
.db $C6,$E6,$F6,$DE,$CE,$C6,$C6,$00 ; N
.db $7C,$C6,$C6,$C6,$C6,$C6,$7C,$00 ; O
.db $FC,$C6,$C6,$FC,$C0,$C0,$C0,$00 ; P
.db $7C,$C6,$C6,$C6,$D6,$DE,$7C,$06 ; Q
.db $FC,$C6,$C6,$FC,$D8,$CC,$C6,$00 ; R
.db $7C,$C6,$C0,$7C,$06,$C6,$7C,$00 ; S
.db $FF,$18,$18,$18,$18,$18,$18,$00 ; T
.db $C6,$C6,$C6,$C6,$C6,$C6,$FE,$00 ; U
.db $C6,$C6,$C6,$C6,$C6,$7C,$38,$00 ; V
.db $C6,$C6,$C6,$C6,$D6,$FE,$6C,$00 ; W
.db $C6,$C6,$6C,$38,$6C,$C6,$C6,$00 ; X
.db $C6,$C6,$C6,$7C,$18,$30,$E0,$00 ; Y
.db $FE,$06,$0C,$18,$30,$60,$FE,$00 ; Z
.db $00,$00,$00,$00,$00,$00,$00,$00 ; [
.db $00,$00,$00,$00,$00,$00,$00,$00 ; \
.db $00,$00,$00,$00,$00,$00,$00,$00 ; ]
.db $00,$00,$00,$00,$00,$00,$00,$00 ; ^
.db $00,$00,$00,$00,$00,$00,$00,$00 ; _
.db $00,$00,$00,$00,$00,$00,$00,$00 ; `
.db $00,$00,$7C,$06,$7E,$C6,$7E,$00 ; a
.db $C0,$C0,$C0,$FC,$C6,$C6,$FC,$00 ; b
.db $00,$00,$7C,$C6,$C0,$C6,$7C,$00 ; c
.db $06,$06,$06,$7E,$C6,$C6,$7E,$00 ; d
.db $00,$00,$7C,$C6,$FE,$C0,$7C,$00 ; e
.db $1C,$36,$30,$78,$30,$30,$78,$00 ; f
.db $00,$00,$7E,$C6,$C6,$7E,$06,$FC ; g
.db $C0,$C0,$FC,$C6,$C6,$C6,$C6,$00 ; h
.db $18,$00,$38,$18,$18,$18,$3C,$00 ; i
.db $06,$00,$06,$06,$06,$06,$C6,$7C ; j
.db $C0,$C0,$CC,$D8,$F8,$CC,$C6,$00 ; k
.db $38,$18,$18,$18,$18,$18,$3C,$00 ; l
.db $00,$00,$CC,$FE,$FE,$D6,$D6,$00 ; m
.db $00,$00,$FC,$C6,$C6,$C6,$C6,$00 ; n
.db $00,$00,$7C,$C6,$C6,$C6,$7C,$00 ; o
.db $00,$00,$FC,$C6,$C6,$FC,$C0,$C0 ; p
.db $00,$00,$7E,$C6,$C6,$7E,$06,$06 ; q
.db $00,$00,$FC,$C6,$C0,$C0,$C0,$00 ; r
.db $00,$00,$7E,$C0,$7C,$06,$FC,$00 ; s
.db $30,$30,$FC,$30,$30,$30,$1C,$00 ; t
.db $00,$00,$C6,$C6,$C6,$C6,$7E,$00 ; u
.db $00,$00,$C6,$C6,$C6,$7C,$38,$00 ; v
.db $00,$00,$C6,$C6,$D6,$FE,$6C,$00 ; w
.db $00,$00,$C6,$6C,$38,$6C,$C6,$00 ; x
.db $00,$00,$C6,$C6,$C6,$7E,$06,$FC ; y
.db $00,$00,$FE,$0C,$38,$60,$FE,$00 ; z
| 28.239544 | 78 | 0.580315 |
4536e5e3e5105698c0ac0884eca47c452ffe2069 | 553 | asm | Assembly | oeis/085/A085744.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/085/A085744.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/085/A085744.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A085744: a(n) = A000217(n^3) - n^3.
; 0,0,28,351,2016,7750,23220,58653,130816,265356,499500,885115,1492128,2412306,3763396,5693625,8386560,12066328,17003196,23519511,31996000,42878430,56684628,74011861,95544576,122062500,154449100,193700403,240934176,297399466,364486500,443736945,536854528,645716016,772382556,919111375,1088367840,1282837878,1505440756,1759342221,2047968000,2375017660,2744478828,3160641771,3628114336,4151837250,4737099780,5389555753,6115239936,6920584776,7812437500,8798077575,9885234528,11082106126,12397376916
pow $0,3
bin $0,2
| 92.166667 | 495 | 0.848101 |
7846bb68c13ccbbe2fd7e717e0bea635a7519665 | 622 | asm | Assembly | oeis/164/A164015.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/164/A164015.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/164/A164015.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A164015: 5 times centered pentagonal numbers: 5*(5*n^2 + 5*n + 2)/2.
; 5,30,80,155,255,380,530,705,905,1130,1380,1655,1955,2280,2630,3005,3405,3830,4280,4755,5255,5780,6330,6905,7505,8130,8780,9455,10155,10880,11630,12405,13205,14030,14880,15755,16655,17580,18530,19505,20505,21530,22580,23655,24755,25880,27030,28205,29405,30630,31880,33155,34455,35780,37130,38505,39905,41330,42780,44255,45755,47280,48830,50405,52005,53630,55280,56955,58655,60380,62130,63905,65705,67530,69380,71255,73155,75080,77030,79005,81005,83030,85080,87155,89255,91380,93530,95705,97905,100130
sub $1,$0
bin $1,2
mul $1,25
add $1,5
mov $0,$1
| 69.111111 | 501 | 0.77492 |
2c3396974115812ca82f9a45be3413ed0ac4131e | 673 | asm | Assembly | programs/oeis/026/A026337.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/026/A026337.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/026/A026337.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A026337: a(n) = 4^n*(4^n - 1)/2.
; 0,6,120,2016,32640,523776,8386560,134209536,2147450880,34359607296,549755289600,8796090925056,140737479966720,2251799780130816,36028796884746240,576460751766552576,9223372034707292160,147573952581086478336,2361183241400462868480,37778931862819722756096,604462909806764831539200,9671406556914834374393856,154742504910663738269368320,2475880078570725365426159616,39614081257132028059283619840,633825300114114137798398181376,10141204801825832960173811957760,162259276829213354384378755547136,2596148429267413778236451145646080,41538374868278620884128782557904896,664613997892457935875442777836748800
mov $1,4
pow $1,$0
bin $1,2
mov $0,$1
| 84.125 | 598 | 0.893016 |
b484ae3ea9d410062cf574b570ec0a37a3113d9e | 828 | asm | Assembly | oeis/142/A142633.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/142/A142633.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/142/A142633.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A142633: Primes congruent to 46 mod 55.
; Submitted by Jon Maiga
; 101,211,431,541,761,1091,1201,1531,1861,2081,2411,2521,2741,2851,3181,3511,4391,4721,4831,5051,5381,5711,5821,6151,6481,6701,7691,8461,8681,9011,9341,9781,10111,10331,10771,11321,11981,12421,12641,13411,14071,14401,14621,14731,14951,15061,15391,16381,16931,17041,17921,18251,18691,18911,19571,19681,20011,20231,20341,21001,21221,21661,21881,21991,22541,22651,22871,23201,23311,23531,23971,24631,24851,25621,25841,25951,26171,26501,27271,28151,28591,28921,29251,29581,30241,31121,31231,31891,32441
mov $1,50
mov $2,$0
add $2,2
pow $2,2
lpb $2
sub $2,1
mov $3,$1
mul $3,2
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,55
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
lpe
mov $0,$1
mul $0,2
sub $0,109
| 34.5 | 498 | 0.729469 |
7c618ddfb334361c46426bc839be869485002b1e | 1,074 | asm | Assembly | oeis/282/A282412.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/282/A282412.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/282/A282412.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A282412: Binary 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 467", based on the 5-celled von Neumann neighborhood.
; Submitted by Christian Krause
; 1,10,111,0,11111,0,1111111,0,111111111,0,11111111111,0,1111111111111,0,111111111111111,0,11111111111111111,0,1111111111111111111,0,111111111111111111111,0,11111111111111111111111,0,1111111111111111111111111,0,111111111111111111111111111,0,11111111111111111111111111111,0,1111111111111111111111111111111,0,111111111111111111111111111111111,0,11111111111111111111111111111111111,0,1111111111111111111111111111111111111,0,111111111111111111111111111111111111111,0
seq $0,282414 ; 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 467", based on the 5-celled von Neumann neighborhood.
seq $0,7088 ; The binary numbers (or binary words, or binary vectors, or binary expansion of n): numbers written in base 2.
| 153.428571 | 462 | 0.834264 |
7ce3983f4bf245d968d25f64eb92d9caaa778b15 | 330 | asm | Assembly | T3/E3T2.asm | abphilip-vit/College3 | 6dda385462d995d5d98b64b8b981a5b639c64b91 | [
"MIT"
] | 2 | 2021-05-03T00:41:14.000Z | 2021-05-08T06:06:51.000Z | T3/E3T2.asm | abphilip-vit/College3 | 6dda385462d995d5d98b64b8b981a5b639c64b91 | [
"MIT"
] | 1 | 2021-04-29T23:48:19.000Z | 2021-04-30T00:02:10.000Z | T3/E3T2.asm | allenalvin333/College3 | 6dda385462d995d5d98b64b8b981a5b639c64b91 | [
"MIT"
] | null | null | null | ORG 0000H
MOV DPTR,#0200H
MOV R1, #0EH
MOV R0, #40H
ALLEN:CLR A
MOVC A,@A+DPTR
MOV @R0,A
INC DPTR
INC R0
DJNZ R1,ALLEN
MOV R0,#40H
MOV R1,#60H
MOV R3,#0EH
ALLEN2: CLR A
MOV A,@R0
MOV @R1,A
INC R1
INC R0
DJNZ R3,ALLEN2
HERE: SJMP HERE
ORG 0200H
DB "VIT UNIVERSITY"
END | 12.692308 | 21 | 0.575758 |
c721ae2364632126e9a533924cf5de10d1d0ce54 | 151 | asm | Assembly | libsrc/target/zx-common/graphics/plotpixl.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/target/zx-common/graphics/plotpixl.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/target/zx-common/graphics/plotpixl.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ;
; Plot pixel at (x,y) coordinate.
SECTION code_clib
PUBLIC plotpixel
EXTERN plot_MODE0
defc plotpixel = plot_MODE0
| 9.4375 | 39 | 0.615894 |
63a7d3f42c06ecf779ecea72229f496f3d0a8e4f | 883 | asm | Assembly | data/pokemon/base_stats/crobat.asm | AtmaBuster/pokeplat-gen2 | fa83b2e75575949b8f72cb2c48f7a1042e97f70f | [
"blessing"
] | 6 | 2021-06-19T06:41:19.000Z | 2022-02-15T17:12:33.000Z | data/pokemon/base_stats/crobat.asm | AtmaBuster/pokeplat-gen2-old | 01e42c55db5408d72d89133dc84a46c699d849ad | [
"blessing"
] | null | null | null | data/pokemon/base_stats/crobat.asm | AtmaBuster/pokeplat-gen2-old | 01e42c55db5408d72d89133dc84a46c699d849ad | [
"blessing"
] | 2 | 2021-08-11T19:47:07.000Z | 2022-01-01T07:07:56.000Z | db 0 ; species ID placeholder
db 85, 90, 80, 130, 70, 80
; hp atk def spd sat sdf
db POISON, FLYING ; type
db 90 ; catch rate
db 204 ; base exp
db NO_ITEM, NO_ITEM ; items
db GENDER_F50 ; gender ratio
db 15 ; step cycles to hatch
INCBIN "gfx/pokemon/crobat/front.dimensions"
db GROWTH_MEDIUM_FAST ; growth rate
dn EGG_FLYING, EGG_FLYING ; egg groups
db 70 ; happiness
; tm/hm learnset
tmhm TOXIC, HIDDEN_POWER, SUNNY_DAY, TAUNT, HYPER_BEAM, PROTECT, RAIN_DANCE, GIGA_DRAIN, FRUSTRATION, RETURN, SHADOW_BALL, DOUBLE_TEAM, SLUDGE_BOMB, AERIAL_ACE, TORMENT, FACADE, SECRET_POWER, REST, ATTRACT, THIEF, STEEL_WING, SNATCH, ROOST, ENDURE, PAYBACK, GIGA_IMPACT, CAPTIVATE, DARK_PULSE, X_SCISSOR, SLEEP_TALK, NATURAL_GIFT, SWAGGER, PLUCK, U_TURN, SUBSTITUTE, FLY, DEFOG, AIR_CUTTER, HEAT_WAVE, OMINOUS_WIND, SNORE, SWIFT, TWISTER, UPROAR, ZEN_HEADBUTT
; end
| 44.15 | 461 | 0.746319 |
53f5cbcb10f1f0e664cbde10c12b4d572e274186 | 157 | asm | Assembly | test/sarx.asm | cryptoptusenix/assemblyline | fd4908f9eee237cbeebc2e17d2bdec1c7928a187 | [
"Apache-2.0"
] | null | null | null | test/sarx.asm | cryptoptusenix/assemblyline | fd4908f9eee237cbeebc2e17d2bdec1c7928a187 | [
"Apache-2.0"
] | 9 | 2021-09-15T18:04:36.000Z | 2021-09-28T01:22:15.000Z | test/sarx.asm | daviduwu9/AssemblyLine | ecabc96e254be5a1e02654258ba4a60ea708397a | [
"Apache-2.0"
] | null | null | null | SECTION .text
GLOBAL test
test:
sarx r9, rax, rax
sarx r9, rcx, rcx
sarx r9, rdx, rdi
sarx r9, rsp, r8
sarx r9, r12, r10
sarx r9, rax, rsi
sarx rsp, rax, rsi | 15.7 | 18 | 0.694268 |
5f6bb83ba1106ace330c7c3f5d1faba5aab7fa3c | 169 | asm | Assembly | src/main/fragment/mos6502-common/vwsm1=vwsm1_ror_5.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | 2 | 2022-03-01T02:21:14.000Z | 2022-03-01T04:33:35.000Z | src/main/fragment/mos6502-common/vwsm1=vwsm1_ror_5.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | src/main/fragment/mos6502-common/vwsm1=vwsm1_ror_5.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | lda {m1}
sta $ff
lda {m1}+1
sta {m1}
lda #0
bit {m1}+1
bpl !+
lda #$ff
!:
sta {m1}+1
rol $ff
rol {m1}
rol {m1}+1
rol $ff
rol {m1}
rol {m1}+1
rol $ff
rol {m1}
rol {m1}+1
| 8.45 | 10 | 0.550296 |
6e83c961011b75e84ae65ecf476fd1530d64ad2e | 2,236 | asm | Assembly | I2C_Slave_Code_Dev/I2C_SlaveCore/asm/src/sys_timers.asm | CmdrZin/chips_avr_examples | d4b57a8efd6aff2a678adef4fd405e6359e891e6 | [
"MIT"
] | 5 | 2017-04-17T15:11:40.000Z | 2021-12-13T23:52:09.000Z | I2C_Slave_Code_Dev/I2C_SlaveCore/asm/src/sys_timers.asm | CmdrZin/chips_avr_examples | d4b57a8efd6aff2a678adef4fd405e6359e891e6 | [
"MIT"
] | null | null | null | I2C_Slave_Code_Dev/I2C_SlaveCore/asm/src/sys_timers.asm | CmdrZin/chips_avr_examples | d4b57a8efd6aff2a678adef4fd405e6359e891e6 | [
"MIT"
] | null | null | null | /*
* System Timer Utility - MOD for Servo timing generation.
*
* org: 6/28/2014
* rev: 01/20/2015
* auth: Nels "Chip" Pearson
*
* Dependencies
* none
*
* Target: Any AVR
*
* Usage:
* .include sys_timers.asm
*
*/
; 1ms tic flags
.equ FLOOR_1MS_TIC = GPIOR00 ; Floor/Line Detectors
.equ RNG_1MS_TIC = GPIOR01 ; Side sensors
;.equ = GPIOR02 ;
;.equ = GPIOR03 ;
; 10ms tic flags
;.equ = GPIOR04 ; Optical Range Sensor
.equ SWITCH_10MS_TIC = GPIOR05 ; Single Button and LED Service
.equ KP_DS_SW_10MS = GPIOR06 ; KeyPad and 7 Seg Display service
.equ DEMO_10MS_TIC = GPIOR07 ; Demo service
.equ SLOW_TIC = 10 ; 1ms * N for the slow tic
.DSEG
st_cnt_10ms: .BYTE 1 ; secondary timer counter.
.CSEG
/*
* Set up Timer0 to generate 1ms and 10ms System Time Tics using 20MHz CPU clock.
* GPIOR0 is used to provide TIC flags.
* Call this once after RESET.
*
* Modifies: OCR0A, TCCR0A, TIMSK0, TCCR0B, and GPIOR0
*
* input reg: none
* output reg: none
* resources: R16
*
* NOTE: 10ms and 1ms flags generated.
*
*/
st_init_tmr0:
ldi R16, 77 ; (20MHz) 2 * 256 * (1 + OCR0A) : 512 * (40*2) : 1024 * 40 * 2
out OCR0A, R16
ldi R16, (1<<WGM01)
out TCCR0A, R16
ldi R16, (1<<OCIE0A)
sts TIMSK0, R16 ; enable counter 0 OCO intr
;
ldi R16, 0b100 ; CPU div 256
out TCCR0B, R16
;
ldi R16, SLOW_TIC ; set for 10ms count.
sts st_cnt_10ms, R16
;
clr R16
sts GPIOR0, R16 ; clear all tic flags
;
ret
/*
* Timer1 setup for Two Channel Servo by pwm_servo_lib
*/
/*
* Timer0 CTC (compare) interrupt service.
* Called each 1ms
*
* input reg: none
* output reg: none
* resources: GPIOR0.GPIR00:7
* SRAM 1 byte
* Stack:3
*
*/
st_tmr0_intr:
; Save SREG
push R0
in R0, SREG
push R0
;
push R16
; tic1ms flags
sbi GPIOR0, GPIOR00 ;
sbi GPIOR0, GPIOR01 ;
sbi GPIOR0, GPIOR02 ;
sbi GPIOR0, GPIOR03 ;
;
lds R16, st_cnt_10ms ; get counter
dec R16
brne st_skip00
ldi R16, SLOW_TIC ; reload 10ms count down.
; tic10ms flags
sbi GPIOR0, GPIOR04 ;
sbi GPIOR0, GPIOR05 ;
sbi GPIOR0, GPIOR06 ;
sbi GPIOR0, GPIOR07 ;
;
st_skip00:
sts st_cnt_10ms, R16 ; update
pop R16
; Restore SREG
pop R0
out SREG, R0
pop R0
;
reti
| 19.443478 | 81 | 0.650268 |
6e8ba1a1254311c280a1ba5816928d5d636d727b | 36 | asm | Assembly | Gas/Dos/GLOB/G_Global.asm | Gabidal/GAS_Pack | 02f13531849bc5c03721a4319a9e315a60ba7707 | [
"MIT"
] | 1 | 2021-09-21T13:07:37.000Z | 2021-09-21T13:07:37.000Z | Gas/Dos/GLOB/G_Global.asm | Gabidal/GAS_Pack | 02f13531849bc5c03721a4319a9e315a60ba7707 | [
"MIT"
] | null | null | null | Gas/Dos/GLOB/G_Global.asm | Gabidal/GAS_Pack | 02f13531849bc5c03721a4319a9e315a60ba7707 | [
"MIT"
] | null | null | null | %macro Glo 1
global %1
%endmacro | 12 | 13 | 0.666667 |
99cae16efcec3a07d342677dfb5e08074f3f6d1f | 311 | asm | Assembly | programs/oeis/010/A010994.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/010/A010994.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/010/A010994.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A010994: a(n) = binomial coefficient C(n,41).
; 1,42,903,13244,148995,1370754,10737573,73629072,450978066,2505433700,12777711870,60403728840,266783135710,1108176102180,4353548972850,16253249498640,57902201338905,197548686920970,647520696018735,2044802197953900,6236646703759395
mov $1,$0
add $1,41
bin $1,$0
| 44.428571 | 231 | 0.826367 |
b477ad8592033738a41242feb0852571ee7a26be | 4,283 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1298.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1298.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_1298.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %rax
push %rdi
push %rsi
lea addresses_D_ht+0x7081, %rdi
nop
nop
add %rax, %rax
vmovups (%rdi), %ymm7
vextracti128 $1, %ymm7, %xmm7
vpextrq $0, %xmm7, %r12
nop
dec %rsi
pop %rsi
pop %rdi
pop %rax
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r8
push %rbx
push %rcx
push %rdi
push %rdx
// Load
lea addresses_WC+0x11a0c, %r13
nop
nop
dec %rcx
movb (%r13), %r8b
nop
nop
inc %r11
// Faulty Load
lea addresses_normal+0x2521, %rcx
nop
nop
nop
add $749, %rdi
mov (%rcx), %edx
lea oracles, %rcx
and $0xff, %rdx
shlq $12, %rdx
mov (%rcx,%rdx,1), %rdx
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r8
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 5}}
{'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
*/
| 57.878378 | 2,999 | 0.660985 |
8b9cf0fd3aeb754625aa07dc5b969e1afc348047 | 499 | asm | Assembly | programs/oeis/334/A334414.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/334/A334414.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/334/A334414.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A334414: First differences of A334415.
; 0,1,0,1,0,0,1,0,0,1,0,1,0,0,1,0,0,1,0,1,0,0,1,0,1,0,0,1,0,0,1,0,1,0,0,1,0,1,0,0,1,0,0,1,0,1,0,0,1,0,0,1,0,1,0,0,1,0,1,0,0,1,0,0,1,0,1,0,0,1,0,1,0,0,1,0,0,1,0,1,0,0,1,0,0,1,0,1,0
mov $8,$0
mov $10,2
lpb $10,1
clr $0,8
mov $0,$8
sub $10,1
add $0,$10
mul $0,13
mov $1,34
lpb $0,1
sub $0,$1
add $2,4
lpe
mov $1,$2
mov $11,$10
lpb $11,1
mov $9,$1
sub $11,1
lpe
lpe
lpb $8,1
mov $8,0
sub $9,$1
lpe
mov $1,$9
div $1,4
| 16.633333 | 179 | 0.507014 |
0b2dcd32399c2ebf47e0e6db33d31179b35ca077 | 273 | asm | Assembly | solutions/57 - Neighborly Sweeper/size-9_speed-982.asm | behrmann/7billionhumans | 36d53daf278ef4f3729bc5cba2f2398d5411bd6d | [
"MIT"
] | 45 | 2018-09-05T04:56:59.000Z | 2021-11-22T08:57:26.000Z | solutions/57 - Neighborly Sweeper/size-9_speed-982.asm | behrmann/7billionhumans | 36d53daf278ef4f3729bc5cba2f2398d5411bd6d | [
"MIT"
] | 36 | 2018-09-01T11:34:26.000Z | 2021-05-19T23:20:49.000Z | solutions/57 - Neighborly Sweeper/size-9_speed-982.asm | behrmann/7billionhumans | 36d53daf278ef4f3729bc5cba2f2398d5411bd6d | [
"MIT"
] | 36 | 2018-09-01T07:44:19.000Z | 2021-09-10T19:07:35.000Z | -- 7 Billion Humans (2145) --
-- 57: Neighborly Sweeper --
-- Author: landfillbaby
-- Size: 9
-- Speed: 982
a:
step nw,w,sw,n,s,ne,e,se
pickup c
mem1 = set 0
mem2 = foreachdir nw,w,sw,n,s,ne,e,se:
if mem2 >= 0:
mem1 = calc mem1 + 1
endif
endfor
write mem1
drop
jump a | 14.368421 | 38 | 0.641026 |
70e11cf332d148fc1c6fd61a4ee7253a81e3b2a5 | 365 | asm | Assembly | 002-assembly/hello-world.asm | dingjingmaster/learn-kernel | befb4ef7ff56145d268e79fe1d18a5c11433c11a | [
"MIT"
] | null | null | null | 002-assembly/hello-world.asm | dingjingmaster/learn-kernel | befb4ef7ff56145d268e79fe1d18a5c11433c11a | [
"MIT"
] | null | null | null | 002-assembly/hello-world.asm | dingjingmaster/learn-kernel | befb4ef7ff56145d268e79fe1d18a5c11433c11a | [
"MIT"
] | null | null | null | .data
msg: .ascii "Hello World\n"
.text
.global _start
_start:
movq $1, %rax # 写 系统调用
movq $1, %rdi # 标准输出文件描述符
movq $msg, %rsi # 字符串地址
movq $12, %rdx
syscall # 调用 写操作
movq $60, %rax # exit 调用
movq $0, %rdi #
syscall # 调用
| 20.277778 | 39 | 0.391781 |
1b86f287b0a0d6e0eb7f674cf6150ae66fa76e3d | 3,362 | asm | Assembly | src/rt/minit.asm | deviator/druntime | ae624e08220295429b254547c2cae2d56e56341d | [
"BSL-1.0"
] | 373 | 2016-04-18T23:26:39.000Z | 2022-03-31T18:28:11.000Z | src/rt/minit.asm | deviator/druntime | ae624e08220295429b254547c2cae2d56e56341d | [
"BSL-1.0"
] | 2,188 | 2016-04-16T04:50:32.000Z | 2022-03-31T20:13:15.000Z | src/rt/minit.asm | deviator/druntime | ae624e08220295429b254547c2cae2d56e56341d | [
"BSL-1.0"
] | 337 | 2016-04-22T21:17:10.000Z | 2022-03-28T10:16:20.000Z | ;_ minit.asm
; Module initialization support.
;
; Copyright: Copyright Digital Mars 2000 - 2010.
; License: $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
; Authors: Walter Bright
;
; Copyright Digital Mars 2000 - 2010.
; Distributed under the Boost Software License, Version 1.0.
; (See accompanying file LICENSE or copy at
; http://www.boost.org/LICENSE_1_0.txt)
;
; With VC installed, build with:
; ml /omf minit.asm
.model FLAT
ifdef _WIN32
DATAGRP EQU FLAT
else
DATAGRP EQU DGROUP
endif
; Provide a default resolution for weak extern records, no way in C
; to define an omf symbol with a specific value
public __nullext
__nullext equ 0
extrn __moduleinfo_array:near
; This bit of assembler is needed because, from C or D, one cannot
; specify the names of data segments. Why does this matter?
; All the ModuleInfo pointers are placed into a segment named 'FM'.
; The order in which they are placed in 'FM' is arbitrarily up to the linker.
; In order to walk all the pointers, we need to be able to find the
; beginning and the end of the 'FM' segment.
; This is done by bracketing the 'FM' segment with two other, empty,
; segments named 'FMB' and 'FME'. Since this module is the only one that
; ever refers to 'FMB' and 'FME', we get to control the order in which
; these segments appear relative to 'FM' by using a GROUP statement.
; So, we have in memory:
; FMB empty segment
; FM contains all the pointers
; FME empty segment
; and finding the limits of FM is as easy as taking the address of FMB
; and the address of FME.
; These segments bracket FM, which contains the list of ModuleInfo pointers
FMB segment dword use32 public 'DATA'
FMB ends
FM segment dword use32 public 'DATA'
FM ends
FME segment dword use32 public 'DATA'
FME ends
; This leaves room in the _fatexit() list for _moduleDtor()
XOB segment dword use32 public 'BSS'
XOB ends
XO segment dword use32 public 'BSS'
dd ?
XO ends
XOE segment dword use32 public 'BSS'
XOE ends
DGROUP group FMB,FM,FME
; These segments bracket DP, which contains the _DATA pointer references
public __DPbegin, __DPend
DPB segment dword use32 public 'CODE'
__DPbegin:
DPB ends
DP segment dword use32 public 'CODE'
DP ends
DPE segment dword use32 public 'CODE'
__DPend:
DPE ends
CGROUP group DPB,DP,DPE
; These segments bracket TP, which contains the TLS pointer references
public __TPbegin, __TPend
TPB segment dword use32 public 'CODE'
__TPbegin:
TPB ends
TP segment dword use32 public 'CODE'
TP ends
TPE segment dword use32 public 'CODE'
__TPend:
TPE ends
CGROUP group TPB,TP,TPE
_TEXT segment para use32 public 'CODE'
assume CS:_TEXT
; extern (C) void _minit();
; Converts array of ModuleInfo pointers to a D dynamic array of them,
; so they can be accessed via D.
; Result is written to:
; extern (C) ModuleInfo[] _moduleinfo_array;
public __minit
__minit:
mov EDX,offset DATAGRP:FMB
mov EAX,offset DATAGRP:FME
mov dword ptr __moduleinfo_array+4,EDX
sub EAX,EDX ; size in bytes of FM segment
shr EAX,2 ; convert to array length
mov dword ptr __moduleinfo_array,EAX
ret
_TEXT ends
end
| 29.234783 | 77 | 0.697204 |
0283a8f496a0a036889b0d9ca2b8d140a22aff34 | 629 | asm | Assembly | waterbackground/_includes/vint.asm | ArcadeTV/megadrive-samples | bb00902a844f63d55c6f449d50b0ae8a72c3c05e | [
"CC0-1.0"
] | 5 | 2021-05-15T21:47:38.000Z | 2022-03-27T19:33:15.000Z | waterbackground/_includes/vint.asm | ArcadeTV/megadrive-samples | bb00902a844f63d55c6f449d50b0ae8a72c3c05e | [
"CC0-1.0"
] | 1 | 2021-06-09T10:17:41.000Z | 2021-06-09T15:07:37.000Z | whitenoise/_includes/vint.asm | ArcadeTV/megadrive-samples | bb00902a844f63d55c6f449d50b0ae8a72c3c05e | [
"CC0-1.0"
] | null | null | null | ;==============================================================
; Vertical Interrupt
;==============================================================
INT_VInterrupt:
movem.l d0-a6,-(sp)
move.b #$FF,(RAM_VINT_FLAG)
add.l #1,(RAM_CURRENT_FRAME).l
not.b (RAM_TICTOC).l
INT_VInterrupt_return:
movem.l (sp)+,d0-a6
rte
;-------------------------------------------------------------------------------
; WaitVBlank
;-------------------------------------------------------------------------------
WaitVBlank:
cmpi.b #$FF,(RAM_VINT_FLAG)
bne.s WaitVBlank ; loop until flag changes
move.b #$00,(RAM_VINT_FLAG)
rts
| 26.208333 | 80 | 0.372019 |
d49ae1ae8808d0bd5a2c58229d0ca2620d72110a | 426 | asm | Assembly | libsrc/target/tvc/sound/tvc_is_os_sound_playing.asm | dikdom/z88dk | 40c55771062b0ea9bb2f0d5b73e2f754fc12b6b0 | [
"ClArtistic"
] | null | null | null | libsrc/target/tvc/sound/tvc_is_os_sound_playing.asm | dikdom/z88dk | 40c55771062b0ea9bb2f0d5b73e2f754fc12b6b0 | [
"ClArtistic"
] | 2 | 2022-03-20T22:17:35.000Z | 2022-03-24T16:10:00.000Z | libsrc/target/tvc/sound/tvc_is_os_sound_playing.asm | jorgegv/z88dk | 127130cf11f9ff268ba53e308138b12d2b9be90a | [
"ClArtistic"
] | null | null | null | ; Videoton TV Computer ASM stub
; Sandor Vass - 2022
;
; Returns if OS is playing a sound or not
;
SECTION code_clib
PUBLIC tvc_is_os_sound_playing
INCLUDE "target/tvc/def/tvc.def"
;
; Returns false (0) if no sound is being played, true (1) otherwise
;
.tvc_is_os_sound_playing
._tvc_is_os_sound_playing
ld h,0
ld l,h
ld a,(SND_ACTIVE)
or a
ret z
inc l
ret
| 18.521739 | 67 | 0.63615 |
0fffa2a1836d56cbc767723097f500476b4eb6ad | 237 | asm | Assembly | kernel/asm/tss.asm | lowlevelmemes/echidnaOS | 5f9ee308988eff00b61eddf69321d8e153991db0 | [
"BSD-2-Clause"
] | 11 | 2020-10-06T18:44:20.000Z | 2021-03-23T18:23:16.000Z | kernel/asm/tss.asm | lowlevelmemes/echidnaOS | 5f9ee308988eff00b61eddf69321d8e153991db0 | [
"BSD-2-Clause"
] | 1 | 2020-10-07T03:31:11.000Z | 2020-10-07T03:31:11.000Z | kernel/asm/tss.asm | lowlevelmemes/echidnaOS | 5f9ee308988eff00b61eddf69321d8e153991db0 | [
"BSD-2-Clause"
] | 3 | 2020-10-06T18:49:45.000Z | 2020-10-10T05:30:56.000Z | extern ring0_stack.top
global TSS
global TSS_size
section .data
align 4
TSS_begin:
dd 0
dd ring0_stack.top
dd 0x10
dd 0xf000
dd 0x21
times 21 dd 0
TSS_end:
TSS dd TSS_begin
TSS_size dd TSS_end - TSS_begin - 1
| 11.85 | 35 | 0.700422 |
023fba6cc7f9efe43157d3807edb6a4ed0110e3a | 581 | asm | Assembly | oeis/198/A198855.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/198/A198855.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/198/A198855.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A198855: a(n) = 7*8^n - 1.
; 6,55,447,3583,28671,229375,1835007,14680063,117440511,939524095,7516192767,60129542143,481036337151,3848290697215,30786325577727,246290604621823,1970324836974591,15762598695796735,126100789566373887,1008806316530991103,8070450532247928831,64563604257983430655,516508834063867445247,4132070672510939561983,33056565380087516495871,264452523040700131966975,2115620184325601055735807,16924961474604808445886463,135399691796838467567091711,1083197534374707740536733695,8665580274997661924293869567
mov $1,8
pow $1,$0
sub $1,1
mul $1,7
add $1,6
mov $0,$1
| 58.1 | 494 | 0.869191 |
88f3a2626bb32235e27cd331d4793232cf4bb4b6 | 5,020 | asm | Assembly | software/minol/source/commands/input.asm | paulscottrobson/retrochallenge-jan-2016 | 8bd340efc85969fa6f2fecc788aa21b27123a4db | [
"MIT"
] | null | null | null | software/minol/source/commands/input.asm | paulscottrobson/retrochallenge-jan-2016 | 8bd340efc85969fa6f2fecc788aa21b27123a4db | [
"MIT"
] | null | null | null | software/minol/source/commands/input.asm | paulscottrobson/retrochallenge-jan-2016 | 8bd340efc85969fa6f2fecc788aa21b27123a4db | [
"MIT"
] | null | null | null | ; ****************************************************************************************************************
; ****************************************************************************************************************
;
; IN command
;
; ****************************************************************************************************************
; ****************************************************************************************************************
jmp CIN_Over2
CMD_In:
lpi p3,EvaluateAddressPair-1 ; set P3 to call evaluate pair (H,L)
scl ; indicates no error
ld (p1) ; look at first character
jz CIN_Over2 ; if zero or ':' then end of IN
xri ':'
jz CIN_Over2
ld @1(p1) ; fetch and bump
xri ',' ; ignora commas
jz CMD_In
xri ' '!',' ; ignore spaces.
jz CMD_In
xri '('!' ' ; open bracket is Input to (H,L)
jz CIN_Memory
xri '$'!'(' ; $(H,L) is input to memory.
jz CIN_String
; ****************************************************************************************************************
; Check for A-Z input.
; ****************************************************************************************************************
ld -1(p1) ; get letter of variable
ccl
adi 255-'Z' ; check if > 'Z'
jp CIN_Syntax
adi 26 ; will be +ve if A..Z now
jp CIN_Variable
; ****************************************************************************************************************
; Syntax error - not (x,x) $(x,x) or A..Z
; ****************************************************************************************************************
CIN_Syntax:
ldi ERRC_Syntax
xae
ccl
CIN_Over2:
jmp CIN_Over
; ****************************************************************************************************************
; Input to variable in A (0-25)
; ****************************************************************************************************************
CIN_Variable:
ccl ; add variable number 0-25 to Variables to get an address
adi Variables & 255
st -2(p2)
ldi Variables / 256
adi 0
st -1(p2)
jmp CIN_InputVariableOrMemory
; ****************************************************************************************************************
; Input to (<expr>,<expr>)
; ****************************************************************************************************************
CIN_Memory:
ld @-1(p1) ; point to the bracket.
xppc p3 ; push the H,L on the stack, without the stack being changed
jp CIN_Over ; exit on error.
; ****************************************************************************************************************
; Input to variable or memory address is hidden on TOS.
; ****************************************************************************************************************
CIN_InputVariableOrMemory:
ld @-2(p2) ; save the storage address as TOS "Make it visible"
pushp p1 ; save P1 on stack
lpi p3,GetString-1 ; read keyboard
lpi p1,KeyboardBuffer ; point P1 to keyboard buffer.
ldi KeyboardBufferSize ; buffer size
xppc p3 ; read it in.
lpi p3,GetConstant-1 ; extract constant to E if any
xppc p3
ani 0x80 ; if CY/L set, e.g. is it legal
jnz CIN_StoreValue ; if so, store E at the address.
ld (p1) ; get the character code of the first letter
xae ; into E
CIN_StoreValue:
pullp p1 ; restore P1
ld @1(p2) ; get low byte to P3.L
xpal p3
ld @1(p2) ; get high byte to P3.H
xpah p3
lde ; get E, value to store
st (p3) ; and write it.
CMD_In2:
jmp CMD_In ; and see if there is more to input
; ****************************************************************************************************************
; Input String to Memory
; ****************************************************************************************************************
CIN_String:
xppc p3 ; evaluate (H,L)
jp CIN_Over ; exit on error.
ld -1(p2) ; read High
xpah p1 ; put into P1.H
st -1(p2)
ld -2(p2) ; read Low
xpal p1 ; put into P1.L
st @-2(p2) ; save on stack
lpi p3,GetString-1 ; read keyboard
ldi KeyboardBufferSize ; max size of input
xppc p3 ; read keyboard into address
CIN_FindEnd: ; look for EOS (NULL)
ld @1(p1)
jnz CIN_FindEnd
dld -1(p1) ; convert $00 to $FF
ld @1(p2) ; pop P1
xpal p1
ld @1(p2)
xpah p1
jmp CMD_In2 ; see if more input
CIN_Over:
| 38.030303 | 114 | 0.331275 |
e0c7b06c271cdbd0d0b6f57583a096217ffaed90 | 57,873 | asm | Assembly | Section11_Templates/Introduction_To_Templates/Introduction_To_Templates/Debug/Source.asm | AlvinToh/Complete-Modern-C- | d0875394b52dcf87b67b38763c4b82ce4cbdd1a3 | [
"MIT"
] | 1 | 2022-02-04T18:38:34.000Z | 2022-02-04T18:38:34.000Z | Section11_Templates/Introduction_To_Templates/Introduction_To_Templates/Debug/Source.asm | AlvinToh/Complete-Modern-C- | d0875394b52dcf87b67b38763c4b82ce4cbdd1a3 | [
"MIT"
] | null | null | null | Section11_Templates/Introduction_To_Templates/Introduction_To_Templates/Debug/Source.asm | AlvinToh/Complete-Modern-C- | d0875394b52dcf87b67b38763c4b82ce4cbdd1a3 | [
"MIT"
] | null | null | null | ; Listing generated by Microsoft (R) Optimizing Compiler Version 19.25.28614.0
TITLE C:\Users\User\Desktop\Alvin_Personal_Projects\Coding_Languages\Complete-Modern-C\Section11_Templates\Introduction_To_Templates\Introduction_To_Templates\Source.cpp
.686P
.XMM
include listing.inc
.model flat
INCLUDELIB MSVCRTD
INCLUDELIB OLDNAMES
msvcjmc SEGMENT
__47A90C35_vcruntime_new@h DB 01H
__09340588_corecrt_math@h DB 01H
__24E9E95F_stdlib@h DB 01H
__3ADEFC50_cstdlib DB 01H
__214B6046_cmath DB 01H
__F66CEB67_corecrt_stdio_config@h DB 01H
__101834BA_corecrt_wstdio@h DB 01H
__AD6A91B7_stdio@h DB 01H
__AF2D6193_type_traits DB 01H
__B0C4CEA9_malloc@h DB 01H
__99999F74_vcruntime_exception@h DB 01H
__0ABCEC93_exception DB 01H
__367CC694_corecrt_memcpy_s@h DB 01H
__35D7DDB3_corecrt_memory@h DB 01H
__DC9673E3_corecrt_wstring@h DB 01H
__A29A7DFB_string@h DB 01H
__5467428D_corecrt_wconio@h DB 01H
__4442441F_corecrt_wio@h DB 01H
__45F4AF76_corecrt_wtime@h DB 01H
__186FF47F_stat@h DB 01H
__534C724A_wchar@h DB 01H
__EA1B4990_limits DB 01H
__E4812FB1_xutility DB 01H
__67461A18_xmemory DB 01H
__13959C84_xstring DB 01H
__83F2D6CE_stdexcept DB 01H
__81F03EE0_xcall_once@h DB 01H
__3EAD2CC0_system_error DB 01H
__84C161B0_vcruntime_typeinfo@h DB 01H
__945EDCA8_typeinfo DB 01H
__56B5451E_memory DB 01H
__7AF01211_xfacet DB 01H
__7242C389_ctype@h DB 01H
__8BD73F60_xlocinfo DB 01H
__CCABE8B5_xlocale DB 01H
__B2324873_xiosbase DB 01H
__522C8EA2_xlocnum DB 01H
__5781BAB1_ios DB 01H
__41122F1E_Source@cpp DB 01H
__BC6B074B_istream DB 01H
__DFBB3271_ostream DB 01H
__81526E72_streambuf DB 01H
__26F29C16_iosfwd DB 01H
__0DD379DB_utility DB 01H
__FACCEEC9_xstddef DB 01H
__00B06045_xatomic@h DB 01H
msvcjmc ENDS
PUBLIC ?__empty_global_delete@@YAXPAX@Z ; __empty_global_delete
PUBLIC ?__empty_global_delete@@YAXPAXI@Z ; __empty_global_delete
PUBLIC ?length@?$_Narrow_char_traits@DH@std@@SAIQBD@Z ; std::_Narrow_char_traits<char,int>::length
PUBLIC ?eq_int_type@?$_Narrow_char_traits@DH@std@@SA_NABH0@Z ; std::_Narrow_char_traits<char,int>::eq_int_type
PUBLIC ?eof@?$_Narrow_char_traits@DH@std@@SAHXZ ; std::_Narrow_char_traits<char,int>::eof
PUBLIC ?name@type_info@@QBEPBDXZ ; type_info::name
PUBLIC ??$Max@D@@YADDD@Z ; Max<char>
PUBLIC _main
PUBLIC ??$Max@M@@YAMMM@Z ; Max<float>
PUBLIC ??$Max@N@@YANNN@Z ; Max<double>
PUBLIC ??$Max@H@@YAHHH@Z ; Max<int>
PUBLIC ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z ; std::operator<<<std::char_traits<char> >
PUBLIC ??$endl@DU?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@@Z ; std::endl<char,std::char_traits<char> >
PUBLIC ??0_Sentry_base@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@AAV12@@Z ; std::basic_ostream<char,std::char_traits<char> >::_Sentry_base::_Sentry_base
PUBLIC ??1_Sentry_base@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@XZ ; std::basic_ostream<char,std::char_traits<char> >::_Sentry_base::~_Sentry_base
PUBLIC ??0sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@AAV12@@Z ; std::basic_ostream<char,std::char_traits<char> >::sentry::sentry
PUBLIC ??1sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@XZ ; std::basic_ostream<char,std::char_traits<char> >::sentry::~sentry
PUBLIC ??Bsentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QBE_NXZ ; std::basic_ostream<char,std::char_traits<char> >::sentry::operator bool
PUBLIC __JustMyCode_Default
PUBLIC ??_R0D@8 ; char `RTTI Type Descriptor'
PUBLIC ??_R0M@8 ; float `RTTI Type Descriptor'
PUBLIC ??_R0N@8 ; double `RTTI Type Descriptor'
PUBLIC ??_R0H@8 ; int `RTTI Type Descriptor'
PUBLIC __real@4008000000000000
PUBLIC __real@4018cccccccccccd
PUBLIC __real@40400000
PUBLIC __real@40b00000
EXTRN ?uncaught_exception@std@@YA_NXZ:PROC ; std::uncaught_exception
EXTRN _strlen:PROC
EXTRN ___std_type_info_name:PROC
EXTRN __imp_?good@ios_base@std@@QBE_NXZ:PROC
EXTRN __imp_?flags@ios_base@std@@QBEHXZ:PROC
EXTRN __imp_?width@ios_base@std@@QBE_JXZ:PROC
EXTRN __imp_?width@ios_base@std@@QAE_J_J@Z:PROC
EXTRN __imp_?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z:PROC
EXTRN __imp_?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE_JPBD_J@Z:PROC
EXTRN __imp_?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z:PROC
EXTRN __imp_?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ:PROC
EXTRN __imp_?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ:PROC
EXTRN __imp_?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDXZ:PROC
EXTRN __imp_?widen@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDD@Z:PROC
EXTRN __imp_?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ:PROC
EXTRN __imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z:PROC
EXTRN __imp_?put@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@D@Z:PROC
EXTRN __imp_?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ:PROC
EXTRN @_RTC_CheckStackVars@8:PROC
EXTRN @__CheckForDebuggerJustMyCode@4:PROC
EXTRN @__security_check_cookie@4:PROC
EXTRN __RTC_CheckEsp:PROC
EXTRN __RTC_InitBase:PROC
EXTRN __RTC_Shutdown:PROC
EXTRN ___CxxFrameHandler3:PROC
EXTRN ??_7type_info@@6B@:QWORD ; type_info::`vftable'
EXTRN ?__type_info_root_node@@3U__type_info_node@@A:BYTE ; __type_info_root_node
EXTRN __imp_?cout@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A:BYTE
EXTRN ___security_cookie:DWORD
EXTRN __fltused:DWORD
; COMDAT __real@40b00000
CONST SEGMENT
__real@40b00000 DD 040b00000r ; 5.5
CONST ENDS
; COMDAT __real@40400000
CONST SEGMENT
__real@40400000 DD 040400000r ; 3
CONST ENDS
; COMDAT __real@4018cccccccccccd
CONST SEGMENT
__real@4018cccccccccccd DQ 04018cccccccccccdr ; 6.2
CONST ENDS
; COMDAT __real@4008000000000000
CONST SEGMENT
__real@4008000000000000 DQ 04008000000000000r ; 3
CONST ENDS
; COMDAT rtc$TMZ
rtc$TMZ SEGMENT
__RTC_Shutdown.rtc$TMZ DD FLAT:__RTC_Shutdown
rtc$TMZ ENDS
; COMDAT rtc$IMZ
rtc$IMZ SEGMENT
__RTC_InitBase.rtc$IMZ DD FLAT:__RTC_InitBase
rtc$IMZ ENDS
; COMDAT ??_R0H@8
data$r SEGMENT
??_R0H@8 DD FLAT:??_7type_info@@6B@ ; int `RTTI Type Descriptor'
DD 00H
DB '.H', 00H
data$r ENDS
; COMDAT ??_R0N@8
data$r SEGMENT
??_R0N@8 DD FLAT:??_7type_info@@6B@ ; double `RTTI Type Descriptor'
DD 00H
DB '.N', 00H
data$r ENDS
; COMDAT ??_R0M@8
data$r SEGMENT
??_R0M@8 DD FLAT:??_7type_info@@6B@ ; float `RTTI Type Descriptor'
DD 00H
DB '.M', 00H
data$r ENDS
; COMDAT ??_R0D@8
data$r SEGMENT
??_R0D@8 DD FLAT:??_7type_info@@6B@ ; char `RTTI Type Descriptor'
DD 00H
DB '.D', 00H
data$r ENDS
; COMDAT xdata$x
xdata$x SEGMENT
__ehfuncinfo$??1sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@XZ DD 019930522H
DD 00H
DD 00H
DD 2 DUP(00H)
DD 2 DUP(00H)
DD 00H
DD 05H
xdata$x ENDS
; COMDAT xdata$x
xdata$x SEGMENT
__unwindtable$??0sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@AAV12@@Z DD 0ffffffffH
DD FLAT:__unwindfunclet$??0sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@AAV12@@Z$0
__ehfuncinfo$??0sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@AAV12@@Z DD 019930522H
DD 01H
DD FLAT:__unwindtable$??0sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@AAV12@@Z
DD 2 DUP(00H)
DD 2 DUP(00H)
DD 00H
DD 01H
xdata$x ENDS
; COMDAT xdata$x
xdata$x SEGMENT
__ehfuncinfo$??1_Sentry_base@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@XZ DD 019930522H
DD 00H
DD 00H
DD 2 DUP(00H)
DD 2 DUP(00H)
DD 00H
DD 05H
xdata$x ENDS
; COMDAT xdata$x
xdata$x SEGMENT
__catchsym$??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z$3 DD 040H
DD 00H
DD 00H
DD FLAT:__catch$??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z$0
__tryblocktable$??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z DD 01H
DD 01H
DD 02H
DD 01H
DD FLAT:__catchsym$??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z$3
__unwindtable$??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z DD 0ffffffffH
DD FLAT:__unwindfunclet$??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z$2
DD 00H
DD 00H
DD 00H
DD 00H
__ehfuncinfo$??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z DD 019930522H
DD 03H
DD FLAT:__unwindtable$??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z
DD 01H
DD FLAT:__tryblocktable$??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z
DD 2 DUP(00H)
DD 00H
DD 01H
xdata$x ENDS
; COMDAT xdata$x
xdata$x SEGMENT
__ehfuncinfo$?name@type_info@@QBEPBDXZ DD 019930522H
DD 00H
DD 00H
DD 2 DUP(00H)
DD 2 DUP(00H)
DD 00H
DD 05H
xdata$x ENDS
; COMDAT xdata$x
xdata$x SEGMENT
__ehfuncinfo$?eof@?$_Narrow_char_traits@DH@std@@SAHXZ DD 019930522H
DD 00H
DD 00H
DD 2 DUP(00H)
DD 2 DUP(00H)
DD 00H
DD 05H
xdata$x ENDS
; COMDAT xdata$x
xdata$x SEGMENT
__ehfuncinfo$?eq_int_type@?$_Narrow_char_traits@DH@std@@SA_NABH0@Z DD 019930522H
DD 00H
DD 00H
DD 2 DUP(00H)
DD 2 DUP(00H)
DD 00H
DD 05H
xdata$x ENDS
; COMDAT xdata$x
xdata$x SEGMENT
__ehfuncinfo$?length@?$_Narrow_char_traits@DH@std@@SAIQBD@Z DD 019930522H
DD 00H
DD 00H
DD 2 DUP(00H)
DD 2 DUP(00H)
DD 00H
DD 05H
xdata$x ENDS
; Function compile flags: /Odt
; COMDAT __JustMyCode_Default
_TEXT SEGMENT
__JustMyCode_Default PROC ; COMDAT
push ebp
mov ebp, esp
pop ebp
ret 0
__JustMyCode_Default ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\ostream
; COMDAT ??Bsentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QBE_NXZ
_TEXT SEGMENT
_this$ = -8 ; size = 4
??Bsentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QBE_NXZ PROC ; std::basic_ostream<char,std::char_traits<char> >::sentry::operator bool, COMDAT
; _this$ = ecx
; 121 : explicit __CLR_OR_THIS_CALL operator bool() const {
push ebp
mov ebp, esp
sub esp, 204 ; 000000ccH
push ebx
push esi
push edi
push ecx
lea edi, DWORD PTR [ebp-204]
mov ecx, 51 ; 00000033H
mov eax, -858993460 ; ccccccccH
rep stosd
pop ecx
mov DWORD PTR _this$[ebp], ecx
mov ecx, OFFSET __DFBB3271_ostream
call @__CheckForDebuggerJustMyCode@4
; 122 : return _Ok;
mov eax, DWORD PTR _this$[ebp]
mov al, BYTE PTR [eax+4]
; 123 : }
pop edi
pop esi
pop ebx
add esp, 204 ; 000000ccH
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
??Bsentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QBE_NXZ ENDP ; std::basic_ostream<char,std::char_traits<char> >::sentry::operator bool
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\ostream
; COMDAT ??1sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@XZ
_TEXT SEGMENT
_this$ = -20 ; size = 4
__$EHRec$ = -12 ; size = 12
??1sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@XZ PROC ; std::basic_ostream<char,std::char_traits<char> >::sentry::~sentry, COMDAT
; _this$ = ecx
; 110 : __CLR_OR_THIS_CALL ~sentry() noexcept {
push ebp
mov ebp, esp
push -1
push __ehhandler$??1sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@XZ
mov eax, DWORD PTR fs:0
push eax
sub esp, 204 ; 000000ccH
push ebx
push esi
push edi
push ecx
lea edi, DWORD PTR [ebp-216]
mov ecx, 51 ; 00000033H
mov eax, -858993460 ; ccccccccH
rep stosd
pop ecx
mov eax, DWORD PTR ___security_cookie
xor eax, ebp
push eax
lea eax, DWORD PTR __$EHRec$[ebp]
mov DWORD PTR fs:0, eax
mov DWORD PTR _this$[ebp], ecx
mov ecx, OFFSET __DFBB3271_ostream
call @__CheckForDebuggerJustMyCode@4
; 111 : #if _HAS_EXCEPTIONS
; 112 : if (!_STD uncaught_exception()) { // TRANSITION, ArchivedOS-12000909
call ?uncaught_exception@std@@YA_NXZ ; std::uncaught_exception
movzx eax, al
test eax, eax
jne SHORT $LN1@sentry
; 113 : this->_Myostr._Osfx();
mov esi, esp
mov eax, DWORD PTR _this$[ebp]
mov ecx, DWORD PTR [eax]
call DWORD PTR __imp_?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ
cmp esi, esp
call __RTC_CheckEsp
$LN1@sentry:
; 114 : }
; 115 : #else // _HAS_EXCEPTIONS
; 116 : this->_Myostr._Osfx();
; 117 : #endif // _HAS_EXCEPTIONS
; 118 : }
mov ecx, DWORD PTR _this$[ebp]
call ??1_Sentry_base@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@XZ ; std::basic_ostream<char,std::char_traits<char> >::_Sentry_base::~_Sentry_base
mov ecx, DWORD PTR __$EHRec$[ebp]
mov DWORD PTR fs:0, ecx
pop ecx
pop edi
pop esi
pop ebx
add esp, 216 ; 000000d8H
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
_TEXT ENDS
; COMDAT text$x
text$x SEGMENT
__ehhandler$??1sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@XZ:
mov edx, DWORD PTR [esp+8]
lea eax, DWORD PTR [edx+12]
mov ecx, DWORD PTR [edx-220]
xor ecx, eax
call @__security_check_cookie@4
mov eax, OFFSET __ehfuncinfo$??1sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@XZ
jmp ___CxxFrameHandler3
text$x ENDS
??1sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@XZ ENDP ; std::basic_ostream<char,std::char_traits<char> >::sentry::~sentry
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\ostream
; COMDAT ??0sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@AAV12@@Z
_TEXT SEGMENT
__Tied$ = -32 ; size = 4
_this$ = -20 ; size = 4
__$EHRec$ = -12 ; size = 12
__Ostr$ = 8 ; size = 4
??0sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@AAV12@@Z PROC ; std::basic_ostream<char,std::char_traits<char> >::sentry::sentry, COMDAT
; _this$ = ecx
; 92 : explicit __CLR_OR_THIS_CALL sentry(basic_ostream& _Ostr) : _Sentry_base(_Ostr) {
push ebp
mov ebp, esp
push -1
push __ehhandler$??0sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@AAV12@@Z
mov eax, DWORD PTR fs:0
push eax
sub esp, 216 ; 000000d8H
push ebx
push esi
push edi
push ecx
lea edi, DWORD PTR [ebp-228]
mov ecx, 54 ; 00000036H
mov eax, -858993460 ; ccccccccH
rep stosd
pop ecx
mov eax, DWORD PTR ___security_cookie
xor eax, ebp
push eax
lea eax, DWORD PTR __$EHRec$[ebp]
mov DWORD PTR fs:0, eax
mov DWORD PTR _this$[ebp], ecx
mov ecx, OFFSET __DFBB3271_ostream
call @__CheckForDebuggerJustMyCode@4
mov eax, DWORD PTR __Ostr$[ebp]
push eax
mov ecx, DWORD PTR _this$[ebp]
call ??0_Sentry_base@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@AAV12@@Z ; std::basic_ostream<char,std::char_traits<char> >::_Sentry_base::_Sentry_base
mov DWORD PTR __$EHRec$[ebp+8], 0
; 93 : if (!_Ostr.good()) {
mov eax, DWORD PTR __Ostr$[ebp]
mov ecx, DWORD PTR [eax]
mov edx, DWORD PTR __Ostr$[ebp]
add edx, DWORD PTR [ecx+4]
mov esi, esp
mov ecx, edx
call DWORD PTR __imp_?good@ios_base@std@@QBE_NXZ
cmp esi, esp
call __RTC_CheckEsp
movzx eax, al
test eax, eax
jne SHORT $LN2@sentry
; 94 : _Ok = false;
mov eax, DWORD PTR _this$[ebp]
mov BYTE PTR [eax+4], 0
; 95 : return;
jmp SHORT $LN1@sentry
$LN2@sentry:
; 96 : }
; 97 :
; 98 : const auto _Tied = _Ostr.tie();
mov eax, DWORD PTR __Ostr$[ebp]
mov ecx, DWORD PTR [eax]
mov edx, DWORD PTR __Ostr$[ebp]
add edx, DWORD PTR [ecx+4]
mov esi, esp
mov ecx, edx
call DWORD PTR __imp_?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ
cmp esi, esp
call __RTC_CheckEsp
mov DWORD PTR __Tied$[ebp], eax
; 99 : if (!_Tied || _Tied == &_Ostr) {
cmp DWORD PTR __Tied$[ebp], 0
je SHORT $LN4@sentry
mov eax, DWORD PTR __Tied$[ebp]
cmp eax, DWORD PTR __Ostr$[ebp]
jne SHORT $LN3@sentry
$LN4@sentry:
; 100 : _Ok = true;
mov eax, DWORD PTR _this$[ebp]
mov BYTE PTR [eax+4], 1
; 101 : return;
jmp SHORT $LN1@sentry
$LN3@sentry:
; 102 : }
; 103 :
; 104 :
; 105 : _Tied->flush();
mov esi, esp
mov ecx, DWORD PTR __Tied$[ebp]
call DWORD PTR __imp_?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ
cmp esi, esp
call __RTC_CheckEsp
; 106 : _Ok = _Ostr.good(); // store test only after flushing tie
mov eax, DWORD PTR __Ostr$[ebp]
mov ecx, DWORD PTR [eax]
mov edx, DWORD PTR __Ostr$[ebp]
add edx, DWORD PTR [ecx+4]
mov esi, esp
mov ecx, edx
call DWORD PTR __imp_?good@ios_base@std@@QBE_NXZ
cmp esi, esp
call __RTC_CheckEsp
mov ecx, DWORD PTR _this$[ebp]
mov BYTE PTR [ecx+4], al
$LN1@sentry:
; 107 : }
mov DWORD PTR __$EHRec$[ebp+8], -1
mov eax, DWORD PTR _this$[ebp]
mov ecx, DWORD PTR __$EHRec$[ebp]
mov DWORD PTR fs:0, ecx
pop ecx
pop edi
pop esi
pop ebx
add esp, 228 ; 000000e4H
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 4
_TEXT ENDS
; COMDAT text$x
text$x SEGMENT
__unwindfunclet$??0sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@AAV12@@Z$0:
mov ecx, DWORD PTR _this$[ebp]
jmp ??1_Sentry_base@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@XZ ; std::basic_ostream<char,std::char_traits<char> >::_Sentry_base::~_Sentry_base
__ehhandler$??0sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@AAV12@@Z:
mov edx, DWORD PTR [esp+8]
lea eax, DWORD PTR [edx+12]
mov ecx, DWORD PTR [edx-232]
xor ecx, eax
call @__security_check_cookie@4
mov eax, OFFSET __ehfuncinfo$??0sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@AAV12@@Z
jmp ___CxxFrameHandler3
text$x ENDS
??0sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@AAV12@@Z ENDP ; std::basic_ostream<char,std::char_traits<char> >::sentry::sentry
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\ostream
; COMDAT ??1_Sentry_base@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@XZ
_TEXT SEGMENT
tv72 = -232 ; size = 4
__Rdbuf$ = -32 ; size = 4
_this$ = -20 ; size = 4
__$EHRec$ = -12 ; size = 12
??1_Sentry_base@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@XZ PROC ; std::basic_ostream<char,std::char_traits<char> >::_Sentry_base::~_Sentry_base, COMDAT
; _this$ = ecx
; 78 : __CLR_OR_THIS_CALL ~_Sentry_base() noexcept { // destroy after unlocking
push ebp
mov ebp, esp
push -1
push __ehhandler$??1_Sentry_base@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@XZ
mov eax, DWORD PTR fs:0
push eax
sub esp, 220 ; 000000dcH
push ebx
push esi
push edi
push ecx
lea edi, DWORD PTR [ebp-232]
mov ecx, 55 ; 00000037H
mov eax, -858993460 ; ccccccccH
rep stosd
pop ecx
mov eax, DWORD PTR ___security_cookie
xor eax, ebp
push eax
lea eax, DWORD PTR __$EHRec$[ebp]
mov DWORD PTR fs:0, eax
mov DWORD PTR _this$[ebp], ecx
mov ecx, OFFSET __DFBB3271_ostream
call @__CheckForDebuggerJustMyCode@4
; 79 : const auto _Rdbuf = _Myostr.rdbuf();
mov eax, DWORD PTR _this$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv72[ebp], ecx
mov edx, DWORD PTR tv72[ebp]
mov eax, DWORD PTR [edx]
mov ecx, DWORD PTR tv72[ebp]
add ecx, DWORD PTR [eax+4]
mov esi, esp
call DWORD PTR __imp_?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ
cmp esi, esp
call __RTC_CheckEsp
mov DWORD PTR __Rdbuf$[ebp], eax
; 80 : if (_Rdbuf) {
cmp DWORD PTR __Rdbuf$[ebp], 0
je SHORT $LN3@Sentry_bas
; 81 : _Rdbuf->_Unlock();
mov eax, DWORD PTR __Rdbuf$[ebp]
mov edx, DWORD PTR [eax]
mov esi, esp
mov ecx, DWORD PTR __Rdbuf$[ebp]
mov eax, DWORD PTR [edx+8]
call eax
cmp esi, esp
call __RTC_CheckEsp
$LN3@Sentry_bas:
; 82 : }
; 83 : }
mov ecx, DWORD PTR __$EHRec$[ebp]
mov DWORD PTR fs:0, ecx
pop ecx
pop edi
pop esi
pop ebx
add esp, 232 ; 000000e8H
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
_TEXT ENDS
; COMDAT text$x
text$x SEGMENT
__ehhandler$??1_Sentry_base@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@XZ:
mov edx, DWORD PTR [esp+8]
lea eax, DWORD PTR [edx+12]
mov ecx, DWORD PTR [edx-236]
xor ecx, eax
call @__security_check_cookie@4
mov eax, OFFSET __ehfuncinfo$??1_Sentry_base@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@XZ
jmp ___CxxFrameHandler3
text$x ENDS
??1_Sentry_base@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@XZ ENDP ; std::basic_ostream<char,std::char_traits<char> >::_Sentry_base::~_Sentry_base
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\ostream
; COMDAT ??0_Sentry_base@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@AAV12@@Z
_TEXT SEGMENT
tv73 = -220 ; size = 4
__Rdbuf$ = -20 ; size = 4
_this$ = -8 ; size = 4
__Ostr$ = 8 ; size = 4
??0_Sentry_base@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@AAV12@@Z PROC ; std::basic_ostream<char,std::char_traits<char> >::_Sentry_base::_Sentry_base, COMDAT
; _this$ = ecx
; 71 : __CLR_OR_THIS_CALL _Sentry_base(basic_ostream& _Ostr) : _Myostr(_Ostr) { // lock the stream buffer, if there
push ebp
mov ebp, esp
sub esp, 220 ; 000000dcH
push ebx
push esi
push edi
push ecx
lea edi, DWORD PTR [ebp-220]
mov ecx, 55 ; 00000037H
mov eax, -858993460 ; ccccccccH
rep stosd
pop ecx
mov DWORD PTR _this$[ebp], ecx
mov ecx, OFFSET __DFBB3271_ostream
call @__CheckForDebuggerJustMyCode@4
mov eax, DWORD PTR _this$[ebp]
mov ecx, DWORD PTR __Ostr$[ebp]
mov DWORD PTR [eax], ecx
; 72 : const auto _Rdbuf = _Myostr.rdbuf();
mov eax, DWORD PTR _this$[ebp]
mov ecx, DWORD PTR [eax]
mov DWORD PTR tv73[ebp], ecx
mov edx, DWORD PTR tv73[ebp]
mov eax, DWORD PTR [edx]
mov ecx, DWORD PTR tv73[ebp]
add ecx, DWORD PTR [eax+4]
mov esi, esp
call DWORD PTR __imp_?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ
cmp esi, esp
call __RTC_CheckEsp
mov DWORD PTR __Rdbuf$[ebp], eax
; 73 : if (_Rdbuf) {
cmp DWORD PTR __Rdbuf$[ebp], 0
je SHORT $LN1@Sentry_bas
; 74 : _Rdbuf->_Lock();
mov eax, DWORD PTR __Rdbuf$[ebp]
mov edx, DWORD PTR [eax]
mov esi, esp
mov ecx, DWORD PTR __Rdbuf$[ebp]
mov eax, DWORD PTR [edx+4]
call eax
cmp esi, esp
call __RTC_CheckEsp
$LN1@Sentry_bas:
; 75 : }
; 76 : }
mov eax, DWORD PTR _this$[ebp]
pop edi
pop esi
pop ebx
add esp, 220 ; 000000dcH
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 4
??0_Sentry_base@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@AAV12@@Z ENDP ; std::basic_ostream<char,std::char_traits<char> >::_Sentry_base::_Sentry_base
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\ostream
; COMDAT ??$endl@DU?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@@Z
_TEXT SEGMENT
__Ostr$ = 8 ; size = 4
??$endl@DU?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@@Z PROC ; std::endl<char,std::char_traits<char> >, COMDAT
; 943 : basic_ostream<_Elem, _Traits>& _Ostr) { // insert newline and flush stream
push ebp
mov ebp, esp
sub esp, 192 ; 000000c0H
push ebx
push esi
push edi
lea edi, DWORD PTR [ebp-192]
mov ecx, 48 ; 00000030H
mov eax, -858993460 ; ccccccccH
rep stosd
mov ecx, OFFSET __DFBB3271_ostream
call @__CheckForDebuggerJustMyCode@4
; 944 : _Ostr.put(_Ostr.widen('\n'));
mov esi, esp
push 10 ; 0000000aH
mov eax, DWORD PTR __Ostr$[ebp]
mov ecx, DWORD PTR [eax]
mov edx, DWORD PTR __Ostr$[ebp]
add edx, DWORD PTR [ecx+4]
mov ecx, edx
call DWORD PTR __imp_?widen@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDD@Z
cmp esi, esp
call __RTC_CheckEsp
mov esi, esp
movzx eax, al
push eax
mov ecx, DWORD PTR __Ostr$[ebp]
call DWORD PTR __imp_?put@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@D@Z
cmp esi, esp
call __RTC_CheckEsp
; 945 : _Ostr.flush();
mov esi, esp
mov ecx, DWORD PTR __Ostr$[ebp]
call DWORD PTR __imp_?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ
cmp esi, esp
call __RTC_CheckEsp
; 946 : return _Ostr;
mov eax, DWORD PTR __Ostr$[ebp]
; 947 : }
pop edi
pop esi
pop ebx
add esp, 192 ; 000000c0H
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
??$endl@DU?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@@Z ENDP ; std::endl<char,std::char_traits<char> >
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\ostream
; COMDAT ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z
_TEXT SEGMENT
tv135 = -356 ; size = 8
tv343 = -348 ; size = 8
tv291 = -344 ; size = 4
tv288 = -344 ; size = 8
tv286 = -344 ; size = 4
tv329 = -340 ; size = 8
tv290 = -340 ; size = 4
tv285 = -340 ; size = 4
tv287 = -336 ; size = 4
tv137 = -336 ; size = 4
tv289 = -333 ; size = 1
tv284 = -333 ; size = 1
$T2 = -328 ; size = 4
$T3 = -316 ; size = 4
$T4 = -304 ; size = 4
$T5 = -292 ; size = 4
$T6 = -280 ; size = 4
__Ok$ = -76 ; size = 8
__Pad$ = -60 ; size = 8
__Count$ = -44 ; size = 8
__State$ = -28 ; size = 4
__$ArrayPad$ = -20 ; size = 4
__$EHRec$ = -16 ; size = 16
__Ostr$ = 8 ; size = 4
__Val$ = 12 ; size = 4
??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z PROC ; std::operator<<<std::char_traits<char> >, COMDAT
; 731 : const char* _Val) { // insert NTBS into char stream
push ebp
mov ebp, esp
push -1
push __ehhandler$??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z
mov eax, DWORD PTR fs:0
push eax
push ecx
sub esp, 340 ; 00000154H
push ebx
push esi
push edi
lea edi, DWORD PTR [ebp-356]
mov ecx, 85 ; 00000055H
mov eax, -858993460 ; ccccccccH
rep stosd
mov eax, DWORD PTR ___security_cookie
xor eax, ebp
mov DWORD PTR __$ArrayPad$[ebp], eax
push eax
lea eax, DWORD PTR __$EHRec$[ebp+4]
mov DWORD PTR fs:0, eax
mov DWORD PTR __$EHRec$[ebp], esp
mov ecx, OFFSET __DFBB3271_ostream
call @__CheckForDebuggerJustMyCode@4
; 732 : using _Elem = char;
; 733 : using _Myos = basic_ostream<_Elem, _Traits>;
; 734 :
; 735 : ios_base::iostate _State = ios_base::goodbit;
mov DWORD PTR __State$[ebp], 0
; 736 : streamsize _Count = static_cast<streamsize>(_Traits::length(_Val));
mov eax, DWORD PTR __Val$[ebp]
push eax
call ?length@?$_Narrow_char_traits@DH@std@@SAIQBD@Z ; std::_Narrow_char_traits<char,int>::length
add esp, 4
xor ecx, ecx
mov DWORD PTR __Count$[ebp], eax
mov DWORD PTR __Count$[ebp+4], ecx
; 737 : streamsize _Pad = _Ostr.width() <= 0 || _Ostr.width() <= _Count ? 0 : _Ostr.width() - _Count;
mov eax, DWORD PTR __Ostr$[ebp]
mov ecx, DWORD PTR [eax]
mov edx, DWORD PTR __Ostr$[ebp]
add edx, DWORD PTR [ecx+4]
mov esi, esp
mov ecx, edx
call DWORD PTR __imp_?width@ios_base@std@@QBE_JXZ
cmp esi, esp
call __RTC_CheckEsp
mov DWORD PTR tv329[ebp], eax
mov DWORD PTR tv329[ebp+4], edx
cmp DWORD PTR tv329[ebp+4], 0
jl SHORT $LN17@operator
jg SHORT $LN24@operator
cmp DWORD PTR tv329[ebp], 0
jbe SHORT $LN17@operator
$LN24@operator:
mov eax, DWORD PTR __Ostr$[ebp]
mov ecx, DWORD PTR [eax]
mov edx, DWORD PTR __Ostr$[ebp]
add edx, DWORD PTR [ecx+4]
mov esi, esp
mov ecx, edx
call DWORD PTR __imp_?width@ios_base@std@@QBE_JXZ
cmp esi, esp
call __RTC_CheckEsp
mov DWORD PTR tv343[ebp], eax
mov DWORD PTR tv343[ebp+4], edx
mov eax, DWORD PTR tv343[ebp+4]
cmp eax, DWORD PTR __Count$[ebp+4]
jl SHORT $LN17@operator
jg SHORT $LN25@operator
mov ecx, DWORD PTR tv343[ebp]
cmp ecx, DWORD PTR __Count$[ebp]
jbe SHORT $LN17@operator
$LN25@operator:
mov edx, DWORD PTR __Ostr$[ebp]
mov eax, DWORD PTR [edx]
mov ecx, DWORD PTR __Ostr$[ebp]
add ecx, DWORD PTR [eax+4]
mov esi, esp
call DWORD PTR __imp_?width@ios_base@std@@QBE_JXZ
cmp esi, esp
call __RTC_CheckEsp
sub eax, DWORD PTR __Count$[ebp]
sbb edx, DWORD PTR __Count$[ebp+4]
mov DWORD PTR tv135[ebp], eax
mov DWORD PTR tv135[ebp+4], edx
jmp SHORT $LN18@operator
$LN17@operator:
xorps xmm0, xmm0
movlpd QWORD PTR tv135[ebp], xmm0
$LN18@operator:
mov ecx, DWORD PTR tv135[ebp]
mov DWORD PTR __Pad$[ebp], ecx
mov edx, DWORD PTR tv135[ebp+4]
mov DWORD PTR __Pad$[ebp+4], edx
; 738 : const typename _Myos::sentry _Ok(_Ostr);
mov eax, DWORD PTR __Ostr$[ebp]
push eax
lea ecx, DWORD PTR __Ok$[ebp]
call ??0sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@AAV12@@Z ; std::basic_ostream<char,std::char_traits<char> >::sentry::sentry
mov DWORD PTR __$EHRec$[ebp+12], 0
; 739 :
; 740 : if (!_Ok) {
lea ecx, DWORD PTR __Ok$[ebp]
call ??Bsentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QBE_NXZ ; std::basic_ostream<char,std::char_traits<char> >::sentry::operator bool
movzx eax, al
test eax, eax
jne SHORT $LN8@operator
; 741 : _State |= ios_base::badbit;
mov eax, DWORD PTR __State$[ebp]
or eax, 4
mov DWORD PTR __State$[ebp], eax
; 742 : } else { // state okay, insert
jmp $LN9@operator
$LN8@operator:
; 743 : _TRY_IO_BEGIN
mov BYTE PTR __$EHRec$[ebp+12], 1
; 744 : if ((_Ostr.flags() & ios_base::adjustfield) != ios_base::left) {
mov eax, DWORD PTR __Ostr$[ebp]
mov ecx, DWORD PTR [eax]
mov edx, DWORD PTR __Ostr$[ebp]
add edx, DWORD PTR [ecx+4]
mov esi, esp
mov ecx, edx
call DWORD PTR __imp_?flags@ios_base@std@@QBEHXZ
cmp esi, esp
call __RTC_CheckEsp
mov DWORD PTR tv137[ebp], eax
mov eax, DWORD PTR tv137[ebp]
and eax, 448 ; 000001c0H
cmp eax, 64 ; 00000040H
je $LN11@operator
; 745 : for (; 0 < _Pad; --_Pad) { // pad on left
jmp SHORT $LN4@operator
$LN2@operator:
mov eax, DWORD PTR __Pad$[ebp]
sub eax, 1
mov ecx, DWORD PTR __Pad$[ebp+4]
sbb ecx, 0
mov DWORD PTR __Pad$[ebp], eax
mov DWORD PTR __Pad$[ebp+4], ecx
$LN4@operator:
cmp DWORD PTR __Pad$[ebp+4], 0
jl $LN11@operator
jg SHORT $LN26@operator
cmp DWORD PTR __Pad$[ebp], 0
jbe $LN11@operator
$LN26@operator:
; 746 : if (_Traits::eq_int_type(_Traits::eof(), _Ostr.rdbuf()->sputc(_Ostr.fill()))) {
mov eax, DWORD PTR __Ostr$[ebp]
mov ecx, DWORD PTR [eax]
mov edx, DWORD PTR __Ostr$[ebp]
add edx, DWORD PTR [ecx+4]
mov esi, esp
mov ecx, edx
call DWORD PTR __imp_?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDXZ
cmp esi, esp
call __RTC_CheckEsp
mov BYTE PTR tv284[ebp], al
mov eax, DWORD PTR __Ostr$[ebp]
mov ecx, DWORD PTR [eax]
mov edx, DWORD PTR __Ostr$[ebp]
add edx, DWORD PTR [ecx+4]
mov esi, esp
mov ecx, edx
call DWORD PTR __imp_?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ
cmp esi, esp
call __RTC_CheckEsp
mov DWORD PTR tv285[ebp], eax
mov esi, esp
movzx eax, BYTE PTR tv284[ebp]
push eax
mov ecx, DWORD PTR tv285[ebp]
call DWORD PTR __imp_?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z
cmp esi, esp
call __RTC_CheckEsp
mov DWORD PTR tv286[ebp], eax
mov ecx, DWORD PTR tv286[ebp]
mov DWORD PTR $T6[ebp], ecx
call ?eof@?$_Narrow_char_traits@DH@std@@SAHXZ ; std::_Narrow_char_traits<char,int>::eof
mov DWORD PTR $T5[ebp], eax
lea edx, DWORD PTR $T6[ebp]
push edx
lea eax, DWORD PTR $T5[ebp]
push eax
call ?eq_int_type@?$_Narrow_char_traits@DH@std@@SA_NABH0@Z ; std::_Narrow_char_traits<char,int>::eq_int_type
add esp, 8
movzx ecx, al
test ecx, ecx
je SHORT $LN12@operator
; 747 : _State |= ios_base::badbit; // insertion failed, quit
mov eax, DWORD PTR __State$[ebp]
or eax, 4
mov DWORD PTR __State$[ebp], eax
; 748 : break;
jmp SHORT $LN11@operator
$LN12@operator:
; 749 : }
; 750 : }
jmp $LN2@operator
$LN11@operator:
; 751 : }
; 752 :
; 753 : if (_State == ios_base::goodbit && _Ostr.rdbuf()->sputn(_Val, _Count) != _Count) {
cmp DWORD PTR __State$[ebp], 0
jne SHORT $LN13@operator
mov eax, DWORD PTR __Ostr$[ebp]
mov ecx, DWORD PTR [eax]
mov edx, DWORD PTR __Ostr$[ebp]
add edx, DWORD PTR [ecx+4]
mov esi, esp
mov ecx, edx
call DWORD PTR __imp_?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ
cmp esi, esp
call __RTC_CheckEsp
mov DWORD PTR tv287[ebp], eax
mov esi, esp
mov eax, DWORD PTR __Count$[ebp+4]
push eax
mov ecx, DWORD PTR __Count$[ebp]
push ecx
mov edx, DWORD PTR __Val$[ebp]
push edx
mov ecx, DWORD PTR tv287[ebp]
call DWORD PTR __imp_?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE_JPBD_J@Z
cmp esi, esp
call __RTC_CheckEsp
mov DWORD PTR tv288[ebp], eax
mov DWORD PTR tv288[ebp+4], edx
mov eax, DWORD PTR tv288[ebp]
cmp eax, DWORD PTR __Count$[ebp]
jne SHORT $LN27@operator
mov ecx, DWORD PTR tv288[ebp+4]
cmp ecx, DWORD PTR __Count$[ebp+4]
je SHORT $LN13@operator
$LN27@operator:
; 754 : _State |= ios_base::badbit;
mov eax, DWORD PTR __State$[ebp]
or eax, 4
mov DWORD PTR __State$[ebp], eax
$LN13@operator:
; 755 : }
; 756 :
; 757 : if (_State == ios_base::goodbit) {
cmp DWORD PTR __State$[ebp], 0
jne $LN14@operator
; 758 : for (; 0 < _Pad; --_Pad) { // pad on right
jmp SHORT $LN7@operator
$LN5@operator:
mov eax, DWORD PTR __Pad$[ebp]
sub eax, 1
mov ecx, DWORD PTR __Pad$[ebp+4]
sbb ecx, 0
mov DWORD PTR __Pad$[ebp], eax
mov DWORD PTR __Pad$[ebp+4], ecx
$LN7@operator:
cmp DWORD PTR __Pad$[ebp+4], 0
jl $LN14@operator
jg SHORT $LN28@operator
cmp DWORD PTR __Pad$[ebp], 0
jbe $LN14@operator
$LN28@operator:
; 759 : if (_Traits::eq_int_type(_Traits::eof(), _Ostr.rdbuf()->sputc(_Ostr.fill()))) {
mov eax, DWORD PTR __Ostr$[ebp]
mov ecx, DWORD PTR [eax]
mov edx, DWORD PTR __Ostr$[ebp]
add edx, DWORD PTR [ecx+4]
mov esi, esp
mov ecx, edx
call DWORD PTR __imp_?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDXZ
cmp esi, esp
call __RTC_CheckEsp
mov BYTE PTR tv289[ebp], al
mov eax, DWORD PTR __Ostr$[ebp]
mov ecx, DWORD PTR [eax]
mov edx, DWORD PTR __Ostr$[ebp]
add edx, DWORD PTR [ecx+4]
mov esi, esp
mov ecx, edx
call DWORD PTR __imp_?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ
cmp esi, esp
call __RTC_CheckEsp
mov DWORD PTR tv290[ebp], eax
mov esi, esp
movzx eax, BYTE PTR tv289[ebp]
push eax
mov ecx, DWORD PTR tv290[ebp]
call DWORD PTR __imp_?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z
cmp esi, esp
call __RTC_CheckEsp
mov DWORD PTR tv291[ebp], eax
mov ecx, DWORD PTR tv291[ebp]
mov DWORD PTR $T4[ebp], ecx
call ?eof@?$_Narrow_char_traits@DH@std@@SAHXZ ; std::_Narrow_char_traits<char,int>::eof
mov DWORD PTR $T3[ebp], eax
lea edx, DWORD PTR $T4[ebp]
push edx
lea eax, DWORD PTR $T3[ebp]
push eax
call ?eq_int_type@?$_Narrow_char_traits@DH@std@@SA_NABH0@Z ; std::_Narrow_char_traits<char,int>::eq_int_type
add esp, 8
movzx ecx, al
test ecx, ecx
je SHORT $LN15@operator
; 760 : _State |= ios_base::badbit; // insertion failed, quit
mov eax, DWORD PTR __State$[ebp]
or eax, 4
mov DWORD PTR __State$[ebp], eax
; 761 : break;
jmp SHORT $LN14@operator
$LN15@operator:
; 762 : }
; 763 : }
jmp $LN5@operator
$LN14@operator:
; 764 : }
; 765 :
; 766 : _Ostr.width(0);
mov esi, esp
push 0
push 0
mov eax, DWORD PTR __Ostr$[ebp]
mov ecx, DWORD PTR [eax]
mov edx, DWORD PTR __Ostr$[ebp]
add edx, DWORD PTR [ecx+4]
mov ecx, edx
call DWORD PTR __imp_?width@ios_base@std@@QAE_J_J@Z
cmp esi, esp
call __RTC_CheckEsp
jmp SHORT $LN19@operator
__catch$??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z$0:
; 767 : _CATCH_IO_(ios_base, _Ostr)
mov esi, esp
push 1
push 4
mov eax, DWORD PTR __Ostr$[ebp]
mov ecx, DWORD PTR [eax]
mov edx, DWORD PTR __Ostr$[ebp]
add edx, DWORD PTR [ecx+4]
mov ecx, edx
call DWORD PTR __imp_?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z
cmp esi, esp
call __RTC_CheckEsp
mov eax, $LN23@operator
ret 0
$LN19@operator:
mov DWORD PTR __$EHRec$[ebp+12], 0
jmp SHORT $LN9@operator
$LN23@operator:
mov DWORD PTR __$EHRec$[ebp+12], 0
$LN9@operator:
; 768 : }
; 769 :
; 770 : _Ostr.setstate(_State);
mov esi, esp
push 0
mov eax, DWORD PTR __State$[ebp]
push eax
mov ecx, DWORD PTR __Ostr$[ebp]
mov edx, DWORD PTR [ecx]
mov ecx, DWORD PTR __Ostr$[ebp]
add ecx, DWORD PTR [edx+4]
call DWORD PTR __imp_?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z
cmp esi, esp
call __RTC_CheckEsp
; 771 : return _Ostr;
mov eax, DWORD PTR __Ostr$[ebp]
mov DWORD PTR $T2[ebp], eax
mov DWORD PTR __$EHRec$[ebp+12], -1
lea ecx, DWORD PTR __Ok$[ebp]
call ??1sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@XZ ; std::basic_ostream<char,std::char_traits<char> >::sentry::~sentry
mov eax, DWORD PTR $T2[ebp]
; 772 : }
push edx
mov ecx, ebp
push eax
lea edx, DWORD PTR $LN32@operator
call @_RTC_CheckStackVars@8
pop eax
pop edx
mov ecx, DWORD PTR __$EHRec$[ebp+4]
mov DWORD PTR fs:0, ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, DWORD PTR __$ArrayPad$[ebp]
xor ecx, ebp
call @__security_check_cookie@4
add esp, 356 ; 00000164H
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
npad 2
$LN32@operator:
DD 1
DD $LN31@operator
$LN31@operator:
DD -76 ; ffffffb4H
DD 8
DD $LN29@operator
$LN29@operator:
DB 95 ; 0000005fH
DB 79 ; 0000004fH
DB 107 ; 0000006bH
DB 0
_TEXT ENDS
; COMDAT text$x
text$x SEGMENT
__unwindfunclet$??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z$2:
lea ecx, DWORD PTR __Ok$[ebp]
jmp ??1sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@XZ ; std::basic_ostream<char,std::char_traits<char> >::sentry::~sentry
__ehhandler$??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z:
mov edx, DWORD PTR [esp+8]
lea eax, DWORD PTR [edx+12]
mov ecx, DWORD PTR [edx-360]
xor ecx, eax
call @__security_check_cookie@4
mov ecx, DWORD PTR [edx-8]
xor ecx, eax
call @__security_check_cookie@4
mov eax, OFFSET __ehfuncinfo$??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z
jmp ___CxxFrameHandler3
text$x ENDS
??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z ENDP ; std::operator<<<std::char_traits<char> >
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Users\User\Desktop\Alvin_Personal_Projects\Coding_Languages\Complete-Modern-C\Section11_Templates\Introduction_To_Templates\Introduction_To_Templates\Source.cpp
; COMDAT ??$Max@H@@YAHHH@Z
_TEXT SEGMENT
tv72 = -196 ; size = 4
_x$ = 8 ; size = 4
_y$ = 12 ; size = 4
??$Max@H@@YAHHH@Z PROC ; Max<int>, COMDAT
; 12 : T Max(T x, T y) {
push ebp
mov ebp, esp
sub esp, 196 ; 000000c4H
push ebx
push esi
push edi
lea edi, DWORD PTR [ebp-196]
mov ecx, 49 ; 00000031H
mov eax, -858993460 ; ccccccccH
rep stosd
mov ecx, OFFSET __41122F1E_Source@cpp
call @__CheckForDebuggerJustMyCode@4
; 13 : std::cout << typeid(T).name() << std::endl;
mov esi, esp
push OFFSET ??$endl@DU?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@@Z ; std::endl<char,std::char_traits<char> >
mov ecx, OFFSET ??_R0H@8
call ?name@type_info@@QBEPBDXZ ; type_info::name
push eax
mov eax, DWORD PTR __imp_?cout@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A
push eax
call ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z ; std::operator<<<std::char_traits<char> >
add esp, 8
mov ecx, eax
call DWORD PTR __imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z
cmp esi, esp
call __RTC_CheckEsp
; 14 : return x > y ? x : y;
mov eax, DWORD PTR _x$[ebp]
cmp eax, DWORD PTR _y$[ebp]
jle SHORT $LN3@Max
mov ecx, DWORD PTR _x$[ebp]
mov DWORD PTR tv72[ebp], ecx
jmp SHORT $LN4@Max
$LN3@Max:
mov edx, DWORD PTR _y$[ebp]
mov DWORD PTR tv72[ebp], edx
$LN4@Max:
mov eax, DWORD PTR tv72[ebp]
; 15 : }
pop edi
pop esi
pop ebx
add esp, 196 ; 000000c4H
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
??$Max@H@@YAHHH@Z ENDP ; Max<int>
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Users\User\Desktop\Alvin_Personal_Projects\Coding_Languages\Complete-Modern-C\Section11_Templates\Introduction_To_Templates\Introduction_To_Templates\Source.cpp
; COMDAT ??$Max@N@@YANNN@Z
_TEXT SEGMENT
tv72 = -200 ; size = 8
_x$ = 8 ; size = 8
_y$ = 16 ; size = 8
??$Max@N@@YANNN@Z PROC ; Max<double>, COMDAT
; 12 : T Max(T x, T y) {
push ebp
mov ebp, esp
sub esp, 200 ; 000000c8H
push ebx
push esi
push edi
lea edi, DWORD PTR [ebp-200]
mov ecx, 50 ; 00000032H
mov eax, -858993460 ; ccccccccH
rep stosd
mov ecx, OFFSET __41122F1E_Source@cpp
call @__CheckForDebuggerJustMyCode@4
; 13 : std::cout << typeid(T).name() << std::endl;
mov esi, esp
push OFFSET ??$endl@DU?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@@Z ; std::endl<char,std::char_traits<char> >
mov ecx, OFFSET ??_R0N@8
call ?name@type_info@@QBEPBDXZ ; type_info::name
push eax
mov eax, DWORD PTR __imp_?cout@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A
push eax
call ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z ; std::operator<<<std::char_traits<char> >
add esp, 8
mov ecx, eax
call DWORD PTR __imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z
cmp esi, esp
call __RTC_CheckEsp
; 14 : return x > y ? x : y;
movsd xmm0, QWORD PTR _x$[ebp]
comisd xmm0, QWORD PTR _y$[ebp]
jbe SHORT $LN3@Max
movsd xmm0, QWORD PTR _x$[ebp]
movsd QWORD PTR tv72[ebp], xmm0
jmp SHORT $LN4@Max
$LN3@Max:
movsd xmm0, QWORD PTR _y$[ebp]
movsd QWORD PTR tv72[ebp], xmm0
$LN4@Max:
fld QWORD PTR tv72[ebp]
; 15 : }
pop edi
pop esi
pop ebx
add esp, 200 ; 000000c8H
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
??$Max@N@@YANNN@Z ENDP ; Max<double>
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Users\User\Desktop\Alvin_Personal_Projects\Coding_Languages\Complete-Modern-C\Section11_Templates\Introduction_To_Templates\Introduction_To_Templates\Source.cpp
; COMDAT ??$Max@M@@YAMMM@Z
_TEXT SEGMENT
tv72 = -196 ; size = 4
_x$ = 8 ; size = 4
_y$ = 12 ; size = 4
??$Max@M@@YAMMM@Z PROC ; Max<float>, COMDAT
; 12 : T Max(T x, T y) {
push ebp
mov ebp, esp
sub esp, 196 ; 000000c4H
push ebx
push esi
push edi
lea edi, DWORD PTR [ebp-196]
mov ecx, 49 ; 00000031H
mov eax, -858993460 ; ccccccccH
rep stosd
mov ecx, OFFSET __41122F1E_Source@cpp
call @__CheckForDebuggerJustMyCode@4
; 13 : std::cout << typeid(T).name() << std::endl;
mov esi, esp
push OFFSET ??$endl@DU?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@@Z ; std::endl<char,std::char_traits<char> >
mov ecx, OFFSET ??_R0M@8
call ?name@type_info@@QBEPBDXZ ; type_info::name
push eax
mov eax, DWORD PTR __imp_?cout@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A
push eax
call ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z ; std::operator<<<std::char_traits<char> >
add esp, 8
mov ecx, eax
call DWORD PTR __imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z
cmp esi, esp
call __RTC_CheckEsp
; 14 : return x > y ? x : y;
movss xmm0, DWORD PTR _x$[ebp]
comiss xmm0, DWORD PTR _y$[ebp]
jbe SHORT $LN3@Max
movss xmm0, DWORD PTR _x$[ebp]
movss DWORD PTR tv72[ebp], xmm0
jmp SHORT $LN4@Max
$LN3@Max:
movss xmm0, DWORD PTR _y$[ebp]
movss DWORD PTR tv72[ebp], xmm0
$LN4@Max:
fld DWORD PTR tv72[ebp]
; 15 : }
pop edi
pop esi
pop ebx
add esp, 196 ; 000000c4H
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
??$Max@M@@YAMMM@Z ENDP ; Max<float>
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Users\User\Desktop\Alvin_Personal_Projects\Coding_Languages\Complete-Modern-C\Section11_Templates\Introduction_To_Templates\Introduction_To_Templates\Source.cpp
; COMDAT _main
_TEXT SEGMENT
_pfn$ = -8 ; size = 4
_main PROC ; COMDAT
; 18 : int main() {
push ebp
mov ebp, esp
sub esp, 204 ; 000000ccH
push ebx
push esi
push edi
lea edi, DWORD PTR [ebp-204]
mov ecx, 51 ; 00000033H
mov eax, -858993460 ; ccccccccH
rep stosd
mov ecx, OFFSET __41122F1E_Source@cpp
call @__CheckForDebuggerJustMyCode@4
; 19 : Max(static_cast<float>(3), 5.5f);
push ecx
movss xmm0, DWORD PTR __real@40b00000
movss DWORD PTR [esp], xmm0
push ecx
movss xmm0, DWORD PTR __real@40400000
movss DWORD PTR [esp], xmm0
call ??$Max@M@@YAMMM@Z ; Max<float>
fstp ST(0)
add esp, 8
; 20 : Max<double>(3, 6.2);
sub esp, 8
movsd xmm0, QWORD PTR __real@4018cccccccccccd
movsd QWORD PTR [esp], xmm0
sub esp, 8
movsd xmm0, QWORD PTR __real@4008000000000000
movsd QWORD PTR [esp], xmm0
call ??$Max@N@@YANNN@Z ; Max<double>
fstp ST(0)
add esp, 16 ; 00000010H
; 21 : int (*pfn)(int, int) = Max;
mov DWORD PTR _pfn$[ebp], OFFSET ??$Max@H@@YAHHH@Z ; Max<int>
; 22 : //auto num = Max(3.3f, 5.8f);
; 23 : //std::cout << num << std::endl;
; 24 : //auto num2 = Max(38, 12);
; 25 : //std::cout << num2 << std::endl;
; 26 :
; 27 : return 0;
xor eax, eax
; 28 : }
pop edi
pop esi
pop ebx
add esp, 204 ; 000000ccH
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
_main ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Users\User\Desktop\Alvin_Personal_Projects\Coding_Languages\Complete-Modern-C\Section11_Templates\Introduction_To_Templates\Introduction_To_Templates\Source.cpp
; COMDAT ??$Max@D@@YADDD@Z
_TEXT SEGMENT
tv74 = -193 ; size = 1
_x$ = 8 ; size = 1
_y$ = 12 ; size = 1
??$Max@D@@YADDD@Z PROC ; Max<char>, COMDAT
; 12 : T Max(T x, T y) {
push ebp
mov ebp, esp
sub esp, 196 ; 000000c4H
push ebx
push esi
push edi
lea edi, DWORD PTR [ebp-196]
mov ecx, 49 ; 00000031H
mov eax, -858993460 ; ccccccccH
rep stosd
mov ecx, OFFSET __41122F1E_Source@cpp
call @__CheckForDebuggerJustMyCode@4
; 13 : std::cout << typeid(T).name() << std::endl;
mov esi, esp
push OFFSET ??$endl@DU?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@@Z ; std::endl<char,std::char_traits<char> >
mov ecx, OFFSET ??_R0D@8
call ?name@type_info@@QBEPBDXZ ; type_info::name
push eax
mov eax, DWORD PTR __imp_?cout@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A
push eax
call ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z ; std::operator<<<std::char_traits<char> >
add esp, 8
mov ecx, eax
call DWORD PTR __imp_??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@P6AAAV01@AAV01@@Z@Z
cmp esi, esp
call __RTC_CheckEsp
; 14 : return x > y ? x : y;
movsx eax, BYTE PTR _x$[ebp]
movsx ecx, BYTE PTR _y$[ebp]
cmp eax, ecx
jle SHORT $LN3@Max
mov dl, BYTE PTR _x$[ebp]
mov BYTE PTR tv74[ebp], dl
jmp SHORT $LN4@Max
$LN3@Max:
mov al, BYTE PTR _y$[ebp]
mov BYTE PTR tv74[ebp], al
$LN4@Max:
mov al, BYTE PTR tv74[ebp]
; 15 : }
pop edi
pop esi
pop ebx
add esp, 196 ; 000000c4H
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
??$Max@D@@YADDD@Z ENDP ; Max<char>
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\vcruntime_typeinfo.h
; COMDAT ?name@type_info@@QBEPBDXZ
_TEXT SEGMENT
_this$ = -20 ; size = 4
__$EHRec$ = -12 ; size = 12
?name@type_info@@QBEPBDXZ PROC ; type_info::name, COMDAT
; _this$ = ecx
; 97 : {
push ebp
mov ebp, esp
push -1
push __ehhandler$?name@type_info@@QBEPBDXZ
mov eax, DWORD PTR fs:0
push eax
sub esp, 204 ; 000000ccH
push ebx
push esi
push edi
push ecx
lea edi, DWORD PTR [ebp-216]
mov ecx, 51 ; 00000033H
mov eax, -858993460 ; ccccccccH
rep stosd
pop ecx
mov eax, DWORD PTR ___security_cookie
xor eax, ebp
push eax
lea eax, DWORD PTR __$EHRec$[ebp]
mov DWORD PTR fs:0, eax
mov DWORD PTR _this$[ebp], ecx
mov ecx, OFFSET __84C161B0_vcruntime_typeinfo@h
call @__CheckForDebuggerJustMyCode@4
; 98 : #ifdef _M_CEE_PURE
; 99 : return __std_type_info_name(&_Data, static_cast<__type_info_node*>(__type_info_root_node.ToPointer()));
; 100 : #else
; 101 : return __std_type_info_name(&_Data, &__type_info_root_node);
push OFFSET ?__type_info_root_node@@3U__type_info_node@@A ; __type_info_root_node
mov eax, DWORD PTR _this$[ebp]
add eax, 4
push eax
call ___std_type_info_name
add esp, 8
; 102 : #endif
; 103 : }
mov ecx, DWORD PTR __$EHRec$[ebp]
mov DWORD PTR fs:0, ecx
pop ecx
pop edi
pop esi
pop ebx
add esp, 216 ; 000000d8H
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
_TEXT ENDS
; COMDAT text$x
text$x SEGMENT
__ehhandler$?name@type_info@@QBEPBDXZ:
mov edx, DWORD PTR [esp+8]
lea eax, DWORD PTR [edx+12]
mov ecx, DWORD PTR [edx-220]
xor ecx, eax
call @__security_check_cookie@4
mov eax, OFFSET __ehfuncinfo$?name@type_info@@QBEPBDXZ
jmp ___CxxFrameHandler3
text$x ENDS
?name@type_info@@QBEPBDXZ ENDP ; type_info::name
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\xstring
; COMDAT ?eof@?$_Narrow_char_traits@DH@std@@SAHXZ
_TEXT SEGMENT
__$EHRec$ = -12 ; size = 12
?eof@?$_Narrow_char_traits@DH@std@@SAHXZ PROC ; std::_Narrow_char_traits<char,int>::eof, COMDAT
; 404 : _NODISCARD static constexpr int_type eof() noexcept {
push ebp
mov ebp, esp
push -1
push __ehhandler$?eof@?$_Narrow_char_traits@DH@std@@SAHXZ
mov eax, DWORD PTR fs:0
push eax
sub esp, 192 ; 000000c0H
push ebx
push esi
push edi
lea edi, DWORD PTR [ebp-204]
mov ecx, 48 ; 00000030H
mov eax, -858993460 ; ccccccccH
rep stosd
mov eax, DWORD PTR ___security_cookie
xor eax, ebp
push eax
lea eax, DWORD PTR __$EHRec$[ebp]
mov DWORD PTR fs:0, eax
mov ecx, OFFSET __13959C84_xstring
call @__CheckForDebuggerJustMyCode@4
; 405 : return static_cast<int_type>(EOF);
or eax, -1
; 406 : }
mov ecx, DWORD PTR __$EHRec$[ebp]
mov DWORD PTR fs:0, ecx
pop ecx
pop edi
pop esi
pop ebx
add esp, 204 ; 000000ccH
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
_TEXT ENDS
; COMDAT text$x
text$x SEGMENT
__ehhandler$?eof@?$_Narrow_char_traits@DH@std@@SAHXZ:
mov edx, DWORD PTR [esp+8]
lea eax, DWORD PTR [edx+12]
mov ecx, DWORD PTR [edx-208]
xor ecx, eax
call @__security_check_cookie@4
mov eax, OFFSET __ehfuncinfo$?eof@?$_Narrow_char_traits@DH@std@@SAHXZ
jmp ___CxxFrameHandler3
text$x ENDS
?eof@?$_Narrow_char_traits@DH@std@@SAHXZ ENDP ; std::_Narrow_char_traits<char,int>::eof
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\xstring
; COMDAT ?eq_int_type@?$_Narrow_char_traits@DH@std@@SA_NABH0@Z
_TEXT SEGMENT
tv65 = -208 ; size = 4
__$EHRec$ = -12 ; size = 12
__Left$ = 8 ; size = 4
__Right$ = 12 ; size = 4
?eq_int_type@?$_Narrow_char_traits@DH@std@@SA_NABH0@Z PROC ; std::_Narrow_char_traits<char,int>::eq_int_type, COMDAT
; 396 : _NODISCARD static constexpr bool eq_int_type(const int_type& _Left, const int_type& _Right) noexcept {
push ebp
mov ebp, esp
push -1
push __ehhandler$?eq_int_type@?$_Narrow_char_traits@DH@std@@SA_NABH0@Z
mov eax, DWORD PTR fs:0
push eax
sub esp, 196 ; 000000c4H
push ebx
push esi
push edi
lea edi, DWORD PTR [ebp-208]
mov ecx, 49 ; 00000031H
mov eax, -858993460 ; ccccccccH
rep stosd
mov eax, DWORD PTR ___security_cookie
xor eax, ebp
push eax
lea eax, DWORD PTR __$EHRec$[ebp]
mov DWORD PTR fs:0, eax
mov ecx, OFFSET __13959C84_xstring
call @__CheckForDebuggerJustMyCode@4
; 397 : return _Left == _Right;
mov eax, DWORD PTR __Left$[ebp]
mov ecx, DWORD PTR __Right$[ebp]
mov edx, DWORD PTR [eax]
cmp edx, DWORD PTR [ecx]
jne SHORT $LN3@eq_int_typ
mov DWORD PTR tv65[ebp], 1
jmp SHORT $LN4@eq_int_typ
$LN3@eq_int_typ:
mov DWORD PTR tv65[ebp], 0
$LN4@eq_int_typ:
mov al, BYTE PTR tv65[ebp]
; 398 : }
mov ecx, DWORD PTR __$EHRec$[ebp]
mov DWORD PTR fs:0, ecx
pop ecx
pop edi
pop esi
pop ebx
add esp, 208 ; 000000d0H
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
_TEXT ENDS
; COMDAT text$x
text$x SEGMENT
__ehhandler$?eq_int_type@?$_Narrow_char_traits@DH@std@@SA_NABH0@Z:
mov edx, DWORD PTR [esp+8]
lea eax, DWORD PTR [edx+12]
mov ecx, DWORD PTR [edx-212]
xor ecx, eax
call @__security_check_cookie@4
mov eax, OFFSET __ehfuncinfo$?eq_int_type@?$_Narrow_char_traits@DH@std@@SA_NABH0@Z
jmp ___CxxFrameHandler3
text$x ENDS
?eq_int_type@?$_Narrow_char_traits@DH@std@@SA_NABH0@Z ENDP ; std::_Narrow_char_traits<char,int>::eq_int_type
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\include\xstring
; COMDAT ?length@?$_Narrow_char_traits@DH@std@@SAIQBD@Z
_TEXT SEGMENT
__$EHRec$ = -12 ; size = 12
__First$ = 8 ; size = 4
?length@?$_Narrow_char_traits@DH@std@@SAIQBD@Z PROC ; std::_Narrow_char_traits<char,int>::length, COMDAT
; 309 : _NODISCARD static _CONSTEXPR17 size_t length(_In_z_ const _Elem* const _First) noexcept /* strengthened */ {
push ebp
mov ebp, esp
push -1
push __ehhandler$?length@?$_Narrow_char_traits@DH@std@@SAIQBD@Z
mov eax, DWORD PTR fs:0
push eax
sub esp, 192 ; 000000c0H
push ebx
push esi
push edi
lea edi, DWORD PTR [ebp-204]
mov ecx, 48 ; 00000030H
mov eax, -858993460 ; ccccccccH
rep stosd
mov eax, DWORD PTR ___security_cookie
xor eax, ebp
push eax
lea eax, DWORD PTR __$EHRec$[ebp]
mov DWORD PTR fs:0, eax
mov ecx, OFFSET __13959C84_xstring
call @__CheckForDebuggerJustMyCode@4
; 310 : // find length of null-terminated string
; 311 : #if _HAS_CXX17
; 312 : #ifdef __cpp_char8_t
; 313 : if constexpr (is_same_v<_Elem, char8_t>) {
; 314 : #if _HAS_U8_INTRINSICS
; 315 : return __builtin_u8strlen(_First);
; 316 : #else // ^^^ use u8 intrinsics / no u8 intrinsics vvv
; 317 : return _Char_traits<_Elem, _Int_type>::length(_First);
; 318 : #endif // _HAS_U8_INTRINSICS
; 319 : } else
; 320 : #endif // __cpp_char8_t
; 321 : {
; 322 : return __builtin_strlen(_First);
; 323 : }
; 324 : #else // _HAS_CXX17
; 325 : return _CSTD strlen(reinterpret_cast<const char*>(_First));
mov eax, DWORD PTR __First$[ebp]
push eax
call _strlen
add esp, 4
; 326 : #endif // _HAS_CXX17
; 327 : }
mov ecx, DWORD PTR __$EHRec$[ebp]
mov DWORD PTR fs:0, ecx
pop ecx
pop edi
pop esi
pop ebx
add esp, 204 ; 000000ccH
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
_TEXT ENDS
; COMDAT text$x
text$x SEGMENT
__ehhandler$?length@?$_Narrow_char_traits@DH@std@@SAIQBD@Z:
mov edx, DWORD PTR [esp+8]
lea eax, DWORD PTR [edx+12]
mov ecx, DWORD PTR [edx-208]
xor ecx, eax
call @__security_check_cookie@4
mov eax, OFFSET __ehfuncinfo$?length@?$_Narrow_char_traits@DH@std@@SAIQBD@Z
jmp ___CxxFrameHandler3
text$x ENDS
?length@?$_Narrow_char_traits@DH@std@@SAIQBD@Z ENDP ; std::_Narrow_char_traits<char,int>::length
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Users\User\Desktop\Alvin_Personal_Projects\Coding_Languages\Complete-Modern-C\Section11_Templates\Introduction_To_Templates\Introduction_To_Templates\Source.cpp
; COMDAT ?__empty_global_delete@@YAXPAXI@Z
_TEXT SEGMENT
___formal$ = 8 ; size = 4
___formal$ = 12 ; size = 4
?__empty_global_delete@@YAXPAXI@Z PROC ; __empty_global_delete, COMDAT
push ebp
mov ebp, esp
sub esp, 192 ; 000000c0H
push ebx
push esi
push edi
lea edi, DWORD PTR [ebp-192]
mov ecx, 48 ; 00000030H
mov eax, -858993460 ; ccccccccH
rep stosd
mov ecx, OFFSET __41122F1E_Source@cpp
call @__CheckForDebuggerJustMyCode@4
pop edi
pop esi
pop ebx
add esp, 192 ; 000000c0H
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
?__empty_global_delete@@YAXPAXI@Z ENDP ; __empty_global_delete
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File C:\Users\User\Desktop\Alvin_Personal_Projects\Coding_Languages\Complete-Modern-C\Section11_Templates\Introduction_To_Templates\Introduction_To_Templates\Source.cpp
; COMDAT ?__empty_global_delete@@YAXPAX@Z
_TEXT SEGMENT
___formal$ = 8 ; size = 4
?__empty_global_delete@@YAXPAX@Z PROC ; __empty_global_delete, COMDAT
push ebp
mov ebp, esp
sub esp, 192 ; 000000c0H
push ebx
push esi
push edi
lea edi, DWORD PTR [ebp-192]
mov ecx, 48 ; 00000030H
mov eax, -858993460 ; ccccccccH
rep stosd
mov ecx, OFFSET __41122F1E_Source@cpp
call @__CheckForDebuggerJustMyCode@4
pop edi
pop esi
pop ebx
add esp, 192 ; 000000c0H
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
?__empty_global_delete@@YAXPAX@Z ENDP ; __empty_global_delete
_TEXT ENDS
END
| 28.65 | 170 | 0.696335 |
5898007e3ef11cbfcb82ab7faef9094cea7216a4 | 3,534 | asm | Assembly | Working Disassembly/Levels/LRZ/Debug/Act 2.asm | TeamASM-Blur/Sonic-3-Blue-Balls-Edition | 7e8a2c5df02271615ff4cae529521e6b1560d6b1 | [
"Apache-2.0"
] | null | null | null | Working Disassembly/Levels/LRZ/Debug/Act 2.asm | TeamASM-Blur/Sonic-3-Blue-Balls-Edition | 7e8a2c5df02271615ff4cae529521e6b1560d6b1 | [
"Apache-2.0"
] | null | null | null | Working Disassembly/Levels/LRZ/Debug/Act 2.asm | TeamASM-Blur/Sonic-3-Blue-Balls-Edition | 7e8a2c5df02271615ff4cae529521e6b1560d6b1 | [
"Apache-2.0"
] | null | null | null | ; Object Mappings Subtype Frame Arttile
dbglistobj Obj_Ring, Map_Ring, 0, 0, make_art_tile($6BC,1,1)
dbglistobj Obj_Monitor, Map_Monitor, 6, 0, make_art_tile($4C4,0,0)
dbglistobj Obj_PathSwap, Map_PathSwap, 9, 1, make_art_tile($6BC,1,0)
dbglistobj Obj_PathSwap, Map_PathSwap, $D, 5, make_art_tile($6BC,1,0)
dbglistobj Obj_Spring, Map_Spring, $81, 0, make_art_tile($4A4,0,0)
dbglistobj Obj_Spring, Map_Spring, $90, 3, make_art_tile($4B4,0,0)
dbglistobj Obj_Spring, Map_Spring, $A0, 6, make_art_tile($4A4,0,0)
dbglistobj Obj_Spikes, Map_Spikes, 0, 0, make_art_tile($49C,0,0)
dbglistobj Obj_Toxomister, Map_Toxomister, 0, 0, make_art_tile($562,0,0)
dbglistobj Obj_Fireworm, Map_FirewormSegments, 0, 0, make_art_tile($512,3,0)
dbglistobj Obj_LRZExplodingRock, Map_LRZExplodingRock, 0, 0, make_art_tile($530,0,0)
dbglistobj Obj_LRZSinkingRock, Map_LRZSinkingRock, 0, 1, make_art_tile($090,2,0)
dbglistobj Obj_LRZDoor, Map_LRZDoor, 0, 1, make_art_tile($090,2,0)
dbglistobj Obj_LRZSwingingSpikeBall, Map_LRZSwingingSpikeBall, $88, 3, make_art_tile($40D,0,1)
dbglistobj Obj_LRZButtonHorizontal, Map_LRZButtonHorizontal, 0, 2, make_art_tile($40D,1,0)
dbglistobj Obj_Button, Map_LRZButton, 0, 2, make_art_tile($429,1,0)
dbglistobj Obj_LRZChainedPlatforms, Map_LRZChainedPlatforms, $80, 0, make_art_tile($40D,1,0)
dbglistobj Obj_LRZOrbitingSpikeBallHorizontal, Map_LRZOrbitingSpikeBall, 0, 0, make_art_tile($40D,1,0)
dbglistobj Obj_LRZOrbitingSpikeBallVertical, Map_LRZOrbitingSpikeBall, 0, 0, make_art_tile($40D,1,0)
dbglistobj Obj_LRZFlameThrower, Map_LRZFlameThrower, 8, 6, make_art_tile($090,1,0)
dbglistobj Obj_AnimatedStillSprite, Map_AnimatedStillSprites, 3, $B, make_art_tile($40D,1,0)
dbglistobj Obj_LRZSolidMovingPlatforms, Map_LRZSolidMovingPlatforms, $10, 1, make_art_tile($090,2,0)
dbglistobj Obj_LRZSolidMovingPlatforms, Map_LRZSolidMovingPlatforms, 1, 0, make_art_tile($090,2,0)
dbglistobj Obj_LRZSolidMovingPlatforms, Map_LRZSolidMovingPlatforms, 2, 0, make_art_tile($090,2,0)
dbglistobj Obj_LRZSolidMovingPlatforms, Map_LRZSolidMovingPlatforms, 3, 0, make_art_tile($090,2,0)
dbglistobj Obj_LRZSolidMovingPlatforms, Map_LRZSolidMovingPlatforms, 4, 0, make_art_tile($090,2,0)
dbglistobj Obj_LRZSolidMovingPlatforms, Map_LRZSolidMovingPlatforms, 5, 0, make_art_tile($090,2,0)
dbglistobj Obj_LRZSolidMovingPlatforms, Map_LRZSolidMovingPlatforms, 6, 0, make_art_tile($090,2,0)
dbglistobj Obj_LRZSolidRock, Map_LRZSolidRock, 0, 0, make_art_tile($090,3,0)
dbglistobj Obj_LRZSolidRock, Map_LRZSolidRock, $40, 0, make_art_tile($090,3,0)
dbglistobj Obj_Button, Map_LRZButton, $40, 2, make_art_tile($429,1,0)
dbglistobj Obj_BreakableWall, Map_LRZBreakableWall, 0, 0, make_art_tile($40D,3,0)
dbglistobj Obj_CollapsingBridge, Map_LRZCollapsingPlatform, 0, 0, make_art_tile($090,2,0)
dbglistobj Obj_AIZLRZEMZRock, Map_LRZBreakableRock2, $F4, 8, make_art_tile($40D,3,0)
dbglistobj Obj_LRZTurbineSprites, Map_LRZTurbineSprites, 0, 0, make_art_tile($3AD,1,1)
dbglistobj Obj_LRZTurbineSprites, Map_LRZTurbineSprites, 1, 4, make_art_tile($3AD,1,1)
dbglistobj Obj_LRZFlameThrower, Map_LRZFlameThrower, $88, 7, make_art_tile($090,1,0)
dbglistobj Obj_LRZSpikeBallLauncher, Map_LRZSpikeBallLauncher, $60, 3, make_art_tile($40D,1,0)
| 88.35 | 108 | 0.742784 |
42073a14bf1ace10963080e90299bdf3f8fa8f8b | 647 | asm | Assembly | src/linearmap.asm | JoeyCluett/game-jam-beat-the-boredom | 1a5a28c35bded76b1b7cb842a9c7059cc07a4773 | [
"Unlicense"
] | null | null | null | src/linearmap.asm | JoeyCluett/game-jam-beat-the-boredom | 1a5a28c35bded76b1b7cb842a9c7059cc07a4773 | [
"Unlicense"
] | 1 | 2020-04-12T00:43:27.000Z | 2020-04-13T22:08:29.000Z | src/linearmap.asm | JoeyCluett/game-jam-beat-the-boredom | 1a5a28c35bded76b1b7cb842a9c7059cc07a4773 | [
"Unlicense"
] | null | null | null |
global linearmap
section .bss
section .data
section .text
align 16
linearmap:
;
; x : xmm0
; x_begin : xmm1
; x_end : xmm2
; y_begin : xmm3
; y_end : xmm4
;
; result : xmm0
;
; output = y_begin + ((y_end - y_begin) / (x_end - x_begin)) * (x - x_begin)
;
; leaf function so no need to create stack frame
subss xmm4, xmm3 ; y_end -= y_begin
subss xmm0, xmm1 ; x -= x_begin
subss xmm2, xmm1 ; x_end -= x_begin
divss xmm4, xmm2 ; y_end /= x_end
mulss xmm4, xmm0 ; y_end *= x
addss xmm3, xmm4 ; y_begin += y_end
movss xmm0, xmm3 ; returned in xmm0
ret
| 17.486486 | 80 | 0.570325 |
4f4f67cafe4ac00fd457d3a3721a155a3c550be6 | 7,307 | asm | Assembly | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_1833.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_1833.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_1833.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 %r15
push %r9
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0x1c6b6, %r9
nop
nop
nop
sub %rdi, %rdi
mov (%r9), %edx
nop
nop
add %rdx, %rdx
lea addresses_UC_ht+0x10d6e, %rsi
lea addresses_WT_ht+0x16846, %rdi
clflush (%rsi)
nop
nop
nop
and %rbp, %rbp
mov $37, %rcx
rep movsl
nop
nop
add %r9, %r9
lea addresses_WT_ht+0x8526, %rsi
lea addresses_normal_ht+0x1ce06, %rdi
add %r10, %r10
mov $22, %rcx
rep movsw
sub %rcx, %rcx
lea addresses_D_ht+0xdd6e, %rsi
lea addresses_UC_ht+0x3ce6, %rdi
nop
nop
nop
cmp $953, %r15
mov $40, %rcx
rep movsq
nop
and $10799, %r9
lea addresses_A_ht+0x17c62, %rsi
lea addresses_normal_ht+0x16926, %rdi
nop
nop
nop
nop
nop
sub %r15, %r15
mov $6, %rcx
rep movsb
nop
nop
nop
nop
nop
and %rsi, %rsi
lea addresses_D_ht+0x11f26, %rsi
lea addresses_A_ht+0x198ee, %rdi
nop
nop
and $57877, %r9
mov $104, %rcx
rep movsl
nop
nop
nop
and %r15, %r15
lea addresses_A_ht+0x50a8, %rcx
clflush (%rcx)
nop
nop
nop
nop
xor %r9, %r9
movw $0x6162, (%rcx)
inc %rsi
lea addresses_WC_ht+0x18866, %rsi
lea addresses_WC_ht+0x16946, %rdi
nop
and %rbp, %rbp
mov $102, %rcx
rep movsl
add %rdi, %rdi
lea addresses_UC_ht+0x19a26, %rdi
cmp $5083, %rdx
movb (%rdi), %cl
nop
nop
nop
and $65014, %r9
lea addresses_normal_ht+0x13126, %rdx
nop
nop
dec %r10
and $0xffffffffffffffc0, %rdx
movntdqa (%rdx), %xmm4
vpextrq $1, %xmm4, %rsi
nop
nop
nop
nop
sub $23424, %r9
lea addresses_UC_ht+0x56d6, %rdx
nop
nop
sub $37036, %r9
mov $0x6162636465666768, %rcx
movq %rcx, (%rdx)
nop
nop
nop
nop
nop
dec %r15
lea addresses_WT_ht+0x1f26, %rbp
nop
dec %r10
movb $0x61, (%rbp)
dec %rcx
lea addresses_WT_ht+0x175f6, %rsi
lea addresses_A_ht+0xbfc6, %rdi
nop
nop
and %r10, %r10
mov $94, %rcx
rep movsq
nop
nop
nop
nop
xor %rdi, %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r15
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r15
push %r8
push %rbx
push %rdi
push %rdx
push %rsi
// Faulty Load
lea addresses_WC+0x4f26, %rsi
nop
xor $21330, %rdi
movb (%rsi), %r8b
lea oracles, %rdx
and $0xff, %r8
shlq $12, %r8
mov (%rdx,%r8,1), %r8
pop %rsi
pop %rdx
pop %rdi
pop %rbx
pop %r8
pop %r15
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 4, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 5, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 8, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 8, 'size': 16, 'same': False, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': True, 'congruent': 3, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 11, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 36.90404 | 2,999 | 0.659641 |
8b3872ddbb6289bbb902546c3a2acd6d86773c07 | 6,149 | asm | Assembly | base/remoteboot/bootfloppy/src/loader/5x9.asm | npocmaka/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 17 | 2020-11-13T13:42:52.000Z | 2021-09-16T09:13:13.000Z | base/remoteboot/bootfloppy/src/loader/5x9.asm | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 2 | 2020-10-19T08:02:06.000Z | 2020-10-19T08:23:18.000Z | base/remoteboot/bootfloppy/src/loader/5x9.asm | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 14 | 2020-11-14T09:43:20.000Z | 2021-08-28T08:59:57.000Z | ;--------------------------------------------------------------------
; BW5X9.ASM
;
; 3Com 3C509/3C509B detection support for the loader.
;
;--------------------------------------------------------------------
include "vulcan.inc"
;--------------------------------------------------------------------
; Detect a 3C5X9 NIC
;
; Carry Flag set if found.
; or
; Carry Flag cleared if not found.
;
;--------------------------------------------------------------------
Proc Detect5X9
; Preserve the environment.
pushad
push ds
push es
sti
cld
call Find_Vulcan
; Restore the original environment.
pop es
pop ds
popad
ret
endp Detect5X9
;--------------------------------------------------------------------
;
; Find_Vulcan:
;
; On Entry:
;
; sti
; cld
;
; On Exit:
; Carry Flag set if found.
; or
; Carry Flag cleared if not found.
;
;--------------------------------------------------------------------
proc Find_Vulcan
cli
;-----------------------------------------------------------------------------
; ISA-specific init code
;-----------------------------------------------------------------------------
mov dx, ID_PORT
call Write_ID_Sequence ; IDS enters ID_CMD state
mov al, SET_TAG_REGISTER + 0 ; 04-06-92
out dx, al ; 04-06-92, untag adapter
; look for the first adapter and activate it. we will use contention test to
; make sure there is at least 1 Vulcan on system bus and activate the first
; Vulcan adapter we find.
mov al, EE_MANUFACTURER_CODE
call Contention_Test ; read EISA manufacturer ID
cmp ax, EISA_MANUFACTURER_ID ; is it 3Com's EISA ID?
je isa_vlucan_found
sti
clc
ret
isa_vlucan_found:
sti
stc
ret
endp Find_Vulcan
;-----------------------------------------------------------------------------
; Write_ID_Sequence:
;
; This routine writes ID sequence to the specified ID port
; on Vulcan adapter; when the complete ID sequence has been
; written, the ID sequence State Machine (IDS) enters the
; ID_CMD state. This routine is called when IDS is in
; ID_WAIT state.
;
; On Entry:
; dx = the ID port desired (1x0h)
;
; On Exit:
; dx = preserved
; ax, cx are not preserved
;-----------------------------------------------------------------------------
proc Write_ID_Sequence
mov al, 0
out dx, al ; to setup new ID port
out dx, al
mov cx, 0ffh ; 255-byte sequence
mov al, 0ffh ; initial value of sequence
wr_id_loop:
out dx, al
shl al, 1
jnc wr_id
xor al, 0cfh
wr_id:
loop wr_id_loop
ret
endp Write_ID_Sequence
;--------------------------------------------------------------------
;
; Contention_Test: This routine, first, writes an "EEPROM Read Command" to
; ID port (dx), the write operation actually causes the
; content of the specified EEPROM data to be read into
; EEPROM data register. Then it reads ID port 16 times
; and saves the results in ax. During each read, the
; hardware drives bit 15 of EEPROM data register out onto
; bit 0 of the host data bus, reads this bit 0 back from
; host bus and if it does not match what is driven, then
; the IDS has a contention failure and returns to ID_WAIT
; state. If the adapter does not experience contention
; failure, it will join the other contention tests when
; this routine is called again.
;
; Eventually, only one adapter is left in the ID_CMD state,
; so it can be activated.
;
; On Entry:
; al = word of EEPROM data on which test will contend
; dx = ID port (to which ID sequence was written)
; cli
;
; On Exit:
; ax = EEPROM data read back by hardware through contention test.
; dx = preserved
; bx = trashed
; cli
;
;--------------------------------------------------------------------
proc Contention_Test
push bx
push cx
push dx
add al, READ_EEPROM ; select EEPROM data to
out dx, al ; contend on
cli
; seems to solve some problem when Init is ran a few times
mov cx, 3000h ; 5 ms
call WaitTime
sti
mov cx, 16 ; read 16 times
xor bx, bx ; reset the result
contention_read:
shl bx, 1
in al, dx ; reading ID port causes
; contention test
and ax, 1 ; each time, we read bit 0
add bx, ax
loop contention_read
mov ax, bx
pop dx
pop cx
pop bx
ret
endp Contention_Test
;--------------------------------------------------------------------
; WaitTime - CX has 2*1.1932 the number of microseconds to wait.
; If CX is small, add 1 to compensate for asynchronous nature
; of clock. For example, for 10us, call with CX = 25
;
; On entry,
; ints off (especially if CX is small, and accuracy needed)
; On exit,
; CX modified
;
; 911223 0.0 GK
;--------------------------------------------------------------------
proc WaitTime
push ax
push bx
call ReadTimer0 ; get Timer0 value in AX
mov bx, ax ; save in BX
ReadTimer0Loop:
call ReadTimer0
push bx
sub bx, ax
cmp bx, cx
pop bx
jc ReadTimer0Loop
pop bx
pop ax
ret
endp WaitTime
proc ReadTimer0
mov al, 6
out 43h, al ; port 43h, 8253 wrt timr mode 3
call RT0
RT0:
jmp short $+2
jmp short $+2
jmp short $+2
in al, 40h ; port 40h, 8253 timer 0 clock
xchg ah, al
ret
endp ReadTimer0
| 25.728033 | 79 | 0.467556 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.