| |
|
| abi-code my+ ( n1 n2 -- n3 ) |
abi-code my+ ( n1 n2 -- n3 ) |
| di ax mov \ ABI: sp passed in di, returned in ax |
\ ABI: SP passed in di, returned in ax, address of FP passed in si |
| si dx mov \ ABI: fp passed in si, returned in dx |
\ Caller-saved: ax,cx,dx,si,di,r8-r11,xmm0-xmm15 |
| ax ) r8 mov \ load sp[0] |
8 di d) ax lea \ compute new sp in result reg |
| 8 ax d) r8 add \ add sp[1] |
di ) dx mov \ get old tos |
| 8 # ax add \ store result to *++sp |
dx ax ) add \ add to new tos |
| r8 ax ) mov |
ret |
| ret \ return to caller |
|
| end-code |
end-code |
| |
|
| : my+-compiled ( n1 n2 -- n3 ) my+ ; |
: my+-compiled ( n1 n2 -- n3 ) my+ ; |
| |
|
| assert0( 12 34 my+ 46 = ) |
12 34 my+ 46 <> throw |
| assert0( 12 34 my+-compiled 46 = ) |
12 34 my+-compiled 46 <> throw |