No description provided.
break out disassembler into its own file. refactored it a lot.
Merge remote-tracking branch 'denull/master' into disasm
merge denull's new disasm work into the refactored disasm.
fix bug in parsing constants.
BRK moved. :)
The disassembler seems to work worse than it was working before...
For example, the disassembler should be able to parse this code:
ADD PC, 1
SET X, 0x8000
SUB PC, 1
But your version produces
ADD PC, 1
SET X, 0x7c61
SUB PC, 1
(i.e. it doesn't understand that after ADD PC, 1 there is an unreachable word and thus it must be treated as DAT until the next reachable block will be found)
add keyboard support.
fix imported-font format to match the current spec.
oops, sorry, missed your comment last night.
hmm. i see. one fix might be to notice if an opcode is crossing into a target, and stop (just display DAT) in that case. i'll try that.
make sure to always disassemble starting from every target. as a bonu…
…s, decode BRA now too.
ok, it now disassembles to:
0000: BRA label0
0001: DAT 0x7c61
0002: SET X, 0x8000
0004: BRA label1
Still wasn't totally happy with your way of disassembling code... Restored much of the refactored code to its initial state.
The idea is to disassemble only the chunks of code that are actually could be accessible (based on jumps, jsr's, ias'es and other manipulations on PC). Source code shouldn't be used at all (or else disassembler will be totally useless in case of self-modifying code or for disassembling someone else's binaries).
i'll work on this more on a branch. i think i see what the intent was, now, and why it wasn't working for me.
i think it would be cool if the disassembly was automatic -- you didn't need the button. as you edit in the assembler, it compiles all the time, then when you go to the disassembly tab, it disassembles whatever is in memory, and you can edit the memory, changing the disassembly.
it's kinda like the memory dump should be a 3rd tab, and be editable.
i'm trying to get the html/css bootstrapped, so maybe i'll fiddle with that too.
The problem with disassembling current memory is, it's too much work to do (for the disassembler). For example, I don't want to display all memory dump in one large textarea (and disassemble every word of it) - it'll make page too heavy.
And I already have an image of the new page layout in my mind - please keep that in mind when you'll make any serious changes to the interface.
i'll post a merge request that splits out the html, css, and ui js so that it's at least easier to hack on the ui incrementally.
i didn't get bootstrap finished yet, but it keeps your design, just using bootstrap divs instead of manual layout. you can see what it looks like (but doesn't scroll right) here: http://www.lag.net/dcpu/play.html