commit e8ed84b3e1baa20db2bc41465623416227ecd437 parent 0defe85350a1f1d1770fe1ea78c289bb278645a2 Author: Alexander Burger <abu@software-lab.de> Date: Sat, 3 Nov 2012 10:29:33 +0100 emu64 continued Diffstat:
M | src64/arch/emu.l | | | 21 | +++++++++++++++------ |
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/src64/arch/emu.l b/src64/arch/emu.l @@ -1,4 +1,4 @@ -# 02nov12abu +# 03nov12abu # (c) Software Lab. Alexander Burger # Byte order @@ -474,11 +474,20 @@ # Comparisons (asm cmp (Dst D Src S) - (if (or (= Dst "A.b[0]") (= Src "A.b[0]")) - (genCode (Dst D Src S) (list 'cmp Dst Src) ((op.b Dst D) (op.b Src S)) - "Carry = (Result = @1 - @2) > MAX64 - @2;" ) - (genCode (Dst D Src S) (list 'cmp Dst Src) ((op.n Dst D) (op.n Src S)) - "Carry = (Result = @1 - @2) > MAX64 - @2;" ) ) ) + (cond + ((or (= Dst "A.b[0]") (= Src "A.b[0]")) + (genCode (Dst D Src S) (list 'cmp Dst Src) ((op.b Dst D) (op.b Src S)) + "Carry = (Result = @1 - @2) > MAX64 - @2;" ) ) + ((and (= Dst "S") (= Src '(StkLimit))) + (genCode (Dst D Src S) (list 'cmp Dst Src) ((op.n Dst D) (op.n Src S)) + "if (S.p < Stack + 4064) {" + " fprintf(stderr, \"Emulator stack overflow\\n\");" + " exit(-99);" + "}" + "Carry = (Result = @1 - @2) > MAX64 - @2;" ) ) + (T + (genCode (Dst D Src S) (list 'cmp Dst Src) ((op.n Dst D) (op.n Src S)) + "Carry = (Result = @1 - @2) > MAX64 - @2;" ) ) ) ) (asm cmpn (Dst D Src S Cnt C) (genCode (Dst D Src S Cnt C) (list 'cmpn Dst Src Cnt) ((op.a Dst D) (op.a Src S) (op.i Cnt C))