Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions src/crt/ineg.src
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,19 @@ __ineg := 000160h
else

__ineg:
if 0
push de
end if
; UHL = -UHL
; CC: 10*r(PC)+3*r(SPL)+1
; CC: 9 bytes | 10F + 3R + 1
add hl, de ; uhl=UHL+UDE
ex de, hl ; ude=UHL+UDE, uhl=UDE
or a, a
sbc hl, de ; uhl=UDE-(UHL+UDE)
; =UDE-UHL-UDE
; =-UHL
if 0
pop de
else
ex de, hl ; ude=-UHL, uhl=UHL+UDE
add hl, de ; uhl=UHL+UDE+-UHL
; =UDE
ex de, hl ; ude=UDE, uhl=-UHL
end if
ret

end if
3 changes: 3 additions & 0 deletions src/crt/ineg_fast.src
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
section .text
public __ineg_fast
__ineg_fast:
; UHL = -UHL
; CC: 7*r(PC)+3*r(SPL)+1
; CC: 6 bytes | 7F + 3R + 1
add hl, de ; uhl=UHL+UDE
ex de, hl ; ude=UHL+UDE, uhl=UDE
or a, a
Expand Down
10 changes: 3 additions & 7 deletions src/crt/inot.src
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,23 @@ __inot := 000164h
else

__inot:
if 0
push de
end if
; UHL = ~UHL
; CC: 11*r(PC)+3*r(SPL)+1
; CC: 10 bytes | 11F + 3R + 1
add hl, de ; uhl=UHL+UDE
ex de, hl ; ude=UHL+UDE, uhl=UDE
scf
sbc hl, de ; uhl=UDE-(UHL+UDE)-1
; =UDE-UHL-UDE-1
; =-UHL-1
; =~UHL
if 0
pop de
else
ex de, hl ; ude=~UHL, uhl=UHL+UDE
add hl, de ; uhl=UHL+UDE+~UHL
; =UHL+UDE+(-UHL-1)
; =UHL+UDE-UHL-1
; =UDE-1
inc hl ; uhl=UDE
ex de, hl ; ude=UDE, uhl=~UHL
end if
ret

end if
3 changes: 3 additions & 0 deletions src/crt/inot_fast.src
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
section .text
public __inot_fast
__inot_fast:
; UHL = ~UHL
; CC: 7*r(PC)+3*r(SPL)+1
; CC: 6 bytes | 7F + 3R + 1
add hl, de ; uhl=UHL+UDE
ex de, hl ; ude=UHL+UDE, uhl=UDE
scf
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading