commit 098fa6467e9fc18845edca63bbdf101bed425abd
parent 32ff42218254aa44046d95bb5406cf6730ed1a56
Author: Virgil Dupras <hsoft@hardcoded.net>
Date: Sun, 24 Jul 2022 07:22:20 -0400
i386: add emit rtype
Diffstat:
1 file changed, 28 insertions(+), 11 deletions(-)
diff --git a/fs/xcomp/i386.fs b/fs/xcomp/i386.fs
@@ -102,24 +102,41 @@ xcode !
ax 0 d) bx mov,
ret,
+pc $b8000 ,
+xcode emit \ temporary, this is going in /drv/pc
+ di dup ( pc ) m) mov,
+ dup ( pc ) m) inc,
+ ( pc ) m) inc,
+ AX pspop,
+ di 0 d) al mov,
+ di 1 d) 7 i) mov,
+ ret,
+
+xcode rtype ( a u -- )
+ CX pspop,
+ SI pspop,
+pc
+ ax ax xor,
+ al si 0 d) mov,
+ AX pspush,
+ si push, cx push,
+ xwordlbl emit abs>rel call,
+ cx pop, si pop,
+ si inc,
+ cx dec,
+ ( pc ) abs>rel jnz,
+ ret,
+
pc lblmainalias pc>addr !
xwordlbl (s) abs>rel call,
12 c, ," Hello World!"
SI pspop,
bx bx xor,
bl si 0 d) mov, \ len
- bx push,
si inc,
- di $b8000 i) mov,
- pc
- bx bx xor,
- bl si 0 d) mov,
- di 0 d) bl mov,
- di inc,
- di 0 d) 7 i) mov,
- di inc,
- si inc,
- xwordlbl (next) abs>rel call, ( pc ) ,
+ SI pspush,
+ BX pspush,
+ xwordlbl rtype abs>rel call,
xwordlbl bye abs>rel call,
xbindict orgifydict