REM > Library

DEF PROCAssemble
Size% = 1024
DIM Code% Size%

FOR Pass% = %1000 TO %1010 STEP %10

P% = Code%
L% = Code% + Size%

[OPT    Pass%

.Move
STMfd   R13!, {R0-R5, R14}

MOV     R0, #21
ADR     R1, Move_Block
SWI     "OS_Word"

LDMfd   R13!, {R0-R5, PC}^

.Move_Block
EQUD    3
EQUD    0

.Move_End

.Click
STMfd   R13!, {R0-R5, R14}

SWI     "OS_IntOff"

MOV     R0, #138
MOV     R1, #9

LDRB    R2, Click_Block + 0
SWI     "OS_Byte"
LDRB    R2, Click_Block + 1
SWI     "OS_Byte"
LDRB    R2, Click_Block + 2
SWI     "OS_Byte"
LDRB    R2, Click_Block + 3
SWI     "OS_Byte"
LDRB    R2, Click_Block + 4
SWI     "OS_Byte"
MOV     R2, #0
SWI     "OS_Byte"
SWI     "OS_Byte"
SWI     "OS_Byte"
SWI     "OS_Byte"
SWI     "OS_IntOn"

LDMfd   R13!, {R0-R5, PC}^

.Click_Block
EQUD    0
EQUD    0

.Click_End
]
NEXT

ENDPROC

REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜

DEF PROCMove(s%, n%, x%, y%)
Move_Block?4 = (x% AND 255)
Move_Block?5 = (x% >> %1000)
Move_Block?6 = (y% AND 255)
Move_Block?7 = (y% >> %1000)

SYS"Econet_DoImmediate", 3, -1, s%, n%, Move, Move_End
ENDPROC

REM ˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜˜

DEF PROCClick(s%, n%, x%, y%, z%)
Click_Block?0 = (x% AND 255)
Click_Block?1 = (x% >> %1000)
Click_Block?2 = (y% AND 255)
Click_Block?3 = (y% >> %1000)
Click_Block?4 = z%

SYS"Econet_DoImmediate", 3, -1, s%, n%, Click, Click_End
ENDPROC