Z80 timing

Página 1/5
| 2 | 3 | 4 | 5

Por pitpan

Prophet (3152)

Imagen del pitpan

20-05-2005, 12:56

Hi!

I have been trying to calculate the exact time that a routine takes to be fully executed on a regular Z80 at 3.5 MHz, but I haven't managed to do it accurately. What I do is just add the T-states that every instruction takes and then convert it to microseconds, knowing that 1 T-states takes 1/3.5M (of course, I am using more precise values).

What am I doing wrong? Of course, interrupts are disabled to prevent further problems. Is there an additional T-state to be added somewhere? I am using the T-state values calculated by Sean Young in his excellent "Z80 undocumented documented".

Help!!!?

Login sesión o register para postear comentarios

Por Sonic_aka_T

Enlighted (4130)

Imagen del Sonic_aka_T

20-05-2005, 13:23

dunno, waitstates, like you said, and perhaps refresh also affects the timing?

Por Edwin

Paragon (1182)

Imagen del Edwin

20-05-2005, 15:10

Sean Young's document gives the standard z80 timings. For MSX, you need to add 1 T-state for every M1 cycle (for memory refresh).

Por Grauw

Ascended (10581)

Imagen del Grauw

20-05-2005, 16:27

It is documented on the MSX Assembly Page

Por Tanni

Hero (556)

Imagen del Tanni

20-05-2005, 16:33

The conditional jumps need to be distinguished if the condition fails or not. If it fails, it needs less
clock cycles than if the jump is performed. Also be carefully if you use block instructions, their execution
time depends on the size of the block moved or searched.

Por aoineko

Champion (445)

Imagen del aoineko

12-02-2022, 01:51

Do you know an online tool that automatically calculates the timing of a piece of MSX assembler code? And also, as a bonus, its size.
It's a pain to do it by hand, especially when you are testing code generated by a C compiler.

Por ARTRAG

Enlighted (6844)

Imagen del ARTRAG

12-02-2022, 05:13

This is the best
http://msx.jannone.org/bit/

Por aoineko

Champion (445)

Imagen del aoineko

12-02-2022, 10:24

Thanks, but it doesn't recognize the assembler generated by SDCC (sdasz80). :-/

Por jltursan

Prophet (2619)

Imagen del jltursan

12-02-2022, 10:44

No idea if it fully works with sdasz80; but you can try with VSCode and its plugin Z80 Assembly Meter. It has some nice tuning parameters and I'm sure theNestruo can help you to make it work :)

Por aoineko

Champion (445)

Imagen del aoineko

12-02-2022, 11:10

SDCC is listed on the description page, I guess it is supported.
Thanks, I'll give it a try.

Por Manuel

Ascended (18785)

Imagen del Manuel

12-02-2022, 11:14

What you can also do in openMSX:
- set a break point at point X
- set a break point at point Y
- when you're in point X type in the console: set timex [machine_info time]
- then run until you're in break point Y, then type: set diff [expr [machine_info time] - $timex]]
And you know how much time (in seconds) was passed between the two breakpoints.

Página 1/5
| 2 | 3 | 4 | 5