From cf9e540d3a0189e82eaa364df59f5044060e51e2 Mon Sep 17 00:00:00 2001 From: Nick Bannon Date: Fri, 16 Nov 2001 17:38:39 +0000 Subject: [PATCH] makeasm.pl will create vendas11.asm, which, so far, includes every byte of mapped.asm as a FCB command. This can be assembled and compared to vend.bin with a "make test". It appears that mapped.asm had lost some lines somewhere along the line - fixed. "masm" is a version of the as11 assembler I found... --- ROM/Makefile | 32 ++++++++++++++++++++++++++++++++ ROM/makeasm.pl | 36 ++++++++++++++++++++++++++++++++++++ ROM/mapped.asm | 20 ++++++++++++++++++++ 3 files changed, 88 insertions(+) create mode 100644 ROM/Makefile create mode 100755 ROM/makeasm.pl diff --git a/ROM/Makefile b/ROM/Makefile new file mode 100644 index 0000000..a11b1c7 --- /dev/null +++ b/ROM/Makefile @@ -0,0 +1,32 @@ +HEXDUMP=xxd +HEXDUMP=od -A x -x + +.SUFFIXES: .asm .obj + +all: vendas11.asm + @true + +.asm.obj: + masm $? - bl > $*.listing + +vendas11.asm: mapped.asm + ./makeasm.pl $? > $@ + +64kvend.bin: vend.bin + dd if=/dev/zero bs=32768 count=1 of=$@ + cat $? >> $@ + +check: test + @true + +test: vendas11.obj 64kvend.bin + cmp vendas11.obj 64kvend.bin + +x1: vendas11.obj + $(HEXDUMP) $? > $@ + +x2: 64kvend.bin + $(HEXDUMP) $? > $@ + +hex: x1 x2 + diff -u x1 x2 diff --git a/ROM/makeasm.pl b/ROM/makeasm.pl new file mode 100755 index 0000000..c278881 --- /dev/null +++ b/ROM/makeasm.pl @@ -0,0 +1,36 @@ +#!/usr/local/bin/perl -w + +print "\tORG\t\$8000\n"; + +LINE: while (<>) { + if (/^\s*$/) { print "\n"; next LINE; } + if (/^\s*;/) { print; next LINE; } + if (/^\s*((loop|jump82|goto91):)/) { print "${1}_$.\n"; next LINE; } + if (/^\s*(\w*:)/) { print "$1\n"; next LINE; } + if (/^\t\.word\t([a-f0-9]{4})$/) { print "\tFDB\t\$\U$1\n"; next LINE; } + if (/^([A-F0-9]{4}) ((([A-F0-9]{2}) )*[A-F0-9]{2})/) { + print ";$_"; + @_=split(' ',$2); + print "\tFCB\t\$".join(', $',@_)."\n"; + +# print "\tFCB\t\$$3, \$$5, \$$7, \$$9\n"; + next LINE; + } +# if (/^([A-F0-9]{4}) (([A-F0-9]{2}) )(([A-F0-9]{2}) )(([A-F0-9]{2}) )/) { +# print ";$_"; +# print "\tFCB\t\$$3, \$$5, \$$7\n"; +# next LINE; +# } +# if (/^([A-F0-9]{4}) (([A-F0-9]{2}) )(([A-F0-9]{2}) )/) { +# print ";$_"; +# print "\tFCB\t\$$3, \$$5\n"; +# next LINE; +# } +# if (/^([A-F0-9]{4}) ([A-F0-9]{2})/) { +# print ";$_"; +# print "\tFCB\t\$$2\n"; +# next LINE; +# } + if (/^\cZ$/) { next LINE; } + print ";$_"; +} diff --git a/ROM/mapped.asm b/ROM/mapped.asm index 913a899..5f924c2 100644 --- a/ROM/mapped.asm +++ b/ROM/mapped.asm @@ -365,6 +365,7 @@ goto1: 821D 62 b illegal 821E 83 A5 83 ... subd #a583 8221 C2 83 .. sbcb #83 +8223 DF 83 FC ... stx 83 8226 84 19 .. anda #19 8228 84 35 .5 anda #35 822A 84 51 .Q anda #51 @@ -1280,6 +1281,7 @@ jump17: 8A06 8C 72 8B .r. cpx #728b 8A09 FC 8C 67 ..g ldd 8c67 8A0C 8C 6F BD .o. cpx #6fbd +8A0F 9A 47 7E .G~ ora 47 8A12 8C 72 F6 .r. cpx #72f6 8A15 00 . test 8A16 36 6 psha @@ -2117,6 +2119,7 @@ jump21: 9178 C5 91 .. bitb #91 917A B5 91 BA ... bita 91ba 917D 91 C2 BD ... cmpa c2 +9180 9D 7E 20 .~ jsr 7e 9183 41 A illegal 9184 BD A8 64 ..d jsr a864 ;jump99 9187 20 3C < bra 3c ;91C5 @@ -2186,6 +2189,7 @@ jump76: 9212 92 59 92 .Y. sbca 59 9215 4E N illegal 9216 92 56 BD .V. sbca 56 +9219 9D 7E 20 .~ jsr 7e 921C 3C < pshx 921D BD A8 64 ..d jsr a864 ;jump99 9220 20 37 7 bra 37 ;9259 @@ -2251,6 +2255,7 @@ jump149: 92A7 ED 92 .. stad 92,x 92A9 E2 92 .. sbcb 92,x 92AB EA BD .. orb bd,x +92AD 9D 7E 20 .~ jsr 7e 92B0 3C < pshx 92B1 BD A8 64 ..d jsr a864 ;jump99 92B4 20 37 7 bra 37 ;92ED @@ -3315,6 +3320,7 @@ jump111: 9C20 00 . test 9C21 00 . test 9C22 0A . clv +9C23 9D 29 9C .). jsr 29 9C26 3B ; rti 9C27 9C 53 9C .S. cmpx 53 9C2A 6B k illegal @@ -3323,6 +3329,7 @@ jump111: 9C31 9C C9 9C ... cmpx c9 9C34 E0 9C .. subb 9c,x 9C36 F7 9D 0E ... stb 9d0e +9C39 9D 23 F6 .#. jsr 23 9C3C 00 . test 9C3D 67 C4 g. asr c4,x 9C3F 02 . idiv @@ -3581,13 +3588,21 @@ jump100: 9E96 2D A1 -. blt a1 ;9E39 9E98 C4 9E .. andb #9e 9E9A F5 9E FE ... bitb 9efe +9E9D 9F 07 9F ... sts 07 9EA0 10 . sba +9EA1 9F 19 9F ... sts 19 9EA4 3B ; rti +9EA5 9F 44 9F .D. sts 44 9EA8 52 R illegal +9EA9 9F 5B 9F .[. sts 5b 9EAC 69 i rol +9EAD 9F 72 9F .r. sts 72 9EB0 80 9F .. suba #9f 9EB2 89 9F .. adca #9f +9EB4 97 9F A0 ... sta 9f +9EB7 9F AE 9F ... sts ae 9EBA B7 9F C5 ... sta 9fc5 +9EBD 9F DD 9F ... sts dd 9EC0 EB A0 .. addb a0,x 9EC2 03 . fdiv 9EC3 A0 11 .. suba 11,x @@ -6215,11 +6230,13 @@ B0F6 4A J deca B0F7 56 V rorb B0F8 61 a illegal B0F9 08 . inx +B0FA 13 . brclr B0FB 33 3 pulb B0FC 3E > wai B0FD 49 I rola B0FE 54 T lsrb B0FF 60 07 `. neg 07,x +B101 12 . brset B102 1D 3D .= bclr add,x 3d,x B104 48 H asla B105 53 S comb @@ -6383,6 +6400,7 @@ B1C4 44 D lsra B1C5 20 2D - bra 2d ;B1F4 B1C7 00 . test B1C8 09 . dex +B1C9 12 . brset B1CA 1B . aba B1CB 24 2C $, bcc 2c ;B1F9 B1CD 35 5 txs @@ -14024,6 +14042,7 @@ EE08 BD C0 BA ... jsr c0ba ;display: EE0B CE 10 16 ... ldx #1016 EE0E 1D 01 .. bclr add,x 01,x EE10 FF CC 05 ... stx cc05 +EE13 DC BD E5 ... ldd bd EE16 71 q illegal EE17 38 8 pulx EE18 39 9 rts @@ -15409,6 +15428,7 @@ FA8A CE 00 1F ... ldx #001f FA8D 1C 00 .. bset add,x 00,x FA8F 20 F6 . bra f6 ;FA87 FA91 00 . test +FA92 12 . brset FA93 C4 01 .. andb #01 FA95 26 33 &3 bne 33 ;FACA FA97 F6 00 1D ... ldab 001d -- 2.20.1