News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_freemac

Just a s idea of project : instruction timing line per line of .asm file

Started by freemac, 20:24, 18 July 18

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

freemac


I'm currently compiling a SDCC .c file into .bin, and got a intermediat file called .asm


That's would be cool to get something adding in comment the time lengh (in NOPs) of each instruction.


Because actually, my code does look like that :

// dérapage
//;moustache.c:140: for (j=0;j<nb_vsync1[0];j++) {} // VSYNC1
// http://www.cpc-power.com/cpcarchives/index.php?page=articles&num=65
//;2 8T ld r,n ld c,#0x00
//;5 16T ld HL, (nn) ld hl, #_nb_vsync1 + 0
//;4 16T ld A, (nn) ld b,(hl)
//;1 4T ld r, r' ld a,c
//;1 4T sub r sub a, b
//;3-2 12T-8T jr NR, e jr NC,00126$
//;1 4T inc r inc c
//;3 12T jr e jr 00156$
//donc : 20-19NOPs (cpc-powa) 76us-72us (z80 pdf doc)
nb_vsync0[0]=nb_vsync0[0]-1-2;
while (get_vsync()==1) {}
vsync();
for (j=0;j<nb_vsync1[0];j++) {
// 40 NOPs FIXME set_hsyncMinus1() à chronométrer aussi par là.
__asm
NOP
NOP
NOP
NOP
NOP

NOP
NOP
NOP
NOP
NOP
//10
NOP
NOP
NOP
NOP
NOP

NOP
NOP
NOP
NOP
NOP
//20
NOP
NOP
NOP
__endasm;
} // VSYNC1

Powered by SMFPacks Menu Editor Mod