.macro delay_ZL_cycles ;; 11 <= ZL <= 255
ldi ZH,high(noptab) ;; ZH = NOP table start address MSB
subi ZL,10 ;; Compensate for a macro execution time
neg ZL ;; ZL = compensated # of NOPs to execute
icall ;; Enter a calculated # of NOPs sequence
.endm
ldi ZL,11 ; Test code (try any value from 11 to 255)
delay_ZL_cycles ; Cycle counter will show 1 cycle more due to the ldi ZL line above
nop ; Test breakpoint placeholder
.org (PC & 0xFF00)+256 ; Align to a 256 code words boundary
noptab: ; Place at the end of a code segment for convenience
.dq 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ; 32 x dq 0 = 128 NOPs
.dq 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ; 32 x dq 0 = 128 NOPs
ret
[/pre}