- Top Stats

Top Posters Top Topic Starters Top Topics
AMSDOS 1288
arnoldemu 1128
TFM 1124
ervin 745
ronaldo 403
AMSDOS 55
arnoldemu 51
ervin 42
EgoTrip 35
Arnaud 33
FutureOS corner - 70696 Views TFM/FS 07:12, 01 October 10
Example Z80 as... - 66063 Views arnoldemu 10:59, 04 April 10
#CPCtelera 1.4... - 32996 Views ronaldo 13:59, 11 May 15
BASIC programm... - 30907 Views arnoldemu 16:23, 22 May 09
CHAMP Assemble... - 24974 Views Bruce Abbo... 12:59, 16 January 14


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

0 Members and 1 Guest are viewing this topic.

Offline freemac

  • CPC6128
  • ****
  • Posts: 298
  • Country: 00
  • Liked: 237

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 »