File tree Expand file tree Collapse file tree 4 files changed +12
-14
lines changed Expand file tree Collapse file tree 4 files changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -10,23 +10,19 @@ __ineg := 000160h
1010else
1111
1212__ineg:
13- if 0
14- push de
15- end if
13+ ; UHL = -UHL
14+ ; CC: 10*r(PC)+3*r(SPL)+1
15+ ; CC: 9 bytes | 10F + 3R + 1
1616 add hl, de ; uhl=UHL+UDE
1717 ex de, hl ; ude=UHL+UDE, uhl=UDE
1818 or a, a
1919 sbc hl, de ; uhl=UDE-(UHL+UDE)
2020 ; =UDE-UHL-UDE
2121 ; =-UHL
22- if 0
23- pop de
24- else
2522 ex de, hl ; ude=-UHL, uhl=UHL+UDE
2623 add hl, de ; uhl=UHL+UDE+-UHL
2724 ; =UDE
2825 ex de, hl ; ude=UDE, uhl=-UHL
29- end if
3026 ret
3127
3228end if
Original file line number Diff line number Diff line change 33 section .text
44 public __ineg_fast
55__ineg_fast:
6+ ; UHL = -UHL
7+ ; CC: 7*r(PC)+3*r(SPL)+1
8+ ; CC: 6 bytes | 7F + 3R + 1
69 add hl, de ; uhl=UHL+UDE
710 ex de, hl ; ude=UHL+UDE, uhl=UDE
811 or a, a
Original file line number Diff line number Diff line change @@ -10,27 +10,23 @@ __inot := 000164h
1010else
1111
1212__inot:
13- if 0
14- push de
15- end if
13+ ; UHL = ~UHL
14+ ; CC: 11*r(PC)+3*r(SPL)+1
15+ ; CC: 10 bytes | 11F + 3R + 1
1616 add hl, de ; uhl=UHL+UDE
1717 ex de, hl ; ude=UHL+UDE, uhl=UDE
1818 scf
1919 sbc hl, de ; uhl=UDE-(UHL+UDE)-1
2020 ; =UDE-UHL-UDE-1
2121 ; =-UHL-1
2222 ; =~UHL
23- if 0
24- pop de
25- else
2623 ex de, hl ; ude=~UHL, uhl=UHL+UDE
2724 add hl, de ; uhl=UHL+UDE+~UHL
2825 ; =UHL+UDE+(-UHL-1)
2926 ; =UHL+UDE-UHL-1
3027 ; =UDE-1
3128 inc hl ; uhl=UDE
3229 ex de, hl ; ude=UDE, uhl=~UHL
33- end if
3430 ret
3531
3632end if
Original file line number Diff line number Diff line change 33 section .text
44 public __inot_fast
55__inot_fast:
6+ ; UHL = ~UHL
7+ ; CC: 7*r(PC)+3*r(SPL)+1
8+ ; CC: 6 bytes | 7F + 3R + 1
69 add hl, de ; uhl=UHL+UDE
710 ex de, hl ; ude=UHL+UDE, uhl=UDE
811 scf
You can’t perform that action at this time.
0 commit comments