mirror of
https://github.com/samsonjs/compiler.git
synced 2026-03-25 08:45:52 +00:00
[CHANGED] Removed use of the LOOP instruction.
This commit is contained in:
parent
448c47156e
commit
ed1a3444c7
2 changed files with 3 additions and 2 deletions
|
|
@ -803,7 +803,7 @@ module Assembler
|
|||
end
|
||||
|
||||
|
||||
# TODO remove this, LOOP sucks ... only accepts a 1-byte signed offset.
|
||||
# NOTE: LOOP only accepts a 1-byte signed offset. Don't use it.
|
||||
def loop_(label)
|
||||
real_eip = @eip + 2 # loop instruction is 2 bytes
|
||||
delta = @symtab.lookup_label(label) - real_eip
|
||||
|
|
|
|||
|
|
@ -547,7 +547,8 @@ class Compiler
|
|||
asm.pop(ECX)
|
||||
|
||||
match_word('end')
|
||||
asm.loop_(start_label)
|
||||
asm.dec(ECX)
|
||||
asm.jnz(start_label)
|
||||
|
||||
# Phony push! break needs to clean up the stack, but since we
|
||||
# don't know if there is a break at this point we fake a push and
|
||||
|
|
|
|||
Loading…
Reference in a new issue