Author Topic: Just a s idea of project : instruction timing line per line of .asm file  (Read 143 times)

0 Members and 1 Guest are viewing this topic.

Offline freemac

  • CPC6128
  • ****
  • Posts: 296
  • Country: 00
  • Liked: 228

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 :
Code: [Select]
// 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
« Last Edit: 12:25, 19 July 18 by freemac »