Author: wmb Date: 2008-08-29 11:21:31 +0200 (Fri, 29 Aug 2008) New Revision: 905
Modified: cpu/x86/assem.fth cpu/x86/build/builder.dic Log: The assembler needs to pay attention to "long-offsets" in the implementation of direct branching words like "je".
Modified: cpu/x86/assem.fth =================================================================== --- cpu/x86/assem.fth 2008-08-29 05:54:16 UTC (rev 904) +++ cpu/x86/assem.fth 2008-08-29 09:21:31 UTC (rev 905) @@ -335,12 +335,14 @@
: prefix-0f h# 0f asm8, ;
+variable long-offsets long-offsets off + \ 3MI define branch instructions, with one or two bytes of offset. : 3MI \ conditional branches ( op -- ) create c, ( dest -- ) does> c@ ( dest op ) swap here 2+ - ( op disp ) - dup small? if ( op disp8 ) + dup small? long-offsets @ 0= and if ( op disp8 ) swap asm8, asm8, else ( op disp ) prefix-0f swap h# 10 + asm8, @@ -704,8 +706,6 @@
\ Assembler version of forward/backward mark/resolve.
-variable long-offsets long-offsets off - : >MARK (S -- addr ) HERE ; \ Address of opcode, not offset byte : >RESOLVE (S addr -- ) long-offsets @ if