Merge pull request #140 from davidgiven/dtrg-arraysizes
CPM: Move the standard ret boilerplate into a helper procedure.
This commit is contained in:
commit
7563ac46a7
14
mach/i80/libem/ret.s
Normal file
14
mach/i80/libem/ret.s
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
.sect .text
|
||||||
|
.sect .rom
|
||||||
|
.sect .data
|
||||||
|
.sect .bss
|
||||||
|
.sect .text
|
||||||
|
|
||||||
|
.define .ret
|
||||||
|
.ret:
|
||||||
|
mov h, b
|
||||||
|
mov l, c
|
||||||
|
sphl
|
||||||
|
pop b
|
||||||
|
ret
|
||||||
|
|
|
@ -1844,18 +1844,12 @@ pat lfr ret $1==$2 leaving ret 0
|
||||||
pat ret $1==0
|
pat ret $1==0
|
||||||
with STACK
|
with STACK
|
||||||
uses hlreg
|
uses hlreg
|
||||||
gen move lb,hl
|
gen jmp {label, ".ret"}
|
||||||
sphl.
|
|
||||||
pop lb
|
|
||||||
ret.
|
|
||||||
|
|
||||||
pat ret $1==2
|
pat ret $1==2
|
||||||
with dereg STACK
|
with dereg STACK
|
||||||
uses hlreg
|
uses hlreg
|
||||||
gen move lb,hl
|
gen jmp {label, ".ret"}
|
||||||
sphl.
|
|
||||||
pop lb
|
|
||||||
ret.
|
|
||||||
|
|
||||||
pat ret $1<=8
|
pat ret $1<=8
|
||||||
with STACK
|
with STACK
|
||||||
|
@ -1868,10 +1862,7 @@ gen 1:
|
||||||
inx hl
|
inx hl
|
||||||
dcr a
|
dcr a
|
||||||
jnz {label,1b}
|
jnz {label,1b}
|
||||||
move lb,hl
|
jmp {label, ".ret"}
|
||||||
sphl.
|
|
||||||
pop lb
|
|
||||||
ret.
|
|
||||||
|
|
||||||
/******************************************/
|
/******************************************/
|
||||||
/* Group 15: Miscellaneous */
|
/* Group 15: Miscellaneous */
|
||||||
|
|
Loading…
Reference in a new issue