commit c4b329a213197d324932a98eb082b3462bf339ad
parent 3ac5393ec8c289a4dc580770836856e1758f9037
Author: Virgil Dupras <hsoft@hardcoded.net>
Date: Wed, 5 Apr 2023 20:06:00 -0400
asm/i386: add lea,
Diffstat:
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/fs/asm/i386.fs b/fs/asm/i386.fs
@@ -199,6 +199,7 @@ create _tbl $8c , $120 , $121 , $124 ,
drop dup indirect? if $c600 or opmod, else _shortimm then
else $8800 _regular, then ;
+: lea, swap $8d00 _regular, ;
: int, ( n -- ) $cd c, c, ;
\ Jumps and relative addresses
diff --git a/fs/doc/asm/i386.txt b/fs/doc/asm/i386.txt
@@ -133,7 +133,7 @@ only) operand.
add, or, adc, sbb,
and, sub, xor, cmp,
test, xchg,
-mov,
+mov, lea,
### Shift instructions ( dst shiftby -- )
diff --git a/fs/tests/asm/i386.fs b/fs/tests/asm/i386.fs
@@ -166,6 +166,9 @@ here ax 16b) dx in, 2 chk
here 3 nc, $f6 $00 $80
here ax 0 d) 8b) $80 i) test, 3 chk
+here 4 nc, $8d $44 $24 $2a
+here ax sp 42 d) lea, 4 chk
+
1 to realmode
here 2 nc, $8a $04
here al 0 si+) mov, 2 chk