Closed shazz closed 3 years ago
I also added the cycle count estimation by opcode
Output:
0801: 0C 08 00 00 9E 32 30 36
0809: 31 00 00 00
080D: 20 8C 08 frame_loop JSR $088C ; #6
0810: A9 00 LDA #$00 ; #2
0812: A8 TAY ; #2
0813: 85 20 STA $20 ; #3
0815: AD 9B 08 anim_sprites LDA $089B ; #4
0818: 18 CLC ; #2
0819: 65 20 ADC $20 ; #3
081B: 29 3F AND #$3F ; #2
081D: AA TAX ; #2
081E: BD AC 08 LDA $08AC,X ; #4
0821: 18 CLC ; #2
0822: 69 64 ADC #$64 ; #2
0824: 99 9C 08 STA $089C,Y ; #5
0827: A5 20 LDA $20 ; #3
0829: 18 CLC ; #2
082A: 69 05 ADC #$05 ; #2
082C: 85 20 STA $20 ; #3
082E: C8 INY ; #2
082F: C0 08 CPY #$08 ; #2
0831: D0 E2 BNE $0815 ; #2
0833: EE 9B 08 INC $089B ; #6
0836: 20 3C 08 JSR $083C ; #6
0839: 4C 0D 08 JMP $080D ; #3
083C: A9 00 set_sprites LDA #$00 ; #2
083E: 8D 1D D0 STA $D01D ; #4
Sorry, this fell through the cracks, perhaps I will now have a bit of time to work on the assembler.
The feature looks very useful. How would you feel about changing the formatting a bit.. by moving the labels into the right sight in comments? Reason: having them in the hex byte data will increase the left margin significantly making the disassembly look ugly with longer labels. At least I'd like them on the right side.
I could pick this change and adapt it for different output format.
yeah formatting the way I did with possibly very long labels is not that good. Better your way I guess. Yes, please pick it up and improve it.
Merged! Thank you very much, it's a really useful addition!
Added some minor clean up and enable/disable CLI options here: 6983fd06ff94abb16f17cbeef158d459fcb3735f
better like this :) Now I can delete my branches... I think I had another patch to save the listing using
parser.addArgument('--disasm-file', {
dest: 'disasmFile',
help: 'Save the disassembly in the given file.'
});
Yes that was in https://github.com/nurpax/c64jasm/commit/c00b5545df66df95c4a46ea5eba12c042ca6d63e which is also in now.
I never coded anything with Typescript so probably not the best way to do but at least it works. You'll tell me what to change :)
Basically what it does:
I added an Interface for labels in the disassembler:
The CLI provides the labels generated by the assembler to the disassembler:
The disassembler convert the list of labels into a dictionary in the constructor:
During the disassembler process
disassemble()
, if for the given address a label exist in the dictionnary, it will be used by each decoder to generate the output:Execution example: