From bdc3674c59fa1a97420dd504447099741494ea65 Mon Sep 17 00:00:00 2001 From: Curtis F Kaylor Date: Thu, 14 Nov 2019 12:28:32 -0500 Subject: [PATCH] Added HEX Pseudo-Op, Fixed LDY Addressing Modes --- a02.c | 7 +++++++ a02.h | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/a02.c b/a02.c index 238961a..b460078 100644 --- a/a02.c +++ b/a02.c @@ -286,6 +286,12 @@ void asmbyt(void) { } while (cpychr(',')); } +/* Assemble HEX Pseudo-Op */ +void asmhex(void) { + if (DEBUG) puts("Assembling HEX Pseudo-Op"); + do {outbyt(evlhex(0xFF)); } while (cpychr(',')); +} + /* Assemble WORD Pseudo-Op */ void asmwrd(void) { do { @@ -359,6 +365,7 @@ int asmpso(void) { switch (token) { case '=': asmequ(); break; //EQU case 'B': asmbyt(); break; //BYTE + case 'H': asmhex(); break; //BYTE case 'W': asmwrd(); break; //WORD case 'F': asmfll(); break; //FILL case 'S': asmsub(); break; //SUBRoutine diff --git a/a02.h b/a02.h index 16c07d2..3899f29 100644 --- a/a02.h +++ b/a02.h @@ -41,9 +41,9 @@ struct amd amdesc[] = { struct opc {char name[5], token; int amode;}; struct opc psolst[] = { - {"BYTE", 'B', 0}, {"WORD", 'W', 0}, {"EQU", '=', 0}, {"FILL", 'F', 0}, {"INCL", 'I', 0}, - {"SUBR", 'S', 0}, {"ORG", '*', 0}, {"PROC", 'P', 0}, {"DC", 'B', 0}, {"DS", 'F', 0}, - {"", 0, 0} + {"BYTE", 'B', 0}, {"HEX", 'H'}, {"WORD", 'W', 0}, {"EQU", '=', 0}, {"FILL", 'F', 0}, + {"INCL", 'I', 0}, {"SUBR", 'S', 0}, {"ORG", '*', 0}, {"PROC", 'P', 0}, + {"DC", 'B', 0}, {"DS", 'F', 0}, {"", 0, 0} }; struct opc opclst[] = { @@ -74,7 +74,7 @@ struct opc opclst[] = { {"STZ", 0x60, 0x006C}, {"JMP", 0x4C, 0x0620}, {"JSR", 0x14, 0x0020}, - {"LDY", 0xA0, 0x002E}, + {"LDY", 0xA0, 0x006E}, {"STY", 0x80, 0x002C}, {"", 0, 0} };