git.ucc.asn.au
/
uccvend-snackrom.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c7f5f20
)
Commented makeasm.pl
author
Mark Tearle
<
[email protected]
>
Sat, 17 Nov 2001 11:06:32 +0000
(11:06 +0000)
committer
Mark Tearle
<
[email protected]
>
Sat, 17 Nov 2001 11:06:32 +0000
(11:06 +0000)
ROM/makeasm.pl
patch
|
blob
|
history
diff --git
a/ROM/makeasm.pl
b/ROM/makeasm.pl
index
fb26c05
..
786dfef
100755
(executable)
--- a/
ROM/makeasm.pl
+++ b/
ROM/makeasm.pl
@@
-3,17
+3,33
@@
print "\tORG\t\$8000\n";
LINE: while (<>) {
print "\tORG\t\$8000\n";
LINE: while (<>) {
+
+# if blank line, print blank line
if (/^\s*$/) { print "\n"; next LINE; }
if (/^\s*$/) { print "\n"; next LINE; }
+
+# if comment line, pass straight through
if (/^\s*;/) { print; next LINE; }
if (/^\s*;/) { print; next LINE; }
+
+# if duplicate label - rename uniquely
if (/^\s*((loop|jump82|goto91):)/) { print "${1}_$.\n"; next LINE; }
if (/^\s*((loop|jump82|goto91):)/) { print "${1}_$.\n"; next LINE; }
+
+# if it's a label, print label
if (/^\s*(\w*:)/) { print "$1\n"; next LINE; }
if (/^\s*(\w*:)/) { print "$1\n"; next LINE; }
+
+# if it's a vector table, print words
if (/^\t\.word\t([a-f0-9]{4})$/) { print "\tFDB\t\$\U$1\n"; next LINE; }
if (/^\t\.word\t([a-f0-9]{4})$/) { print "\tFDB\t\$\U$1\n"; next LINE; }
+
+# otherwise, catch all, print bytes
if (/^([A-F0-9]{4}) ((([A-F0-9]{2}) )*[A-F0-9]{2})/) {
print ";$_";
@_=split(' ',$2);
print "\tFCB\t\$".join(', $',@_)."\n";
next LINE;
}
if (/^([A-F0-9]{4}) ((([A-F0-9]{2}) )*[A-F0-9]{2})/) {
print ";$_";
@_=split(' ',$2);
print "\tFCB\t\$".join(', $',@_)."\n";
next LINE;
}
+
+# if control Z, remove it
if (/^\cZ$/) { next LINE; }
if (/^\cZ$/) { next LINE; }
+
+# FINAL print commented out
print ";$_";
}
print ";$_";
}
UCC
git Repository :: git.ucc.asn.au