From 08d8620cd9bfe4a2bcaaa9156f8a46a1c0b9e659 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Sun, 28 Dec 2014 17:25:36 -0800 Subject: Removed bcd_add and bcd_sub from runtime.S and generated the logic inline with the rest of abcd and sbcd translation. Fixed some edge cases and undefined flag behavior in the process --- runtime_32.S | 57 --------------------------------------------------------- 1 file changed, 57 deletions(-) (limited to 'runtime_32.S') diff --git a/runtime_32.S b/runtime_32.S index 1f0c503..50117f1 100644 --- a/runtime_32.S +++ b/runtime_32.S @@ -12,63 +12,6 @@ m68k_invalid: push $1 call exit - .global bcd_add -bcd_add: - xchg %eax, %edi - - mov %cl, %ch - mov %al, %ah - and $0xF, %ch - and $0xF, %ah - and $0xF0, %cl - and $0xF0, %al - add %ah, %ch - cmp $10, %ch - jb no_adjust - add $6, %ch -no_adjust: - add %ch, %al - add %al, %cl - mov $0, %ch - jc def_adjust - cmp $0xA0, %cl - jb no_adjust_h -def_adjust: - add $0x60, %cl - mov $1, %ch -no_adjust_h: - - mov %edi, %eax - ret - - .global bcd_sub -bcd_sub: - xchg %eax, %edi - - mov %cl, %ch - mov %al, %ah - and $0xF, %ch - and $0xF, %ah - and $0xF0, %cl - and $0xF0, %al - sub %ah, %ch - cmp $10, %ch - jb no_adjusts - sub $6, %ch -no_adjusts: - add %ch, %cl - sub %al, %cl - mov $0, %ch - jc def_adjusts - cmp $0xA0, %cl - jb no_adjust_hs -def_adjusts: - sub $0x60, %cl - mov $1, %ch -no_adjust_hs: - - mov %edi, %eax - ret -- cgit v1.2.3 From a68ca32cfe9156b40952894ff09f1991f073486e Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Sat, 23 May 2015 20:24:27 -0700 Subject: Eliminate runtime.S/runtime_32.S. --- runtime_32.S | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 runtime_32.S (limited to 'runtime_32.S') diff --git a/runtime_32.S b/runtime_32.S deleted file mode 100644 index 50117f1..0000000 --- a/runtime_32.S +++ /dev/null @@ -1,17 +0,0 @@ - - -invalid_msg: - .asciz "Invalid instruction at %X\n" - - .global m68k_invalid -m68k_invalid: - push %ecx - push invalid_msg - xor %eax, %eax - call printf - push $1 - call exit - - - - -- cgit v1.2.3