Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request boriel-basic#287 from boriel/bugfix/and32
Browse files Browse the repository at this point in the history
Bugfix/and32
  • Loading branch information
boriel committed May 9, 2020
2 parents 6c080fa + 88902a2 commit 1ab7517
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 40 deletions.
38 changes: 17 additions & 21 deletions library-asm/and32.asm
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,24 @@
; First operand in DE,HL 2nd operand into the stack

__AND32:
ld a, l
or h
or e
or d
sub 1
sbc a
ld a, l
or h
or e
or d

ld c, a
pop hl
pop de
ex (sp), hl
ret z

pop hl

pop de
ld a, d
or e
pop de
or d
or e
sub 1
sbc a

or c
cpl
jp (hl)
ld a, d
or e
or h
or l

#ifdef NORMALIZE_BOOLEAN
ret z
ld a, 1
#endif

ret
33 changes: 14 additions & 19 deletions tests/functional/and32.asm
Original file line number Diff line number Diff line change
Expand Up @@ -60,25 +60,20 @@ __CALL_BACK__:
; result in Accumulator (0 False, not 0 True)
; First operand in DE,HL 2nd operand into the stack
__AND32:
ld a, l
or h
or e
or d
sub 1
sbc a
ld c, a
pop hl
pop de
ld a, d
or e
pop de
or d
or e
sub 1
sbc a
or c
cpl
jp (hl)
ld a, l
or h
or e
or d
pop hl
pop de
ex (sp), hl
ret z
ld a, d
or e
or h
or l
#line 26 "/zxbasic/library-asm/and32.asm"
ret
#line 46 "and32.bas"
ZXBASIC_USER_DATA:
_a:
Expand Down

0 comments on commit 1ab7517

Please sign in to comment.