I think this will do the 'wait for tick':
And, handily, leaves the start TIME in the bottom 5 bytes of the stack (which never grows big enough to overwrite it). I probably should allocate a separate 5 bytes for the start and another 5 for the end values. But 10 bytes seems a lot looking up from Beeb-land.
Code:
; Bottom of stack (scratch for TIME) ADR R1, stack_bot MOV R0, #1 ; OSWORD 1: read timer SWI &07 LDR R3, [R1] ; starting value of TIMEwait_for_tick MOV R2, R3; put previous value in R2 SWI &07 LDR R3, [R1] CMP R3, R2 BEQ wait_for_tickStatistics: Posted by acheton1984 — Thu Nov 27, 2025 1:18 pm