Quantcast
Channel: stardot.org.uk
Viewing all articles
Browse latest Browse all 5565

32-bit acorn software: other • Re: Sanity Check of TAK in ARM1 Assembler

$
0
0
I think this will do the 'wait for tick':

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_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.

Statistics: Posted by acheton1984 — Thu Nov 27, 2025 1:18 pm



Viewing all articles
Browse latest Browse all 5565

Trending Articles