measuring execution time of assembler routines

Page 1/2
| 2

By santiontanon

Paragon (1639)

santiontanon's picture

22-05-2016, 00:44

Hi all, quick question, is there a good way to measure the number of CPU ticks (M cycles or T cycles) that a given assembler routine takes to execute? (other than doing it manually Smile)

I'm playing around with some little project, and very quickly my code grew into something that cannot be run at 50 frames per second (and most likely because it's grossly inefficient, since I'm still learning Smile)

Thanks in advance!

Login or register to post comments

By ricbit

Champion (438)

ricbit's picture

22-05-2016, 01:30

The best way by far is to use TCL scripts in openmsx, this way you can have cycle-accurate measures for Z80 code.

By santiontanon

Paragon (1639)

santiontanon's picture

22-05-2016, 07:56

Thanks to both!

@ricbit: I'm new to all of this MSX assembler world, so, I'm not familiar with the tools, etc. Do you have any example of TCL script for openmsx to do something similar, so I could adapt?

@Bit Addict: thanks for the link! I might try Grauw's script (Sandy's profiler is for Windows, and thus I can't use...)

By ARTRAG

Enlighted (6845)

ARTRAG's picture

22-05-2016, 08:30

This is for small routines

http://msx.jannone.org/bit/

By ricbit

Champion (438)

ricbit's picture

22-05-2016, 13:55

@santiontanon Grauw's script is a great example of tcl script profiling

By santiontanon

Paragon (1639)

santiontanon's picture

22-05-2016, 16:29

Oh wow! that link is great ARTRAG, thanks! I'll play around with that and if I need something more powerful, then I'll go with the TCL script. Thanks a lot guys, this really helped Smile

By hit9918

Prophet (2923)

hit9918's picture

22-05-2016, 20:21

just change the color register at start and end of the code in question.
you get a real life dynamic cpu usage equalizer display.

By Metalion

Paragon (1529)

Metalion's picture

23-05-2016, 10:29

ARTRAG wrote:

This is for small routines
http://msx.jannone.org/bit/

I get an "Account Suspended" page ... :(

By ARTRAG

Enlighted (6845)

ARTRAG's picture

23-05-2016, 10:49

Strange, it was active till Friday

By Grauw

Ascended (10604)

Grauw's picture

23-05-2016, 15:30

It works for me now.

Page 1/2
| 2