Skip to content
Merged
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
5 changes: 0 additions & 5 deletions src/arch/z80/backend/_16bit.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,11 +752,6 @@ def bxor16(cls, ins: Quad) -> list[str]:
output.append("push hl")
return output

if op2 == 0xFFFF: # X ^ 0xFFFF = bNOT X
output.append(runtime_call(RuntimeLabel.NEGHL))
output.append("push hl")
return output

output = cls.get_oper(op1, op2)
output.append(runtime_call(RuntimeLabel.BXOR16))
output.append("push hl")
Expand Down
25 changes: 5 additions & 20 deletions tests/functional/arch/zx48k/bxor16.asm
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ _b:
call .core.__BXOR16
ld a, l
ld (_b), a
ld de, 65535
ld hl, (_a)
call .core.__NEGHL
call .core.__BXOR16
ld a, l
ld (_b), a
ld hl, (_a)
Expand All @@ -42,8 +43,9 @@ _b:
call .core.__BXOR16
ld a, l
ld (_b), a
ld de, 65535
ld hl, (_a)
call .core.__NEGHL
call .core.__BXOR16
ld a, l
ld (_b), a
ld de, (_a)
Expand Down Expand Up @@ -84,22 +86,5 @@ __BXOR16:
ld l, a
ret
pop namespace
#line 46 "arch/zx48k/bxor16.bas"
#line 1 "/zxbasic/src/lib/arch/zx48k/runtime/neg16.asm"
; Negates HL value (16 bit)
push namespace core
__ABS16:
bit 7, h
ret z
__NEGHL:
ld a, l ; HL = -HL
cpl
ld l, a
ld a, h
cpl
ld h, a
inc hl
ret
pop namespace
#line 47 "arch/zx48k/bxor16.bas"
#line 48 "arch/zx48k/bxor16.bas"
END