diff --git a/basis/cpu/x86/32/32.factor b/basis/cpu/x86/32/32.factor index e908f52952..86cd53712d 100755 --- a/basis/cpu/x86/32/32.factor +++ b/basis/cpu/x86/32/32.factor @@ -30,12 +30,14 @@ M: x86.32 temp-reg-2 EDX ; M:: x86.32 %dispatch ( src temp -- ) ! Load jump table base. temp src HEX: ffffffff [+] LEA + building get length cell - :> start 0 rc-absolute-cell rel-here ! Go temp HEX: 7f [+] JMP + building get length :> end ! Fix up the displacement above cell code-alignment - [ 7 + building get dup pop* push ] + [ end start - + building get dup pop* push ] [ align-code ] bi ; diff --git a/basis/cpu/x86/64/64.factor b/basis/cpu/x86/64/64.factor index 2c8fb3f18f..5390d7e0c8 100644 --- a/basis/cpu/x86/64/64.factor +++ b/basis/cpu/x86/64/64.factor @@ -23,15 +23,17 @@ M: x86.64 rs-reg R15 ; M: x86.64 stack-reg RSP ; M:: x86.64 %dispatch ( src temp -- ) + building get length :> start ! Load jump table base. temp HEX: ffffffff MOV 0 rc-absolute-cell rel-here ! Add jump table base temp src ADD temp HEX: 7f [+] JMP + building get length :> end ! Fix up the displacement above cell code-alignment - [ 15 + building get dup pop* push ] + [ end start - 2 - + building get dup pop* push ] [ align-code ] bi ;