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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d4784c107ee80b5fb1c65ac7350589400114f0a3 | 5,607 | asm | Assembly | demos/SicDemos/drawtext/drawtext.asm | roycrippen/sicxe | fdca37f56c95f2a76a78455f86a90e4b89329a54 | [
"MIT"
] | null | null | null | demos/SicDemos/drawtext/drawtext.asm | roycrippen/sicxe | fdca37f56c95f2a76a78455f86a90e4b89329a54 | [
"MIT"
] | null | null | null | demos/SicDemos/drawtext/drawtext.asm | roycrippen/sicxe | fdca37f56c95f2a76a78455f86a90e4b89329a54 | [
"MIT"
] | null | null | null | . DRAW
. enter a command (or more commands) to stdin and press enter to draw
. commands:
. - h : displays help on stdout
. - w, a, s, d : up, left, down, right
. - f : changes drawing symbol to next typed character
. - c : clears the screen and returns to center
. - p : fills the screen with drawing symbol
. - q : halt
.
. examples: 'aaaa wwww dddd ssss' -> draws a 4x4 square
. 'f.' -> changes drawing symbol to '.'
. 'f-dddf df-dddf df-ddd' -> draws a dashed line '--- --- ---'
.
draw START 0
reset LDA scrcols . calculate center: X = (scrcols/2) * scrrows
DIV #2
MUL scrrows
RMO A, X . set X to center coordinate
J help . display help (comment this line to skip it)
J printcur
input RD #0
COMP #10
JEQ input . newline, ignore
COMP #113
JEQ halt . q, halt
COMP #102
JEQ switch . f, change drawing symbol
COMP #99
JEQ clear . c, clear screen
COMP #112
JEQ fill . p, fill screen
COMP #104
JEQ help . h, help
COMP #119
JEQ up . w a s d za premikanje kurzorja
COMP #97
JEQ left
COMP #115
JEQ down
COMP #100
JEQ right
J input
. switch the drawing symbol
switch RD #0
COMP #10
JEQ switch . newline is ignored, read another character
STA symbol
J input
. clear screen - call scrclear
clear JSUB scrclear
J reset
. fill screen - load symbol and call scrfill
fill LDA symbol
JSUB scrfill
J reset
printcur LDA cursor . print cursor to coordinate in X
+STCH screen, X
J input
. move up
up LDA symbol
+STCH screen, X . print symbol on current X (location of cursor)
LDA scrcols . move X up (X = X - scrcols)
SUBR A, X
LDA #0
COMPR X, A . if X is too far up, move it to bottom of the screen
JLT pluslen
J printcur
pluslen LDA scrlen . moves X from above the screen to bottom (adds scrlen)
ADDR A, X
J printcur . add scrlen (move X from top to bottom)
. move down - almost the same as up
down LDA symbol
+STCH screen, X . draw symbol to X, move X down one row
LDA scrcols
ADDR A, X
LDA scrlen
COMPR X, A
JGT minuslen . if X is too far down, move it to top of screen
J printcur
minuslen LDA scrlen . subtract scrlen (move X from bottom to top)
SUBR A, X
J printcur
. move left
left LDA symbol
+STCH screen, X . draw symbol to X
RMO X, A
DIV scrcols . calculate current row ( X / scrcols)
STA currow
LDA #1
SUBR A, X . move X one to left
RMO X, A . if X moved too far left, it will be one row higher on the right side
DIV scrcols
COMP currow . X / scrcols gives us the row X is on
JLT pluscol . if calculated row is lower than currow, move one down
J printcur
pluscol LDA scrcols . add scrcols (move X one down)
ADDR A, X
J printcur
. move right - almost the same as up
right LDA symbol
+STCH screen, X . draw symbol, move X to right, check if we went too far
RMO X, A
DIV scrcols
STA currow
LDA #1
ADDR A, X
RMO X, A
DIV scrcols
JGT minuscol . if calculated row is too high, move X one row up
J printcur
minuscol LDA scrcols . subtract scrcols (move X one up)
SUBR A, X
J printcur
help STX tmpX . print help to stdout
LDX #0
LDA #helplen .calculate length of help text
SUB #helptxt
SUB #2
STA helplen
help1 LDA helptxt, X . read from helptxt, write to stdout
WD #1
TIX helplen . increment X and compare it to help length
JEQ rethelp
J help1
rethelp LDX tmpX . restore X, set A to 0 and go to input
LDA #0
J printcur . draw cursor on the screen and wait for new input
scrclear STA tmpA . save A to tmpA, set it to space and call writeA
LDA #32
J writeA
scrfill STA tmpA . save A to tmpA and call writeA
J writeA
writeA STX tmpX . write last bit of A to whole screen
LDX #0
loop +STCH screen, X
TIX scrlen
JEQ return
J loop
return LDX tmpX . reload A and X from tmpA and tmpX
LDA tmpA
RSUB
halt J halt
symbol WORD 42 . drawing symbol
cursor WORD 43 . cursor symbol
currow WORD 12 . current row
tmpX RESW 1
tmpA RESW 1
scrcols WORD 80 . screen columns - should be the same as settings in simulator
scrrows WORD 25 . screen rows
scrlen WORD 2000
. help text
helptxt BYTE C' ---DRAW---'
BYTE 10
BYTE C'type a command (or more commands) to stdin and press enter to draw'
BYTE 10
BYTE C'commands:'
BYTE 10
BYTE C'- h: help'
BYTE 10
BYTE C'- w,a,s,d: up, left, down, right'
BYTE 10
BYTE C'- f: change drawing symbol to next entered character'
BYTE 10
BYTE C'- c: clear screen and move to center'
BYTE 10
BYTE C'- p: fill screen with drawing symbol'
BYTE 10
BYTE C'- q: stop the program'
BYTE 10
helplen RESW 1
ORG 47104 . screen address in memory
screen RESB 1
| 29.510526 | 97 | 0.562333 |
2323e5870cc8ac46d82afcc887b6af678e99a861 | 34 | asm | Assembly | src/main/fragment/mos6502-common/pwuc1_derefidx_vbuxx_neq_0_then_la1.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | 2 | 2022-03-01T02:21:14.000Z | 2022-03-01T04:33:35.000Z | src/main/fragment/mos6502-common/pwuc1_derefidx_vbuxx_neq_0_then_la1.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | src/main/fragment/mos6502-common/pwuc1_derefidx_vbuxx_neq_0_then_la1.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | lda {c1}+1,x
ora {c1},x
bne {la1}
| 8.5 | 12 | 0.558824 |
030a4ea7ea87818d143b27e7ee4307e36a7ab5d3 | 47 | asm | Assembly | src/main/fragment/mos6502-common/vwum1=vbuaa_plus_vbum2.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | 2 | 2022-03-01T02:21:14.000Z | 2022-03-01T04:33:35.000Z | src/main/fragment/mos6502-common/vwum1=vbuaa_plus_vbum2.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | src/main/fragment/mos6502-common/vwum1=vbuaa_plus_vbum2.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | clc
adc {m2}
sta {m1}
lda #0
adc #0
sta {m1}+1
| 6.714286 | 10 | 0.574468 |
c0d1e0c00d4a19432a9e744ae19d69cca3e4bcf6 | 5,601 | asm | Assembly | installer/install.asm | speccytools/spectranet-index-module | d23b03c3b11ce4fb07129392ff5a16b4651e69ca | [
"MIT"
] | null | null | null | installer/install.asm | speccytools/spectranet-index-module | d23b03c3b11ce4fb07129392ff5a16b4651e69ca | [
"MIT"
] | null | null | null | installer/install.asm | speccytools/spectranet-index-module | d23b03c3b11ce4fb07129392ff5a16b4651e69ca | [
"MIT"
] | null | null | null | global install_new_module
global install_replace_module
extern module_binary
include "../include/spectranet.inc"
include "../include/sysvars.inc"
STR_install_message:
defb "Installing Spectranet Search Index...\n", 0
STR_install_fail:
defb "Failed!\n", 0
install_replace_module:
ld (v_workspace), a
and 0xFC ; mask out bottom two bits to find
ld (v_workspace + 1), a ; the sector, store it for later
call F_copysectortoram ; copy the flash sector
ld a, (v_workspace) ; calculate the RAM page to use
and 0x03 ; get position in the sector
add a, 0xDC ; add RAM page number
call SETPAGEA
ld hl, module_binary
ld de, 0x1000
ld bc, 0x1000
ldir
ld a, (v_workspace + 1) ; retrieve sector page
di
call F_FlashEraseSector
ld a, (v_workspace + 1)
call F_writesector ; write the new contents of RAM
ei
ld hl, STR_install_message
call PRINT42
ret
; F_copysectortoram
; Copies 4 pages of flash to RAM.
; Parameter: A = first page.
F_copysectortoram:
ex af, af' ; save ROM page
ld a, 0xDC ; first RAM page
ld b, 4 ; pages to copy
copyloop14:
push bc
call SETPAGEB ; RAM into area B
inc a
ex af, af' ; ROM page into A
call SETPAGEA ; page it in
inc a
ex af, af' ; for the next iteration.
ld hl, 0x1000 ; copy the page
ld de, 0x2000
ld bc, 0x1000
ldir
pop bc
djnz copyloop14
ret
install_new_module:
ld hl, STR_install_message
call PRINT42
call F_findfirstfreepage
jp c, install_module_failed
call SETPAGEB
ld hl, module_binary
ld de, 0x2000
ld bc, 0x1000
call F_FlashWriteBlock
jp c, install_module_failed
ret
install_module_failed:
ld hl, STR_install_fail
call PRINT42
ret
F_findfirstfreepage:
ld a, 0x04
loop3:
call SETPAGEB
ex af, af'
ld a, (0x2000)
cp 0xFF ; FF = free page
jr z, found3
ex af, af'
cp 0x1F ; Last page?
jr z, nospace3
inc a
jr loop3
nospace3:
scf
ret
found3:
ex af, af'
and a ; make sure carry is reset
ret
;---------------------------------------------------------------------------
; F_FlashEraseSector
; Simple flash writer for the Am29F010 (and probably any 1 megabit flash
; with 16kbyte sectors)
;
; Parameters: A = page to erase (based on 4k Spectranet pages, but
; erases a 16k sector)
; Carry flag is set if an error occurs.
F_FlashEraseSector:
; Page in the appropriate sector first 4k into page area B.
; Page to start the erase from is in A.
call SETPAGEB ; page into page area B
ld a, 0xAA ; unlock code 1
ld (0x555), a ; unlock addr 1
ld a, 0x55 ; unlock code 2
ld (0x2AA), a ; unlock addr 2
ld a, 0x80 ; erase cmd 1
ld (0x555), a ; erase cmd addr 1
ld a, 0xAA ; erase cmd 2
ld (0x555), a ; erase cmd addr 2
ld a, 0x55 ; erase cmd 3
ld (0x2AA), a ; erase cmd addr 3
ld a, 0x30 ; erase cmd 4
ld (0x2000), a ; erase sector address
ld hl, 0x2000
wait1:
bit 7, (hl) ; test DQ7 - should be 1 when complete
jr nz, complete1
bit 5, (hl) ; test DQ5 - should be 1 to continue
jr z, wait1
bit 7, (hl) ; test DQ7 again
jr z, borked1
complete1:
or 0 ; clear carry flag
ret
borked1:
scf ; carry flag = error
ret
;---------------------------------------------------------------------------
; F_FlashWriteBlock
; Copies a block of memory to flash. The flash should be mapped into
; page area B.
; Parameters: HL = source start address
; DE = destination start address
; BC = number of bytes to copy
; On error, the carry flag is set.
F_FlashWriteBlock:
ld a, (hl) ; get byte to write
call F_FlashWriteByte
ret c ; on error, return immediately
inc hl ; point at next source address
inc de ; point at next destination address
dec bc ; decrement byte count
ld a, b
or c ; is it zero?
jr nz, F_FlashWriteBlock
ret
;---------------------------------------------------------------------------
; F_FlashWriteByte
; Writes a single byte to the flash memory.
; Parameters: DE = address to write
; A = byte to write
; On return, carry flag set = error
; Page the appropriate flash area into one of the paging areas to write to
; it, and the address should be in that address space.
F_FlashWriteByte:
push bc
ld c, a ; save A
ld a, 0xAA ; unlock 1
ld (0x555), a ; unlock address 1
ld a, 0x55 ; unlock 2
ld (0x2AA), a ; unlock address 2
ld a, 0xA0 ; Program
ld (0x555), a ; Program address
ld a, c ; retrieve A
ld (de), a ; program it
wait3:
ld a, (de) ; read programmed address
ld b, a ; save status
xor c
bit 7, a ; If bit 7 = 0 then bit 7 = data
jr z, byteComplete3
bit 5, b ; test DQ5
jr z, wait3
ld a, (de) ; read programmed address
xor c
bit 7, a ; Does DQ7 = programmed data? 0 if true
jr nz, borked3
byteComplete3:
pop bc
or 0 ; clear carry flag
ret
borked3:
pop bc
scf ; error = set carry flag
ret
;---------------------------------------------------------------------------
; F_writesector
; Writes 4 pages from the last 4 pages of RAM to flash, starting at the
; page specified in A
F_writesector:
ex af, af' ; swap with alternate set
ld a, 0xDC ; RAM page 0xDC
ld b, 4 ; number of pages
loop4:
push bc
call SETPAGEA ; Page into area A
inc a ; next page
ex af, af' ; get flash page to program
call SETPAGEB
inc a ; next page
ex af, af' ; back to ram page for next iteration
ld hl, 0x1000
ld de, 0x2000
ld bc, 0x1000
push af
call F_FlashWriteBlock
jr c, failed4 ; restore stack and exit
pop af
pop bc
djnz loop4 ; next page
ret
failed4: ; restore stack, set carry flag
pop af
pop bc
scf
ret
| 23.049383 | 76 | 0.639707 |
c9f2051ee6fab002cb0b35b50572a6c093c54f43 | 746 | asm | Assembly | programs/oeis/267/A267797.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/267/A267797.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/267/A267797.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A267797: Lucas numbers of the form (x^3 + y^3) / 2 where x and y are distinct positive integers.
; 76,1364,24476,439204,7881196,141422324,2537720636,45537549124,817138163596,14662949395604,263115950957276,4721424167835364,84722519070079276,1520283919093591604,27280388024614569596,489526700523968661124,8784200221406821330636,157626077284798815290324,2828485190904971853895196,50755107359004694554823204,910763447271179530132922476,16342986943522226847837781364,293263001536128903730947142076,5262391040706798040309210776004,94429775731186235821834846825996,1694473572120645446752718032091924,30406094522440431805727089730828636,545615227831807127056334897122823524
add $0,1
seq $0,119032 ; a(n+2)=18a(n+1)-a(n)+8.
sub $0,9
mul $0,8
add $0,76
| 82.888889 | 568 | 0.872654 |
5a2d7a0a599e202380c7dfaf14a3f0858c9190e4 | 3,505 | asm | Assembly | programs/oeis/289/A289156.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/289/A289156.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/289/A289156.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A289156: Largest area of triangles with integer sides and area = n times perimeter.
; 60,1224,8436,34320,103020,254040,546084,1060896,1907100,3224040,5185620,8004144,11934156,17276280,24381060,33652800,45553404,60606216,79399860,102592080,130913580,165171864,206255076,255135840,312875100,380625960,459637524,551258736,656942220,778248120,916847940,1074528384,1253195196,1454877000,1681729140,1936037520,2220222444,2536842456,2888598180,3278336160,3709052700,4183897704,4706178516,5279363760,5907087180,6593151480,7341532164,8156381376,9042031740,10003000200,11043991860,12169903824,13385829036,14697060120,16109093220,17627631840,19258590684,21008099496,22882506900,24888384240,27032529420,29321970744,31763970756,34366030080,37135891260,40081542600,43211222004,46533420816,50056887660,53790632280,57743929380,61926322464,66347627676,71017937640,75947625300,81147347760,86628050124,92400969336,98477638020,104869888320,111589855740,118649982984,126063023796,133842046800,142000439340,150551911320,159510499044,168890569056,178706821980,188974296360,199708372500,210924776304,222639583116,234869221560,247630477380,260940497280,274816792764,289277243976,304340103540,320024000400,336347943660,353331326424,370993929636,389355925920,408437883420,428260769640,448845955284,470215218096,492390746700,515395144440,539251433220,563983057344,589613887356,616168223880,643670801460,672146792400,701621810604,732121915416,763673615460,796303872480,830040105180,864910193064,900942480276,938165779440,976609375500,1016303029560,1057276982724,1099561959936,1143189173820,1188190328520,1234597623540,1282443757584,1331761932396,1382585856600,1434949749540,1488888345120,1544436895644,1601631175656,1660507485780,1721102656560,1783454052300,1847599574904,1913577667716,1981427319360,2051188067580,2122900003080,2196603773364,2272340586576,2350152215340,2430081000600,2512169855460,2596462269024,2683002310236,2771834631720,2863004473620,2956557667440,3052540639884,3151000416696,3251984626500,3355541504640,3461719897020,3570569263944,3682139683956,3796481857680,3913647111660,4033687402200,4156655319204,4282604090016,4411587583260,4543660312680,4678877440980,4817294783664,4958968812876,5103956661240,5252316125700,5404105671360,5559384435324,5718212230536,5880649549620,6046757568720,6216598151340,6390233852184,6567727920996,6749144306400,6934547659740,7124003338920,7317577412244,7515336662256,7717348589580,7923681416760,8134404092100,8349586293504,8569298432316,8793611657160,9022597857780,9256329668880,9494880473964,9738324409176,9986736367140,10240192000800,10498767727260,10762540731624,11031588970836,11305991177520,11585826863820,11871176325240,12162120644484,12458741695296,12761122146300,13069345464840,13383495920820,13703658590544,14029919360556,14362364931480,14701082821860,15046161372000,15397689747804,15755757944616,16120456791060,16491877952880,16870113936780,17255258094264,17647404625476,18046648583040,18453085875900,18866813273160,19287928407924,19716529781136,20152716765420,20596589608920,21048249439140,21507798266784,21975338989596,22450975396200,22934812169940,23426954892720,23927510048844,24436585028856,24954288133380,25480728576960,26016016491900,26560262932104,27113579876916,27676080234960,28247877847980,28829087494680,29419824894564,30020206711776,30630350558940,31250375001000
mov $2,$0
add $0,14
add $2,1
mul $2,2
lpb $0
mov $0,$2
mov $1,$2
mul $1,$2
add $1,1
mul $0,$1
mul $1,$0
add $1,$0
sub $0,$0
mul $1,2
lpe
sub $1,117
div $1,24
mul $1,12
add $1,60
| 152.391304 | 3,221 | 0.894437 |
943742d6ef287b3457fe64fdf876ea79737c4081 | 2,191 | asm | Assembly | programs/oeis/213/A213837.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/213/A213837.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/213/A213837.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A213837: Principal diagonal of the convolution array A213836.
; 1,13,52,134,275,491,798,1212,1749,2425,3256,4258,5447,6839,8450,10296,12393,14757,17404,20350,23611,27203,31142,35444,40125,45201,50688,56602,62959,69775,77066,84848,93137,101949,111300,121206,131683,142747,154414,166700,179621,193193,207432,222354,237975,254311,271378,289192,307769,327125,347276,368238,390027,412659,436150,460516,485773,511937,539024,567050,596031,625983,656922,688864,721825,755821,790868,826982,864179,902475,941886,982428,1024117,1066969,1111000,1156226,1202663,1250327,1299234,1349400,1400841,1453573,1507612,1562974,1619675,1677731,1737158,1797972,1860189,1923825,1988896,2055418,2123407,2192879,2263850,2336336,2410353,2485917,2563044,2641750,2722051,2803963,2887502,2972684,3059525,3148041,3238248,3330162,3423799,3519175,3616306,3715208,3815897,3918389,4022700,4128846,4236843,4346707,4458454,4572100,4687661,4805153,4924592,5045994,5169375,5294751,5422138,5551552,5683009,5816525,5952116,6089798,6229587,6371499,6515550,6661756,6810133,6960697,7113464,7268450,7425671,7585143,7746882,7910904,8077225,8245861,8416828,8590142,8765819,8943875,9124326,9307188,9492477,9680209,9870400,10063066,10258223,10455887,10656074,10858800,11064081,11271933,11482372,11695414,11911075,12129371,12350318,12573932,12800229,13029225,13260936,13495378,13732567,13972519,14215250,14460776,14709113,14960277,15214284,15471150,15730891,15993523,16259062,16527524,16798925,17073281,17350608,17630922,17914239,18200575,18489946,18782368,19077857,19376429,19678100,19982886,20290803,20601867,20916094,21233500,21554101,21877913,22204952,22535234,22868775,23205591,23545698,23889112,24235849,24585925,24939356,25296158,25656347,26019939,26386950,26757396,27131293,27508657,27889504,28273850,28661711,29053103,29448042,29846544,30248625,30654301,31063588,31476502,31893059,32313275,32737166,33164748,33596037,34031049,34469800,34912306,35358583,35808647,36262514,36720200,37181721,37647093,38116332,38589454,39066475,39547411,40032278,40521092,41013869,41510625
mov $1,$0
add $1,1
mov $4,$0
add $4,$0
add $4,$0
mov $3,$4
lpb $0
sub $0,1
add $2,$1
add $1,$3
add $1,$3
sub $1,$0
add $1,3
lpe
add $0,$2
add $1,$0
| 109.55 | 1,965 | 0.841168 |
5ebe0d24a1ade6785fe3ee861eb0c583dd7400c8 | 390 | asm | Assembly | oeis/027/A027173.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/027/A027173.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/027/A027173.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A027173: a(n) = A027170(2n, n-1).
; Submitted by Jon Maiga
; 5,30,123,472,1790,6794,25879,98952,379674,1461248,5638930,21811540,84542016,328287506,1276868111,4973645576,19398954626,75753497816,296142817406,1158865623236,4539024407576,17793358627976,69805770185498
mul $0,2
mov $1,$0
div $0,2
add $1,2
mov $2,$1
bin $1,$0
add $0,1
add $2,2
bin $2,$0
mul $2,2
add $2,$1
mov $0,$2
sub $0,4
| 21.666667 | 204 | 0.728205 |
bf458f07500e8066341902d65c7aee6168f796b1 | 749 | asm | Assembly | programs/oeis/304/A304507.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/304/A304507.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/304/A304507.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A304507: a(n) = 5*(n+1)*(9*n+4).
; 20,130,330,620,1000,1470,2030,2680,3420,4250,5170,6180,7280,8470,9750,11120,12580,14130,15770,17500,19320,21230,23230,25320,27500,29770,32130,34580,37120,39750,42470,45280,48180,51170,54250,57420,60680,64030,67470,71000,74620,78330,82130,86020,90000,94070,98230,102480,106820,111250,115770,120380,125080,129870,134750,139720,144780,149930,155170,160500,165920,171430,177030,182720,188500,194370,200330,206380,212520,218750,225070,231480,237980,244570,251250,258020,264880,271830,278870,286000,293220,300530,307930,315420,323000,330670,338430,346280,354220,362250,370370,378580,386880,395270,403750,412320,420980,429730,438570,447500
mov $1,9
mul $1,$0
add $1,13
mul $1,$0
div $1,2
mul $1,10
add $1,20
mov $0,$1
| 62.416667 | 634 | 0.789052 |
9c612fbf710a58ea5d5b95526271f88fef7a2ecd | 147 | asm | Assembly | other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/英語_PAL/pal_asm/zel_enmy.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/英語_PAL/pal_asm/zel_enmy.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/英語_PAL/pal_asm/zel_enmy.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | Name: zel_enmy.asm
Type: file
Size: 534767
Last-Modified: '2016-05-13T04:25:37Z'
SHA-1: 493ED21F0B2F7158FE9D096A1A0265ED7940B8B3
Description: null
| 21 | 47 | 0.816327 |
c10c1b1d7113c898702440afc3c4966519c2a225 | 1,029 | asm | Assembly | libsrc/stdio/__printf_format_table.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/stdio/__printf_format_table.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/stdio/__printf_format_table.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ; Default set of formatters for printf
;
; These will be used by default when sdcc pulls in printf
MODULE __printf_format_table
SECTION rodata_clib
PUBLIC __printf_format_table
PUBLIC __printf_get_flags
EXTERN __printf_get_flags_impl
EXTERN __printf_handle_s
EXTERN __printf_handle_c
EXTERN __printf_handle_d
EXTERN __printf_handle_u
EXTERN __printf_handle_x
EXTERN __printf_handle_o
EXTERN __printf_handle_p
EXTERN __printf_handle_X
EXTERN __printf_handle_B
EXTERN __printf_handle_n
EXTERN __printf_handle_ll
defc __printf_get_flags = __printf_get_flags_impl
__printf_format_table:
defb 's'
defw __printf_handle_s
defb 'c'
defw __printf_handle_c
defb 'd'
defw __printf_handle_d
defb 'u'
defw __printf_handle_u
defb 'x'
defw __printf_handle_x
defb 'o'
defw __printf_handle_o
defb 'p'
defw __printf_handle_p
defb 'X'
defw __printf_handle_X
defb 'n'
defw __printf_handle_n
defb 'B'
defw __printf_handle_B
IF !__CPU_INTEL__ && !__CPU_GBZ80__
defb 'l'
defw __printf_handle_ll
ENDIF
defb 0
| 20.176471 | 57 | 0.822157 |
a884e8b4f032aa835596c1a5b199df8ebf9fd117 | 432 | asm | Assembly | output.asm | farazmurtaza/expression_to_assembly_generator | 2c1712f87709a4ac412c7ed4056e75abdbe5c2a2 | [
"MIT"
] | null | null | null | output.asm | farazmurtaza/expression_to_assembly_generator | 2c1712f87709a4ac412c7ed4056e75abdbe5c2a2 | [
"MIT"
] | null | null | null | output.asm | farazmurtaza/expression_to_assembly_generator | 2c1712f87709a4ac412c7ed4056e75abdbe5c2a2 | [
"MIT"
] | null | null | null | includelib C:\Irvine\Kernel32.Lib
includelib C:\Irvine\User32.Lib
includelib C:\Irvine\Irvine32.lib
INCLUDE C:\Irvine\Irvine32.inc
.data
.code
main PROC
MOV EAX, 0
MOV AX, 22
PUSH AX
MOV AX, 50
PUSH AX
MOV AX, 36
PUSH AX
MOV AX, 12
PUSH AX
POP BX
POP AX
MOV DX, 0
DIV BX
PUSH AX
MOV AX, 16
PUSH AX
POP BX
POP AX
SUB AX, BX
PUSH AX
POP AX
POP BX
ADD AX, BX
PUSH AX
POP AX
POP BX
MUL BX
PUSH AX
call writedec
exit
main ENDP
END main
| 10.536585 | 33 | 0.740741 |
0fdb27f2b35b2c8b1a277290c2363b5274155459 | 401 | asm | Assembly | programs/oeis/028/A028309.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/028/A028309.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/028/A028309.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A028309: Molien series for ring of symmetrized weight enumerators of self-dual codes (with respect to Euclidean inner product) of length n over GF(4).
; 1,1,2,3,5,6,9,11,15,18,23,27,33,38,45,51,59,66,75,83,93,102,113,123,135,146,159,171,185,198,213,227,243,258,275,291,309,326,345,363,383,402,423,443,465,486,509,531,555
mov $1,$0
div $1,2
sub $0,$1
mul $1,$0
trn $0,2
sub $1,$0
mov $0,$1
add $0,1
| 33.416667 | 169 | 0.698254 |
2b051fe085b2ea071b4473f1a4036c9875ec14aa | 330 | asm | Assembly | programs/oeis/099/A099431.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/099/A099431.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/099/A099431.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A099431: Expansion of x(1-2x+3x^2)/(1-x-2x)^2;.
; 0,1,0,6,8,30,60,154,336,774,1700,3762,8184,17758,38220,81930,174752,371382,786420,1660258,3495240,7340046,15379100,32156346,67108848,139810150,290805060,603979794,1252698776,2594876094,5368709100
mov $2,$0
lpb $2,1
mul $1,2
add $3,$1
mov $1,$0
mov $0,$3
sub $2,1
lpe
| 27.5 | 197 | 0.706061 |
8d4ca1810e0c715e84f1395ddda67d2518821771 | 6,714 | asm | Assembly | source/main.asm | paulscottrobson/atari-cosmos | b1cebdf3baca36df6604957b04aa890fb057074d | [
"MIT"
] | null | null | null | source/main.asm | paulscottrobson/atari-cosmos | b1cebdf3baca36df6604957b04aa890fb057074d | [
"MIT"
] | null | null | null | source/main.asm | paulscottrobson/atari-cosmos | b1cebdf3baca36df6604957b04aa890fb057074d | [
"MIT"
] | null | null | null | ; **********************************************************************************************************
; **********************************************************************************************************
;
; Main Program
;
; **********************************************************************************************************
; **********************************************************************************************************
; **********************************************************************************************************
;
; Start / Restart of Program
;
; **********************************************************************************************************
Reset:
clra
lei 2
jsr ClearMemory ; clear memory
jsr GetGameID ; figure out which game we are playing.
aisc 15 ; running game # 0
jp InitialiseGames ; skip over selection code.
; **********************************************************************************************************
;
; Selection phase. Allows changing of #Players and Skill Level, and game starting.
;
; **********************************************************************************************************
SELLoop:
lbi GameSpeed ; point to speed.
clra
aisc 5 ; 5 (S) for slow
skmbz 0
aisc 5 ; 10 is F.
xad 2,LeftDigit
ldd PlayerCount ; get player count
aisc 1 ; make 0/1 1/2
xad 2,RightDigit
; **********************************************************************************************************
; HACK
; **********************************************************************************************************
;jp InitialiseGames ; uncomment this to run automatically S/1.
SELReleaseKey:
jsr SELSkipCtrlKey
jp SELWaitKey
jp SELReleaseKey
SELWaitKey: ; wait for keyboard key to be pressed.
jsr Random
jsr SELSkipCtrlKey
jp SELWaitKey
skmbz KFB_START ; if start pressed return
jp InitialiseGames
skmbz KFB_PLAYERS ; if player not pressed must be skill level aka speed.
lbi PlayerCount ; if pressed player#
lbi GameSpeed ; lbi fall-through.
clra ; toggle bit zero of the selected control nibble.
aisc 1
xor
x 0
jmp SELLoop ; loop back.
;
; Utility Routine : Update Screen / Check control keys ; RETSK if a key is pressed.
;
SELSkipCtrlKey:
jsrp Repaint ; wait for keyboard to be released.
jsrp ScanKeyboard
lbi KeysControl ; B = control keys
clra ; A = 0
ske ; skip if equal e.g. no key pressed
retsk ; skip on press
ret
; **********************************************************************************************************
;
; Initialise both players, then kill the second one if it's a one player game.
;
; **********************************************************************************************************
InitialiseGames:
jsrp CommonInitialise
jsr SwapPlayerData ; on both halves of memory.
jsrp CommonInitialise
lbi 5,0
smb 3 ; set bit 3, which identifies player #1.
ldd PlayerCount ; read the players
aisc 15 ; will skip if 2 player game.
smb 0 ; kill player 2 as 1 player game.
jmp RunGameCode
; **********************************************************************************************************
; **********************************************************************************************************
;
; Come here when the turn is over. Swap Players over if the alternate players kill bit is clear.
; If Alternate Playe is dead, check to see if Current Player is dead as well ; if so restart.
;
; **********************************************************************************************************
; **********************************************************************************************************
GameTurnOver:
lbi 5,InfoBits ; alternate players (2) kill bit set ?
skmbz 0 ; skipped if still alive.
jp Player2IsDead
jsr SwapPlayerData ; swap player data round.
jp RunGameCode ; and run the game code
; **********************************************************************************************************
;
; Alternate Player is dead, check for game over, if not, run again with player
;
; **********************************************************************************************************
Player2IsDead:
lbi 2,0 ; see if Player 1 is dead.
skmbz 0
jmp Reset ; if so, then reset the game.
; **********************************************************************************************************
;
; Run the game/init code.
;
; **********************************************************************************************************
RunGameCode:
jsrp CommonNewTurn ; clear the screen etc.
lbi GameID ; point to GameID
clra
aisc 7 ; set up JQID.
jid ; jump.
; **********************************************************************************************************
;
; Game Vectors
;
; **********************************************************************************************************
VectorBase:
jmp Football ; game 0 (game under development - no hologram on emulator)
jmp Asteroids ; game 1 (Asteroids)
jmp SpaceInvaders ; game 2 (Space Invaders)
jmp Outlaw ; game 3 (Outlaw)
jmp RoadRunner ; game 4 (Road Runner)
jmp Destroyer ; game 5 (Destroyer)
jmp Superman ; game 6 (Superman)
jmp Football ; game 7 (Football)
jmp Basketball ; game 8 (Basketball)
; **********************************************************************************************************
;
; PC LSB values for JQID
;
; **********************************************************************************************************
page 1
offset 48
byte VectorBase+0 &255 ; JQID Jump Table
byte VectorBase+2 &255
byte VectorBase+4 &255
byte VectorBase+6 &255
byte VectorBase+8 &255
byte VectorBase+10 &255
byte VectorBase+12 &255
byte VectorBase+14 &255
byte VectorBase+16 &255
; **********************************************************************************************************
;
; Initialisation done in every game
;
; **********************************************************************************************************
FN__CommonInitialise:
lbi 2,LeftDigit ; reset score.
stii 0
stii 0
lbi 2,Lives ; reset lives
stii 2 ; 2 is 3 because it fails when lives was 0.
ret
| 36.48913 | 108 | 0.366994 |
fb33c8d786f12d79f22402b82f0983408901900a | 632 | asm | Assembly | programs/oeis/202/A202455.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/202/A202455.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/202/A202455.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A202455: Number of (n+2) X 4 binary arrays with consecutive windows of three bits considered as a binary number nondecreasing in every row and column.
; 729,1194,1876,2835,4137,5854,8064,10851,14305,18522,23604,29659,36801,45150,54832,65979,78729,93226,109620,128067,148729,171774,197376,225715,256977,291354,329044,370251,415185,464062,517104,574539,636601,703530
mov $3,10
mov $7,$0
add $0,11
mov $8,7
sub $8,$0
lpb $0
pow $3,2
mov $4,1
mul $4,$8
mul $4,$0
mov $0,$2
mov $6,1
add $6,$3
mov $8,6
sub $8,$4
div $8,2
pow $8,2
lpe
add $6,$8
sub $6,2
mov $1,$6
add $1,5
mov $5,$7
mul $5,$7
mul $5,$7
add $1,$5
| 21.066667 | 213 | 0.677215 |
2bd8853953c9371c06776a5eecd70ce4a1a30e58 | 5,567 | asm | Assembly | lib/vector.6502.asm | mikroman/lib-acorn-bbc-main_KICK | e43c1b773644f6f816100f887eddb5b48a22c56a | [
"MIT"
] | null | null | null | lib/vector.6502.asm | mikroman/lib-acorn-bbc-main_KICK | e43c1b773644f6f816100f887eddb5b48a22c56a | [
"MIT"
] | null | null | null | lib/vector.6502.asm | mikroman/lib-acorn-bbc-main_KICK | e43c1b773644f6f816100f887eddb5b48a22c56a | [
"MIT"
] | null | null | null | #importonce
#import "macros.6502.asm"
#import "constants.6502.asm"
#import "output.6502.asm"
//
// title: bbc micro vector output routines
// author: dean belfield
// created: 25/10/2020
// last updated: 25/10/2020
//
// requires: output, macros, constants
//
// modinfo:
//
// plot a pixel
// x: x coordinate
// y: y coordinate
// a: pixel colour (plot only)
// returns:
// sl/sh: screen address
//
plot:
sta pc // store the pixel colour
plot_pc:
{
jsr get_pixel_address // get the pixel address
beq s1 // skip if left pixel byte
lda pc // get the colour
and #%01010101 // mask out the right pixel
sta m1+1 // store it back temporarily
ldy #0 // clear the index registere
lda (sl),y // get the pixel we're writing to
and #%10101010 // and out any pixel data already there
m1:
ora #$ff // or in the new data
sta (sl),y // store
rts
s1:
lda pc // get the colour
and #%10101010 // mask out the left pixel
sta m2+1 // store it back temporarily
ldy #0 // clear the index registere
lda (sl),y // get the pixel we're writing to
and #%01010101 // and out any pixel data already there
m2:
ora #$ff // or in the new data
sta (sl),y // store
rts
}
unplot:
rts
// x: x pixel position of circle centre
// y: x pixel position of circle centre
// a: colour (0-15)
// r0: radius
// r2/r3: delta
// r4/r5: d1
// r6/r7: d2
// r8/r9: x/y position in quadrant
//
draw_circle:
{
stx px // store the circle centre
sty py
sta pc // store the circle colour
lda r0 // get the radius
bne skip_1 // if > 0 then draw circle
jmp plot_pc
skip_1:
sta r9 // store radius in py
ldx #0 // store 0 in px
stx r8
//
// delta and d1 = 1 (delta should be 1-r?)
//
stx r3 // high bytes 0
stx r5
stx r7 // also high byte of delta
inx
stx r2
stx r4
//
// calculate d2 = 3-(r*2)
//
as16l(r7) // multiply a/r7 by 2
sta r6 // r6/r7 = (r*2)
lda #3 // now subtract it from 3
sec
sbc r6
sta r6
lda #0
sbc r7
sta r7 // r6/r7 = 3-(r*2)
//
// the loop
//
loop: lda r9 // get y
cmp r8 // compare with x
bcs skip_4 // end if x > y
rts
//
// the circle routine calculates 1/8th of a circle// this block of code uses
// symmetry to draw a complete circle
//
skip_4:
lda px
add(r8)
tax // plot the first quadrant
lda py
add(r9)
tay
jsr plot_pc
lda px
add(r9)
tax
lda py
add(r8)
tay
jsr plot_pc
lda px
sub(r8)
tax // plot the second quadrant
lda py
add(r9)
tay
jsr plot_pc
lda px
sub(r9)
tax
lda py
add(r8)
tay
jsr plot_pc
lda px
add(r8)
tax // plot the third quadrant
lda py
sub(r9)
tay
jsr plot_pc
lda px
add(r9)
tax
lda py
sub(r8)
tay
jsr plot_pc
lda px
sub(r8)
tax // plot the fourth quadrant
lda py
sub(r9)
tay
jsr plot_pc
lda px
sub(r9)
tax
lda py
sub(r8)
tay
jsr plot_pc
//
// the incremental circle algorithm
//
lda r3 // check for delta < 0
bpl skip_2
addm16(r2, r4) // delta += d1
jmp skip_3
skip_2:
addm16(r2, r6) // delta += d2
addi16(r6, 2) // d2 += 2
dec r9 // y -= 1
skip_3:
addi16(r6, 2) // d2 += 2
addi16(r4, 2) // d1 += 2
inc r8 // x += 1
jmp loop
}
// draw a line between (x1,y1) and (x2,y2)
// x: x1
// y: y1
// a: colour
// px: x2
// py: y2
// uses:
// r0, r1: w and h of line
// r2, r3: running parameters for bresenhams
// r4, r5: x and y directions
//
draw_line:
{
sta pc // store the pixel colour
txa // get x1 in a
ldx #$01 // x direction defaults to +1
sub(px) // subtract with x2
bcs skip_px // if carry then skip next bit
// neg // negate width to make it positive
eor #$ff
adc #$01
ldx #$ff // change x draw direction to -1
skip_px:
stx r4 // store x direction
sta r0 // store width
tya // get y1
ldy #$01 // y direction defauts to +1
sub(py) // subtract with y2
bcs skip_py // if positive then skip next bit
// neg // negate height to make it positive
eor #$ff
adc #$01
ldy #$ff // change y draw direction to -1
skip_py:
sty r5 // store y direction
sta r1 // store height
cmp r0 // compare height with the width
bcc skip_q2 // if no carry, then skip to draw q2
//
// case #1: height >= width
//
sta r3 // r3 = height
lsr // r2 = height / 2
sta r2
loop_q1:
ldx px // plot the point
ldy py
jsr plot_pc
lda r2 // the brezenham's calculation
sub(r0)
sta r2
bcs skip_q1m
adc r1
sta r2
lda r4
add(px)
sta px
skip_q1m:
lda r5
add(py)
sta py
dec r3
bne loop_q1
ldx px
ldy py
jmp plot_pc
//
// case #2: height < width
//
skip_q2:
lda r0
sta r3 // r3 = width
lsr
sta r2 // r2 = width / 2
loop_q2:
ldx px // plot the point
ldy py
jsr plot_pc
lda r2 // the brezenham's calculation
sub(r1)
sta r2
bcs skip_q2m
adc r0
sta r2
lda r5
add(py)
sta py
skip_q2m:
lda r4
add(px)
sta px
dec r3
bne loop_q2
ldx px
ldy py
jmp plot_pc // plot the final point
} | 19.465035 | 76 | 0.54392 |
0f6eb2716d76d39d5eed296f6e7cae2348774501 | 431 | asm | Assembly | programs/oeis/114/A114458.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/114/A114458.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/114/A114458.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A114458: Integer part of sqrt(n)+sqrt(n+1)+sqrt(n+2).
; 4,5,5,6,7,7,8,8,9,9,10,10,11,11,11,12,12,13,13,13,14,14,14,14,15,15,15,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,20,21,21,21,21,22,22,22,22,22,23,23,23,23,23,23,24,24,24,24,24,25,25,25,25,25
mov $2,$0
mov $3,2
mov $4,9
mul $4,$0
add $4,1
lpb $2
mov $1,7
lpb $4
add $1,$3
trn $2,10
trn $4,$1
lpe
lpe
trn $1,9
div $1,2
add $1,4
mov $0,$1
| 20.52381 | 210 | 0.587007 |
8144c6b069f1c217596cb7d1f0874651c37c0dba | 574 | asm | Assembly | libsrc/osca/rename_file_callee.asm | Toysoft/z88dk | f930bef9ac4feeec91a07303b79ddd9071131a24 | [
"ClArtistic"
] | null | null | null | libsrc/osca/rename_file_callee.asm | Toysoft/z88dk | f930bef9ac4feeec91a07303b79ddd9071131a24 | [
"ClArtistic"
] | null | null | null | libsrc/osca/rename_file_callee.asm | Toysoft/z88dk | f930bef9ac4feeec91a07303b79ddd9071131a24 | [
"ClArtistic"
] | 1 | 2019-12-03T23:28:20.000Z | 2019-12-03T23:28:20.000Z | ;
; Old School Computer Architecture - interfacing FLOS
; Stefano Bodrato, 2011
;
; Like 'rename' but with a FLOS style error handling
;
; $Id: rename_file_callee.asm,v 1.4 2016-06-22 22:13:09 dom Exp $
;
INCLUDE "target/osca/def/flos.def"
SECTION code_clib
PUBLIC rename_file_callee
PUBLIC _rename_file_callee
EXTERN flos_err
PUBLIC ASMDISP_RENAME_FILE_CALLEE
rename_file_callee:
_rename_file_callee:
pop bc
pop de
pop hl
push bc
asmentry:
call kjt_rename_file
jp flos_err
DEFC ASMDISP_RENAME_FILE_CALLEE = # asmentry - rename_file_callee
| 19.133333 | 65 | 0.761324 |
5f59fde6ae8f485c6fb27fc42b74c1d96f6063f7 | 480 | asm | Assembly | programs/oeis/092/A092515.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/092/A092515.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/092/A092515.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A092515: Decimal expansion of e^(1/6).
; 1,1,8,1,3,6,0,4,1,2,8,6,5,6,4,5,9,8,0,3,0,5,1,1,2,1,5,2,5,0,7,1,8,4,3,2,7,8,3,0,1,8,9,3,1,0,8,3,8,9,6,3,7,9,7,8,5,6,1,9,4,2,8,0,2,2,6,4,5,5,2,8,5,5,9,2,2,9,7,4,5,6,6,2,3,6,6,9,7,3,8,5,0,4,4,2,7,6,3,1
mov $2,1
mov $3,$0
mul $3,5
lpb $3
div $1,6
mul $2,$3
add $1,$2
cmp $4,0
mov $5,$0
div $5,3
add $5,$4
div $1,$5
div $2,$5
sub $3,1
cmp $4,0
lpe
mov $6,10
pow $6,$0
div $2,$6
div $1,$2
add $1,$6
mod $1,10
mov $0,$1
| 17.777778 | 201 | 0.504167 |
e8a2cd57a9a8dc5f676f098834c6a675d7cc28e4 | 45,448 | asm | Assembly | P6/P6Judger - 100 testpoints/testpoint/testpoint73.asm | flyinglandlord/BUAA-CO-2021 | 1aa28b09762dfb2376ed2aac4126839f0e6fcf93 | [
"MIT"
] | 5 | 2021-12-05T12:58:26.000Z | 2022-03-31T02:05:13.000Z | P6/P6Judger - 100 testpoints/testpoint/testpoint73.asm | OliverDu8-24/BUAA-CO-2021 | 9959abd90de9039d751bab64f153547e76066665 | [
"MIT"
] | null | null | null | P6/P6Judger - 100 testpoints/testpoint/testpoint73.asm | OliverDu8-24/BUAA-CO-2021 | 9959abd90de9039d751bab64f153547e76066665 | [
"MIT"
] | 2 | 2021-12-19T11:49:48.000Z | 2021-12-22T10:25:38.000Z | ori $1, $0, 14
ori $2, $0, 12
ori $3, $0, 7
ori $4, $0, 6
sw $2, 0($0)
sw $3, 4($0)
sw $2, 8($0)
sw $4, 12($0)
sw $2, 16($0)
sw $3, 20($0)
sw $4, 24($0)
sw $3, 28($0)
sw $4, 32($0)
sw $3, 36($0)
sw $2, 40($0)
sw $4, 44($0)
sw $4, 48($0)
sw $4, 52($0)
sw $1, 56($0)
sw $3, 60($0)
sw $4, 64($0)
sw $4, 68($0)
sw $3, 72($0)
sw $1, 76($0)
sw $3, 80($0)
sw $2, 84($0)
sw $1, 88($0)
sw $3, 92($0)
sw $4, 96($0)
sw $1, 100($0)
sw $3, 104($0)
sw $2, 108($0)
sw $4, 112($0)
sw $1, 116($0)
sw $1, 120($0)
sw $4, 124($0)
sh $2, 0($2)
mtlo $2
lui $4, 1
sh $2, 0($2)
TAG1:
sll $0, $0, 0
sb $4, 0($3)
mtlo $3
mult $4, $4
TAG2:
mtlo $3
blez $3, TAG3
lb $2, 0($3)
beq $2, $2, TAG3
TAG3:
mtlo $2
mflo $3
lbu $2, 0($2)
sllv $3, $2, $2
TAG4:
sll $0, $0, 0
mult $3, $3
mfhi $3
mthi $3
TAG5:
bne $3, $3, TAG6
lhu $2, 0($3)
mult $3, $2
sw $2, 0($2)
TAG6:
lbu $3, 0($2)
mfhi $4
lui $3, 1
mflo $1
TAG7:
mult $1, $1
multu $1, $1
lui $4, 3
lui $4, 8
TAG8:
sll $0, $0, 0
mthi $4
srl $1, $3, 11
ori $1, $1, 5
TAG9:
sb $1, 0($1)
lui $4, 8
div $4, $1
subu $4, $1, $4
TAG10:
nor $2, $4, $4
sll $0, $0, 0
sll $0, $0, 0
mtlo $3
TAG11:
srl $2, $3, 14
mthi $3
andi $2, $3, 12
bne $2, $2, TAG12
TAG12:
sb $2, 0($2)
lb $3, 0($2)
bne $3, $3, TAG13
multu $2, $3
TAG13:
mflo $3
bne $3, $3, TAG14
or $1, $3, $3
addiu $2, $1, 11
TAG14:
sb $2, 0($2)
lui $3, 6
sra $4, $2, 4
divu $4, $2
TAG15:
lui $1, 9
bgtz $1, TAG16
slt $4, $1, $1
divu $1, $4
TAG16:
srav $2, $4, $4
addiu $4, $2, 15
lui $3, 6
mtlo $2
TAG17:
lui $3, 12
mthi $3
bne $3, $3, TAG18
sll $0, $0, 0
TAG18:
sb $4, 0($4)
divu $4, $4
mflo $3
mthi $4
TAG19:
lbu $2, 0($3)
srl $4, $2, 9
sw $2, 0($2)
mult $2, $2
TAG20:
bltz $4, TAG21
lui $3, 14
sll $4, $4, 2
mtlo $4
TAG21:
bgtz $4, TAG22
sh $4, 0($4)
sb $4, 0($4)
multu $4, $4
TAG22:
and $3, $4, $4
mult $3, $3
sub $2, $4, $3
mflo $2
TAG23:
lui $3, 12
mflo $4
mtlo $3
div $2, $3
TAG24:
beq $4, $4, TAG25
subu $2, $4, $4
subu $3, $4, $2
div $3, $2
TAG25:
mflo $4
beq $4, $4, TAG26
srav $2, $4, $3
bne $4, $2, TAG26
TAG26:
lui $2, 15
lui $3, 9
sll $0, $0, 0
div $4, $3
TAG27:
mflo $3
mult $3, $3
bne $3, $4, TAG28
mfhi $2
TAG28:
blez $2, TAG29
mthi $2
bltz $2, TAG29
lui $1, 10
TAG29:
lui $3, 1
mthi $1
mthi $3
beq $1, $1, TAG30
TAG30:
mfhi $3
lui $1, 1
blez $1, TAG31
lui $1, 1
TAG31:
srlv $2, $1, $1
sltu $2, $1, $1
addu $3, $2, $2
mfhi $1
TAG32:
multu $1, $1
sll $0, $0, 0
srav $4, $2, $2
sh $4, 0($4)
TAG33:
bltz $4, TAG34
slti $3, $4, 3
sb $4, 0($3)
add $4, $4, $4
TAG34:
bltz $4, TAG35
sw $4, 0($4)
lui $4, 14
sll $0, $0, 0
TAG35:
srav $4, $4, $4
sll $0, $0, 0
div $4, $4
mflo $4
TAG36:
lb $1, 0($4)
mflo $4
bltz $1, TAG37
xor $1, $4, $4
TAG37:
lh $4, 0($1)
sh $4, 0($4)
subu $2, $4, $4
mthi $1
TAG38:
ori $4, $2, 7
lbu $4, 0($4)
lui $2, 9
addiu $3, $2, 0
TAG39:
mfhi $1
addi $2, $1, 10
mtlo $2
bltz $2, TAG40
TAG40:
lbu $1, 0($2)
lui $4, 1
lui $4, 15
div $4, $2
TAG41:
sllv $1, $4, $4
xori $3, $4, 11
lui $3, 11
subu $1, $4, $3
TAG42:
sra $2, $1, 3
sll $0, $0, 0
mfhi $2
multu $2, $2
TAG43:
lui $4, 12
sll $0, $0, 0
slt $1, $4, $4
sll $0, $0, 0
TAG44:
lui $2, 4
beq $2, $2, TAG45
lh $2, 0($1)
bne $2, $1, TAG45
TAG45:
sb $2, 0($2)
mtlo $2
bgez $2, TAG46
mthi $2
TAG46:
multu $2, $2
mthi $2
mtlo $2
sw $2, 0($2)
TAG47:
multu $2, $2
mtlo $2
lb $4, 0($2)
sw $4, 0($2)
TAG48:
xor $4, $4, $4
lhu $3, 0($4)
bne $3, $4, TAG49
lui $3, 9
TAG49:
divu $3, $3
div $3, $3
bne $3, $3, TAG50
sll $2, $3, 11
TAG50:
lui $2, 3
mfhi $3
bgez $3, TAG51
sll $2, $2, 5
TAG51:
beq $2, $2, TAG52
multu $2, $2
mflo $3
lui $1, 10
TAG52:
slt $1, $1, $1
sub $3, $1, $1
addi $3, $3, 9
lui $4, 8
TAG53:
or $1, $4, $4
bne $1, $1, TAG54
sll $0, $0, 0
div $4, $1
TAG54:
sra $2, $1, 12
sll $0, $0, 0
bne $1, $1, TAG55
mtlo $1
TAG55:
lui $4, 15
ori $3, $2, 3
mthi $3
slti $3, $2, 2
TAG56:
mfhi $1
mfhi $3
beq $1, $3, TAG57
addu $2, $3, $3
TAG57:
sra $3, $2, 8
divu $3, $2
div $2, $3
subu $2, $3, $2
TAG58:
sw $2, 261($2)
blez $2, TAG59
mtlo $2
lui $2, 9
TAG59:
subu $1, $2, $2
subu $1, $2, $2
lw $4, 261($2)
bltz $1, TAG60
TAG60:
sb $4, 261($4)
blez $4, TAG61
mthi $4
mthi $4
TAG61:
sh $4, 261($4)
sll $4, $4, 1
mthi $4
mtlo $4
TAG62:
lui $4, 15
mult $4, $4
andi $2, $4, 14
sll $0, $0, 0
TAG63:
mtlo $3
bgez $3, TAG64
srlv $2, $3, $3
bgez $2, TAG64
TAG64:
andi $3, $2, 10
multu $2, $3
lhu $4, 0($3)
sll $0, $0, 0
TAG65:
bne $4, $4, TAG66
divu $4, $4
mult $4, $4
xor $4, $4, $4
TAG66:
blez $4, TAG67
mult $4, $4
mflo $4
sh $4, 0($4)
TAG67:
mthi $4
beq $4, $4, TAG68
mflo $1
mthi $1
TAG68:
bgez $1, TAG69
mflo $4
mult $1, $1
multu $4, $4
TAG69:
sltiu $4, $4, 12
div $4, $4
nor $2, $4, $4
sb $4, 2($2)
TAG70:
subu $2, $2, $2
lui $4, 3
mtlo $4
mfhi $2
TAG71:
blez $2, TAG72
subu $3, $2, $2
andi $2, $2, 1
add $1, $2, $2
TAG72:
lw $2, 0($1)
mflo $1
beq $1, $1, TAG73
mult $1, $2
TAG73:
lui $3, 15
sltiu $2, $3, 8
mthi $3
lui $3, 7
TAG74:
srl $4, $3, 1
div $3, $4
beq $4, $3, TAG75
mflo $1
TAG75:
mfhi $2
bne $2, $1, TAG76
sltu $1, $1, $2
lb $1, 0($1)
TAG76:
bne $1, $1, TAG77
lhu $1, 0($1)
blez $1, TAG77
mflo $1
TAG77:
bgtz $1, TAG78
div $1, $1
beq $1, $1, TAG78
mfhi $2
TAG78:
addi $2, $2, 15
lui $2, 4
mtlo $2
mfhi $4
TAG79:
beq $4, $4, TAG80
mfhi $1
addi $1, $1, 1
lbu $1, 0($1)
TAG80:
bgez $1, TAG81
mfhi $3
bltz $3, TAG81
mflo $4
TAG81:
sb $4, 0($4)
mthi $4
srlv $1, $4, $4
or $3, $1, $4
TAG82:
blez $3, TAG83
sll $4, $3, 15
lui $1, 6
sw $4, 0($4)
TAG83:
bne $1, $1, TAG84
lui $1, 13
mult $1, $1
sll $0, $0, 0
TAG84:
mult $1, $1
sll $0, $0, 0
bgez $3, TAG85
sll $0, $0, 0
TAG85:
lui $1, 4
sltiu $4, $1, 4
sub $4, $1, $4
lhu $2, 0($3)
TAG86:
bne $2, $2, TAG87
divu $2, $2
bne $2, $2, TAG87
sll $0, $0, 0
TAG87:
mthi $2
lui $3, 15
xor $3, $2, $3
divu $3, $3
TAG88:
addiu $3, $3, 3
mflo $4
addu $3, $3, $4
blez $3, TAG89
TAG89:
div $3, $3
beq $3, $3, TAG90
or $3, $3, $3
mtlo $3
TAG90:
mthi $3
bne $3, $3, TAG91
lui $4, 6
nor $1, $3, $4
TAG91:
sll $0, $0, 0
mult $2, $1
sll $0, $0, 0
srlv $2, $1, $2
TAG92:
subu $1, $2, $2
mfhi $2
lui $1, 11
sll $0, $0, 0
TAG93:
sll $0, $0, 0
bgez $1, TAG94
sll $0, $0, 0
lh $3, 0($1)
TAG94:
mflo $3
slti $2, $3, 5
sllv $1, $2, $3
sllv $1, $2, $2
TAG95:
mfhi $2
lw $1, 0($1)
mfhi $2
bne $1, $2, TAG96
TAG96:
mult $2, $2
multu $2, $2
sltiu $3, $2, 14
bne $3, $2, TAG97
TAG97:
lui $3, 10
lui $3, 12
slti $4, $3, 14
sllv $1, $4, $3
TAG98:
mflo $3
mtlo $3
sw $1, 0($1)
mflo $1
TAG99:
mtlo $1
multu $1, $1
bltz $1, TAG100
mfhi $3
TAG100:
sw $3, 0($3)
sb $3, 0($3)
addiu $2, $3, 10
bltz $2, TAG101
TAG101:
mtlo $2
sllv $4, $2, $2
sh $4, -10240($4)
subu $3, $4, $4
TAG102:
subu $1, $3, $3
mult $1, $1
bgez $1, TAG103
lui $1, 5
TAG103:
mfhi $2
subu $3, $2, $1
mtlo $3
sll $0, $0, 0
TAG104:
bgez $2, TAG105
lui $1, 4
addiu $2, $2, 12
addi $3, $2, 10
TAG105:
sll $0, $0, 0
bgtz $3, TAG106
sll $0, $0, 0
lui $3, 13
TAG106:
lui $4, 7
sra $1, $3, 2
beq $1, $1, TAG107
mthi $1
TAG107:
mfhi $4
ori $3, $4, 6
sll $0, $0, 0
lui $3, 5
TAG108:
sll $0, $0, 0
sll $0, $0, 0
bne $4, $4, TAG109
mult $4, $3
TAG109:
bne $4, $4, TAG110
nor $2, $4, $4
mfhi $4
bne $4, $4, TAG110
TAG110:
lui $3, 13
sh $4, 0($4)
slt $3, $4, $4
lhu $3, 0($3)
TAG111:
div $3, $3
blez $3, TAG112
sltu $4, $3, $3
mult $4, $4
TAG112:
lh $1, 0($4)
bgez $4, TAG113
divu $4, $1
sltiu $4, $1, 8
TAG113:
lui $3, 11
bne $4, $3, TAG114
or $3, $3, $3
mthi $3
TAG114:
mfhi $2
mtlo $3
mtlo $2
srl $4, $3, 5
TAG115:
beq $4, $4, TAG116
lui $1, 1
sw $4, 0($4)
bne $1, $4, TAG116
TAG116:
mthi $1
sll $0, $0, 0
bne $1, $1, TAG117
lui $1, 7
TAG117:
srlv $4, $1, $1
sll $0, $0, 0
addu $2, $4, $4
lui $3, 13
TAG118:
srlv $4, $3, $3
blez $3, TAG119
lui $4, 5
sll $0, $0, 0
TAG119:
mthi $4
sra $3, $4, 13
mthi $4
divu $3, $4
TAG120:
lbu $1, 0($3)
srav $4, $1, $3
mtlo $3
lui $3, 5
TAG121:
divu $3, $3
bltz $3, TAG122
ori $1, $3, 1
sll $0, $0, 0
TAG122:
mflo $2
mthi $2
bne $2, $2, TAG123
srav $4, $2, $1
TAG123:
sra $1, $4, 14
mfhi $4
lui $3, 14
lui $2, 12
TAG124:
lui $4, 0
lui $4, 5
bne $4, $4, TAG125
sll $0, $0, 0
TAG125:
addiu $4, $2, 10
mfhi $1
bne $1, $1, TAG126
mflo $1
TAG126:
sb $1, 0($1)
bgtz $1, TAG127
sb $1, 0($1)
mfhi $4
TAG127:
sll $0, $0, 0
bne $3, $4, TAG128
sllv $2, $4, $4
mflo $1
TAG128:
sb $1, 0($1)
sb $1, 0($1)
mflo $4
lb $4, 0($4)
TAG129:
slti $3, $4, 1
bgtz $4, TAG130
srav $1, $4, $3
ori $4, $4, 2
TAG130:
xor $2, $4, $4
bltz $4, TAG131
add $1, $2, $2
sb $2, 0($4)
TAG131:
andi $4, $1, 11
mthi $1
mthi $4
mthi $1
TAG132:
sb $4, 0($4)
sb $4, 0($4)
bne $4, $4, TAG133
lui $2, 11
TAG133:
bgtz $2, TAG134
lui $2, 2
blez $2, TAG134
mthi $2
TAG134:
mflo $3
lbu $1, 0($3)
mfhi $2
sb $1, 0($2)
TAG135:
bgez $2, TAG136
sh $2, 0($2)
div $2, $2
bgtz $2, TAG136
TAG136:
mtlo $2
lui $2, 4
bne $2, $2, TAG137
sll $4, $2, 8
TAG137:
xor $4, $4, $4
mult $4, $4
mfhi $2
sw $2, 0($2)
TAG138:
beq $2, $2, TAG139
sb $2, 0($2)
addiu $2, $2, 7
lh $1, 0($2)
TAG139:
bgtz $1, TAG140
mflo $1
or $2, $1, $1
sb $2, 0($2)
TAG140:
bgtz $2, TAG141
sb $2, 0($2)
sw $2, 0($2)
sltu $4, $2, $2
TAG141:
multu $4, $4
bne $4, $4, TAG142
lui $4, 7
ori $2, $4, 12
TAG142:
mtlo $2
slti $2, $2, 10
lhu $2, 0($2)
mtlo $2
TAG143:
lui $1, 7
lb $1, 0($2)
lui $4, 2
lh $4, 0($2)
TAG144:
lbu $1, 0($4)
mfhi $3
sw $4, 0($3)
bne $3, $1, TAG145
TAG145:
slt $4, $3, $3
bltz $3, TAG146
mthi $4
blez $4, TAG146
TAG146:
multu $4, $4
blez $4, TAG147
and $1, $4, $4
multu $4, $1
TAG147:
lui $4, 4
lui $4, 3
sltu $1, $4, $4
bltz $1, TAG148
TAG148:
lbu $4, 0($1)
bgez $1, TAG149
addi $2, $4, 11
div $1, $2
TAG149:
xori $3, $2, 2
beq $3, $3, TAG150
div $3, $2
mthi $3
TAG150:
xor $2, $3, $3
mtlo $3
mtlo $2
andi $2, $3, 1
TAG151:
bne $2, $2, TAG152
sb $2, 0($2)
mflo $4
mthi $2
TAG152:
mult $4, $4
bgez $4, TAG153
multu $4, $4
div $4, $4
TAG153:
lui $4, 4
lui $2, 2
blez $4, TAG154
sll $0, $0, 0
TAG154:
multu $2, $2
div $2, $2
and $1, $2, $2
lui $4, 11
TAG155:
sll $0, $0, 0
bgez $4, TAG156
mflo $3
blez $4, TAG156
TAG156:
lb $2, 0($3)
srl $4, $3, 5
sb $3, 0($3)
sltu $3, $4, $2
TAG157:
lb $2, 0($3)
mfhi $3
beq $3, $3, TAG158
srl $2, $3, 4
TAG158:
sltu $3, $2, $2
sw $3, 0($3)
bltz $3, TAG159
xor $4, $2, $3
TAG159:
beq $4, $4, TAG160
srl $1, $4, 6
ori $2, $1, 15
sb $1, 0($2)
TAG160:
sb $2, 0($2)
lhu $4, 0($2)
beq $4, $4, TAG161
lui $4, 6
TAG161:
sltiu $4, $4, 7
multu $4, $4
lbu $1, 0($4)
multu $4, $4
TAG162:
slti $2, $1, 8
sh $1, 0($1)
beq $2, $1, TAG163
mthi $2
TAG163:
bne $2, $2, TAG164
srav $4, $2, $2
div $2, $2
srlv $2, $4, $4
TAG164:
sb $2, 0($2)
lhu $4, 0($2)
mtlo $2
sllv $4, $4, $4
TAG165:
multu $4, $4
mthi $4
srl $3, $4, 10
lb $1, 0($4)
TAG166:
srl $1, $1, 4
lh $3, 0($1)
mfhi $1
multu $1, $1
TAG167:
subu $3, $1, $1
lui $3, 15
div $3, $3
sll $0, $0, 0
TAG168:
mthi $3
mflo $3
addu $4, $3, $3
sb $3, 0($3)
TAG169:
addu $2, $4, $4
sh $2, 0($4)
mfhi $3
bltz $2, TAG170
TAG170:
sltiu $3, $3, 6
lui $3, 14
sll $0, $0, 0
srlv $1, $3, $3
TAG171:
blez $1, TAG172
sll $0, $0, 0
lui $2, 0
beq $2, $2, TAG172
TAG172:
sra $4, $2, 3
addiu $4, $4, 5
lb $2, 0($4)
lui $1, 12
TAG173:
bgtz $1, TAG174
mflo $4
div $1, $1
bne $4, $4, TAG174
TAG174:
sll $2, $4, 15
addu $4, $4, $4
sllv $1, $4, $4
bgez $4, TAG175
TAG175:
sw $1, 0($1)
subu $1, $1, $1
lui $3, 11
sub $2, $1, $1
TAG176:
srav $3, $2, $2
subu $2, $3, $3
blez $3, TAG177
lhu $4, 0($2)
TAG177:
beq $4, $4, TAG178
slti $3, $4, 8
lui $2, 0
mflo $3
TAG178:
ori $3, $3, 10
mthi $3
mthi $3
mflo $3
TAG179:
bne $3, $3, TAG180
or $4, $3, $3
sb $4, 0($3)
bne $3, $3, TAG180
TAG180:
subu $3, $4, $4
lh $3, 0($3)
mult $4, $3
and $4, $3, $4
TAG181:
xori $4, $4, 8
blez $4, TAG182
lbu $3, 0($4)
beq $4, $3, TAG182
TAG182:
lhu $1, 0($3)
subu $3, $1, $1
mflo $3
mtlo $3
TAG183:
subu $3, $3, $3
beq $3, $3, TAG184
mthi $3
ori $3, $3, 11
TAG184:
mfhi $2
lh $2, 0($3)
mult $2, $3
mflo $2
TAG185:
srlv $4, $2, $2
mflo $3
bne $4, $3, TAG186
srl $1, $4, 5
TAG186:
lbu $4, 0($1)
mtlo $1
beq $4, $1, TAG187
and $4, $1, $1
TAG187:
blez $4, TAG188
mflo $1
beq $1, $4, TAG188
multu $1, $4
TAG188:
lbu $4, 0($1)
beq $4, $1, TAG189
nor $3, $4, $1
beq $4, $4, TAG189
TAG189:
srl $3, $3, 0
lui $3, 15
bgtz $3, TAG190
mthi $3
TAG190:
bltz $3, TAG191
srav $2, $3, $3
sll $0, $0, 0
sll $0, $0, 0
TAG191:
mtlo $2
sll $3, $2, 2
xori $1, $2, 7
srlv $2, $3, $1
TAG192:
addu $4, $2, $2
mtlo $4
lui $2, 14
mtlo $4
TAG193:
lui $3, 3
subu $2, $2, $2
mthi $2
and $3, $3, $2
TAG194:
mflo $4
multu $3, $4
mult $3, $4
multu $3, $4
TAG195:
sll $0, $0, 0
divu $4, $4
lui $3, 2
bltz $3, TAG196
TAG196:
lui $1, 15
bne $3, $3, TAG197
mflo $2
lbu $2, 0($2)
TAG197:
bgtz $2, TAG198
ori $3, $2, 1
bne $2, $3, TAG198
mult $2, $2
TAG198:
sb $3, 0($3)
sll $1, $3, 1
mtlo $3
mthi $1
TAG199:
multu $1, $1
addiu $1, $1, 9
lui $4, 14
blez $4, TAG200
TAG200:
subu $1, $4, $4
sll $0, $0, 0
srlv $2, $4, $1
divu $3, $3
TAG201:
sll $0, $0, 0
beq $2, $2, TAG202
sll $0, $0, 0
lui $1, 9
TAG202:
lh $3, 0($1)
mult $3, $1
mflo $3
blez $3, TAG203
TAG203:
multu $3, $3
mult $3, $3
lui $4, 10
mfhi $2
TAG204:
sub $1, $2, $2
lui $3, 11
lui $2, 9
sll $0, $0, 0
TAG205:
sll $0, $0, 0
addu $2, $2, $2
beq $2, $2, TAG206
sll $0, $0, 0
TAG206:
beq $1, $1, TAG207
ori $2, $1, 13
sw $2, 0($1)
bgez $2, TAG207
TAG207:
mthi $2
div $2, $2
beq $2, $2, TAG208
multu $2, $2
TAG208:
sb $2, 0($2)
lb $3, 0($2)
addu $3, $3, $3
lui $3, 5
TAG209:
bne $3, $3, TAG210
mtlo $3
sll $0, $0, 0
ori $1, $3, 5
TAG210:
sll $0, $0, 0
beq $1, $1, TAG211
sllv $2, $1, $1
lw $3, 0($1)
TAG211:
mfhi $3
mthi $3
mflo $4
beq $3, $3, TAG212
TAG212:
subu $1, $4, $4
beq $4, $1, TAG213
lui $1, 6
andi $4, $1, 6
TAG213:
slt $4, $4, $4
sra $4, $4, 1
slti $3, $4, 12
multu $4, $4
TAG214:
addu $3, $3, $3
div $3, $3
mflo $2
bgtz $2, TAG215
TAG215:
sb $2, 0($2)
slti $3, $2, 11
divu $3, $2
bgtz $2, TAG216
TAG216:
mflo $3
nor $4, $3, $3
mflo $3
multu $3, $3
TAG217:
lui $3, 11
sll $0, $0, 0
sll $0, $0, 0
multu $3, $3
TAG218:
sll $0, $0, 0
lui $1, 7
mult $2, $3
divu $1, $3
TAG219:
lui $4, 13
sll $0, $0, 0
mthi $1
sll $0, $0, 0
TAG220:
lui $1, 4
subu $2, $4, $4
beq $2, $4, TAG221
lui $4, 2
TAG221:
bgtz $4, TAG222
sll $0, $0, 0
beq $4, $4, TAG222
sw $4, 0($4)
TAG222:
slti $1, $4, 15
lw $4, 0($1)
bne $4, $4, TAG223
divu $4, $4
TAG223:
beq $4, $4, TAG224
lui $4, 13
addiu $4, $4, 3
lw $3, 0($4)
TAG224:
bgez $3, TAG225
mfhi $1
lui $1, 4
bgez $3, TAG225
TAG225:
lhu $3, 0($1)
bltz $1, TAG226
sh $1, 0($1)
beq $1, $1, TAG226
TAG226:
lui $4, 15
mthi $3
mthi $3
or $2, $4, $4
TAG227:
multu $2, $2
beq $2, $2, TAG228
sltu $4, $2, $2
bgtz $4, TAG228
TAG228:
mfhi $1
bltz $1, TAG229
ori $2, $4, 3
div $4, $2
TAG229:
lbu $1, 0($2)
bgez $2, TAG230
mfhi $2
mflo $1
TAG230:
bgtz $1, TAG231
addiu $4, $1, 2
sllv $1, $1, $4
mfhi $4
TAG231:
bne $4, $4, TAG232
andi $4, $4, 2
mult $4, $4
xor $4, $4, $4
TAG232:
lui $1, 4
beq $4, $1, TAG233
lui $1, 11
sltu $4, $4, $4
TAG233:
mfhi $3
lui $2, 4
lui $2, 5
sll $0, $0, 0
TAG234:
mflo $3
bgez $2, TAG235
sub $4, $3, $3
blez $3, TAG235
TAG235:
srlv $1, $4, $4
sw $4, 0($1)
lbu $2, 0($1)
mult $2, $4
TAG236:
slti $3, $2, 8
lui $1, 7
lui $4, 11
mthi $2
TAG237:
divu $4, $4
addiu $4, $4, 9
mtlo $4
multu $4, $4
TAG238:
mflo $2
mthi $2
addu $4, $2, $2
mflo $3
TAG239:
lui $3, 11
beq $3, $3, TAG240
mult $3, $3
srav $2, $3, $3
TAG240:
mfhi $3
addiu $4, $3, 12
mfhi $1
or $4, $1, $4
TAG241:
mthi $4
bne $4, $4, TAG242
mthi $4
sw $4, -253($4)
TAG242:
divu $4, $4
mflo $1
sb $1, 0($1)
lb $4, -253($4)
TAG243:
mthi $4
sll $4, $4, 7
multu $4, $4
xori $1, $4, 5
TAG244:
beq $1, $1, TAG245
mult $1, $1
add $1, $1, $1
lui $4, 4
TAG245:
beq $4, $4, TAG246
mthi $4
mflo $2
sh $4, 0($4)
TAG246:
beq $2, $2, TAG247
sll $0, $0, 0
lh $1, 0($2)
lhu $2, 0($2)
TAG247:
divu $2, $2
bgez $2, TAG248
mfhi $3
bne $3, $2, TAG248
TAG248:
mflo $2
blez $2, TAG249
multu $3, $3
lhu $2, 0($3)
TAG249:
srlv $3, $2, $2
sltu $1, $3, $2
sltiu $1, $3, 7
div $1, $2
TAG250:
lui $3, 6
bne $1, $1, TAG251
mflo $1
lui $1, 3
TAG251:
ori $3, $1, 5
sll $0, $0, 0
blez $3, TAG252
sll $0, $0, 0
TAG252:
srl $4, $3, 1
sltu $2, $3, $3
sh $3, 0($2)
sll $0, $0, 0
TAG253:
sub $3, $2, $2
lh $1, 0($3)
mult $2, $2
sltiu $1, $3, 9
TAG254:
mtlo $1
mthi $1
div $1, $1
beq $1, $1, TAG255
TAG255:
divu $1, $1
srl $1, $1, 14
mtlo $1
lui $1, 14
TAG256:
lui $3, 4
lui $3, 6
lui $3, 1
addu $4, $3, $3
TAG257:
sra $4, $4, 12
bgez $4, TAG258
mult $4, $4
mflo $2
TAG258:
srav $4, $2, $2
addi $3, $4, 1
bgtz $4, TAG259
lh $1, 0($2)
TAG259:
lui $2, 10
bltz $2, TAG260
sll $0, $0, 0
mtlo $2
TAG260:
bgtz $2, TAG261
divu $2, $2
mult $2, $2
sw $2, 0($2)
TAG261:
mtlo $2
beq $2, $2, TAG262
sllv $3, $2, $2
sh $3, 0($2)
TAG262:
sll $0, $0, 0
lui $2, 12
beq $3, $3, TAG263
sll $0, $0, 0
TAG263:
slt $3, $2, $2
blez $3, TAG264
sllv $2, $2, $3
sltu $4, $3, $3
TAG264:
mult $4, $4
bgez $4, TAG265
sw $4, 0($4)
divu $4, $4
TAG265:
mult $4, $4
mtlo $4
ori $3, $4, 2
lhu $2, 0($3)
TAG266:
beq $2, $2, TAG267
lui $3, 4
lui $4, 9
lbu $1, 0($4)
TAG267:
addiu $1, $1, 4
lbu $3, 0($1)
srlv $2, $1, $1
bne $2, $1, TAG268
TAG268:
lh $4, 0($2)
lui $4, 11
sll $0, $0, 0
multu $4, $4
TAG269:
bne $4, $4, TAG270
lui $2, 7
mthi $2
mtlo $2
TAG270:
mult $2, $2
sll $0, $0, 0
lui $2, 15
beq $2, $2, TAG271
TAG271:
mthi $2
bne $2, $2, TAG272
sll $0, $0, 0
mflo $4
TAG272:
srlv $2, $4, $4
xor $2, $2, $2
lui $4, 8
sll $0, $0, 0
TAG273:
subu $1, $4, $4
subu $4, $4, $4
blez $4, TAG274
slti $2, $4, 5
TAG274:
and $3, $2, $2
mult $3, $2
bne $3, $3, TAG275
addu $1, $3, $2
TAG275:
mtlo $1
lui $4, 12
xori $1, $1, 3
mfhi $4
TAG276:
lui $2, 8
sltiu $4, $2, 15
lw $2, 0($4)
lh $3, 0($2)
TAG277:
lui $2, 14
mthi $3
mult $3, $2
nor $2, $3, $2
TAG278:
sll $0, $0, 0
sltu $4, $2, $4
srl $2, $4, 5
mtlo $4
TAG279:
srav $4, $2, $2
mult $2, $4
multu $2, $4
sltiu $2, $4, 7
TAG280:
sb $2, 0($2)
sb $2, 0($2)
mtlo $2
lbu $4, 0($2)
TAG281:
mthi $4
srav $3, $4, $4
bgez $3, TAG282
mfhi $1
TAG282:
sltiu $4, $1, 6
sb $1, 0($1)
ori $4, $4, 4
lui $4, 8
TAG283:
div $4, $4
subu $2, $4, $4
bne $2, $4, TAG284
lui $4, 15
TAG284:
bgtz $4, TAG285
sll $0, $0, 0
bgez $4, TAG285
lui $2, 5
TAG285:
sh $2, 0($2)
lui $1, 15
ori $2, $2, 3
mtlo $2
TAG286:
addu $4, $2, $2
lb $4, 0($4)
beq $2, $2, TAG287
mult $2, $2
TAG287:
blez $4, TAG288
srav $3, $4, $4
lhu $3, 0($3)
lh $4, 0($3)
TAG288:
mult $4, $4
bltz $4, TAG289
sltiu $2, $4, 2
addiu $2, $4, 0
TAG289:
sll $1, $2, 14
bgez $2, TAG290
ori $4, $1, 4
lui $4, 8
TAG290:
lh $3, 0($4)
or $4, $4, $3
mflo $4
sltu $4, $4, $4
TAG291:
lui $4, 13
lui $2, 4
mflo $4
mtlo $2
TAG292:
lui $2, 1
lui $3, 3
beq $3, $4, TAG293
slti $1, $3, 7
TAG293:
sh $1, 0($1)
lb $1, 0($1)
lhu $3, 0($1)
beq $3, $1, TAG294
TAG294:
andi $2, $3, 6
beq $3, $3, TAG295
lui $2, 1
mfhi $2
TAG295:
beq $2, $2, TAG296
lui $4, 7
xori $3, $2, 4
bgtz $4, TAG296
TAG296:
sw $3, 0($3)
lh $4, 0($3)
lbu $1, 0($4)
sb $4, 0($3)
TAG297:
mult $1, $1
mflo $1
xori $3, $1, 6
lbu $1, 0($1)
TAG298:
mult $1, $1
blez $1, TAG299
mtlo $1
xori $3, $1, 8
TAG299:
sra $2, $3, 2
ori $1, $3, 9
xori $4, $2, 9
bne $2, $4, TAG300
TAG300:
lhu $2, 0($4)
sra $2, $4, 5
mult $2, $2
bgtz $4, TAG301
TAG301:
lbu $3, 0($2)
lb $4, 0($3)
mfhi $3
multu $3, $4
TAG302:
slti $4, $3, 10
lui $4, 1
sll $4, $3, 13
lui $1, 2
TAG303:
sll $0, $0, 0
mthi $1
bne $1, $1, TAG304
mult $1, $1
TAG304:
sll $0, $0, 0
multu $4, $4
xori $4, $1, 6
beq $4, $4, TAG305
TAG305:
mflo $3
bne $3, $4, TAG306
sltu $3, $4, $4
and $4, $3, $3
TAG306:
sll $3, $4, 14
mtlo $3
bltz $3, TAG307
divu $3, $3
TAG307:
mfhi $4
mflo $4
sll $0, $0, 0
slt $4, $4, $4
TAG308:
mult $4, $4
sltiu $3, $4, 15
or $2, $3, $3
addi $1, $4, 8
TAG309:
xori $1, $1, 1
beq $1, $1, TAG310
and $3, $1, $1
lui $2, 5
TAG310:
blez $2, TAG311
sb $2, 0($2)
mfhi $1
blez $2, TAG311
TAG311:
mthi $1
blez $1, TAG312
mthi $1
beq $1, $1, TAG312
TAG312:
mthi $1
beq $1, $1, TAG313
slt $1, $1, $1
mflo $2
TAG313:
mtlo $2
lb $1, 0($2)
lb $1, 0($2)
divu $1, $1
TAG314:
div $1, $1
mfhi $2
slti $2, $2, 1
sltiu $4, $2, 3
TAG315:
mthi $4
lui $1, 10
bne $1, $1, TAG316
sll $0, $0, 0
TAG316:
lui $2, 1
mtlo $1
mtlo $2
div $2, $1
TAG317:
mtlo $2
sll $0, $0, 0
sll $0, $0, 0
sll $0, $0, 0
TAG318:
mthi $3
mult $3, $3
blez $3, TAG319
mfhi $4
TAG319:
lui $3, 13
lui $3, 14
sll $0, $0, 0
sb $3, 0($4)
TAG320:
sll $0, $0, 0
beq $3, $3, TAG321
addiu $3, $3, 15
mfhi $2
TAG321:
beq $2, $2, TAG322
mult $2, $2
bgez $2, TAG322
addi $1, $2, 13
TAG322:
mthi $1
lui $1, 5
lui $4, 0
sb $1, 0($4)
TAG323:
mthi $4
ori $3, $4, 14
mthi $4
lui $3, 2
TAG324:
divu $3, $3
mflo $3
mfhi $3
bgez $3, TAG325
TAG325:
mthi $3
andi $2, $3, 4
mtlo $3
lbu $4, 0($2)
TAG326:
mflo $3
bgtz $3, TAG327
lui $3, 6
and $2, $3, $4
TAG327:
beq $2, $2, TAG328
sh $2, 0($2)
addi $4, $2, 10
bgtz $2, TAG328
TAG328:
lh $4, 0($4)
sllv $3, $4, $4
mthi $3
sb $4, 0($3)
TAG329:
mflo $3
sh $3, 0($3)
multu $3, $3
blez $3, TAG330
TAG330:
multu $3, $3
bgtz $3, TAG331
sll $2, $3, 3
bltz $2, TAG331
TAG331:
lh $1, 0($2)
bgez $2, TAG332
mtlo $2
mult $2, $1
TAG332:
mfhi $3
mtlo $1
bne $3, $3, TAG333
xori $4, $1, 9
TAG333:
xori $4, $4, 6
lb $1, 0($4)
lui $1, 5
multu $1, $4
TAG334:
sll $0, $0, 0
sll $0, $0, 0
sll $0, $0, 0
div $1, $1
TAG335:
beq $1, $1, TAG336
sll $0, $0, 0
divu $1, $1
nor $4, $1, $1
TAG336:
multu $4, $4
lui $2, 14
div $2, $2
mthi $4
TAG337:
multu $2, $2
beq $2, $2, TAG338
and $1, $2, $2
lui $2, 5
TAG338:
mfhi $1
mfhi $3
sll $0, $0, 0
beq $3, $1, TAG339
TAG339:
sra $1, $4, 6
lhu $4, 0($1)
mflo $1
mthi $1
TAG340:
mthi $1
srav $2, $1, $1
and $2, $1, $1
sltiu $2, $2, 9
TAG341:
slt $2, $2, $2
sw $2, 0($2)
sw $2, 0($2)
lbu $3, 0($2)
TAG342:
mtlo $3
bltz $3, TAG343
lui $4, 4
addiu $1, $4, 4
TAG343:
lui $3, 9
mtlo $3
divu $1, $1
lui $2, 10
TAG344:
lui $4, 4
beq $4, $2, TAG345
sll $3, $2, 6
bgtz $4, TAG345
TAG345:
xor $3, $3, $3
lui $2, 6
bgez $3, TAG346
addi $3, $3, 11
TAG346:
lui $4, 1
sll $0, $0, 0
divu $4, $4
sll $0, $0, 0
TAG347:
mfhi $4
beq $1, $1, TAG348
mult $4, $4
sw $1, 0($4)
TAG348:
mflo $4
lw $1, 0($4)
lui $2, 10
sb $2, 0($4)
TAG349:
ori $1, $2, 7
or $1, $2, $1
mtlo $2
bgtz $2, TAG350
TAG350:
mthi $1
mthi $1
beq $1, $1, TAG351
mtlo $1
TAG351:
mflo $2
addu $4, $2, $2
mtlo $1
sll $0, $0, 0
TAG352:
mtlo $4
sll $0, $0, 0
sll $0, $0, 0
mflo $1
TAG353:
ori $4, $1, 13
sll $0, $0, 0
beq $4, $1, TAG354
lui $4, 3
TAG354:
mthi $4
blez $4, TAG355
sll $0, $0, 0
sll $3, $4, 14
TAG355:
multu $3, $3
addu $1, $3, $3
addiu $4, $3, 13
bne $1, $3, TAG356
TAG356:
ori $1, $4, 9
addiu $3, $4, 11
mthi $1
sll $0, $0, 0
TAG357:
div $4, $4
sll $0, $0, 0
addiu $4, $4, 10
mflo $3
TAG358:
lb $2, 0($3)
mult $3, $2
lui $3, 9
mfhi $4
TAG359:
lui $1, 11
lui $1, 7
mflo $3
mfhi $1
TAG360:
sh $1, 0($1)
nor $3, $1, $1
bltz $1, TAG361
lh $4, 1($3)
TAG361:
mthi $4
lui $4, 8
bne $4, $4, TAG362
subu $1, $4, $4
TAG362:
sw $1, 0($1)
lui $1, 1
srl $1, $1, 1
blez $1, TAG363
TAG363:
ori $2, $1, 4
beq $1, $2, TAG364
sll $0, $0, 0
lbu $2, 1($3)
TAG364:
and $3, $2, $2
lui $3, 0
lui $4, 13
mflo $4
TAG365:
bgtz $4, TAG366
mflo $1
sh $4, 0($4)
multu $1, $4
TAG366:
sra $1, $1, 15
lui $1, 9
sra $1, $1, 4
sltu $3, $1, $1
TAG367:
bne $3, $3, TAG368
lui $1, 3
mflo $1
mtlo $1
TAG368:
bgez $1, TAG369
mtlo $1
mflo $1
addu $2, $1, $1
TAG369:
bgez $2, TAG370
sw $2, 0($2)
beq $2, $2, TAG370
lui $4, 10
TAG370:
slti $4, $4, 3
lui $2, 10
mult $4, $2
mult $2, $4
TAG371:
sll $0, $0, 0
beq $1, $2, TAG372
lui $3, 9
bltz $2, TAG372
TAG372:
mtlo $3
divu $3, $3
blez $3, TAG373
lui $4, 14
TAG373:
div $4, $4
beq $4, $4, TAG374
lui $2, 1
sb $4, 0($4)
TAG374:
sll $0, $0, 0
sll $0, $0, 0
sll $0, $0, 0
divu $2, $4
TAG375:
sll $0, $0, 0
sb $1, 0($1)
mult $4, $4
lw $4, 0($1)
TAG376:
mult $4, $4
andi $1, $4, 4
lh $2, 0($4)
mflo $1
TAG377:
nor $2, $1, $1
sra $3, $2, 1
beq $3, $2, TAG378
mthi $1
TAG378:
and $1, $3, $3
lbu $2, 1($1)
div $2, $3
bne $3, $2, TAG379
TAG379:
addiu $2, $2, 3
sh $2, 0($2)
multu $2, $2
sh $2, 0($2)
TAG380:
div $2, $2
mflo $2
xor $3, $2, $2
sb $2, 0($2)
TAG381:
multu $3, $3
mtlo $3
lui $4, 11
beq $3, $4, TAG382
TAG382:
lui $1, 9
div $4, $1
div $4, $1
sll $0, $0, 0
TAG383:
sllv $3, $1, $1
beq $1, $1, TAG384
mfhi $3
mflo $2
TAG384:
slt $4, $2, $2
beq $4, $2, TAG385
lui $1, 10
sra $4, $1, 2
TAG385:
addu $3, $4, $4
beq $3, $4, TAG386
mflo $2
bltz $4, TAG386
TAG386:
divu $2, $2
lui $1, 14
mflo $3
divu $2, $1
TAG387:
lb $3, 0($3)
bgez $3, TAG388
lui $4, 4
or $3, $3, $3
TAG388:
blez $3, TAG389
mult $3, $3
blez $3, TAG389
mult $3, $3
TAG389:
blez $3, TAG390
mflo $1
lui $1, 9
mflo $3
TAG390:
sllv $4, $3, $3
lh $3, 0($4)
multu $4, $4
mtlo $3
TAG391:
multu $3, $3
slt $3, $3, $3
slt $4, $3, $3
bgez $4, TAG392
TAG392:
lw $3, 0($4)
sra $1, $4, 3
bgez $3, TAG393
mflo $2
TAG393:
lw $3, 0($2)
sb $3, 0($2)
xor $1, $3, $3
mtlo $1
TAG394:
mtlo $1
sll $2, $1, 0
mfhi $4
lhu $4, 0($1)
TAG395:
bne $4, $4, TAG396
xor $2, $4, $4
multu $2, $4
sub $3, $4, $2
TAG396:
ori $2, $3, 0
multu $2, $2
sb $2, -256($3)
sb $2, -256($2)
TAG397:
beq $2, $2, TAG398
sw $2, -256($2)
andi $1, $2, 5
bgez $1, TAG398
TAG398:
sh $1, 0($1)
mult $1, $1
mthi $1
bne $1, $1, TAG399
TAG399:
sub $3, $1, $1
multu $3, $1
sh $3, 0($3)
mthi $3
TAG400:
bne $3, $3, TAG401
addiu $4, $3, 14
beq $3, $3, TAG401
lui $1, 15
TAG401:
addiu $4, $1, 14
multu $1, $4
lui $1, 12
subu $1, $1, $1
TAG402:
slti $2, $1, 6
mthi $2
mtlo $2
sra $1, $2, 1
TAG403:
sh $1, 0($1)
multu $1, $1
sw $1, 0($1)
sb $1, 0($1)
TAG404:
bltz $1, TAG405
mflo $2
blez $2, TAG405
sb $2, 0($2)
TAG405:
bne $2, $2, TAG406
sw $2, 0($2)
nor $1, $2, $2
lw $1, 1($1)
TAG406:
mfhi $4
lb $2, 0($4)
multu $1, $4
srav $4, $2, $1
TAG407:
bltz $4, TAG408
and $2, $4, $4
mtlo $4
addu $2, $4, $2
TAG408:
mult $2, $2
lui $1, 3
sll $0, $0, 0
sw $3, 0($2)
TAG409:
lui $4, 3
or $2, $4, $4
lui $4, 4
divu $4, $4
TAG410:
sll $0, $0, 0
lui $1, 1
divu $4, $4
lui $2, 3
TAG411:
bgez $2, TAG412
divu $2, $2
div $2, $2
bltz $2, TAG412
TAG412:
sll $0, $0, 0
beq $2, $2, TAG413
lui $4, 2
bne $4, $1, TAG413
TAG413:
sll $0, $0, 0
sll $0, $0, 0
or $3, $4, $3
mthi $4
TAG414:
mtlo $3
mthi $3
mtlo $3
mfhi $1
TAG415:
multu $1, $1
lui $4, 11
srav $4, $1, $1
mthi $4
TAG416:
div $4, $4
mthi $4
bne $4, $4, TAG417
sll $0, $0, 0
TAG417:
nor $1, $4, $4
sra $1, $1, 10
lw $2, 129($1)
mult $1, $2
TAG418:
bltz $2, TAG419
mtlo $2
mflo $2
sra $1, $2, 7
TAG419:
lhu $4, 0($1)
mflo $2
lui $1, 14
bne $4, $1, TAG420
TAG420:
divu $1, $1
bgez $1, TAG421
sll $0, $0, 0
bgez $1, TAG421
TAG421:
mfhi $1
mfhi $1
lb $1, 0($1)
bne $1, $1, TAG422
TAG422:
mflo $4
sb $1, 0($4)
lb $2, 0($4)
sltu $3, $1, $4
TAG423:
mtlo $3
bgez $3, TAG424
mtlo $3
lw $2, 0($3)
TAG424:
lhu $4, 0($2)
bgtz $4, TAG425
mfhi $3
sh $3, 0($4)
TAG425:
mthi $3
nor $4, $3, $3
sll $3, $4, 0
mtlo $3
TAG426:
bltz $3, TAG427
mfhi $1
mfhi $4
lui $1, 9
TAG427:
sh $1, 0($1)
bne $1, $1, TAG428
sw $1, 0($1)
lh $3, 0($1)
TAG428:
lhu $1, 0($3)
sw $3, 0($3)
slti $4, $3, 15
divu $1, $4
TAG429:
lbu $1, 0($4)
lb $4, 0($4)
lb $2, 0($1)
mtlo $4
TAG430:
bne $2, $2, TAG431
mfhi $3
sh $2, 0($3)
sltiu $2, $3, 9
TAG431:
lui $2, 9
sll $3, $2, 13
sll $0, $0, 0
mflo $4
TAG432:
sllv $4, $4, $4
lw $3, 0($4)
mthi $4
srav $3, $3, $4
TAG433:
subu $1, $3, $3
bne $3, $3, TAG434
mtlo $3
bne $3, $1, TAG434
TAG434:
mthi $1
mult $1, $1
addi $3, $1, 8
lb $1, 0($3)
TAG435:
mult $1, $1
andi $1, $1, 7
bne $1, $1, TAG436
sllv $3, $1, $1
TAG436:
mflo $2
lhu $3, 0($2)
xori $2, $3, 10
lh $2, 0($3)
TAG437:
lhu $3, 0($2)
lui $3, 4
bltz $3, TAG438
sll $0, $0, 0
TAG438:
sb $2, 0($2)
lui $1, 12
mtlo $1
sll $0, $0, 0
TAG439:
lbu $1, 0($4)
sw $4, 0($4)
bgez $4, TAG440
mult $4, $4
TAG440:
mthi $1
sb $1, 0($1)
sb $1, 0($1)
bne $1, $1, TAG441
TAG441:
srl $3, $1, 15
slti $2, $3, 12
mult $2, $3
beq $3, $3, TAG442
TAG442:
mfhi $3
multu $2, $2
ori $2, $2, 9
div $2, $2
TAG443:
mult $2, $2
beq $2, $2, TAG444
mflo $3
bltz $2, TAG444
TAG444:
addiu $3, $3, 2
srl $3, $3, 10
lb $3, 0($3)
bltz $3, TAG445
TAG445:
xori $2, $3, 6
lhu $2, 0($3)
mult $3, $3
lb $4, 0($2)
TAG446:
mtlo $4
mfhi $4
mtlo $4
lhu $2, 0($4)
TAG447:
sub $2, $2, $2
multu $2, $2
mtlo $2
mfhi $3
TAG448:
blez $3, TAG449
lui $4, 9
sw $4, 0($3)
sw $4, 0($3)
TAG449:
mtlo $4
mtlo $4
sll $2, $4, 15
bne $4, $4, TAG450
TAG450:
mtlo $2
mult $2, $2
or $3, $2, $2
multu $2, $3
TAG451:
bgez $3, TAG452
mtlo $3
mthi $3
bltz $3, TAG452
TAG452:
sll $0, $0, 0
mtlo $1
and $1, $1, $1
lb $4, 0($1)
TAG453:
lui $3, 4
mflo $2
mflo $3
or $1, $4, $4
TAG454:
sb $1, 0($1)
lui $1, 11
sll $0, $0, 0
andi $4, $1, 10
TAG455:
bltz $4, TAG456
slti $3, $4, 10
lbu $2, 0($3)
bne $2, $4, TAG456
TAG456:
sw $2, 0($2)
mult $2, $2
addiu $3, $2, 13
sltu $4, $2, $2
TAG457:
sw $4, 0($4)
add $1, $4, $4
bltz $1, TAG458
sb $1, 0($4)
TAG458:
lb $4, 0($1)
mult $4, $4
sltiu $1, $1, 9
bltz $1, TAG459
TAG459:
mfhi $1
multu $1, $1
lbu $3, 0($1)
mfhi $2
TAG460:
mult $2, $2
nor $3, $2, $2
mtlo $3
mult $3, $3
TAG461:
sll $0, $0, 0
sllv $3, $3, $3
sll $0, $0, 0
mflo $2
TAG462:
bne $2, $2, TAG463
lui $4, 12
mflo $2
mfhi $2
TAG463:
sb $2, 0($2)
bne $2, $2, TAG464
addiu $4, $2, 7
multu $4, $2
TAG464:
sb $4, 0($4)
bne $4, $4, TAG465
mthi $4
lui $4, 12
TAG465:
mthi $4
addu $1, $4, $4
mult $4, $1
sll $0, $0, 0
TAG466:
divu $3, $3
lui $4, 3
bne $3, $4, TAG467
mfhi $4
TAG467:
mflo $1
xori $2, $4, 12
beq $2, $2, TAG468
lui $1, 15
TAG468:
lui $2, 4
mflo $3
mthi $2
lui $4, 13
TAG469:
multu $4, $4
bgez $4, TAG470
mflo $3
sw $4, 0($3)
TAG470:
bne $3, $3, TAG471
lw $2, 0($3)
lui $3, 14
bne $3, $2, TAG471
TAG471:
sll $0, $0, 0
sltiu $1, $3, 1
beq $3, $1, TAG472
xori $3, $3, 13
TAG472:
sll $0, $0, 0
sll $0, $0, 0
subu $4, $3, $3
mult $3, $4
TAG473:
lui $3, 5
subu $1, $4, $4
sb $1, 0($1)
sll $0, $0, 0
TAG474:
bne $3, $3, TAG475
sll $0, $0, 0
beq $2, $3, TAG475
sb $2, 0($2)
TAG475:
mthi $2
sh $2, 0($2)
mult $2, $2
beq $2, $2, TAG476
TAG476:
lui $3, 11
and $3, $2, $3
addi $1, $3, 0
sb $3, 0($2)
TAG477:
blez $1, TAG478
mflo $3
multu $1, $1
lb $4, 0($1)
TAG478:
blez $4, TAG479
sllv $2, $4, $4
lui $2, 12
divu $4, $4
TAG479:
lw $2, 0($2)
mtlo $2
addu $3, $2, $2
lui $4, 14
TAG480:
lui $2, 11
multu $2, $2
beq $2, $2, TAG481
addu $1, $2, $4
TAG481:
mtlo $1
sll $0, $0, 0
bgtz $1, TAG482
sltu $4, $1, $1
TAG482:
mtlo $4
lui $3, 3
bgtz $4, TAG483
sra $4, $4, 4
TAG483:
mtlo $4
xor $2, $4, $4
mult $4, $4
sh $2, 0($4)
TAG484:
mflo $2
lbu $1, 0($2)
lh $4, 0($2)
lhu $3, 0($1)
TAG485:
sw $3, 0($3)
sb $3, 0($3)
sw $3, 0($3)
lb $1, 0($3)
TAG486:
mthi $1
mflo $2
sltu $2, $1, $1
sw $1, 0($2)
TAG487:
mult $2, $2
sh $2, 0($2)
nor $1, $2, $2
sw $1, 0($2)
TAG488:
lui $4, 9
mtlo $1
sll $0, $0, 0
mthi $1
TAG489:
beq $4, $4, TAG490
andi $2, $4, 8
mtlo $2
sb $4, 0($2)
TAG490:
bgtz $2, TAG491
lb $4, 0($2)
lui $4, 9
mfhi $3
TAG491:
mflo $1
mtlo $1
lui $3, 10
addu $2, $3, $3
TAG492:
andi $4, $2, 5
lh $4, 0($4)
mfhi $1
mflo $4
TAG493:
mtlo $4
bne $4, $4, TAG494
mtlo $4
div $4, $4
TAG494:
div $4, $4
lhu $3, 1($4)
bltz $4, TAG495
sh $3, 1($4)
TAG495:
lui $4, 8
mtlo $4
bgez $4, TAG496
lui $3, 4
TAG496:
sll $0, $0, 0
mfhi $2
sltiu $2, $2, 15
divu $3, $3
TAG497:
bne $2, $2, TAG498
mflo $3
mult $3, $2
lui $4, 4
TAG498:
mtlo $4
sll $0, $0, 0
addiu $3, $1, 14
xori $3, $4, 10
TAG499:
sll $0, $0, 0
ori $3, $3, 3
mflo $2
lui $1, 1
TAG500:
andi $4, $1, 5
bne $4, $4, TAG501
mult $1, $1
sra $3, $4, 14
TAG501:
bltz $3, TAG502
lui $4, 0
bgez $4, TAG502
addu $4, $4, $4
TAG502:
and $4, $4, $4
addi $3, $4, 12
lw $4, 0($4)
lbu $4, 1($4)
TAG503:
sh $4, -255($4)
bne $4, $4, TAG504
mtlo $4
blez $4, TAG504
TAG504:
multu $4, $4
lui $2, 0
div $2, $4
sllv $2, $2, $2
TAG505:
lb $4, 0($2)
lui $3, 10
bne $3, $3, TAG506
andi $1, $3, 13
TAG506:
mtlo $1
mthi $1
sb $1, 0($1)
lh $4, 0($1)
TAG507:
mthi $4
mthi $4
sw $4, 0($4)
ori $3, $4, 5
TAG508:
bgtz $3, TAG509
divu $3, $3
sll $2, $3, 4
bne $3, $3, TAG509
TAG509:
mflo $1
multu $2, $2
srlv $2, $1, $2
xori $1, $2, 1
TAG510:
bne $1, $1, TAG511
subu $3, $1, $1
bne $1, $3, TAG511
sltu $2, $3, $3
TAG511:
lui $3, 4
sb $3, 0($2)
div $3, $3
blez $2, TAG512
TAG512:
mflo $3
mtlo $3
beq $3, $3, TAG513
addiu $2, $3, 7
TAG513:
mfhi $3
sw $2, 0($2)
sll $4, $3, 7
mflo $4
TAG514:
xori $3, $4, 10
sb $4, 0($4)
mtlo $4
lui $1, 3
TAG515:
sll $0, $0, 0
sll $0, $0, 0
multu $2, $1
addu $3, $1, $1
TAG516:
sll $0, $0, 0
blez $3, TAG517
sll $0, $0, 0
sll $2, $2, 7
TAG517:
lui $4, 2
ori $2, $2, 11
nor $3, $2, $2
slti $2, $3, 10
TAG518:
sra $1, $2, 15
lui $3, 11
lbu $3, 0($2)
lb $1, 0($3)
TAG519:
bgez $1, TAG520
sllv $3, $1, $1
sw $3, 0($3)
mfhi $4
TAG520:
mfhi $2
lh $1, 0($2)
mflo $3
addu $1, $4, $4
TAG521:
mflo $3
mfhi $2
lui $2, 0
multu $2, $1
TAG522:
addi $4, $2, 5
bgtz $2, TAG523
lui $1, 12
slt $2, $1, $2
TAG523:
mflo $1
sw $1, 0($1)
slt $4, $2, $2
addi $2, $4, 3
TAG524:
multu $2, $2
mthi $2
mtlo $2
lb $4, 0($2)
TAG525:
sh $4, 0($4)
mtlo $4
nor $2, $4, $4
mult $4, $4
TAG526:
div $2, $2
mult $2, $2
slti $1, $2, 7
blez $2, TAG527
TAG527:
mflo $1
mtlo $1
multu $1, $1
lb $4, 0($1)
TAG528:
lui $2, 6
sll $0, $0, 0
bgez $4, TAG529
mult $2, $4
TAG529:
bgez $3, TAG530
mtlo $3
sb $3, 0($3)
slti $3, $3, 2
TAG530:
bne $3, $3, TAG531
and $2, $3, $3
sra $3, $3, 10
lbu $4, -1536($3)
TAG531:
beq $4, $4, TAG532
lui $2, 6
sra $4, $4, 10
bne $4, $4, TAG532
TAG532:
lh $1, 0($4)
srl $4, $4, 5
mult $4, $4
bltz $4, TAG533
TAG533:
mult $4, $4
bne $4, $4, TAG534
sh $4, 0($4)
mtlo $4
TAG534:
xori $2, $4, 11
lui $3, 7
bgez $4, TAG535
subu $4, $3, $3
TAG535:
lh $1, 0($4)
sltu $1, $4, $1
multu $4, $1
mfhi $3
TAG536:
ori $1, $3, 12
mflo $3
bgez $1, TAG537
ori $1, $3, 10
TAG537:
mult $1, $1
blez $1, TAG538
mtlo $1
and $4, $1, $1
TAG538:
lhu $3, 0($4)
sh $3, 0($4)
slt $1, $3, $3
ori $4, $1, 15
TAG539:
sb $4, 0($4)
mfhi $3
and $4, $4, $4
lb $4, 0($4)
TAG540:
divu $4, $4
mflo $1
mflo $1
sb $1, 0($1)
TAG541:
bltz $1, TAG542
lui $2, 10
mflo $2
div $2, $1
TAG542:
div $2, $2
lbu $1, 0($2)
lui $3, 3
mtlo $3
TAG543:
subu $1, $3, $3
mflo $3
sll $1, $3, 7
beq $1, $1, TAG544
TAG544:
mtlo $1
srlv $1, $1, $1
bltz $1, TAG545
ori $1, $1, 11
TAG545:
sll $0, $0, 0
bgez $1, TAG546
mflo $2
mthi $2
TAG546:
sll $0, $0, 0
bne $2, $2, TAG547
lui $2, 4
mfhi $1
TAG547:
multu $1, $1
mthi $1
xori $3, $1, 2
ori $4, $1, 8
TAG548:
sb $4, 0($4)
sll $2, $4, 12
mtlo $2
sltiu $1, $4, 10
TAG549:
mtlo $1
lb $2, 0($1)
sll $2, $1, 8
sb $2, 0($1)
TAG550:
mtlo $2
bgez $2, TAG551
mtlo $2
beq $2, $2, TAG551
TAG551:
srav $1, $2, $2
lui $4, 10
xor $3, $1, $4
nor $2, $3, $3
TAG552:
divu $2, $2
mtlo $2
lui $3, 1
bltz $3, TAG553
TAG553:
srav $1, $3, $3
sll $0, $0, 0
lui $1, 8
slti $4, $1, 6
TAG554:
sllv $1, $4, $4
srav $4, $1, $1
sw $4, 0($4)
lui $4, 7
TAG555:
lui $4, 15
xori $1, $4, 8
sll $0, $0, 0
lui $2, 3
TAG556:
bgez $2, TAG557
sll $0, $0, 0
beq $2, $2, TAG557
sh $2, 0($2)
TAG557:
divu $2, $2
sll $0, $0, 0
lui $1, 1
bne $1, $2, TAG558
TAG558:
andi $1, $1, 11
lw $4, 0($1)
beq $1, $4, TAG559
mult $1, $1
TAG559:
mfhi $3
beq $3, $4, TAG560
sw $4, 0($3)
mtlo $4
TAG560:
lh $1, 0($3)
andi $2, $3, 5
mult $2, $2
subu $2, $2, $3
TAG561:
multu $2, $2
lui $3, 3
lui $4, 5
sra $1, $2, 3
TAG562:
mthi $1
mflo $3
multu $1, $1
lw $1, 0($1)
TAG563:
bne $1, $1, TAG564
slti $2, $1, 6
sra $3, $1, 1
blez $3, TAG564
TAG564:
multu $3, $3
lb $3, 0($3)
lh $3, 0($3)
addi $4, $3, 10
TAG565:
lh $3, 0($4)
sh $4, 0($3)
lui $1, 6
mthi $4
TAG566:
sll $0, $0, 0
srl $4, $1, 10
sb $4, 0($2)
bne $4, $2, TAG567
TAG567:
addu $2, $4, $4
mflo $4
sll $4, $2, 2
lui $4, 4
TAG568:
bne $4, $4, TAG569
addiu $4, $4, 8
sll $2, $4, 3
bltz $4, TAG569
TAG569:
lui $3, 9
beq $3, $2, TAG570
div $3, $3
bne $2, $2, TAG570
TAG570:
sll $0, $0, 0
sll $0, $0, 0
addu $3, $4, $3
addu $1, $3, $3
TAG571:
mfhi $3
mthi $1
blez $1, TAG572
divu $3, $1
TAG572:
sb $3, 0($3)
mult $3, $3
bgez $3, TAG573
lui $4, 11
TAG573:
xor $4, $4, $4
mthi $4
lui $2, 14
sll $1, $4, 6
TAG574:
lbu $4, 0($1)
sb $4, 0($4)
addiu $2, $1, 1
sb $1, 0($2)
TAG575:
or $1, $2, $2
lb $4, 0($1)
blez $1, TAG576
lui $4, 4
TAG576:
sll $0, $0, 0
mult $4, $4
bgez $4, TAG577
mflo $4
TAG577:
sw $4, 0($4)
lui $1, 14
sb $1, 0($4)
mthi $4
TAG578:
lui $2, 8
mflo $3
ori $1, $2, 3
lui $4, 10
TAG579:
beq $4, $4, TAG580
mtlo $4
beq $4, $4, TAG580
sw $4, 0($4)
TAG580:
addiu $3, $4, 6
bltz $3, TAG581
slti $4, $3, 12
beq $3, $4, TAG581
TAG581:
mthi $4
slti $2, $4, 4
srl $3, $4, 9
bne $4, $2, TAG582
TAG582:
lb $3, 0($3)
bgtz $3, TAG583
sw $3, 0($3)
multu $3, $3
TAG583:
sw $3, 0($3)
mfhi $3
bne $3, $3, TAG584
lui $2, 11
TAG584:
sltiu $1, $2, 9
beq $1, $1, TAG585
mthi $1
sub $2, $1, $2
TAG585:
slti $1, $2, 7
mflo $1
sll $0, $0, 0
multu $2, $2
TAG586:
mflo $2
mtlo $2
sw $1, 0($1)
mflo $2
TAG587:
bgtz $2, TAG588
lui $1, 6
mflo $4
mtlo $4
TAG588:
sltiu $1, $4, 4
mfhi $2
mfhi $4
mflo $2
TAG589:
sh $2, 0($2)
lbu $4, 0($2)
mtlo $2
andi $2, $4, 6
TAG590:
mtlo $2
sltu $1, $2, $2
bne $2, $2, TAG591
mfhi $4
TAG591:
bgez $4, TAG592
div $4, $4
lhu $2, 0($4)
srlv $4, $2, $2
TAG592:
lb $2, 0($4)
multu $4, $2
sltiu $4, $2, 4
lb $4, 0($4)
TAG593:
addiu $4, $4, 3
divu $4, $4
lbu $3, 0($4)
mtlo $4
TAG594:
mult $3, $3
mfhi $2
lb $4, 0($3)
bgez $2, TAG595
TAG595:
sb $4, 0($4)
lhu $1, 0($4)
mflo $2
mfhi $1
TAG596:
bne $1, $1, TAG597
sb $1, 0($1)
bne $1, $1, TAG597
multu $1, $1
TAG597:
multu $1, $1
lb $1, 0($1)
ori $1, $1, 9
bne $1, $1, TAG598
TAG598:
sb $1, 0($1)
lui $2, 12
beq $2, $2, TAG599
addu $1, $1, $1
TAG599:
sll $1, $1, 5
mfhi $4
sll $2, $4, 0
lui $4, 15
TAG600:
div $4, $4
subu $4, $4, $4
lui $1, 5
lui $4, 12
TAG601:
bne $4, $4, TAG602
mflo $3
mfhi $1
mfhi $3
TAG602:
lui $3, 8
blez $3, TAG603
mthi $3
mflo $2
TAG603:
bne $2, $2, TAG604
subu $1, $2, $2
lui $4, 6
lui $2, 14
TAG604:
sll $0, $0, 0
mflo $1
sll $0, $0, 0
mtlo $2
TAG605:
sll $0, $0, 0
sra $4, $2, 8
bltz $4, TAG606
mfhi $4
TAG606:
slti $3, $4, 1
sll $0, $0, 0
div $4, $4
lui $2, 3
TAG607:
mtlo $2
sltiu $4, $2, 5
mult $4, $4
lui $2, 1
TAG608:
subu $3, $2, $2
bne $3, $2, TAG609
mtlo $3
beq $2, $3, TAG609
TAG609:
srl $3, $3, 10
multu $3, $3
lui $2, 3
mthi $3
TAG610:
mtlo $2
divu $2, $2
sll $0, $0, 0
mthi $2
TAG611:
sll $0, $0, 0
lui $3, 6
lui $3, 13
beq $3, $3, TAG612
TAG612:
subu $3, $3, $3
mflo $2
mthi $3
sb $3, 0($3)
TAG613:
bne $2, $2, TAG614
multu $2, $2
lb $2, 0($2)
mtlo $2
TAG614:
multu $2, $2
sll $2, $2, 12
lbu $1, 0($2)
mfhi $3
TAG615:
sltiu $1, $3, 14
lui $1, 7
mflo $4
sltu $1, $4, $1
TAG616:
lb $4, 0($1)
sh $1, 0($4)
mthi $1
multu $1, $1
TAG617:
sltu $2, $4, $4
addi $3, $2, 9
srlv $2, $2, $2
mfhi $4
TAG618:
mult $4, $4
mthi $4
lhu $4, 0($4)
bltz $4, TAG619
TAG619:
mflo $2
bne $4, $4, TAG620
subu $1, $2, $2
srav $3, $4, $2
TAG620:
mflo $2
mfhi $1
add $3, $1, $1
lh $1, 0($3)
TAG621:
multu $1, $1
lb $4, 0($1)
mfhi $4
multu $1, $4
TAG622:
subu $2, $4, $4
ori $2, $4, 8
mult $4, $4
lw $1, 0($4)
TAG623:
divu $1, $1
mthi $1
bne $1, $1, TAG624
lui $1, 10
TAG624:
lui $4, 9
mtlo $4
lui $1, 12
beq $1, $4, TAG625
TAG625:
srav $4, $1, $1
lui $4, 6
bne $4, $1, TAG626
xori $2, $4, 13
TAG626:
sll $0, $0, 0
blez $2, TAG627
sltiu $3, $2, 0
mtlo $3
TAG627:
sll $4, $3, 11
xori $3, $4, 8
multu $4, $4
sh $3, 0($3)
TAG628:
mflo $2
sb $3, 0($3)
xori $3, $2, 12
xor $1, $2, $3
TAG629:
lw $3, 0($1)
sll $0, $0, 0
bgez $3, TAG630
or $2, $1, $3
TAG630:
sll $0, $0, 0
slti $4, $2, 6
multu $2, $4
div $4, $2
TAG631:
bne $4, $4, TAG632
multu $4, $4
slt $3, $4, $4
multu $3, $3
TAG632:
beq $3, $3, TAG633
mfhi $4
sh $3, 0($4)
mtlo $4
TAG633:
beq $4, $4, TAG634
lui $2, 13
lhu $3, 0($2)
srav $4, $4, $4
TAG634:
mthi $4
mult $4, $4
lui $1, 12
ori $3, $1, 12
TAG635:
sll $0, $0, 0
beq $3, $3, TAG636
mfhi $4
ori $3, $4, 12
TAG636:
lui $2, 14
div $2, $2
lui $2, 3
sll $0, $0, 0
TAG637:
bltz $4, TAG638
addiu $3, $4, 3
mult $3, $4
lui $3, 5
TAG638:
multu $3, $3
sll $0, $0, 0
lui $3, 12
bgtz $3, TAG639
TAG639:
mflo $2
mfhi $2
sb $2, 0($2)
mfhi $2
TAG640:
mthi $2
beq $2, $2, TAG641
sb $2, 0($2)
xori $1, $2, 2
TAG641:
sll $0, $0, 0
sll $0, $0, 0
mfhi $1
lui $3, 14
TAG642:
subu $1, $3, $3
bgtz $1, TAG643
multu $1, $1
sra $2, $1, 2
TAG643:
ori $2, $2, 5
blez $2, TAG644
lui $1, 7
mthi $1
TAG644:
sll $0, $0, 0
sll $0, $0, 0
slt $1, $1, $1
sltu $4, $1, $1
TAG645:
mult $4, $4
bgez $4, TAG646
sb $4, 0($4)
nor $3, $4, $4
TAG646:
mthi $3
slti $4, $3, 0
multu $3, $4
lui $3, 14
TAG647:
divu $3, $3
slti $2, $3, 0
multu $3, $3
addu $3, $3, $3
TAG648:
mtlo $3
mtlo $3
bgtz $3, TAG649
sll $0, $0, 0
TAG649:
bltz $3, TAG650
mthi $3
divu $3, $3
mult $3, $3
TAG650:
mthi $3
lui $2, 3
mthi $2
bgtz $2, TAG651
TAG651:
sll $0, $0, 0
mfhi $2
beq $2, $2, TAG652
mtlo $2
TAG652:
sll $0, $0, 0
srl $1, $2, 14
mtlo $1
bltz $2, TAG653
TAG653:
multu $1, $1
sh $1, 0($1)
mtlo $1
lhu $1, 0($1)
TAG654:
sltiu $2, $1, 0
div $2, $1
sb $1, 0($2)
mfhi $4
TAG655:
sh $4, 0($4)
bltz $4, TAG656
mtlo $4
lui $3, 14
TAG656:
mtlo $3
div $3, $3
sll $0, $0, 0
mthi $3
TAG657:
sll $0, $0, 0
sllv $1, $3, $3
addiu $4, $3, 3
bne $3, $3, TAG658
TAG658:
nor $2, $4, $4
sll $0, $0, 0
andi $4, $2, 2
srl $1, $4, 11
TAG659:
mtlo $1
slti $3, $1, 6
slt $2, $1, $3
bne $1, $2, TAG660
TAG660:
ori $1, $2, 10
lui $3, 3
sll $3, $2, 3
mflo $2
TAG661:
multu $2, $2
lui $3, 7
sw $3, 0($2)
bgez $2, TAG662
TAG662:
mtlo $3
ori $4, $3, 10
lui $2, 3
sll $0, $0, 0
TAG663:
lui $4, 15
bltz $4, TAG664
sll $0, $0, 0
divu $4, $2
TAG664:
sll $0, $0, 0
mult $2, $3
mtlo $3
bgtz $2, TAG665
TAG665:
sll $0, $0, 0
bgez $3, TAG666
lui $2, 0
mthi $3
TAG666:
lw $1, 0($2)
sll $0, $0, 0
divu $3, $3
or $1, $3, $1
TAG667:
sll $0, $0, 0
mthi $1
sltu $3, $1, $1
bltz $1, TAG668
TAG668:
mthi $3
mflo $3
sb $3, 0($3)
mflo $3
TAG669:
mfhi $3
bne $3, $3, TAG670
sb $3, 0($3)
mtlo $3
TAG670:
lui $4, 8
xori $1, $4, 5
lui $1, 3
sll $0, $0, 0
TAG671:
beq $1, $1, TAG672
lui $3, 15
lhu $3, 0($1)
nor $4, $1, $1
TAG672:
divu $4, $4
div $4, $4
blez $4, TAG673
mtlo $4
TAG673:
sll $0, $0, 0
div $4, $4
sltu $2, $4, $4
sll $0, $0, 0
TAG674:
lui $3, 10
lui $3, 1
sltu $4, $2, $3
beq $3, $2, TAG675
TAG675:
sb $4, 0($4)
mthi $4
mfhi $3
mthi $4
TAG676:
srav $4, $3, $3
lui $1, 12
slti $2, $3, 6
div $2, $3
TAG677:
sll $3, $2, 6
divu $3, $2
mfhi $4
bltz $3, TAG678
TAG678:
ori $1, $4, 10
lhu $4, 0($1)
mthi $1
ori $4, $4, 6
TAG679:
lhu $2, 0($4)
mflo $1
addiu $2, $2, 13
nor $2, $2, $4
TAG680:
mult $2, $2
addu $4, $2, $2
beq $2, $2, TAG681
mtlo $2
TAG681:
mfhi $1
andi $3, $1, 12
lw $4, 0($3)
mfhi $4
TAG682:
and $2, $4, $4
andi $3, $4, 7
sw $3, 0($3)
bne $4, $4, TAG683
TAG683:
multu $3, $3
bgez $3, TAG684
sltiu $2, $3, 1
lui $2, 11
TAG684:
sll $1, $2, 6
and $3, $1, $2
sb $2, 0($2)
lbu $2, 0($2)
TAG685:
mfhi $2
ori $4, $2, 7
addu $3, $2, $2
lb $4, 0($2)
TAG686:
multu $4, $4
multu $4, $4
mfhi $1
lui $1, 13
TAG687:
sltu $2, $1, $1
lui $4, 2
mthi $2
sb $2, 0($2)
TAG688:
lui $2, 8
bne $2, $2, TAG689
mult $2, $4
addiu $4, $2, 5
TAG689:
div $4, $4
sll $0, $0, 0
mflo $2
divu $2, $4
TAG690:
lb $3, 0($2)
mult $3, $2
bne $2, $3, TAG691
lui $4, 10
TAG691:
mflo $2
mthi $2
mfhi $3
lui $2, 14
TAG692:
div $2, $2
divu $2, $2
addu $4, $2, $2
mult $4, $2
TAG693:
blez $4, TAG694
mflo $2
lui $3, 10
lui $3, 8
TAG694:
beq $3, $3, TAG695
mult $3, $3
mtlo $3
lui $2, 12
TAG695:
sltu $2, $2, $2
mflo $3
xori $4, $2, 6
blez $2, TAG696
TAG696:
sb $4, 0($4)
ori $4, $4, 0
beq $4, $4, TAG697
sb $4, 0($4)
TAG697:
blez $4, TAG698
lhu $4, 0($4)
beq $4, $4, TAG698
div $4, $4
TAG698:
sw $4, -1798($4)
blez $4, TAG699
div $4, $4
lh $2, -1798($4)
TAG699:
beq $2, $2, TAG700
lui $2, 2
divu $2, $2
lui $4, 1
TAG700:
sw $4, -1798($4)
bltz $4, TAG701
lhu $4, -1798($4)
sra $1, $4, 11
TAG701:
multu $1, $1
multu $1, $1
mult $1, $1
and $4, $1, $1
TAG702:
lb $1, 0($4)
sb $1, 0($1)
add $2, $4, $4
bgez $1, TAG703
TAG703:
sw $2, 0($2)
bne $2, $2, TAG704
sb $2, 0($2)
lh $1, 0($2)
TAG704:
bne $1, $1, TAG705
mult $1, $1
lw $2, 0($1)
bgtz $1, TAG705
TAG705:
lbu $4, 0($2)
beq $4, $4, TAG706
sb $4, 0($4)
bgez $2, TAG706
TAG706:
mtlo $4
blez $4, TAG707
sh $4, 0($4)
multu $4, $4
TAG707:
slti $4, $4, 13
srlv $3, $4, $4
bne $4, $4, TAG708
mult $4, $4
TAG708:
lbu $2, 0($3)
sw $3, 0($3)
sw $2, 0($2)
beq $2, $2, TAG709
TAG709:
sltu $3, $2, $2
srav $2, $3, $3
mtlo $3
mfhi $4
TAG710:
multu $4, $4
beq $4, $4, TAG711
slti $3, $4, 9
lui $1, 14
TAG711:
mfhi $1
sltiu $1, $1, 15
div $1, $1
lui $4, 12
TAG712:
or $4, $4, $4
lui $2, 5
lui $1, 4
beq $2, $4, TAG713
TAG713:
sll $0, $0, 0
lbu $3, 0($3)
addu $1, $3, $3
lui $3, 12
TAG714:
sll $0, $0, 0
mflo $3
mtlo $3
div $3, $3
TAG715:
and $3, $3, $3
lui $2, 15
mthi $2
mflo $1
TAG716:
mtlo $1
lui $3, 6
addu $4, $1, $3
bne $1, $1, TAG717
TAG717:
sll $0, $0, 0
sll $0, $0, 0
sltu $1, $2, $2
bgez $2, TAG718
TAG718:
mthi $1
mthi $1
bne $1, $1, TAG719
multu $1, $1
TAG719:
lui $3, 11
add $2, $1, $3
mtlo $3
bne $1, $3, TAG720
TAG720:
lui $1, 6
addiu $2, $2, 0
mflo $1
addu $1, $1, $1
TAG721:
mtlo $1
mthi $1
sll $0, $0, 0
sll $0, $0, 0
TAG722:
beq $2, $2, TAG723
divu $2, $2
lui $4, 0
multu $4, $4
TAG723:
sll $0, $0, 0
slti $3, $4, 5
sltiu $1, $4, 0
mtlo $3
TAG724:
blez $1, TAG725
sh $1, 0($1)
xori $3, $1, 13
lh $4, 0($3)
TAG725:
mfhi $4
mult $4, $4
xori $2, $4, 9
div $2, $2
TAG726:
mthi $2
addiu $2, $2, 7
mthi $2
mtlo $2
TAG727:
divu $2, $2
mthi $2
sh $2, 0($2)
mfhi $4
TAG728:
mtlo $4
sb $4, 0($4)
multu $4, $4
lb $4, 0($4)
TAG729:
srl $2, $4, 15
bgez $2, TAG730
slti $2, $2, 13
lui $4, 11
TAG730:
multu $4, $4
lb $1, 0($4)
mthi $4
ori $3, $1, 4
TAG731:
sh $3, 0($3)
div $3, $3
lbu $3, 0($3)
lw $4, 0($3)
TAG732:
subu $3, $4, $4
mult $4, $3
lui $1, 3
bne $3, $3, TAG733
TAG733:
mfhi $4
bgez $4, TAG734
lh $3, 0($4)
lui $3, 11
TAG734:
xor $1, $3, $3
lhu $1, 0($3)
lhu $2, 0($3)
bgez $3, TAG735
TAG735:
lh $4, 0($2)
bne $2, $2, TAG736
mthi $4
mtlo $4
TAG736:
sltiu $1, $4, 15
multu $4, $4
mtlo $1
sb $4, 0($1)
TAG737:
beq $1, $1, TAG738
mult $1, $1
lw $4, 0($1)
lui $1, 14
TAG738:
mthi $1
lb $1, 0($1)
slti $3, $1, 15
sra $1, $1, 4
TAG739:
and $3, $1, $1
lbu $4, 0($3)
mtlo $1
bltz $3, TAG740
TAG740:
xor $3, $4, $4
beq $4, $4, TAG741
xori $1, $3, 12
srav $3, $4, $4
TAG741:
bne $3, $3, TAG742
lui $3, 4
mfhi $2
multu $2, $3
TAG742:
mthi $2
lui $2, 15
xor $4, $2, $2
bne $2, $2, TAG743
TAG743:
addiu $3, $4, 10
sh $4, 0($3)
and $4, $3, $4
lbu $4, 0($3)
TAG744:
lui $2, 7
beq $2, $2, TAG745
mthi $4
sb $2, 0($2)
TAG745:
blez $2, TAG746
lui $1, 12
div $1, $1
mtlo $2
TAG746:
mfhi $3
blez $3, TAG747
andi $4, $3, 1
sb $3, 0($3)
TAG747:
mflo $1
sb $4, 0($4)
mult $4, $4
sll $0, $0, 0
TAG748:
sll $0, $0, 0
lhu $1, 0($4)
multu $4, $4
slti $1, $1, 14
TAG749:
lui $3, 8
mfhi $1
lui $1, 10
addiu $2, $3, 4
TAG750:
nop
nop
test_end:
beq $0, $0, test_end
nop | 11.988394 | 21 | 0.540816 |
057e8d0deba4bf1fe75ac84081a523664fff9933 | 171 | asm | Assembly | data/wildPokemon/route17.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | null | null | null | data/wildPokemon/route17.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | null | null | null | data/wildPokemon/route17.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | null | null | null | Route17Mons:
db $19
db 26,SKARMORY
db 27,FEAROW
db 27,DODUO
db 28,DODUO
db 28,PONYTA
db 30,PONYTA
db 29,FEAROW
db 28,MILTANK
db 32,PONYTA
db 29,DODRIO
db $00
| 11.4 | 15 | 0.701754 |
a8c2580e1b8a3bfb97b7c0e9229359a26e6cc64c | 244 | asm | Assembly | pwnlib/shellcraft/templates/i386/linux/getsid.asm | zaratec/pwntools | 8793decd1c9b8c822e3db6c27b9cbf6e8cddfeba | [
"MIT"
] | 5 | 2018-05-15T13:00:56.000Z | 2020-02-09T14:29:00.000Z | pwnlib/shellcraft/templates/i386/linux/getsid.asm | FDlucifer/binjitsu | 999ad632004bfc3e623eead20eb11de98fc1f4dd | [
"MIT"
] | null | null | null | pwnlib/shellcraft/templates/i386/linux/getsid.asm | FDlucifer/binjitsu | 999ad632004bfc3e623eead20eb11de98fc1f4dd | [
"MIT"
] | 6 | 2017-09-07T02:31:11.000Z | 2021-07-05T16:59:18.000Z |
<%
from pwnlib.shellcraft.i386.linux import syscall
%>
<%page args="pid"/>
<%docstring>
Invokes the syscall getsid. See 'man 2 getsid' for more information.
Arguments:
pid(pid_t): pid
</%docstring>
${syscall('SYS_getsid', pid)}
| 17.428571 | 69 | 0.67623 |
fd7be818c85acbf431fedcc38039c2007b0d4a0a | 10,265 | asm | Assembly | src/build.asm | matthewkirby/Beta-Quest | 0532c73e639fb56a1f3ffbc164fb394bfa45d371 | [
"MIT"
] | null | null | null | src/build.asm | matthewkirby/Beta-Quest | 0532c73e639fb56a1f3ffbc164fb394bfa45d371 | [
"MIT"
] | null | null | null | src/build.asm | matthewkirby/Beta-Quest | 0532c73e639fb56a1f3ffbc164fb394bfa45d371 | [
"MIT"
] | null | null | null | .n64
.relativeinclude on
.create "../roms/port.z64", 0
.incbin "../roms/base.z64"
//set language
.orga 0x3E
.byte 0x45
.include "macros.asm"
;==============================================================================
; Constants
;==============================================================================
.definelabel CUTSCENE_ROOM_0_START, 0x2AA4000
.definelabel CUTSCENE_ROOM_0_END, 0x02AA46E0
.include "constants.asm"
.include "addresses.asm"
;==============================================================================
; dmadata
;==============================================================================
.orga 0xB494
.word 0x0202E6E0
.orga 0xB4A4
.word 0x0204CF90
.orga 0xC420
.word CUTSCENE_ROOM_0_START, CUTSCENE_ROOM_0_END
.orga 0xD290
.word 0x03480000, 0x03480B00, 0x03480000, 0
.orga 0xD2A0
.word 0x03490000, 0x03490000 + PAYLOAD_END - PAYLOAD_START, 0x03490000 //payload
;==============================================================================
; Code file scripts
;==============================================================================
.include "boot.asm"
.include "hacks.asm"
.headersize(0x800110A0 - 0xA87000)
.include "loader.asm"
.include "code.asm"
.include "transition.asm"
.org 0x8004BE30
.incbin("../build/loader.z64")
.include "save.asm"
.include "kaleido_scope.asm"
.include "tower.asm"
;==============================================================================
; Fast Block Push
;==============================================================================
.include "fastblock.asm"
;==============================================================================
; More Cutscenes
;==============================================================================
.include "cutscenes.asm"
;==============================================================================
; Misc Hacks - Changes that don't have another home from rando
;==============================================================================
.include "mischacks.asm"
;==============================================================================
; Cutscenes
;==============================================================================
.orga 0xD0FD04
.incbin("../resources/cs/firemedallion.z64")
.orga 0xD13A38
.incbin("../resources/cs/shadowmedallion.z64")
.orga 0xD39CA8
.incbin("../resources/cs/spiritmedallion.z64")
.orga 0xD4EA58
.incbin("../resources/cs/forestmedallion.z64")
.orga 0xD4EA58
.word 0x17 //for matching purposes only
.orga 0xD59538
.incbin("../resources/cs/watermedallion.z64")
.orga 0x20783A0
//non-matching in c generation
.incbin("../resources/cs/kokiriemerald.z64")
.orga 0x2112D10
//non-matching in c generation
.incbin("../resources/cs/zorasapphire.z64")
.orga 0x22210B0
//non-matching in c generation
.incbin("../resources/cs/goronruby.z64")
.orga 0x251107E
.halfword 0x0FFF //change Link's spawn to the default in Chamber of Sages
.orga 0x2511120
.incbin("../resources/cs/lightmedallion.z64")
.orga 0x25314E0
.incbin("../resources/cs/lightarrow.z64")
.orga 0x2AA1A60
.incbin("../resources/cs/ganonlol.z64")
//Goddess Cutscene, which starts at 2AA2890
.orga 0x2AA2BDA
.halfword 1, 2, 2 //set exit command start/end to 1 and 2
.orga 0x2E8DC04
.incbin("../resources/cs/theend.z64")
//Learning Zelda's Lullaby (02E8E524)
.orga 0x2E8E914
.halfword 0x0073 //change exit asm from 33 to 73
;==============================================================================
; Scenes
;==============================================================================
//Kakariko Graveyard
.orga 0x2020000
.incbin("../resources/s/spot02_scene.bin")
.orga 0x202C000
.incbin("../resources/s/spot02_room_0.bin")
.orga 0x202F000
.incbin("../resources/s/spot02_room_1.bin")
//Chamber of Sages
.orga 0x2515039
.byte 7 //set number of actors in chamber of sages to 7
.orga 0x2515070
//deletes actor 0x5D (Warp Portals) from the list of actors to spawn, for cutscene purposes
.incbin("../resources/s/kenjyanoma_room_0_setup_0_actors.bin")
//Temple of Time
//scene
.orga 0x2529094
.word 0, 0, 0x0200CC40 //delete cutscene setups 8 an 9, and make cutscene setup A point to 8
.orga 0x2535C91
.byte 9 //set cutscene A to have 9 environment settings
.skip 2
.word 0x0200CD10 //new environement settings ptr
.orga 0x2535D10
.incbin("../resources/s/tokinoma_scene_setup_E_lighting.bin")
.fill 0x2A, 0 //for matching
//Room 1
.orga 0x2554074
.word 0, 0, 0x030007F0 //delete cutscene setups 8 an 9, and make cutscene setup A point to 8
//Cutscene Setup A
.orga 0x2554819
.byte 10 //number of objects
.skip 2
.word 0x030002F0 //object list offset
.skip 1
.byte 7 //number of actors
.skip 2
.word 0x03000890
.orga 0x2554890
.incbin("../resources/s/tokinoma_room_1_setup_E_actors.bin")
//Ganon's Castle (Exterior)
.orga 0x292B070
.incbin("../resources/s/ganon_tou_scene_spawns.bin")
//Cutscene Map
.orga 0x2AA000F
.byte 0x56 //playback song
//set link's spawn
.orga 0x2AA0080
.halfword 0x0000, 0, 0, 0, 0x0000, 0x8000, 0x0000, 0x03FF
//set room location across setups
.orga 0x2AA0090
.word CUTSCENE_ROOM_0_START, CUTSCENE_ROOM_0_END
.orga 0x2AA3820
.word CUTSCENE_ROOM_0_START, CUTSCENE_ROOM_0_END
.orga 0x2AA38F8
.word CUTSCENE_ROOM_0_START, CUTSCENE_ROOM_0_END
.orga 0x2AA3980
.word CUTSCENE_ROOM_0_START, CUTSCENE_ROOM_0_END
.orga 0x2AA3A10
.word CUTSCENE_ROOM_0_START, CUTSCENE_ROOM_0_END
.orga 0x2AA3AC0
.word CUTSCENE_ROOM_0_START, CUTSCENE_ROOM_0_END
.orga 0x2AA3B58
.word CUTSCENE_ROOM_0_START, CUTSCENE_ROOM_0_END
.orga 0x2AA3BE8
.word CUTSCENE_ROOM_0_START, CUTSCENE_ROOM_0_END
.orga 0x2AA3C70
.word CUTSCENE_ROOM_0_START, CUTSCENE_ROOM_0_END
.orga 0x2AA3D00
.word CUTSCENE_ROOM_0_START, CUTSCENE_ROOM_0_END
//the following are unused
.orga 0x2AA35D0
.word CUTSCENE_ROOM_0_START, CUTSCENE_ROOM_0_END
.orga 0x2AA3690
.word CUTSCENE_ROOM_0_START, CUTSCENE_ROOM_0_END
.orga 0x2AA3750
.word CUTSCENE_ROOM_0_START, CUTSCENE_ROOM_0_END
//cutscene map room 0
.orga 0x2AA4024
.halfword 0x0477 //set current time for the skybox
.orga 0x2AA4031
.byte 3 //num object files
.skip 7
.byte 10 //num actors
.skip 2
.word 0x03000640
//set room 0's object files
.orga 0x2AA4078
.halfword 0x0092, 0x0106, 0x000E
//set room 0's actor spawns
.orga 0x2AA4640
.halfword 0x008C, 158, 149, 315, 0x0000, 0x0000, 0x0000, 0x0000 //Temple of Time Objects, Unknown
.halfword 0x0113, -173, 0, 100, 0x0000, 0x5555, 0x0000, 0xFF03 //Iron Knuckle, Switch Flag: FF, White, standing
.halfword 0x0113, 173, 0, 100, 0x0000, 0xAAAA, 0x0000, 0xFF03 //Iron Knuckle, Switch Flag: FF, White, standing
.halfword 0x0113, 0, 0, -200, 0x0000, 0x0000, 0x0000, 0xFF02 //Iron Knuckle, Switch Flag: FF, Black, standing
.halfword 0x0010, -216, 0, 125, 0x0000, 0x5555, 0x0000, 0x0000 //Bomb
.halfword 0x0010, 216, 0, 125, 0x0000, 0xAAAA, 0x0000, 0x0000 //Bomb
.halfword 0x0010, 0, 0, -250, 0x0000, 0x0000, 0x0000, 0x0000 //Bomb
.halfword 0x000A, -173, 0, 100, 0x0000, 0xD555, 0x0000, 0x1060 //Chest, Large, Appears, Clear Flag, Contents: Bombchu (10), Chest Flag: 0000
.halfword 0x000A, 173, 0, 100, 0x0000, 0x2AAA, 0x0000, 0x1520 //Chest, Large, Appears, Clear Flag, Contents: Deku Shield or blue (5) rupee, Chest Flag: 0000
.halfword 0x000A, 0, 0, -200, 0x0000, 0x8000, 0x0000, 0x1540 //Chest, Large, Appears, Clear Flag, Contents: Hylian Shield or blue (5) rupee, Chest Flag: 0000
//Bongo Bongo's Boss Room
.orga 0x2EC4094
.halfword 0x2B2 //change boss room exit to be a valid exit
;==============================================================================
; Title Screen
;==============================================================================
.orga 0x1795000
.incbin("../resources/version_ia8.bin")
.orga 0x17AE300
.incbin("../resources/copyright_ia8.bin")
.orga 0x17B3C40
.incbin("../resources/beta_quest_i8.bin")
.headersize(0x80AECDF0 - 0xE6C0D0)
.org 0x80AEE558
beql t6, r0, title_screen_draw_dd
.org 0x80AEE56C
title_screen_draw_dd:
.org 0x80AEE6D4
addiu a3, a3, 0x60
.org 0x80AEE6E4
addiu t0, t0, 0x72
;==============================================================================
; Save Game Message textures
;==============================================================================
.orga 0x8409C0
.area 0xA00 + 0xA00 + 0xA00
.incbin("../resources/save_0_4.bin")
.incbin("../resources/save_1_4.bin")
.incbin("../resources/save_2_4.bin")
.endarea
;==============================================================================
; Code Binaries
;==============================================================================
.orga 0x3480000
RAND_START:
.incbin("../build/rand.z64")
RAND_END:
.headersize (0x80400000 - 0x03490000)
.org 0x80400000
.area 0x20000 //payload max memory
PAYLOAD_START:
.area 0x20, 0
RANDO_CONTEXT:
.endarea
.include "config.asm"
.include "init.asm"
.include "every_frame.asm"
.include "dpad.asm"
.include "initial_save.asm"
.align 0x10
.importobj "../build/bundle.o"
.align 8
FONT_TEXTURE:
.incbin("../resources/font.bin")
DPAD_TEXTURE:
.incbin("../resources/dpad.bin")
TRIFORCE_ICON_TEXTURE:
.incbin("../resources/triforce_sprite.bin")
.align 0x10
PAYLOAD_END:
.endarea //payload max memory
;==============================================================================
; Ganon
;==============================================================================
.orga 0xE879CC
addiu t8, r0, 0x400
.orga 0xE879DC
ori t0, r0, 0xFFF0
;==============================================================================
; Grottos
;==============================================================================
.orga 0x020C120E
.halfword 0x10FE
.orga 0x020C1512
.halfword 0x10FE
.orga 0x02103156
.halfword 0x11EA
.orga 0x021034BE
.halfword 0x11EA
.orga 0x021BD49A
.halfword 0x11F1
.orga 0x021BD6DA
.halfword 0x11F1
;==============================================================================
; Unsorted
;==============================================================================
//dialog, probably changed by mistake
.orga 0x8EB00C
.halfword 0x6142
.orga 0xca3174
ori t6, r0, 0xFFF2
.orga 0xcca12c
addiu at, r0, 0x0010
.orga 0xECF8A4 //Inside Ganon's Tower, set flags for completing trials
.word 0xFFFF8960, 0xFFFF8960, 0xFFFF8960, 0xFFFF8960, 0xFFFF8960, 0xFFFF8960
.close | 25.6625 | 162 | 0.589089 |
8663e2ca40e781c6f7b74a06a75d6391569f791d | 1,064 | asm | Assembly | asm/patches/tingle_chests_without_tuner.asm | Crain-32/wwrando | 1832963c7a9339f4f004e7f4b8bee227bfd86f23 | [
"MIT"
] | 284 | 2018-07-05T15:18:18.000Z | 2022-03-28T19:59:03.000Z | asm/patches/tingle_chests_without_tuner.asm | Crain-32/wwrando | 1832963c7a9339f4f004e7f4b8bee227bfd86f23 | [
"MIT"
] | 235 | 2018-07-06T18:39:36.000Z | 2022-03-29T21:09:46.000Z | asm/patches/tingle_chests_without_tuner.asm | Crain-32/wwrando | 1832963c7a9339f4f004e7f4b8bee227bfd86f23 | [
"MIT"
] | 96 | 2018-07-12T02:33:40.000Z | 2022-03-22T05:08:02.000Z |
; Make Tingle Chests respond to normal bombs as well as Tingle Bombs.
.open "files/rels/d_a_agbsw0.rel"
.org 0x1CA4 ; In ExeSubT__10daAgbsw0_cFv
; Skip some checks to see if the Tingle Tuner GBA link is active.
b 0x1CC0
.org 0x1D0C ; In ExeSubT__10daAgbsw0_cFv
; Skip the check that it's a Tingle Bomb specifically.
nop
.close
; Make Tingle Chests appear on the map once you have the compass even if you haven't made the chest appear yet.
; The way the game knows if a chest is a Tingle Chest is by checking the chest's opened flag.
; The five Tingle Statue Chests all have 0xF for their opened flags.
; The yellow rupee Tingle Chest in DRC has 0x10 for its flag.
; Remove the checks that cause the icon to be hidden if the opened flag is 0xF or 0x10.
.open "sys/main.dol"
.org 0x801A9F8C ; In treasureSet__12dMenu_Dmap_cFv
; Skip over the two opened flag checks when drawing the big map.
b 0x801A9F9C
.org 0x8004C68C ; In drawPointGc__6dMap_cFUcfffScsUcUcUcUc
; Skip over the two opened flag checks when drawing the minimap.
b 0x8004C69C
.close
| 42.56 | 111 | 0.770677 |
63f033bdc298da43e7fb9a9024346599a6d5f520 | 552 | asm | Assembly | src/tests/spectre_v1.1.asm | mguarnieri/revizor | a3d91b19d91bcc9a266b7f10e5b9631906ebfedd | [
"MIT"
] | 29 | 2021-05-24T12:45:19.000Z | 2022-03-16T16:53:10.000Z | src/tests/spectre_v1.1.asm | mguarnieri/revizor | a3d91b19d91bcc9a266b7f10e5b9631906ebfedd | [
"MIT"
] | 3 | 2021-11-23T15:37:25.000Z | 2022-01-24T12:01:44.000Z | src/tests/spectre_v1.1.asm | mguarnieri/revizor | a3d91b19d91bcc9a266b7f10e5b9631906ebfedd | [
"MIT"
] | 3 | 2021-06-17T09:00:27.000Z | 2022-03-28T03:42:01.000Z | .intel_syntax noprefix
LFENCE
# reduce the entropy of rax
AND rax, 0b111111000000
# delay the cond. jump
MOV r15, 0
LEA rbx, [rbx + r15 + 1]
LEA rbx, [rbx + r15 - 1]
LEA rbx, [rbx + r15 + 1]
LEA rbx, [rbx + r15 - 1]
LEA rbx, [rbx + r15 + 1]
LEA rbx, [rbx + r15 - 1]
LEA rbx, [rbx + r15 + 1]
LEA rbx, [rbx + r15 - 1]
LEA rbx, [rbx + r15 + 1]
LEA rbx, [rbx + r15 - 1]
# reduce the entropy in rbx
AND rbx, 0b1000000
CMP rbx, 0
JE .l1 # misprediction
# rbx != 0
MOV qword ptr [r14], rax
MOV rbx, [r14]
MOV rbx, [r14 + rbx]
.l1:
MFENCE
| 17.806452 | 28 | 0.597826 |
8b15db78d4972c0a278da677be937f1e8ff8e522 | 3,358 | asm | Assembly | base/ntos/lpc/i386/lpcmove.asm | npocmaka/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 17 | 2020-11-13T13:42:52.000Z | 2021-09-16T09:13:13.000Z | base/ntos/lpc/i386/lpcmove.asm | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 2 | 2020-10-19T08:02:06.000Z | 2020-10-19T08:23:18.000Z | base/ntos/lpc/i386/lpcmove.asm | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 14 | 2020-11-14T09:43:20.000Z | 2021-08-28T08:59:57.000Z | title "LPC Move Message Support"
;++
;
; Copyright (c) 1989 Microsoft Corporation
;
; Module Name:
;
; lpcmove.asm
;
; Abstract:
;
; This module implements functions to support the efficient movement of
; LPC Message blocks
;
; Author:
;
; Steven R. Wood (stevewo) 30-Jun-1989
;
; Environment:
;
; Kernel mode only.
;
; Revision History:
;
; 6-Mar-90 bryanwi
; Ported to the 386.
;
;--
.386p
include callconv.inc ; calling convention macros
page ,132
subttl "Update System Time"
_PAGE SEGMENT DWORD PUBLIC 'CODE'
ASSUME DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING
;++
;
; VOID
; LpcpMoveMessage (
; OUT PPORT_MESSAGE DstMsg
; IN PPORT_MESSAGE SrcMsg
; IN ULONG MsgType OPTIONAL,
; IN PCLIENT_ID ClientId OPTIONAL
; )
;
; Routine Description:
;
; This function moves an LPC message block.
;
; Arguments:
;
; DstMsg (TOS) - Supplies pointer to where to move the message block to.
;
; SrcMsg (TOS+4) - Supplies a pointer to the message to move.
;
; MsgType (TOS+8) - If non-zero, then store in Type field of DstMsg
;
; ClientId (TOS+12) - If non-NULL, then points to a ClientId to copy to dst
;
; Return Value:
;
; None
;
;--
DstMsg equ [esp + 12]
SrcMsg equ [esp + 16]
SrcMsgData equ [esp + 20]
MsgType equ [esp + 24]
ClientId equ [esp + 28]
cPublicProc _LpcpMoveMessage ,5
push esi ; Save non-volatile registers
push edi
mov edi,DstMsg ; (edi)->Destination
cld
mov esi,SrcMsg ; (esi)->Source
lodsd ; (eax)=length
stosd
lea ecx,3[eax]
and ecx,0FFFCH ; (ecx)=length rounded up to 4
shr ecx,2 ; (ecx)=length in dwords
lodsd ; (eax)=DataInfoOffset U Type
mov edx,MsgType ; (edx)=MsgType
or edx,edx
jz lmm10 ; No MsgType, go do straight copy
mov ax,dx ; (eax low 16)=MsgType
lmm10: stosd
mov edx,ClientId ; (edx)=ClientId
or edx,edx
jz lmm20 ; No Clientid to set, go do copy
mov eax,[edx] ; Get new ClientId
stosd ; and store in DstMsg->ClientId
mov eax,[edx+4]
stosd
add esi,8 ; and skip over SrcMsg->ClientId
jmp short lmm30
lmm20: movsd ; Copy ClientId
movsd
;
; At this point, all of the control structures are copied, all we
; need to copy is the data.
;
lmm30:
movsd ; Copy MessageId
movsd ; Copy ClientViewSize
mov esi,SrcMsgData ; Copy data directly from user buffer
rep movsd ; Copy the data portion of message
pop edi
pop esi ; Restore non-volatile registers
stdRET _LpcpMoveMessage
stdENDP _LpcpMoveMessage
_PAGE ends
end
| 25.24812 | 79 | 0.504169 |
5ca0404f785cc39e3d5d2029a97c46c32040b5fc | 397 | asm | Assembly | oeis/091/A091918.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/091/A091918.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/091/A091918.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A091918: Inverse of number triangle A091917.
; Submitted by Christian Krause
; 1,2,1,4,2,1,8,3,3,1,16,4,6,4,1,32,5,10,10,5,1,64,6,15,20,15,6,1,128,7,21,35,35,21,7,1,256,8,28,56,70,56,28,8,1,512,9,36,84,126,126,84,36,9,1,1024,10,45,120,210,252,210,120,45,10,1,2048,11,55,165,330,462,462,330
lpb $0
add $1,1
sub $0,$1
mov $2,$1
lpe
bin $1,$0
cmp $0,0
add $0,1
pow $0,$2
mul $1,$0
mov $0,$1
| 24.8125 | 212 | 0.634761 |
54e455d3d46102fabb224cb609a6bee959a4a043 | 466 | asm | Assembly | programs/oeis/000/A000040.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/000/A000040.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/000/A000040.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A000040: The prime numbers.
; 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541
seq $0,6005 ; The odd prime numbers together with 1.
max $0,2
| 77.666667 | 372 | 0.723176 |
494ca79b0ac6c21d625264b2875254acad732d79 | 589 | asm | Assembly | programs/oeis/314/A314220.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/314/A314220.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/314/A314220.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A314220: Coordination sequence Gal.5.306.1 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
; 1,5,11,17,22,28,34,39,45,51,56,61,67,73,78,84,90,95,101,107,112,117,123,129,134,140,146,151,157,163,168,173,179,185,190,196,202,207,213,219,224,229,235,241,246,252,258,263,269,275
mov $2,$0
add $2,1
mov $4,$0
lpb $2,1
mov $0,$4
sub $2,1
sub $0,$2
mov $3,$0
add $3,$0
add $0,$3
lpb $0,1
lpb $0,1
mod $0,10
lpe
div $0,4
add $0,4
lpe
mov $3,$0
add $3,1
add $1,$3
lpe
| 23.56 | 181 | 0.628183 |
1df0e3b8dcb7fbd2edea5d5de5f163fa77f5f363 | 8,274 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0x48.log_21829_2631.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0x48.log_21829_2631.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0x48.log_21829_2631.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r12
push %r15
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x64bd, %rbp
nop
nop
cmp $27682, %r15
mov $0x6162636465666768, %r11
movq %r11, %xmm5
vmovups %ymm5, (%rbp)
add $15967, %r10
lea addresses_WC_ht+0xd01d, %rsi
lea addresses_normal_ht+0x1eebd, %rdi
nop
nop
inc %r12
mov $116, %rcx
rep movsq
nop
nop
nop
nop
and %r12, %r12
lea addresses_WC_ht+0x82bd, %r11
nop
nop
add %rsi, %rsi
mov $0x6162636465666768, %rcx
movq %rcx, %xmm3
movups %xmm3, (%r11)
nop
nop
nop
xor $21712, %rdi
lea addresses_A_ht+0x1c69d, %rsi
lea addresses_D_ht+0x17cbd, %rdi
nop
nop
cmp %r15, %r15
mov $33, %rcx
rep movsl
nop
nop
xor %rsi, %rsi
lea addresses_A_ht+0xf0ef, %rsi
lea addresses_WT_ht+0xe9bd, %rdi
clflush (%rsi)
nop
nop
xor %rbp, %rbp
mov $110, %rcx
rep movsq
nop
nop
nop
and $37112, %r12
lea addresses_A_ht+0x1eea5, %rdi
clflush (%rdi)
nop
nop
nop
xor $39212, %rbp
mov $0x6162636465666768, %r11
movq %r11, (%rdi)
sub $22782, %rsi
lea addresses_D_ht+0xe66d, %r12
nop
nop
nop
and %r15, %r15
vmovups (%r12), %ymm3
vextracti128 $1, %ymm3, %xmm3
vpextrq $1, %xmm3, %r10
nop
nop
nop
nop
sub $38449, %rdi
lea addresses_UC_ht+0x8c09, %r15
nop
xor %r10, %r10
mov $0x6162636465666768, %rcx
movq %rcx, (%r15)
nop
nop
nop
nop
nop
inc %rdi
lea addresses_A_ht+0xfea6, %r12
cmp $39012, %rcx
mov $0x6162636465666768, %rdi
movq %rdi, (%r12)
nop
inc %rcx
lea addresses_normal_ht+0x493d, %r12
nop
cmp %rdi, %rdi
mov (%r12), %rcx
nop
nop
nop
nop
xor $34144, %rbp
lea addresses_UC_ht+0xb6bd, %r12
and %r10, %r10
mov (%r12), %di
nop
nop
nop
nop
nop
xor $48019, %r10
lea addresses_A_ht+0x1cdbd, %rdi
nop
nop
nop
nop
inc %rcx
mov (%rdi), %bp
xor $29557, %r12
lea addresses_A_ht+0x135bd, %rsi
lea addresses_A_ht+0x39bd, %rdi
nop
nop
nop
nop
dec %r12
mov $116, %rcx
rep movsl
and $47652, %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r15
pop %r12
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r14
push %r9
push %rax
push %rbp
push %rbx
push %rdx
// Store
lea addresses_WC+0xd9bd, %r14
nop
nop
sub %r9, %r9
movb $0x51, (%r14)
sub $48834, %rdx
// Load
lea addresses_WT+0x1d35d, %rax
add $56283, %rbx
movups (%rax), %xmm6
vpextrq $1, %xmm6, %rbp
nop
nop
nop
nop
nop
add $16923, %rbx
// Load
lea addresses_A+0x15abd, %r13
add $34751, %rdx
mov (%r13), %r9w
nop
nop
nop
nop
and %r14, %r14
// Store
lea addresses_UC+0x8abd, %rbp
nop
nop
nop
nop
nop
xor $21282, %rax
mov $0x5152535455565758, %r13
movq %r13, (%rbp)
nop
nop
cmp %r9, %r9
// Faulty Load
lea addresses_UC+0x13abd, %r14
nop
nop
nop
nop
nop
inc %rbp
movb (%r14), %bl
lea oracles, %r13
and $0xff, %rbx
shlq $12, %rbx
mov (%r13,%rbx,1), %rbx
pop %rdx
pop %rbx
pop %rbp
pop %rax
pop %r9
pop %r14
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': True, 'congruent': 0, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 8, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 5, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 11, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 7, 'size': 8, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': True}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 7, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 11, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 9, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 2, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 4, 'size': 32, 'same': True, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 1, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 0, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 6, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 9, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 8, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 7, 'same': False}}
{'58': 21829}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
| 32.833333 | 2,999 | 0.654339 |
b52cea88a2f0f7e087c10adab32b5ccfa38117e1 | 550 | asm | Assembly | ASM_MSVC/log10.asm | Atari2/ARLib | fff1d1b8cf226f3a186815e88f1d9c5c91c3a0af | [
"BSD-2-Clause"
] | null | null | null | ASM_MSVC/log10.asm | Atari2/ARLib | fff1d1b8cf226f3a186815e88f1d9c5c91c3a0af | [
"BSD-2-Clause"
] | null | null | null | ASM_MSVC/log10.asm | Atari2/ARLib | fff1d1b8cf226f3a186815e88f1d9c5c91c3a0af | [
"BSD-2-Clause"
] | null | null | null | TITLE log.obj
public arlib_log10
_TEXT SEGMENT
.data
one_cst dq 1.0
limit_cst dq 0.26
.code
arlib_log10 proc x: mmword
fldlg2
movq x, xmm0
fld x
fxam
fnstsw ax
fld st
sahf
jc $L3
$L4:
fsub one_cst
fld st
fabs
fcomp limit_cst
fnstsw ax
and ah, 45h
jz $L2
fxam
fnstsw ax
and ah, 45h
cmp ah, 40h
jne $L5
fabs
$L5:
fstp st(1)
fyl2xp1
fst x
movq xmm0, x
ret
$L2:
fstp st(0)
fyl2x
fst x
movq xmm0, x
ret
$L3:
jp $L4
fst x
movq xmm0, x
fstp st(1)
fstp st(1)
ret
arlib_log10 endp
_TEXT ENDS
END | 10.185185 | 26 | 0.649091 |
6d4544c4dc929a410089ed2023b7b6e72e0b7494 | 515 | asm | Assembly | includes/std_routines.asm | Al-Nafuur/batari-Basic | 9988745b6f1879730e6a8c83e7d21deb106e091a | [
"CC0-1.0"
] | 47 | 2020-01-20T00:52:34.000Z | 2022-02-04T01:21:23.000Z | includes/std_routines.asm | Al-Nafuur/batari-Basic | 9988745b6f1879730e6a8c83e7d21deb106e091a | [
"CC0-1.0"
] | 5 | 2020-03-08T10:37:24.000Z | 2021-03-25T15:50:50.000Z | includes/std_routines.asm | Al-Nafuur/batari-Basic | 9988745b6f1879730e6a8c83e7d21deb106e091a | [
"CC0-1.0"
] | 10 | 2020-02-23T08:09:59.000Z | 2022-03-12T07:45:02.000Z | ; Provided under the CC0 license. See the included LICENSE.txt for details.
;standard routines needed for pretty much all games
; just the random number generator is left - maybe we should remove this asm file altogether?
; repositioning code and score pointer setup moved to overscan
; read switches, joysticks now compiler generated (more efficient)
randomize
lda rand
lsr
ifconst rand16
rol rand16
endif
bcc noeor
eor #$B4
noeor
sta rand
ifconst rand16
eor rand16
endif
RETURN
| 23.409091 | 94 | 0.751456 |
cf8da9de72a94cb5b6659f668843703bd71725ad | 598 | asm | Assembly | programs/oeis/325/A325909.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/325/A325909.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/325/A325909.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A325909: Lexicographically earliest sequence of distinct positive terms such that for any n > 0, n divides Sum_{k = 1..n} (-1)^k * a(k).
; 1,3,2,4,9,5,7,15,8,10,21,11,13,27,14,16,33,17,19,39,20,22,45,23,25,51,26,28,57,29,31,63,32,34,69,35,37,75,38,40,81,41,43,87,44,46,93,47,49,99,50,52,105,53,55,111,56,58,117,59,61,123,62,64,129,65
add $0,5
mov $1,$0
add $1,$0
mov $2,$0
mov $4,$0
sub $4,3
mov $5,3
lpb $2
mov $3,$5
lpb $4
sub $1,3
trn $4,$3
lpe
mov $6,$0
lpb $6
add $4,3
add $1,$4
mov $3,$2
mov $2,$1
sub $2,5
sub $6,$3
lpe
sub $2,1
lpe
sub $1,9
| 20.62069 | 196 | 0.573579 |
5f9dfcabeeb615368d93d850188db15e650a3690 | 747 | asm | Assembly | programs/oeis/303/A303298.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/303/A303298.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/303/A303298.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A303298: Generalized 21-gonal (or icosihenagonal) numbers: m*(19*m - 17)/2 with m = 0, +1, -1, +2, -2, +3, -3, ...
; 0,1,18,21,55,60,111,118,186,195,280,291,393,406,525,540,676,693,846,865,1035,1056,1243,1266,1470,1495,1716,1743,1981,2010,2265,2296,2568,2601,2890,2925,3231,3268,3591,3630,3970,4011,4368,4411,4785,4830,5221,5268,5676,5725,6150,6201,6643,6696,7155,7210,7686,7743,8236,8295,8805,8866,9393,9456,10000,10065,10626,10693,11271,11340,11935,12006,12618,12691,13320,13395,14041,14118,14781,14860,15540,15621,16318,16401,17115,17200,17931,18018,18766,18855,19620,19711,20493,20586,21385,21480,22296,22393,23226,23325
lpb $0
mov $2,$0
sub $0,1
seq $2,317317 ; Multiples of 17 and odd numbers interleaved.
add $1,$2
lpe
mov $0,$1
| 67.909091 | 509 | 0.73494 |
99b295844c3eb486faab675f0754a3c9f6a0c2ef | 709 | asm | Assembly | programs/oeis/010/A010005.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/010/A010005.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/010/A010005.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A010005: a(0) = 1, a(n) = 15*n^2 + 2 for n>0.
; 1,17,62,137,242,377,542,737,962,1217,1502,1817,2162,2537,2942,3377,3842,4337,4862,5417,6002,6617,7262,7937,8642,9377,10142,10937,11762,12617,13502,14417,15362,16337,17342,18377,19442,20537,21662,22817,24002,25217,26462,27737,29042,30377,31742,33137,34562,36017,37502,39017,40562,42137,43742,45377,47042,48737,50462,52217,54002,55817,57662,59537,61442,63377,65342,67337,69362,71417,73502,75617,77762,79937,82142,84377,86642,88937,91262,93617,96002,98417,100862,103337,105842,108377,110942,113537,116162,118817,121502,124217,126962,129737,132542,135377,138242,141137,144062,147017
pow $1,$0
gcd $1,2
mov $3,$0
mul $3,$0
mov $2,$3
mul $2,15
add $1,$2
mov $0,$1
| 59.083333 | 580 | 0.764457 |
7dea4f8c1bf9e934e80d3d926685752839d2cf7f | 337 | asm | Assembly | programs/oeis/003/A003177.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/003/A003177.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/003/A003177.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A003177: a(n) = ceiling(24(2^n-1)/n).
; 24,36,56,90,149,252,436,765,1363,2456,4467,8190,15122,28086,52428,98303,185042,349524,662258,1258290,2396744,4575604,8753330,16777215,32212254,61946643,119304647,230087533
mov $2,$0
add $2,1
cal $0,248877 ; a(1) = 23, a(2) = 71, a(n) = 3*a(n-1) - 2*a(n-2) for n>2.
div $0,$2
mov $1,$0
add $1,1
| 33.7 | 173 | 0.664688 |
fb294726e70dd65408d5e8312883f9c5776ed1b7 | 278 | asm | Assembly | Print dialog box/print_dialogbox_float.asm | berkcetinsaya/MIPSLanguageExamples | e1ec7ae15a38621e09fcf211f033497c495ee06b | [
"Apache-2.0"
] | null | null | null | Print dialog box/print_dialogbox_float.asm | berkcetinsaya/MIPSLanguageExamples | e1ec7ae15a38621e09fcf211f033497c495ee06b | [
"Apache-2.0"
] | null | null | null | Print dialog box/print_dialogbox_float.asm | berkcetinsaya/MIPSLanguageExamples | e1ec7ae15a38621e09fcf211f033497c495ee06b | [
"Apache-2.0"
] | null | null | null | .data
message: .asciiz "This is a message\n"
number: .float 50.0
.text
la $a0, message # general message to print will be loaded to $a0
lwc1 $f12, number # float number to print will be loaded to $f12
addi $v0, $zero, 57 # service 57 to display a float dialog box
syscall | 34.75 | 66 | 0.71223 |
cbb55097d4c22e7cfb145b9310741130ceca5a78 | 642 | asm | Assembly | oeis/256/A256314.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/256/A256314.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/256/A256314.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A256314: Number of partitions of 3n into exactly 5 parts.
; 0,0,1,5,13,30,57,101,164,255,377,540,748,1014,1342,1747,2233,2818,3507,4319,5260,6351,7599,9027,10642,12470,14518,16814,19366,22204,25337,28796,32591,36756,41301,46262,51649,57501,63829,70673,78045,85987,94512,103664,113456,123935,135114,147042,159733,173238,187572,202787,218899,235963,253995,273052,293150,314349,336666,360162,384855,410808,438040,466616,496555,527925,560745,595085,630965,668457,707582,748413,790972,835335,881524,929617,979636,1031662,1085718,1141886,1200190,1260714,1323483
mul $0,3
seq $0,26811 ; Number of partitions of n in which the greatest part is 5.
| 107 | 497 | 0.808411 |
c777ae9c1b090b3cbb9eb070c1dc05194e648c41 | 795 | asm | Assembly | oeis/104/A104629.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/104/A104629.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/104/A104629.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A104629: Expansion of (1-2*x-sqrt(1-4*x))/(x^2 * (1+2*x+sqrt(1-4*x))).
; Submitted by Christian Krause
; 1,2,6,18,57,186,622,2120,7338,25724,91144,325878,1174281,4260282,15548694,57048048,210295326,778483932,2892818244,10786724388,40347919626,151355847012,569274150156,2146336125648,8110508473252,30711521221376,116518215264492,442862000693438,1686062250699433,6429286894263738,24552388991392230,93891870710425440,359526085719652662,1378379704593824300,5290709340633314596,20330047491994213884,78201907647506243758,301111732041234778316,1160507655117628665252,4476705468260134734384
mov $2,$0
add $2,1
mov $3,$0
add $3,2
lpb $2
mov $0,$3
sub $2,1
sub $0,$2
seq $0,108 ; Catalan numbers: C(n) = binomial(2n,n)/(n+1) = (2n)!/(n!(n+1)!).
mul $1,-1
add $1,$0
div $1,2
lpe
mov $0,$1
| 41.842105 | 479 | 0.763522 |
7da87dd5d456bd44693b6ba2194a230da325815c | 183 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/math32/lm32/c/sccz80/l_f32_ge.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/math/float/math32/lm32/c/sccz80/l_f32_ge.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/math/float/math32/lm32/c/sccz80/l_f32_ge.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
SECTION code_fp_math32
PUBLIC l_f32_ge
EXTERN m32_compare_callee
.l_f32_ge
call m32_compare_callee
ccf
ret C
scf
ret Z
ccf
dec hl
ret
| 11.4375 | 30 | 0.622951 |
e105b1ede22bb0a7acf4ec3866a0885c4bc154bd | 319 | asm | Assembly | data/mapHeaders/CeruleanTrashedHouse.asm | AmateurPanda92/pokemon-rby-dx | f7ba1cc50b22d93ed176571e074a52d73360da93 | [
"MIT"
] | 9 | 2020-07-12T19:44:21.000Z | 2022-03-03T23:32:40.000Z | data/mapHeaders/CeruleanTrashedHouse.asm | JStar-debug2020/pokemon-rby-dx | c2fdd8145d96683addbd8d9075f946a68d1527a1 | [
"MIT"
] | 7 | 2020-07-16T10:48:52.000Z | 2021-01-28T18:32:02.000Z | data/mapHeaders/CeruleanTrashedHouse.asm | JStar-debug2020/pokemon-rby-dx | c2fdd8145d96683addbd8d9075f946a68d1527a1 | [
"MIT"
] | 2 | 2021-03-28T18:33:43.000Z | 2021-05-06T13:12:09.000Z | CeruleanTrashedHouse_h:
db HOUSE ; tileset
db CERULEAN_TRASHED_HOUSE_HEIGHT, CERULEAN_TRASHED_HOUSE_WIDTH ; dimensions (y, x)
dw CeruleanTrashedHouse_Blocks ; blocks
dw CeruleanTrashedHouse_TextPointers ; texts
dw CeruleanTrashedHouse_Script ; scripts
db 0 ; connections
dw CeruleanTrashedHouse_Object ; objects
| 35.444444 | 83 | 0.840125 |
3d301454668c59717628753dcc26694cc9a5f807 | 41,137 | asm | Assembly | rm.asm | TusharGupta01/XV6 | d365413bcf8fbb190063548c0fa477dc57f2b98b | [
"MIT"
] | null | null | null | rm.asm | TusharGupta01/XV6 | d365413bcf8fbb190063548c0fa477dc57f2b98b | [
"MIT"
] | null | null | null | rm.asm | TusharGupta01/XV6 | d365413bcf8fbb190063548c0fa477dc57f2b98b | [
"MIT"
] | 1 | 2018-03-14T14:09:08.000Z | 2018-03-14T14:09:08.000Z |
_rm: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
#include "stat.h"
#include "user.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: 83 ec 20 sub $0x20,%esp
int i;
if(argc < 2){
9: 83 7d 08 01 cmpl $0x1,0x8(%ebp)
d: 7f 19 jg 28 <main+0x28>
printf(2, "Usage: rm files...\n");
f: c7 44 24 04 4b 08 00 movl $0x84b,0x4(%esp)
16: 00
17: c7 04 24 02 00 00 00 movl $0x2,(%esp)
1e: e8 5c 04 00 00 call 47f <printf>
exit();
23: e8 cf 02 00 00 call 2f7 <exit>
}
for(i = 1; i < argc; i++){
28: c7 44 24 1c 01 00 00 movl $0x1,0x1c(%esp)
2f: 00
30: eb 4f jmp 81 <main+0x81>
if(unlink(argv[i]) < 0){
32: 8b 44 24 1c mov 0x1c(%esp),%eax
36: 8d 14 85 00 00 00 00 lea 0x0(,%eax,4),%edx
3d: 8b 45 0c mov 0xc(%ebp),%eax
40: 01 d0 add %edx,%eax
42: 8b 00 mov (%eax),%eax
44: 89 04 24 mov %eax,(%esp)
47: e8 fb 02 00 00 call 347 <unlink>
4c: 85 c0 test %eax,%eax
4e: 79 2c jns 7c <main+0x7c>
printf(2, "rm: %s failed to delete\n", argv[i]);
50: 8b 44 24 1c mov 0x1c(%esp),%eax
54: 8d 14 85 00 00 00 00 lea 0x0(,%eax,4),%edx
5b: 8b 45 0c mov 0xc(%ebp),%eax
5e: 01 d0 add %edx,%eax
60: 8b 00 mov (%eax),%eax
62: 89 44 24 08 mov %eax,0x8(%esp)
66: c7 44 24 04 5f 08 00 movl $0x85f,0x4(%esp)
6d: 00
6e: c7 04 24 02 00 00 00 movl $0x2,(%esp)
75: e8 05 04 00 00 call 47f <printf>
break;
7a: eb 0e jmp 8a <main+0x8a>
if(argc < 2){
printf(2, "Usage: rm files...\n");
exit();
}
for(i = 1; i < argc; i++){
7c: 83 44 24 1c 01 addl $0x1,0x1c(%esp)
81: 8b 44 24 1c mov 0x1c(%esp),%eax
85: 3b 45 08 cmp 0x8(%ebp),%eax
88: 7c a8 jl 32 <main+0x32>
printf(2, "rm: %s failed to delete\n", argv[i]);
break;
}
}
exit();
8a: e8 68 02 00 00 call 2f7 <exit>
0000008f <stosb>:
"cc");
}
static inline void
stosb(void *addr, int data, int cnt)
{
8f: 55 push %ebp
90: 89 e5 mov %esp,%ebp
92: 57 push %edi
93: 53 push %ebx
asm volatile("cld; rep stosb" :
94: 8b 4d 08 mov 0x8(%ebp),%ecx
97: 8b 55 10 mov 0x10(%ebp),%edx
9a: 8b 45 0c mov 0xc(%ebp),%eax
9d: 89 cb mov %ecx,%ebx
9f: 89 df mov %ebx,%edi
a1: 89 d1 mov %edx,%ecx
a3: fc cld
a4: f3 aa rep stos %al,%es:(%edi)
a6: 89 ca mov %ecx,%edx
a8: 89 fb mov %edi,%ebx
aa: 89 5d 08 mov %ebx,0x8(%ebp)
ad: 89 55 10 mov %edx,0x10(%ebp)
"=D" (addr), "=c" (cnt) :
"0" (addr), "1" (cnt), "a" (data) :
"memory", "cc");
}
b0: 5b pop %ebx
b1: 5f pop %edi
b2: 5d pop %ebp
b3: c3 ret
000000b4 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, char *t)
{
b4: 55 push %ebp
b5: 89 e5 mov %esp,%ebp
b7: 83 ec 10 sub $0x10,%esp
char *os;
os = s;
ba: 8b 45 08 mov 0x8(%ebp),%eax
bd: 89 45 fc mov %eax,-0x4(%ebp)
while((*s++ = *t++) != 0)
c0: 90 nop
c1: 8b 45 08 mov 0x8(%ebp),%eax
c4: 8d 50 01 lea 0x1(%eax),%edx
c7: 89 55 08 mov %edx,0x8(%ebp)
ca: 8b 55 0c mov 0xc(%ebp),%edx
cd: 8d 4a 01 lea 0x1(%edx),%ecx
d0: 89 4d 0c mov %ecx,0xc(%ebp)
d3: 0f b6 12 movzbl (%edx),%edx
d6: 88 10 mov %dl,(%eax)
d8: 0f b6 00 movzbl (%eax),%eax
db: 84 c0 test %al,%al
dd: 75 e2 jne c1 <strcpy+0xd>
;
return os;
df: 8b 45 fc mov -0x4(%ebp),%eax
}
e2: c9 leave
e3: c3 ret
000000e4 <strcmp>:
int
strcmp(const char *p, const char *q)
{
e4: 55 push %ebp
e5: 89 e5 mov %esp,%ebp
while(*p && *p == *q)
e7: eb 08 jmp f1 <strcmp+0xd>
p++, q++;
e9: 83 45 08 01 addl $0x1,0x8(%ebp)
ed: 83 45 0c 01 addl $0x1,0xc(%ebp)
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
f1: 8b 45 08 mov 0x8(%ebp),%eax
f4: 0f b6 00 movzbl (%eax),%eax
f7: 84 c0 test %al,%al
f9: 74 10 je 10b <strcmp+0x27>
fb: 8b 45 08 mov 0x8(%ebp),%eax
fe: 0f b6 10 movzbl (%eax),%edx
101: 8b 45 0c mov 0xc(%ebp),%eax
104: 0f b6 00 movzbl (%eax),%eax
107: 38 c2 cmp %al,%dl
109: 74 de je e9 <strcmp+0x5>
p++, q++;
return (uchar)*p - (uchar)*q;
10b: 8b 45 08 mov 0x8(%ebp),%eax
10e: 0f b6 00 movzbl (%eax),%eax
111: 0f b6 d0 movzbl %al,%edx
114: 8b 45 0c mov 0xc(%ebp),%eax
117: 0f b6 00 movzbl (%eax),%eax
11a: 0f b6 c0 movzbl %al,%eax
11d: 29 c2 sub %eax,%edx
11f: 89 d0 mov %edx,%eax
}
121: 5d pop %ebp
122: c3 ret
00000123 <strlen>:
uint
strlen(char *s)
{
123: 55 push %ebp
124: 89 e5 mov %esp,%ebp
126: 83 ec 10 sub $0x10,%esp
int n;
for(n = 0; s[n]; n++)
129: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
130: eb 04 jmp 136 <strlen+0x13>
132: 83 45 fc 01 addl $0x1,-0x4(%ebp)
136: 8b 55 fc mov -0x4(%ebp),%edx
139: 8b 45 08 mov 0x8(%ebp),%eax
13c: 01 d0 add %edx,%eax
13e: 0f b6 00 movzbl (%eax),%eax
141: 84 c0 test %al,%al
143: 75 ed jne 132 <strlen+0xf>
;
return n;
145: 8b 45 fc mov -0x4(%ebp),%eax
}
148: c9 leave
149: c3 ret
0000014a <memset>:
void*
memset(void *dst, int c, uint n)
{
14a: 55 push %ebp
14b: 89 e5 mov %esp,%ebp
14d: 83 ec 0c sub $0xc,%esp
stosb(dst, c, n);
150: 8b 45 10 mov 0x10(%ebp),%eax
153: 89 44 24 08 mov %eax,0x8(%esp)
157: 8b 45 0c mov 0xc(%ebp),%eax
15a: 89 44 24 04 mov %eax,0x4(%esp)
15e: 8b 45 08 mov 0x8(%ebp),%eax
161: 89 04 24 mov %eax,(%esp)
164: e8 26 ff ff ff call 8f <stosb>
return dst;
169: 8b 45 08 mov 0x8(%ebp),%eax
}
16c: c9 leave
16d: c3 ret
0000016e <strchr>:
char*
strchr(const char *s, char c)
{
16e: 55 push %ebp
16f: 89 e5 mov %esp,%ebp
171: 83 ec 04 sub $0x4,%esp
174: 8b 45 0c mov 0xc(%ebp),%eax
177: 88 45 fc mov %al,-0x4(%ebp)
for(; *s; s++)
17a: eb 14 jmp 190 <strchr+0x22>
if(*s == c)
17c: 8b 45 08 mov 0x8(%ebp),%eax
17f: 0f b6 00 movzbl (%eax),%eax
182: 3a 45 fc cmp -0x4(%ebp),%al
185: 75 05 jne 18c <strchr+0x1e>
return (char*)s;
187: 8b 45 08 mov 0x8(%ebp),%eax
18a: eb 13 jmp 19f <strchr+0x31>
}
char*
strchr(const char *s, char c)
{
for(; *s; s++)
18c: 83 45 08 01 addl $0x1,0x8(%ebp)
190: 8b 45 08 mov 0x8(%ebp),%eax
193: 0f b6 00 movzbl (%eax),%eax
196: 84 c0 test %al,%al
198: 75 e2 jne 17c <strchr+0xe>
if(*s == c)
return (char*)s;
return 0;
19a: b8 00 00 00 00 mov $0x0,%eax
}
19f: c9 leave
1a0: c3 ret
000001a1 <gets>:
char*
gets(char *buf, int max)
{
1a1: 55 push %ebp
1a2: 89 e5 mov %esp,%ebp
1a4: 83 ec 28 sub $0x28,%esp
int i, cc;
char c;
for(i=0; i+1 < max; ){
1a7: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
1ae: eb 4c jmp 1fc <gets+0x5b>
cc = read(0, &c, 1);
1b0: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
1b7: 00
1b8: 8d 45 ef lea -0x11(%ebp),%eax
1bb: 89 44 24 04 mov %eax,0x4(%esp)
1bf: c7 04 24 00 00 00 00 movl $0x0,(%esp)
1c6: e8 44 01 00 00 call 30f <read>
1cb: 89 45 f0 mov %eax,-0x10(%ebp)
if(cc < 1)
1ce: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
1d2: 7f 02 jg 1d6 <gets+0x35>
break;
1d4: eb 31 jmp 207 <gets+0x66>
buf[i++] = c;
1d6: 8b 45 f4 mov -0xc(%ebp),%eax
1d9: 8d 50 01 lea 0x1(%eax),%edx
1dc: 89 55 f4 mov %edx,-0xc(%ebp)
1df: 89 c2 mov %eax,%edx
1e1: 8b 45 08 mov 0x8(%ebp),%eax
1e4: 01 c2 add %eax,%edx
1e6: 0f b6 45 ef movzbl -0x11(%ebp),%eax
1ea: 88 02 mov %al,(%edx)
if(c == '\n' || c == '\r')
1ec: 0f b6 45 ef movzbl -0x11(%ebp),%eax
1f0: 3c 0a cmp $0xa,%al
1f2: 74 13 je 207 <gets+0x66>
1f4: 0f b6 45 ef movzbl -0x11(%ebp),%eax
1f8: 3c 0d cmp $0xd,%al
1fa: 74 0b je 207 <gets+0x66>
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
1fc: 8b 45 f4 mov -0xc(%ebp),%eax
1ff: 83 c0 01 add $0x1,%eax
202: 3b 45 0c cmp 0xc(%ebp),%eax
205: 7c a9 jl 1b0 <gets+0xf>
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
207: 8b 55 f4 mov -0xc(%ebp),%edx
20a: 8b 45 08 mov 0x8(%ebp),%eax
20d: 01 d0 add %edx,%eax
20f: c6 00 00 movb $0x0,(%eax)
return buf;
212: 8b 45 08 mov 0x8(%ebp),%eax
}
215: c9 leave
216: c3 ret
00000217 <stat>:
int
stat(char *n, struct stat *st)
{
217: 55 push %ebp
218: 89 e5 mov %esp,%ebp
21a: 83 ec 28 sub $0x28,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
21d: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
224: 00
225: 8b 45 08 mov 0x8(%ebp),%eax
228: 89 04 24 mov %eax,(%esp)
22b: e8 07 01 00 00 call 337 <open>
230: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0)
233: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
237: 79 07 jns 240 <stat+0x29>
return -1;
239: b8 ff ff ff ff mov $0xffffffff,%eax
23e: eb 23 jmp 263 <stat+0x4c>
r = fstat(fd, st);
240: 8b 45 0c mov 0xc(%ebp),%eax
243: 89 44 24 04 mov %eax,0x4(%esp)
247: 8b 45 f4 mov -0xc(%ebp),%eax
24a: 89 04 24 mov %eax,(%esp)
24d: e8 fd 00 00 00 call 34f <fstat>
252: 89 45 f0 mov %eax,-0x10(%ebp)
close(fd);
255: 8b 45 f4 mov -0xc(%ebp),%eax
258: 89 04 24 mov %eax,(%esp)
25b: e8 bf 00 00 00 call 31f <close>
return r;
260: 8b 45 f0 mov -0x10(%ebp),%eax
}
263: c9 leave
264: c3 ret
00000265 <atoi>:
int
atoi(const char *s)
{
265: 55 push %ebp
266: 89 e5 mov %esp,%ebp
268: 83 ec 10 sub $0x10,%esp
int n;
n = 0;
26b: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
while('0' <= *s && *s <= '9')
272: eb 25 jmp 299 <atoi+0x34>
n = n*10 + *s++ - '0';
274: 8b 55 fc mov -0x4(%ebp),%edx
277: 89 d0 mov %edx,%eax
279: c1 e0 02 shl $0x2,%eax
27c: 01 d0 add %edx,%eax
27e: 01 c0 add %eax,%eax
280: 89 c1 mov %eax,%ecx
282: 8b 45 08 mov 0x8(%ebp),%eax
285: 8d 50 01 lea 0x1(%eax),%edx
288: 89 55 08 mov %edx,0x8(%ebp)
28b: 0f b6 00 movzbl (%eax),%eax
28e: 0f be c0 movsbl %al,%eax
291: 01 c8 add %ecx,%eax
293: 83 e8 30 sub $0x30,%eax
296: 89 45 fc mov %eax,-0x4(%ebp)
atoi(const char *s)
{
int n;
n = 0;
while('0' <= *s && *s <= '9')
299: 8b 45 08 mov 0x8(%ebp),%eax
29c: 0f b6 00 movzbl (%eax),%eax
29f: 3c 2f cmp $0x2f,%al
2a1: 7e 0a jle 2ad <atoi+0x48>
2a3: 8b 45 08 mov 0x8(%ebp),%eax
2a6: 0f b6 00 movzbl (%eax),%eax
2a9: 3c 39 cmp $0x39,%al
2ab: 7e c7 jle 274 <atoi+0xf>
n = n*10 + *s++ - '0';
return n;
2ad: 8b 45 fc mov -0x4(%ebp),%eax
}
2b0: c9 leave
2b1: c3 ret
000002b2 <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
2b2: 55 push %ebp
2b3: 89 e5 mov %esp,%ebp
2b5: 83 ec 10 sub $0x10,%esp
char *dst, *src;
dst = vdst;
2b8: 8b 45 08 mov 0x8(%ebp),%eax
2bb: 89 45 fc mov %eax,-0x4(%ebp)
src = vsrc;
2be: 8b 45 0c mov 0xc(%ebp),%eax
2c1: 89 45 f8 mov %eax,-0x8(%ebp)
while(n-- > 0)
2c4: eb 17 jmp 2dd <memmove+0x2b>
*dst++ = *src++;
2c6: 8b 45 fc mov -0x4(%ebp),%eax
2c9: 8d 50 01 lea 0x1(%eax),%edx
2cc: 89 55 fc mov %edx,-0x4(%ebp)
2cf: 8b 55 f8 mov -0x8(%ebp),%edx
2d2: 8d 4a 01 lea 0x1(%edx),%ecx
2d5: 89 4d f8 mov %ecx,-0x8(%ebp)
2d8: 0f b6 12 movzbl (%edx),%edx
2db: 88 10 mov %dl,(%eax)
{
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
2dd: 8b 45 10 mov 0x10(%ebp),%eax
2e0: 8d 50 ff lea -0x1(%eax),%edx
2e3: 89 55 10 mov %edx,0x10(%ebp)
2e6: 85 c0 test %eax,%eax
2e8: 7f dc jg 2c6 <memmove+0x14>
*dst++ = *src++;
return vdst;
2ea: 8b 45 08 mov 0x8(%ebp),%eax
}
2ed: c9 leave
2ee: c3 ret
000002ef <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
2ef: b8 01 00 00 00 mov $0x1,%eax
2f4: cd 40 int $0x40
2f6: c3 ret
000002f7 <exit>:
SYSCALL(exit)
2f7: b8 02 00 00 00 mov $0x2,%eax
2fc: cd 40 int $0x40
2fe: c3 ret
000002ff <wait>:
SYSCALL(wait)
2ff: b8 03 00 00 00 mov $0x3,%eax
304: cd 40 int $0x40
306: c3 ret
00000307 <pipe>:
SYSCALL(pipe)
307: b8 04 00 00 00 mov $0x4,%eax
30c: cd 40 int $0x40
30e: c3 ret
0000030f <read>:
SYSCALL(read)
30f: b8 05 00 00 00 mov $0x5,%eax
314: cd 40 int $0x40
316: c3 ret
00000317 <write>:
SYSCALL(write)
317: b8 10 00 00 00 mov $0x10,%eax
31c: cd 40 int $0x40
31e: c3 ret
0000031f <close>:
SYSCALL(close)
31f: b8 15 00 00 00 mov $0x15,%eax
324: cd 40 int $0x40
326: c3 ret
00000327 <kill>:
SYSCALL(kill)
327: b8 06 00 00 00 mov $0x6,%eax
32c: cd 40 int $0x40
32e: c3 ret
0000032f <exec>:
SYSCALL(exec)
32f: b8 07 00 00 00 mov $0x7,%eax
334: cd 40 int $0x40
336: c3 ret
00000337 <open>:
SYSCALL(open)
337: b8 0f 00 00 00 mov $0xf,%eax
33c: cd 40 int $0x40
33e: c3 ret
0000033f <mknod>:
SYSCALL(mknod)
33f: b8 11 00 00 00 mov $0x11,%eax
344: cd 40 int $0x40
346: c3 ret
00000347 <unlink>:
SYSCALL(unlink)
347: b8 12 00 00 00 mov $0x12,%eax
34c: cd 40 int $0x40
34e: c3 ret
0000034f <fstat>:
SYSCALL(fstat)
34f: b8 08 00 00 00 mov $0x8,%eax
354: cd 40 int $0x40
356: c3 ret
00000357 <link>:
SYSCALL(link)
357: b8 13 00 00 00 mov $0x13,%eax
35c: cd 40 int $0x40
35e: c3 ret
0000035f <mkdir>:
SYSCALL(mkdir)
35f: b8 14 00 00 00 mov $0x14,%eax
364: cd 40 int $0x40
366: c3 ret
00000367 <chdir>:
SYSCALL(chdir)
367: b8 09 00 00 00 mov $0x9,%eax
36c: cd 40 int $0x40
36e: c3 ret
0000036f <dup>:
SYSCALL(dup)
36f: b8 0a 00 00 00 mov $0xa,%eax
374: cd 40 int $0x40
376: c3 ret
00000377 <getpid>:
SYSCALL(getpid)
377: b8 0b 00 00 00 mov $0xb,%eax
37c: cd 40 int $0x40
37e: c3 ret
0000037f <sbrk>:
SYSCALL(sbrk)
37f: b8 0c 00 00 00 mov $0xc,%eax
384: cd 40 int $0x40
386: c3 ret
00000387 <sleep>:
SYSCALL(sleep)
387: b8 0d 00 00 00 mov $0xd,%eax
38c: cd 40 int $0x40
38e: c3 ret
0000038f <uptime>:
SYSCALL(uptime)
38f: b8 0e 00 00 00 mov $0xe,%eax
394: cd 40 int $0x40
396: c3 ret
00000397 <getcwd>:
SYSCALL(getcwd)
397: b8 16 00 00 00 mov $0x16,%eax
39c: cd 40 int $0x40
39e: c3 ret
0000039f <putc>:
#include "stat.h"
#include "user.h"
static void
putc(int fd, char c)
{
39f: 55 push %ebp
3a0: 89 e5 mov %esp,%ebp
3a2: 83 ec 18 sub $0x18,%esp
3a5: 8b 45 0c mov 0xc(%ebp),%eax
3a8: 88 45 f4 mov %al,-0xc(%ebp)
write(fd, &c, 1);
3ab: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
3b2: 00
3b3: 8d 45 f4 lea -0xc(%ebp),%eax
3b6: 89 44 24 04 mov %eax,0x4(%esp)
3ba: 8b 45 08 mov 0x8(%ebp),%eax
3bd: 89 04 24 mov %eax,(%esp)
3c0: e8 52 ff ff ff call 317 <write>
}
3c5: c9 leave
3c6: c3 ret
000003c7 <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
3c7: 55 push %ebp
3c8: 89 e5 mov %esp,%ebp
3ca: 56 push %esi
3cb: 53 push %ebx
3cc: 83 ec 30 sub $0x30,%esp
static char digits[] = "0123456789ABCDEF";
char buf[16];
int i, neg;
uint x;
neg = 0;
3cf: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
if(sgn && xx < 0){
3d6: 83 7d 14 00 cmpl $0x0,0x14(%ebp)
3da: 74 17 je 3f3 <printint+0x2c>
3dc: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
3e0: 79 11 jns 3f3 <printint+0x2c>
neg = 1;
3e2: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp)
x = -xx;
3e9: 8b 45 0c mov 0xc(%ebp),%eax
3ec: f7 d8 neg %eax
3ee: 89 45 ec mov %eax,-0x14(%ebp)
3f1: eb 06 jmp 3f9 <printint+0x32>
} else {
x = xx;
3f3: 8b 45 0c mov 0xc(%ebp),%eax
3f6: 89 45 ec mov %eax,-0x14(%ebp)
}
i = 0;
3f9: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
do{
buf[i++] = digits[x % base];
400: 8b 4d f4 mov -0xc(%ebp),%ecx
403: 8d 41 01 lea 0x1(%ecx),%eax
406: 89 45 f4 mov %eax,-0xc(%ebp)
409: 8b 5d 10 mov 0x10(%ebp),%ebx
40c: 8b 45 ec mov -0x14(%ebp),%eax
40f: ba 00 00 00 00 mov $0x0,%edx
414: f7 f3 div %ebx
416: 89 d0 mov %edx,%eax
418: 0f b6 80 c4 0a 00 00 movzbl 0xac4(%eax),%eax
41f: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1)
}while((x /= base) != 0);
423: 8b 75 10 mov 0x10(%ebp),%esi
426: 8b 45 ec mov -0x14(%ebp),%eax
429: ba 00 00 00 00 mov $0x0,%edx
42e: f7 f6 div %esi
430: 89 45 ec mov %eax,-0x14(%ebp)
433: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
437: 75 c7 jne 400 <printint+0x39>
if(neg)
439: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
43d: 74 10 je 44f <printint+0x88>
buf[i++] = '-';
43f: 8b 45 f4 mov -0xc(%ebp),%eax
442: 8d 50 01 lea 0x1(%eax),%edx
445: 89 55 f4 mov %edx,-0xc(%ebp)
448: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1)
while(--i >= 0)
44d: eb 1f jmp 46e <printint+0xa7>
44f: eb 1d jmp 46e <printint+0xa7>
putc(fd, buf[i]);
451: 8d 55 dc lea -0x24(%ebp),%edx
454: 8b 45 f4 mov -0xc(%ebp),%eax
457: 01 d0 add %edx,%eax
459: 0f b6 00 movzbl (%eax),%eax
45c: 0f be c0 movsbl %al,%eax
45f: 89 44 24 04 mov %eax,0x4(%esp)
463: 8b 45 08 mov 0x8(%ebp),%eax
466: 89 04 24 mov %eax,(%esp)
469: e8 31 ff ff ff call 39f <putc>
buf[i++] = digits[x % base];
}while((x /= base) != 0);
if(neg)
buf[i++] = '-';
while(--i >= 0)
46e: 83 6d f4 01 subl $0x1,-0xc(%ebp)
472: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
476: 79 d9 jns 451 <printint+0x8a>
putc(fd, buf[i]);
}
478: 83 c4 30 add $0x30,%esp
47b: 5b pop %ebx
47c: 5e pop %esi
47d: 5d pop %ebp
47e: c3 ret
0000047f <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
47f: 55 push %ebp
480: 89 e5 mov %esp,%ebp
482: 83 ec 38 sub $0x38,%esp
char *s;
int c, i, state;
uint *ap;
state = 0;
485: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
ap = (uint*)(void*)&fmt + 1;
48c: 8d 45 0c lea 0xc(%ebp),%eax
48f: 83 c0 04 add $0x4,%eax
492: 89 45 e8 mov %eax,-0x18(%ebp)
for(i = 0; fmt[i]; i++){
495: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
49c: e9 7c 01 00 00 jmp 61d <printf+0x19e>
c = fmt[i] & 0xff;
4a1: 8b 55 0c mov 0xc(%ebp),%edx
4a4: 8b 45 f0 mov -0x10(%ebp),%eax
4a7: 01 d0 add %edx,%eax
4a9: 0f b6 00 movzbl (%eax),%eax
4ac: 0f be c0 movsbl %al,%eax
4af: 25 ff 00 00 00 and $0xff,%eax
4b4: 89 45 e4 mov %eax,-0x1c(%ebp)
if(state == 0){
4b7: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
4bb: 75 2c jne 4e9 <printf+0x6a>
if(c == '%'){
4bd: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
4c1: 75 0c jne 4cf <printf+0x50>
state = '%';
4c3: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp)
4ca: e9 4a 01 00 00 jmp 619 <printf+0x19a>
} else {
putc(fd, c);
4cf: 8b 45 e4 mov -0x1c(%ebp),%eax
4d2: 0f be c0 movsbl %al,%eax
4d5: 89 44 24 04 mov %eax,0x4(%esp)
4d9: 8b 45 08 mov 0x8(%ebp),%eax
4dc: 89 04 24 mov %eax,(%esp)
4df: e8 bb fe ff ff call 39f <putc>
4e4: e9 30 01 00 00 jmp 619 <printf+0x19a>
}
} else if(state == '%'){
4e9: 83 7d ec 25 cmpl $0x25,-0x14(%ebp)
4ed: 0f 85 26 01 00 00 jne 619 <printf+0x19a>
if(c == 'd'){
4f3: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp)
4f7: 75 2d jne 526 <printf+0xa7>
printint(fd, *ap, 10, 1);
4f9: 8b 45 e8 mov -0x18(%ebp),%eax
4fc: 8b 00 mov (%eax),%eax
4fe: c7 44 24 0c 01 00 00 movl $0x1,0xc(%esp)
505: 00
506: c7 44 24 08 0a 00 00 movl $0xa,0x8(%esp)
50d: 00
50e: 89 44 24 04 mov %eax,0x4(%esp)
512: 8b 45 08 mov 0x8(%ebp),%eax
515: 89 04 24 mov %eax,(%esp)
518: e8 aa fe ff ff call 3c7 <printint>
ap++;
51d: 83 45 e8 04 addl $0x4,-0x18(%ebp)
521: e9 ec 00 00 00 jmp 612 <printf+0x193>
} else if(c == 'x' || c == 'p'){
526: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp)
52a: 74 06 je 532 <printf+0xb3>
52c: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp)
530: 75 2d jne 55f <printf+0xe0>
printint(fd, *ap, 16, 0);
532: 8b 45 e8 mov -0x18(%ebp),%eax
535: 8b 00 mov (%eax),%eax
537: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp)
53e: 00
53f: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
546: 00
547: 89 44 24 04 mov %eax,0x4(%esp)
54b: 8b 45 08 mov 0x8(%ebp),%eax
54e: 89 04 24 mov %eax,(%esp)
551: e8 71 fe ff ff call 3c7 <printint>
ap++;
556: 83 45 e8 04 addl $0x4,-0x18(%ebp)
55a: e9 b3 00 00 00 jmp 612 <printf+0x193>
} else if(c == 's'){
55f: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp)
563: 75 45 jne 5aa <printf+0x12b>
s = (char*)*ap;
565: 8b 45 e8 mov -0x18(%ebp),%eax
568: 8b 00 mov (%eax),%eax
56a: 89 45 f4 mov %eax,-0xc(%ebp)
ap++;
56d: 83 45 e8 04 addl $0x4,-0x18(%ebp)
if(s == 0)
571: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
575: 75 09 jne 580 <printf+0x101>
s = "(null)";
577: c7 45 f4 78 08 00 00 movl $0x878,-0xc(%ebp)
while(*s != 0){
57e: eb 1e jmp 59e <printf+0x11f>
580: eb 1c jmp 59e <printf+0x11f>
putc(fd, *s);
582: 8b 45 f4 mov -0xc(%ebp),%eax
585: 0f b6 00 movzbl (%eax),%eax
588: 0f be c0 movsbl %al,%eax
58b: 89 44 24 04 mov %eax,0x4(%esp)
58f: 8b 45 08 mov 0x8(%ebp),%eax
592: 89 04 24 mov %eax,(%esp)
595: e8 05 fe ff ff call 39f <putc>
s++;
59a: 83 45 f4 01 addl $0x1,-0xc(%ebp)
} else if(c == 's'){
s = (char*)*ap;
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
59e: 8b 45 f4 mov -0xc(%ebp),%eax
5a1: 0f b6 00 movzbl (%eax),%eax
5a4: 84 c0 test %al,%al
5a6: 75 da jne 582 <printf+0x103>
5a8: eb 68 jmp 612 <printf+0x193>
putc(fd, *s);
s++;
}
} else if(c == 'c'){
5aa: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp)
5ae: 75 1d jne 5cd <printf+0x14e>
putc(fd, *ap);
5b0: 8b 45 e8 mov -0x18(%ebp),%eax
5b3: 8b 00 mov (%eax),%eax
5b5: 0f be c0 movsbl %al,%eax
5b8: 89 44 24 04 mov %eax,0x4(%esp)
5bc: 8b 45 08 mov 0x8(%ebp),%eax
5bf: 89 04 24 mov %eax,(%esp)
5c2: e8 d8 fd ff ff call 39f <putc>
ap++;
5c7: 83 45 e8 04 addl $0x4,-0x18(%ebp)
5cb: eb 45 jmp 612 <printf+0x193>
} else if(c == '%'){
5cd: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
5d1: 75 17 jne 5ea <printf+0x16b>
putc(fd, c);
5d3: 8b 45 e4 mov -0x1c(%ebp),%eax
5d6: 0f be c0 movsbl %al,%eax
5d9: 89 44 24 04 mov %eax,0x4(%esp)
5dd: 8b 45 08 mov 0x8(%ebp),%eax
5e0: 89 04 24 mov %eax,(%esp)
5e3: e8 b7 fd ff ff call 39f <putc>
5e8: eb 28 jmp 612 <printf+0x193>
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
5ea: c7 44 24 04 25 00 00 movl $0x25,0x4(%esp)
5f1: 00
5f2: 8b 45 08 mov 0x8(%ebp),%eax
5f5: 89 04 24 mov %eax,(%esp)
5f8: e8 a2 fd ff ff call 39f <putc>
putc(fd, c);
5fd: 8b 45 e4 mov -0x1c(%ebp),%eax
600: 0f be c0 movsbl %al,%eax
603: 89 44 24 04 mov %eax,0x4(%esp)
607: 8b 45 08 mov 0x8(%ebp),%eax
60a: 89 04 24 mov %eax,(%esp)
60d: e8 8d fd ff ff call 39f <putc>
}
state = 0;
612: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
619: 83 45 f0 01 addl $0x1,-0x10(%ebp)
61d: 8b 55 0c mov 0xc(%ebp),%edx
620: 8b 45 f0 mov -0x10(%ebp),%eax
623: 01 d0 add %edx,%eax
625: 0f b6 00 movzbl (%eax),%eax
628: 84 c0 test %al,%al
62a: 0f 85 71 fe ff ff jne 4a1 <printf+0x22>
putc(fd, c);
}
state = 0;
}
}
}
630: c9 leave
631: c3 ret
00000632 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
632: 55 push %ebp
633: 89 e5 mov %esp,%ebp
635: 83 ec 10 sub $0x10,%esp
Header *bp, *p;
bp = (Header*)ap - 1;
638: 8b 45 08 mov 0x8(%ebp),%eax
63b: 83 e8 08 sub $0x8,%eax
63e: 89 45 f8 mov %eax,-0x8(%ebp)
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
641: a1 e0 0a 00 00 mov 0xae0,%eax
646: 89 45 fc mov %eax,-0x4(%ebp)
649: eb 24 jmp 66f <free+0x3d>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
64b: 8b 45 fc mov -0x4(%ebp),%eax
64e: 8b 00 mov (%eax),%eax
650: 3b 45 fc cmp -0x4(%ebp),%eax
653: 77 12 ja 667 <free+0x35>
655: 8b 45 f8 mov -0x8(%ebp),%eax
658: 3b 45 fc cmp -0x4(%ebp),%eax
65b: 77 24 ja 681 <free+0x4f>
65d: 8b 45 fc mov -0x4(%ebp),%eax
660: 8b 00 mov (%eax),%eax
662: 3b 45 f8 cmp -0x8(%ebp),%eax
665: 77 1a ja 681 <free+0x4f>
free(void *ap)
{
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
667: 8b 45 fc mov -0x4(%ebp),%eax
66a: 8b 00 mov (%eax),%eax
66c: 89 45 fc mov %eax,-0x4(%ebp)
66f: 8b 45 f8 mov -0x8(%ebp),%eax
672: 3b 45 fc cmp -0x4(%ebp),%eax
675: 76 d4 jbe 64b <free+0x19>
677: 8b 45 fc mov -0x4(%ebp),%eax
67a: 8b 00 mov (%eax),%eax
67c: 3b 45 f8 cmp -0x8(%ebp),%eax
67f: 76 ca jbe 64b <free+0x19>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
681: 8b 45 f8 mov -0x8(%ebp),%eax
684: 8b 40 04 mov 0x4(%eax),%eax
687: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
68e: 8b 45 f8 mov -0x8(%ebp),%eax
691: 01 c2 add %eax,%edx
693: 8b 45 fc mov -0x4(%ebp),%eax
696: 8b 00 mov (%eax),%eax
698: 39 c2 cmp %eax,%edx
69a: 75 24 jne 6c0 <free+0x8e>
bp->s.size += p->s.ptr->s.size;
69c: 8b 45 f8 mov -0x8(%ebp),%eax
69f: 8b 50 04 mov 0x4(%eax),%edx
6a2: 8b 45 fc mov -0x4(%ebp),%eax
6a5: 8b 00 mov (%eax),%eax
6a7: 8b 40 04 mov 0x4(%eax),%eax
6aa: 01 c2 add %eax,%edx
6ac: 8b 45 f8 mov -0x8(%ebp),%eax
6af: 89 50 04 mov %edx,0x4(%eax)
bp->s.ptr = p->s.ptr->s.ptr;
6b2: 8b 45 fc mov -0x4(%ebp),%eax
6b5: 8b 00 mov (%eax),%eax
6b7: 8b 10 mov (%eax),%edx
6b9: 8b 45 f8 mov -0x8(%ebp),%eax
6bc: 89 10 mov %edx,(%eax)
6be: eb 0a jmp 6ca <free+0x98>
} else
bp->s.ptr = p->s.ptr;
6c0: 8b 45 fc mov -0x4(%ebp),%eax
6c3: 8b 10 mov (%eax),%edx
6c5: 8b 45 f8 mov -0x8(%ebp),%eax
6c8: 89 10 mov %edx,(%eax)
if(p + p->s.size == bp){
6ca: 8b 45 fc mov -0x4(%ebp),%eax
6cd: 8b 40 04 mov 0x4(%eax),%eax
6d0: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
6d7: 8b 45 fc mov -0x4(%ebp),%eax
6da: 01 d0 add %edx,%eax
6dc: 3b 45 f8 cmp -0x8(%ebp),%eax
6df: 75 20 jne 701 <free+0xcf>
p->s.size += bp->s.size;
6e1: 8b 45 fc mov -0x4(%ebp),%eax
6e4: 8b 50 04 mov 0x4(%eax),%edx
6e7: 8b 45 f8 mov -0x8(%ebp),%eax
6ea: 8b 40 04 mov 0x4(%eax),%eax
6ed: 01 c2 add %eax,%edx
6ef: 8b 45 fc mov -0x4(%ebp),%eax
6f2: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
6f5: 8b 45 f8 mov -0x8(%ebp),%eax
6f8: 8b 10 mov (%eax),%edx
6fa: 8b 45 fc mov -0x4(%ebp),%eax
6fd: 89 10 mov %edx,(%eax)
6ff: eb 08 jmp 709 <free+0xd7>
} else
p->s.ptr = bp;
701: 8b 45 fc mov -0x4(%ebp),%eax
704: 8b 55 f8 mov -0x8(%ebp),%edx
707: 89 10 mov %edx,(%eax)
freep = p;
709: 8b 45 fc mov -0x4(%ebp),%eax
70c: a3 e0 0a 00 00 mov %eax,0xae0
}
711: c9 leave
712: c3 ret
00000713 <morecore>:
static Header*
morecore(uint nu)
{
713: 55 push %ebp
714: 89 e5 mov %esp,%ebp
716: 83 ec 28 sub $0x28,%esp
char *p;
Header *hp;
if(nu < 4096)
719: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp)
720: 77 07 ja 729 <morecore+0x16>
nu = 4096;
722: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp)
p = sbrk(nu * sizeof(Header));
729: 8b 45 08 mov 0x8(%ebp),%eax
72c: c1 e0 03 shl $0x3,%eax
72f: 89 04 24 mov %eax,(%esp)
732: e8 48 fc ff ff call 37f <sbrk>
737: 89 45 f4 mov %eax,-0xc(%ebp)
if(p == (char*)-1)
73a: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp)
73e: 75 07 jne 747 <morecore+0x34>
return 0;
740: b8 00 00 00 00 mov $0x0,%eax
745: eb 22 jmp 769 <morecore+0x56>
hp = (Header*)p;
747: 8b 45 f4 mov -0xc(%ebp),%eax
74a: 89 45 f0 mov %eax,-0x10(%ebp)
hp->s.size = nu;
74d: 8b 45 f0 mov -0x10(%ebp),%eax
750: 8b 55 08 mov 0x8(%ebp),%edx
753: 89 50 04 mov %edx,0x4(%eax)
free((void*)(hp + 1));
756: 8b 45 f0 mov -0x10(%ebp),%eax
759: 83 c0 08 add $0x8,%eax
75c: 89 04 24 mov %eax,(%esp)
75f: e8 ce fe ff ff call 632 <free>
return freep;
764: a1 e0 0a 00 00 mov 0xae0,%eax
}
769: c9 leave
76a: c3 ret
0000076b <malloc>:
void*
malloc(uint nbytes)
{
76b: 55 push %ebp
76c: 89 e5 mov %esp,%ebp
76e: 83 ec 28 sub $0x28,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
771: 8b 45 08 mov 0x8(%ebp),%eax
774: 83 c0 07 add $0x7,%eax
777: c1 e8 03 shr $0x3,%eax
77a: 83 c0 01 add $0x1,%eax
77d: 89 45 ec mov %eax,-0x14(%ebp)
if((prevp = freep) == 0){
780: a1 e0 0a 00 00 mov 0xae0,%eax
785: 89 45 f0 mov %eax,-0x10(%ebp)
788: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
78c: 75 23 jne 7b1 <malloc+0x46>
base.s.ptr = freep = prevp = &base;
78e: c7 45 f0 d8 0a 00 00 movl $0xad8,-0x10(%ebp)
795: 8b 45 f0 mov -0x10(%ebp),%eax
798: a3 e0 0a 00 00 mov %eax,0xae0
79d: a1 e0 0a 00 00 mov 0xae0,%eax
7a2: a3 d8 0a 00 00 mov %eax,0xad8
base.s.size = 0;
7a7: c7 05 dc 0a 00 00 00 movl $0x0,0xadc
7ae: 00 00 00
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
7b1: 8b 45 f0 mov -0x10(%ebp),%eax
7b4: 8b 00 mov (%eax),%eax
7b6: 89 45 f4 mov %eax,-0xc(%ebp)
if(p->s.size >= nunits){
7b9: 8b 45 f4 mov -0xc(%ebp),%eax
7bc: 8b 40 04 mov 0x4(%eax),%eax
7bf: 3b 45 ec cmp -0x14(%ebp),%eax
7c2: 72 4d jb 811 <malloc+0xa6>
if(p->s.size == nunits)
7c4: 8b 45 f4 mov -0xc(%ebp),%eax
7c7: 8b 40 04 mov 0x4(%eax),%eax
7ca: 3b 45 ec cmp -0x14(%ebp),%eax
7cd: 75 0c jne 7db <malloc+0x70>
prevp->s.ptr = p->s.ptr;
7cf: 8b 45 f4 mov -0xc(%ebp),%eax
7d2: 8b 10 mov (%eax),%edx
7d4: 8b 45 f0 mov -0x10(%ebp),%eax
7d7: 89 10 mov %edx,(%eax)
7d9: eb 26 jmp 801 <malloc+0x96>
else {
p->s.size -= nunits;
7db: 8b 45 f4 mov -0xc(%ebp),%eax
7de: 8b 40 04 mov 0x4(%eax),%eax
7e1: 2b 45 ec sub -0x14(%ebp),%eax
7e4: 89 c2 mov %eax,%edx
7e6: 8b 45 f4 mov -0xc(%ebp),%eax
7e9: 89 50 04 mov %edx,0x4(%eax)
p += p->s.size;
7ec: 8b 45 f4 mov -0xc(%ebp),%eax
7ef: 8b 40 04 mov 0x4(%eax),%eax
7f2: c1 e0 03 shl $0x3,%eax
7f5: 01 45 f4 add %eax,-0xc(%ebp)
p->s.size = nunits;
7f8: 8b 45 f4 mov -0xc(%ebp),%eax
7fb: 8b 55 ec mov -0x14(%ebp),%edx
7fe: 89 50 04 mov %edx,0x4(%eax)
}
freep = prevp;
801: 8b 45 f0 mov -0x10(%ebp),%eax
804: a3 e0 0a 00 00 mov %eax,0xae0
return (void*)(p + 1);
809: 8b 45 f4 mov -0xc(%ebp),%eax
80c: 83 c0 08 add $0x8,%eax
80f: eb 38 jmp 849 <malloc+0xde>
}
if(p == freep)
811: a1 e0 0a 00 00 mov 0xae0,%eax
816: 39 45 f4 cmp %eax,-0xc(%ebp)
819: 75 1b jne 836 <malloc+0xcb>
if((p = morecore(nunits)) == 0)
81b: 8b 45 ec mov -0x14(%ebp),%eax
81e: 89 04 24 mov %eax,(%esp)
821: e8 ed fe ff ff call 713 <morecore>
826: 89 45 f4 mov %eax,-0xc(%ebp)
829: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
82d: 75 07 jne 836 <malloc+0xcb>
return 0;
82f: b8 00 00 00 00 mov $0x0,%eax
834: eb 13 jmp 849 <malloc+0xde>
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){
836: 8b 45 f4 mov -0xc(%ebp),%eax
839: 89 45 f0 mov %eax,-0x10(%ebp)
83c: 8b 45 f4 mov -0xc(%ebp),%eax
83f: 8b 00 mov (%eax),%eax
841: 89 45 f4 mov %eax,-0xc(%ebp)
return (void*)(p + 1);
}
if(p == freep)
if((p = morecore(nunits)) == 0)
return 0;
}
844: e9 70 ff ff ff jmp 7b9 <malloc+0x4e>
}
849: c9 leave
84a: c3 ret
| 34.110282 | 60 | 0.426915 |
adf6daeb8ac8e3694d77150f95127ca5be512217 | 1,005 | asm | Assembly | oeis/269/A269963.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/269/A269963.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/269/A269963.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A269963: Start with a square; at each stage add a square at each expandable vertex so that the ratio between the side of the squares at stage n+1 and at stage n is the golden ratio phi=0.618...; a(n) is the number of squares in a portion of the n-th stage (see below).
; Submitted by Jon Maiga
; 1,2,7,16,37,82,187,428,985,2262,5191,11904,27301,62618,143635,329476,755761,1733566,3976447,9121160,20922109,47991138,110082091,252506316,579198985,1328566598,3047466007,6990277456,16034298325,36779473258,84364755139,193515873812,443886707809,1018187322318,2335518061615,5357211287832,12288371155885,28187065536626,64655490421339,148306762766428,340186049768377,780318754845526,1789895145842503,4105661453369312,9417566167959685,21602013106831482,49550697276260083,113659388521855908
mov $2,2
lpb $0
sub $0,1
add $4,$1
mul $1,2
add $3,1
add $1,$3
add $2,2
div $3,2
mul $4,2
add $5,$2
mov $2,$3
mov $3,$5
sub $3,$1
add $4,3
div $4,2
add $2,$4
mul $2,2
lpe
mov $0,$1
add $0,1
| 38.653846 | 485 | 0.755224 |
a1e2acbc1e022d076216e38bf01055bbb2147915 | 588 | asm | Assembly | oeis/077/A077414.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/077/A077414.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/077/A077414.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A077414: a(n) = n*(n - 1)*(n + 2)/2.
; 0,4,15,36,70,120,189,280,396,540,715,924,1170,1456,1785,2160,2584,3060,3591,4180,4830,5544,6325,7176,8100,9100,10179,11340,12586,13920,15345,16864,18480,20196,22015,23940,25974,28120,30381,32760,35260,37884,40635,43516,46530,49680,52969,56400,59976,63700,67575,71604,75790,80136,84645,89320,94164,99180,104371,109740,115290,121024,126945,133056,139360,145860,152559,159460,166566,173880,181405,189144,197100,205276,213675,222300,231154,240240,249561,259120,268920,278964,289255,299796,310590,321640
add $0,1
mov $1,2
add $1,$0
bin $0,2
mul $0,$1
| 65.333333 | 500 | 0.770408 |
24759721dba566c3acd6c1a385133cd7fb2e5525 | 369 | asm | Assembly | programs/oeis/264/A264853.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/264/A264853.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/264/A264853.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A264853: a(n) = n*(n + 1)*(5*n^2 + 5*n - 4)/12.
; 0,1,13,56,160,365,721,1288,2136,3345,5005,7216,10088,13741,18305,23920,30736,38913,48621,60040,73360,88781,106513,126776,149800,175825,205101,237888,274456,315085,360065,409696,464288,524161,589645,661080,738816,823213,914641
mov $2,$0
lpb $0
sub $0,1
add $3,$2
add $1,$3
add $4,7
add $2,$4
add $4,3
lpe
| 28.384615 | 227 | 0.674797 |
885b300776efcdc9bbc44cb121700304a047f625 | 245 | asm | Assembly | libsrc/_DEVELOPMENT/stdio/c/sccz80/fputc_unlocked.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/stdio/c/sccz80/fputc_unlocked.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/stdio/c/sccz80/fputc_unlocked.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
; int fputc_unlocked(int c, FILE *stream)
SECTION code_clib
SECTION code_stdio
PUBLIC fputc_unlocked
EXTERN asm_fputc_unlocked
fputc_unlocked:
pop af
pop ix
pop de
push de
push hl
push af
jp asm_fputc_unlocked
| 11.136364 | 41 | 0.714286 |
a73d5391d4e7959b59c5b985a99e22c3cf9175d8 | 142 | asm | Assembly | General/Sprites/Surfboard/Anim - Surfboard Splash.asm | NatsumiFox/AMPS-Sonic-3-Knuckles | af951b39f0ca103a905d7492448ac5245a2e8104 | [
"Apache-2.0"
] | 5 | 2021-07-09T08:17:56.000Z | 2022-02-27T19:57:47.000Z | General/Sprites/Surfboard/Anim - Surfboard Splash.asm | NatsumiFox/AMPS-Sonic-3-Knuckles | af951b39f0ca103a905d7492448ac5245a2e8104 | [
"Apache-2.0"
] | null | null | null | General/Sprites/Surfboard/Anim - Surfboard Splash.asm | NatsumiFox/AMPS-Sonic-3-Knuckles | af951b39f0ca103a905d7492448ac5245a2e8104 | [
"Apache-2.0"
] | null | null | null | dc.w byte_2118A-Ani_SurfboardSplash
byte_2118A: dc.b 0, 1, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, $FF, 0
even
| 35.5 | 96 | 0.464789 |
fd8559d424272e3385843603be872a7dead73f06 | 442 | asm | Assembly | oeis/105/A105577.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/105/A105577.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/105/A105577.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A105577: a(n+3) = 2*a(n+2) - 3*a(n+1) + 2*a(n); a(0) = 1, a(1) = 5, a(2) = 6.
; Submitted by Jon Maiga
; 1,5,6,-1,-10,-5,18,31,-2,-61,-54,71,182,43,-318,-401,238,1043,570,-1513,-2650,379,5682,4927,-6434,-16285,-3414,29159,35990,-22325,-94302,-49649,138958,238259,-39654,-516169,-436858,595483,1469202,278239,-2660162,-3216637,2103690,8536967
mov $1,-5
mov $2,1
lpb $0
sub $0,1
mul $2,2
add $1,$2
sub $2,$1
sub $1,3
lpe
mov $0,$2
| 29.466667 | 238 | 0.606335 |
f553c161a36a5205aee3a59b557d4e7498645c63 | 166 | asm | Assembly | oeis/234/A234373.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/234/A234373.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/234/A234373.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A234373: Row 4 of the square array A234951.
; 1,4,6,9,11,14,15,18,20,23
mov $2,$0
mul $0,2
mov $1,$2
div $1,2
lpb $0
sub $0,$1
div $1,3
lpe
add $0,$2
add $0,1
| 11.857143 | 45 | 0.584337 |
80c515a89e64cc4fac91508f36cb5d88b694d97d | 528 | asm | Assembly | programs/oeis/061/A061078.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/061/A061078.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/061/A061078.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A061078: Sum of the products of the digits of the first n even numbers.
; 2,6,12,20,20,22,26,32,40,40,44,52,64,80,80,86,98,116,140,140,148,164,188,220,220,230,250,280,320,320,332,356,392,440,440,454,482,524,580,580,596,628,676,740,740,758,794,848,920,920,920,920,920,920,920,922
mov $4,$0
add $4,1
mov $6,$0
lpb $4
mov $0,$6
sub $4,1
sub $0,$4
mul $0,2
add $0,2
mov $3,4
lpb $0
mov $2,$0
div $0,10
mod $2,10
mul $3,$2
lpe
mov $5,$3
sub $5,4
div $5,4
add $5,1
add $1,$5
lpe
mov $0,$1
| 19.555556 | 206 | 0.598485 |
0d9818676d96e1ce145948a7651855c8adc6416f | 533 | asm | Assembly | Bootsektor/bootloader.asm | JensFZ/MyOS | 8a3cd2fd2fcb9550856b9260ab85585b7a6f2f15 | [
"MIT"
] | null | null | null | Bootsektor/bootloader.asm | JensFZ/MyOS | 8a3cd2fd2fcb9550856b9260ab85585b7a6f2f15 | [
"MIT"
] | null | null | null | Bootsektor/bootloader.asm | JensFZ/MyOS | 8a3cd2fd2fcb9550856b9260ab85585b7a6f2f15 | [
"MIT"
] | null | null | null | global loader ; make loader visible for the linker
extern main ; main function of the C kernel
FLAGS equ 0
MAGIC equ 0x1BADB002 ; Magicnumber for Grub
CHECKSUM equ -(MAGIC+FLAGS) ; Checksum
section .text
align 4
MultiBootHeader:
dd MAGIC
dd FLAGS
dd CHECKSUM
loader:
mov esp, 0x200000 ; Set stack to 2MB
push eax ; Multiboot Magicnumber pushed to stack
push ebx ; push Multiboot structure address to stack
call main ; call C kernel main function
cli ; if kernel reaches this point -> halt CPU
hlt
| 23.173913 | 55 | 0.729831 |
e3bd5f07af758d707183c94b68243f7135b88147 | 6,383 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_464.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_464.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_464.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r14
push %r9
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x14d1d, %rsi
lea addresses_UC_ht+0x126fe, %rdi
clflush (%rsi)
nop
nop
nop
inc %r9
mov $126, %rcx
rep movsq
nop
inc %r9
lea addresses_A_ht+0xe018, %rsi
lea addresses_normal_ht+0x629d, %rdi
clflush (%rsi)
nop
nop
nop
add %r14, %r14
mov $120, %rcx
rep movsw
nop
nop
nop
add %rcx, %rcx
lea addresses_UC_ht+0x839d, %rsi
lea addresses_WT_ht+0x1a43d, %rdi
xor %rbx, %rbx
mov $80, %rcx
rep movsl
nop
dec %rbx
lea addresses_WT_ht+0x1509d, %rcx
nop
nop
nop
nop
cmp $58034, %r11
mov $0x6162636465666768, %r9
movq %r9, %xmm3
vmovups %ymm3, (%rcx)
nop
nop
inc %rcx
lea addresses_D_ht+0x1ca51, %r11
nop
nop
nop
and $20966, %rbx
movb $0x61, (%r11)
nop
nop
dec %rbx
lea addresses_D_ht+0xef2d, %rbx
dec %rcx
mov (%rbx), %r9
nop
nop
nop
nop
nop
add %rbx, %rbx
lea addresses_D_ht+0x1ab5, %r11
nop
nop
xor %r14, %r14
mov $0x6162636465666768, %rbx
movq %rbx, (%r11)
nop
dec %rcx
lea addresses_UC_ht+0x9dcd, %rdi
nop
nop
nop
xor $4665, %rcx
movw $0x6162, (%rdi)
nop
nop
nop
nop
cmp %r14, %r14
lea addresses_normal_ht+0xe63d, %r9
nop
nop
cmp %r14, %r14
movb $0x61, (%r9)
nop
nop
nop
dec %r14
lea addresses_WC_ht+0x1b01d, %rcx
nop
nop
nop
inc %r11
mov $0x6162636465666768, %r9
movq %r9, %xmm2
vmovups %ymm2, (%rcx)
add %r9, %r9
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r14
push %rbp
push %rbx
push %rcx
push %rdx
push %rsi
// Faulty Load
lea addresses_PSE+0xe29d, %rcx
nop
nop
nop
nop
add %rsi, %rsi
mov (%rcx), %r14
lea oracles, %rdx
and $0xff, %r14
shlq $12, %r14
mov (%rdx,%r14,1), %r14
pop %rsi
pop %rdx
pop %rcx
pop %rbx
pop %rbp
pop %r14
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 0, 'type': 'addresses_UC_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 0, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_normal_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 8, 'type': 'addresses_UC_ht'}, 'dst': {'same': True, 'congruent': 5, 'type': 'addresses_WT_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 9}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 1}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': True, 'size': 2, 'congruent': 4}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 4}}
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
| 38.451807 | 2,999 | 0.659094 |
827caec4f9bedfddb5b78ef2c11b9d5479ce8967 | 466 | asm | Assembly | libsrc/math/genmath/cos.asm | andydansby/z88dk-mk2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | 1 | 2020-09-15T08:35:49.000Z | 2020-09-15T08:35:49.000Z | libsrc/genmath/cos.asm | dex4er/deb-z88dk | 9ee4f23444fa6f6043462332a1bff7ae20a8504b | [
"ClArtistic"
] | null | null | null | libsrc/genmath/cos.asm | dex4er/deb-z88dk | 9ee4f23444fa6f6043462332a1bff7ae20a8504b | [
"ClArtistic"
] | null | null | null | ; Small C+ Maths Routines
;
; transcendental floating point routines
;
XLIB cos
LIB sin
LIB hladd
XREF __halfpi
;double cos(double val)
;Looks odd, but don't worry..value is already in FA - no need for stack
;
; transcendental functions: sin, cos, tan
;
.COS LD HL,HALFPI ;local copy..
CALL HLADD
jp sin
.halfpi DEFB $22,$A2,$DA,$0F,$49,$81 ; pi/2
| 13.314286 | 71 | 0.536481 |
833242a345e1957621de4140334235fccb2774ac | 464 | asm | Assembly | env/zx/common/dodos_residos.asm | pjshumphreys/querycsv | 48453d8c81fb5fc6db495881c99046f7a7656cbc | [
"MIT"
] | 18 | 2017-04-17T23:19:51.000Z | 2022-02-09T00:26:21.000Z | env/zx/common/dodos_residos.asm | pjshumphreys/querycsv | 48453d8c81fb5fc6db495881c99046f7a7656cbc | [
"MIT"
] | null | null | null | env/zx/common/dodos_residos.asm | pjshumphreys/querycsv | 48453d8c81fb5fc6db495881c99046f7a7656cbc | [
"MIT"
] | null | null | null | HOOK_PACKAGE equ 0xfb
PKG_RESIDOS equ 0
PKG_IDEDOS equ 0x01
include "equs.inc"
;-------------------------------------
; dodos_residos
dodos_residos:
exx
ld b, PKG_IDEDOS
jr testbanks
doresi2:
exx
ld b, PKG_RESIDOS
testbanks:
push af
ld a, (basicBank)
di
call mypager
ei
pop af
push iy
pop hl
rst RST_HOOK
defb HOOK_PACKAGE
push af
ld a, (defaultBank) ; page 0
di
call mypager
ei
pop af
ld iy, ERR_NR
ret
end: | 10.790698 | 38 | 0.62069 |
003fe3047f73631d54680914bbb3c118d90e7e91 | 640 | asm | Assembly | programs/oeis/165/A165834.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/165/A165834.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/165/A165834.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A165834: Totally multiplicative sequence with a(p) = 13.
; 1,13,13,169,13,169,13,2197,169,169,13,2197,13,169,169,28561,13,2197,13,2197,169,169,13,28561,169,169,2197,2197,13,2197,13,371293,169,169,169,28561,13,169,169,28561,13,2197,13,2197,2197,169,13,371293,169,2197,169,2197,13,28561,169,28561,169,169,13,28561,13,169,2197,4826809,169,2197,13,2197,169,2197,13,371293,13,169,2197,2197,169,2197,13,371293,28561,169,13,28561,169,169,169,28561,13,28561,169,2197,169,169,169,4826809,13,2197,2197,28561
seq $0,1222 ; Number of prime divisors of n counted with multiplicity (also called bigomega(n) or Omega(n)).
mov $1,13
pow $1,$0
mov $0,$1
| 80 | 440 | 0.751563 |
45b92cd7e34713a43d2d4fac7cf179f39be93629 | 1,334 | asm | Assembly | test/pxor.asm | killvxk/AssemblyLine | 2a20ec925532875c2f3bb5d423eb38a00bc5c91d | [
"Apache-2.0"
] | 147 | 2021-09-01T03:52:49.000Z | 2022-03-30T16:59:58.000Z | test/pxor.asm | killvxk/AssemblyLine | 2a20ec925532875c2f3bb5d423eb38a00bc5c91d | [
"Apache-2.0"
] | 7 | 2021-09-10T07:03:36.000Z | 2022-03-03T23:30:58.000Z | test/pxor.asm | killvxk/AssemblyLine | 2a20ec925532875c2f3bb5d423eb38a00bc5c91d | [
"Apache-2.0"
] | 19 | 2021-09-09T10:54:44.000Z | 2022-03-18T19:56:45.000Z | SECTION .text
GLOBAL test
test:
pxor xmm0, xmm0
pxor xmm0, xmm1
pxor xmm0, xmm2
pxor xmm0, xmm3
pxor xmm0, xmm4
pxor xmm0, xmm5
pxor xmm0, xmm6
pxor xmm0, xmm7
pxor xmm1, xmm0
pxor xmm1, xmm1
pxor xmm1, xmm2
pxor xmm1, xmm3
pxor xmm1, xmm4
pxor xmm1, xmm5
pxor xmm1, xmm6
pxor xmm1, xmm7
pxor xmm2, xmm0
pxor xmm2, xmm1
pxor xmm2, xmm2
pxor xmm2, xmm3
pxor xmm2, xmm4
pxor xmm2, xmm5
pxor xmm2, xmm6
pxor xmm2, xmm7
pxor xmm3, xmm0
pxor xmm3, xmm1
pxor xmm3, xmm2
pxor xmm3, xmm3
pxor xmm3, xmm4
pxor xmm3, xmm5
pxor xmm3, xmm6
pxor xmm3, xmm7
pxor xmm4, xmm0
pxor xmm4, xmm1
pxor xmm4, xmm2
pxor xmm4, xmm3
pxor xmm4, xmm4
pxor xmm4, xmm5
pxor xmm4, xmm6
pxor xmm4, xmm7
pxor xmm5, xmm0
pxor xmm5, xmm1
pxor xmm5, xmm2
pxor xmm5, xmm3
pxor xmm5, xmm4
pxor xmm5, xmm5
pxor xmm5, xmm6
pxor xmm5, xmm7
pxor xmm6, xmm0
pxor xmm6, xmm1
pxor xmm6, xmm2
pxor xmm6, xmm3
pxor xmm6, xmm4
pxor xmm6, xmm5
pxor xmm6, xmm6
pxor xmm6, xmm7
pxor xmm7, xmm0
pxor xmm7, xmm1
pxor xmm7, xmm2
pxor xmm7, xmm3
pxor xmm7, xmm4
pxor xmm7, xmm5
pxor xmm7, xmm6
pxor xmm7, xmm7
pxor xmm8, xmm0
pxor xmm8, xmm1
pxor xmm8, xmm2
pxor xmm8, xmm3
pxor xmm8, xmm4
pxor xmm8, xmm5
pxor xmm8, xmm6
pxor xmm8, xmm7
pxor xmm0, xmm15
pxor xmm1, xmm14
pxor xmm2, xmm13
pxor xmm3, xmm12
pxor xmm4, xmm11
pxor xmm5, xmm10
pxor xmm6, xmm9
pxor xmm7, xmm8
pxor xmm8, xmm14 | 15.880952 | 16 | 0.752624 |
be8c0edfc1cc56b99c1139c488559221484916b7 | 591 | asm | Assembly | libsrc/target/gb/gbdk/receive_byte.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/target/gb/gbdk/receive_byte.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/target/gb/gbdk/receive_byte.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
MODULE receive_byte
PUBLIC receive_byte
PUBLIC _receive_byte
EXTERN __io_status
SECTION code_driver
INCLUDE "target/gb/def/gb_globals.def"
;; Send byte in __io_out to the serial port
receive_byte:
_receive_byte:
LD A,IO_RECEIVING
LD (__io_status),A ; Store status
XOR A
LDH (SC),A ; Use external clock
LD A,DT_RECEIVING
LDH (SB),A ; Send RECEIVING byte
LD A,0x80
LDH (SC),A ; Use external clock
RET
| 21.888889 | 52 | 0.532995 |
82b4b2b7a56f286e87846eebb77a6d5aa4f0072d | 599 | asm | Assembly | programs/oeis/048/A048467.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/048/A048467.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/048/A048467.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A048467: a(n) = T(6,n), array T given by A047858.
; 1,8,23,55,123,267,571,1211,2555,5371,11259,23547,49147,102395,212987,442363,917499,1900539,3932155,8126459,16777211,34603003,71303163,146800635,301989883,620756987,1275068411,2617245691,5368709115,11005853691,22548578299,46170898427,94489280507,193273528315,395136991227,807453851643,1649267441659,3367254360059,6871947673595,14018773254139,28587302322171,58274116272123,118747255799803,241892558110715,492581209243643,1002754604531707,2040693581152251,4151755906482171,8444249301319675
mov $1,2
pow $1,$0
add $0,12
mul $1,$0
div $1,2
sub $1,5
| 59.9 | 488 | 0.836394 |
5c79ebcd6dd5900dd10c3c31a0eedf75d6eb7be1 | 392 | asm | Assembly | programs/oeis/344/A344483.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/344/A344483.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/344/A344483.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A344483: a(n) = n^2 + sigma(n) - n*d(n).
; 1,3,7,11,21,24,43,47,67,78,111,100,157,164,189,207,273,255,343,322,389,432,507,444,581,614,661,672,813,732,931,895,1005,1074,1133,1063,1333,1352,1421,1370,1641,1524,1807,1756,1833,2004,2163,1948,2311,2293,2469,2490
add $0,1
mov $2,$0
lpb $0
sub $0,1
mov $3,$2
mov $4,$0
cmp $4,0
add $0,$4
dif $3,$0
add $1,$3
lpe
add $1,1
mov $0,$1
| 23.058824 | 216 | 0.625 |
2e95cce1c10fe2e1ea7e797f5e121383bef75f1d | 351 | asm | Assembly | programs/oeis/134/A134314.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/134/A134314.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/134/A134314.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A134314: First differences of A134429.
; -8,8,-8,16,-24,24,-24,32,-40,40,-40,48,-56,56,-56,64,-72,72,-72,80,-88,88,-88,96,-104,104,-104,112,-120,120,-120,128,-136,136,-136,144,-152,152,-152,160,-168,168,-168,176,-184,184,-184,192,-200,200,-200,208
add $0,2
mov $1,$0
lpb $1
gcd $1,4
sub $1,$0
sub $1,1
lpe
sub $1,3
div $1,2
mul $1,8
add $1,8
| 23.4 | 208 | 0.606838 |
4c08dd1311b8fdad685e2136877653451c33d5f2 | 3,324 | asm | Assembly | main.asm | EscapeCharacter-dev/chadbrain | b601f05eff19062c13d874636215209dc686f404 | [
"CC0-1.0"
] | 2 | 2021-07-25T21:07:36.000Z | 2021-07-26T02:39:42.000Z | main.asm | EscapeCharacter-dev/chadbrain | b601f05eff19062c13d874636215209dc686f404 | [
"CC0-1.0"
] | null | null | null | main.asm | EscapeCharacter-dev/chadbrain | b601f05eff19062c13d874636215209dc686f404 | [
"CC0-1.0"
] | null | null | null | [BITS 16]
[ORG 0x7C00]
lowMemAddr: equ 0
inputBuf: equ 0
stackLow: equ 0
inputBufLength: equ 0xFFFF
highMemAddr: equ 0xFFFF
stackHigh: equ 0xFFFF
memAddrLength: equ highMemAddr - lowMemAddr - 1
index:
DW 0
_start:
; clearing screen
XOR AH, AH
MOV AL, 0x03
INT 0x10
IN AL, 0x92 ; a20 line
OR AL, 2 ; a20 line
OUT 0x92, AL ; a20 line
; set ES to 0xFFFF
MOV BX, 0x1300
MOV ES, BX ; cell segment
MOV BX, 0x1600
MOV GS, BX ; input buffer segment
MOV BX, 0x1900
MOV SS, BX ; stack segment
MOV SP, stackHigh ; stack top
.reset:
MOV WORD [inputBufUsed], 0
MOV AH, 0x0E
XOR BH, BH
MOV BL, 0x07
MOV AL, 0x0A ; newline
INT 0x10
MOV AL, 0x0D ; return carriage
INT 0x10
MOV AL, 'O' ; O
INT 0x10
MOV AL, 'k'
INT 0x10
MOV AL, '>' ; >
INT 0x10
MOV AL, ' ' ; (whitespace)
INT 0x10
XOR CX, CX
.loop:
XOR AH, AH
INT 0x16
CMP AL, 0x0D ; newline
JE .continue
CMP AL, 0x08 ; backspace
JE .delete
CMP CX, inputBufLength
JE .continue
INC CX
MOV BX, CX
ADD BX, inputBuf
MOV [GS:BX], AL
MOV AH, 0x0E
XOR BH, BH
MOV BL, 0x07
INT 0x10
JMP .loop
.delete:
CMP CX, 0
PUSH CX
JE .loop
; getting current character position
MOV AH, 0x03
XOR BH, BH
INT 0x10
DEC DL
; setting character position
MOV AH, 0x02
INT 0x10
; displaying
MOV AH, 0x0E
XOR BH, BH
MOV BL, 0x07
MOV AL, ' '
INT 0x10
; going back again
MOV AH, 0x02
INT 0x10
POP CX
DEC CX
JMP .loop
.continue:
MOV AH, 0x0E
XOR BH, BH
MOV BL, 0x07
MOV AL, 0x0A ; newline
INT 0x10
MOV AL, 0x0D ; return carriage
INT 0x10
; here we do code execution
INC CX
MOV [inputBufUsed], CX
XOR CX, CX
.execl:
; out of bounds checking
CMP CX, [inputBufUsed]
JGE .reset
MOV AH, 1
INT 0x16
JZ .skipesc
MOV BH, AH
MOV AH, 0
INT 0x16
MOV AH, BH
CMP AH, 1
JE .reset
.skipesc:
; fetching character
LEA BX, inputBuf
ADD BX, CX
MOV AL, [GS:BX]
CMP AL, '+'
JE .incr
CMP AL, '-'
JE .decr
CMP AL, '>'
JE .incp
CMP AL, '<'
JE .decp
CMP AL, '.'
JE .disp
CMP AL, ','
JE .read
CMP AL, '['
JE .bjne
CMP AL, ']'
JE .bje
CMP AL, '^'
JE .max
.execle:
INC CX
JMP .execl
.incr:
LEA BX, lowMemAddr
ADD BX, [index]
MOV DL, [ES:BX]
INC DL
MOV [ES:BX], DL
JMP .execle
.decr:
LEA BX, lowMemAddr
ADD BX, [index]
MOV DL, [ES:BX]
DEC DL
MOV [ES:BX], DL
JMP .execle
.incp:
CMP WORD [index], memAddrLength
JE .execle
INC WORD [index]
JMP .execle
.decp:
CMP WORD [index], 0
JE .execle
DEC WORD [index]
JMP .execle
.disp:
LEA BX, lowMemAddr
ADD BX, [index]
MOV AL, [ES:BX]
MOV AH, 0x0E
XOR BH, BH
MOV BL, 0x07
INT 0x10
JMP .execle
.read:
LEA BX, lowMemAddr
ADD BX, [index]
MOV AH, 0x00
INT 0x16
MOV [ES:BX], AL
JMP .execle
.bjne:
LEA BX, lowMemAddr
ADD BX, [index]
MOV DL, [ES:BX]
CMP DL, 0
JNE .execle
; here we go foward
.bjnel:
LEA BX, inputBuf
ADD BX, CX
MOV AL, [GS:BX]
CMP AL, ']'
JE .bjneb
CMP CX, inputBufLength
JE .execle
INC CX
JMP .bjnel
.bjneb:
JMP .execle
.bje:
LEA BX, lowMemAddr
ADD BX, [index]
MOV DL, [ES:BX]
CMP DL, 0
JE .execle
.bjel:
LEA BX, inputBuf
ADD BX, CX
MOV AL, [GS:BX]
CMP AL, '['
JE .bjeb
CMP CX, 0
JE .execle
DEC CX
JMP .bjel
.bjeb:
;INC CX
JMP .execle
.max:
LEA BX, inputBuf
ADD BX, [index]
MOV BYTE [ES:BX], 0xFF
JMP .execle
inputBufUsed:
DW 0
TIMES 510 - ($ - $$) DB 0
DW 0xAA55 | 13.403226 | 47 | 0.634777 |
7e653b99732453e906b61ae7831e3c92772b9b9a | 7,946 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0xca_notsx.log_21829_844.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0xca_notsx.log_21829_844.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0xca_notsx.log_21829_844.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 %r9
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x13abe, %r14
nop
nop
nop
nop
nop
add %r9, %r9
movups (%r14), %xmm6
vpextrq $1, %xmm6, %rsi
sub %rbp, %rbp
lea addresses_WT_ht+0x1971e, %rcx
nop
nop
nop
nop
nop
sub $439, %r10
mov $0x6162636465666768, %rdi
movq %rdi, %xmm2
vmovups %ymm2, (%rcx)
dec %r14
lea addresses_WT_ht+0xccbc, %rbp
nop
nop
nop
nop
cmp $63446, %rcx
movups (%rbp), %xmm3
vpextrq $0, %xmm3, %r14
nop
nop
nop
nop
nop
cmp %rdi, %rdi
lea addresses_UC_ht+0xc2f2, %rsi
lea addresses_UC_ht+0x1d25e, %rdi
nop
nop
sub %rbx, %rbx
mov $34, %rcx
rep movsb
nop
nop
cmp $20096, %rbp
lea addresses_UC_ht+0x337a, %rbp
nop
cmp %r10, %r10
mov (%rbp), %edi
nop
nop
sub $54430, %r9
lea addresses_A_ht+0x1609e, %rsi
lea addresses_D_ht+0xedde, %rdi
clflush (%rdi)
nop
nop
xor $54691, %rbx
mov $42, %rcx
rep movsw
nop
nop
nop
nop
nop
and %r10, %r10
lea addresses_WT_ht+0x17d9e, %rbx
nop
nop
nop
add $6462, %r14
mov $0x6162636465666768, %r10
movq %r10, (%rbx)
nop
nop
nop
nop
nop
dec %rcx
lea addresses_WT_ht+0x81e, %rsi
lea addresses_WC_ht+0x13009, %rdi
clflush (%rsi)
and $14785, %rbx
mov $84, %rcx
rep movsb
nop
cmp $56157, %rcx
lea addresses_WT_ht+0x435e, %rsi
lea addresses_WT_ht+0x329e, %rdi
clflush (%rdi)
nop
nop
xor $63667, %r10
mov $92, %rcx
rep movsq
sub $45193, %r14
lea addresses_UC_ht+0x140de, %rsi
lea addresses_D_ht+0x9796, %rdi
nop
xor $40872, %r14
mov $43, %rcx
rep movsq
nop
nop
nop
nop
nop
sub %rcx, %rcx
lea addresses_UC_ht+0x6b1e, %r10
clflush (%r10)
nop
nop
dec %rdi
mov $0x6162636465666768, %rsi
movq %rsi, %xmm7
vmovups %ymm7, (%r10)
and $58691, %r9
lea addresses_D_ht+0x5a9e, %rsi
lea addresses_WC_ht+0x25b4, %rdi
inc %rbx
mov $92, %rcx
rep movsb
nop
and $32844, %rdi
lea addresses_A_ht+0x620e, %r10
and $12067, %rbp
movb (%r10), %cl
nop
nop
nop
nop
nop
add %rdi, %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r9
pop %r14
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r8
push %rbx
push %rcx
push %rdi
push %rsi
// REPMOV
lea addresses_US+0x1d5de, %rsi
lea addresses_UC+0x101d6, %rdi
nop
nop
inc %r10
mov $31, %rcx
rep movsw
nop
nop
nop
nop
cmp %r8, %r8
// Store
lea addresses_normal+0x1879e, %r12
nop
nop
dec %rbx
mov $0x5152535455565758, %r10
movq %r10, %xmm5
vmovups %ymm5, (%r12)
nop
nop
nop
xor %rcx, %rcx
// Faulty Load
mov $0x7e25d000000071e, %r10
add $61845, %rsi
movb (%r10), %bl
lea oracles, %rdi
and $0xff, %rbx
shlq $12, %rbx
mov (%rdi,%rbx,1), %rbx
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r8
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0, 'same': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_US'}, 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_UC'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 6, 'same': False, 'type': 'addresses_normal'}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 0, 'same': True, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 1, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 10, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 1, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 2, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 2, 'same': True, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 7, 'same': True, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 6, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 7, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 5, 'same': True, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 6, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 5, 'same': False, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 1, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 4, 'same': False, 'type': 'addresses_A_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
*/
| 34.103004 | 2,999 | 0.657941 |
346a0e6a6c86f6004a66d764c7329ff54501a704 | 48,815 | asm | Assembly | Test/Z80/pacalpaca/pengoalpaca.asm | sparks-c16/zasm | c03a31c6d7ec2c2aecb1d6dc6b4ced73b7cf00c4 | [
"BSD-2-Clause"
] | 43 | 2019-12-06T23:46:40.000Z | 2022-03-31T15:34:44.000Z | Test/Z80/pacalpaca/pengoalpaca.asm | sparks-c16/zasm | c03a31c6d7ec2c2aecb1d6dc6b4ced73b7cf00c4 | [
"BSD-2-Clause"
] | 21 | 2019-12-27T01:49:08.000Z | 2022-03-31T15:38:42.000Z | Test/Z80/pacalpaca/pengoalpaca.asm | sparks-c16/zasm | c03a31c6d7ec2c2aecb1d6dc6b4ced73b7cf00c4 | [
"BSD-2-Clause"
] | 13 | 2019-12-27T00:38:46.000Z | 2022-03-15T08:34:51.000Z | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; PengoAlpaca.asm
;
; ALPACA: A Multitasking operating system for Pengo Z80 arcade hardware
;
; Written by
; Scott "Jerry" Lawrence
; alpaca@umlautllama.com
;
; This source file is covered by the LGPL:
;
;; Alpaca - A Multitasking operating system for Z80 arcade hardware
;; Copyright (C) 2003 Scott "Jerry" Lawrence
;; alpaca@umlautllama.com
;;
;; This is free software; you can redistribute it and/or modify
;; it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation; either version
;; 2 of the License, or (at your option) any later version.
;;
;; This software is distributed in the hope that it will be
;; useful, but WITHOUT ANY WARRANTY; without even the implied
;; warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
;; PURPOSE. See the GNU Lesser General Public License for
;; more details.
;;
;; You should have received a copy of the GNU Lesser General
;; Public License along with this library; if not, write to
;; the Free Foundation, Inc., 59 Temple Place, Suite 330,
;; Boston, MA 02111-1307 USA
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; This file is machine generated. Do not edit it by hand!
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
.title alpaca
.module alpaca
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; some constants:
p1_bport = in1
p1_b1 = 5
p2_bport = in1
p1_b1 = 6
stack = 0x8ff0
vidram = 0x8000
colram = 0x8400
ram = 0x8800
dsw0 = 0x9040
in1 = 0x9080
in0 = 0x90c0
specreg = 0x9000
speclen = 0x00ff
sprtbase = 0x8ff2
sprtlen = 0x0010
p1_port = in0
p1_up = 0
p1_down = 1
p1_left = 2
p1_right = 3
p2_port = in1
p2_up = 0
p2_down = 1
p2_left = 2
p2_right = 3
p1_bport = in0
p1_b1 = 7
p2_bport = in1
p1_b1 = 7
start_port = in1
start1 = 5
start2 = 6
coin_port = in0
coin1 = 4
coin2 = 5
coin3 = 6
svc_port = in1
service = 4
sprtMult = 4
sprtColor = 1
sprtIndex = 0
sprtXFlip = 0
bitXFlip = 0
valXFlip = 1
sprtYFlip = 0
bitYFlip = 1
valYFlip = 2
spritebase = 0x8ff2
nsprites = 0x06
spritecoords = 0x9022
v1_wave = 0x9005
v1_freq = 0x9011
v1_vol = 0x9015
v2_wave = 0x900a
v2_freq = 0x9016
v2_vol = 0x901a
v3_wave = 0x900f
v3_freq = 0x901b
v3_vol = 0x901f
irqen = 0x9040
sounden = 0x9041
flipscreen = 0x9043
coincount = 0x9044
watchdog = 0x9070
palbank = 0x9042
collutbank = 0x9046
spritebank = 0x9047
; constants for the task system
stacksize = 192 ; number of bytes per stack
slotTicks = 4 ; number of ticks per slot to start with
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; RAM allocation:
; which task is in which slot (index into tasklist)
slotIdx = (ram + 0) ; 4 bytes, one per slot
slotIdx0 = (ram + 0)
slotIdx1 = (ram + 1)
slotIdx2 = (ram + 2)
slotIdx3 = (ram + 3)
slotOpen = 0xff
; control information for each slot (to be handled by switcher)
slotCtrl = (ram + 4) ; 4 bytes, one per slot
slot0Ctrl = (ram + 4)
slot1Ctrl = (ram + 5)
slot2Ctrl = (ram + 6)
slot3Ctrl = (ram + 7)
C_InUse = 7
C_EXT0 = 4
killSlot = 0
execSlot = 1
sleepSlot = 2
; stack pointers for the four slots
slotSP = (ram + 8) ; 8 bytes, two per slot
slotSP0 = (ram + 8)
slotSP1 = (ram + 10)
slotSP2 = (ram + 12)
slotSP3 = (ram + 14)
; Base of ram for the currently active slot.
ramBase = (ram + 16) ; word
; various flags about the task switcher system
taskFlag = (ram + 18) ; byte
slot0use = 0
slot1use = 1
slot2use = 2
slot3use = 3
taskActive = 7
; the currently active slot number
taskSlot = (ram + 19) ; byte
; how many ticks does this slot have before it gets swapped out
slotTime = (ram + 20) ; byte
; timer counter (word)
timer = (ram + 21)
; random assistance register (byte)
randval = (ram + 23)
; messages
msgbase = (ram + 0x0ca0)
msgmax = (msgbase + 0x003f)
; semaphores
semabase = (ram + 0x0ce0)
semamax = (semabase + 0x0F)
; stack regions for the four tasks
stackbottom = (stack-(stacksize*4)) ; 192 bytes (bottom of stack 3)
stack3 = (stack-(stacksize*3)) ; 192 bytes
stack2 = (stack-(stacksize*2)) ; 192 bytes
stack1 = (stack-(stacksize*1)) ; 192 bytes
stack0 = (stack-(0)) ; top of space - sprite ram
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; area configuration
; we want absolute dataspace, with this area called "CODE"
.area .CODE (ABS)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; RST functions
; RST 00
.org 0x000
.reset00: ; RST 00 - Init
jp .start
; RST 08
.org 0x0008
.reset08: ; RST 08 - Semaphore control
ret
; RST 10
.org 0x0010
.reset10: ; RST 10 - TBD
ret
; RST 18
.org 0x0018
.reset18: ; RST 18 - TBD
ret
; RST 20
.org 0x0020
.reset20: ; RST 20 - TBD
ret
; RST 28
.org 0x0028
.reset28: ; RST 28 - TBD
ret
; RST 30
.org 0x0030
.reset30: ; RST 30 - TBD
ret
; RST 38
.org 0x0038
.reset38: ; RST 38 - Vblank Interrupt Service Routine
jp .isr
; NMI
.org 0x0066
.nmi: ; NMI handler
retn
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; interrupt service routine:
.isr:
di ; disable interrupts (no re-entry!)
push af ; store aside some registers
xor a ; a = 0
ld (irqen), a ; disable external interrupt mechanism
push bc
push de
push hl
push ix
push iy
ld (watchdog), a ; kick the dog
ld bc, (timer) ; bc = timer
inc bc ; bc++
ld (timer), bc ; timer = bc
;; task management stuff
; check for disabled switching
ld hl, (taskFlag)
bit #taskActive, (hl) ; check to see if task switching is on
jr Z, .doneTask ; jp over if switching is disabled
; check to see if any of the control flags are set
; loop throgh all slots
; check for kill
; check for sleep
; check for start
;; check to see if we need to task switch yet
ld hl, #slotTime ; hl = time address
ld c, (hl) ; c = current time for active slot
; check the current value
xor a ; a = 0
cp c ; is C >=0? ( Carry set )
jp C, .noSwitch ; still greater than zero?
;; change to next dormant task (or this one...)
.tsNext:
ld a, (taskSlot) ; a = current task slot (a is try)
ld e, a ; de = current slot
.tsloop1:
inc a ; ++try
and a, #slotMask ; try &= 0x03
ld hl, #(slotCtrl) ; hl = slotCtrl base
ld c, a
ld b, #0x00 ; bc = task number
add hl, bc ; hl = control for this task
bit #C_InUse, (hl) ; check the flag
jr NZ, .tsloop1 ; if not active, inc again
; compare selected task with "current"
ld a, e ; A = current (again)
cp c ; compare A(curr) and C(try)
jr Z, .overslot1 ; skip this next bit if we're there
.storeTheSP:
; snag the SP into IX
ld ix, #0x0000 ; zero ix
add ix, sp ; ix = SP
; setup HL as ram location to store SP
ld hl, #(slotSP) ; hl = base of slotSP array
ld d, #0x00 ; de = current slot
rlc e ; = current slot * 2
; bc still contains the try value
add hl, de ; hl = base of current slot SP
push ix ; de
pop de ; = SP
; store the current SP
ld (hl), e ; (hl) =
inc hl
ld (hl), d ; = de (really SP)
.loadInTheSP:
; swap in the new SP
ld d, #0
ld e, c ; de = new slot number
rlc e ; = new slot number * 2
ld hl, #(slotSP) ; hl = base of slotSP array
add hl, de ; hl = base of new slot SP
; snag it and shove it into place
ld e, (hl) ; de =
inc hl
ld d, (hl) ; = new sp
ld h, d ; hl =
ld l, e ; = sp
ld sp, hl ; new SP!
.setupVars:
; set up reference variables
ld a, c ; a = c
ld (taskSlot), a ; taskSlot = new slot number
; set up ramBase
ld hl, #(stackList) ; hl = base of stackList array
ld e, c ; e = new slot
inc e ; e = new slot + 1
rlc e ; e = (new slot + 1) * 2
ld d, #0 ; de = (new slot + 1) * 2
add hl, de ; = index of this slot + 1 word
ld c, (hl) ; bc =
inc hl
ld b, (hl) ; = new ramBase item
ld hl, #(ramBase)
ld (hl), c ; ramBase =
inc hl
ld (hl), b ; = correct value!
.overslot1:
ld hl, #slotTime ; hl = time address
ld (hl), #slotTicks ; reset the ticks for this task
.noSwitch:
; decrement the slot timer
ld hl, #slotTime ; hl = time address
ld c, (hl) ; c = current time for active slot
dec c ; current time --
ld (hl), c ; store the current time
.doneTask:
; restore the registers
pop iy
pop ix
pop hl
pop de
pop bc
ld a, #0x01 ; a = 1
ld (irqen), a ; enable external interrupt mechanism
pop af
ei ; enable processor interrupts
reti ; return from interrupt routine
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; the core OS stuff:
; initialization and splash screen
.start:
di ; disable processor interrupts
ld sp, #(stack) ; setup the initial stack pointer
im 1 ; setup interrupt mode 1
;; clear the special registers
ld a, #0x00 ; a = 0x00
ld hl, #(specreg) ; hl = start of special registers
ld b, #(speclen) ; b = 0xC0 bytes to zero
call memset256 ; 0x5000-0x50C0 will get 0x00
;; clear sprite registers
ld a, #0x00 ; a = 0x00
ld hl, #(sprtbase) ; hl = start of sprite registers
ld b, #(sprtlen) ; b = 0x10 16 bytes
call memset256 ; 0x4ff0-0x4fff will get 0x00
;; clear the screen ram
call cls ; clear the screen RAM
;; clear user ram
ld hl, #(ram) ; hl = base of RAM
ld a, #0x03 ; a = 0
ld b, #0x02 ; b = 2 blocks of 256 bytes to clear
call memsetN ; clear the blocks
;; initialize tasks
; clear flags
xor a ; a = 0
ld (taskFlag), a ; clear all task flags
; clear the dormant stack pointers (set all four to 0x0000)
xor a ; a = 0
ld b, #8 ; 8 bytes (4 one-word variables)
ld hl, #(slotSP) ; base of slot stack pointers
call memset256 ; clear it
; set all slots as open
ld a, #(slotOpen) ; a = openslot
ld b, #4 ; 4 bytes
ld hl, #(slotIdx) ; base of slot index bytes
call memset256
; clear control bytes
xor a ; a = 0
ld b, #4 ; 4 bytes
ld hl, #(slotCtrl) ; base of slot control bytes
call memset256
; clear taskSlot
xor a ; a = 0
ld (taskSlot), a ; taskSlot = 0
; enable the task switcher
ld hl, (taskFlag)
set #taskActive, (hl) ; set the flag
;; setup pac interrupts
ld a, #0xff ; fill register 'a' with 0xff
out (0x00), a ; send the 0xff to port 0x00
ld a, #0x01 ; fill register 'a' with 0x01
ld (irqen), a ; enable the external interrupt mechanism.
ei
; Splash screen!
.splash:
call guicls
; draw out the llama!
ld hl, #(llama1) ; top half of llama
ld bc, #0x0d09
ld a, #(LlamaC)
call putstrB
ld hl, #(llama2) ; bottom half of llama
inc c
call putstrB
; draw out the copyright notice and version info
ld hl, #(cprt1)
ld bc, #0x060f
ld a, #0x00 ; black text
call putstrB ; top black border
ld bc, #0x0611
call putstrB ; bottom black border
ld hl, #(cprt1)
ld a, #0x14 ; yellow text
ld bc, #0x0610
call putstrB ; 'Alpaca OS...'
ld hl, #(cprt2)
ld a, #0x0b ; cyan text
ld bc, #0x041e
call putstrB ; '(C) 2003...
ld hl, #(cprt3)
ld bc, #0x0200
call putstrC ; email addy
; the core task
.coretask:
; set up sprite 1 as the flying llama
ld ix, #(sprtbase)
ld a, #(LlamaFS*sprtMult)
ld sprtIndex(ix), a
ld a, #(3) ; decent llama color
ld sprtColor(ix), a
;; set up sprite 2 and 3
ld ix, #(sprtbase)
ld a, #4 ;(hardcoded for now)
ld 2+sprtIndex(ix), a
ld 4+sprtIndex(ix), a
ld a, #(3) ;0x12
ld 2+sprtColor(ix), a
ld 4+sprtColor(ix), a
foo:
; do a lissajous on the screen with the first sprite (arrow cursor)
;; X
ld ix, #(spritecoords)
ld bc, (timer)
rlc c ; *2
rlc c ; *2
call sine
rrca
and #0x7f
add #0x40
ld sprtIndex(ix), a
;; Y
ld bc, (timer)
;rlc c
call cosine
rrca
and #0x7f
add #0x40
ld sprtColor(ix), a
; try to hug a screen refresh
ld bc, #1
call sleep
jp foo
halt
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; some helpful utility functions
; memset256
;; memset256 - set up to 256 bytes of ram to a certain value
; in a value to poke
; in b number of bytes to set 0x00 for 256
; in hl base address of the memory location
; out -
; mod hl, bc
memset256:
ld (hl), a ; *hl = 0
inc hl ; hl++
djnz memset256 ; decrement b, jump to memset256 if b>0
ret ; return
; memsetN
;; memsetN - set N blocks of ram to a certain value
; in a value to poke
; in b number of blocks to set
; in hl base address of the memory location
; out -
; mod hl, bc
memsetN:
push bc ; set aside bc
ld b, #0x00 ; b = 256
call memset256 ; set 256 bytes
pop bc ; restore the outer bc
djnz memsetN ; if we're not done, set another chunk.
ret ; otherwise return
; clear screen
;; cls - clear the screen (color and video ram)
; in -
; out -
; mod -
cls:
push hl ; set aside some registers
push af
push bc
ld hl, #(vidram) ; base of video ram
ld a, #0x00 ; clear the screen to 0x00
ld b, #0x08 ; need to set 256 bytes 8 times.
call memsetN ; do it.
pop bc ; restore the registers
pop af
pop hl
ret ; return
; clear screen (gui tile version)
;; guicls - clear the screen to the GUI background
; in -
; out -
; mod -
guicls:
push hl ; set aside some registers
push af
push bc
; fill the screen with the background color
ld hl, #(colram) ; color ram
ld a, #(PwpC) ; color
ld b, #0x04 ; 4 blocks
call memsetN
; fill the screen with the background tile
ld hl, #(vidram) ; character ram
ld a, #(PwpS) ; background tile
ld b, #0x04 ; 4 blocks
call memsetN
pop bc ; restore the registers
pop af
pop hl
ret ; return
; rand
;; rand - get a random number
; in -
; out a random number 0..256
; mod flags
rand:
; set aside registers
push hl
push bc
; compute a random number
ld hl, (randval) ; hl = last random number
push hl
pop bc ; bc = hl
call sine ; a = sine (c)
ld c, a ; c = sine ( last value )
.r01:
ld a, r ; a = R
add a, c ; a += sine( last value )
ld c, a ; c = sine( last value ) + R
.r02:
add hl, bc ; rnd += sin ( last value ) + R
ld bc, (timer)
add hl, bc ; rnd += timer
ld (randval), hl ; hl = computed random (rnd)
ld a, (randval) ; a = rnd
; restore registers
pop bc
pop hl
; return
ret
; sine
;; sine - get the sine of a
; in c value to look up
; out a sine value 0..256
; mod -
sine:
; set aside registers
push hl
push bc
; look up the value in the sine table
ld hl, #(.sinetab) ; hl = sinetable base
ld b, #0x00 ; b = 0
add hl, bc ; hl += bc
ld a, (hl) ; a = sine(c)
; restore registers
pop bc
pop hl
; return
ret
; cosine
;; cosine - get the cosine of a
; in c value to look up
; out a cosine value 0..256
; mod f
cosine:
; set aside registers
push bc
; add 180 degrees, call sine
ld a, #0x3f
add a, c
ld c, a
call sine
; restore registers
pop bc
; return
ret
; text justification
;; textcenter - adjust the x ordinate
; in hl pascal string
; in b x ordinate
; in c y ordinate BC -> 0xXXYY
; out -
; mod b adjusted for center
hscrwide = 14
textcenter:
; set aside registers
push af
; halve the width
ld b, (hl) ; b = length of text
jp NC, .tcrr ; make sure carry is cleared
ccf
.tcrr:
rr b ; b = half of text length
; add on the center position
ld a, #hscrwide ; a = screenwidth/2
sub b ; a = screenwidth/2 - textlength/2
ld b, a ; b = that result
; restore registers
pop af
; return
ret
;; textright - adjust the x ordinate
; in hl pascal string
; in b x ordinate
; in c y ordinate BC -> 0xXXYY
; out -
; mod b adjusted for right
textright:
; set aside registers
push af
; halve the width
ld a, b ; a = start location
ld b, (hl) ; b = length of text
sub b ; a = start loc - length
ld b, a ; b = new position
; restore registers
pop af
; return
ret
; xy2offs
;; xy2offsB - get the vid/color buffer offset of the X Y coordinates
; in b x ordinate
; in c y ordinate BC -> 0xXXYY
; out hl offset
; mod -
xy2offsB:
; set aside registers
push af
push bc
push de
push ix
; set aside Y for later in DE
ld d, #0x00 ; d = 0
ld e, c ; shove Y into E
; get the base offset
ld ix, #(.scroffs) ; ix = offset table base
; add in X component
;; XXXXJJJJJ This can probably be shortened if we
;; drop the range check.
ld a, b ; shove X into A
and a, #0x1f ; make sure X is reasonable
rlc a ; x *= 2
ld c, a ; c = offset * 2
ld b, #0x00 ; b = 0
add ix, bc ; ix += bc
; retrieve that value into HL
ld b, 1(ix)
ld c, 0(ix)
push bc
pop hl ; hl = scroffs[x]
; add in Y component
add hl, de ; hl += DE hl = scroffs[x]+y
; restore registers
pop ix
pop de
pop bc
pop af
; return
ret
;; xy2offAC - get the vid/color buffer offset of the X Y coordinates
; in b x ordinate
; in c y ordinate BC -> 0xXXYY
; out hl offset
; mod -
xy2offsAC:
; set aside registers
push bc
push de
push ix
; generate the X component into DE
ld d, #0x00 ; d = 0
ld e, b ; e = X
; get the base offset
ld ix, #(.acoffs) ; ix = offset table base
; add in the y component. (BC)
ld b, #0x00 ; zero B (top of BC)
rlc c ; y *= 2
add ix, bc ; offset += index
; retrieve that value into HL
ld b, 1(ix)
ld c, 0(ix)
push bc
pop hl ; hl = acroffs[x]
; subtract out the X component.
sbc hl, de ; hl -= DE hl = acoffs[y]-x
; restore registers
pop ix
pop de
pop bc
; return
ret
; putstr
;; putstrA - get the vid/color buffer offset of the X Y coordinates
; in hl pointer to the string (asciz)
; in b x position
; in c y position
; in a color
; out -
; mod -
putstrA:
; set aside registers
push bc
.psChook: ; this is where putstrC joins in...
push hl
push de
push ix
push iy
; compute the offsets
push hl ; set aside the string pointer
call xy2offsAC
push hl
pop ix ; move the offset into ix (char ram)
push hl
pop iy ; move the offset into iy (color ram)
ld de, #(vidram) ; base of video ram
add ix, de ; set IX to appropriate location in vid ram
ld de, #(colram) ; base of color ram
add iy, de ; set IY to appropriate location in color ram
; prep for the loop
pop hl
ld b, (hl) ; b is the number of bytes (pascal string)
inc hl ; HL points to the text now
.pstra1:
; loop for each character
ld c, (hl) ; c = character
ld (ix), c ; vidram[b+offs] = character
ld (iy), a ; colram[b+offs] = color
; adjust pointers
inc hl ; inc string location
dec ix ; dec char ram pointer
dec iy ; dec color ram pointer
djnz .pstra1 ; dec b, jump back if not done
; restore registers
pop iy
pop ix
pop de
pop hl
pop bc
; return
ret
;; putstrB - get the vid/color buffer offset of the X Y coordinates
; in hl pointer to the string (asciz)
; in b x position
; in c y position
; in a color
; out -
; mod -
offsadd = -32
putstrB:
; set aside registers
push hl
push bc
push de
push ix
push iy
push hl
; compute the offsets
call xy2offsB ; hl = core offset
push hl
pop ix ; move the offset into ix (char ram)
push hl
pop iy ; move the offset into iy (color ram)
ld de, #(vidram) ; base of video ram
add ix, de ; set IX to appropriate location in vid ram
ld de, #(colram) ; base of color ram
add iy, de ; set IY to appropriate location in color ram
; prep for the loop
pop hl
ld b, (hl) ; b is the number of bytes (pascal string)
inc hl ; HL points to the text now
ld de, #offsadd ; set up the column offset
.pstrb1:
; loop for each character
ld c, (hl) ; c = character
ld (ix), c ; vidram[b+offs] = character
ld (iy), a ; colram[b+offs] = color
; adjust pointers
inc hl ; inc string location
add ix, de ; add in offset into char ram
add iy, de ; add in offset into color ram
djnz .pstrb1 ; dec b, jump back if not done
; restore registers
pop iy
pop ix
pop de
pop bc
pop hl
; return
ret
;; putstrC - get the vid/color buffer offset of the X Y coordinates
; in hl pointer to the string (asciz)
; in b x position
; in c y position
; in a color
; out -
; mod -
putstrC:
; set aside registers
push bc
inc c ; just change indexing 0,1 into 2,3
inc c
jp .psChook ; jump back into putstrA
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; semaphore control
; lock semaphore
;; semalock - lock a semaphore
; in a which semaphore to lock
; out -
; mod -
semalock:
; set aside registers
push af
push bc
push hl
; set up the address
and #0x0f ; limit A to 0..15
ld c, a ; c is the current semaphore number
ld b, #0x00 ; make sure that b=0 (bc = 0x00SS)
ld hl, (semabase) ; hl = base address
add hl, bc ; hl = address of this semaphore
.sl2:
bit 1, (hl)
jr NZ, .sl2 ; while it's set, loop
; set the bit
set 1, (hl) ; lock the semaphore
; restore registers
pop hl
pop bc
pop af
; return
ret
; release semaphore
;; semarel - release a semaphore
; in a which semaphore to release
; out -
; mod -
semarel:
; set aside registers
push af
push bc
push hl
; set up the address
and #0x0F ; limit A to 0..15
ld c, a ; c is the current semaphore number
ld b, #0x00 ; b=0 (bc = 0x000S)
ld hl, (semabase) ; hl = base address
add hl, bc ; hl = address of this semaphore
; clear the semaphore
res 1, (hl) ; clear the bit
; restore registers
pop hl
pop bc
pop af
; return
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; task exec, kill, and sleep routines
;; execstart - starts up a new task
; in E task number to start
; in D task slot to use (0..3)
; out -
; mod -
execstart:
; save registers we're using
push af
push de
push bc
push hl
; limit E (task) to 127
res 7, e ; limit task number to 127
; limit D (slot)
ld a, d ; a=d
and #0x03 ; slot is 0,1,2, or 3
ld c, a ; c=a
ld b, #0x00 ; b=0x00, bc = 0x000S
; set the control value
ld hl, #(taskctrl) ; set up the control register
add hl, bc ; hl = base + offset
ld (hl), e ; taskctrl[d] = e
; restore the registers
pop hl
pop bc
pop de
pop af
; return
ret
;; execkill - kills a running task
; in D task slot to kill
; out -
; mod -
execkill:
; save registers we're using
push af
push de
push bc
push hl
; limit D (slot) and shove it into C
ld a, d ; a=d
and #0x03 ; slot is 0,1,2, or 3
ld c, a ; c=a
ld b, #0x00 ; b=0x00, bc = 0x000S
; set the control value
ld hl, #(taskctrl) ; set up the control register
add hl, bc ; hl = base + offset
ld (hl), #(killslot) ; taskctrl[d] = KILL!
; restore the registers
pop hl
pop bc
pop de
pop af
; return
ret
;; sleep - wait a specified number of ticks
; in bc number of ticks to wait
; out -
; mod -
sleep:
; set side some registers
push bc
push af
push hl
;; this is where we would set the flag for
;; the exec system to relinquish the rest of our time.
; compute the timeout into BC
ld hl, (timer) ; hl = timer
add hl, bc ; hl += ticks to wait
push hl ; bc =
pop bc ; = hl
.slp:
; loop until the timeout comes
ld hl, (timer) ; hl = current time
sbc hl, bc ; set flags
jp M, .slp ; if (HL >= BC) then JP .slp2
; restore the registers
pop hl
pop af
pop bc
; return
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; The tasks
; task list -- list of all available tasks
; list of all tasks available, null terminated
tasklist:
.word t0header
.word t1header
.word t2header
.word t3header
.word 0x0000
;;;;;;;;;;;;;;;;;;;;
; task number 0
;; Task 0 - PTUI
; constants
; GUI constants
; cursor and wallpaper
PcursorS = 0 ; sprite 0 for the cursor
PcursorC = 9 ; color 9 for the cursor
CrosshFS = 1 ; crosshair for window movement
CrosshC = 0x09 ; crosshair color
PwpS = 162 ; wallpaper sprite
PwpC = 0x10 ; wallpaper color 0x13- blues
LlamaC = 0x10 ; llama color (might be the same as PwpC above)
LlamaS = 0x7b ; base of llama tile
LlamaFS = 2 ; llama floating sprite
CprtC = 0x14 ; copyright color 11
; flags
F_Noframe = 1 ; no frame in render (hard flag)
F_Frame = 2 ; frame in render (hard flag)
F_Dirty = 1 ; frame needs redraw (soft flag)
F_Focus = 2 ; frame is capturing focus currently
; -- frame widgets --
; close
PcloseS = 128 ; close widget sprite
PcloseCS = 1 ; close widget selected color (5)
PcloseCU = 0x1e ; close widget unselected color
; raise
PraiseS = 131 ; raise widget sprite
PraiseCS = 1 ; raise widget selected color (5)
PraiseCU = 0xc ; raise widget unselected color
; -- frame ornaments --
PfrmTSel = 9 ; dragbar text selected color 0x14 0xb
PfrmTUns = 1 ; dragbar text unselected color
PfrmCSel = 1 ; frame selected color
PfrmCUns = 0x1e ; frame unselected color
; bottom corners
PSWcornS = 138 ; southwest corner
PSEcornS = 139 ; southeast corner
; top corners
PNWcornS = 1 ; northwest corner 140
PNEcornS = 1 ; northeast corner 141
; top bar
PfN_W = 129 ; top left (145 or 129)
PfN_N = 32 ; top center (146 or 32)
PfN_E = 130 ; top right (147 or 130)
; left bar
PfW_N = 132 ; left top
PfW_W = 133 ; left center
PfW_S = 134 ; left bottom
; right bar
PfE_N = 135 ; right top
PfE_E = 136 ; right center
PfE_S = 137 ; right bottom
; bottom bar
PfS_W = 142 ; bottom left
PfS_S = 143 ; bottom center
PfS_E = 144 ; bottom right
; widgets
PwC = 1 ; generic widget color
PwBGS = 127 ; window background sprite
; button
PwbLuS = 148 ; [ button left unselected sprite
PwbRuS = 149 ; ] button right unselected sprite
; selected button
PwbLsS = 150 ; [[ button left selected sprite
PwbRsS = 151 ; ]] button right selected sprite
; checkbox
PwcuS = 152 ; [ ] checkbox unselected sprite
PwcsS = 153 ; [X] checkbox selected sprite
; radio box
PwruS = 154 ; ( ) radio unselected sprite
PwrsS = 155 ; (X) radio selected sprite
; slider
PwsnS = 156 ; === slider notch sprite
PwsbS = 157 ; =|= slider bar sprite
; progress bar
PwpoS = 158 ; progress bar open sprite
PwpfS = 159 ; ### progress bar filled sprite
; spin
PwHsS = 160 ; <> horizontal spin controller
PwVsS = 161 ; ^v vertical spin controller
; Widget Types (for the frame-widget table)
W_End = 0 ; end of the widget list
W_Frame = 1 ; window frame (needs to be first)
; frame flags:
FF_Border = 1 ; use a border on the frame
FF_NClose = 2 ; no close button
FF_NRaise = 4 ; no raise button
W_MButton = 2 ; momentary button
W_SButton = 3 ; sticky button
W_Radio = 4 ; radio button (flags is the group number)
W_Check = 5 ; check button
W_SText = 6 ; static text (text is the idx of a string)
W_DText = 7 ; dynamic text (data is idx of ram)
W_DInt = 8 ; dynamic integer (data is idx in the ram)
W_HSlider = 9 ; horizontal slider
W_VSlider = 10 ; vertical slider
W_HSpin = 11 ; horizontal spin
W_VSpin = 12 ; vertical spin
; header
t0header:
.byte 0xc9, 0x4a, 0x73, 0x4c ; cookie
.byte 0x01 ; version
.byte 0x04 ; requested timeslices
.word t0name ; name
.word t0process ; process function
t0name:
.byte 6 ; strlen
.asciz "Task 0" ; name
; routines
t0process:
ld hl, #(colram) ; base of color ram
ld a, #0x01 ; clear the screen to 0x00
ld b, #0x04 ; 256*4 = 1k
call memsetN ; do it.
t0p2:
ld hl, #(vidram) ; base of video ram
ld a, #0x41 ; 'A'
ld b, #0x04 ; 256*4 = 1k
call memsetN
ld hl, #(vidram) ; base of video ram
ld a, #0x42 ; 'B'
ld b, #0x04 ; 256*4 = 1k
call memsetN
ld hl, #(vidram) ; base of video ram
ld a, #0x43 ; 'C'
ld b, #0x04 ; 256*4 = 1k
call memsetN
jp t0p2
halt
;;;;;;;;;;;;;;;;;;;;
; task number 1
;; Task 1 - TBD
; header
t1header:
.byte 0xc9, 0x4a, 0x73, 0x4c ; cookie
.byte 0x01 ; version
.byte 0x04 ; requested timeslices
.word t1name ; name
.word t1process ; process function
t1name:
.byte 6 ; strlen
.asciz "Task 1" ; name
; routines
t1process:
ld hl, #(colram) ; base of color ram
ld a, #0x01 ; clear the screen to blue
ld b, #0x04 ; 256*4 = 1k
call memsetN
ld hl, #(colram) ; base of color ram
ld a, #0x09 ; clear the screen to red
ld b, #0x04 ; 256*4 = 1k
call memsetN
jp t1process
halt
;;;;;;;;;;;;;;;;;;;;
; task number 2
;; Task 2 - TBD
; header
t2header:
.byte 0xc9, 0x4a, 0x73, 0x4c ; cookie
.byte 0x01 ; version
.byte 0x04 ; requested timeslices
.word t2name ; name
.word t2process ; process function
t2name:
.byte 6 ; strlen
.asciz "Task 2" ; name
; routines
t2process:
ld hl, #(colram) ; base of color ram
ld a, #0x01 ; clear the screen to 0x00
ld b, #0x04 ; 256*4 = 1k
call memsetN
ld hl, #(vidram) ; base of video ram
ld a, #0x61 ; 'a'
ld b, #0x04 ; 256*4 = 1k
call memsetN
ld hl, #(vidram) ; base of video ram
ld a, #0x62 ; 'b'
ld b, #0x04 ; 256*4 = 1k
call memsetN
ld hl, #(vidram) ; base of video ram
ld a, #0x63 ; 'c'
ld b, #0x04 ; 256*4 = 1k
call memsetN
jp t2process
halt
;;;;;;;;;;;;;;;;;;;;
; task number 3
;; Task 3 - TBD
; header
t3header:
.byte 0xc9, 0x4a, 0x73, 0x4c ; cookie
.byte 0x01 ; version
.byte 0x04 ; requested timeslices
.word t3name ; name
.word t3process ; process function
t3name:
.byte 6 ; strlen
.asciz "Task 3" ; name
; routines
t3process:
ld hl, #(colram) ; base of color ram
ld a, #0x01 ; clear the screen to 0x00
ld b, #0x04 ; 256*4 = 1k
call memsetN
ld hl, #(vidram) ; base of video ram
ld a, #0x78 ; 'X'
ld b, #0x04 ; 256*4 = 1k
call memsetN
ld hl, #(vidram) ; base of video ram
ld a, #0x79 ; 'Y'
ld b, #0x04 ; 256*4 = 1k
call memsetN
ld hl, #(vidram) ; base of video ram
ld a, #0x7a ; 'Z'
ld b, #0x04 ; 256*4 = 1k
call memsetN
jp t3process
halt
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; The Data
; splash strings
llama1:
.byte 0x02, (LlamaS+0), (LlamaS+1) ; first row of llama
llama2:
.byte 0x02, (LlamaS+2), (LlamaS+3) ; second row of llama
cprt1:
.byte 0x10
.ascii " Alpaca OS v0.8 "
cprt2:
.byte 0x14
.ascii "/2003 Jerry Lawrence"
cprt3:
.byte 0x18
.ascii "alpacaOS@umlautllama.com"
; Some tables for the Task Switcher
; table of stack/user RAM usage (stacks, ram)
stacklist:
.word stack0
.word stack1
.word stack2
.word stack3
.word stackbottom
; The sine table
.sinetab:
.byte 0x80, 0x83, 0x86, 0x89, 0x8c, 0x8f, 0x92, 0x95
.byte 0x99, 0x9c, 0x9f, 0xa2, 0xa5, 0xa8, 0xab, 0xae
.byte 0xb1, 0xb4, 0xb6, 0xb9, 0xbc, 0xbf, 0xc2, 0xc4
.byte 0xc7, 0xc9, 0xcc, 0xcf, 0xd1, 0xd3, 0xd6, 0xd8
.byte 0xda, 0xdc, 0xdf, 0xe1, 0xe3, 0xe5, 0xe7, 0xe8
.byte 0xea, 0xec, 0xee, 0xef, 0xf1, 0xf2, 0xf3, 0xf5
.byte 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd
.byte 0xfd, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff
.byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfe, 0xfd
.byte 0xfd, 0xfc, 0xfb, 0xfb, 0xfa, 0xf9, 0xf8, 0xf7
.byte 0xf5, 0xf4, 0xf3, 0xf1, 0xf0, 0xee, 0xed, 0xeb
.byte 0xe9, 0xe8, 0xe6, 0xe4, 0xe2, 0xe0, 0xde, 0xdb
.byte 0xd9, 0xd7, 0xd5, 0xd2, 0xd0, 0xcd, 0xcb, 0xc8
.byte 0xc6, 0xc3, 0xc0, 0xbd, 0xbb, 0xb8, 0xb5, 0xb2
.byte 0xaf, 0xac, 0xa9, 0xa6, 0xa3, 0xa0, 0x9d, 0x9a
.byte 0x97, 0x94, 0x91, 0x8e, 0x8b, 0x87, 0x84, 0x81
.byte 0x7e, 0x7b, 0x78, 0x74, 0x71, 0x6e, 0x6b, 0x68
.byte 0x65, 0x62, 0x5f, 0x5c, 0x59, 0x56, 0x53, 0x50
.byte 0x4d, 0x4a, 0x47, 0x44, 0x42, 0x3f, 0x3c, 0x39
.byte 0x37, 0x34, 0x32, 0x2f, 0x2d, 0x2a, 0x28, 0x26
.byte 0x24, 0x21, 0x1f, 0x1d, 0x1b, 0x19, 0x17, 0x16
.byte 0x14, 0x12, 0x11, 0x0f, 0x0e, 0x0c, 0x0b, 0x0a
.byte 0x08, 0x07, 0x06, 0x05, 0x04, 0x04, 0x03, 0x02
.byte 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00
.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x02
.byte 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09
.byte 0x0a, 0x0c, 0x0d, 0x0e, 0x10, 0x11, 0x13, 0x15
.byte 0x17, 0x18, 0x1a, 0x1c, 0x1e, 0x20, 0x23, 0x25
.byte 0x27, 0x29, 0x2c, 0x2e, 0x30, 0x33, 0x36, 0x38
.byte 0x3b, 0x3d, 0x40, 0x43, 0x46, 0x49, 0x4b, 0x4e
.byte 0x51, 0x54, 0x57, 0x5a, 0x5d, 0x60, 0x63, 0x66
.byte 0x6a, 0x6d, 0x70, 0x73, 0x76, 0x79, 0x7c, 0x7f
; The XY-offset table
.scroffs:
.word 0x03a0, 0x0380, 0x0360, 0x0340
.word 0x0320, 0x0300, 0x02e0, 0x02c0
.word 0x02a0, 0x0280, 0x0260, 0x0240
.word 0x0220, 0x0200, 0x01e0, 0x01c0
.word 0x01a0, 0x0180, 0x0160, 0x0140
.word 0x0120, 0x0100, 0x00e0, 0x00c0
.word 0x00a0, 0x0080, 0x0060, 0x0040
; The Region A and C offset table
.acoffs:
.word 0x03dd ; Region A row 'E' -> AC row 0
.word 0x03fd ; Region A row 'F' -> AC row 1
.word 0x001d ; Region C row 'A' -> AC row 2
.word 0x003d ; Region C row 'B' -> AC row 3
| 34.694385 | 80 | 0.413602 |
cf3ca298f25bcaa7bcd2bd77e5f7aaafb83f5a47 | 56,017 | asm | Assembly | Library/Math/Float/floatFloatToAscii.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/Math/Float/floatFloatToAscii.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/Math/Float/floatFloatToAscii.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z |
COMMENT @-----------------------------------------------------------------------
Copyright (c) Geoworks 1991 -- All Rights Reserved
PROJECT: PC GEOS
MODULE:
FILE: floatFloatToAscii.asm
AUTHOR: Cheng, 3/91
ROUTINES:
Name Description
---- -----------
FloatFloatToAscii_StdFormat Global routine that save the caller
from having to deal with the
FFA_stackFrame.
FloatFloatToAscii Global routine that expects the
FFA_stackFrame.
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 3/91 Initial revision
witt 10/93 DBCS string routines and such..
DESCRIPTION:
$Id: floatFloatToAscii.asm,v 1.1 97/04/05 01:23:00 newdeal Exp $
-------------------------------------------------------------------------------@
COMMENT @-----------------------------------------------------------------------
FUNCTION: FloatFloatToAscii_StdFormat
DESCRIPTION: Converts the floating point number into an ASCII string
in the format specified by al.
This routine provides a way to obtain an ASCII string from
a floating point number without having to deal with the
FFA_stackFrame.
!!! NOTE !!!
Rounding is based on decimalDigits and not total Digits.
CALLED BY: GLOBAL ()
PASS: ax - FloatFloatToAsciiFormatFlags
Flags permitted:
FFAF_FROM_ADDR - source of number
If FFAF_FROM_ADDR=1,
Use the number at the given address
ds:si - location
If FFAF_FROM_ADDR=0,
Use number from the fp stack.
Number will be popped
FFAF_SCIENTIFIC - scientific format
If FFAF_SCIENTIFIC=1,
Returns numbers in the form x.xxxE+xxx
in accordance with bh and bl
Numbers are normalized ie. the mantissa m satisfies
1 <= m < 10
If FFAF_SCIENTIFIC=0,
Returns numbers in the form xxx.xxx
in accordance with bh and bl
FFAF_PERCENT - percentage format
Returns numbers in the form xxx.xxx%
in accordance with bh and bl
FFAF_USE_COMMAS
FFAF_NO_TRAIL_ZEROS
bh - number of significant digits desired (>=1)
(A significant digit is a decimal digit derived from
the floating point number's mantissa and it may preceed
or follow a decimal point).
Fixed format numbers that require more digits than limited
will be forced into scientific notation.
bl - number of fractional digits desired (ie. number of
digits following the decimal point)
es:di - destination address of string
NOTE:
-----
* Numbers are rounded away from 0.
eg. if number of fractional digits desired = 1,
0.56 will round to 1
-0.56 will round to -1
* Commas only apply to the integer portion of fixed and
percentage format numbers.
ie. scientific formats, the fractional and exponent portions
of numbers will have no commas even if FFAF_USE_COMMAS is
passed.
RETURN: cx - number of characters in the string
(excluding the null terminator)
cx == 0 menas that the string produced was a Nan, i.e
either "underflow", "overflow", or "error"
DESTROYED: nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 1/91 Initial version
-------------------------------------------------------------------------------@
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FloatFloatToAscii_StdFormatInternal
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: internal call to FloatFloatToAscii_StdFormat
CALLED BY: INTERNAL
see header directoly above for details
exported for coprocessor libriaries
REVISION HISTORY:
Name Date Description
---- ---- -----------
jimmy 10/29/92 Initial version.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
global FloatFloatToAscii_StdFormatInternal:far
FloatFloatToAscii_StdFormatInternal proc far
call FloatFloatToAscii_StdFormat
ret
FloatFloatToAscii_StdFormatInternal endp
FloatFloatToAscii_StdFormat proc far uses ax
locals local FFA_stackFrame
.enter
;
; check for illegal bits
;
EC< test ax, mask FFAF_HEADER_PRESENT or \
mask FFAF_TRAILER_PRESENT or \
mask FFAF_SIGN_CHAR_TO_FOLLOW_HEADER or \
mask FFAF_SIGN_CHAR_TO_PRECEDE_TRAILER >
EC< ERROR_NZ FLOAT_BAD_FLAGS >
mov locals.FFA_float.FFA_params.formatFlags, ax
clr ax
mov locals.FFA_float.FFA_params.decimalOffset, al
mov locals.FFA_float.FFA_params.totalDigits, bh
mov locals.FFA_float.FFA_params.decimalLimit, bl
if DBCS_PCGEOS
mov locals.FFA_float.FFA_params.header, ax
mov locals.FFA_float.FFA_params.trailer, ax
mov locals.FFA_float.FFA_params.preNegative, '-'
mov locals.FFA_float.FFA_params.preNegative+2, ax
mov locals.FFA_float.FFA_params.postNegative, ax
mov locals.FFA_float.FFA_params.prePositive, ax
mov locals.FFA_float.FFA_params.postPositive, ax
else
mov locals.FFA_float.FFA_params.header, al
mov locals.FFA_float.FFA_params.trailer, al
mov {word} locals.FFA_float.FFA_params.preNegative, '-'
mov locals.FFA_float.FFA_params.postNegative, al
mov locals.FFA_float.FFA_params.prePositive, al
mov locals.FFA_float.FFA_params.postPositive, al
endif
call FloatFloatToAscii
.leave
ret
FloatFloatToAscii_StdFormat endp
if 0
FloatFloatToAscii_CurrencyFormat proc near uses ax
locals local FFA_stackFrame
.enter
mov locals.FFA_float.FFA_params.formatFlags, mask FFAF_USE_COMMAS or \
mask FFAF_HEADER_PRESENT
DBCS< .assert (size char) eq (size wchar) ; need to DBCS routine >
clr al
mov locals.FFA_float.FFA_params.decimalOffset, al
mov locals.FFA_float.FFA_params.totalDigits, bh
mov locals.FFA_float.FFA_params.decimalLimit, 2
; mov locals.FFA_float.FFA_params.header, al
mov locals.FFA_float.FFA_params.trailer, al
mov locals.FFA_float.FFA_params.preNegative, '('
mov locals.FFA_float.FFA_params.postNegative, ')'
mov locals.FFA_float.FFA_params.prePositive, al
mov locals.FFA_float.FFA_params.postPositive, al
call FloatFloatToAscii
.leave
ret
FloatFloatToAscii_CurrencyFormat endp
endif
COMMENT @-----------------------------------------------------------------------
FUNCTION: FloatFloatToAscii
DESCRIPTION: Converts the floating point number into an ASCII string.
This routine requires that you initialize the FFA_stackFrame.
CALLED BY: GLOBAL ()
PASS: ss:bp - FFA_stackFrame stack frame
es:di - destination address of string
this buffer must either be FLOAT_TO_ASCII_NORMAL_BUF_LEN or
FLOAT_TO_ASCII_HUGE_BUF_LEN in size (see math.def)
If FFA_stackFrame.FFA_FROM_ADDR = 1
ds:si - location of number to convert
NOTE:
-----
* Numbers are rounded away from 0.
eg. if number of fractional digits desired = 1,
0.56 will round to 1
-0.56 will round to -1
* Commas only apply to the integer portion of fixed and
percentage format numbers.
ie. scientific formats, the fractional and exponent portions
of numbers will have no commas even if FFAF_USE_COMMAS is
passed.
RETURN: cx - number of characters in the string
(excluding the null terminator)
cx == 0 means that the string produced was a Nan, i.e
either "underflow", "overflow", or "error"
some useful fields in the stack frame, see math.def
DESTROYED: nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
FloatFloatToAscii is a big body of code!
A FloatFloatToAsciiFixed routine exists to format fixed format numbers
quickly. Some demands may exceed its ability, so once this is detected,
it bails and the generalized (& significantly slower) FloatFloatToAscii
routine takes over.
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 1/91 Initial version
witt 10/93 DBCS-ized strings and such.
-------------------------------------------------------------------------------@
FloatFloatToAscii proc far uses ax,bx,dx,ds,di,si
locals local FFA_stackFrame
.enter inherit far
if FULL_EXECUTE_IN_PLACE
;
; Make sure the fptr passed in is valid
;
EC < test locals.FFA_float.FFA_params.formatFlags, mask FFAF_FROM_ADDR >
EC < jz xipSave
EC < push bx >
EC < mov bx, ds >
EC < call ECAssertValidFarPointerXIP >
EC < pop bx >
xipSave::
endif
test locals.FFA_float.FFA_params.formatFlags, mask FFAF_FLOAT_RESERVED
je floatOp
call FloatFloatToDateTime
LONG jnc straightExit ; If no error, exit.
clr cx ; An error occurred.
jmp straightExit
floatOp:
EC< call CheckFloatToAsciiParams >
;-----------------------------------------------------------------------
; initialize vars and such
mov locals.FFA_float.FFA_saveDI, di
call FloatGetDecimalSeperator
SBCS< mov locals.FFA_float.FFA_decimalChar, al >
DBCS< mov locals.FFA_float.FFA_decimalChar, ax >
SBCS< mov cx, FLOAT_TO_ASCII_NORMAL_BUF_LEN >
DBCS< mov cx, FLOAT_TO_ASCII_NORMAL_BUF_LEN*(size wchar) >
test locals.FFA_float.FFA_params.formatFlags, mask FFAF_DONT_USE_SCIENTIFIC
je 10$
SBCS< mov cx, FLOAT_TO_ASCII_HUGE_BUF_LEN >
DBCS< mov cx, FLOAT_TO_ASCII_HUGE_BUF_LEN*(size wchar) >
10$:
mov locals.FFA_float.FFA_bufSize, cx ; store byte count
clr cx
mov locals.FFA_float.FFA_startNumber, cx
mov locals.FFA_float.FFA_decimalPoint, cx
mov locals.FFA_float.FFA_endNumber, cx
mov locals.FFA_float.FFA_numChars, cx
mov locals.FFA_float.FFA_startExponent, cx
mov locals.FFA_float.FFA_numSign, cx
mov locals.FFA_float.FFA_startSigCount, cl
mov locals.FFA_float.FFA_sigCount, cl
mov locals.FFA_float.FFA_noMoreSigInfo, cl
mov locals.FFA_float.FFA_startDecCount, cl
mov locals.FFA_float.FFA_decCount, cl
mov locals.FFA_float.FFA_useCommas, cl
test locals.FFA_float.FFA_params.formatFlags, mask FFAF_FROM_ADDR
; source=stack?
je sourceOK ; branch if not
call FloatPushNumberFar ; else place number on stack
sourceOK:
;-----------------------------------------------------------------------
; examine the number
call FloatEnter_DSSI ; ds:si <- top of fp stack
; we will access the exponent
EC< call FloatCheck1Arg >
call FloatIsNoNAN1
jnc nan
call FloatDoPreNumeric ; initializes FFA_numSign
;
; Zero is no longer special cased here.
;
jmp nonZero
nan:
;-----------------------------------------------------------------------
; if +/- infinity, return the text
; else return "error"
call FloatIsInfinity ; dl <- ASCII sign if infinity
mov si, offset errorStr ; assume not infinity
jnc copyString ; branch if assumption correct
mov si, offset overflowStr
cmp dl, '+' ; ASCII char "+" is flag
je copyString
mov si, offset underflowStr
copyString:
call FloatCopyErrorStr
clr cx
jmp short exit
nonZero:
;-----------------------------------------------------------------------
; perform the conversion
;
; First initialize the buffer to a stream of "0" characters.
;
push cx, di ; Save counter, pointer
mov cx, locals.FFA_float.FFA_bufSize
LocalPrevChar sscx ; don't count NULL
add cx, locals.FFA_float.FFA_saveDI ; Adjust by # of bytes written
sub cx, locals.FFA_float.FFA_startNumber ; already
LocalLoadChar ax, '0' ; character to store
if DBCS_PCGEOS
shr cx, 1 ; bytes --> char count
rep stosw ; Zero out the buffer
else
rep stosb ; Zero out the buffer
endif
pop cx, di ; Retrieve counter, pointer
; if format is fixed see if fast formatting code will work
call FloatAbs
test locals.FFA_float.FFA_params.formatFlags, mask FFAF_SCIENTIFIC
jne doScientific
call FloatFloatToAsciiFixed
jnc done
doScientific:
call GetDecimalExponent ; sets FFA_decExponent & FFA_curExponent
;
; If the number is zero, then the rounding code messes up, so since
; zero is already rounded, we just skip this.
;
cmp locals.FFA_float.FFA_numSign,0
je afterRounding ; Branch if number is zero
call RoundNumber
call GetDecimalExponent ; sets FFA_decExponent & FFA_curExponent
afterRounding:
call ConvertBase10Mantissa ; cx <- base 10 exponent
call RemoveTrailingZeros
test locals.FFA_float.FFA_params.formatFlags, mask FFAF_SCIENTIFIC
je done
if DBCS_PCGEOS
cmp cx, 0
mov bl, '+' ; only load low byte (save a little)
jge expSignOK
mov bl, '-'
neg cx
expSignOK:
mov ax, 'E'
mov locals.FFA_float.FFA_startExponent, di
LocalPutChar esdi, ax
mov al, bl ; high byte already 0.
LocalPutChar esdi, ax
else
cmp cx, 0
mov ah, '+'
jge expSignOK
mov ah, '-'
neg cx
expSignOK:
mov al, 'E'
mov locals.FFA_float.FFA_startExponent, di
stosw
endif
;
; have at least 2 digits in the exponent
;
cmp cx, 10
jae convExp
LocalLoadChar ax, '0'
LocalPutChar esdi, ax
convExp:
mov ax, cx
call ConvertWordToAscii
done:
;-----------------------------------------------------------------------
; done, tidy up
call FloatDoPostNumeric
mov cx, di
sub cx, locals.FFA_float.FFA_saveDI
DBCS< shr cx, 1 ; bytes --> char count >
mov locals.FFA_float.FFA_numChars, cx
clr ax ; null terminate string
LocalPutChar esdi, ax
exit:
FloatDrop trashFlags
call FloatOpDone
straightExit:
.leave
ret
FloatFloatToAscii endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: FloatCopyErrorStr
DESCRIPTION: Copies an error string into the given location.
CALLED BY: INTERNAL ()
PASS: es:di - location to place string
si - chunk handle of error string
RETURN: nothing
DESTROYED: di,si
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 3/91 Initial version
-------------------------------------------------------------------------------@
FloatCopyErrorStr proc far uses ds
.enter
mov bx, handle overflowStr
call MemLock
mov ds, ax
mov si, ds:[si]
LocalCopyString
call MemUnlock
.leave
ret
FloatCopyErrorStr endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: CheckFloatToAsciiParams
DESCRIPTION: Error checking code for FloatFloatToAscii.
CALLED BY: INTERNAL (FloatFloatToAscii)
PASS: parameters for FloatFloatToAscii
RETURN: nothing
DESTROYED: dies if assertions fail
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 1/91 Initial version
witt 10/93 DBCS'ized string length checks.
-------------------------------------------------------------------------------@
if ERROR_CHECK
CheckFloatToAsciiParams proc near uses ax,bx,cx,es,di
locals local FFA_stackFrame
.enter inherit near
mov bh, locals.FFA_float.FFA_params.totalDigits
cmp bh, 1
ERROR_B FLOAT_BAD_SIGNIFICANT_DIGITS
test locals.FFA_float.FFA_params.formatFlags, mask FFAF_DONT_USE_SCIENTIFIC
je normalNum
cmp bh, MAX_DIGITS_FOR_HUGE_NUMBERS
ERROR_A FLOAT_BAD_SIGNIFICANT_DIGITS
jmp short doneCheck
normalNum:
cmp bh, DECIMAL_PRECISION
ERROR_A FLOAT_BAD_SIGNIFICANT_DIGITS
doneCheck:
mov bl, locals.FFA_float.FFA_params.decimalLimit
cmp bl, DECIMAL_PRECISION
ERROR_A FLOAT_BAD_DECIMAL_DIGITS
;
; check sign strings
;
segmov es,ss,ax ; es <- ss
clr ax ; null-terminator
mov cx, SIGN_STR_LEN+1
lea di, locals.FFA_float.FFA_params.preNegative
LocalFindChar
ERROR_NE FLOAT_BAD_HEADER
mov cx, SIGN_STR_LEN+1
lea di, locals.FFA_float.FFA_params.postNegative
LocalFindChar
ERROR_NE FLOAT_BAD_HEADER
mov cx, SIGN_STR_LEN+1
lea di, locals.FFA_float.FFA_params.prePositive
LocalFindChar
ERROR_NE FLOAT_BAD_HEADER
mov cx, SIGN_STR_LEN+1
lea di, locals.FFA_float.FFA_params.postPositive
LocalFindChar
ERROR_NE FLOAT_BAD_HEADER
;
; check header and trailer
;
test locals.FFA_float.FFA_params.formatFlags, mask FFAF_HEADER_PRESENT
je doneHeaderCheck ; branch if absent
mov cx, PAD_STR_LEN+1
lea di, locals.FFA_float.FFA_params.header
LocalFindChar
ERROR_NE FLOAT_BAD_HEADER
doneHeaderCheck:
test locals.FFA_float.FFA_params.formatFlags, mask FFAF_TRAILER_PRESENT
je doneTrailerCheck ; branch if absent
mov cx, PAD_STR_LEN+1
lea di, locals.FFA_float.FFA_params.trailer
LocalFindChar
ERROR_NE FLOAT_BAD_TRAILER
doneTrailerCheck:
.leave
ret
CheckFloatToAsciiParams endp
endif
COMMENT @-----------------------------------------------------------------------
FUNCTION: GetDecimalExponent
DESCRIPTION: Compute the decimal exponent which we will use to start
the decimal conversion.
CALLED BY: INTERNAL ()
PASS: X on fp stack
FFA_stackFrame stack frame
ds - fp stack seg
RETURN: X on fp stack
FFA_decExponent
FFA_curExponent
ax - decimal exponent
DESTROYED: dx
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
Let b = binary exponent of X
and d = decimal exponent we seek
Let X = a * 2^b where a = mantissa
we seek log X, but log X is an expensive operation
log X = lg X / lg 10
= (b + lg a) / lg 10
= b / lg 10 + lg a / lg 10
if we take int(b / lg 10) to be our estimate,
then our error will be
frac(b / lg 10) + lg a / lg 10
a / lg 10 <= .602
frac(b / lg 10) < 1
so we can be off as much as 1.602
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 1/91 Initial version
-------------------------------------------------------------------------------@
GetDecimalExponent proc near uses bx,si
locals local FFA_stackFrame
.enter inherit near
EC< call FloatCheck1Arg >
clr ax
call FloatSign ; --> bx=neg/non-neg, flags
je expGotten
EC< ERROR_L FLOAT_POSITIVE_NUMBER_EXPECTED >
call FloatDup
call FloatLog
EC< call FloatIsNoNAN1 >
EC< ERROR_NC FLOAT_BAD_DECIMAL_EXPONENT >
call FloatInt ; don't want rounding
call FloatFloatToDword ; dx:ax <- answer
expGotten:
mov locals.FFA_float.FFA_decExponent, ax
mov locals.FFA_float.FFA_curExponent, ax
;-----------------------------------------------------------------------
; if number format is FIXED, check to see that there won't be overflow
test locals.FFA_float.FFA_params.formatFlags, mask FFAF_SCIENTIFIC
jne done
mov dl, locals.FFA_float.FFA_params.totalDigits
clr dh
push ax ; store char offset in exponent
tst ax
jns 10$
neg ax
10$:
cmp ax, dx ; larger than limit?
pop ax
jl noScientific ; branch if not
test locals.FFA_float.FFA_params.formatFlags, mask FFAF_DONT_USE_SCIENTIFIC
je forceScientific ; branch if no preference for fixed
;
; User wants fixed format. That is permissible if the limit is not
; exceeded.
;
cmp ax, MAX_DIGITS_FOR_HUGE_NUMBERS-1
jle done
forceScientific:
;
; ok... number is too big, force scientific
; don't do the same for numbers that are too small?
; (use a "jb" instead of a "jl" otherwise)
; take abs value of ax if that is desired
;
or locals.FFA_float.FFA_params.formatFlags, mask FFAF_SCIENTIFIC
done:
.leave
ret
noScientific:
tst ax
jns done
clr locals.FFA_float.FFA_decExponent
clr locals.FFA_float.FFA_curExponent
jmp done
GetDecimalExponent endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: ConvertBase10Mantissa
DESCRIPTION:
CALLED BY: INTERNAL (FloatFloatToAscii)
PASS: number on the floating point stack
ds - fp stack seg
es:di - location to store ASCII string
FFA_stackFrame stack frame
RETURN: cx - base 10 exponent
DESTROYED: ax,dx
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
iterative DIV to extract digits (in the order of ms to ls)
start with 10^x such that
2^exp <= 10^x, where exp is the exponent of the fp number
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 1/91 Initial version
-------------------------------------------------------------------------------@
ConvertBase10Mantissa proc near uses bx
locals local FFA_stackFrame
.enter inherit near
call InitCommaHandling
mov ax, locals.FFA_float.FFA_decExponent
call Float10ToTheX
intLoop:
;
; ( fp: num 10^x )
;
cmp locals.FFA_float.FFA_noMoreSigInfo, 0
je processSigDigit
clr al
call ConvertMantissa_ProcessDigit
jmp short nextDigit
processSigDigit:
call FloatOver ; ( fp: num 10^x num )
call FloatOver ; ( fp: num 10^x num 10^x )
call FloatDIV ; ( fp: num 10^x digit )
call FloatDup
call FloatFloatToDword ; al <- digit
push ax ; save digit
call FloatOver ; ( fp: num 10^x digit 10^x )
call FloatMultiply ; ( fp: num 10^x digit*10^x )
call FloatNegate
call FloatRot ; ( fp: 10^x -digit*10^x num )
pop ax ; retrieve digit
call ConvertMantissa_ProcessDigit
call FloatAdd ; ( fp: 10^x newNum )
call FloatSwap
call Float10
call FloatDivide ; ( fp: newNum 10^(x-1) )
nextDigit:
dec locals.FFA_float.FFA_curExponent
;
; done if any of the limits hit or if (newNum = 0)
;
call ConvertMantissa_CheckDone
jnc intLoop
FloatDrop trashFlags ; drop 10^x
mov cx, locals.FFA_float.FFA_decExponent
.leave
ret
ConvertBase10Mantissa endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: ConvertMantissa_ProcessDigit
DESCRIPTION: This routine is complicated by the requirement that it deal
with fixed and scientific formats.
CALLED BY: INTERNAL (ConvertBase10Mantissa)
PASS: al - digit ( 0 <= ax <= 9 )
X on fp stack
ds - fp stack seg
es:di - location to store ASCII string
FFA_stackFrame stack frame
RETURN:
DESTROYED: ax
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
Rounding
--------
Rounding is done seperately for fixed and scientific formats.
Let d = number of decimal digits desired (for the scientific format,
this is the number of digits following the normalization digit)
and r = number that is added to obtain the desired rounding
and x = decimal exponent of the rounding number r
r = 5 * 10^x
To round fixed format numbers,
x = -d-1
To round scientific numbers,
x = current exponent - d - 1
Rounding is performed once the first significant digit is encountered.
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 1/91 Initial version
-------------------------------------------------------------------------------@
ConvertMantissa_ProcessDigit proc near
locals local FFA_stackFrame
.enter inherit near
cmp locals.FFA_float.FFA_startSigCount, 0 ; lead 0s eliminated?
je checkSigStart ; branch if not
inc locals.FFA_float.FFA_sigCount ; up count of sig digits
if DBCS_PCGEOS
clr ah
add al, '0' ; convert to Unicode
else
add al, '0' ; convert to ASCII
endif
LocalPutChar esdi, ax ; store
cmp locals.FFA_float.FFA_startDecCount, 0 ; decimals started yet?
je checkDecStart ; branch if not
inc locals.FFA_float.FFA_decCount
jmp short done
checkSigStart:
;-----------------------------------------------------------------------
; deal with lead 0s
; lead 0s may be significant for fixed format numbers
tst al ; lead 0 ?
jne countSig
test locals.FFA_float.FFA_params.formatFlags, mask FFAF_SCIENTIFIC
je checkDropLead0 ; lose lead 0 if scientific
;
; For scientific notation, if the number is zero then we do want
; to count this zero rather than dropping it.
;
cmp locals.FFA_float.FFA_numSign,0
jne dropLead0
jmp countSig
checkDropLead0:
call FloatDup
call FloatIntFrac ; ( fp: int frac )
FloatDrop trashFlags ; lose fraction
call FloatEq0 ; int part = 0?
jnc dropLead0 ; branch if not
;
; fixed format number < 1
; want 0 preceeding decimal point
;
cmp locals.FFA_float.FFA_curExponent, 0
jne done
clr al ; reinstate 0 digit (destroyed)
countSig:
EC< cmp locals.FFA_float.FFA_startSigCount, 0 >
EC< ERROR_NE FLOAT_BAD_STACK_FRAME >
;
; start count and store digit
;
dec locals.FFA_float.FFA_startSigCount ; indicate start of sig count
inc locals.FFA_float.FFA_sigCount ; up count of sig digits
tst al
jne 10$
test locals.FFA_float.FFA_params.formatFlags, mask FFAF_NO_LEAD_ZERO
jne 20$
10$:
if DBCS_PCGEOS
clr ah
add al, '0' ; convert to Unicode
stosw
else
add al, '0' ; convert to ASCII
stosb ; store
endif
20$:
test locals.FFA_float.FFA_params.formatFlags, mask FFAF_SCIENTIFIC
jne startDecimal ; branch if scientific
checkDecStart:
cmp locals.FFA_float.FFA_curExponent, 0
jne done
startDecimal:
;-----------------------------------------------------------------------
; found spot for decimal point
dec locals.FFA_float.FFA_startDecCount ; indicate start of dec count
mov locals.FFA_float.FFA_useCommas, 0 ; no commas in fraction
cmp locals.FFA_float.FFA_params.decimalLimit, 0 ; does caller want decimals?
je done ; done if not
call StuffDecimalPoint
jmp short done
dropLead0:
dec locals.FFA_float.FFA_decExponent ; adjust
jmp short commaDone
done:
;-----------------------------------------------------------------------
; deal with commas
cmp locals.FFA_float.FFA_useCommas, 0
je commaDone
dec locals.FFA_float.FFA_charsToComma
jne commaDone
LocalLoadChar ax, locals.FFA_float.FFA_commaChar
LocalPutChar esdi, ax
mov locals.FFA_float.FFA_charsToComma, 3
commaDone:
.leave
ret
ConvertMantissa_ProcessDigit endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: InitCommaHandling
DESCRIPTION: Sees if commas are required.
CALLED BY: INTERNAL (ConvertBase10Mantissa)
PASS: FFA_params.formatFlags
FFA_startDecCount
FFA_useCommas = 0
FFA_curExponent
RETURN: FFA_useCommas
FFA_charsToComma
DESTROYED: ax,dx
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
FFA_useCommas has been initialized by FloatFloatToAscii to 0
No commas if:
* caller does not want them
* format = scientific
* currently converting decimal portion
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 3/91 Initial version
-------------------------------------------------------------------------------@
InitCommaHandling proc near
locals local FFA_stackFrame
.enter inherit near
test locals.FFA_float.FFA_params.formatFlags, mask FFAF_USE_COMMAS
je done
test locals.FFA_float.FFA_params.formatFlags, mask FFAF_SCIENTIFIC
jne done
cmp locals.FFA_float.FFA_startDecCount, 0
jne done
;-----------------------------------------------------------------------
; commas required
dec locals.FFA_float.FFA_useCommas; note commas required
mov ax, locals.FFA_float.FFA_curExponent
EC< tst ah >
EC< ERROR_NE FLOAT_ASSERTION_FAILED >
inc al ; al <- num chars in integer
mov dl, 3
div dl ; ah <- remainder = chars
; before comma
tst ah
jne storeCharsToComma
mov ah, dl ; ah <- 3
storeCharsToComma:
mov locals.FFA_float.FFA_charsToComma, ah
call FloatGetThousandsSeperator
SBCS< mov locals.FFA_float.FFA_commaChar, al >
DBCS< mov locals.FFA_float.FFA_commaChar, ax >
done:
.leave
ret
InitCommaHandling endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: RoundNumber
DESCRIPTION:
CALLED BY: INTERNAL (ConvertMantissa_ProcessDigit, FloatFloatToAsciiFixed)
PASS: ax - exponent d as explained in ConvertMantissa_ProcessDigit's
routine header
X on fp stack
ds - fp stack seg
RETURN: X rounded
DESTROYED: ax
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
Rounding is done "away" from 0
ie. for 0 decimal places,
1.5 rounds to 2
-0.56 rounds to -1
see also notes in header of ConvertMantissa_ProcessDigit
The way we do rounding is we take the place we want to round to (ax)
and add to the current fp-number starting at that position.
Basically we're adding .5 * 10^ax to the existing number.
This is the same as adding:
.5 * 2^(log2(10)*ax)
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 1/91 Initial version
-------------------------------------------------------------------------------@
RoundNumber proc near uses bx, si, dx
locals local FFA_stackFrame
.enter inherit near
clr ah
mov al, locals.FFA_float.FFA_params.decimalLimit
; get number of decimal places
inc ax ; one more to get rounding pos
neg ax
test locals.FFA_float.FFA_params.formatFlags, mask FFAF_SCIENTIFIC
; scientific?
je doRounding ; branch if not
;
; scientific format rounding
;
add ax, locals.FFA_float.FFA_curExponent
; dec ax
doRounding:
call FloatSign ; bx <- sign, flags set
pushf
call FloatAbs
call Float10ToTheX ; ( fp: X 10^ax )
call Float5
call FloatMultiply ; ( fp: X 5*(10^ax) )
call FloatAdd
;
; HACK - to guard against numbers that are 1 bit less than desired
;
call FloatEpsilon
call FloatAdd
popf
jge done
call FloatNegate
done:
.leave
ret
RoundNumber endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: ConvertMantissa_CheckDone
DESCRIPTION:
CALLED BY: INTERNAL ()
PASS: FFA_stackFrame stack frame
ds - fp stack seg
( fp: num 10^x )
RETURN: carry - boolean bit
set = TRUE
clear = FALSE
DESTROYED:
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 1/91 Initial version
-------------------------------------------------------------------------------@
ConvertMantissa_CheckDone proc near
locals local FFA_stackFrame
.enter inherit near
cmp locals.FFA_float.FFA_startSigCount, 0 ; started counting sig digits?
je notDone ; branch if not
mov al, locals.FFA_float.FFA_sigCount
cmp al, locals.FFA_float.FFA_params.totalDigits ; else has limit been hit?
je done
;
; if FFA_sigCount exceeds DECIMAL_PRECISION, no more meaningful
; information can be extracted so we zero out the number in such an
; event
;
cmp locals.FFA_float.FFA_noMoreSigInfo, 0
jne 20$ ; branch if already detected
cmp al, DECIMAL_PRECISION ; else sig limit exceeded?
jbe 20$ ; branch if not
call FloatSwap ; ( fp: 10^x num )
FloatDrop trashFlags ; ( fp: 10^x )
call Float0 ; ( fp: 10^x 0 )
call FloatSwap ; ( fp: 0 10^x )
dec locals.FFA_float.FFA_noMoreSigInfo ; flag condition detected
20$:
cmp locals.FFA_float.FFA_startDecCount, 0 ; started counting dec digits?
je notDone ; branch if not
mov al, locals.FFA_float.FFA_decCount
cmp al, locals.FFA_float.FFA_params.decimalLimit
; else has limit been hit?
je done
notDone:
clc
jmp short exit
done:
stc
exit:
.leave
ret
ConvertMantissa_CheckDone endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: ConvertWordToAscii
DESCRIPTION: Converts a hex number into a non-terminated ASCII string.
If a 0 is passed, a '0' will be stored.
CALLED BY: INTERNAL (FloatFloatToAscii)
PASS: ax - number to convert
es:di - location to store ASCII chars
RETURN: es:di - addr past last char converted
DESTROYED: ax,dx
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
Called upon to convert the exponent so there's no provision for
sticking in commas.
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 1/91 Initial version
-------------------------------------------------------------------------------@
ConvertWordToAscii proc near uses bx,cx
.enter
clr cx ; init count
mov bx, 10
convLoop:
clr dx
div bx ; ax <- quotient, dx <- remainder
push dx ; save digit
inc cx ; inc count
tst ax ; done?
jnz convLoop ; loop while not
storeLoop:
pop ax ; retrieve digit
add ax, '0' ; convert to ASCII/Unicode
LocalPutChar esdi, ax ; save it
loop storeLoop
.leave
ret
ConvertWordToAscii endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: FloatFloatToAsciiFixed
DESCRIPTION: Provides faster formatting of fixed format numbers.
CALLED BY: INTERNAL (FloatFloatToAscii)
PASS: FFA_stackFrame
es:di - destination address of string
NOTE:
-----
Numbers are rounded away from 0.
eg. if number of fractional digits desired = 1,
0.56 will round to 1
-0.56 will round to -1
RETURN: carry set if fixed format won't work (totalDigits exceeded)
DESTROYED: ax,dx
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
The reason why we resort to this is because having the scientific
format code organize a fixed format number as well is very slow
(in the order of 250,000 cycles).
The approach here is to convert the integer and fraction parts
into integers in registers which can be passed on to routines
like ConvertDwordToAscii which should work quite a bit faster
than the methods employed in FloatFloatToAscii (in the order of
25,000 cycles).
In the event of the number overflowing a 32 bit register pair,
the codition is signaled and FloatFloatToAscii can use the original
code. We do quite a bit of work, possibly to no avail, but
these occasions should be relatively rare.
An even faster approach may be to convert both the integer and
fraction together by shifting the significant decimals to the
left of the decimal point, add .5 to round, and then perform
the conversion. We save a call to ConvertDwordToAscii and
the series of float calls to round the number. The drawback to
this method is the total number of significant digits (integer &
fraction) is limited to 10. (The code below limits the integer
to 10 digits and the fraction to 10 digits).
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 3/91 Initial version
-------------------------------------------------------------------------------@
FloatFloatToAsciiFixed proc near uses bx,cx
locals local FFA_stackFrame
.enter inherit near
;
; Preliminary checks to see if we should proceed
;;; Removed, 10/11/91 - cheng
;;; ;
;;; ; If the number has anything but zeros after the first 2 words of the
;;; ; number then we can't format it here.
;;; ;
;;; call CheckNumberIn32Bits
;;; LONG jc quit ; Branch if it doesn't fit
;;; Removed, 7/ 4/91 -jw
;;; In the hope that the check above will work correctly and will allow more
;;; numbers to be formatted by this routine.
;;; Restored, 10/11/91 - cheng
;;; CheckNumberIn32Bits won't work.
;
; If the user asks for more decimal digits than we can process with
; ConvertDwordToAscii, there is no way we can do it.
;
cmp locals.FFA_float.FFA_params.decimalLimit, NUM_DEC_DIGITS_IN_32_BITS
stc
LONG jg quit
push di ; save di, restored if we bail
call FloatDup ; duplicate in case we need to bail
;-----------------------------------------------------------------------
; round number now
call RoundNumber
;-----------------------------------------------------------------------
; convert the integer portion
call FloatIntFrac
call FloatSwap ; ( fp: # frac int )
call FloatFloatToDword ; ( fp: # frac ), dx:ax <- int
jc popNum ; done if overflow, rid fraction
push ax
or ax, dx
pop ax
jne 10$
;
; integer portion = 0
;
test locals.FFA_float.FFA_params.formatFlags, mask FFAF_NO_LEAD_ZERO
jne checkProcessFraction
LocalLoadChar ax, '0'
LocalPutChar esdi, ax
jmp short checkProcessFraction
10$:
xchg ax, dx ; ax:dx <- number
clr cl
test locals.FFA_float.FFA_params.formatFlags, mask FFAF_USE_COMMAS
je 20$
mov cl, mask DTAF_INCLUDE_COMMAS
20$:
call ConvertDwordToAscii ; cl <- num digits, es:di <- next loc
checkProcessFraction:
cmp cl, locals.FFA_float.FFA_params.totalDigits
jl processFraction ; branch if there's space for a fraction
je popNum ; done if no more space, rid fraction
;
; too little space given to represent this number in fixed format
;
mov locals.FFA_float.FFA_params.formatFlags, mask FFAF_SCIENTIFIC
stc ; bail
jmp short popNum ; rid fraction
processFraction:
;-----------------------------------------------------------------------
; convert the fractional portion
;
; cl = length so far
;
mov ch, locals.FFA_float.FFA_params.totalDigits
sub ch, cl ; ch = max decimal digits allowed
mov al, locals.FFA_float.FFA_params.decimalLimit
cmp ch, al
jge numDecOK
mov al, ch ; adjust to contain max decimal digits
numDecOK:
tst al ; 0 decimal digits?
je popNum ; done if so, rid fraction
clr ah
mov bx, ax ; bx <- number of decimals
call Float10ToTheX
call FloatMultiply
call FloatIntFrac ; truncate number at the decimal point
FloatDrop trashFlags ; lose fraction
call StuffDecimalPoint
call FloatFloatToDword ; dx:ax <- int
jc done ; done if overflow
;
; 0s are significant
; bx = number of decimals
;
xchg ax, dx
mov cl, mask DTAF_INCLUDE_LEADING_ZEROS_FIXED
if 0
; no commas in fractional portion
test locals.FFA_float.FFA_params.formatFlags, mask FFAF_USE_COMMAS
je 20$
or cl, mask DTAF_INCLUDE_COMMAS
20$:
endif
call ConvertDwordToAscii
mov locals.FFA_float.FFA_decCount, cl
call RemoveTrailingZeros
clc
jmp short done
popNum:
FloatDrop ; dropping fraction if not successful
; carry flag intact
done:
pop ax ; retrieve original di
jnc quit
mov di, ax ; restore di if op unsuccessful
quit:
.leave
ret
FloatFloatToAsciiFixed endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CheckNumberIn32Bits
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Check to see if the number on the fp stack fits in 32 bits
CALLED BY: FloatFloatToAsciiFixed
Taken out on 10/11/91 by cheng because a floating point number
containing bits in the low 32 bits does not mean that the
number cannot be represented in 10 digits of integer and
10 digits of fraction.
PASS: ds = fp stack
RETURN: carry set if the number *does not* fall in 32 bits
carry clear otherwise
DESTROYED: ax
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jcw 7/ 4/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if 0
CheckNumberIn32Bits proc near
uses si
.enter
; call FloatGetSP_DSSI ; ds:si <- top of stac
FloatGetSP_DSSI
mov ax, ds:[si].F_mantissa_wd0
or ax, ds:[si].F_mantissa_wd1
tst ax ; Check for zero in low 2 words
; 'tst' clears the carry
jz fits ; Branch if it fits in 32 bits
stc ; Signal: doesn't fit in 32 bits
fits:
.leave
ret
CheckNumberIn32Bits endp
endif
COMMENT @-----------------------------------------------------------------------
FUNCTION: ConvertDwordToAscii
DESCRIPTION: Converts a 32 bit unsigned number to its ASCII/Unicode
representation.
CALLED BY: INTERNAL (GenerateLabel, FloatFloatToAsciiFixed)
PASS: ax:dx - dword to convert
cl - DwordToAsciiFlags
DTAF_INCLUDE_LEADING_ZEROS
DTAF_INCLUDE_LEADING_ZEROS_FIXED
bx = total number of digits, bx > 0
DTAF_NULL_TERMINATE
DTAF_INCLUDE_COMMAS
es:di - address of buffer to place null terminated string
(should have 10 chars/wchars if DTAF_NULL_TERMINATE=0,
11 chars/wchars if DTAF_NULL_TERMINATE=1)
RETURN: es:di - next available location
cx - number of digits stored
DESTROYED: nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
You might think that one could use the 8086 32bit divide instruction
to perform the conversion here. You'd be wrong. The divisor (10) is
too small. Given something greater than 64k * 10, we will get a divide-
by-zero trap the first time we try to divide. So we use "32-bit"
division with a 16-bit divisor to avoid such problems, doing two
divides instead of one, etc.
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
When UtilHex32ToAscii has commas, that routine should be called instead.
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 7/89 Initial version
Cheng 3/91 Modified to handle DTAF_INCLUDE_LEADING_ZEROS_FIXED
witt 10/93 DBCS-ized.
-------------------------------------------------------------------------------@
convertStackFrame struct
CSF_flags byte
CSF_numDigits word
convertStackFrame ends
ConvertDwordToAscii proc near uses si, dx, bx, ax
locals local convertStackFrame
.enter
mov locals.CSF_flags, cl
mov locals.CSF_numDigits, bx
mov bx, 10 ; print in base ten
clr cx ; initialize character count
nextDigit:
mov si, dx ; si = low word
clr dx
div bx
xchg ax, si ; ax = low word, si = quotient
div bx
xchg ax, dx ; ax = remainder, dx = quotient
add al, '0' ; convert to ASCII/Unicode
push ax ; save character
inc cx ; inc count
mov ax, si ; retrieve quotient of high word
or si, dx ; done?
jnz nextDigit ; loop if not
;-----------------------------------------------------------------------
; conversion done, see if any other formatting needs to be done
; cx = number of digits on stack
test locals.CSF_flags, mask DTAF_INCLUDE_LEADING_ZEROS_FIXED
jne doPadZeros
test locals.CSF_flags, mask DTAF_INCLUDE_LEADING_ZEROS
mov locals.CSF_numDigits, cx
je doStore ; branch if no padding requested
;
; number of decimal chars from a 32 bit binary binary number = 10
;
mov locals.CSF_numDigits, bx ; CSF_numDigits <- 10
jmp short doLeadZeros
doPadZeros:
mov bx, locals.CSF_numDigits ; retrieve total number of digits
doLeadZeros:
;
; bx = locals.CSF_numDigits = total number of digits
; cx = number of digits on stack
;
sub bx, cx ; bx <- 0s needed for padding
EC< ERROR_L FLOAT_ASSERTION_FAILED >
je doStore ; branch if none
mov cx, bx ; else place count in cx
mov ax, '0' ; character to push
addLeadZeros:
;
; cx = number of '0's to push
; locals.CSF_numDigits = total number of digits
;
push ax
loop addLeadZeros
;-----------------------------------------------------------------------
; store what's on the stack
doStore:
mov cx, locals.CSF_numDigits ; cx <- total number of digits
;
; deal with commas if necessary
; use bl to contain the number of characters before next comma
; use bh to contains flag as to whether or not to include commas
; dl = comma character
;
mov bh, locals.CSF_flags ; get flags
and bh, mask DTAF_INCLUDE_COMMAS ; isolate flag
je storeLoop ; branch if no commas
mov bl, 3 ; cx MOD 3 = chars before comma
mov ax, cx ; ax <- num chars on stack
div bl ; ah <- remainder
tst ah ; remainder = 0?
je initComma ; bl = 3 if so
mov bl, ah ; bl <- chars before comma
initComma:
call FloatGetThousandsSeperator
SBCS< mov dl, al ; dl <- comma character >
DBCS< mov dx, ax ; dx <- comma character >
storeLoop:
pop ax ; retrieve character
LocalPutChar esdi, ax
tst bh ; include commas?
je nextChar ; branch if not
dec bl ; else dec count to comma pos
jne nextChar ; branch if not there yet
cmp cx, 1 ; else last character stored?
je nextChar ; no comma will follow last char
SBCS< mov al, dl ; store comma >
DBCS< mov ax, dx ; store comma >
LocalPutChar esdi, ax
mov bl, 3 ; reinitialize count
nextChar:
loop storeLoop ; loop to store all
test locals.CSF_flags, mask DTAF_NULL_TERMINATE
je done
clr al
stosb
done:
mov cx, locals.CSF_numDigits ; return cx <- total number of digits
.leave
ret
ConvertDwordToAscii endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: FloatDoPreNumeric
DESCRIPTION: Stuff the pre-numeric characters.
CALLED BY: INTERNAL (FloatFloatToAscii, FloatGenFormatStr)
PASS: ss:bp - FFA_stackFrame
es:di - next storage location
RETURN: FFA_numSign
DESTROYED: ax
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
Deal with header and sign
Deal with percentage
Deal with decimal offset
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 3/91 Initial version
-------------------------------------------------------------------------------@
FloatDoPreNumeric proc near uses si
locals local FFA_stackFrame
.enter inherit near
;-----------------------------------------------------------------------
; deal with header and sign
test locals.FFA_float.FFA_params.formatFlags, mask FFAF_HEADER_PRESENT
jne doHeader ; branch if header present
call StuffPreSign ; store sign
jmp short doOffsets
doHeader:
lea si, locals.FFA_float.FFA_params.header
test locals.FFA_float.FFA_params.formatFlags, \
mask FFAF_SIGN_CHAR_TO_FOLLOW_HEADER
pushf ; save flags
je doSign
call StuffChars
doSign:
call StuffPreSign ; store sign
popf ; retrieve flags from test
jne doOffsets
call StuffChars
doOffsets:
;-----------------------------------------------------------------------
; deal with offsets
cmp locals.FFA_float.FFA_params.decimalOffset, 0
je checkPct
mov al, locals.FFA_float.FFA_params.decimalOffset
cbw
call Float10ToTheX
call FloatMultiply
checkPct:
test locals.FFA_float.FFA_params.formatFlags, mask FFAF_PERCENT
je notPct
call FloatMultiply10
call FloatMultiply10
notPct:
;-----------------------------------------------------------------------
; note position where number will start
mov locals.FFA_float.FFA_startNumber, di
.leave
ret
FloatDoPreNumeric endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: FloatDoPostNumeric
DESCRIPTION: Stuff the post-numeric characters.
CALLED BY: INTERNAL (FloatFloatToAscii, FloatGenFormatStr)
PASS: ss:bp - FFA_stackFrame
es:di - next storage location
RETURN: nothing
DESTROYED: ax
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
Deal with percentage
Deal with trailer and sign
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 3/91 Initial version
-------------------------------------------------------------------------------@
FloatDoPostNumeric proc near uses si
locals local FFA_stackFrame
.enter inherit near
;-----------------------------------------------------------------------
; note position where number ends
mov locals.FFA_float.FFA_endNumber, di
;-----------------------------------------------------------------------
; deal with percentages
test locals.FFA_float.FFA_params.formatFlags, mask FFAF_PERCENT
je donePct
LocalLoadChar ax, '%'
LocalPutChar esdi, ax
donePct:
;-----------------------------------------------------------------------
; deal with trailer and sign
test locals.FFA_float.FFA_params.formatFlags, mask FFAF_TRAILER_PRESENT
jne doTrailer
call StuffPostSign
jmp short done
doTrailer:
lea si, locals.FFA_float.FFA_params.trailer ; si <- trailer
test locals.FFA_float.FFA_params.formatFlags, \
mask FFAF_SIGN_CHAR_TO_PRECEDE_TRAILER
pushf ; save flags
jne doSign
call StuffChars
doSign:
call StuffPostSign
popf ; retrieve flags from test
je done
call StuffChars
done:
.leave
ret
FloatDoPostNumeric endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: StuffPreSign
DESCRIPTION: Store the sign character if one should precede the number.
CALLED BY: INTERNAL (FloatDoPreNumeric)
PASS: es:di - next storage location
RETURN: es:di - next storage location
DESTROYED: nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 3/91 Initial version
-------------------------------------------------------------------------------@
StuffPreSign proc near uses bx,si
locals local FFA_stackFrame
.enter inherit near
call FloatSign ; bx <- sign
mov locals.FFA_float.FFA_numSign, bx ; save sign
lea si, locals.FFA_float.FFA_params.prePositive ; assume positive
jge storeSign ; branch if assumption correct
lea si, locals.FFA_float.FFA_params.preNegative ; else modify char
storeSign:
call StuffChars
.leave
ret
StuffPreSign endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: StuffPostSign
DESCRIPTION: Store the sign character if one should follow the number.
CALLED BY: INTERNAL (FloatDoPostNumeric)
PASS: es:di - next storage location
RETURN: es:di - next storage location
DESTROYED: nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 3/91 Initial version
-------------------------------------------------------------------------------@
StuffPostSign proc near uses si
locals local FFA_stackFrame
.enter inherit near
cmp locals.FFA_float.FFA_numSign, 0
lea si, locals.FFA_float.FFA_params.postPositive ; assume positive
jge storeSign ; branch if assumption correct
lea si, locals.FFA_float.FFA_params.postNegative ; else modify char
storeSign:
call StuffChars
.leave
ret
StuffPostSign endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: StuffChars
DESCRIPTION: Copy a null-terminated string to the destination.
The null-terminator will not be copied.
CALLED BY: INTERNAL (FloatDoPreNumeric, FloatDoPostNumeric)
PASS: si - offset from ss to null-terminated string
es:di - next storage location
RETURN: string copied over
es:di - next storage location
DESTROYED: ax,si
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 3/91 Initial version
witt 10/93 DBCS-ized string copy.
-------------------------------------------------------------------------------@
StuffChars proc near
LocalIsNull ss:[si] ; something to work on?
je exit ; quit if not
push ds
segmov ds,ss,ax ; ds:si <- source string
copyLoop:
LocalGetChar ax, dssi ; grab character
LocalIsNull ax ; null terminator?
je done ; done if so
LocalPutChar esdi, ax ; else stuff char
jmp short copyLoop
done:
pop ds
exit:
ret
StuffChars endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: StuffDecimalPoint
DESCRIPTION: Store the decimal point and make note of it in the
stack frame.
CALLED BY: INTERNAL ()
PASS: es:di - next storage location
FFA_stackFrame
RETURN: es:di - next storage location
DESTROYED: nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 3/91 Initial version
-------------------------------------------------------------------------------@
StuffDecimalPoint proc near
locals local FFA_stackFrame
.enter inherit near
mov locals.FFA_float.FFA_decimalPoint, di ; note position
call FloatGetDecimalSeperator
LocalPutChar esdi, ax ; store the decimal point
.leave
ret
StuffDecimalPoint endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: RemoveTrailingZeros
DESCRIPTION: Routine that removes trailing zeros and the decimal point
if that is the trailing character.
CALLED BY: INTERNAL (FloatFloatToAscii, FloatFloatToAsciiFixed)
PASS: FFA_stackFrame
es:di - next storage location
RETURN: es:di - next storage location
DESTROYED: ax
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
Can't call RemoveTrailingZeros at the end of conversion cos of
numbers in scientific format. So calls to this routine need to be
placed judiciously.
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 3/91 Initial version
-------------------------------------------------------------------------------@
RemoveTrailingZeros proc near uses cx
locals local FFA_stackFrame
.enter inherit near
test locals.FFA_float.FFA_params.formatFlags, mask FFAF_NO_TRAIL_ZEROS
je checkDecimalPoint
mov cl, locals.FFA_float.FFA_decCount ; decimals present?
tst cl
je checkDecimalPoint ; branch if not
clr ch ; else loop to remove
delLoop:
SBCS< cmp {char} es:[di-1], '0' ; trailing zero? >
DBCS< cmp {wchar} es:[di-2], '0' ; trailing zero? >
jne checkDecimalPoint ; done if not
LocalPrevChar esdi
loop delLoop
checkDecimalPoint:
;
; these lines can be taken out if zero padding out to a fixed
; number of decimal digits is desired (ie pad out even if totalDigits is
; exceeded)
;
LocalLoadChar ax, locals.FFA_float.FFA_decimalChar
SBCS< cmp al, es:[di-1] ; is last char a decimal point? >
DBCS< cmp ax, es:[di-2] ; is last char a decimal point? >
jne done ; branch if not
LocalPrevChar esdi ; else lose it
clr locals.FFA_float.FFA_decimalPoint ; note no decimal point
done:
.leave
ret
RemoveTrailingZeros endp
COMMENT @-----------------------------------------------------------------------
FUNCTION: FloatGetNumDigitsInIntegerPart
DESCRIPTION: As routine says, eg. with 5678.956, routine returns 4.
CALLED BY: INTERNAL ()
PASS: X on fp stack
ds - fp stack seg
RETURN: ax - number of digits in the integer part
X is popped off the stack
DESTROYED: dx
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
complications:
* log of -ve numbers is undefined, fix by taking absolute value
* want to return 1 for x such that 0 <= x < 1
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 10/91 Initial version
-------------------------------------------------------------------------------@
FloatGetNumDigitsInIntegerPart proc far
.enter
call FloatAbs ; log of negative numbers is undefined
call FloatTrunc ; want 1 to be returned for 0.00...
call FloatLog
call FloatIsNoNAN1 ; was log taken of 0?
jnc return1 ; branch if so
call FloatTrunc ; don't want rounding
call FloatFloatToDword ; dx:ax <- answer
inc ax ; log(X)+1 = number of digits
done:
.leave
ret
return1:
FloatDrop trashFlags ; lose fraction
mov ax, 1
jmp short done
FloatGetNumDigitsInIntegerPart endp
public FloatGetNumDigitsInIntegerPart
| 24.863293 | 81 | 0.641555 |
117644136a3565f60b32503b81a0950b1e7c815b | 206 | asm | Assembly | oeis/244/A244191.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/244/A244191.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/244/A244191.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A244191: a(n) = most common final digit for a prime < 10^n, or 0 if there is a tie.
; 0,3,7,3,7,3,3,7,3,3,7,7,3,3
lpb $0
mul $0,4
mov $3,$0
div $0,5
trn $0,1
sub $3,1
mov $2,$3
lpe
mov $0,$2
| 15.846154 | 85 | 0.548544 |
f309519851fddb75642dd952a388fb76fcbe4351 | 765 | asm | Assembly | libsrc/_DEVELOPMENT/sound/ay/c/sdcc_iy/ay_wyz_init.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/sound/ay/c/sdcc_iy/ay_wyz_init.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/sound/ay/c/sdcc_iy/ay_wyz_init.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | IF !__CPU_INTEL__ && !__CPU_GBZ80__
SECTION code_sound_ay
PUBLIC _ay_wyz_init
PUBLIC _ay_wyz_init_fastcall
EXTERN asm_wyz_player_init
EXTERN asm_wyz_TABLA_PAUTAS
EXTERN asm_wyz_TABLA_SONIDOS
EXTERN asm_wyz_TABLA_SONG
EXTERN asm_wyz_DATOS_NOTAS
; void ay_wyz_init(wyz_song *song) __z88dk_fastcall
_ay_wyz_init:
pop bc
pop hl
push hl
push bc
_ay_wyz_init_fastcall:
ld c,(hl) ;instrument table
inc hl
ld b,(hl)
inc hl
ld (asm_wyz_TABLA_SONIDOS),bc
ld c,(hl) ;effect
inc hl
ld b,(hl)
inc hl
ld (asm_wyz_TABLA_PAUTAS),bc
ld c,(hl) ;note
inc hl
ld b,(hl)
inc hl
ld (asm_wyz_DATOS_NOTAS),bc
ld c,(hl) ;song table
inc hl
ld b,(hl)
ld (asm_wyz_TABLA_SONG),bc
call asm_wyz_player_init
ret
ENDIF
| 16.630435 | 51 | 0.721569 |
7f02f76f94c49a7e30d44f3dbcde42c2ec9cba73 | 63 | asm | Assembly | old/Assembly/libc_cmd.asm | cz-theng/myblog | 716b89550fa2799088f5b01f6f8baebe2c1e37ef | [
"CC0-1.0"
] | 28 | 2016-05-18T15:34:34.000Z | 2020-11-05T06:49:36.000Z | old/Assembly/libc_cmd.asm | cz-it/myblog | 716b89550fa2799088f5b01f6f8baebe2c1e37ef | [
"CC0-1.0"
] | null | null | null | old/Assembly/libc_cmd.asm | cz-it/myblog | 716b89550fa2799088f5b01f6f8baebe2c1e37ef | [
"CC0-1.0"
] | 55 | 2016-07-28T01:54:36.000Z | 2020-09-14T02:10:30.000Z | 965 STR
965 MOV
965 LDMFD
965 ADD
2 AREA
| 10.5 | 13 | 0.492063 |
dcc1db1e952bf21f093f70644c3f99ef7c69f2f7 | 624 | asm | Assembly | programs/oeis/161/A161382.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/161/A161382.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/161/A161382.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A161382: (0,1)-sequence where n-th run has length n^2.
; 0,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
cal $0,74279 ; n appears n^2 times.
gcd $0,2
mov $1,$0
sub $1,1
| 78 | 501 | 0.525641 |
44cbfce210710358704c3c3b032e4045a438fdd8 | 250 | asm | Assembly | core/src/code_generation/tests/expression-5.asm | mari-linhares/GoCompiler | dc87ff118ee5752fa1da3271ae57679a8ac449a3 | [
"Apache-2.0"
] | 1 | 2019-03-01T23:20:03.000Z | 2019-03-01T23:20:03.000Z | core/src/code_generation/tests/expression-5.asm | mari-linhares/GoCompiler | dc87ff118ee5752fa1da3271ae57679a8ac449a3 | [
"Apache-2.0"
] | null | null | null | core/src/code_generation/tests/expression-5.asm | mari-linhares/GoCompiler | dc87ff118ee5752fa1da3271ae57679a8ac449a3 | [
"Apache-2.0"
] | null | null | null | 100: LD SP, #4000
108: LD R1, #0
116: ST a, R1
124: LD R2, #0
132: ST b, R2
140: LD R3, #0
148: ST c, R3
156: LD R4, #0
164: ST d, R4
172: LD R5, #0
180: ST e, R5
function main
1000: MUL R6, R2, R3
1008: ST a, R6
1016: ADD R7, R6, R4
1024: ST e, R7
| 13.888889 | 20 | 0.588 |
61e339e15dfdd20726e1d726d02fa1fd183fb229 | 452 | asm | Assembly | programs/oeis/082/A082458.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/082/A082458.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/082/A082458.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A082458: Multiply by 1, add 1, multiply by 2, add 2, etc., starting with 0.
; 0,0,1,2,4,12,15,60,64,320,325,1950,1956,13692,13699,109592,109600,986400,986409,9864090,9864100,108505100,108505111,1302061332,1302061344,16926797472,16926797485,236975164790,236975164804,3554627472060,3554627472075,56874039553200,56874039553216
lpb $0,1
sub $0,1
mov $2,$0
add $4,1
lpb $2,1
sub $0,1
add $1,5
mov $2,$3
lpe
mul $1,$4
lpe
div $1,5
| 28.25 | 247 | 0.712389 |
0bfda5f5eacaaf067c9af0dbf65b71d2f1f5ac1d | 530 | asm | Assembly | libsrc/_DEVELOPMENT/adt/b_array/z80/asm_b_array_destroy.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/adt/b_array/z80/asm_b_array_destroy.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/adt/b_array/z80/asm_b_array_destroy.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
; ===============================================================
; Mar 2014
; ===============================================================
;
; void b_array_destroy(b_array_t *a)
;
; Zero the array structure.
; array.capacity = 0 ensures no array operations can be performed.
;
; ===============================================================
SECTION code_adt_b_array
PUBLIC asm_b_array_destroy
EXTERN l_setmem_hl
asm_b_array_destroy:
; enter : hl = array *
;
; uses : af, hl
xor a
jp l_setmem_hl - 12
| 19.62963 | 66 | 0.437736 |
2ed2dd8608b110a364d0acc1e6be8a069618b701 | 2,028 | asm | Assembly | libsrc/_DEVELOPMENT/stdio/z80/asm_gets.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/stdio/z80/asm_gets.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/stdio/z80/asm_gets.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | 1 | 2019-12-03T23:57:48.000Z | 2019-12-03T23:57:48.000Z |
; ===============================================================
; Jan 2014
; ===============================================================
;
; char *gets(char *s)
;
; Read chars from stdin and write to string s until '\n' or
; a stream error occurs. Remove the '\n' from the stream
; but discard it. Terminate s with '\0'.
;
; This function is deprecated because it is unsafe.
; See fgets() instead.
;
; ===============================================================
INCLUDE "clib_cfg.asm"
SECTION code_clib
SECTION code_stdio
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
IF __CLIB_OPT_MULTITHREAD & $02
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
PUBLIC asm_gets
EXTERN _stdin
EXTERN asm0_gets_unlocked, __stdio_lock_release
asm_gets:
; enter : hl = char *s
;
; exit : ix = FILE *stdin
;
; if success
;
; hl = char *s
; de = address of terminating '\0'
; s terminated
; carry reset
;
; if s == 0
;
; hl = 0
; s not terminated
; carry set
;
; if stream at EOF or stream in error state
;
; hl = 0
; s not terminated
; carry set
;
; if stream error or EOF occurs and no chars were read
;
; hl = 0
; s not terminated
; carry set, errno set
;
; uses : all except ix
ld ix,(_stdin)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
IF __CLIB_OPT_STDIO & $01
EXTERN __stdio_verify_valid_lock, error_zc
call __stdio_verify_valid_lock
jp c, error_zc
ELSE
EXTERN __stdio_lock_acquire, error_enolck_zc
call __stdio_lock_acquire
jp c, error_enolck_zc
ENDIF
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
call asm0_gets_unlocked
jp __stdio_lock_release
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ELSE
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
PUBLIC asm_gets
EXTERN asm_gets_unlocked
defc asm_gets = asm_gets_unlocked
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ENDIF
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
| 20.079208 | 65 | 0.456607 |
0d739a7bfb7c7a26b0340ea68dc37cfcabcd39ce | 480 | asm | Assembly | programs/oeis/057/A057003.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/057/A057003.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/057/A057003.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A057003: Write the natural numbers in groups: 1; 2,3; 4,5,6; 7,8,9,10; ... and multiply the members of each group.
; 1,6,120,5040,360360,39070080,5967561600,1220096908800,321570878428800,106137499051584000,42873948150095462400,20803502274492921984000,11938961126118491232768000,7998487694738166709923840000,6185983879158893706209144832000,5469827772398615431168153190400000
add $0,1
mov $1,15
mov $2,$0
bin $2,2
lpb $0
sub $0,1
add $2,1
mul $1,$2
lpe
div $1,15
mov $0,$1
| 32 | 258 | 0.78125 |
86d964b168a0516ab3ebfa3470c5beccec34987c | 423 | asm | Assembly | programs/oeis/143/A143943.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/143/A143943.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/143/A143943.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A143943: The Wiener index of a chain of n squares joined at vertices (i.e., joined like <><><>...<>; here <> is a square!).
; 8,40,114,248,460,768,1190,1744,2448,3320,4378,5640,7124,8848,10830,13088,15640,18504,21698,25240,29148,33440,38134,43248,48800,54808,61290,68264,75748,83760,92318,101440,111144,121448,132370,143928
mov $1,2
add $1,$0
mov $3,$0
mul $3,3
mul $3,$1
mul $1,$3
add $1,8
mov $2,$0
mul $2,5
add $1,$2
| 30.214286 | 199 | 0.690307 |
92d5a84315004b75b7ecd84aeb1242cf8def69ef | 456 | asm | Assembly | oeis/232/A232555.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/232/A232555.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/232/A232555.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A232555: Nonsquare numbers whose sum of proper square divisors is a square greater than 1.
; Submitted by Jon Maiga
; 3528,5292,8820,10584,12348,17640,19404,22932,24696,26460,29988,33516,37044,38808,40572,45864,51156,52920,54684,58212,59976,61740,65268,67032,68796,72324,74088,75852,81144,82908,89964,93492,97020,100548,102312,104076,107604
mul $0,6
mov $2,2
lpb $0
sub $0,6
seq $2,67535 ; Smallest squarefree number >= n.
lpe
mov $0,$2
mul $0,1764
| 35.076923 | 224 | 0.763158 |
996327df2b6111e2cefef07176309289c6d2d2fc | 8,274 | asm | Assembly | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_291.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_291.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_291.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r9
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x129b3, %rsi
lea addresses_UC_ht+0x132c7, %rdi
nop
nop
nop
nop
add $24010, %rbx
mov $63, %rcx
rep movsq
nop
nop
nop
inc %rdi
lea addresses_D_ht+0x3173, %rdi
nop
nop
lfence
movl $0x61626364, (%rdi)
and %rbp, %rbp
lea addresses_WC_ht+0x1073, %rcx
sub %rdi, %rdi
mov (%rcx), %bp
nop
nop
nop
dec %rsi
lea addresses_WT_ht+0x8773, %rdi
nop
nop
nop
xor %rbx, %rbx
mov $0x6162636465666768, %rbp
movq %rbp, %xmm6
movups %xmm6, (%rdi)
nop
nop
nop
nop
nop
xor $47240, %rbp
lea addresses_WT_ht+0xbc73, %rsi
lea addresses_A_ht+0x2373, %rdi
clflush (%rsi)
cmp $62872, %r10
mov $112, %rcx
rep movsl
nop
nop
nop
add $7620, %rdi
lea addresses_WC_ht+0xfd73, %r10
nop
nop
nop
nop
nop
add $21843, %rsi
mov (%r10), %r11
nop
nop
nop
dec %rbx
lea addresses_UC_ht+0x18473, %rsi
lea addresses_D_ht+0x16373, %rdi
nop
nop
nop
nop
nop
xor $30447, %r9
mov $110, %rcx
rep movsl
nop
nop
nop
add %rbx, %rbx
lea addresses_WT_ht+0xdf33, %rsi
nop
xor %rbx, %rbx
mov (%rsi), %cx
nop
nop
sub %rbx, %rbx
lea addresses_UC_ht+0x131f3, %rbp
clflush (%rbp)
nop
nop
nop
inc %rsi
vmovups (%rbp), %ymm3
vextracti128 $0, %ymm3, %xmm3
vpextrq $0, %xmm3, %rdi
nop
xor $33177, %r11
lea addresses_D_ht+0x16d73, %rsi
lea addresses_D_ht+0xb773, %rdi
nop
nop
cmp $43272, %rbp
mov $25, %rcx
rep movsl
nop
nop
nop
nop
nop
xor %rdi, %rdi
lea addresses_D_ht+0xe373, %rsi
lea addresses_A_ht+0x13c2f, %rdi
nop
nop
add $56472, %r11
mov $27, %rcx
rep movsl
nop
nop
nop
nop
cmp $52422, %rdi
lea addresses_normal_ht+0x1011b, %rsi
lea addresses_WC_ht+0x1c473, %rdi
nop
nop
nop
nop
nop
cmp %r9, %r9
mov $100, %rcx
rep movsl
nop
nop
inc %rbx
lea addresses_WT_ht+0x1a1f3, %rsi
lea addresses_D_ht+0x3073, %rdi
nop
mfence
mov $105, %rcx
rep movsq
nop
xor %rbp, %rbp
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r9
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r14
push %r8
push %rcx
push %rdi
push %rdx
// Store
lea addresses_WC+0x13b73, %rdi
nop
nop
nop
nop
and $60713, %r14
movl $0x51525354, (%rdi)
nop
nop
nop
nop
nop
cmp $43676, %r8
// Store
lea addresses_WC+0x13773, %r8
nop
nop
nop
nop
nop
cmp %r14, %r14
mov $0x5152535455565758, %rdx
movq %rdx, %xmm5
vmovups %ymm5, (%r8)
nop
nop
nop
nop
cmp $52454, %r8
// Store
lea addresses_PSE+0x12b73, %rdi
nop
add $64653, %r14
mov $0x5152535455565758, %r13
movq %r13, %xmm4
vmovaps %ymm4, (%rdi)
nop
nop
nop
nop
add %r8, %r8
// Faulty Load
lea addresses_PSE+0x12b73, %r13
nop
nop
nop
cmp $27284, %r12
vmovups (%r13), %ymm3
vextracti128 $1, %ymm3, %xmm3
vpextrq $0, %xmm3, %rdx
lea oracles, %r14
and $0xff, %rdx
shlq $12, %rdx
mov (%r14,%rdx,1), %rdx
pop %rdx
pop %rdi
pop %rcx
pop %r8
pop %r14
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_PSE'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_WC'}}
{'OP': 'STOR', 'dst': {'congruent': 8, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_WC'}}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': True, 'same': True, 'size': 32, 'NT': True, 'type': 'addresses_PSE'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 32, 'NT': False, 'type': 'addresses_PSE'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 2, 'same': False, 'type': 'addresses_UC_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_D_ht'}}
{'src': {'congruent': 8, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 10, 'same': True, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 9, 'AVXalign': False, 'same': True, 'size': 8, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 8, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_D_ht'}}
{'src': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 7, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_D_ht'}}
{'src': {'congruent': 9, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 1, 'same': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 3, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_WC_ht'}}
{'src': {'congruent': 7, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'congruent': 5, 'same': False, 'type': 'addresses_D_ht'}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 31.340909 | 2,999 | 0.658932 |
8cfa1ff9ca45ae8313cb04e34562162aae8667e4 | 388 | asm | Assembly | mc-sema/validator/x86_64/tests/ST_PF80m.asm | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | 2 | 2021-08-07T16:21:29.000Z | 2021-11-17T10:58:37.000Z | mc-sema/validator/x86_64/tests/ST_PF80m.asm | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | null | null | null | mc-sema/validator/x86_64/tests/ST_PF80m.asm | randolphwong/mcsema | eb5b376736e7f57ff0a61f7e4e5a436bbb874720 | [
"BSD-3-Clause"
] | null | null | null | BITS 64
;TEST_FILE_META_BEGIN
;TEST_TYPE=TEST_F
;TEST_IGNOREFLAGS=FLAG_FPU_IE
;TEST_FILE_META_END
FLD1
;TEST_BEGIN_RECORDING
lea rdi, [rsp-0x10]
mov dword [rdi+0x00], 0
mov dword [rdi+0x04], 0
mov dword [rdi+0x08], 0
fstp tword [rdi]
mov eax, dword [rdi+00]
mov ebx, dword [rdi+04]
mov ecx, dword [rdi+08]
mov edi, 0x0
;TEST_END_RECORDING
| 20.421053 | 29 | 0.664948 |
1be9746bbaa59d0f8e8d5b1fc727b575d13acb79 | 1,931 | asm | Assembly | emulator/old/test4.asm | paulscottrobson/scmp-computer | c0c2af499f54383f13782cfe9757009f38567203 | [
"MIT"
] | null | null | null | emulator/old/test4.asm | paulscottrobson/scmp-computer | c0c2af499f54383f13782cfe9757009f38567203 | [
"MIT"
] | null | null | null | emulator/old/test4.asm | paulscottrobson/scmp-computer | c0c2af499f54383f13782cfe9757009f38567203 | [
"MIT"
] | null | null | null | ; ***********************************************************************************************
;
; Bootloader 2. Displays AAA.DDD in octal. Writes to page 1xx
;
; ***********************************************************************************************
cpu sc/mp
buffer = 0x7A ; positioned here so with 6 digits, it
bootloader:
nop
ldi 1 ; p3.h points to working page.
xpah p3
;
; Using the current address (at readit+1) fill the buffer with the numeric data
; the lower 3 bits only being relevant.
;
ldi (buffer & 255)+3 ; p1 points to buffer, assumes its zero filled.
xpal p1 ; it won't be first time round :)
ld readit+1
scl
nextexpand:
expand: st @-1(p1)
sr
sr
sr
jnz expand
csa ; if CY/L clear, then done.
jp refresh
ldi (buffer & 255)+6 ; p1 points to tail of buffer.
xpal p1
readit: ldi 0xFE
xpal p3
ld 0(p3) ; read the byte, p3 = 0. This constant is the address
ccl ; clear the carry/link flag
jmp nextexpand
;
; Copy data into the screen. Assumes clear.
;
refresh:
ldi buffer & 255 ; point P1 to the buffer.
nextdigit:
xpal p1
sio ; wait for D0 to go high and step first bit.
lde
jp nextdigit
dly 00
ldi 0xF8 ; do 8 digits.
digitloop:
xae
ld 0(p1) ; get required display value
xre ; xor with counter
ani 7 ; if the lower 3 bits are the same then echo out.
jnz noecho
st 0(p1) ; erase buffer for next time around.
ldi 1 ; set F0 to 1 to 'type in' the number
cas
noecho: dly 03 ; clock out get key.
ldi 0 ; clear F0 + CY/L
cas
lde ; go to next digit
adi 1
jnz digitloop
ld @1(p1) ; next in buffer.
xpal p1 ; check if done
jp nextdigit ; all 6 digits
halt: jmp halt
;
; get keystroke - modify address / data depending.
;
org 0x1FE
db 0x7A
| 24.1375 | 97 | 0.540135 |
10e08357f98bf033368e69dcffac24531820f7fa | 1,885 | asm | Assembly | third_party/aten/src/ATen/cpu/tbb/tbb_remote/src/tbb/ia32-masm/itsx.asm | gautamkmr/caffe2 | cde7f21d1e34ec714bc08dbfab945a1ad30e92ff | [
"MIT"
] | 80 | 2019-07-02T22:05:26.000Z | 2022-03-29T12:46:31.000Z | third_party/aten/src/ATen/cpu/tbb/tbb_remote/src/tbb/ia32-masm/itsx.asm | gautamkmr/caffe2 | cde7f21d1e34ec714bc08dbfab945a1ad30e92ff | [
"MIT"
] | 2 | 2017-08-07T03:39:25.000Z | 2017-11-07T18:37:49.000Z | third_party/aten/src/ATen/cpu/tbb/tbb_remote/src/tbb/ia32-masm/itsx.asm | gautamkmr/caffe2 | cde7f21d1e34ec714bc08dbfab945a1ad30e92ff | [
"MIT"
] | 34 | 2019-07-18T11:58:14.000Z | 2022-03-18T06:47:48.000Z | ; Copyright (c) 2005-2017 Intel Corporation
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
;
;
;
;
.686
.model flat,c
.code
ALIGN 4
PUBLIC c __TBB_machine_try_lock_elided
__TBB_machine_try_lock_elided:
mov ecx, 4[esp]
xor eax, eax
mov al, 1
BYTE 0F2H
xchg al, byte ptr [ecx]
xor al, 1
ret
.code
ALIGN 4
PUBLIC c __TBB_machine_unlock_elided
__TBB_machine_unlock_elided:
mov ecx, 4[esp]
BYTE 0F3H
mov byte ptr [ecx], 0
ret
.code
ALIGN 4
PUBLIC c __TBB_machine_begin_transaction
__TBB_machine_begin_transaction:
mov eax, -1
BYTE 0C7H
BYTE 0F8H
BYTE 000H
BYTE 000H
BYTE 000H
BYTE 000H
ret
.code
ALIGN 4
PUBLIC c __TBB_machine_end_transaction
__TBB_machine_end_transaction:
BYTE 00FH
BYTE 001H
BYTE 0D5H
ret
.code
ALIGN 4
PUBLIC c __TBB_machine_transaction_conflict_abort
__TBB_machine_transaction_conflict_abort:
BYTE 0C6H
BYTE 0F8H
BYTE 0FFH ; 12.4.5 Abort argument: lock not free when tested
ret
.code
ALIGN 4
PUBLIC c __TBB_machine_is_in_transaction
__TBB_machine_is_in_transaction:
xor eax, eax
BYTE 00FH
BYTE 001H
BYTE 0D6H
JZ rset
MOV al,1
rset:
RET
end
| 23.271605 | 74 | 0.656233 |
e1e2df85fa4bbaa46d2fe2b4f5c912b40e94063a | 704 | asm | Assembly | oeis/305/A305991.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/305/A305991.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/305/A305991.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A305991: Expansion of (1-27*x)^(1/9).
; Submitted by Christian Krause
; 1,-3,-36,-612,-11934,-250614,-5513508,-125235396,-2911722957,-68910776649,-1653858639576,-40143659706072,-983519662798764,-24285370135261788,-603664914790793016,-15091622869769825400,-379177024602966863175,-9568643738510163782475,-242405641375590815822700,-6162206567600545475913900,-157136267473813909635804450,-4018198839687527117829856650,-103012006617443877020729052300,-2646960691778666579097863909100,-68159237813300664411769995659325,-1758508335583157141823665888010585
mov $1,1
mov $3,$0
mov $0,-4
mov $4,1
lpb $3
add $0,1
mul $1,$3
mul $1,$0
add $0,26
add $2,$4
div $1,$2
sub $3,1
add $4,2
lpe
mov $0,$1
| 35.2 | 478 | 0.77983 |
dfe04dcecb4d7bf2779e7099eb41160ef96403c6 | 1,634 | asm | Assembly | programs/oeis/162/A162316.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/162/A162316.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/162/A162316.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A162316: a(n) = 5n^2 + 20n + 1.
; 1,26,61,106,161,226,301,386,481,586,701,826,961,1106,1261,1426,1601,1786,1981,2186,2401,2626,2861,3106,3361,3626,3901,4186,4481,4786,5101,5426,5761,6106,6461,6826,7201,7586,7981,8386,8801,9226,9661,10106,10561,11026,11501,11986,12481,12986,13501,14026,14561,15106,15661,16226,16801,17386,17981,18586,19201,19826,20461,21106,21761,22426,23101,23786,24481,25186,25901,26626,27361,28106,28861,29626,30401,31186,31981,32786,33601,34426,35261,36106,36961,37826,38701,39586,40481,41386,42301,43226,44161,45106,46061,47026,48001,48986,49981,50986,52001,53026,54061,55106,56161,57226,58301,59386,60481,61586,62701,63826,64961,66106,67261,68426,69601,70786,71981,73186,74401,75626,76861,78106,79361,80626,81901,83186,84481,85786,87101,88426,89761,91106,92461,93826,95201,96586,97981,99386,100801,102226,103661,105106,106561,108026,109501,110986,112481,113986,115501,117026,118561,120106,121661,123226,124801,126386,127981,129586,131201,132826,134461,136106,137761,139426,141101,142786,144481,146186,147901,149626,151361,153106,154861,156626,158401,160186,161981,163786,165601,167426,169261,171106,172961,174826,176701,178586,180481,182386,184301,186226,188161,190106,192061,194026,196001,197986,199981,201986,204001,206026,208061,210106,212161,214226,216301,218386,220481,222586,224701,226826,228961,231106,233261,235426,237601,239786,241981,244186,246401,248626,250861,253106,255361,257626,259901,262186,264481,266786,269101,271426,273761,276106,278461,280826,283201,285586,287981,290386,292801,295226,297661,300106,302561,305026,307501,309986,312481,314986
mov $1,4
add $1,$0
mul $1,$0
mul $1,5
add $1,1
| 181.555556 | 1,551 | 0.820685 |
8b1d3a96bb414dc826dc4f9fcfb4dbfdd19e5d31 | 2,646 | asm | Assembly | Codes/Chapter14/P03/P14-03.asm | ar-ekt/Dandamudi-Assembly-Solutions | 876097a20420b125b19ec9e71cc480cc08b47997 | [
"MIT"
] | 8 | 2021-03-04T18:31:42.000Z | 2021-11-03T04:41:25.000Z | Codes/Chapter14/P03/P14-03.asm | ar-ekt/Dandamudi-Assembly-Solutions | 876097a20420b125b19ec9e71cc480cc08b47997 | [
"MIT"
] | null | null | null | Codes/Chapter14/P03/P14-03.asm | ar-ekt/Dandamudi-Assembly-Solutions | 876097a20420b125b19ec9e71cc480cc08b47997 | [
"MIT"
] | 1 | 2021-11-09T09:49:00.000Z | 2021-11-09T09:49:00.000Z | %INCLUDE "lib.h"
global _start
section .data
file1_msg db ">> File-1 Name: ", 0
file2_msg db ">> File-2 Name: ", 0
file1_error_msg db ">> File-1 Open Error!", 10, 0
file2_error_msg db ">> File-2 Open Error!", 10, 0
done_msg db ">> Done!", 10, 0
section .bss
buffer1 resb 30
buffer2 resb 30
fd_in1 resd 1
fd_in2 resd 1
inp_buffer resb 256
section .code
_start:
puts file1_msg
fgets buffer1, 30
push buffer1
puts file2_msg
fgets buffer2, 30
push buffer2
call append
push 0
mov eax, 1
mov ebx, 0
int 0x80
%DEFINE FILE1 DWORD [EBP + 12]
%DEFINE FILE2 DWORD [EBP + 8]
;---------------------------------proc append-------------------------------------;
; A procedure to concatenate two files. This procedure takes two files names ;
; (i.e., pointers to files names strings) as parameters via the stack and appends ;
; contents of the second file to the first. ;
;---------------------------------------------------------------------------------;
append:
enter 0, 0
pusha
open_file1:
mov eax, 5 ; file open
mov ebx, FILE1 ; pointer to file1 name
mov ecx, 02001o ; file access bits (set file pointer at the end of the file for appending)
mov edx, 0700o; file permissions
int 0x80
mov [fd_in1], eax ; store fd for use in write routine
check_open_error1:
cmp eax, 0 ; open error if fd < 0
jge open_file2
puts file1_error_msg
jmp done
open_file2:
mov eax, 5 ; file open
mov ebx, FILE2 ; pointer to file2 name
mov ecx, 0 ; file access bits (0 = read only)
mov edx, 0700o ; file permissions
int 0x80
mov [fd_in2], eax ; store fd for use in read routine
check_open_error2:
cmp eax, 0 ; open error if fd < 0
jge appending_proc
puts file2_error_msg
jmp close_file1
appending_proc:
; read file2
mov eax, 3 ; file read
mov ebx, [fd_in2] ; file descriptor
mov ecx, inp_buffer ; input buffer
mov edx, 256 ; size
int 0x80
; write (append) to file1
mov edx, eax ; byte count
mov eax, 4 ; file write
mov ebx, [fd_in1] ; file descriptor
mov ecx, inp_buffer
int 0x80
cmp edx, 256 ; EDX = # bytes read
jl close_file2 ; EDX < BUF_SIZE
; indicates end-of-file
jmp appending_proc
close_file2:
puts done_msg
mov eax, 6 ; close file2
mov ebx, [fd_in2]
close_file1:
mov eax, 6 ; close file1
mov ebx, [fd_in1]
done:
popa
leave
ret 8 | 27.852632 | 98 | 0.569539 |
121a544a890eba0b34bca2f4354eb0e040c16680 | 203 | asm | Assembly | libsrc/_DEVELOPMENT/adt/wa_stack/c/sccz80/wa_stack_push_callee.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | 8 | 2017-01-18T12:02:17.000Z | 2021-06-12T09:40:28.000Z | libsrc/_DEVELOPMENT/adt/wa_stack/c/sccz80/wa_stack_push_callee.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | 1 | 2017-03-06T07:41:56.000Z | 2017-03-06T07:41:56.000Z | libsrc/_DEVELOPMENT/adt/wa_stack/c/sccz80/wa_stack_push_callee.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | 3 | 2017-03-07T03:19:40.000Z | 2021-09-15T17:59:19.000Z |
; int wa_stack_push(wa_stack_t *s, void *item)
SECTION code_clib
SECTION code_adt_wa_stack
PUBLIC wa_stack_push_callee
EXTERN w_array_append_callee
defc wa_stack_push_callee = w_array_append_callee
| 16.916667 | 49 | 0.852217 |
1b5b9874d2a20b3d59abdb24efc1aaff2628d880 | 446 | a51 | Assembly | a51test/(18)DEC_Rn.a51 | Aimini/51cpu | cdeb75510d1dcd867fbebe10e963c4dbecd5ff13 | [
"MIT"
] | null | null | null | a51test/(18)DEC_Rn.a51 | Aimini/51cpu | cdeb75510d1dcd867fbebe10e963c4dbecd5ff13 | [
"MIT"
] | null | null | null | a51test/(18)DEC_Rn.a51 | Aimini/51cpu | cdeb75510d1dcd867fbebe10e963c4dbecd5ff13 | [
"MIT"
] | null | null | null | MOV 0xD0,#0x00
MOV 0xF0,#0xFF
START0:
DEC R0
DEC R1
DEC R2
DEC R3
DEC R4
DEC R5
DEC R6
DEC R7
DJNZ 0xF0,START0
MOV 0xD0,#0x08
MOV 0xF0,#0xFF
START1:
DEC R0
DEC R1
DEC R2
DEC R3
DEC R4
DEC R5
DEC R6
DEC R7
DJNZ 0xF0,START1
MOV 0xD0,#0x10
MOV 0xF0,#0xFF
START2:
DEC R0
DEC R1
DEC R2
DEC R3
DEC R4
DEC R5
DEC R6
DEC R7
DJNZ 0xF0,START2
MOV 0xD0,#0x18
MOV 0xF0,#0xFF
START3:
DEC R0
DEC R1
DEC R2
DEC R3
DEC R4
DEC R5
DEC R6
DEC R7
DJNZ 0xF0,START3 | 8.745098 | 16 | 0.735426 |
bc3afe28fe9015c312c843ac74148d7b504aa7e8 | 5,595 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1970.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_1970.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_1970.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r13
push %r8
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0xacac, %rsi
lea addresses_normal_ht+0x18435, %rdi
clflush (%rdi)
nop
nop
nop
nop
add %r8, %r8
mov $5, %rcx
rep movsl
nop
nop
xor $5946, %r11
lea addresses_normal_ht+0x2235, %r13
nop
nop
nop
nop
add $21005, %rdi
movb (%r13), %r8b
cmp $3176, %r8
lea addresses_D_ht+0xbd51, %rsi
nop
nop
nop
nop
nop
sub %rdi, %rdi
mov (%rsi), %r11
nop
nop
nop
nop
nop
and %r11, %r11
lea addresses_normal_ht+0x5475, %r11
nop
cmp $65162, %rbp
and $0xffffffffffffffc0, %r11
movntdqa (%r11), %xmm0
vpextrq $0, %xmm0, %r13
nop
dec %r8
lea addresses_UC_ht+0xc835, %rdi
cmp $7188, %rsi
movl $0x61626364, (%rdi)
nop
nop
and %rbp, %rbp
lea addresses_D_ht+0x1a235, %rsi
nop
nop
nop
nop
cmp %r11, %r11
movw $0x6162, (%rsi)
nop
nop
and %rsi, %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r8
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r15
push %r8
push %rbx
push %rdi
push %rdx
// Store
lea addresses_normal+0x19f35, %rdi
clflush (%rdi)
nop
nop
nop
nop
cmp $32161, %rdx
movb $0x51, (%rdi)
add %r15, %r15
// Faulty Load
lea addresses_D+0x11635, %rdi
nop
sub %r12, %r12
mov (%rdi), %r15
lea oracles, %rdx
and $0xff, %r15
shlq $12, %r15
mov (%rdx,%r15,1), %r15
pop %rdx
pop %rdi
pop %rbx
pop %r8
pop %r15
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_D', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 4}}
[Faulty Load]
{'src': {'type': 'addresses_D', 'AVXalign': False, 'size': 8, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': False}}
{'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 9}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 2}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 16, 'NT': True, 'same': True, 'congruent': 4}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 5}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 10}}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
| 42.386364 | 2,999 | 0.658445 |
6b4a06203401aa412553f4b9c6671d37bda875f5 | 649 | asm | Assembly | programs/oeis/070/A070355.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/070/A070355.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/070/A070355.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A070355: a(n) = 3^n mod 22.
; 1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15,1,3,9,5,15
mov $1,1
mov $2,$0
lpb $2,1
mul $1,3
mod $1,22
sub $2,1
lpe
| 59 | 551 | 0.539291 |
92e2dd8560142b8f9b37f464cc4471deaffb6d90 | 333 | asm | Assembly | game/data/stages/plateau/plateau.asm | pompshuffle/super-tilt-bro | d0f836290223085d7794c445c696e1c644c674d2 | [
"WTFPL"
] | 2 | 2020-09-29T16:43:35.000Z | 2021-08-24T16:41:22.000Z | game/data/stages/plateau/plateau.asm | pompshuffle/super-tilt-bro | d0f836290223085d7794c445c696e1c644c674d2 | [
"WTFPL"
] | null | null | null | game/data/stages/plateau/plateau.asm | pompshuffle/super-tilt-bro | d0f836290223085d7794c445c696e1c644c674d2 | [
"WTFPL"
] | null | null | null | STAGE_PLATEAU_BANK_NUMBER = CURRENT_BANK_NUMBER
stage_plateau_data:
STAGE_HEADER($4000, $a000, $80ff, $80ff, $7000, $6000) ; player_a_x, player_b_x, player_a_y, player_b_y, respawn_x, respawn_y
stage_plateau_elements:
PLATFORM($29, $cf, $81, $ff) ; left, right, top, bot
END_OF_STAGE
#include "game/data/stages/plateau/screen.asm"
| 33.3 | 125 | 0.774775 |
867b12fb41d6c8891ed10efeedf45a9cc23f72d9 | 20,519 | asm | Assembly | src/test/ref/printf-17.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | 2 | 2022-03-01T02:21:14.000Z | 2022-03-01T04:33:35.000Z | src/test/ref/printf-17.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | src/test/ref/printf-17.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | // Tests snprintf function call rewriting
// Test simple formats
// Commodore 64 PRG executable file
.file [name="printf-17.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(__start)
.const BINARY = 2
.const OCTAL = 8
.const DECIMAL = $a
.const HEXADECIMAL = $10
.const OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS = 1
.const STACK_BASE = $103
.const SIZEOF_STRUCT_PRINTF_BUFFER_NUMBER = $c
/// The capacity of the buffer (n passed to snprintf())
/// Used to hold state while printing
.label __snprintf_capacity = $18
// The number of chars that would have been filled when printing without capacity. Grows even after size>capacity.
/// Used to hold state while printing
.label __snprintf_size = $14
/// Current position in the buffer being filled ( initially *s passed to snprintf()
/// Used to hold state while printing
.label __snprintf_buffer = $16
.label screen = $e
.segment Code
__start: {
// volatile size_t __snprintf_capacity
lda #<0
sta.z __snprintf_capacity
sta.z __snprintf_capacity+1
// volatile size_t __snprintf_size
sta.z __snprintf_size
sta.z __snprintf_size+1
// char * __snprintf_buffer
sta.z __snprintf_buffer
sta.z __snprintf_buffer+1
jsr main
rts
}
/// Print a character into snprintf buffer
/// Used by snprintf()
/// @param c The character to print
// void snputc(__register(X) char c)
snputc: {
.const OFFSET_STACK_C = 0
tsx
lda STACK_BASE+OFFSET_STACK_C,x
tax
// ++__snprintf_size;
inc.z __snprintf_size
bne !+
inc.z __snprintf_size+1
!:
// if(__snprintf_size > __snprintf_capacity)
lda.z __snprintf_size+1
cmp.z __snprintf_capacity+1
bne !+
lda.z __snprintf_size
cmp.z __snprintf_capacity
beq __b1
!:
bcc __b1
// }
rts
__b1:
// if(__snprintf_size==__snprintf_capacity)
lda.z __snprintf_size+1
cmp.z __snprintf_capacity+1
bne __b2
lda.z __snprintf_size
cmp.z __snprintf_capacity
bne __b2
ldx #0
__b2:
// *(__snprintf_buffer++) = c
// Append char
txa
ldy #0
sta (__snprintf_buffer),y
// *(__snprintf_buffer++) = c;
inc.z __snprintf_buffer
bne !+
inc.z __snprintf_buffer+1
!:
rts
}
main: {
// snprintf(BUF, 20, "hello world! ")
lda #<$14
sta.z snprintf_init.n
lda #>$14
sta.z snprintf_init.n+1
jsr snprintf_init
// snprintf(BUF, 20, "hello world! ")
lda #<snputc
sta.z printf_str.putc
lda #>snputc
sta.z printf_str.putc+1
lda #<s
sta.z printf_str.s
lda #>s
sta.z printf_str.s+1
jsr printf_str
// snprintf(BUF, 20, "hello world! ")
lda #0
pha
jsr snputc
pla
// print(BUF)
lda #<$400
sta.z screen
lda #>$400
sta.z screen+1
jsr print
// snprintf(BUF, 20, "hello %s%c ", "world", '!')
lda #<$14
sta.z snprintf_init.n
lda #>$14
sta.z snprintf_init.n+1
jsr snprintf_init
// snprintf(BUF, 20, "hello %s%c ", "world", '!')
lda #<snputc
sta.z printf_str.putc
lda #>snputc
sta.z printf_str.putc+1
lda #<s1
sta.z printf_str.s
lda #>s1
sta.z printf_str.s+1
jsr printf_str
// snprintf(BUF, 20, "hello %s%c ", "world", '!')
jsr printf_string
// snprintf(BUF, 20, "hello %s%c ", "world", '!')
lda #'!'
pha
jsr snputc
pla
lda #<snputc
sta.z printf_str.putc
lda #>snputc
sta.z printf_str.putc+1
lda #<s2
sta.z printf_str.s
lda #>s2
sta.z printf_str.s+1
jsr printf_str
// snprintf(BUF, 20, "hello %s%c ", "world", '!')
lda #0
pha
jsr snputc
pla
// print(BUF)
jsr print
// snprintf(BUF, 20, "hello %d+%x! ", 3,11)
lda #<$14
sta.z snprintf_init.n
lda #>$14
sta.z snprintf_init.n+1
jsr snprintf_init
// snprintf(BUF, 20, "hello %d+%x! ", 3,11)
lda #<snputc
sta.z printf_str.putc
lda #>snputc
sta.z printf_str.putc+1
lda #<s1
sta.z printf_str.s
lda #>s1
sta.z printf_str.s+1
jsr printf_str
// snprintf(BUF, 20, "hello %d+%x! ", 3,11)
lda #<3
sta.z printf_sint.value
lda #>3
sta.z printf_sint.value+1
jsr printf_sint
// snprintf(BUF, 20, "hello %d+%x! ", 3,11)
lda #<snputc
sta.z printf_str.putc
lda #>snputc
sta.z printf_str.putc+1
lda #<s4
sta.z printf_str.s
lda #>s4
sta.z printf_str.s+1
jsr printf_str
// snprintf(BUF, 20, "hello %d+%x! ", 3,11)
jsr printf_uint
// snprintf(BUF, 20, "hello %d+%x! ", 3,11)
lda #<snputc
sta.z printf_str.putc
lda #>snputc
sta.z printf_str.putc+1
lda #<s5
sta.z printf_str.s
lda #>s5
sta.z printf_str.s+1
jsr printf_str
// snprintf(BUF, 20, "hello %d+%x! ", 3,11)
lda #0
pha
jsr snputc
pla
// print(BUF)
jsr print
// snprintf(BUF, 6, "hi %d! ", 22222)
lda #<6
sta.z snprintf_init.n
lda #>6
sta.z snprintf_init.n+1
jsr snprintf_init
// snprintf(BUF, 6, "hi %d! ", 22222)
lda #<snputc
sta.z printf_str.putc
lda #>snputc
sta.z printf_str.putc+1
lda #<s6
sta.z printf_str.s
lda #>s6
sta.z printf_str.s+1
jsr printf_str
// snprintf(BUF, 6, "hi %d! ", 22222)
lda #<$56ce
sta.z printf_sint.value
lda #>$56ce
sta.z printf_sint.value+1
jsr printf_sint
// snprintf(BUF, 6, "hi %d! ", 22222)
lda #<snputc
sta.z printf_str.putc
lda #>snputc
sta.z printf_str.putc+1
lda #<s5
sta.z printf_str.s
lda #>s5
sta.z printf_str.s+1
jsr printf_str
// snprintf(BUF, 6, "hi %d! ", 22222)
lda #0
pha
jsr snputc
pla
// print(BUF)
jsr print
// }
rts
.segment Data
s: .text "hello world! "
.byte 0
s1: .text "hello "
.byte 0
str: .text "world"
.byte 0
s2: .text " "
.byte 0
s4: .text "+"
.byte 0
s5: .text "! "
.byte 0
s6: .text "hi "
.byte 0
}
.segment Code
/// Initialize the snprintf() state
// void snprintf_init(char *s, __zp(2) unsigned int n)
snprintf_init: {
.label n = 2
// __snprintf_capacity = n
lda.z n
sta.z __snprintf_capacity
lda.z n+1
sta.z __snprintf_capacity+1
// __snprintf_size = 0
lda #<0
sta.z __snprintf_size
sta.z __snprintf_size+1
// __snprintf_buffer = s
lda #<BUF
sta.z __snprintf_buffer
lda #>BUF
sta.z __snprintf_buffer+1
// }
rts
}
/// Print a NUL-terminated string
// void printf_str(__zp(2) void (*putc)(char), __zp(6) const char *s)
printf_str: {
.label s = 6
.label putc = 2
__b1:
// while(c=*s++)
ldy #0
lda (s),y
inc.z s
bne !+
inc.z s+1
!:
cmp #0
bne __b2
// }
rts
__b2:
// putc(c)
pha
jsr icall6
pla
jmp __b1
icall6:
jmp (putc)
}
// void print(__zp(6) char *msg)
print: {
.label msg = 6
lda #<BUF
sta.z msg
lda #>BUF
sta.z msg+1
__b1:
// while(*msg)
ldy #0
lda (msg),y
cmp #0
bne __b2
// }
rts
__b2:
// *(screen++) = *(msg++)
ldy #0
lda (msg),y
sta (screen),y
// *(screen++) = *(msg++);
inc.z screen
bne !+
inc.z screen+1
!:
inc.z msg
bne !+
inc.z msg+1
!:
jmp __b1
}
// Print a string value using a specific format
// Handles justification and min length
// void printf_string(void (*putc)(char), char *str, char format_min_length, char format_justify_left)
printf_string: {
.label putc = snputc
// printf_str(putc, str)
lda #<putc
sta.z printf_str.putc
lda #>putc
sta.z printf_str.putc+1
lda #<main.str
sta.z printf_str.s
lda #>main.str
sta.z printf_str.s+1
jsr printf_str
// }
rts
}
// Print a signed integer using a specific format
// void printf_sint(void (*putc)(char), __zp(2) int value, char format_min_length, char format_justify_left, char format_sign_always, char format_zero_padding, char format_upper_case, char format_radix)
printf_sint: {
.label value = 2
// printf_buffer.sign = 0
// Handle any sign
lda #0
sta printf_buffer
// if(value<0)
lda.z value+1
bmi __b1
jmp __b2
__b1:
// value = -value
lda #0
sec
sbc.z value
sta.z value
lda #0
sbc.z value+1
sta.z value+1
// printf_buffer.sign = '-'
lda #'-'
sta printf_buffer
__b2:
// utoa(uvalue, printf_buffer.digits, format.radix)
ldx #DECIMAL
jsr utoa
// printf_number_buffer(putc, printf_buffer, format)
lda printf_buffer
sta.z printf_number_buffer.buffer_sign
// Print using format
lda #0
sta.z printf_number_buffer.format_upper_case
lda #<snputc
sta.z printf_number_buffer.putc
lda #>snputc
sta.z printf_number_buffer.putc+1
lda #0
sta.z printf_number_buffer.format_zero_padding
sta.z printf_number_buffer.format_justify_left
tax
jsr printf_number_buffer
// }
rts
}
// Print an unsigned int using a specific format
// void printf_uint(void (*putc)(char), unsigned int uvalue, char format_min_length, char format_justify_left, char format_sign_always, char format_zero_padding, char format_upper_case, char format_radix)
printf_uint: {
.const uvalue = $b
.const format_min_length = 0
.const format_justify_left = 0
.const format_zero_padding = 0
.const format_upper_case = 0
.label putc = snputc
// printf_buffer.sign = format.sign_always?'+':0
// Handle any sign
lda #0
sta printf_buffer
// utoa(uvalue, printf_buffer.digits, format.radix)
// Format number into buffer
lda #<uvalue
sta.z utoa.value
lda #>uvalue
sta.z utoa.value+1
ldx #HEXADECIMAL
jsr utoa
// printf_number_buffer(putc, printf_buffer, format)
lda printf_buffer
sta.z printf_number_buffer.buffer_sign
// Print using format
lda #format_upper_case
sta.z printf_number_buffer.format_upper_case
lda #<putc
sta.z printf_number_buffer.putc
lda #>putc
sta.z printf_number_buffer.putc+1
lda #format_zero_padding
sta.z printf_number_buffer.format_zero_padding
lda #format_justify_left
sta.z printf_number_buffer.format_justify_left
ldx #format_min_length
jsr printf_number_buffer
// }
rts
}
// Converts unsigned number value to a string representing it in RADIX format.
// If the leading digits are zero they are not included in the string.
// - value : The number to be converted to RADIX
// - buffer : receives the string representing the number and zero-termination.
// - radix : The radix to convert the number to (from the enum RADIX)
// void utoa(__zp(2) unsigned int value, __zp(9) char *buffer, __register(X) char radix)
utoa: {
.label digit_value = 4
.label buffer = 9
.label digit = $c
.label value = 2
.label max_digits = $11
.label digit_values = 6
// if(radix==DECIMAL)
cpx #DECIMAL
beq __b2
// if(radix==HEXADECIMAL)
cpx #HEXADECIMAL
beq __b3
// if(radix==OCTAL)
cpx #OCTAL
beq __b4
// if(radix==BINARY)
cpx #BINARY
beq __b5
// *buffer++ = 'e'
// Unknown radix
lda #'e'
sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
// *buffer++ = 'r'
lda #'r'
sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1
sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+2
// *buffer = 0
lda #0
sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+3
// }
rts
__b2:
lda #<RADIX_DECIMAL_VALUES
sta.z digit_values
lda #>RADIX_DECIMAL_VALUES
sta.z digit_values+1
lda #5
sta.z max_digits
jmp __b1
__b3:
lda #<RADIX_HEXADECIMAL_VALUES
sta.z digit_values
lda #>RADIX_HEXADECIMAL_VALUES
sta.z digit_values+1
lda #4
sta.z max_digits
jmp __b1
__b4:
lda #<RADIX_OCTAL_VALUES
sta.z digit_values
lda #>RADIX_OCTAL_VALUES
sta.z digit_values+1
lda #6
sta.z max_digits
jmp __b1
__b5:
lda #<RADIX_BINARY_VALUES
sta.z digit_values
lda #>RADIX_BINARY_VALUES
sta.z digit_values+1
lda #$10
sta.z max_digits
__b1:
lda #<printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
sta.z buffer
lda #>printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
sta.z buffer+1
ldx #0
txa
sta.z digit
__b6:
// max_digits-1
lda.z max_digits
sec
sbc #1
// for( char digit=0; digit<max_digits-1; digit++ )
cmp.z digit
beq !+
bcs __b7
!:
// *buffer++ = DIGITS[(char)value]
ldx.z value
lda DIGITS,x
ldy #0
sta (buffer),y
// *buffer++ = DIGITS[(char)value];
inc.z buffer
bne !+
inc.z buffer+1
!:
// *buffer = 0
lda #0
tay
sta (buffer),y
rts
__b7:
// unsigned int digit_value = digit_values[digit]
lda.z digit
asl
tay
lda (digit_values),y
sta.z digit_value
iny
lda (digit_values),y
sta.z digit_value+1
// if (started || value >= digit_value)
cpx #0
bne __b10
cmp.z value+1
bne !+
lda.z digit_value
cmp.z value
beq __b10
!:
bcc __b10
__b9:
// for( char digit=0; digit<max_digits-1; digit++ )
inc.z digit
jmp __b6
__b10:
// utoa_append(buffer++, value, digit_value)
jsr utoa_append
// utoa_append(buffer++, value, digit_value)
// value = utoa_append(buffer++, value, digit_value)
// value = utoa_append(buffer++, value, digit_value);
inc.z buffer
bne !+
inc.z buffer+1
!:
ldx #1
jmp __b9
}
// Print the contents of the number buffer using a specific format.
// This handles minimum length, zero-filling, and left/right justification from the format
// void printf_number_buffer(__zp(2) void (*putc)(char), __zp($12) char buffer_sign, char *buffer_digits, __register(X) char format_min_length, __zp($11) char format_justify_left, char format_sign_always, __zp($c) char format_zero_padding, __zp($13) char format_upper_case, char format_radix)
printf_number_buffer: {
.label __19 = 9
.label buffer_sign = $12
.label padding = $10
.label putc = 2
.label format_zero_padding = $c
.label format_justify_left = $11
.label format_upper_case = $13
// if(format.min_length)
cpx #0
beq __b6
// strlen(buffer.digits)
jsr strlen
// strlen(buffer.digits)
// signed char len = (signed char)strlen(buffer.digits)
// There is a minimum length - work out the padding
ldy.z __19
// if(buffer.sign)
lda.z buffer_sign
beq __b13
// len++;
iny
__b13:
// padding = (signed char)format.min_length - len
txa
sty.z $ff
sec
sbc.z $ff
sta.z padding
// if(padding<0)
cmp #0
bpl __b1
__b6:
lda #0
sta.z padding
__b1:
// if(!format.justify_left && !format.zero_padding && padding)
lda.z format_justify_left
bne __b2
lda.z format_zero_padding
bne __b2
lda.z padding
cmp #0
bne __b8
jmp __b2
__b8:
// printf_padding(putc, ' ',(char)padding)
lda.z padding
sta.z printf_padding.length
lda #' '
sta.z printf_padding.pad
jsr printf_padding
__b2:
// if(buffer.sign)
lda.z buffer_sign
beq __b3
// putc(buffer.sign)
pha
jsr icall7
pla
__b3:
// if(format.zero_padding && padding)
lda.z format_zero_padding
beq __b4
lda.z padding
cmp #0
bne __b10
jmp __b4
__b10:
// printf_padding(putc, '0',(char)padding)
lda.z padding
sta.z printf_padding.length
lda #'0'
sta.z printf_padding.pad
jsr printf_padding
__b4:
// if(format.upper_case)
lda.z format_upper_case
beq __b5
// strupr(buffer.digits)
jsr strupr
__b5:
// printf_str(putc, buffer.digits)
lda #<printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
sta.z printf_str.s
lda #>printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
sta.z printf_str.s+1
jsr printf_str
// if(format.justify_left && !format.zero_padding && padding)
lda.z format_justify_left
beq __breturn
lda.z format_zero_padding
bne __breturn
lda.z padding
cmp #0
bne __b12
rts
__b12:
// printf_padding(putc, ' ',(char)padding)
lda.z padding
sta.z printf_padding.length
lda #' '
sta.z printf_padding.pad
jsr printf_padding
__breturn:
// }
rts
icall7:
jmp (putc)
}
// Used to convert a single digit of an unsigned number value to a string representation
// Counts a single digit up from '0' as long as the value is larger than sub.
// Each time the digit is increased sub is subtracted from value.
// - buffer : pointer to the char that receives the digit
// - value : The value where the digit will be derived from
// - sub : the value of a '1' in the digit. Subtracted continually while the digit is increased.
// (For decimal the subs used are 10000, 1000, 100, 10, 1)
// returns : the value reduced by sub * digit so that it is less than sub.
// __zp(2) unsigned int utoa_append(__zp(9) char *buffer, __zp(2) unsigned int value, __zp(4) unsigned int sub)
utoa_append: {
.label buffer = 9
.label value = 2
.label sub = 4
.label return = 2
ldx #0
__b1:
// while (value >= sub)
lda.z sub+1
cmp.z value+1
bne !+
lda.z sub
cmp.z value
beq __b2
!:
bcc __b2
// *buffer = DIGITS[digit]
lda DIGITS,x
ldy #0
sta (buffer),y
// }
rts
__b2:
// digit++;
inx
// value -= sub
lda.z value
sec
sbc.z sub
sta.z value
lda.z value+1
sbc.z sub+1
sta.z value+1
jmp __b1
}
// Computes the length of the string str up to but not including the terminating null character.
// __zp(9) unsigned int strlen(__zp(6) char *str)
strlen: {
.label len = 9
.label str = 6
.label return = 9
lda #<0
sta.z len
sta.z len+1
lda #<printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
sta.z str
lda #>printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
sta.z str+1
__b1:
// while(*str)
ldy #0
lda (str),y
cmp #0
bne __b2
// }
rts
__b2:
// len++;
inc.z len
bne !+
inc.z len+1
!:
// str++;
inc.z str
bne !+
inc.z str+1
!:
jmp __b1
}
// Print a padding char a number of times
// void printf_padding(__zp(2) void (*putc)(char), __zp($d) char pad, __zp($b) char length)
printf_padding: {
.label i = 8
.label putc = 2
.label length = $b
.label pad = $d
lda #0
sta.z i
__b1:
// for(char i=0;i<length; i++)
lda.z i
cmp.z length
bcc __b2
// }
rts
__b2:
// putc(pad)
lda.z pad
pha
jsr icall8
pla
// for(char i=0;i<length; i++)
inc.z i
jmp __b1
icall8:
jmp (putc)
}
// Converts a string to uppercase.
// char * strupr(char *str)
strupr: {
.label str = printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
.label src = 4
lda #<str
sta.z src
lda #>str
sta.z src+1
__b1:
// while(*src)
ldy #0
lda (src),y
cmp #0
bne __b2
// }
rts
__b2:
// toupper(*src)
ldy #0
lda (src),y
jsr toupper
// *src = toupper(*src)
ldy #0
sta (src),y
// src++;
inc.z src
bne !+
inc.z src+1
!:
jmp __b1
}
// Convert lowercase alphabet to uppercase
// Returns uppercase equivalent to c, if such value exists, else c remains unchanged
// __register(A) char toupper(__register(A) char ch)
toupper: {
// if(ch>='a' && ch<='z')
cmp #'a'
bcc __breturn
cmp #'z'
bcc __b1
beq __b1
rts
__b1:
// return ch + ('A'-'a');
clc
adc #'A'-'a'
__breturn:
// }
rts
}
.segment Data
// The digits used for numbers
DIGITS: .text "0123456789abcdef"
// Values of binary digits
RADIX_BINARY_VALUES: .word $8000, $4000, $2000, $1000, $800, $400, $200, $100, $80, $40, $20, $10, 8, 4, 2
// Values of octal digits
RADIX_OCTAL_VALUES: .word $8000, $1000, $200, $40, 8
// Values of decimal digits
RADIX_DECIMAL_VALUES: .word $2710, $3e8, $64, $a
// Values of hexadecimal digits
RADIX_HEXADECIMAL_VALUES: .word $1000, $100, $10
BUF: .fill $14, 0
// Buffer used for stringified number being printed
printf_buffer: .fill SIZEOF_STRUCT_PRINTF_BUFFER_NUMBER, 0
| 23.557979 | 292 | 0.622545 |
dc57112a64bdf56f5be271e8fc0be24e14bc3cc3 | 18,265 | asm | Assembly | enduser/netmeeting/av/codecs/intel/h263/i386/cxm1282.asm | npocmaka/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 17 | 2020-11-13T13:42:52.000Z | 2021-09-16T09:13:13.000Z | enduser/netmeeting/av/codecs/intel/h263/i386/cxm1282.asm | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 2 | 2020-10-19T08:02:06.000Z | 2020-10-19T08:23:18.000Z | enduser/netmeeting/av/codecs/intel/h263/i386/cxm1282.asm | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 14 | 2020-11-14T09:43:20.000Z | 2021-08-28T08:59:57.000Z | ;-------------------------------------------------------------------------
; INTEL Corporation Proprietary Information
;
; This listing is supplied under the terms of a license
; agreement with INTEL Corporation and may not be copied
; nor disclosed except in accordance with the terms of
; that agreement.
;
; Copyright (c) 1996 Intel Corporation.
; All Rights Reserved.
;
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
;// $Header: S:\h26x\src\dec\cx51282.asv
;//
;// $Log: S:\h26x\src\dec\cxm1282.asv $
;//
;// Rev 1.7 14 Jun 1996 16:30:00 AGUPTA2
;// Cosmetic changes to adhere to common coding convention.
;//
;// Rev 1.6 13 May 1996 11:03:42 AGUPTA2
;// Final drop from IDC.
;//
;// Rev 1.3 02 Apr 1996 16:30:54 RMCKENZX
;// Corrected two bugs in set-up.
;//
;// Rev 1.1 20 Mar 1996 11:19:28 RMCKENZX
;// March 96 version.
;//
;// Rev 1.2 05 Feb 1996 11:45:02 vladip
;// initial mmx almost optimized version
;//
;// Rev 1.1 29 Jan 1996 18:53:38 vladip
;//
;// IFDEF TIMING is added
;//
;// Rev 1.0 29 Jan 1996 17:28:08 vladip
;// Initial revision.
;//
;// Rev 1.2 03 Nov 1995 14:39:42 BNICKERS
;// Support YUV12 to CLUT8 zoom by 2.
;//
;// Rev 1.1 26 Oct 1995 09:46:10 BNICKERS
;// Reduce the number of blanks in the "proc" statement because the assembler
;// sometimes has problems with statements longer than 512 characters long.
;//
;// Rev 1.0 25 Oct 1995 17:59:22 BNICKERS
;// Initial revision.
;-------------------------------------------------------------------------
;
; +---------- Color convertor.
; |+--------- For both H261 and H263.
; ||+-------- MMx Version.
; |||++------ Convert from YUV12.
; |||||+----- Convert to CLUT8.
; ||||||+---- Zoom by two.
; |||||||
; cxm1282 -- This function performs YUV12 to CLUT8 zoom-by-2 color conversion
; for H26x. It dithers among 9 chroma points and 26 luma
; points, mapping the 8 bit luma pels into the 26 luma points by
; clamping the ends and stepping the luma by 8.
;
; 1. The color convertor is destructive; the input Y, U, and V
; planes will be clobbered. The Y plane MUST be preceded by
; 1544 bytes of space for scratch work.
; 2. U and V planes should be preceded by 4 bytes (for read only)
;
OPTION CASEMAP:NONE
OPTION PROLOGUE:None
OPTION EPILOGUE:ReturnAndRelieveEpilogueMacro
.586
.xlist
include iammx.inc
include memmodel.inc
.list
MMXCODE1 SEGMENT PARA USE32 PUBLIC 'CODE'
MMXCODE1 ENDS
MMXDATA1 SEGMENT PARA USE32 PUBLIC 'DATA'
MMXDATA1 ENDS
;------------------------------------------------------------
PQ equ PD
;------------------------------------------------------------
;=============================================================================
MMXDATA1 SEGMENT
ALIGN 8
EXTRN convert_to_sign : DWORD ; Defined in cxm1281.asm
EXTRN V2_U0low_bound : DWORD
EXTRN V2_U0high_bound : DWORD
EXTRN U2_V0low_bound : DWORD
EXTRN U2_V0high_bound : DWORD
EXTRN U_low_value : DWORD
EXTRN V_low_value : DWORD
EXTRN Y0_low : DWORD
EXTRN Y1_low : DWORD
EXTRN clean_MSB_mask : DWORD
EXTRN saturate_to_Y_high: DWORD
EXTRN return_from_Y_high: DWORD
Y0_correct EQU Y1_low+8
Y1_correct EQU Y0_low+8
Y2_correct EQU Y1_low
Y3_correct EQU Y0_low
U_high_value EQU U_low_value
V_high_value EQU V_low_value
MMXDATA1 ENDS
MMXCODE1 SEGMENT
MMX_YUV12ToCLUT8ZoomBy2 PROC DIST LANG PUBLIC,
AYPlane: DWORD,
AVPlane: DWORD,
AUPlane: DWORD,
AFrameWidth: DWORD,
AFrameHeight: DWORD,
AYPitch: DWORD,
AVPitch: DWORD,
AAspectAdjustmentCnt: DWORD,
AColorConvertedFrame: DWORD,
ADCIOffset: DWORD,
ACCOffsetToLine0: DWORD,
ACCOPitch: DWORD,
ACCType: DWORD
LocalFrameSize = 56
RegisterStorageSize = 16
argument_base EQU ebp + RegisterStorageSize
local_base EQU esp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Arguments:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
YPlane EQU argument_base + 4
VPlane EQU argument_base + 8
UPlane EQU argument_base + 12
FrameWidth EQU argument_base + 16
FrameHeight EQU argument_base + 20
YPitch EQU argument_base + 24
ChromaPitch EQU argument_base + 28
AspectAdjustmentCount EQU argument_base + 32
ColorConvertedFrame EQU argument_base + 36
DCIOffset EQU argument_base + 40
CCOffsetToLine0 EQU argument_base + 44
CCOPitch EQU argument_base + 48
CCType EQU argument_base + 52
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Locals (on local stack frame)
; (local_base is aligned at cache-line boundary in the prologue)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
localVPlane EQU local_base + 0
localFrameWidth EQU local_base + 4
localYPitch EQU local_base + 8
localChromaPitch EQU local_base + 12
localAspectAdjustmentCount EQU local_base + 16
localCCOPitch EQU local_base + 20
CCOCursor EQU local_base + 24
YLimit EQU local_base + 28
DistanceFromVToU EQU local_base + 32
AspectCount EQU local_base + 36
CCOLine1 EQU local_base + 40
CCOLine2 EQU local_base + 44
CCOLine3 EQU local_base + 48
StashESP EQU local_base + 52
push esi
push edi
push ebp
push ebx
mov ebp, esp
sub esp, LocalFrameSize
and esp, -32 ; align at cache line boundary
mov [StashESP], ebp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Save some parameters on local stack frame
; localVPlane
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
mov ebx, [VPlane]
;
mov [localVPlane], ebx
mov ebx, [FrameWidth]
mov [localFrameWidth], ebx
mov ebx, [YPitch]
mov [localYPitch], ebx
mov ebx, [ChromaPitch]
mov [localChromaPitch], ebx
mov ebx, [AspectAdjustmentCount]
mov [localAspectAdjustmentCount], ebx
mov ebx, [CCOPitch]
mov [localCCOPitch], ebx
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Set-up rest of the local stack frame
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
mov ebx, [localVPlane]
mov ecx, [UPlane]
sub ecx, ebx
mov eax, [ColorConvertedFrame]
mov [DistanceFromVToU], ecx
;
add eax, [DCIOffset]
;
add eax, [CCOffsetToLine0]
;
mov [CCOCursor], eax
mov edx, [FrameHeight]
mov ecx, [localYPitch]
;
imul edx, ecx
;
mov edi, [localCCOPitch]
mov esi, [YPlane] ; Fetch cursor over luma plane.
mov [CCOCursor], eax
add edx, esi
mov [YLimit], edx
mov edx, [localAspectAdjustmentCount]
mov [AspectCount], edx
mov edi, esi
mov ebx, [localFrameWidth]
mov eax, [CCOCursor] ; CCOLine0
sar ebx, 1
sub ebx, 4 ; counter starts from maxvalue-4, and in last iteration it equals 0
mov ecx, eax
;
add edi, [localYPitch] ; edi = odd Y line cursor
;
add ecx, [localCCOPitch]
mov [localFrameWidth], ebx
mov [CCOLine1], ecx
mov ebx, [localCCOPitch]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; in each outer loop iteration, 4 lines of output are done.
; in each inner loop iteration block 4x16 of output is done.
; main task of outer loop is to prepare pointers for inner loop
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Arguments should not be referenced beyond this point
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
NextFourLines:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; eax : CCOLine0
; ebx : CCOPitch
; ecx : CCOLine1
; edx : available
; esi : Cursor over even Y line
; edi : Cursor over odd Y line
; ebp : available
; prepare output pointers : CCOLine1, CCOLine2, CCOLine3
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
mov ebp, [AspectCount]
;
sub ebp, 2
jg continue1 ; jump if it still>0
add ebp, [localAspectAdjustmentCount]
mov ecx, eax ; Output1 will overwrite Output0 line
mov [CCOLine1], ecx
continue1:
lea edx, [ecx+ebx] ; CCOLine2
sub ebp, 2
mov [CCOLine2], edx
jg continue2 ; jump if it still>0
add ebp, [localAspectAdjustmentCount]
xor ebx, ebx ; Output3 will overwrite Output2 line
continue2:
mov [AspectCount], ebp
lea ebp, [edx+ebx]
mov [CCOLine3], ebp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Inner loop does 4x16 block of output points (2x8 of input points)
; Register Usage
; eax : cursor over Output
; ebx : counter
; ecx : cursor over Output1,2,3
; edx : Cursor over V line
; esi : Cursor over even Y line
; edi : Cursor over odd Y line
; ebp : Cursor over U line.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
mov ebp, [localVPlane]
mov ebx, [localFrameWidth]
mov edx, ebp
add ebp, [DistanceFromVToU] ; Cursor over U line.
movdt mm3, [ebp+ebx] ; read 4 U points
;
movdt mm2, [edx+ebx] ; read 4 V points
punpcklbw mm3, mm3 ; u3:u3:u2:u2|u1:u1:u0:u0
prepare_next4x8:
psubb mm3, convert_to_sign
punpcklbw mm2, mm2 ; v3:v3:v2:v2|v1:v1:v0:v0
psubb mm2, convert_to_sign
movq mm4, mm3
movdt mm7, [esi+2*ebx] ; read even Y line
punpcklwd mm3, mm3 ; u1:u1:u1:u1|u0:u0:u0:u0
mov ecx, [CCOLine1]
movq mm1, mm3
pcmpgtb mm3, V2_U0low_bound
punpcklbw mm7, mm7 ; y3:y3:y2:y2|y1:y1:y0:y0
pand mm3, U_low_value
movq mm5, mm7
psubusb mm7, Y0_correct
movq mm6, mm2
pcmpgtb mm1, V2_U0high_bound
punpcklwd mm2, mm2 ; v1:v1:v1:v1|v0:v0:v0:v0
pand mm1, U_high_value
psrlq mm7, 3
pand mm7, clean_MSB_mask
movq mm0, mm2
pcmpgtb mm2, U2_V0low_bound
;
pcmpgtb mm0, U2_V0high_bound
paddb mm3, mm1
pand mm2, V_low_value
pand mm0, V_high_value
paddusb mm7, saturate_to_Y_high
paddb mm3, mm2
psubusb mm7, return_from_Y_high ; Y impact on line0
paddd mm3, mm0 ; common U,V impact on line 0
psubusb mm5, Y1_correct
paddb mm7, mm3 ; final value of line 0
movq mm0, mm3 ; u31:u21:u11:u01|u30:u20:u10:u00
psrlq mm5, 3
pand mm5, clean_MSB_mask
psrld mm0, 16 ; : :u31:u21| : :u30:u20
paddusb mm5, saturate_to_Y_high
pslld mm3, 16 ; u11:u01: : |u10:u00: :
psubusb mm5, return_from_Y_high ; Y impact on line0
por mm0, mm3 ; u11:u01:u31:u21|u10:u00:u30:u20
movdt mm3, [edi+2*ebx] ; odd Y line
paddb mm5, mm0 ; final value of line 0
punpcklbw mm3, mm3 ; y3:y3:y2:y2|y1:y1:y0:y0
movq mm2, mm0 ; u11:u01:u31:u21|u10:u00:u30:u20
movq [ecx+4*ebx], mm5 ; write Output1 line
movq mm1, mm3
movq [eax+4*ebx], mm7 ; write Output0 line
psrlw mm0, 8 ; :u11: :u31| :u10: :u30
psubusb mm1, Y3_correct
psllw mm2, 8 ; u01: :u21: |u00: :u20:
psubusb mm3, Y2_correct
psrlq mm1, 3
pand mm1, clean_MSB_mask
por mm0, mm2 ; u01:u11:u21:u31|u00:u10:u20:u30
paddusb mm1, saturate_to_Y_high
psrlq mm3, 3
psubusb mm1, return_from_Y_high
movq mm5, mm0 ; u01:u11:u21:u31|u00:u10:u20:u30
pand mm3, clean_MSB_mask
paddb mm1, mm0
paddusb mm3, saturate_to_Y_high
psrld mm5, 16
psubusb mm3, return_from_Y_high
pslld mm0, 16
mov ecx, [CCOLine3]
por mm5, mm0 ; u21:u31:u01:u11|u20:u30:u00:u10
movdt mm2, [esi+2*ebx+4] ; read next even Y line
paddb mm5, mm3
movq [ecx+4*ebx], mm1 ; write Output3 line
punpckhwd mm4, mm4 ; u3:u3:u3:u3|u2:u2:u2:u2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; start next 4x8 block of output
; SECOND uv-QWORD
; mm6, mm4 are live
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
mov ecx, [CCOLine2]
movq mm3, mm4
pcmpgtb mm4, V2_U0low_bound
punpckhwd mm6,mm6
movq [ecx+4*ebx], mm5 ; write Output2 line
movq mm7, mm6
pand mm4, U_low_value
punpcklbw mm2, mm2 ; y3:y3:y2:y2|y1:y1:y0:y0
pcmpgtb mm3, V2_U0high_bound
movq mm5, mm2
pand mm3, U_high_value
;
pcmpgtb mm6, U2_V0low_bound
paddb mm4, mm3
pand mm6, V_low_value
;
pcmpgtb mm7, U2_V0high_bound
paddb mm4, mm6
pand mm7, V_high_value
;
psubusb mm2, Y0_correct
paddd mm4, mm7
psubusb mm5, Y1_correct
psrlq mm2, 3
pand mm2, clean_MSB_mask
movq mm3, mm4 ; u31:u21:u11:u01|u30:u20:u10:u00
paddusb mm2, saturate_to_Y_high
pslld mm3, 16 ; u11:u01: : |u10:u00: :
psubusb mm2, return_from_Y_high
psrlq mm5, 3
pand mm5, clean_MSB_mask
paddb mm2, mm4 ; MM4=u31:u21:u11:u01|u30:u20:u10:u00, WHERE U STANDS FOR UNATED U AND V IMPACTS
paddusb mm5, saturate_to_Y_high
psrld mm4, 16 ; : :u31:u21| : :u30:u20
psubusb mm5, return_from_Y_high
por mm4, mm3 ; u11:u01:u31:u21|u10:u00:u30:u20
paddb mm5, mm4
mov ecx, [CCOLine1]
movdt mm0, [edi+2*ebx+4] ; read odd Y line
movq mm7, mm4 ; u11:u01:u31:u21|u10:u00:u30:u20
movq [ecx+4*ebx+8], mm5 ; write Output1 line
punpcklbw mm0, mm0 ; y3:y3:y2:y2|y1:y1:y0:y0
movq [eax+4*ebx+8], mm2 ; write Output0 line
movq mm1, mm0
psubusb mm1, Y2_correct
psrlw mm4, 8 ; :u11: :u31| :u10: :u30
psubusb mm0, Y3_correct
psrlq mm1, 3
pand mm1, clean_MSB_mask
psllw mm7, 8 ; u01: :u21: |u00: :u20:
paddusb mm1, saturate_to_Y_high
por mm4, mm7 ; u01:u11:u21:u31|u00:u10:u20:u30
psubusb mm1, return_from_Y_high
psrlq mm0, 3
pand mm0, clean_MSB_mask
movq mm5, mm4 ; u01:u11:u21:u31|u00:u10:u20:u30
paddusb mm0, saturate_to_Y_high
psrld mm5, 16
psubusb mm0, return_from_Y_high
;
paddb mm0, mm4
mov ecx, [CCOLine3]
movdt mm3, [ebp+ebx-4] ; read next 4 U points
pslld mm4, 16
movq [ecx+4*ebx+8], mm0 ; write Output3 line
por mm5, mm4 ; u21:u31:u01:u11|u20:u30:u00:u10
paddb mm5, mm1
mov ecx, [CCOLine2]
movdt mm2, [edx+ebx-4] ; read next 4 V points
punpcklbw mm3, mm3 ; u3:u3:u2:u2|u1:u1:u0:u0
movq [ecx+4*ebx+8], mm5 ; write Output2 line
;
sub ebx, 4
jae prepare_next4x8
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ebp must point to arguments
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
mov ebx, [localCCOPitch]
mov ecx, [CCOLine3]
mov ebp, [localYPitch]
mov edx, [localVPlane]
lea eax, [ecx+ebx] ; next Output0 = old Output3 + CCOPitch
lea ecx, [ecx+2*ebx] ; next Output1 = old Output3 + 2* CCOPitch
add edx, [localChromaPitch]
mov [CCOLine1], ecx
lea esi, [esi+2*ebp] ; even Y line cursor goes to next line
lea edi, [edi+2*ebp] ; odd Y line cursor goes to next line
mov [localVPlane], edx ; edx will point to V plane
cmp esi, [YLimit]
jb NextFourLines
done:
mov esp, [StashESP]
pop ebx
pop ebp
pop edi
pop esi
ret
MMX_YUV12ToCLUT8ZoomBy2 ENDP
MMXCODE1 ENDS
END
| 38.944563 | 126 | 0.479387 |
cb2ebd968c6e672729fcc81f5a652ceb035f7599 | 568 | asm | Assembly | src/Core/DMA/DMA.asm | stoneface86/GameboyBoilerplateProj | 7d2dedb2c3f6fe49819f8ca32c4f6308022d18c7 | [
"MIT"
] | 25 | 2018-06-08T19:19:53.000Z | 2021-10-03T05:07:38.000Z | src/Core/DMA/DMA.asm | stoneface86/GameboyBoilerplateProj | 7d2dedb2c3f6fe49819f8ca32c4f6308022d18c7 | [
"MIT"
] | 1 | 2020-07-14T20:15:47.000Z | 2020-07-15T20:15:26.000Z | src/Core/DMA/DMA.asm | stoneface86/GameboyBoilerplateProj | 7d2dedb2c3f6fe49819f8ca32c4f6308022d18c7 | [
"MIT"
] | 6 | 2019-05-23T05:32:11.000Z | 2020-04-26T21:26:00.000Z | include "./src/Includes.inc"
section "DMA", rom0
DMAInstall::
; Copy DMA Routine to HRAM
copy RawDMACopyFunc, hDMACopyFunc, RawDMACopyFuncEnd-RawDMACopyFunc
ret
RawDMACopyFunc:
di ; Disable Interrupts so as to not offtrack CPU off HRAM
; first we load the OAM page into the DMA register at $FF46
ld a, [wOamPage]
ld [rDMA], a
; DMA transfer begins, we need to wait 160 microseconds while it transfers
; the following loop takes exactly that long
ld a, $28
.loop:
dec a
jr nz, .loop
ei ; Enable Interrupts
ret
RawDMACopyFuncEnd:
| 21.846154 | 75 | 0.716549 |
7c08b60f2878405859f4a914cfbd5361cf3df271 | 444 | asm | Assembly | programs/oeis/025/A025818.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/025/A025818.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/025/A025818.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A025818: Expansion of 1/((1-x^2)(1-x^7)(1-x^10)).
; 1,0,1,0,1,0,1,1,1,1,2,1,2,1,3,1,3,2,3,2,4,3,4,3,5,3,5,4,6,4,7,5,7,5,8,6,8,7,9,7,10,8,11,8,12,9,12,10,13,11,14,12,15,12,16,13,17,14,18,15,19,16,20,17,21,18,22,19,23
mov $3,$0
mov $5,2
lpb $5
sub $5,1
add $0,$5
sub $0,1
mov $2,$5
mov $4,$0
max $4,0
seq $4,29022 ; Expansion of 1/((1-x)(1-x^2)(1-x^7)(1-x^10)).
mul $2,$4
add $1,$2
lpe
min $3,1
mul $3,$4
sub $1,$3
mov $0,$1
| 21.142857 | 165 | 0.527027 |
8d3fa66c7a0b8f6365cefd54cff314ca4a3a1c59 | 1,390 | asm | Assembly | programs/oeis/061/A061076.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/061/A061076.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/061/A061076.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A061076: a(n) is the sum of the products of the digits of all the numbers from 1 to n.
; 1,3,6,10,15,21,28,36,45,45,46,48,51,55,60,66,73,81,90,90,92,96,102,110,120,132,146,162,180,180,183,189,198,210,225,243,264,288,315,315,319,327,339,355,375,399,427,459,495,495,500,510,525,545,570,600,635,675,720,720,726,738,756,780,810,846,888,936,990,990,997,1011,1032,1060,1095,1137,1186,1242,1305,1305,1313,1329,1353,1385,1425,1473,1529,1593,1665,1665,1674,1692,1719,1755,1800,1854,1917,1989,2070,2070,2070,2070,2070,2070,2070,2070,2070,2070,2070,2070,2071,2073,2076,2080,2085,2091,2098,2106,2115,2115,2117,2121,2127,2135,2145,2157,2171,2187,2205,2205,2208,2214,2223,2235,2250,2268,2289,2313,2340,2340,2344,2352,2364,2380,2400,2424,2452,2484,2520,2520,2525,2535,2550,2570,2595,2625,2660,2700,2745,2745,2751,2763,2781,2805,2835,2871,2913,2961,3015,3015,3022,3036,3057,3085,3120,3162,3211,3267,3330,3330,3338,3354,3378,3410,3450,3498,3554,3618,3690,3690,3699,3717,3744,3780,3825,3879,3942,4014,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4097,4101,4107,4115,4125,4137,4151,4167,4185,4185,4189,4197,4209,4225,4245,4269,4297,4329,4365,4365,4371,4383,4401,4425,4455,4491,4533,4581,4635,4635,4643,4659,4683,4715,4755,4803,4859,4923,4995,4995
add $0,2
mul $0,5
sub $0,1
cal $0,61078 ; Sum of the products of the digits of the first n even numbers.
mov $1,$0
sub $1,40
div $1,20
add $1,1
| 115.833333 | 1,155 | 0.764748 |
9baddcab21f81f96bb32d6c79c090d7c6c692c13 | 671 | asm | Assembly | oeis/190/A190048.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/190/A190048.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/190/A190048.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A190048: Expansion of (8+6*x)/(1-x)^5
; 8,46,150,370,770,1428,2436,3900,5940,8690,12298,16926,22750,29960,38760,49368,62016,76950,94430,114730,138138,164956,195500,230100,269100,312858,361746,416150,476470,543120,616528,697136,785400,881790,986790,1100898,1224626,1358500,1503060,1658860,1826468,2006466,2199450,2406030,2626830,2862488,3113656,3381000,3665200,3966950,4286958,4625946,4984650,5363820,5764220,6186628,6631836,7100650,7593890,8112390,8656998,9228576,9828000,10456160,11113960,11802318,12522166,13274450,14060130,14880180
lpb $0
add $0,1
mov $2,$0
sub $0,2
seq $2,304993 ; a(n) = n*(n + 1)*(7*n + 5)/6.
add $1,$2
lpe
mul $1,2
add $1,8
mov $0,$1
| 47.928571 | 496 | 0.76006 |
c3d8756a0be840220598d794273da3f381d53587 | 29,337 | asm | Assembly | basic/expreval/test.asm | hotkeysoft/cpu8085 | b8a669d3d3358250e292d13e78768e80dbfad7fd | [
"MIT"
] | null | null | null | basic/expreval/test.asm | hotkeysoft/cpu8085 | b8a669d3d3358250e292d13e78768e80dbfad7fd | [
"MIT"
] | null | null | null | basic/expreval/test.asm | hotkeysoft/cpu8085 | b8a669d3d3358250e292d13e78768e80dbfad7fd | [
"MIT"
] | null | null | null | .module exprevaltest
.title Tests expreval Module
.include 'expreval.def'
.include '..\integer\integer.def'
.include '..\tokenize\tokenize.def'
.include '..\strings\strings.def'
.include '..\io\io.def'
.include '..\error\error.def'
.include '..\variables\variable.def'
.include '..\program\program.def'
STACK == 0xFFFF ;SYSTEM STACK
.area BOOT (ABS)
.org 0x0000
RST0:
DI
LXI SP,STACK ;INITALIZE STACK
JMP START
;*********************************************************
;* MAIN PROGRAM
;*********************************************************
.area _CODE
START:
MVI A,8 ;SET INTERRUPT MASK
SIM
EI ;ENABLE INTERRUPTS
; IO INIT
CALL IO_INIT
LXI H,0
SHLD PRG_CURRLINE
CALL INT_INIT
CALL EXP_INIT
; TEST PROGRAM
LXI H,TESTPRG1 ; PROGRAM MEMORY
SHLD PRG_LOPTR
LXI H,TESTPRG4END
SHLD PRG_HIPTR
SHLD VAR_LOPTR
SHLD VAR_HIPTR
CALL PRG_INIT
; SET STR PTRS
LXI H,0xA000
SHLD STR_LOPTR
SHLD STR_HIPTR
; SET ZZ = 70
MVI B,'Z
MVI C,'Z
MVI A,SID_CINT
STA VAR_TEMP1
LXI H,70
SHLD VAR_TEMP1+1
LXI H,VAR_TEMP1
CALL VAR_SET
LXI H,LOOP
SHLD ERR_RESTARTPTR
; JMP TEST_BINCALC
; JMP TEST_BINREL
; JMP TEST_BINLOG
; JMP TEST_NEG
; JMP TEST_NOT
; JMP TEST_ABS
; JMP TEST_SGN
; JMP TEST_PEEK
; JMP TEST_RND
; JMP TEST_SQR
; JMP TEST_LEN
; JMP TEST_ASC
; JMP TEST_VAL
; JMP TEST_CHR
; JMP TEST_ADDSTR
; JMP TEST_BINRELSTR
; JMP TEST_STR
; JMP TEST_LEFT
; JMP TEST_RIGHT
; JMP TEST_MID
; JMP TEST_ERROR
; JMP TEST_LIST
; JMP TEST_END
; JMP TEST_NEW
; JMP TEST_PRINT
; JMP TEST_LET
; JMP TEST_CLR
; JMP TEST_REM
; JMP TEST_IF
LXI H,TEST_INTERACTIVE
SHLD ERR_RESTARTPTR
CALL TEST_INTERACTIVE
TEST_BINCALC: ; TEST OF ARITHMETIC OPERATORS
LXI H,TESTSTR0
CALL IO_PUTS
CALL IO_PUTCR
LXI H,TESTSTR001 ; 4+4
CALL EVAL ; RESULT: 8
LXI H,TESTSTR002 ; 4-4
CALL EVAL ; RESULT: 0
LXI H,TESTSTR003 ; 4*4
CALL EVAL ; RESULT: 16
LXI H,TESTSTR004 ; 4/4
CALL EVAL ; RESULT: 1
LXI H,TESTSTR005 ; A+50
CALL EVAL ; RESULT: 50
LXI H,TESTSTR006 ; 50+ZZ
CALL EVAL ; RESULT: 50
CALL EXP_DUMPSTACK ; PRINT RESULTS
CALL EXP_CLEARSTACK
HLT
TEST_BINREL: ; TEST OF BINARY RELATIONS
LXI H,TESTSTR1
CALL IO_PUTS
CALL IO_PUTCR
LXI H,TESTSTR101 ; 4=4
CALL EVAL ; RESULT: TRUE
LXI H,TESTSTR102 ; 4<>4
CALL EVAL ; RESULT: FALSE
LXI H,TESTSTR103 ; 4<4
CALL EVAL ; RESULT: FALSE
LXI H,TESTSTR104 ; 4>4
CALL EVAL ; RESULT: FALSE
LXI H,TESTSTR105 ; 4<=4
CALL EVAL ; RESULT: TRUE
LXI H,TESTSTR106 ; 4>=4
CALL EVAL ; RESULT: TRUE
LXI H,TESTSTR111 ; 1=10
CALL EVAL ; RESULT: FALSE
LXI H,TESTSTR112 ; 1<>10
CALL EVAL ; RESULT: TRUE
LXI H,TESTSTR113 ; 1<10
CALL EVAL ; RESULT: TRUE
LXI H,TESTSTR114 ; 1>10
CALL EVAL ; RESULT: FALSE
LXI H,TESTSTR115 ; 1<=10
CALL EVAL ; RESULT: TRUE
LXI H,TESTSTR116 ; 1>=10
CALL EVAL ; RESULT: FALSE
LXI H,TESTSTR121 ; 10=1
CALL EVAL ; RESULT: FALSE
LXI H,TESTSTR122 ; 10<>1
CALL EVAL ; RESULT: TRUE
LXI H,TESTSTR123 ; 10<1
CALL EVAL ; RESULT: FALSE
LXI H,TESTSTR124 ; 10>1
CALL EVAL ; RESULT: TRUE
LXI H,TESTSTR125 ; 10<=1
CALL EVAL ; RESULT: FALSE
LXI H,TESTSTR126 ; 10>=1
CALL EVAL ; RESULT: TRUE
CALL EXP_DUMPSTACK ; PRINT RESULTS
CALL EXP_CLEARSTACK
LXI H,TESTSTR131 ; ZZ=ZZ+1
CALL EVAL ; RESULT: FALSE
LXI H,TESTSTR132 ; ZZ<>ZZ+1
CALL EVAL ; RESULT: TRUE
LXI H,TESTSTR133 ; ZZ<ZZ/2
CALL EVAL ; RESULT: FALSE
LXI H,TESTSTR134 ; ZZ>ZZ/10
CALL EVAL ; RESULT: TRUE
LXI H,TESTSTR135 ; ZZ<=ZZ-1
CALL EVAL ; RESULT: FALSE
LXI H,TESTSTR136 ; ZZ>=ZZ-ZZ
CALL EVAL ; RESULT: TRUE
CALL EXP_DUMPSTACK ; PRINT RESULTS
CALL EXP_CLEARSTACK
TEST_BINLOG: ; TESTS OF LOGICAL OPERATORS (AND OR XOR)
LXI H,TESTSTR2
CALL IO_PUTS
CALL IO_PUTCR
LXI H,TESTSTR201 ; 0 AND 0
CALL EVAL ; RESULT: 0
LXI H,TESTSTR202 ; 0 AND 255
CALL EVAL ; RESULT: 0
LXI H,TESTSTR203 ; 255 AND 0
CALL EVAL ; RESULT: 0
LXI H,TESTSTR204 ; 255 AND 255
CALL EVAL ; RESULT: 255
LXI H,TESTSTR211 ; 0 OR 0
CALL EVAL ; RESULT: 0
LXI H,TESTSTR212 ; 0 OR 255
CALL EVAL ; RESULT: 255
LXI H,TESTSTR213 ; 255 OR 0
CALL EVAL ; RESULT: 255
LXI H,TESTSTR214 ; 255 OR 255
CALL EVAL ; RESULT: 255
LXI H,TESTSTR221 ; 0 XOR 0
CALL EVAL ; RESULT: 0
LXI H,TESTSTR222 ; 0 XOR 255
CALL EVAL ; RESULT: 255
LXI H,TESTSTR223 ; 255 XOR 0
CALL EVAL ; RESULT: 255
LXI H,TESTSTR224 ; 255 XOR 255
CALL EVAL ; RESULT: 0
CALL EXP_DUMPSTACK ; PRINT RESULTS
CALL EXP_CLEARSTACK
TEST_NEG: ; TESTS OF NEGATION
LXI H,TESTSTR3
CALL IO_PUTS
CALL IO_PUTCR
LXI H,TESTSTR301 ; -10
CALL EVAL ; RESULT: -10
LXI H,TESTSTR302 ; --10
CALL EVAL ; RESULT: +10
LXI H,TESTSTR303 ; -(2+2)
CALL EVAL ; RESULT: -4
LXI H,TESTSTR304 ; -(-5--1)
CALL EVAL ; RESULT: +4
CALL EXP_DUMPSTACK ; PRINT RESULTS
CALL EXP_CLEARSTACK
TEST_NOT: ; TESTS OF NOT
LXI H,TESTSTR4
CALL IO_PUTS
CALL IO_PUTCR
LXI H,TESTSTR401 ; NOT 0
CALL EVAL ; RESULT: -1
LXI H,TESTSTR402 ; NOT NOT 0
CALL EVAL ; RESULT: 0
LXI H,TESTSTR403 ; NOT -1
CALL EVAL ; RESULT: 0
LXI H,TESTSTR404 ; NOT --1
CALL EVAL ; RESULT: -2
CALL EXP_DUMPSTACK ; PRINT RESULTS
CALL EXP_CLEARSTACK
TEST_ABS: ; TESTS OF ABS
LXI H,TESTSTR5
CALL IO_PUTS
CALL IO_PUTCR
LXI H,TESTSTR501 ; ABS ( 0 )
CALL EVAL ; RESULT: 0
LXI H,TESTSTR502 ; ABS ( 1 )
CALL EVAL ; RESULT: 1
LXI H,TESTSTR503 ; ABS ( -1 )
CALL EVAL ; RESULT: 1
LXI H,TESTSTR504 ; ABS ( - ABS ( -10 ) )
CALL EVAL ; RESULT: 10
CALL EXP_DUMPSTACK ; PRINT RESULTS
CALL EXP_CLEARSTACK
TEST_SGN: ; TESTS OF SGN
LXI H,TESTSTR6
CALL IO_PUTS
CALL IO_PUTCR
LXI H,TESTSTR601 ; SGN ( 0 )
CALL EVAL ; RESULT: 0
LXI H,TESTSTR602 ; SGN ( 1 )
CALL EVAL ; RESULT: 1
LXI H,TESTSTR603 ; SGN ( -1 )
CALL EVAL ; RESULT: -1
LXI H,TESTSTR604 ; SGN ( -32768 )
CALL EVAL ; RESULT: -1
LXI H,TESTSTR605 ; SGN ( 32767 )
CALL EVAL ; RESULT: 1
CALL EXP_DUMPSTACK ; PRINT RESULTS
CALL EXP_CLEARSTACK
TEST_PEEK: ; TESTS OF PEEK
LXI H,TESTSTR7
CALL IO_PUTS
CALL IO_PUTCR
LXI H,TESTSTR701 ; PEEK ( 0 )
CALL EVAL ;
LXI H,TESTSTR702 ; PEEK ( 32767 )
CALL EVAL ;
LXI H,TESTSTR703 ; PEEK ( -1 )
CALL EVAL ;
CALL EXP_DUMPSTACK ; PRINT RESULTS
CALL EXP_CLEARSTACK
TEST_RND: ; TESTS OF RND
LXI H,TESTSTRR0
CALL IO_PUTS
CALL IO_PUTCR
LXI H,TESTSTRRND ; RND(0)
CALL EVAL ;
LXI H,TESTSTRRND ; RND(0)
CALL EVAL ;
LXI H,TESTSTRRND ; RND(0)
CALL EVAL ;
LXI H,TESTSTRRND ; RND(0)
CALL EVAL ;
CALL EXP_DUMPSTACK ; PRINT RESULTS
CALL EXP_CLEARSTACK
TEST_SQR: ; TESTS OF SQR
LXI H,TESTSTR8
CALL IO_PUTS
CALL IO_PUTCR
LXI H,TESTSTR801 ; SQR(10)
CALL EVAL ; RESULT: 3
LXI H,TESTSTR802 ; SQR(100)
CALL EVAL ; RESULT: 10
LXI H,TESTSTR803 ; SQR(1000)
CALL EVAL ; RESULT: 31
LXI H,TESTSTR804 ; SQR(10000)
CALL EVAL ; RESULT: 100
CALL EXP_DUMPSTACK ; PRINT RESULTS
CALL EXP_CLEARSTACK
TEST_LEN: ; TESTS OF LEN
LXI H,TESTSTR9
CALL IO_PUTS
CALL IO_PUTCR
LXI H,TESTSTR901 ; LEN("")
CALL EVAL ; RESULT: 0
LXI H,TESTSTR902 ; SQR("A")
CALL EVAL ; RESULT: 1
LXI H,TESTSTR903 ; SQR("12345")
CALL EVAL ; RESULT: 5
CALL EXP_DUMPSTACK ; PRINT RESULTS
CALL EXP_CLEARSTACK
TEST_ASC: ; TESTS OF ASC
LXI H,TESTSTRA
CALL IO_PUTS
CALL IO_PUTCR
LXI H,TESTSTRA01 ; ASC("1234")
CALL EVAL ; RESULT: '1'
LXI H,TESTSTRA02 ; ASC(" ")
CALL EVAL ; RESULT: 32
CALL EXP_DUMPSTACK ; PRINT RESULTS
CALL EXP_CLEARSTACK
TEST_VAL: ; TESTS OF VAL
LXI H,TESTSTRB
CALL IO_PUTS
CALL IO_PUTCR
LXI H,TESTSTRB01 ; VAL("1234")
CALL EVAL ; RESULT: 1234
LXI H,TESTSTRB02 ; VAL("-666")
CALL EVAL ; RESULT: -666
CALL EXP_DUMPSTACK ; PRINT RESULTS
CALL EXP_CLEARSTACK
TEST_CHR: ; TESTS OF CHR$
LXI H,TESTSTRC
CALL IO_PUTS
CALL IO_PUTCR
LXI H,TESTSTRC01 ; CHR$(65)
CALL EVAL ; RESULT: "A"
LXI H,TESTSTRC02 ; CHR$(48)
CALL EVAL ; RESULT: "0"
CALL EXP_DUMPSTACK ; PRINT RESULTS
CALL EXP_CLEARSTACK
TEST_ADDSTR: ; TESTS OF ADD (STR)
LXI H,TESTSTRD
CALL IO_PUTS
CALL IO_PUTCR
LXI H,TESTSTRD01 ; "1234"+"66"
CALL EVAL ; RESULT: "123466"
LXI H,TESTSTRD02 ; "6666"+""
CALL EVAL ; RESULT: "6666"
CALL EXP_DUMPSTACK ; PRINT RESULTS
CALL EXP_CLEARSTACK
TEST_BINRELSTR: ; TESTS OF BINARY RELATIONS
LXI H,TESTSTRE
CALL IO_PUTS
CALL IO_PUTCR
LXI H,TESTSTRE01 ; "A"="A"
CALL EVAL ; RESULT: TRUE
LXI H,TESTSTRE02 ; "B"<>"B"
CALL EVAL ; RESULT: FALSE
LXI H,TESTSTRE03 ; "C"<"C"
CALL EVAL ; RESULT: FALSE
LXI H,TESTSTRE04 ; "C">"C"
CALL EVAL ; RESULT: FALSE
LXI H,TESTSTRE05 ; "D"<="D"
CALL EVAL ; RESULT: TRUE
LXI H,TESTSTRE06 ; "E">="E"
CALL EVAL ; RESULT: TRUE
LXI H,TESTSTRE11 ; "A"="B"
CALL EVAL ; RESULT: FALSE
LXI H,TESTSTRE12 ; "A"<>"B"
CALL EVAL ; RESULT: TRUE
LXI H,TESTSTRE13 ; "A"<"B"
CALL EVAL ; RESULT: TRUE
LXI H,TESTSTRE14 ; "A">"B"
CALL EVAL ; RESULT: FALSE
LXI H,TESTSTRE15 ; "A"<="B"
CALL EVAL ; RESULT: TRUE
LXI H,TESTSTRE16 ; "A">="B"
CALL EVAL ; RESULT: FALSE
LXI H,TESTSTRE21 ; "B"="A"
CALL EVAL ; RESULT: FALSE
LXI H,TESTSTRE22 ; "B"<>"A"
CALL EVAL ; RESULT: TRUE
LXI H,TESTSTRE23 ; "B"<"A"
CALL EVAL ; RESULT: FALSE
LXI H,TESTSTRE24 ; "B">"A"
CALL EVAL ; RESULT: TRUE
LXI H,TESTSTRE25 ; "B"<="A"
CALL EVAL ; RESULT: FALSE
LXI H,TESTSTRE26 ; "B">="A"
CALL EVAL ; RESULT: TRUE
CALL EXP_DUMPSTACK ; PRINT RESULTS
CALL EXP_CLEARSTACK
TEST_STR: ; TESTS OF STR$
LXI H,TESTSTRF
CALL IO_PUTS
CALL IO_PUTCR
LXI H,TESTSTRF01 ; STR$(0)
CALL EVAL ; RESULT: " 0"
LXI H,TESTSTRF02 ; STR$(-1)
CALL EVAL ; RESULT: "-1"
LXI H,TESTSTRF03 ; STR$(1234)
CALL EVAL ; RESULT: "1234"
LXI H,TESTSTRF04 ; STR$(10+10)
CALL EVAL ; RESULT: "20"
LXI H,TESTSTRF05 ; STR$(10*10)
CALL EVAL ; RESULT: "100"
CALL EXP_DUMPSTACK ; PRINT RESULTS
CALL EXP_CLEARSTACK
TEST_LEFT: ; TESTS OF LEFT$
LXI H,TESTSTRG
CALL IO_PUTS
CALL IO_PUTCR
LXI H,TESTSTRG01 ; LEFT$("ABCD",2)
CALL EVAL ; RESULT: "AB"
LXI H,TESTSTRG02 ; LEFT$("ABCD",4)
CALL EVAL ; RESULT: "ABCD"
LXI H,TESTSTRG03 ; LEFT$("ABCD",66)
CALL EVAL ; RESULT: "ABCD"
LXI H,TESTSTRG04 ; LEFT$("",0)
CALL EVAL ; RESULT: ""
LXI H,TESTSTRG05 ; LEFT$("",5)
CALL EVAL ; RESULT: ""
CALL EXP_DUMPSTACK ; PRINT RESULTS
CALL EXP_CLEARSTACK
TEST_RIGHT: ; TESTS OF RIGHT$
LXI H,TESTSTRH
CALL IO_PUTS
CALL IO_PUTCR
LXI H,TESTSTRH01 ; RIGHT$("ABCD",2)
CALL EVAL ; RESULT: "CD"
LXI H,TESTSTRH02 ; RIGHT$("ABCD",4)
CALL EVAL ; RESULT: "ABCD"
LXI H,TESTSTRH03 ; RIGHT$("ABCD",66)
CALL EVAL ; RESULT: "ABCD"
LXI H,TESTSTRH04 ; RIGHT$("",0)
CALL EVAL ; RESULT: ""
LXI H,TESTSTRH05 ; RIGHT$("",5)
CALL EVAL ; RESULT: ""
CALL EXP_DUMPSTACK ; PRINT RESULTS
CALL EXP_CLEARSTACK
TEST_MID: ; TESTS OF MID$
LXI H,TESTSTRI
CALL IO_PUTS
CALL IO_PUTCR
LXI H,TESTSTRI01 ; MID$("ABCD",66,66)
CALL EVAL ; RESULT: ""
LXI H,TESTSTRI02 ; MID$("ABCD",2,0)
CALL EVAL ; RESULT: ""
LXI H,TESTSTRI03 ; MID$("ABCD",1,1)
CALL EVAL ; RESULT: "A"
LXI H,TESTSTRI04 ; MID$("ABCD",2,2)
CALL EVAL ; RESULT: "BC"
LXI H,TESTSTRI05 ; MID$("ABCD",3,66)
CALL EVAL ; RESULT: "CD"
LXI H,TESTSTRI06 ; MID$("ABCD",4,1)
CALL EVAL ; RESULT: "D"
LXI H,TESTSTRI07 ; MID$("ABCD",3,255)
CALL EVAL ; RESULT: "CD"
CALL EXP_DUMPSTACK ; PRINT RESULTS
CALL EXP_CLEARSTACK
TEST_ERROR: ; TESTS OF ERROR HANDLING
LXI H,TESTSTRX
CALL IO_PUTS
CALL IO_PUTCR
LXI H,X01
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX01 ; 2 + "2"
CALL EVAL ; RESULT: TYPE MISMATCH
X01:
LXI H,X02
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX02 ; 2 AND "2"
CALL EVAL ; RESULT: TYPE MISMATCH
X02:
LXI H,X03
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX03 ; "THIS" = 3
CALL EVAL ; RESULT: TYPE MISMATCH
X03:
LXI H,X04
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX04 ; "THIS" / "THAT"
CALL EVAL ; RESULT: TYPE MISMATCH
X04:
LXI H,X05
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX05 ; "THIS" AND "THAT"
CALL EVAL ; RESULT: TYPE MISMATCH
X05:
LXI H,X06
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX06 ; -"THIS"
CALL EVAL ; RESULT: TYPE MISMATCH
X06:
LXI H,X07
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX07 ; NOT "THIS"
CALL EVAL ; RESULT: TYPE MISMATCH
X07:
LXI H,X08
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX08 ; ABS("THIS")
CALL EVAL ; RESULT: TYPE MISMATCH
X08:
LXI H,X09
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX09 ; SGN("THIS")
CALL EVAL ; RESULT: TYPE MISMATCH
X09:
LXI H,X0A
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX0A ; PEEK("THIS")
CALL EVAL ; RESULT: TYPE MISMATCH
X0A:
LXI H,X0B
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX0B ; RND("THIS")
CALL EVAL ; RESULT: TYPE MISMATCH
X0B:
LXI H,X0C
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX0C ; SQR("THIS")
CALL EVAL ; RESULT: TYPE MISMATCH
X0C:
LXI H,X0D
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX0D ; LEN(1234)
CALL EVAL ; RESULT: TYPE MISMATCH
X0D:
LXI H,X0E
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX0E ; ASC(1234)
CALL EVAL ; RESULT: TYPE MISMATCH
X0E:
LXI H,X0F
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX0F ; VAL(1234)
CALL EVAL ; RESULT: TYPE MISMATCH
X0F:
LXI H,X0G
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX0G ; CHR$("THIS")
CALL EVAL ; RESULT: TYPE MISMATCH
X0G:
LXI H,X0H
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX0H ; STR$("THIS")
CALL EVAL ; RESULT: TYPE MISMATCH
X0H:
LXI H,X0I
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX0I ; LEFT$("THIS", "THAT")
CALL EVAL ; RESULT: TYPE MISMATCH
X0I:
LXI H,X0J
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX0J ; LEFT$(3, 4)
CALL EVAL ; RESULT: TYPE MISMATCH
X0J:
LXI H,X0K
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX0K ; RIGHT$("THIS", "THAT")
CALL EVAL ; RESULT: TYPE MISMATCH
X0K:
LXI H,X0L
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX0L ; RIGHT$(3, 4)
CALL EVAL ; RESULT: TYPE MISMATCH
X0L:
LXI H,X0M
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX0M ; MID$(3, 2, 1)
CALL EVAL ; RESULT: TYPE MISMATCH
X0M:
LXI H,X0N
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX0N ; MID$("A", "B", 1)
CALL EVAL ; RESULT: TYPE MISMATCH
X0N:
LXI H,X0O
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX0O ; MID$("A", 3, "C")
CALL EVAL ; RESULT: TYPE MISMATCH
X0O:
LXI H,X11
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX11 ; ASC("")
CALL EVAL ; RESULT: ILLEGAL ARGUMENT
X11:
LXI H,X12
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX12 ; VAL("")
CALL EVAL ; RESULT: ILLEGAL ARGUMENT
X12:
LXI H,X13
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX13 ; CHR$(666)
CALL EVAL ; RESULT: ILLEGAL ARGUMENT
X13:
LXI H,X14
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX14 ; LEFT$("THIS",666)
CALL EVAL ; RESULT: ILLEGAL ARGUMENT
X14:
LXI H,X15
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX15 ; RIGHT$("THIS",666)
CALL EVAL ; RESULT: ILLEGAL ARGUMENT
X15:
LXI H,X16
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX16 ; MID$("THIS",0,1)
CALL EVAL ; RESULT: ILLEGAL ARGUMENT
X16:
LXI H,X17
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX17 ; MID$("THIS",666,1)
CALL EVAL ; RESULT: ILLEGAL ARGUMENT
X17:
LXI H,X21
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX18 ; MID$("THIS",1,666)
CALL EVAL ; RESULT: ILLEGAL ARGUMENT
X21:
LXI H,X22
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX21 ; 32760+10
CALL EVAL ; RESULT: OVERFLOW
X22:
LXI H,X23
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX22 ; 3280*10
CALL EVAL ; RESULT: OVERFLOW
X23:
LXI H,X24
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX23 ; -32767-100
CALL EVAL ; RESULT: OVERFLOW
X24:
LXI H,X31
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX24 ; 1000/0
CALL EVAL ; RESULT: DIVISION BY ZERO
X31:
LXI H,X32
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX31 ; 2*(2+2
CALL EVAL ; RESULT: SYNTAX ERROR
X32:
LXI H,X33
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX32 ; ABS(123
CALL EVAL ; RESULT: SYNTAX ERROR
X33:
LXI H,X34
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX33 ; LEFT$("THIS")
CALL EVAL ; RESULT: SYNTAX ERROR
X34:
LXI H,X35
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX34 ; RIGHT$("THAT")
CALL EVAL ; RESULT: SYNTAX ERROR
X35:
LXI H,X36
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX35 ; MID$("THAT")
CALL EVAL ; RESULT: SYNTAX ERROR
X36:
LXI H,X37
SHLD ERR_RESTARTPTR
LXI H,TESTSTRX36 ; MID$("THAT",2)
CALL EVAL ; RESULT: SYNTAX ERROR
X37:
LXI H,LOOP
SHLD ERR_RESTARTPTR
TEST_LIST:
LXI H,TESTSTRLIST
CALL IO_PUTS
CALL IO_PUTCR
LXI H,TESTSTRLIST01 ; LIST
CALL EXECUTE ; RESULT: LISTS PROGRAM
CALL IO_PUTCR
LXI H,TESTSTRLIST02 ; LIST
CALL EXECUTE ; RESULT: LISTS PROGRAM
CALL IO_PUTCR
TEST_END:
LXI H,TESTSTREND
CALL IO_PUTS
CALL IO_PUTCR
LXI H,TESTSTREND01 ; LIST : END : LIST
CALL EXECUTE ; RESULT: LIST (ONCE)
CALL IO_PUTCR
TEST_NEW:
LXI H,TESTSTRNEW
CALL IO_PUTS
CALL IO_PUTCR
LXI H,TESTSTRNEW01 ; LIST : NEW : LIST
CALL EXECUTE ; RESULT: LIST (ONCE)
CALL IO_PUTCR
; "RESTORE" PROGRAM
LXI H,TESTPRG1 ; PROGRAM MEMORY
SHLD PRG_LOPTR
LXI H,TESTPRG4END
SHLD PRG_HIPTR
SHLD VAR_LOPTR
SHLD VAR_HIPTR
TEST_PRINT:
LXI H,TESTSTRPRINT
CALL IO_PUTS
CALL IO_PUTCR
LXI H,TESTSTRPRINT01 ; PRINT 1234
CALL EXECUTE ; RESULT: 1234
LXI H,TESTSTRPRINT02 ; PRINT 1234 + 5678
CALL EXECUTE ; RESULT: 6912
LXI H,TESTSTRPRINT03 ; PRINT 1234 , 5678
CALL EXECUTE ; RESULT: 1234 5678
LXI H,TESTSTRPRINT04 ; PRINT 1234 : ? 6666
CALL EXECUTE ; RESULT: 1234 (CR) 6666
LXI H,TESTSTRPRINT05 ; PRINT 1234 ; : ? 5678
CALL EXECUTE ; RESULT: 1234 5678
LXI H,TESTSTRPRINT06 ; PRINT ZZ,ZZ*10,ZZ*100
CALL EXECUTE ; RESULT: 70 700 7000
LXI H,TESTSTRPRINT07 ; PRINT 1234 , : ? 5678
CALL EXECUTE ; RESULT: 1234 5678
LXI H,TESTSTRPRINT11 ; PRINT "THIS"
CALL EXECUTE ; RESULT: THIS
LXI H,TESTSTRPRINT12 ; PRINT "","Z","X",123
CALL EXECUTE ; RESULT: Z X 123
LXI H,TESTSTRPRINT13 ; PRINT STR$(66*66),666
CALL EXECUTE ; RESULT: 4356 666
TEST_LET:
LXI H,TESTSTRLET
CALL IO_PUTS
CALL IO_PUTCR
LXI H,TESTSTRLET01 ; ?V0,: LETV0=123 : ?V0
CALL EXECUTE ; RESULT: 0 123
LXI H,TESTSTRLET02 ; V0=V0*V0 :?"V0=";V0
CALL EXECUTE ; RESULT: V0=15129
LXI H,TESTSTRLET03 ; A$=CHR$(65):?"A$=";A$
CALL EXECUTE ; RESULT: A$=A
LXI H,TESTSTRLET04 ; A$=A$+"123":?"A$=";A$
CALL EXECUTE ; RESULT: A$=A123
LXI H,TESTSTRLET05 ; Z$=LEFT$(A$,2):?"Z$=";Z$
CALL EXECUTE ; RESULT: Z$=A1
LXI H,TESTSTRLET06 ; ZZ$=A$+A$+Z$+Z$
CALL EXECUTE ; RESULT: ZZ$=A123A123A1A1
TEST_CLR:
LXI H,TESTSTRCLR
CALL IO_PUTS
CALL IO_PUTCR
LXI H,TESTSTRCLR01 ; A=123:?"A=";A,:CLR:?"A=";A
CALL EXECUTE ; RESULT: A=123 A=0
LXI H,TESTSTRCLR02 ; A$="ZXC":?A$,:CLR:?"A$=";A$
CALL EXECUTE ; RESULT: ZXC A$=
TEST_REM:
LXI H,TESTSTRREM
CALL IO_PUTS
CALL IO_PUTCR
LXI H,TESTSTRREM01 ; ?"REMTEST";:REM TEST:?TEST
CALL EXECUTE ; RESULT: REMTEST
TEST_IF:
LXI H,TESTSTRIF
CALL IO_PUTS
CALL IO_PUTCR
LXI H,TESTSTRIF01 ; IF 1 = 0 THEN ?1:?2:?3
CALL EXECUTE ; RESULT: ""
LXI H,TESTSTRIF02 ; IF 1 = 1 THEN ?1:?2:?3
CALL EXECUTE ; RESULT: 123
LXI H,TESTSTRIF03 ; IF 1=0 THEN?"1=0"ELSE?"1<>0"
CALL EXECUTE ; RESULT: 1<>0
LXI H,TESTSTRIF04 ; IF 1=1 THEN?"1=1"ELSE?"1<>1"
CALL EXECUTE ; RESULT: 1=1
LOOP:
JMP LOOP
EVAL:
PUSH H
CALL TOK_TOKENIZE1
POP H
XCHG
LXI H,OUTSTR
CALL TOK_TOKENIZE2
LXI H,OUTSTR
CALL EXP_L0
RET
EXECUTE::
PUSH H
CALL TOK_TOKENIZE1
POP H
XCHG
LXI H,OUTSTR
CALL TOK_TOKENIZE2
LXI H,OUTSTR
MVI B,FALSE ; INIF = FALSE
MVI C,TRUE ; EXECUTE = TRUE
CALL EXP_EXPREVAL
RET
TEST_INTERACTIVE:
LXI H,READYSTR
CALL IO_PUTS
CALL IO_PUTCR
LXI H,INSTR ; PTR TO INPUT STR IN HL
LL:
CALL IO_GETCHAR ; READ CHARACTER FROM INBUFFER
ORA A ; NOCHAR
JZ LL
CPI 13 ; CHECK FOR (CR)
JZ DONE
MOV M,A ; COPY CHAR TO BUFFER
INX H ; PTR++
JMP LL ; LOOP
DONE:
MVI M,0 ; NULL-TERMINATE STR
LXI H,INSTR ; PTR TO INPUT STR IN HL
CALL EXECUTE
JMP TEST_INTERACTIVE
READYSTR: .asciz 'Ready.'
.area DATA (REL,CON)
TESTSTR0: .asciz 'TESTS OF BINARY ARITHMETIC OPERATIONS'
TESTSTR001: .asciz '4+4' ; 8
TESTSTR002: .asciz '4-4' ; 0
TESTSTR003: .asciz '4*4' ; 16
TESTSTR004: .asciz '4/4' ; 1
TESTSTR005: .asciz 'A+50' ; 50
TESTSTR006: .asciz '50+ZZ' ; 50
TESTSTR1: .asciz 'TESTS OF BINARY RELATIONS'
TESTSTR101: .asciz '4=4' ; TRUE
TESTSTR102: .asciz '4<>4' ; FALSE
TESTSTR103: .asciz '4<4' ; FALSE
TESTSTR104: .asciz '4>4' ; FALSE
TESTSTR105: .asciz '4<=4' ; TRUE
TESTSTR106: .asciz '4>=4' ; TRUE
TESTSTR111: .asciz '1=10' ; FALSE
TESTSTR112: .asciz '1<>10' ; TRUE
TESTSTR113: .asciz '1<10' ; TRUE
TESTSTR114: .asciz '1>10' ; FALSE
TESTSTR115: .asciz '1<=10' ; TRUE
TESTSTR116: .asciz '1>=10' ; FALSE
TESTSTR121: .asciz '10=1' ; FALSE
TESTSTR122: .asciz '10<>1' ; TRUE
TESTSTR123: .asciz '10<1' ; FALSE
TESTSTR124: .asciz '10>1' ; TRUE
TESTSTR125: .asciz '10<=1' ; FALSE
TESTSTR126: .asciz '10>=1' ; TRUE
TESTSTR131: .asciz 'ZZ=ZZ+1' ; FALSE
TESTSTR132: .asciz 'ZZ<>ZZ+1' ; TRUE
TESTSTR133: .asciz 'ZZ<ZZ/2' ; FALSE
TESTSTR134: .asciz 'ZZ>ZZ/10' ; TRUE
TESTSTR135: .asciz 'ZZ<=ZZ-1' ; FALSE
TESTSTR136: .asciz 'ZZ>=ZZ-ZZ' ; TRUE
TESTSTR2: .asciz 'TESTS OF LOGICAL OPERATORS (AND OR XOR)'
TESTSTR201: .asciz '0 AND 0' ; 0
TESTSTR202: .asciz '0 AND 255' ; 0
TESTSTR203: .asciz '255 AND 0' ; 0
TESTSTR204: .asciz '255 AND 255' ; 255
TESTSTR211: .asciz '0 OR 0' ; 0
TESTSTR212: .asciz '0 OR 255' ; 255
TESTSTR213: .asciz '255 OR 0' ; 255
TESTSTR214: .asciz '255 OR 255' ; 255
TESTSTR221: .asciz '0 XOR 0' ; 0
TESTSTR222: .asciz '0 XOR 255' ; 255
TESTSTR223: .asciz '255 XOR 0' ; 255
TESTSTR224: .asciz '255 XOR 255' ; 0
TESTSTR3: .asciz 'TESTS OF NEGATION'
TESTSTR301: .asciz '-10' ; -10
TESTSTR302: .asciz '--10' ; +10
TESTSTR303: .asciz '-(2+2)' ; -4
TESTSTR304: .asciz '-(-5--1)' ; +4
TESTSTR4: .asciz 'TESTS OF NOT'
TESTSTR401: .asciz 'NOT 0' ; -1
TESTSTR402: .asciz 'NOT NOT 0' ; 0
TESTSTR403: .asciz 'NOT -1' ; 0
TESTSTR404: .asciz 'NOT --1' ; -2
TESTSTR5: .asciz 'TESTS OF ABS'
TESTSTR501: .asciz 'ABS ( 0 ) ' ; 0
TESTSTR502: .asciz 'ABS ( 1 ) ' ; 1
TESTSTR503: .asciz 'ABS ( -1 )' ; 1
TESTSTR504: .asciz 'ABS ( - ABS ( -10 ) )' ; 10
TESTSTR6: .asciz 'TESTS OF SGN'
TESTSTR601: .asciz 'SGN ( 0 ) ' ; 0
TESTSTR602: .asciz 'SGN ( 1 ) ' ; 1
TESTSTR603: .asciz 'SGN ( -1 )' ; -1
TESTSTR604: .asciz 'SGN ( -32768 )' ; -1
TESTSTR605: .asciz 'SGN ( 32767 )' ; 1
TESTSTR7: .asciz 'TESTS OF PEEK'
TESTSTR701: .asciz 'PEEK ( 0 ) ' ;
TESTSTR702: .asciz 'PEEK ( 32767 ) ' ;
TESTSTR703: .asciz 'PEEK ( -1 )' ; 1
TESTSTRR0: .asciz 'TESTS OF RND'
TESTSTRRND: .asciz 'RND(0)' ;
TESTSTR8: .asciz 'TESTS OF SQR'
TESTSTR801: .asciz 'SQR(10)' ; 3
TESTSTR802: .asciz 'SQR(100)' ; 10
TESTSTR803: .asciz 'SQR(1000)' ; 31
TESTSTR804: .asciz 'SQR(10000)' ; 100
TESTSTR9: .asciz 'TESTS OF LEN'
TESTSTR901: .asciz 'LEN("")' ; 0
TESTSTR902: .asciz 'LEN("A")' ; 1
TESTSTR903: .asciz 'LEN("12345")' ; 5
TESTSTRA: .asciz 'TESTS OF ASC'
TESTSTRA01: .asciz 'ASC("1234")' ; '1'
TESTSTRA02: .asciz 'ASC(" ")' ; 32
TESTSTRB: .asciz 'TESTS OF VAL'
TESTSTRB01: .asciz 'VAL("1234")' ; 1234
TESTSTRB02: .asciz 'VAL("-666")' ; -666
TESTSTRC: .asciz 'TESTS OF CHR$'
TESTSTRC01: .asciz 'CHR$(65)' ; "A"
TESTSTRC02: .asciz 'CHR$(48)' ; "0"
TESTSTRD: .asciz 'TESTS OF ADD (STR)'
TESTSTRD01: .asciz '"1234"+"66"' ; "123466"
TESTSTRD02: .asciz '"6666"+""' ; "6666"
TESTSTRE: .asciz 'TESTS OF BINARY RELATIONS'
TESTSTRE01: .asciz '"A"="A"' ; TRUE
TESTSTRE02: .asciz '"B"<>"B"' ; FALSE
TESTSTRE03: .asciz '"C"<"C"' ; FALSE
TESTSTRE04: .asciz '"C">"C"' ; FALSE
TESTSTRE05: .asciz '"D"<="D"' ; TRUE
TESTSTRE06: .asciz '"E">="E"' ; TRUE
TESTSTRE11: .asciz '"A"="B"' ; FALSE
TESTSTRE12: .asciz '"A"<>"B"' ; TRUE
TESTSTRE13: .asciz '"A"<"B"' ; TRUE
TESTSTRE14: .asciz '"A">"B"' ; FALSE
TESTSTRE15: .asciz '"A"<="B"' ; TRUE
TESTSTRE16: .asciz '"A">="B"' ; FALSE
TESTSTRE21: .asciz '"B"="A"' ; FALSE
TESTSTRE22: .asciz '"B"<>"A"' ; TRUE
TESTSTRE23: .asciz '"B"<"A"' ; FALSE
TESTSTRE24: .asciz '"B">"A"' ; TRUE
TESTSTRE25: .asciz '"B"<="A"' ; FALSE
TESTSTRE26: .asciz '"B">="A"' ; TRUE
TESTSTRF: .asciz 'TESTS OF STR$'
TESTSTRF01: .asciz 'STR$(0)' ; " 0"
TESTSTRF02: .asciz 'STR$(-1)' ; "-1"
TESTSTRF03: .asciz 'STR$(1234)' ; "1234"
TESTSTRF04: .asciz 'STR$(10+10)' ; "20"
TESTSTRF05: .asciz 'STR$(10*10)' ; "100"
TESTSTRG: .asciz 'TESTS OF LEFT$'
TESTSTRG01: .asciz 'LEFT$("ABCD",2)' ; "AB"
TESTSTRG02: .asciz 'LEFT$("ABCD",4)' ; "ABCD"
TESTSTRG03: .asciz 'LEFT$("ABCD",66)' ; "ABCD"
TESTSTRG04: .asciz 'LEFT$("",0)' ; ""
TESTSTRG05: .asciz 'LEFT$("",5)' ; ""
TESTSTRH: .asciz 'TESTS OF RIGHT$'
TESTSTRH01: .asciz 'RIGHT$("ABCD",2)' ; "CD"
TESTSTRH02: .asciz 'RIGHT$("ABCD",4)' ; "ABCD"
TESTSTRH03: .asciz 'RIGHT$("ABCD",66)' ; "ABCD"
TESTSTRH04: .asciz 'RIGHT$("",0)' ; ""
TESTSTRH05: .asciz 'RIGHT$("",5)' ; ""
TESTSTRI: .asciz 'TESTS OF MID$'
TESTSTRI01: .asciz 'MID$("ABCD",66,66)' ; ""
TESTSTRI02: .asciz 'MID$("ABCD",2,0)' ; ""
TESTSTRI03: .asciz 'MID$("ABCD",1,1)' ; "A"
TESTSTRI04: .asciz 'MID$("ABCD",2,2)' ; "BC"
TESTSTRI05: .asciz 'MID$("ABCD",3,66)' ; "CD"
TESTSTRI06: .asciz 'MID$("ABCD",4,1)' ; "D"
TESTSTRI07: .asciz 'MID$("ABCD",3,255)' ; "CD"
TESTSTRX: .asciz 'TESTS OF ERROR HANDLING'
TESTSTRX01: .asciz '2 + "2"' ; TYPE MISMATCH
TESTSTRX02: .asciz '2 AND "2"' ; TYPE MISMATCH
TESTSTRX03: .asciz '"THIS" = 3' ; TYPE MISMATCH
TESTSTRX04: .asciz '"THIS" / "THAT"' ; TYPE MISMATCH
TESTSTRX05: .asciz '"THIS" AND "THAT"' ; TYPE MISMATCH
TESTSTRX06: .asciz '-"THIS"' ; TYPE MISMATCH
TESTSTRX07: .asciz 'NOT "THIS"' ; TYPE MISMATCH
TESTSTRX08: .asciz 'ABS("THIS")' ; TYPE MISMATCH
TESTSTRX09: .asciz 'SGN("THIS")' ; TYPE MISMATCH
TESTSTRX0A: .asciz 'PEEK("THIS")' ; TYPE MISMATCH
TESTSTRX0B: .asciz 'RND("THIS")' ; TYPE MISMATCH
TESTSTRX0C: .asciz 'SQR("THIS")' ; TYPE MISMATCH
TESTSTRX0D: .asciz 'LEN(1234)' ; TYPE MISMATCH
TESTSTRX0E: .asciz 'ASC(1234)' ; TYPE MISMATCH
TESTSTRX0F: .asciz 'VAL(1234)' ; TYPE MISMATCH
TESTSTRX0G: .asciz 'CHR$("THIS")' ; TYPE MISMATCH
TESTSTRX0H: .asciz 'STR$("THIS")' ; TYPE MISMATCH
TESTSTRX0I: .asciz 'LEFT$("THIS", "THAT")' ; TYPE MISMATCH
TESTSTRX0J: .asciz 'LEFT$(3, 4)' ; TYPE MISMATCH
TESTSTRX0K: .asciz 'RIGHT$("THIS", "THAT")'; TYPE MISMATCH
TESTSTRX0L: .asciz 'RIGHT$(3, 4)' ; TYPE MISMATCH
TESTSTRX0M: .asciz 'MID$(3, 2, 1)' ; TYPE MISMATCH
TESTSTRX0N: .asciz 'MID$("A", "B", 1)' ; TYPE MISMATCH
TESTSTRX0O: .asciz 'MID$("A", 3, "C")' ; TYPE MISMATCH
TESTSTRX11: .asciz 'ASC("")' ; ILLEGAL ARGUMENT
TESTSTRX12: .asciz 'VAL("")' ; ILLEGAL ARGUMENT
TESTSTRX13: .asciz 'CHR$(666)' ; ILLEGAL ARGUMENT
TESTSTRX14: .asciz 'LEFT$("THIS",666)' ; ILLEGAL ARGUMENT
TESTSTRX15: .asciz 'RIGHT$("THIS",666)' ; ILLEGAL ARGUMENT
TESTSTRX16: .asciz 'MID$("THIS",0,1)' ; ILLEGAL ARGUMENT
TESTSTRX17: .asciz 'MID$("THIS",666,1)' ; ILLEGAL ARGUMENT
TESTSTRX18: .asciz 'MID$("THIS",1,666)' ; ILLEGAL ARGUMENT
TESTSTRX21: .asciz '32760+10' ; OVERFLOW
TESTSTRX22: .asciz '3280*10' ; OVERFLOW
TESTSTRX23: .asciz '-32767-100' ; OVERFLOW
TESTSTRX24: .asciz '1000/0' ; DIVISION BY ZERO
TESTSTRX31: .asciz '2*(2+2' ; SYNTAX ERROR
TESTSTRX32: .asciz 'ABS(123' ; SYNTAX ERROR
TESTSTRX33: .asciz 'LEFT$("THIS")' ; SYNTAX ERROR
TESTSTRX34: .asciz 'RIGHT$("THAT")' ; SYNTAX ERROR
TESTSTRX35: .asciz 'MID$("THAT")' ; SYNTAX ERROR
TESTSTRX36: .asciz 'MID$("THAT",2)' ; SYNTAX ERROR
TESTSTRLIST: .asciz 'TESTS OF LIST FUNCTION'
TESTSTRLIST01: .asciz 'LIST' ; LIST
TESTSTRLIST02: .asciz 'LIST : LIST ' ; LIST (TWICE)
TESTSTREND: .asciz 'TESTS OF END FUNCTION'
TESTSTREND01: .asciz 'LIST : END : LIST ' ; LIST (ONCE)
TESTSTRNEW: .asciz 'TESTS OF NEW FUNCTION'
TESTSTRNEW01: .asciz 'LIST : NEW : LIST ' ; LIST (ONCE)
TESTSTRPRINT: .asciz 'TESTS OF PRINT FUNCTION'
TESTSTRPRINT01: .asciz 'PRINT 1234' ; 1234
TESTSTRPRINT02: .asciz 'PRINT 1234 + 5678' ; 6912
TESTSTRPRINT03: .asciz 'PRINT 1234 , 5678' ; 1234 5678
TESTSTRPRINT04: .asciz 'PRINT 1234 : ? 6666' ; 1234 (CR) 6666
TESTSTRPRINT05: .asciz 'PRINT 1234 ; : ? 5678' ; 12345678
TESTSTRPRINT06: .asciz 'PRINT ZZ,ZZ*10,ZZ*100' ; 70 700 7000
TESTSTRPRINT07: .asciz 'PRINT 1234 , : ? 5678' ; 1234 5678
TESTSTRPRINT11: .asciz 'PRINT "THIS"' ; THIS
TESTSTRPRINT12: .asciz 'PRINT "","Z","X",123' ; Z X 123
TESTSTRPRINT13: .asciz 'PRINT STR$(66*66),666' ; 4356 666
TESTSTRLET: .asciz 'TESTS OF VARIABLE ASSIGNATION'
TESTSTRLET01: .asciz '?V0,: LETV0=123 : ?V0' ; 0 123
TESTSTRLET02: .asciz 'V0=V0*V0 :?"V0=";V0' ; 15129
TESTSTRLET03: .asciz 'A$=CHR$(65):?"A$=";A$' ; A$=A
TESTSTRLET04: .asciz 'A$=A$+"123":?"A$=";A$' ; A$=A123
TESTSTRLET05: .asciz 'Z$=LEFT$(A$,2):?"Z$=";Z$' ; Z$=A1
TESTSTRLET06: .asciz 'ZZ$=A$+A$+Z$+Z$:?"ZZ$=",ZZ$' ; ZZ$= A123A123A1A1
TESTSTRCLR: .asciz 'TESTS OF CLR'
TESTSTRCLR01: .asciz 'A=123:?"A=";A,:CLR:?"A=";A' ; A=123 A=0
TESTSTRCLR02: .asciz 'A$="ZXC":?A$,:CLR:?"A$=";A$' ; ZXC A$=
TESTSTRREM: .asciz 'TESTS OF REM'
TESTSTRREM01: .asciz '?"REMTEST";:REM TEST:?TEST' ; REMTEST
TESTSTRIF: .asciz 'TESTS OF IF'
TESTSTRIF01: .asciz 'IF 1 = 0 THEN ?1:?2:?3' ; ""
TESTSTRIF02: .asciz 'IF 1 = 1 THEN ?1;:?2;:?3' ; 123
TESTSTRIF03: .asciz 'IF 1=0 THEN?"1=0"ELSE?"1<>0"' ; 1<>0
TESTSTRIF04: .asciz 'IF 1=1 THEN?"1=1"ELSE?"1<>1"' ; 1=1
INSTR:: .ds 128
OUTSTR:: .ds 128
TESTPRG1:
.db TESTPRG1END-TESTPRG1 ; SIZE
.dw 10 ; LINE NO
.db K_PRINT,32,SID_CINT .dw 1234 .db 0
TESTPRG1END:
TESTPRG2:
.db TESTPRG2END-TESTPRG2 ; SIZE
.dw 20 ; LINE NO
.db K_LET,32,SID_VAR,'A,'B,32,K_EQUAL,32,SID_CINT .dw -6666 .db 0
TESTPRG2END:
TESTPRG3:
.db TESTPRG3END-TESTPRG3 ; SIZE
.dw 30 ; LINE NO
.db K_PRINT,32,SID_VAR,'A,'B,32,', ,SID_CSTR,4 .ascii "ABCD" .db 0
TESTPRG3END:
TESTPRG4:
.db TESTPRG4END-TESTPRG4 ; SIZE
.dw 40 ; LINE NO
.db K_GOTO,32,SID_CINT .dw 10 .db 0
TESTPRG4END:
.ds 64
| 23.582797 | 70 | 0.661792 |
ba00919b0f87970a3fee1643b1791d3c736012c9 | 4,571 | asm | Assembly | cmd/edlin/edlequ.asm | minblock/msdos | 479ffd237d9bb7cc83cb06361db2c4ef42dfbac0 | [
"Apache-2.0"
] | null | null | null | cmd/edlin/edlequ.asm | minblock/msdos | 479ffd237d9bb7cc83cb06361db2c4ef42dfbac0 | [
"Apache-2.0"
] | null | null | null | cmd/edlin/edlequ.asm | minblock/msdos | 479ffd237d9bb7cc83cb06361db2c4ef42dfbac0 | [
"Apache-2.0"
] | null | null | null | page 60,132 ;
;/*
; * Microsoft Confidential
; * Copyright (C) Microsoft Corporation 1991
; * All Rights Reserved.
; */
.xlist
include version.inc
include DOSSYM.INC
include EDLSTDSW.INC
.list
;======================= START OF SPECIFICATIONS =========================
;
; MODULE NAME: EDLEQU.SAL
;
; DESCRIPTIVE NAME: EQUATES FOR EDLIN
;
; FUNCTION: PROVIDES EQUATES FOR EDLIN. IT ALSO PROVIDES THE MACRO
; VAL_YN.
;
; ENTRY POINT: NA
;
; INPUT: NA
;
; EXIT NORMAL: NA
;
; EXIT ERROR: NA
;
; INTERNAL REFERENCES:
;
; ROUTINE: VAL_YN - VALIDATES Y/N RESPONSES FROM THE KEYBOARD
;
; EXTERNAL REFERENCES:
;
; ROUTINE: NA
;
; NOTES: THIS MODULE IS TO BE PREPPED BY SALUT WITH THE "PR" OPTIONS.
; LINK EDLIN+EDLCMD1+EDLCMD2+EDLMES+EDLPARSE
;
; REVISION HISTORY:
;
; AN000 VERSION 4.00 - REVISIONS MADE RELATE TO THE FOLLOWING:
;
; - IMPLEMENT SYSPARSE
; - IMPLEMENT MESSAGE RETRIEVER
; - IMPLEMENT DBCS ENABLING
; - ENHANCED VIDEO SUPPORT
; - EXTENDED OPENS
; - SCROLLING ERROR
;
; COPYRIGHT: "MS DOS EDLIN UTILITY"
; "VERSION 4.00 (C) COPYRIGHT 1988 Microsoft"
;
;======================= END OF SPECIFICATIONS ===========================
COMAND_LINE_LENGTH EQU 128
QUOTE_CHAR EQU 16H ;Quote character = ^V
CR EQU 13
STKSIZ EQU 200h
STACK equ stksiz
asian_blk equ DB_SP_LO ;an000;asian blank 2nd. byte
dbcs_lead_byte equ DB_SP_HI ;an000;asian blank lead byte
nul equ 00h ;an000;nul character
Access_Denied equ 0005h ;an000;extended error code for access denied
;======== Y/N validation equates =========================================
yn_chk equ 23h ;an000;check for Y/N response
max_len equ 01h ;an000;max. len. for Y/N char.
yes equ 01h ;an000;boolean yes value
no equ 00h ;an000;boolean no value
;======== text display values for initialization =========================
video_get equ 0fh ;an000;int 10 get video attributes
video_set equ 00h ;an000;int 10 set video attributes
video_text equ 03h ;an000;80 X 25 color monitor
;======== code page values for functions =================================
get_set_cp equ 66h ;an000;get or set code page
get_cp equ 01h ;an000;get active code page
set_cp equ 02h ;an000;set active code page
;======== screen length & width defaults =================================
std_out equ 01h ;an000;console output
display_attr equ 03h ;an000;display for IOCTL
Get_Display equ 7fh ;an000;Get display for IOCTL
ifndef JAPAN
Def_Disp_Len equ 25 ;an000;default display length
else ; if JAPAN
Def_Disp_Len equ 24
endif
Def_Disp_Width equ 80 ;an000;default display width
;======== extended open equates ==========================================
rw equ 0082h ;an000;read/write
; compatibility
; noinherit
; int 24h handler
; no commit
ext_read equ 0080h ;an000;read
; compatibility
; noinherit
; int 24h handler
; no commit
rw_flag equ 0101h ;an000;fail if file not exist
; open if file exists
; don't validate code page
creat_flag equ 0110h ;an000;create if file does not exist
; fail if file exists
; don't validate code page
open_flag equ 0101h ;an000;fail if file not exist
; open if file exists
; don't validate code page
creat_open_flag equ 0112h ;an000;create if file does not exist
; open/replace if file exists
; don't validate code page
attr equ 00h ;an000;attributes set to 0
;======== parse value equates ============================================
nrm_parse_exit equ 0ffffh ;an000;normal exit from sysparse
too_many equ 01h ;an000;too many parms entered
op_missing equ 02h ;an000;required operand missing
sw_missing equ 03h ;an000;not a valid switch
;======== Strucs =========================================================
Display_Buffer_Struc Struc ;an000;dms;
Display_Info_Level db ? ;an000;dms;
Display_Reserved db ? ;an000;dms;
Display_Buffer_Size dw ? ;an000;dms;
Display_Flags dw ? ;an000;dms;
Display_Mode db ? ;an000;dms;
; TEXT=01
; APA =02
Display_Mode_Reserved db ? ;an000;dms;
Display_Colors dw ? ;an000;dms;# of colors
Display_Width_Pixels dw ? ;an000;dms;# of pixels in width
Display_Length_Pixels dw ? ;an000;dms;# of pixels in len.
Display_Width_Char dw ? ;an000;dms;# of chars in width
Display_Length_Char dw ? ;an000;dms;# of chars in length
Display_Buffer_Struc ends ;an000;dms;
| 27.871951 | 74 | 0.62284 |
459573ae3ce0fea801740b6659e4ca0b5f7c51fc | 1,590 | asm | Assembly | library/02_functions_batch1/unknown_1000a250.asm | SamantazFox/dds140-reverse-engineering | 4c8c286ffc20f2ee07061c83b0a0a68204d90148 | [
"Unlicense"
] | 1 | 2021-06-05T23:41:15.000Z | 2021-06-05T23:41:15.000Z | library/02_functions_batch1/unknown_1000a250.asm | SamantazFox/dds140-reverse-engineering | 4c8c286ffc20f2ee07061c83b0a0a68204d90148 | [
"Unlicense"
] | null | null | null | library/02_functions_batch1/unknown_1000a250.asm | SamantazFox/dds140-reverse-engineering | 4c8c286ffc20f2ee07061c83b0a0a68204d90148 | [
"Unlicense"
] | null | null | null | 1000a250: 55 push ebp
1000a251: 8b ec mov ebp,esp
1000a253: 56 push esi
1000a254: 33 c0 xor eax,eax
1000a256: 50 push eax
1000a257: 50 push eax
1000a258: 50 push eax
1000a259: 50 push eax
1000a25a: 50 push eax
1000a25b: 50 push eax
1000a25c: 50 push eax
1000a25d: 50 push eax
1000a25e: 8b 55 0c mov edx,DWORD PTR [ebp+0xc]
1000a261: 8d 49 00 lea ecx,[ecx+0x0]
1000a264: 8a 02 mov al,BYTE PTR [edx]
1000a266: 0a c0 or al,al
1000a268: 74 09 je 0x1000a273
1000a26a: 83 c2 01 add edx,0x1
1000a26d: 0f ab 04 24 bts DWORD PTR [esp],eax
1000a271: eb f1 jmp 0x1000a264
1000a273: 8b 75 08 mov esi,DWORD PTR [ebp+0x8]
1000a276: 8b ff mov edi,edi
1000a278: 8a 06 mov al,BYTE PTR [esi]
1000a27a: 0a c0 or al,al
1000a27c: 74 0c je 0x1000a28a
1000a27e: 83 c6 01 add esi,0x1
1000a281: 0f a3 04 24 bt DWORD PTR [esp],eax
1000a285: 73 f1 jae 0x1000a278
1000a287: 8d 46 ff lea eax,[esi-0x1]
1000a28a: 83 c4 20 add esp,0x20
1000a28d: 5e pop esi
1000a28e: c9 leave
1000a28f: c3 ret
| 46.764706 | 62 | 0.45283 |
edca148ee54f4ccd4452ddaff5933a42374ada45 | 2,202 | asm | Assembly | ntio/openout.asm | DigitalMars/optlink | 493de158282046641ef2a3a60a88e25e26d88ec4 | [
"BSL-1.0"
] | 28 | 2015-02-03T01:38:24.000Z | 2022-03-23T05:48:24.000Z | ntio/openout.asm | DigitalMars/optlink | 493de158282046641ef2a3a60a88e25e26d88ec4 | [
"BSL-1.0"
] | 20 | 2015-01-02T14:51:20.000Z | 2021-01-09T21:37:19.000Z | ntio/openout.asm | DigitalMars/optlink | 493de158282046641ef2a3a60a88e25e26d88ec4 | [
"BSL-1.0"
] | 9 | 2015-02-11T17:43:56.000Z | 2019-09-05T11:07:02.000Z | TITLE OPEN_OUT - Copyright (C) SLR Systems 1994
INCLUDE MACROS
INCLUDE IO_STRUC
INCLUDE WIN32DEF
PUBLIC OPEN_OUTPUT,GET_OUTPUT_DEVICE
.DATA
EXTERNDEF SHARE_ANDER:BYTE,ASCIZ:BYTE
EXTERNDEF _FILE_LIST_GARRAY:STD_PTR_S,MYO_STUFF:MYO_STRUCT
.CODE PASS2_TEXT
EXTERNDEF MOVE_FN_TO_ASCIZ:PROC,_recover_handle:PROC,_err_file_list_abort:proc
EXTERNDEF _FLUSH_DISABLE_MAPOUT:PROC,REPORT_OUT_ASCIZ:PROC
EXTERNDEF CANT_CREATE_ERR:ABS
GET_OUTPUT_DEVICE PROC
;
;RETURN EAX AS NEXT AVAILABLE MYO_STUFF
;
MOV EAX,OFF MYO_STUFF
PUSH EDI
L1$:
MOV ECX,[EAX].MYO_STRUCT.MYO_BUSY
ADD EAX,SIZE MYO_STRUCT
TEST ECX,ECX
JNZ L1$
L2$:
SUB EAX,SIZE MYO_STRUCT
MOV ECX,SIZE MYO_STRUCT/4
MOV EDI,EAX
MOV EDX,EAX
XOR EAX,EAX
REP STOSD
DEC ECX
MOV EAX,EDX
POP EDI
MOV [EDX].MYO_STRUCT.MYO_BUSY,ECX
RET
GET_OUTPUT_DEVICE ENDP
OPEN_OUTPUT PROC
;
;EAX IS FILE_LIST_GINDEX
;
;RETURNS EAX = MYO_STRUCT
;
PUSHM EDI,ESI
MOV EDI,EAX
CALL GET_OUTPUT_DEVICE ;GET AVAILABLE DEVICE
PUSH EBX
MOV EBX,EAX
MOV [EAX].MYO_STRUCT.MYO_FILE_LIST_GINDEX,EDI
ASSUME EBX:PTR MYO_STRUCT
CONVERT EDI,EDI,_FILE_LIST_GARRAY
ASSUME EDI:PTR FILE_LIST_STRUCT
L12$:
MOV EAX,FILE_FLAG_RANDOM_ACCESS
MOV CL,[EDI].FILE_LIST_FLAGS
AND CL,MASK FLF_RANDOM
JNZ L13$
MOV EAX,FILE_FLAG_SEQUENTIAL_SCAN
L13$:
PUSH 0 ;TEMPLATE FILE
PUSH EAX ;ATTRS&FLAGS
MOV EAX,OPEN_ALWAYS
GETT CL,FORCE_CREATE
OR CL,CL
JZ L14$
MOV EAX,CREATE_NEW
L14$:
PUSH EAX ;CREATE FLAGS
PUSH 0 ;SECURITY DESCRIPTOR
PUSH 0 ;DENY ALL
PUSH GENERIC_WRITE ;ACCESS MODE
LEA EDX,[EDI].FILE_LIST_NFN.NFN_TEXT
PUSH EDX
CALL CreateFile
CMP EAX,INVALID_HANDLE_VALUE
JNZ L3$
CALL _recover_handle
TEST EAX,EAX
JZ L12$
JMP CANT_CREATE
L3$:
L31$:
MOV [EBX].MYO_HANDLE,EAX
if fgh_win32dll
LEA EAX,[EDI].FILE_LIST_NFN.NFN_TEXT
CALL REPORT_OUT_ASCIZ
endif
MOV EAX,EBX
POPM EBX,ESI,EDI
RET
CANT_CREATE:
CALL _FLUSH_DISABLE_MAPOUT ;FLUSH AND STOP MAP OUTPUT
MOV ECX,[EBX].MYO_FILE_LIST_GINDEX
MOV AL,CANT_CREATE_ERR
push ECX
push EAX
call _err_file_list_abort
add ESP,8
OPEN_OUTPUT ENDP
END
| 14.878378 | 80 | 0.737965 |
70c1186ec13cc2e0036b9e02dafffbe865004f7a | 2,915 | asm | Assembly | academic-work/Assembly/Ficha003_Assembly8086_ex002.asm | joao-neves95/Exercises_Challenges_Courses | 02b6e25d9a270395bbf6dc8111c2419bba4f3edc | [
"MIT"
] | null | null | null | academic-work/Assembly/Ficha003_Assembly8086_ex002.asm | joao-neves95/Exercises_Challenges_Courses | 02b6e25d9a270395bbf6dc8111c2419bba4f3edc | [
"MIT"
] | 4 | 2018-11-10T01:05:14.000Z | 2021-06-25T15:16:28.000Z | academic-work/Assembly/Ficha003_Assembly8086_ex002.asm | joao-neves95/Exercises_Challenges_Courses | 02b6e25d9a270395bbf6dc8111c2419bba4f3edc | [
"MIT"
] | null | null | null | ; Remove every occurrence of "ana" in a string.
;Leia um conjunto de carateres digitados, ate que seja pressionada a tecla ENTER,
;com o objetivo de formar uma string na Memoria.
;
;Seguidamente, crie tambem na memoria uma nova string a partir da original,
;mas com a eliminacao de todas as subfrases 'ana'.
;
;Finalmente, mostre a nova string no ecra.
;
;Por exemplo, se a string construida for: 'a ana e o aniceto foram ao cinema anadia'
;
;A string impressa no ecra deve ser:
;
; 'a e o aniceto foram ao cinema dia'
; Logica:
; 1 - Encontrar um 'a'
; 2 - Verificar se os caracteres seguintes sao 'na'
; - Se sim, incrementar SI.
; - Se nao, continuar a colocar na string destino.
#make_COM#
org 100h
jmp Main
.Data
ana db 'ana' , '$'
newLine db 13 , 10 , '$'
getInputInfo db 'Escreva uma frase: ', 13 , 10 , '$'
showOutputInfo db 'A frase tratada e: ', 13 , 10 , '$'
inputStr db 80 dup(?)
outputStr db 80 dup(?)
.Code
Main:
lea dx, getInputInfo
mov ah, 9
int 21H
lea si, inputStr
GetInput:
mov ah, 1 ; Function 01H (read input char). In saves to the AL register.
INT 21H
mov [si], al ; The user input is stored on the AL register.
cmp al, 13 ; Check if the user clicked <ENTER>.
jz BuildOutput
inc si
jmp GetInput
BuildOutput:
mov [si], '$'
lea si, inputStr
lea di, outputStr
; Fall to _BuildOutput.
_BuildOutput:
cmp [si], '$'
jz ShowOutput
cmp [si], 'a'
jz CheckIfAna
mov al, [si]
mov [di], al
inc si
inc di
jmp _BuildOutput
CheckIfAna:
mov bx, si ; Move and store the current offset in BX.
push si
push di
lea di, ana
jmp _CheckIfAna
ShowOutput:
mov [di], '$'
lea dx, newLine
mov ah, 9
INT 21H
lea dx, showOutputInfo
mov ah, 9
INT 21H
lea dx, outputStr
mov ah, 9
INT 21H
; Fall to End.
End:
mov ah, 04CH
INT 21H
; ----------- CheckIfAna -----------
_CheckIfAna:
cmp [di], '$'; Check if it's the end of 'ana$'.
jz _CheckedIfAna_POP ; The inner string was 'ana'.
mov al, [di]
cmp al, [bx] ; Check if it's 'ana'.
jz _CheckIfAna_INC
; It's not 'ana'.
; Get all the original values again.
pop di
pop si
mov al, [si]
mov [di], al ; Move 'a' to DI.
; Move one char forward.
inc si
inc di
jmp _BuildOutput
_CheckIfAna_INC:
inc bx
inc di
jmp _CheckIfAna
; Increment the original SI to DX (after 'ana' location).
_CheckedIfAna_POP:
pop di
pop si
mov si, bx ; Jump to after 'ana' here.
jmp _BuildOutput
; --------- CheckIfAna ---------
| 21.277372 | 95 | 0.555746 |
1b5719c16354a063d0906bcfa5cccff511fd2840 | 1,414 | asm | Assembly | src/asm/hdd.asm | nsandman09/delta | 1656cee96a5978785ea911cf77f89a4fa782390a | [
"BSD-3-Clause"
] | 1 | 2015-06-29T17:53:51.000Z | 2015-06-29T17:53:51.000Z | src/asm/hdd.asm | nsandman09/delta | 1656cee96a5978785ea911cf77f89a4fa782390a | [
"BSD-3-Clause"
] | null | null | null | src/asm/hdd.asm | nsandman09/delta | 1656cee96a5978785ea911cf77f89a4fa782390a | [
"BSD-3-Clause"
] | null | null | null | global ata_lba_read
ata_lba_read:
pushfq
and rax, 0x0FFFFFFF
push rax
push rbx
push rcx
push rdx
push rdi
mov rbx, rax ; Save LBA in RBX
mov edx, 0x01F6 ; Port to send drive and bit 24 - 27 of LBA
shr eax, 24 ; Get bit 24 - 27 in al
or al, 11100000b ; Set bit 6 in al for LBA mode
out dx, al
mov edx, 0x01F2 ; Port to send number of sectors
mov al, cl ; Get number of sectors from CL
out dx, al
mov edx, 0x1F3 ; Port to send bit 0 - 7 of LBA
mov eax, ebx ; Get LBA from EBX
out dx, al
mov edx, 0x1F4 ; Port to send bit 8 - 15 of LBA
mov eax, ebx ; Get LBA from EBX
shr eax, 8 ; Get bit 8 - 15 in AL
out dx, al
mov edx, 0x1F5 ; Port to send bit 16 - 23 of LBA
mov eax, ebx ; Get LBA from EBX
shr eax, 16 ; Get bit 16 - 23 in AL
out dx, al
mov edx, 0x1F7 ; Command port
mov al, 0x20 ; Read with retry.
out dx, al
.still_going:
in al, dx
test al, 8 ; the sector buffer requires servicing.
jz .still_going ; until the sector buffer is ready.
mov rax, 256 ; to read 256 words = 1 sector
xor bx, bx
mov bl, cl ; read CL sectors
mul bx
mov rcx, rax ; RCX is counter for INSW
mov rdx, 0x1F0 ; Data port, in and out
rep insw ; in to [RDI]
pop rdi
pop rdx
pop rcx
pop rbx
pop rax
popfq
ret | 23.566667 | 65 | 0.58628 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.