$ + 1

Thread Starter

mpuvdd

Joined Feb 11, 2007
50
HI everyone,
I'm learning C and some assembly language currently, and was told that $ + 1 would delay 2 instruction cycles instead of 1. Shouldn’t it just take 1 instruction cycle? How's that work? Also, $ does stand for PCL, right?

Thanks,
mpuvdd
 

n9352527

Joined Oct 14, 2005
1,198
It would delay by two cycles, because all jump/branch instructions require two cycles to execute. Yes, $ is the current PCL.

If you need four cycles delay, give a return instruction on any existing function a label and call that label. You get four cycles delay with only a single call instuction.
 
Top