hth313 / Calypsi-tool-chains

Overview of the Calypsi tool chain and open source support packages
16 stars 0 forks source link

Commandline option to have the Compiler generate an assembly file instead of an object file #5

Closed ProxyPlayerHD closed 4 months ago

ProxyPlayerHD commented 1 year ago

I know list files exist, but they aren't directly compatibile with the Assembler, so having the option to generate a valid assembly file would be pretty nice to have. (GCC for example uses the "-S" option for that)

and while at it can the assembly the compiler generates use Hexadecimal or Binary instead of Decimal for instruction operands? i can understand using decimal for the stack indexed addressing mode, but most other operands would be better in Hex, especially addresses... i just can't see why would you want addresses to be in decimal (unless you really really like C64 BASIC). and some bit based Instructions like REP/SEP could use Binary instead.

also on an unrelated note, i have a suggestion for a somewhat complicated feature, but i don't know if i should open an issue on here or post about it on the 6502 forums.

hth313 commented 1 year ago

Generating assembly source is something I can put up on the todo.

The expression output is pretty stupid and simplified in the compiler. On the debugger side it has various heuristics to reconstruct values and choose between hex and decimal that is probably something I could refactor so that such decisions are taken in common code. At the moment the compiler will only output decimal I believe and it has bugged me slightly, but not to the point that it really bothered me as I could find the hex values in the opcode of the list file. I will put this on the todo as well.

I am not following the 6502 forum after I set up a proper location for this on Github, so it is better that you post it here. It will help other people find the issues reported in one place.

Also, create separate issues if they are different matters, it makes it easier to keep conversations apart.

hth313 commented 1 year ago

Assembly source can be generated since a while back.

The way the compiler generates offsets is very simplistic, it just shows it and it happens to be be decimal at the moment. In the debugger when it disassembles there are various approaches depending on the size of the offset and it does hex most of the time. I probably should factor out this behavior to common code to improve the compiler side, it should not be any huge effort, I may look into it at some point.

hth313 commented 4 months ago

The compiler has been changed to use more hexadecimal in the assembler output in 5.1 or 5.2, so I think this issue is fully taken care of and will close it.