Skip to content

Commit 1ab7517

Browse files
authored
Merge pull request #287 from boriel/bugfix/and32
Bugfix/and32
2 parents 6c080fa + 88902a2 commit 1ab7517

2 files changed

Lines changed: 31 additions & 40 deletions

File tree

library-asm/and32.asm

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,24 @@
44
; First operand in DE,HL 2nd operand into the stack
55

66
__AND32:
7-
ld a, l
8-
or h
9-
or e
10-
or d
11-
sub 1
12-
sbc a
7+
ld a, l
8+
or h
9+
or e
10+
or d
1311

14-
ld c, a
12+
pop hl
13+
pop de
14+
ex (sp), hl
15+
ret z
1516

16-
pop hl
17-
18-
pop de
19-
ld a, d
20-
or e
21-
pop de
22-
or d
23-
or e
24-
sub 1
25-
sbc a
26-
27-
or c
28-
cpl
29-
jp (hl)
17+
ld a, d
18+
or e
19+
or h
20+
or l
3021

22+
#ifdef NORMALIZE_BOOLEAN
23+
ret z
24+
ld a, 1
25+
#endif
3126

27+
ret

tests/functional/and32.asm

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -60,25 +60,20 @@ __CALL_BACK__:
6060
; result in Accumulator (0 False, not 0 True)
6161
; First operand in DE,HL 2nd operand into the stack
6262
__AND32:
63-
ld a, l
64-
or h
65-
or e
66-
or d
67-
sub 1
68-
sbc a
69-
ld c, a
70-
pop hl
71-
pop de
72-
ld a, d
73-
or e
74-
pop de
75-
or d
76-
or e
77-
sub 1
78-
sbc a
79-
or c
80-
cpl
81-
jp (hl)
63+
ld a, l
64+
or h
65+
or e
66+
or d
67+
pop hl
68+
pop de
69+
ex (sp), hl
70+
ret z
71+
ld a, d
72+
or e
73+
or h
74+
or l
75+
#line 26 "/zxbasic/library-asm/and32.asm"
76+
ret
8277
#line 46 "and32.bas"
8378
ZXBASIC_USER_DATA:
8479
_a:

0 commit comments

Comments
 (0)