[CHANGED] Removed use of the LOOP instruction.

This commit is contained in:
Sami Samhuri 2009-06-26 11:37:45 -07:00
parent 448c47156e
commit ed1a3444c7
2 changed files with 3 additions and 2 deletions

View file

@ -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

View file

@ -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