summaryrefslogtreecommitdiff
path: root/runtime.S
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2014-12-28 17:25:36 -0800
committerMichael Pavone <pavone@retrodev.com>2014-12-28 17:25:36 -0800
commit08d8620cd9bfe4a2bcaaa9156f8a46a1c0b9e659 (patch)
tree71bccfa30062bcf3aa4b5def6bed8b4127c64513 /runtime.S
parentec6bd7cf6e237ba3f24af06d2c52e629c4029207 (diff)
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
Diffstat (limited to 'runtime.S')
-rw-r--r--runtime.S58
1 files changed, 0 insertions, 58 deletions
diff --git a/runtime.S b/runtime.S
index e66b158..5595eb1 100644
--- a/runtime.S
+++ b/runtime.S
@@ -12,63 +12,5 @@ m68k_invalid:
mov $1, %rdi
call exit
- .global bcd_add
-bcd_add:
- xchg %rax, %rdi
-
- 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 %rdi, %rax
- ret
-
- .global bcd_sub
-bcd_sub:
- xchg %rax, %rdi
-
- 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 %rdi, %rax
- ret
-