X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=ROM%2Fmakeasm.pl;fp=ROM%2Fmakeasm.pl;h=c278881d66789b38f330a946fbd8a820e59d5e9a;hb=cf9e540d3a0189e82eaa364df59f5044060e51e2;hp=0000000000000000000000000000000000000000;hpb=2c11215e1d086c095ba848a7665ee22b440e59bd;p=uccvend-snackrom.git 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 ";$_"; +}