From 9f6ebf538d3cbb0bbb5d55ace1015f79185b0787 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Sat, 18 May 2019 20:31:52 -0400 Subject: [PATCH] zasm: can assemble zasm/tok.asm! --- apps/zasm/main.asm | 3 ++- apps/zasm/tok.asm | 16 ++++++++-------- tools/tests/zasm/test7.asm | 8 ++++++++ 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/apps/zasm/main.asm b/apps/zasm/main.asm index ddd72f4..0a8d5d4 100644 --- a/apps/zasm/main.asm +++ b/apps/zasm/main.asm @@ -59,11 +59,12 @@ jp zasmMain #include "zasm/util.asm" .equ IO_RAMSTART ZASM_RAMEND #include "zasm/io.asm" +.equ TOK_RAMSTART IO_RAMEND #include "zasm/tok.asm" #include "zasm/parse.asm" #include "zasm/expr.asm" #include "zasm/instr.asm" -.equ DIREC_RAMSTART IO_RAMEND +.equ DIREC_RAMSTART TOK_RAMEND #include "zasm/directive.asm" .equ SYM_RAMSTART DIREC_RAMEND #include "zasm/symbol.asm" diff --git a/apps/zasm/tok.asm b/apps/zasm/tok.asm index 1b88601..ce85791 100644 --- a/apps/zasm/tok.asm +++ b/apps/zasm/tok.asm @@ -1,20 +1,20 @@ ; *** Consts *** -TOK_INSTR .equ 0x01 -TOK_DIRECTIVE .equ 0x02 -TOK_LABEL .equ 0x03 -TOK_EOF .equ 0xfe ; end of file -TOK_BAD .equ 0xff +.equ TOK_INSTR 0x01 +.equ TOK_DIRECTIVE 0x02 +.equ TOK_LABEL 0x03 +.equ TOK_EOF 0xfe ; end of file +.equ TOK_BAD 0xff .equ SCRATCHPAD_SIZE 0x40 ; *** Variables *** -scratchpad: - .fill SCRATCHPAD_SIZE +.equ scratchpad TOK_RAMSTART +.equ TOK_RAMEND scratchpad+SCRATCHPAD_SIZE ; *** Code *** ; Sets Z is A is ';' or null. isLineEndOrComment: - cp ';' + cp 0x3b ; ';' ret z ; continue to isLineEnd diff --git a/tools/tests/zasm/test7.asm b/tools/tests/zasm/test7.asm index d28c1e6..880b61b 100644 --- a/tools/tests/zasm/test7.asm +++ b/tools/tests/zasm/test7.asm @@ -20,9 +20,17 @@ .equ SYM_RAMSTART IO_RAMEND #include "zasm/symbol.asm" #include "zasm/parse.asm" +.equ TOK_RAMSTART SYM_RAMEND +#include "zasm/tok.asm" zasmIsFirstPass: nop zasmIsLocalPass: nop + +getInstID: + nop + +getDirectiveID: + nop