mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-24 02:38:05 +11:00
forth: Forth-ify "XOR"
This commit is contained in:
parent
1871f7cdb4
commit
66412a1c30
Binary file not shown.
@ -1505,31 +1505,13 @@ DIVMOD:
|
|||||||
jp next
|
jp next
|
||||||
|
|
||||||
|
|
||||||
.db "XOR"
|
|
||||||
.fill 4
|
|
||||||
.dw $-DIVMOD
|
|
||||||
.db 0
|
|
||||||
XOR:
|
|
||||||
.dw nativeWord
|
|
||||||
pop hl
|
|
||||||
pop de
|
|
||||||
call chkPS
|
|
||||||
ld a, e
|
|
||||||
xor l
|
|
||||||
ld l, a
|
|
||||||
ld a, d
|
|
||||||
xor h
|
|
||||||
ld h, a
|
|
||||||
push hl
|
|
||||||
jp next
|
|
||||||
|
|
||||||
; It might look peculiar to have specific words for "0" and "1", but although
|
; It might look peculiar to have specific words for "0" and "1", but although
|
||||||
; it slightly beefs ups the ASM part of the binary, this one-byte-save-per-use
|
; it slightly beefs ups the ASM part of the binary, this one-byte-save-per-use
|
||||||
; really adds up when we compare total size.
|
; really adds up when we compare total size.
|
||||||
|
|
||||||
.db "0"
|
.db "0"
|
||||||
.fill 6
|
.fill 6
|
||||||
.dw $-XOR
|
.dw $-DIVMOD
|
||||||
.db 0
|
.db 0
|
||||||
ZERO:
|
ZERO:
|
||||||
.dw nativeWord
|
.dw nativeWord
|
||||||
|
@ -54,6 +54,7 @@
|
|||||||
;
|
;
|
||||||
0xa0 OP1r0 ANDr,
|
0xa0 OP1r0 ANDr,
|
||||||
0xb0 OP1r0 ORr,
|
0xb0 OP1r0 ORr,
|
||||||
|
0xa8 OP1r0 XORr,
|
||||||
|
|
||||||
( qq -- also works for ss )
|
( qq -- also works for ss )
|
||||||
: OP1qq
|
: OP1qq
|
||||||
|
@ -97,6 +97,19 @@ CODE OR
|
|||||||
HL PUSHqq,
|
HL PUSHqq,
|
||||||
;CODE
|
;CODE
|
||||||
|
|
||||||
|
CODE XOR
|
||||||
|
HL POPqq,
|
||||||
|
DE POPqq,
|
||||||
|
chkPS,
|
||||||
|
A E LDrr,
|
||||||
|
L XORr,
|
||||||
|
L A LDrr,
|
||||||
|
A D LDrr,
|
||||||
|
H XORr,
|
||||||
|
H A LDrr,
|
||||||
|
HL PUSHqq,
|
||||||
|
;CODE
|
||||||
|
|
||||||
CODE PC!
|
CODE PC!
|
||||||
BC POPqq,
|
BC POPqq,
|
||||||
HL POPqq,
|
HL POPqq,
|
||||||
|
Loading…
Reference in New Issue
Block a user