Z80 assembly development environment recommendations
Z80 assembly development environment recommendations
I wonder if there are any recommendations for z80 assembly dev environments. I would like to break out of a running program at a given point and see the state of the registers and flags.
I am currently using Pasmo for compiling then launching zxspin to see the result. Zx spin does seem to have a menu option for debug but I can’t get it to work as I need.
Any recommendations would be very much appreciated.
Paul
I am currently using Pasmo for compiling then launching zxspin to see the result. Zx spin does seem to have a menu option for debug but I can’t get it to work as I need.
Any recommendations would be very much appreciated.
Paul
Re: Z80 assembly development environment recommendations
Working on a New Year's Resolution are we?
Anyway - Zeus is a proper IDE with breakpoints and so on
https://www.desdes.com/products/oldfiles/zeus.htm
See also this thread viewtopic.php?p=126036&hilit=Zeus#p126036
Anyway - Zeus is a proper IDE with breakpoints and so on
https://www.desdes.com/products/oldfiles/zeus.htm
See also this thread viewtopic.php?p=126036&hilit=Zeus#p126036
- ParadigmShifter
- Manic Miner
- Posts: 671
- Joined: Sat Sep 09, 2023 4:55 am
Re: Z80 assembly development environment recommendations
I don't have any problems with the spin debugger as long as I produce a symbol (.sym) file when assembling. I can't import the symbol file though which is a shame, but it's easy enough to find data and code addresses on the sym file to look at memory and put breakpoints on things.
If I want a breakpoint on a specific line I just add a label
brkhere:
and look at the address (since I only add a label I don't need to reload the binary I can just get the address of the instruction I want to break on).
Register window needs resizing a bit though and the place you have to grab with the mouse isn't very wide when doing that.
Another slight annoyance is you can't set the width of the memory window very easily (I have an 11 wide collision map so I would like to see 11 bytes per line but it's a pain).
I've not tried Zeus but I'm used to Visual Studio editor so I use that. I haven't set up any macros or anything to launch spin and upload the binary but I think you can do that with Spin, not sure.
If I want a breakpoint on a specific line I just add a label
brkhere:
and look at the address (since I only add a label I don't need to reload the binary I can just get the address of the instruction I want to break on).
Register window needs resizing a bit though and the place you have to grab with the mouse isn't very wide when doing that.
Another slight annoyance is you can't set the width of the memory window very easily (I have an 11 wide collision map so I would like to see 11 bytes per line but it's a pain).
I've not tried Zeus but I'm used to Visual Studio editor so I use that. I haven't set up any macros or anything to launch spin and upload the binary but I think you can do that with Spin, not sure.
Re: Z80 assembly development environment recommendations
Another vote for Zeus. It works really well, and is light on resources.
It can also generate tape images in tzx/tap format etc.
(And it has a heritage going back to an actual Spectrum assembler that was released on the Speccy back in the day)
It can also generate tape images in tzx/tap format etc.
(And it has a heritage going back to an actual Spectrum assembler that was released on the Speccy back in the day)
- ParadigmShifter
- Manic Miner
- Posts: 671
- Joined: Sat Sep 09, 2023 4:55 am
Re: Z80 assembly development environment recommendations
I use sjasmplus assembler which also generates TAP files if you want them. I think pasmo can do that as well (not sure really). I think sjasmplus has better macro support than pasmo.
Re: Z80 assembly development environment recommendations
ZX Spin, just TOOLS DEBUGGER and set BREAKPOINT.
Re: Z80 assembly development environment recommendations
sjasmplus(LUA allow calculate checksums) and pasmo(for create .tap files)
Re: Z80 assembly development environment recommendations
Thank you everyone that looks like a good start… I’ll try and get spin working as that’s all set up with macros running from my Notepad++ that both assembles the code in Pasmo then launches spin with the tap file produced by Pasmo.
I am sure I will be back with more questions but for now I have to go out for the rest of the day.
Thanks again and I will be back with a more thorough look…
@Mpk yes this for my game, it feels like a mountain to climb at the moment, but I feel confident I’ll do it this time around.
I am sure I will be back with more questions but for now I have to go out for the rest of the day.
Thanks again and I will be back with a more thorough look…
@Mpk yes this for my game, it feels like a mountain to climb at the moment, but I feel confident I’ll do it this time around.
Re: Z80 assembly development environment recommendations
Pasmo and Zeus were both highly recommended to me by a professional, although I've only really tinkered with them a little bit they do seem quite good.
Re: Z80 assembly development environment recommendations
I'm using BasinC cause I want to work in a native environment but don't have the hardware. It has a CPU window to set breakpoints, trace execution and watch registers.
POKE 23614,10: STOP 1..0 hold, SS/m/n colors, b/spc toggle
Re: Z80 assembly development environment recommendations
pasmo can do if you SET the start value at the END of the file, see docu butParadigmShifter wrote: ↑Sat Jan 27, 2024 11:42 am I use sjasmplus assembler which also generates TAP files if you want them. I think pasmo can do that as well (not sure really). I think sjasmplus has better macro support than pasmo.
only 1 single standard start-basic. its embedded in the source so a bit difficult to change into a #include file
which would be nice.
Re: Z80 assembly development environment recommendations
LnxSpectrum is also becoming a nice development environment with its assembler and debugger.
https://www.ilnx.cz/lnxsp/
https://www.ilnx.cz/lnxsp/
Re: Z80 assembly development environment recommendations
Thank you for this I have it partially working. I can’t get it to work at all when I launch Spin using Notepad++ macros to both assemble the opcodes into an .asm file using Pasmo assembler and then launch spin and automatically load the asm file.
I can use it if I load that same file produced by Pasmo into spin via the spin Z80 Assembler (found under tools menu). I run my code using basic RANDOMIZE USER xxxxx once it’s running I can then launch the debugger and set breakpoints to look at the registers. What I seem unable to do is debug the initial launch I.e after hitting return after the randomise statement. I am sure its user error but I’ve not been able to debug the initial screen draw - not that I need to as that is working just fine
But this is a good step forward
- ParadigmShifter
- Manic Miner
- Posts: 671
- Joined: Sat Sep 09, 2023 4:55 am
Re: Z80 assembly development environment recommendations
Just put a breakpoint on the address xxxxx you use for RANDOMIZE USR xxxxx
Sometimes it disassembles the code wrong (starts disassembling earlier than it should) which can be worked around by putting some NOP instructions at the start of the executable... I usually use 4 and put it on an IF so
Sometimes it disassembles the code wrong (starts disassembling earlier than it should) which can be worked around by putting some NOP instructions at the start of the executable... I usually use 4 and put it on an IF so
Code: Select all
NOPSATSTART EQU 1 ; 0 to remove the NOPs
main:
IF NOPSATSTART
REPT 4
NOP
ENDR
ENDIF
Re: Z80 assembly development environment recommendations
Place before RANDOMIZE USR a breakpoint at the start (or where you want to break)Hedge1970 wrote: ↑Sun Jan 28, 2024 4:35 pm Thank you for this I have it partially working. I can’t get it to work at all when I launch Spin using Notepad++ macros to both assemble the opcodes into an .asm file using Pasmo assembler and then launch spin and automatically load the asm file.
I can use it if I load that same file produced by Pasmo into spin via the spin Z80 Assembler (found under tools menu). I run my code using basic RANDOMIZE USER xxxxx once it’s running I can then launch the debugger and set breakpoints to look at the registers. What I seem unable to do is debug the initial launch I.e after hitting return after the randomise statement. I am sure its user error but I’ve not been able to debug the initial screen draw - not that I need to as that is working just fine
But this is a good step forward
When emulator says PAUSE go to the debugger and use the step function to do step by step.
Re: Z80 assembly development environment recommendations
Thank you both, I’ll be working on this tomorrow and will give both solutions a go. Many thanks.
Re: Z80 assembly development environment recommendations
So it’s all working well now I am able to add breakpoints and also walk through my code monitoring the registers at each step. Obviously this is a great help when debugging and has helped to identify some rather ambiguous coding decisions made by me - lol.
While I do use the stack to push and pop I also have set asside some memory locations that I poke. I’ve looked through the various memory options but can’t see a way to monitor specific memory locations easily? Currently I am using a hexloader program that has a couple of functions to peek values but it would be great if it was a feature of the Zxspin debugger that I have yet to discover?
Thanks again
While I do use the stack to push and pop I also have set asside some memory locations that I poke. I’ve looked through the various memory options but can’t see a way to monitor specific memory locations easily? Currently I am using a hexloader program that has a couple of functions to peek values but it would be great if it was a feature of the Zxspin debugger that I have yet to discover?
Thanks again
Re: Z80 assembly development environment recommendations
You can use the memory tab and in the address input you can simply input the address and see what is there.
Re: Z80 assembly development environment recommendations
Ok I see, thanks again. I’ll work on it tomorrow but I can see the data changing. Is there any benefit to using a label MAIN and if so ideally where should it go?
I don’t currently have one but I see the prefix main: on the drop downs, and the assembler complains that MAIN is missing but the code seems to get assembled ok?
- ParadigmShifter
- Manic Miner
- Posts: 671
- Joined: Sat Sep 09, 2023 4:55 am
Re: Z80 assembly development environment recommendations
I think main is for the inbuilt assembler (which isn't very good - so use Pasmo or Sjasmplus). EDIT: It probably knows about its on labels though which would be handy if the assembler wasn't as crap as it is. So I just use the symbol file to lookup addresses.
I always call my entry point main for C reasons
I expect spin has something where if you have a label main it starts executing from there or something rather than having to randomize usr or something.
I always call my entry point main for C reasons
I expect spin has something where if you have a label main it starts executing from there or something rather than having to randomize usr or something.
Re: Z80 assembly development environment recommendations
Maybe I am not using the program properly, but I seem to need the built in assembler to enable the debugging features of zxspin. As of yet I’ve not noticed any issues regarding the code produced but I will be wary of the possibility now so thanks again.ParadigmShifter wrote: ↑Mon Jan 29, 2024 9:13 pm I think main is for the inbuilt assembler (which isn't very good - so use Pasmo or Sjasmplus). EDIT: It probably knows about its on labels though which would be handy if the assembler wasn't as crap as it is. So I just use the symbol file to lookup addresses.
I always call my entry point main for C reasons
I expect spin has something where if you have a label main it starts executing from there or something rather than having to randomize usr or something.
- ParadigmShifter
- Manic Miner
- Posts: 671
- Joined: Sat Sep 09, 2023 4:55 am
Re: Z80 assembly development environment recommendations
If you can produce a symbol file you don't really need any of the spin assembler/label features.
Just lookup data addresses and go there in the memory window and if you want a breakpoint somewhere just create a label (I always use brkhere) and lookup where to set a breakpoint on a specific instruction.
e.g. symbol file produce by sjasmplus
playerprevx: EQU 0x00008C83
playerxpos: EQU 0x00008C81
gfx_solid: EQU 0x00008C68
gfx_blank: EQU 0x00008C60
gfx_checker: EQU 0x00008C58
gfx_dude: EQU 0x00008C50
gfx_smallsquare: EQU 0x00008C48
row: EQU 0x00000017
read_keyboard.notpressingD: EQU 0x00008BC0
read_keyboard.notpressingA: EQU 0x00008BBB
read_keyboard.notpressingS: EQU 0x00008BB6
read_keyboard.notpressingW: EQU 0x00008BAD
erase16x8ra: EQU 0x00008B41
erase16x8.loop2: EQU 0x00008B33
erase16x8.ok: EQU 0x00008B32
erase16x8.loop: EQU 0x00008B1B
erase16x8raKnowAddr: EQU 0x00008B4B
erase16x8: EQU 0x00008B00
erase8x8shift: EQU 0x00008B00
erase8x8end: EQU 0x00008A50
erase8x8a: EQU 0x00008A35
erase8x8caKnowAddrAndBothOffsets.loop2: EQU 0x00008A30
erase8x8caKnowAddrAndBothOffsets.ok: EQU 0x00008A2B
erase8x8caKnowAddrAndBothOffsets.loop: EQU 0x00008A1D
erase8x8caKnowAddrAndBothOffsets: EQU 0x00008A1C
erase8x8caKnowAddrAndOffset: EQU 0x00008A17
erase8x8aKnowAddr: EQU 0x00008A3F
erase8x8caKnowAddr: EQU 0x00008A12
erase8x8ca: EQU 0x00008A00
draw8x8shift7end: EQU 0x00008967
draw8x8shift7: EQU 0x00008900
draw8x8shift6end: EQU 0x0000886F
draw8x8shift6: EQU 0x00008800
draw8x8shift5end: EQU 0x00008777
draw8x8shift5: EQU 0x00008700
draw8x8shift4end: EQU 0x0000867F
draw8x8shift4: EQU 0x00008600
draw8x8shift3end: EQU 0x00008597
draw8x8shift3: EQU 0x00008500
draw8x8shift2end: EQU 0x0000847F
draw8x8shift2: EQU 0x00008400
draw8x8shiftend: EQU 0x00008367
draw8x8shift1: EQU 0x00008300
sprite8x8end: EQU 0x00008270
sprite8x8a: EQU 0x0000823F
draw8x8end: EQU 0x0000823E
sprite8x8caKnowAddrAndBothOffsets.loop2: EQU 0x00008236
sprite8x8caKnowAddrAndBothOffsets.ok: EQU 0x00008230
sprite8x8caKnowAddrAndBothOffsets.loop: EQU 0x0000821F
sprite8x8caKnowAddrAndBothOffsets: EQU 0x0000821F
sprite8x8caKnowAddrAndOffset: EQU 0x0000821A
sprite8x8aKnowAddr: EQU 0x00008249
sprite8x8caKnowAddr: EQU 0x00008215
sprite8x8ca: EQU 0x00008203
sprite16x8end: EQU 0x0000813B
sprite16x8.loop2: EQU 0x0000812D
sprite16x8.ok: EQU 0x0000812C
sprite16x8.loop: EQU 0x00008115
sprite16x8: EQU 0x000080F7
gfx_scrollbuff: EQU 0x00008C30
sprite16x8raKnowAddr: EQU 0x0000809E
tbl_rows: EQU 0x00008C00
sprite16x8ra: EQU 0x00008094
main.dontupdatex: EQU 0x00008091
main.dontupdatey: EQU 0x00008085
read_keyboard: EQU 0x00008BA1
gfx_square: EQU 0x00008C40
draw8x8: EQU 0x00008200
playerypos: EQU 0x00008C80
jphl: EQU 0x0000823E
erase_8x8_shifts: EQU 0x00008C70
main.docall: EQU 0x00000000
erase8x8: EQU 0x00008A00
playerprevy: EQU 0x00008C82
main: EQU 0x00008000
DELAYAFTERHALT: EQU 0x00000000
TIMING: EQU 0x00000001
UNROLL_Sprite8x8a: EQU 0x00000001
SCRBASE: EQU 0x00004000
Just lookup data addresses and go there in the memory window and if you want a breakpoint somewhere just create a label (I always use brkhere) and lookup where to set a breakpoint on a specific instruction.
e.g. symbol file produce by sjasmplus
playerprevx: EQU 0x00008C83
playerxpos: EQU 0x00008C81
gfx_solid: EQU 0x00008C68
gfx_blank: EQU 0x00008C60
gfx_checker: EQU 0x00008C58
gfx_dude: EQU 0x00008C50
gfx_smallsquare: EQU 0x00008C48
row: EQU 0x00000017
read_keyboard.notpressingD: EQU 0x00008BC0
read_keyboard.notpressingA: EQU 0x00008BBB
read_keyboard.notpressingS: EQU 0x00008BB6
read_keyboard.notpressingW: EQU 0x00008BAD
erase16x8ra: EQU 0x00008B41
erase16x8.loop2: EQU 0x00008B33
erase16x8.ok: EQU 0x00008B32
erase16x8.loop: EQU 0x00008B1B
erase16x8raKnowAddr: EQU 0x00008B4B
erase16x8: EQU 0x00008B00
erase8x8shift: EQU 0x00008B00
erase8x8end: EQU 0x00008A50
erase8x8a: EQU 0x00008A35
erase8x8caKnowAddrAndBothOffsets.loop2: EQU 0x00008A30
erase8x8caKnowAddrAndBothOffsets.ok: EQU 0x00008A2B
erase8x8caKnowAddrAndBothOffsets.loop: EQU 0x00008A1D
erase8x8caKnowAddrAndBothOffsets: EQU 0x00008A1C
erase8x8caKnowAddrAndOffset: EQU 0x00008A17
erase8x8aKnowAddr: EQU 0x00008A3F
erase8x8caKnowAddr: EQU 0x00008A12
erase8x8ca: EQU 0x00008A00
draw8x8shift7end: EQU 0x00008967
draw8x8shift7: EQU 0x00008900
draw8x8shift6end: EQU 0x0000886F
draw8x8shift6: EQU 0x00008800
draw8x8shift5end: EQU 0x00008777
draw8x8shift5: EQU 0x00008700
draw8x8shift4end: EQU 0x0000867F
draw8x8shift4: EQU 0x00008600
draw8x8shift3end: EQU 0x00008597
draw8x8shift3: EQU 0x00008500
draw8x8shift2end: EQU 0x0000847F
draw8x8shift2: EQU 0x00008400
draw8x8shiftend: EQU 0x00008367
draw8x8shift1: EQU 0x00008300
sprite8x8end: EQU 0x00008270
sprite8x8a: EQU 0x0000823F
draw8x8end: EQU 0x0000823E
sprite8x8caKnowAddrAndBothOffsets.loop2: EQU 0x00008236
sprite8x8caKnowAddrAndBothOffsets.ok: EQU 0x00008230
sprite8x8caKnowAddrAndBothOffsets.loop: EQU 0x0000821F
sprite8x8caKnowAddrAndBothOffsets: EQU 0x0000821F
sprite8x8caKnowAddrAndOffset: EQU 0x0000821A
sprite8x8aKnowAddr: EQU 0x00008249
sprite8x8caKnowAddr: EQU 0x00008215
sprite8x8ca: EQU 0x00008203
sprite16x8end: EQU 0x0000813B
sprite16x8.loop2: EQU 0x0000812D
sprite16x8.ok: EQU 0x0000812C
sprite16x8.loop: EQU 0x00008115
sprite16x8: EQU 0x000080F7
gfx_scrollbuff: EQU 0x00008C30
sprite16x8raKnowAddr: EQU 0x0000809E
tbl_rows: EQU 0x00008C00
sprite16x8ra: EQU 0x00008094
main.dontupdatex: EQU 0x00008091
main.dontupdatey: EQU 0x00008085
read_keyboard: EQU 0x00008BA1
gfx_square: EQU 0x00008C40
draw8x8: EQU 0x00008200
playerypos: EQU 0x00008C80
jphl: EQU 0x0000823E
erase_8x8_shifts: EQU 0x00008C70
main.docall: EQU 0x00000000
erase8x8: EQU 0x00008A00
playerprevy: EQU 0x00008C82
main: EQU 0x00008000
DELAYAFTERHALT: EQU 0x00000000
TIMING: EQU 0x00000001
UNROLL_Sprite8x8a: EQU 0x00000001
SCRBASE: EQU 0x00004000
Re: Z80 assembly development environment recommendations
lol I think I’ll file the above under “you don’t know what you don’t know “
I am new to all this and have not seen anything like your post yet. In time I am sure it will be clear one day but for now I’ve got enough going on just coding the outline of my game mechanics. Thanks though as when the time comes I am sure it will be good reference material.
I am new to all this and have not seen anything like your post yet. In time I am sure it will be clear one day but for now I’ve got enough going on just coding the outline of my game mechanics. Thanks though as when the time comes I am sure it will be good reference material.
- ParadigmShifter
- Manic Miner
- Posts: 671
- Joined: Sat Sep 09, 2023 4:55 am
Re: Z80 assembly development environment recommendations
So if I want to look at playerxpos I would produce the symbol file, look up the address (playerxpos: EQU 0x00008C81) and go to the memory window and look at $8c81.
If I wanted to put a breakpoint on erase16x8 I would set a breakpoint here: erase16x8: EQU 0x00008B00 = $8b00
If I wanted to put a breakpoint on erase16x8 I would set a breakpoint here: erase16x8: EQU 0x00008B00 = $8b00
Re: Z80 assembly development environment recommendations
Ah ok, I get that info from the output window when I assemble with Pasmo. I then keep a copy of that and assemble again in spin and then use the previous file to input addresses I want to add break points to. My output is not as neat as yours but is easily searchable and very useable especially when marked up with colours.