You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Great tool! (Kept me from having to write my own assembler for my CPU. :) )
Would it be hard to add an "annotated hex listing output"? I looked a little at the output formats, and it didn't look like any of them have this sort of support.
I'm thinking something like this:
### Input:
#addr 0x80
lda #10
.loop:
sbc #1
out A
bnz .loop ; loop til zero
### Output:
; File: <input>:0
; #addr 0x80
0x80 01 0A ; lda #10
; .loop:
0x82 0B 01 ; sbc #1
0x84 2C ; out A
0x85 27 FA ; bnz .loop ; loop til zero
Basically, the output would be something you might get if you ran the output of the tool back through a disassembler. Except that the tool can cheat, since it could know exactly what line corresponds to each group of bytes that was emitted.
If you're watching a simulated CPU, it would be very easy to follow this listing by following your CPU's PC. It would also be massively useful for just telling if your program is assembling to what you expect. (Emitting proper instructions and so on.)
I wouldn't mind contributing some code to this, but I'm not very familiar with Rust (yet), and I'm even less familiar with the architecture of this tool, so I don't know if the assembler even retains enough information for this feature to be feasible. If it doesn't keep some sort of mapping between the output bytes and the source line, I can imagine this might be a pretty invasive change.
Maybe this would work best as an additional output? That way the assembler can just write to the "listing log" as it goes along, and doesn't have to remember a bunch of extra information to produce an output.
The text was updated successfully, but these errors were encountered:
This is a really good idea! It's very much doable, but you're right in that it will require a little more bookkeeping inside the assembler -- but probably nothing too troublesome. I'll try working on it when I have the time! Should become a good default output format when it's done!
Great tool! (Kept me from having to write my own assembler for my CPU. :) )
Would it be hard to add an "annotated hex listing output"? I looked a little at the output formats, and it didn't look like any of them have this sort of support.
I'm thinking something like this:
Basically, the output would be something you might get if you ran the output of the tool back through a disassembler. Except that the tool can cheat, since it could know exactly what line corresponds to each group of bytes that was emitted.
If you're watching a simulated CPU, it would be very easy to follow this listing by following your CPU's PC. It would also be massively useful for just telling if your program is assembling to what you expect. (Emitting proper instructions and so on.)
I wouldn't mind contributing some code to this, but I'm not very familiar with Rust (yet), and I'm even less familiar with the architecture of this tool, so I don't know if the assembler even retains enough information for this feature to be feasible. If it doesn't keep some sort of mapping between the output bytes and the source line, I can imagine this might be a pretty invasive change.
Maybe this would work best as an additional output? That way the assembler can just write to the "listing log" as it goes along, and doesn't have to remember a bunch of extra information to produce an output.
The text was updated successfully, but these errors were encountered: