Counting TStates

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
Post Reply
User avatar
marste
Posts: 250
Joined: Sun Aug 10, 2014 9:58 pm
Location: Italy
Contact:

Counting TStates

Post by marste »

For the people that develop their own flicker-free routine (e.g. for ZX80, but also custom ones for ZX81) or anyway programs that need very accurate fine grain timing, there is always the need to calculate the cpu cycles of the program pieces, and usually this activity is done by hand (as I did also myself for the flicker free version of the 1K real chess prototype for ZX80)...

I discovered this interesting zmac assembler that has a feature among many others that can help in doing this. Here is the link for the people interested: http://48k.ca/beamhack3.html

(another interesting one is for example the automatic transformation of jr and djnz when target exceed the allowed range)
User avatar
kmurta
Posts: 302
Joined: Tue Sep 01, 2009 5:04 am
Location: Belo Horizonte - BR
Contact:

Re: Counting TStates

Post by kmurta »

Recently I started using sjasmplus with the Visual Studio Code + Z80 Assembly Meter extension and I'm really enjoying it, just select the code with the mouse and you have the count of bytes and T-states displayed in the status bar. Very practical!

https://code.visualstudio.com/

https://github.com/z00m128/sjasmplus

https://github.com/theNestruo/z80-asm-meter-vscode
1 x ZX81, 2 x TK85 , 1 TK82C, 1 TK95, 1 x Alphacom 32 printer, 1 x ZXpand
ZeXtender board, Joy81 - Programmable Joystick Controller, Turbo Sound 81
http://zx81.eu5.org
https://toddysoftware.itch.io/
User avatar
marste
Posts: 250
Joined: Sun Aug 10, 2014 9:58 pm
Location: Italy
Contact:

Re: Counting TStates

Post by marste »

kmurta wrote: Tue Jul 28, 2020 8:02 pm Recently I started using sjasmplus with the Visual Studio Code + Z80 Assembly Meter extension and I'm really enjoying it, just select the code with the mouse and you have the count of bytes and T-states displayed in the status bar. Very practical!
It is still manual calculation (and when you start seriously to count TStates you'll know the single instruction ones by heart ;)).

Anyway, how do you find sjasmplus? Are you able to do debugging using the source files instead of disasm? (I tryed to let Dezog digest fasmg listings but still didn't succeed)
User avatar
kmurta
Posts: 302
Joined: Tue Sep 01, 2009 5:04 am
Location: Belo Horizonte - BR
Contact:

Re: Counting TStates

Post by kmurta »

marste wrote: Fri Jul 31, 2020 9:43 pm It is still manual calculation (and when you start seriously to count TStates you'll know the single instruction ones by heart ;)).
Indeed, semi manual, you still have to calculate the total cycles in loops and conditional jumps, but it helps a lot to visualize the count of cycles and bytes of the instruction before of compile the code:
2020-08-02.png
marste wrote: Fri Jul 31, 2020 9:43 pm Anyway, how do you find sjasmplus? Are you able to do debugging using the source files instead of disasm? (I tryed to let Dezog digest fasmg listings but still didn't succeed)
Yes, there is the DeZog extension for VS Code (https://github.com/maziac/DeZog), but I haven't tested it yet. For now, I'm debugging the code using only the tools of the Eighty One emulator.

Regardless of your preferred assembler, VS Code is a versatile development environment that offers several facilities in code editing (including a built-in terminal) and you can use it with several assemblers, sjasm, sjasmplus, pasmo, rasm, tasm , zmac, etc. It's been very pleasant to use it!
1 x ZX81, 2 x TK85 , 1 TK82C, 1 TK95, 1 x Alphacom 32 printer, 1 x ZXpand
ZeXtender board, Joy81 - Programmable Joystick Controller, Turbo Sound 81
http://zx81.eu5.org
https://toddysoftware.itch.io/
Post Reply