-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ticks debugger #325
Ticks debugger #325
Conversation
for command line. All this does at the moment is to print the disassembly as opcodes are about to be executed.
No timing information changes since no information available.
…oise - this compiles for win32 with mingw at least.
I'm sure there are bugs, but they will be found.. The intention is to support multiple CPUs, load .sym files and print symbol labels.
No there's no timing information. I can try to ask but the people doing hw have been very busy and not too accessible. Mike is doing 4T in his emulator but I'm not sure where he gets that info from. It certainly doesn't make sense from a standard z80 point of view. |
instructions in fairly easily. Add zxn instructions to disassembler.
Disassemble now disassembles to a buffer which is then printed
Prints 128 bytes of memory from addr in a nice hexdump
Some timings passed along by Mike: LDIX 16T MUL 4T (16*16 bit) ADD HL,A 4T PIXELDN 4T INC DEHL 4T TEST $XX 7T So popx is probably 4T too. Some of the instructions are implemented internally using faster logic. |
Brilliant, thank you. I think we can extrapolate that push $xxxx is 12T then. I've not implemented the LDI instructions yet, but I guess that LDIRX is 21T for each loop and then 16T for the last one? |
Some more guesswork here: The ldi* are using the z80 logic so the timing is the same so like you say 21/16. fillde and outinb may be much faster than guessed. |
Fix some missing ix flags.
I just gave z88dk-dis a try on a compiled program: z88dk-dis -o32768 -s32768 -mz80-zxn -x sudoku.map sudoku_CODE.bin > out.txt I gave it a map file for symbols and that's going to mix defined constants with addresses. It looks like the destination addresses for jumps and calls is filled in correctly, though there may be errors if a constant a label share the same value. The beginning looks like this:
The labels on the left are defined contants, in fact: 0,1,2,3,etc. So the left side labels are not being offset to 32768 as they should be ("-o32768"). |
I think it should be:
i.e. space separated. The command line parsing is the same as ticks itself. I think the map file probably needs to distinguish between labels and defc to get the symbolic compilation to truly work. |
If I put the spaces in:
but the label thing is fixed. It's nice to see the symbols in there:
It would be nice if no end address is specified that is pursues all branches rather than stopping after a fixed line count. yazd does something like that.
I also use defc to define address aliases. I don't know if z80asm would be able to distinguish between a link-time defc (an address) and an assemble time constant in the map file. We also have to look at putting bank information into the map file (and have it sorted by bank) and it would be nice if z88dk-dis could handle multiple banks eventually. |
Actually I will move this to the main issues. |
This is the start of a debugger for ticks. Commands supported:
They could all do with extending and extra ones added, but it's better than nothing.
The disassembler is hacked from one I found online, but I think it's worth replacing with something a bit more home-brew to allow easier extension.
There's command line history and editing courtesy of linenoise, this compiles on mingw and I think on VS as well. If someone with windows could confirm that would be nice.
Finally, I've added -mz80 and -mz80-zxn options to ticks and added the ZXN opcodes that the opt file rules use.