소스 검색

forth: Forth-ify "XOR"

pull/95/head
Virgil Dupras 4 년 전
부모
커밋
66412a1c30
4개의 변경된 파일15개의 추가작업 그리고 19개의 파일을 삭제
  1. BIN
      emul/forth/z80c.bin
  2. +1
    -19
      forth/forth.asm
  3. +1
    -0
      forth/z80a.fs
  4. +13
    -0
      forth/z80c.fs

BIN
emul/forth/z80c.bin 파일 보기


+ 1
- 19
forth/forth.asm 파일 보기

@@ -1505,31 +1505,13 @@ DIVMOD:
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 slightly beefs ups the ASM part of the binary, this one-byte-save-per-use
; really adds up when we compare total size.

.db "0"
.fill 6
.dw $-XOR
.dw $-DIVMOD
.db 0
ZERO:
.dw nativeWord


+ 1
- 0
forth/z80a.fs 파일 보기

@@ -54,6 +54,7 @@
;
0xa0 OP1r0 ANDr,
0xb0 OP1r0 ORr,
0xa8 OP1r0 XORr,

( qq -- also works for ss )
: OP1qq


+ 13
- 0
forth/z80c.fs 파일 보기

@@ -97,6 +97,19 @@ CODE OR
HL PUSHqq,
;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!
BC POPqq,
HL POPqq,


불러오는 중...
취소
저장