Z80 timing

ページ 1/5
| 2 | 3 | 4 | 5

By pitpan

Prophet (3153)

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!!!?

ログイン/登録して投稿

By Sonic_aka_T

Enlighted (4130)

Sonic_aka_T さんの画像

20-05-2005, 13:23

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

By Edwin

Paragon (1182)

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).

By Grauw

Ascended (10635)

Grauw さんの画像

20-05-2005, 16:27

It is documented on the MSX Assembly Page

By Tanni

Hero (556)

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.

By aoineko

Paladin (701)

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.

By ARTRAG

Enlighted (6890)

ARTRAG さんの画像

12-02-2022, 05:13

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

By aoineko

Paladin (701)

aoineko さんの画像

12-02-2022, 10:24

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

By jltursan

Prophet (2619)

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 :)

By aoineko

Paladin (701)

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.

By Manuel

Ascended (19058)

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.

ページ 1/5
| 2 | 3 | 4 | 5