Attachment | Size |
---|---|
![]() | 6.63 KB |
here is the file
Please support the defense of Ukraine.
Direct or via Unclutter App
No Ads.
No Trackers.
No Social Media.
All Content Locally Hosted.
Built on Free Software.
We have complied with zero government requests for information.
~ Est. 1999 ~
A pillar of corporate stability since the second millenium.
© 1999-2999 Tom Owad
That code looks like output from a 6502 assembler. We usually compile code written in a programming language to assembly code using a compiler. The next step in compiling can be assembling this output assembly code to a binary. I would filter that assembler output into assembly code that an assembler can use and then assemble it using a 6502 assembler.
Download:
curl -o code-c64.txt https://www.applefritter.com/files/Code%20C64.txt
Filter:
The following piped
sed
commands will remove carriage returns, covert hex labels to origin (ORG) hex addresses, covert CA65-style .byte directives into Merlin32-style ASC directives, remove the assembler output so that there is only assembly code, covert the LAX undocumented opcode into an ASC directive for Merlin32.sed -e 's/\r$//' \
-e 's/^[0-9a-f][0-9a-f][0-9a-f][0-9a-f] / ORG $&\n/' code-c64.txt \
| sed -e 's/.byte / ASC /' \
-e 's/.C:[0-9a-f][0-9a-f][0-9a-f][0-9a-f] .. .. .. / /' \
-e 's/ LAX / ASC $A7,/' > code.txt
Assemble:
merlin32 '' code.txt
Run:
6502 PC=80d 800 code
A=AA X=00 Y=00 S=00 P=22 PC=080D 0
080D- A9 0F LDA #$0F A=0F X=00 Y=00 S=00 P=20 PC=080F 2
080F- A8 TAY A=0F X=00 Y=0F S=00 P=20 PC=0810 4
0810- A2 08 LDX #$08 A=0F X=08 Y=0F S=00 P=20 PC=0812 6
0812- 20 00 FE JSR $FE00 A=0F X=08 Y=0F S=FE P=20 PC=FE00 12
FE00! end