Browse Source

zasm: can now assemble zasm/util.asm!

pull/10/head
Virgil Dupras 5 years ago
parent
commit
157ac03e25
6 changed files with 19 additions and 8 deletions
  1. +2
    -2
      apps/zasm/instr.asm
  2. +1
    -1
      apps/zasm/util.asm
  3. +1
    -1
      parts/z80/core.asm
  4. +4
    -2
      tools/emul/Makefile
  5. +3
    -2
      tools/tests/zasm/runtests.sh
  6. +8
    -0
      tools/tests/zasm/test7.asm

+ 2
- 2
apps/zasm/instr.asm View File

@@ -1087,8 +1087,8 @@ instrTBl:
.db I_SBC, 'A', 'l', 0, 0x9e , 0 ; SBC A, (HL)
.db I_SBC, 'A', 0xb, 0, 0b10011000 , 0 ; SBC A, r
.db I_SCF, 0, 0, 0, 0x37 , 0 ; SCF
.db I_SUB, 'A', 'l', 0, 0x96 , 0 ; SUB A, (HL)
.db I_SUB, 'A', 0xb, 0, 0b10010000 , 0 ; SUB A, r
.db I_SUB, 'l', 0, 0, 0x96 , 0 ; SUB (HL)
.db I_SUB, 0xb, 0, 0, 0b10010000 , 0 ; SUB r
.db I_SUB, 'n', 0, 0, 0xd6 , 0 ; SUB n
.db I_XOR, 'l', 0, 0, 0xae , 0 ; XOR (HL)
.db I_XOR, 0xb, 0, 0, 0b10101000 , 0 ; XOR r


+ 1
- 1
apps/zasm/util.asm View File

@@ -29,7 +29,7 @@ subDEFromHL:
sub e
ld l, a
ld a, h
sbc d
sbc a, d
ld h, a
pop af
ret


+ 1
- 1
parts/z80/core.asm View File

@@ -128,7 +128,7 @@ findchar:
.match:
; We ran 0xff-B loops. That's the result that goes in A.
ld a, 0xff
sub a, b
sub b
cp a ; ensure Z
.end:
pop bc


+ 4
- 2
tools/emul/Makefile View File

@@ -14,8 +14,10 @@ $(KERNEL_HEADERS):
zasm/user.h: zasm/user.asm
scas -o - -I ../../apps $< | ./bin2c.sh USERSPACE | tee $@ > /dev/null

zasm/includes.cfs: ../../parts/z80 $(CFSPACK)
cp -rf $< zasm/includes
zasm/includes.cfs: $(CFSPACK)
rm -rf zasm/includes
cp -r ../../parts/z80 zasm/includes
cp -r ../../apps/zasm zasm/includes/zasm
find zasm/includes -name *.md -delete
find zasm/includes -type f -exec sed -i -e 's/;.*//g' {} \;
$(CFSPACK) zasm/includes > $@


+ 3
- 2
tools/tests/zasm/runtests.sh View File

@@ -5,11 +5,12 @@ set -e
TMPFILE=$(mktemp)
SCAS=scas
PARTS=../../../parts/z80
APPS=../../../apps
ZASM=../../emul/zasm/zasm
ASMFILE=../../../apps/zasm/instr.asm
ASMFILE=${APPS}/zasm/instr.asm

cmpas() {
EXPECTED=$($SCAS -I ${PARTS} -o - "$1" | xxd)
EXPECTED=$($SCAS -I ${PARTS} -I ${APPS} -o - "$1" | xxd)
ACTUAL=$(cat $1 | $ZASM | xxd)
if [ "$ACTUAL" == "$EXPECTED" ]; then
echo ok


+ 8
- 0
tools/tests/zasm/test7.asm View File

@@ -0,0 +1,8 @@
.equ RAMSTART 0x4000
.equ ZASM_FIRST_PASS RAMSTART
.equ ZASM_LOCAL_PASS ZASM_FIRST_PASS+1
.equ ZASM_CTX_PC ZASM_LOCAL_PASS+1
.equ ZASM_RAMEND ZASM_CTX_PC+2

#include "core.asm"
#include "zasm/util.asm"

Loading…
Cancel
Save