summaryrefslogtreecommitdiff
path: root/output.c
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2019-07-29 22:07:00 +1200
committerDavid Phillips <david@sighup.nz>2019-08-03 12:44:12 +1200
commit5544ad5c06bee5f562dddd055c571818bc0d0119 (patch)
tree2c92b433d206b0fb4c99f70452872a983c96a864 /output.c
parent5a22735d1c265a0a000c77ec9b5bd74688a87370 (diff)
downloadtoy-cpu-assembler-5544ad5c06bee5f562dddd055c571818bc0d0119.tar.xz
Add test for asm-disasm-asm, fix bug with labels
This adds a support script for future expansion of an asm->disasm->asm series of tests, which will at minimum ensure some parity between the assembler and disassembler. Lower level tests to ensure correct behaviour rather than just symmetrical behaviour belong in another set of tests. This patch also fixes the assembler's behaviour around numeric labels. Many other assemblers support entirely numeric labels, and the output of the disassembler includes them. The assembler has been adjusted to lex a probably-numeric as a label if it is at the start of the line. Otherwise, old label behavour and old numeric behaviour is left in place.
Diffstat (limited to 'output.c')
-rw-r--r--output.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/output.c b/output.c
index 2afb5fe..047040a 100644
--- a/output.c
+++ b/output.c
@@ -165,7 +165,7 @@ int output_single(FILE *f, struct label *labels, size_t labels_count, struct ins
}
if (len == 2) {
-//#define RAW
+#define RAW
#ifdef RAW
fputc(0xFF & (i >> 24), f);
fputc(0xFF & (i >> 16), f);