Home » Archimedes archive » Micro User » MU 1991-04.adf » PD-Stuff » !Warfarin/WarfSrc

!Warfarin/WarfSrc

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Micro User » MU 1991-04.adf » PD-Stuff
Filename: !Warfarin/WarfSrc
Read OK:
File size: 3472 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM >$.!Warfarin.WarfSrc
   20REM Warfarin Module V1.10 (C) Richard K. Lloyd 1990
   30
   40REM Recommended CD:
   50REM Dire Straits "Dire Straits" (their first album)
   60REM The rawest and easily the best...
   70
   80REM Ahem, but the new RISC OS PRMs, Volume I Page 122 has a
   90REM keyscan table that, I think, has its high and low hex digits
  100REM labelled the wrong way round (e.g. Z = &4E and not &E4)
  110
  120REM Another error: Page 785 claims that CMOS RAM location 191 holds
  130REM the 'mouse multiplier'. It doesn't - location 194 does.
  140
  150REM Yet another error: Pages 132 and 138 are identical !!
  160REM Page 132 should actually be a description of OS_Byte 145...
  170
  180name$="Warfarin":v$="1.10"
  190date$="10 Sep 1990":REM MID$(TIME$,5,11) for current date
  200ver$=name$+CHR$(9)+v$+" ("+date$+")"
  210bl$=CHR$(0)
  220SVC_Mode=3:EventV=16:InsV=20:MouseV=26
  230mouseboost%=4:REM Added to *Conf. MouseStep value before multiplication
  240DIM org &2000,swi% &30
  250
  260FOR A%=0 TO 2 STEP 2
  270P%=org
  280[OPT A%
  290                EQUD    0               ; No start addr (not application)
  300                EQUD    init-org        ; Initialisation addr
  310                EQUD    byebye-org      ; Finalisation addr
  320                EQUD    servicecall-org ; Service call addr
  330                EQUD    titlestr-org    ; Title string addr
  340                EQUD    helpstr-org     ; *EDIT string addr
  350                EQUD    keywords-org    ; Help/Command keyword table addr
  360                EQUD    0               ; No extra SWIs supported...
  370                EQUD    0
  380                EQUD    0
  390                EQUD    0
  400.titlestr       EQUS    name$+bl$
  410                ALIGN
  420
  430.helpstr        EQUS    ver$+bl$
  440                ALIGN
  450
  460.keywords       EQUS    name$+bl$
  470                ALIGN
  480                EQUD    0               ; No * command
  490                EQUD    0               ; No parameters
  500                EQUD    0               ; No invalid message
  510                EQUD    warfhelp-org    ; Pointer to *Help Warfarin text
  520                EQUD    0               ; No more commands
  530
  540.warfhelp       EQUS    "The "+name$+" module allows your mouse to be controlled by the use of the Alt and cursor keys. "
  550                EQUS    "Mouse button presses can be simulated with Alt-Insert (Left), Alt-Home (Middle) and Alt-Page-Up (Right). "
  551                EQUS    "These default keys can be easily changed via "+name$+"$* variables."+bl$
  560                ALIGN
  570
  580.trapevents
  590; On entry,     R0      = 13 to disable, 14 to enable
  600                STMFD   R13!,{R1,R2,R14}
  610                MOV     R1,#2           ; Character inserted in buffer
  620                SWI     "XOS_Byte"
  630                MOV     R1,#4           ; Screen refresh
  640                SWI     "XOS_Byte"
  650                MOV     R1,#11          ; Key up/down
  660                SWI     "XOS_Byte"
  670                LDMFD   R13!,{R1,R2,PC}
  680
  690.translatevar
  700; On entry,     R0      = Pointer to variable name
  710;               R1      = Default value if undefined
  720; On exit,      R0      = Value returned
  730                STMFD   R13!,{R1-R5,R14}
  740                MOV     R5,R1
  750                ADR     R1,valueread    ; Return buffer
  760                MOV     R2,#4           ; Buffer size
  770                MOV     R3,#0           ; First and only call
  780                MOV     R4,#0           ; No translation
  790                SWI     "XOS_ReadVarVal"
  800                LDRB    R0,valueread
  810                MOVVS   R0,R5           ; Failed call
  820                CMP     R4,#1
  830                MOVNE   R0,R5           ; Not a number
  840                LDMFD   R13!,{R1-R5,PC}
  850.valueread      EQUD    0
  860
  870.init           STMFD   R13!,{R0-R2,R14}
  880                MOV     R0,#EventV
  890                ADR     R1,eventtrap
  900                MOV     R2,#0
  910                STR     R2,altkeystatus ; All special keys not pressed
  920                STR     R2,altkeystatus+4
  930                SWI     "XOS_Claim"
  940                MOV     R0,#InsV
  950                ADR     R1,inserttrap
  960                MOV     R2,#0
  970                SWI     "XOS_Claim"
  980                MOV     R0,#MouseV
  990                ADR     R1,mousetrap
 1000                MOV     R2,#0
 1010                SWI     "XOS_Claim"
 1020                MOV     R0,#14
 1030                BL      trapevents      ; Enable claimed events
 1040                MOV     R0,#161
 1050                MOV     R1,#194
 1060                SWI     "XOS_Byte"      ; Read Mouse step setting
 1070                ADD     R2,R2,#mouseboost%      ; Boost it
 1080                STRB    R2,mousespeed
 1090                ADR     R0,fake1name
 1100                MOV     R1,#&5E ; Modifier 1    -> &5E -> Left Alt
 1110                BL      translatevar
 1120                STRB    R0,fake1val
 1130                ADR     R0,fake2name
 1140                MOV     R1,#&60 ; Modifier 2    -> &60 -> Right Alt
 1150                BL      translatevar
 1160                STRB    R0,fake2val
 1170                ADR     R0,leftmousename
 1180                MOV     R1,#&1F ; Left   button -> &1F -> Insert
 1190                BL      translatevar
 1200                STRB    R0,leftmouseval
 1210                ADR     R0,midmousename
 1220                MOV     R1,#&20 ; Middle button -> &20 -> Home
 1230                BL      translatevar
 1240                STRB    R0,midmouseval
 1250                ADR     R0,rightmousename
 1260                MOV     R1,#&21 ; Right  button -> &21 -> Page Up
 1270                BL      translatevar
 1280                STRB    R0,rightmouseval
 1290                LDMFD   R13!,{R0-R2,PC}
 1300.fake1name      EQUS    name$+"$Fake1"+bl$
 1310.fake2name      EQUS    name$+"$Fake2"+bl$
 1320.leftmousename  EQUS    name$+"$Left"+bl$
 1330.midmousename   EQUS    name$+"$Middle"+bl$
 1340.rightmousename EQUS    name$+"$Right"+bl$
 1350                ALIGN
 1360
 1370.servicecall
 1380; On entry,     R1      = Service call number
 1390                STMFD   R13!,{R14}
 1400                CMP     R1,#&27         ; End of machine reset
 1410                BLEQ    init            ; Reactivate Warfarin
 1420                LDMFD   R13!,{PC}
 1430
 1440.eventtrap
 1450; On entry,     R0      = Event number (11 for key up/down)
 1460                STMFD   R13!,{R0-R5,R14}
 1470                CMP     R0,#11  ; Was it key up/down ?
 1480                BNE     notkeyupdown
 1490; When R0 = 11, R1      = 0 for key up, 1 for key down
 1500;               R2      = Internal key code (Page 122)
 1510                LDRB    R3,fake1val
 1520                CMP     R2,R3 ; Was it modifier 1 ?
 1530                LDRNEB  R3,fake2val
 1540                CMPNE   R2,R3 ; Was it modifier 2 ?
 1550                BNE     checktherest
 1560                MOVS    R1,R1           ; If Alt released, then
 1570                STRNEB  R1,altkeystatus ; no movement/buttons anymore
 1580                STREQ   R1,altkeystatus
 1590                STREQ   R1,altkeystatus+4
 1600                B       noevent
 1610.checktherest   CMP     R2,#&62 ; Was it Left Arrow ?
 1620                STREQB  R1,leftstatus
 1630                BEQ     noevent
 1640                CMP     R2,#&64 ; Was it Right Arrow ?
 1650                STREQB  R1,rightstatus
 1660                BEQ     noevent
 1670                CMP     R2,#&59 ; Was it Up Arrow ?
 1680                STREQB  R1,upstatus
 1690                BEQ     noevent
 1700                CMP     R2,#&63 ; Was it Down Arrow ?
 1710                STREQB  R1,downstatus
 1720                BEQ     noevent
 1730                LDRB    R3,leftmouseval
 1740                CMP     R2,R3 ; Was it Left Button Fake ?
 1750                STREQB  R1,lmbstatus
 1760                BEQ     noevent
 1770                LDRB    R3,midmouseval
 1780                CMP     R2,R3 ; Was it Middle Button Fake ?
 1790                STREQB  R1,mmbstatus
 1800                BEQ     noevent
 1810                LDRB    R3,rightmouseval
 1820                CMP     R2,R3 ; Was it Right Button Fake ?
 1830                STREQB  R1,rmbstatus
 1840                B       noevent
 1850.notkeyupdown   CMP     R0,#4   ; Was it screen refresh ?
 1860                BNE     noevent
 1870                LDRB    R0,altkeystatus ; Alt key must be down
 1880                MOVS    R0,R0
 1890                BEQ     noevent
 1900                LDRB    R2,mousespeed
 1910                LDRB    R0,leftstatus
 1920                LDRB    R1,rightstatus
 1930                SUB     R1,R1,R0
 1940                MUL     R4,R1,R2        ; Find X change
 1950                LDRB    R0,upstatus
 1960                LDRB    R1,downstatus
 1970                SUB     R0,R0,R1
 1980                MULS    R5,R0,R2        ; Find Y change
 1990                MOVEQS  R4,R4           ; If both zero, no mouse move
 2000                BEQ     noevent
 2010                FNswi   ("OS_Mouse")
 2020                ADD     R0,R0,R4
 2030                ADD     R2,R1,R5
 2040                ADR     R1,oswordblock
 2050                STRB    R0,[R1,#1]      ; Store new mouse X in block
 2060                MOV     R0,R0,LSR #8
 2070                STRB    R0,[R1,#2]
 2080                STRB    R2,[R1,#3]      ; Store new mouse Y in block
 2090                MOV     R2,R2,LSR #8
 2100                STRB    R2,[R1,#4]
 2110                MOV     R0,#21
 2120                FNswi   ("OS_Word")     ; Set mouse position
 2130.noevent        LDMFD   R13!,{R0-R5,PC}
 2140.oswordblock    EQUS    CHR$(3)+STRING$(7,bl$)
 2150
 2160.mousetrap
 2170; On entry,     R0,R1   = Mouse X,Y
 2180;               R2      = Mouse buttons
 2190;               R3      = Time stamp
 2200; On exit,      R2      = Possibly faked (depending on Alt) mouse buttons
 2210; OK, I admit it, this was copied verbatim from Page 82/83 of the new
 2220; PRMs...
 2230                STMFD   R13!,{R3,R10-R12,R14}
 2240                STMFD   R13!,{PC}
 2250                ADD     R12,R13,#8
 2260                LDMIA   R12,{R10-R12,PC}
 2270                LDR     R12,[R13,#12]
 2280                STMFD   R13!,{R3}
 2290                LDRB    R3,altkeystatus ; Is Alt key down ?
 2300                MOVS    R3,R3
 2310                BEQ     normalmouse
 2320                LDRB    R3,rmbstatus    ; Yes, so 'fake' mouse buttons
 2330                ORR     R2,R2,R3
 2340                LDRB    R3,mmbstatus
 2350                ORR     R2,R2,R3,ASL #1
 2360                LDRB    R3,lmbstatus
 2370                ORR     R2,R2,R3,ASL #2
 2380.normalmouse    LDMFD   R13!,{R3}
 2390                LDMFD   R13!,{R3,R10-R12,R14,PC}
 2400
 2410.inserttrap
 2420; On entry,     R0      = Byte to be inserted
 2430;               R1      = Buffer number
 2440; Note - cursor keys are 140-143 decimal when entering this routine !
 2450                STMFD   R13!,{R0-R3,R14}
 2460                MOVS    R1,R1           ; Is it the keyboard buffer ?
 2470                BNE     notkeybuff
 2480                LDRB    R1,altkeystatus ; Alt key down ?
 2490                MOVS    R1,R1
 2500                BEQ     notkeybuff
 2510                CMP     R0,#143 ; Is it in cursor key range ?
 2520                BGT     notkeybuff
 2530                CMP     R0,#140 ; Yes, so claim this call
 2540                LDMGEFD R13!,{R0-R3,R14,PC}
 2550.notkeybuff     LDMFD   R13!,{R0-R3,PC}
 2560
 2570.byebye         STMFD   R13!,{R0-R2,R14}
 2580                MOV     R0,#13          ; Disable claimed events
 2590                BL      trapevents
 2600                MOV     R0,#EventV
 2610                ADR     R1,eventtrap
 2620                MOV     R2,#0
 2630                SWI     "XOS_Release"
 2640                MOV     R0,#InsV
 2650                ADR     R1,inserttrap
 2660                MOV     R2,#0
 2670                SWI     "XOS_Release"
 2680                MOV     R0,#MouseV
 2690                ADR     R1,mousetrap
 2700                MOV     R2,#0
 2710                SWI     "XOS_Release"
 2720                LDMFD   R13!,{R0-R2,PC}
 2730
 2740.OS_Call
 2750; On entry,     R0-R2   = SWI call params
 2760;               R3      = SWI Number (not X form)
 2770                STMFD   R13!,{R4,R5,R14}
 2780                LDR     R5,SWIInstr
 2790                BIC     R5,R5,#&FF
 2800                ORR     R5,R5,R3
 2810                STR     R5,SWIInstr     ; Naughty ! Self-modifying code !
 2820                MOV     R4,PC
 2830                ORR     R5,R4,#SVC_Mode
 2840                TEQP    R5,#0
 2850                MOVNV   R0,R0
 2860                STMFD   R13!,{R14}
 2870.SWIInstr       SWI     "XOS_WriteC"
 2880                LDMFD   R13!,{R14}
 2890                TEQP    R4,#0
 2900                MOVNV   R0,R0
 2910                LDMFD   R13!,{R4,R5,PC}
 2920
 2930.altkeystatus   EQUB    0
 2940.leftstatus     EQUB    0
 2950.rightstatus    EQUB    0
 2960.upstatus       EQUB    0
 2970.downstatus     EQUB    0
 2980.lmbstatus      EQUB    0
 2990.mmbstatus      EQUB    0
 3000.rmbstatus      EQUB    0
 3010.mousespeed     EQUB    0
 3020.fake1val       EQUB    0
 3030.fake2val       EQUB    0
 3040.leftmouseval   EQUB    0
 3050.midmouseval    EQUB    0
 3060.rightmouseval  EQUB    0
 3070                ALIGN
 3080]NEXT
 3090F$="$.!"+name$+"."+name$+" "
 3100OSCLI"S."+F$+STR$~org+" "+STR$~P%
 3110OSCLI"SetType "+F$+"Module"
 3120*Pointer 1
 3121OSCLI"$.!"+name$
 3150END
 3160
 3200DEFFNswi(swi$)
 3210REM Neat little macro or what ?
 3220LOCAL B%
 3230$swi%=swi$:SYS "OS_SWINumberFromString",,swi% TO B%
 3240[OPT A%
 3250                MOV     R3,#B%
 3260                BL      OS_Call
 3270]=A%

� >$.!Warfarin.WarfSrc
5� Warfarin Module V1.10 (C) Richard K. Lloyd 1990

(� Recommended CD:
25� Dire Straits "Dire Straits" (their first album)
<'� The rawest and easily the best...
F
P=� Ahem, but the new RISC OS PRMs, Volume I Page 122 has a
ZB� keyscan table that, I think, has its high and low hex digits
d=� labelled the wrong way round (e.g. Z = &4E and not &E4)
n
xE� Another error: Page 785 claims that CMOS RAM location 191 holds
�=� the 'mouse multiplier'. It doesn't - location 194 does.
�
�;� Yet another error: Pages 132 and 138 are identical !!
�A� Page 132 should actually be a description of OS_Byte 145...
�
�name$="Warfarin":v$="1.10"
�;date$="10 Sep 1990":� MID$(TIME$,5,11) for current date
�%ver$=name$+�(9)+v$+" ("+date$+")"
�bl$=�(0)
�*SVC_Mode=3:EventV=16:InsV=20:MouseV=26
�Imouseboost%=4:� Added to *Conf. MouseStep value before multiplication
�� org &2000,swi% &30
�
� A%=0 � 2 � 2

P%=org
[OPT A%
"M                EQUD    0               ; No start addr (not application)
,A                EQUD    init-org        ; Initialisation addr
6?                EQUD    byebye-org      ; Finalisation addr
@?                EQUD    servicecall-org ; Service call addr
J?                EQUD    titlestr-org    ; Title string addr
T=                EQUD    helpstr-org     ; *ǒ string addr
^M                EQUD    keywords-org    ; Help/Command keyword table addr
hH                EQUD    0               ; No extra SWIs supported...
r                EQUD    0
|                EQUD    0
�                EQUD    0
�%.titlestr       EQUS    name$+bl$
�                ALIGN
�
�$.helpstr        EQUS    ver$+bl$
�                ALIGN
�
�%.keywords       EQUS    name$+bl$
�                ALIGN
�:                EQUD    0               ; No * command
�;                EQUD    0               ; No parameters
�@                EQUD    0               ; No invalid message
�L                EQUD    warfhelp-org    ; Pointer to *Help Warfarin text
>                EQUD    0               ; No more commands

}.warfhelp       EQUS    "The "+name$+" module allows your mouse to be controlled by the use of the Alt and cursor keys. "
&�                EQUS    "Mouse button presses can be simulated with Alt-Insert (Left), Alt-Home (Middle) and Alt-Page-Up (Right). "
'e                EQUS    "These default keys can be easily changed via "+name$+"$* variables."+bl$
0                ALIGN
:
D.trapevents
N9; On entry,     R0      = 13 to disable, 14 to enable
X,                STMFD   R13!,{R1,R2,R14}
bJ                MOV     R1,#2           ; Character inserted in buffer
l&                SWI     "XOS_Byte"
v<                MOV     R1,#4           ; Screen refresh
�&                SWI     "XOS_Byte"
�9                MOV     R1,#11          ; Key up/down
�&                SWI     "XOS_Byte"
�+                LDMFD   R13!,{R1,R2,PC}
�
�.translatevar
�6; On entry,     R0      = Pointer to variable name
�8;               R1      = Default value if undefined
�,; On exit,      R0      = Value returned
�,                STMFD   R13!,{R1-R5,R14}
�!                MOV     R5,R1
�;                ADR     R1,valueread    ; Return buffer
�9                MOV     R2,#4           ; Buffer size
A                MOV     R3,#0           ; First and only call
<                MOV     R4,#0           ; No translation
,                SWI     "XOS_ReadVarVal"
 (                LDRB    R0,valueread
*9                MOVVS   R0,R5           ; Failed call
4!                CMP     R4,#1
>:                MOVNE   R0,R5           ; Not a number
H+                LDMFD   R13!,{R1-R5,PC}
R.valueread      EQUD    0
\
f,.init           STMFD   R13!,{R0-R2,R14}
p&                MOV     R0,#EventV
z(                ADR     R1,eventtrap
�!                MOV     R2,#0
�J                STR     R2,altkeystatus ; All special keys not pressed
�-                STR     R2,altkeystatus+4
�'                SWI     "XOS_Claim"
�$                MOV     R0,#InsV
�)                ADR     R1,inserttrap
�!                MOV     R2,#0
�'                SWI     "XOS_Claim"
�&                MOV     R0,#MouseV
�(                ADR     R1,mousetrap
�!                MOV     R2,#0
�'                SWI     "XOS_Claim"
�"                MOV     R0,#14
C                BL      trapevents      ; Enable claimed events
#                MOV     R0,#161
#                MOV     R1,#194
$E                SWI     "XOS_Byte"      ; Read Mouse step setting
.>                ADD     R2,R2,#mouseboost%      ; Boost it
8)                STRB    R2,mousespeed
B(                ADR     R0,fake1name
LF                MOV     R1,#&5E ; Modifier 1    -> &5E -> Left Alt
V(                BL      translatevar
`'                STRB    R0,fake1val
j(                ADR     R0,fake2name
tG                MOV     R1,#&60 ; Modifier 2    -> &60 -> Right Alt
~(                BL      translatevar
�'                STRB    R0,fake2val
�,                ADR     R0,leftmousename
�D                MOV     R1,#&1F ; Left   button -> &1F -> Insert
�(                BL      translatevar
�+                STRB    R0,leftmouseval
�+                ADR     R0,midmousename
�B                MOV     R1,#&20 ; Middle button -> &20 -> Home
�(                BL      translatevar
�*                STRB    R0,midmouseval
�-                ADR     R0,rightmousename
�E                MOV     R1,#&21 ; Right  button -> &21 -> Page Up
�(                BL      translatevar
,                STRB    R0,rightmouseval

+                LDMFD   R13!,{R0-R2,PC}
..fake1name      EQUS    name$+"$Fake1"+bl$
..fake2name      EQUS    name$+"$Fake2"+bl$
(-.leftmousename  EQUS    name$+"$Left"+bl$
2/.midmousename   EQUS    name$+"$Middle"+bl$
<..rightmousename EQUS    name$+"$Right"+bl$
F                ALIGN
P
Z.servicecall
d1; On entry,     R1      = Service call number
n&                STMFD   R13!,{R14}
xB                CMP     R1,#&27         ; End of machine reset
�A                BLEQ    init            ; Reactivate Warfarin
�%                LDMFD   R13!,{PC}
�
�.eventtrap
�?; On entry,     R0      = Event number (11 for key up/down)
�,                STMFD   R13!,{R0-R5,R14}
�:                CMP     R0,#11  ; Was it key up/down ?
�(                BNE     notkeyupdown
�:; When R0 = 11, R1      = 0 for key up, 1 for key down
�:;               R2      = Internal key code (Page 122)
�'                LDRB    R3,fake1val
�7                CMP     R2,R3 ; Was it modifier 1 ?
�'                LDRNEB  R3,fake2val
7                CMPNE   R2,R3 ; Was it modifier 2 ?
(                BNE     checktherest
C                MOVS    R1,R1           ; If Alt released, then
"I                STRNEB  R1,altkeystatus ; no movement/buttons anymore
,+                STREQ   R1,altkeystatus
6-                STREQ   R1,altkeystatus+4
@#                B       noevent
J9.checktherest   CMP     R2,#&62 ; Was it Left Arrow ?
T)                STREQB  R1,leftstatus
^#                BEQ     noevent
h:                CMP     R2,#&64 ; Was it Right Arrow ?
r*                STREQB  R1,rightstatus
|#                BEQ     noevent
�7                CMP     R2,#&59 ; Was it Up Arrow ?
�'                STREQB  R1,upstatus
�#                BEQ     noevent
�9                CMP     R2,#&63 ; Was it Down Arrow ?
�)                STREQB  R1,downstatus
�#                BEQ     noevent
�+                LDRB    R3,leftmouseval
�=                CMP     R2,R3 ; Was it Left Button Fake ?
�(                STREQB  R1,lmbstatus
�#                BEQ     noevent
�*                LDRB    R3,midmouseval
�?                CMP     R2,R3 ; Was it Middle Button Fake ?
�(                STREQB  R1,mmbstatus
#                BEQ     noevent
,                LDRB    R3,rightmouseval
>                CMP     R2,R3 ; Was it Right Button Fake ?
&(                STREQB  R1,rmbstatus
0#                B       noevent
:=.notkeyupdown   CMP     R0,#4   ; Was it screen refresh ?
D#                BNE     noevent
NB                LDRB    R0,altkeystatus ; Alt key must be down
X!                MOVS    R0,R0
b#                BEQ     noevent
l)                LDRB    R2,mousespeed
v)                LDRB    R0,leftstatus
�*                LDRB    R1,rightstatus
�$                SUB     R1,R1,R0
�;                MUL     R4,R1,R2        ; Find X change
�'                LDRB    R0,upstatus
�)                LDRB    R1,downstatus
�$                SUB     R0,R0,R1
�;                MULS    R5,R0,R2        ; Find Y change
�F                �QS  R4,R4           ; If both zero, no mouse move
�#                BEQ     noevent
�'                �swi   ("OS_Mouse")
�$                ADD     R0,R0,R4
�$                ADD     R2,R1,R5
�*                ADR     R1,oswordblock
H                STRB    R0,[R1,#1]      ; Store new mouse X in block
(                MOV     R0,R0,LSR #8
&                STRB    R0,[R1,#2]
 H                STRB    R2,[R1,#3]      ; Store new mouse Y in block
*(                MOV     R2,R2,LSR #8
4&                STRB    R2,[R1,#4]
>"                MOV     R0,#21
H?                �swi   ("OS_Word")     ; Set mouse position
R+.noevent        LDMFD   R13!,{R0-R5,PC}
\(.oswordblock    EQUS    �(3)+�7,bl$)
f
p.mousetrap
z'; On entry,     R0,R1   = Mouse X,Y
�+;               R2      = Mouse buttons
�(;               R3      = Time stamp
�M; On exit,      R2      = Possibly faked (depending on Alt) mouse buttons
�I; OK, I admit it, this was copied verbatim from Page 82/83 of the new
�
; PRMs...
�1                STMFD   R13!,{R3,R10-R12,R14}
�%                STMFD   R13!,{PC}
�&                ADD     R12,R13,#8
�,                LDMIA   R12,{R10-R12,PC}
�)                LDR     R12,[R13,#12]
�%                STMFD   R13!,{R3}
�?                LDRB    R3,altkeystatus ; Is Alt key down ?
�!                MOVS    R3,R3
	'                BEQ     normalmouse
	J                LDRB    R3,rmbstatus    ; Yes, so 'fake' mouse buttons
	#                �R     R2,R2,R3
	$(                LDRB    R3,mmbstatus
	.*                �R     R2,R2,R3,ASL #1
	8(                LDRB    R3,lmbstatus
	B*                �R     R2,R2,R3,ASL #2
	L%.normalmouse    LDMFD   R13!,{R3}
	V4                LDMFD   R13!,{R3,R10-R12,R14,PC}
	`
	j.inserttrap
	t1; On entry,     R0      = Byte to be inserted
	~+;               R1      = Buffer number
	�I; Note - cursor keys are 140-143 decimal when entering this routine !
	�,                STMFD   R13!,{R0-R3,R14}
	�I                MOVS    R1,R1           ; Is it the keyboard buffer ?
	�&                BNE     notkeybuff
	�<                LDRB    R1,altkeystatus ; Alt key down ?
	�!                MOVS    R1,R1
	�&                BEQ     notkeybuff
	�A                CMP     R0,#143 ; Is it in cursor key range ?
	�&                BGT     notkeybuff
	�=                CMP     R0,#140 ; Yes, so claim this call
	�/                LDMGEFD R13!,{R0-R3,R14,PC}
	�+.notkeybuff     LDMFD   R13!,{R0-R3,PC}


,.byebye         STMFD   R13!,{R0-R2,R14}
D                MOV     R0,#13          ; Disable claimed events
&                BL      trapevents
(&                MOV     R0,#EventV
2(                ADR     R1,eventtrap
<!                MOV     R2,#0
F)                SWI     "XOS_Release"
P$                MOV     R0,#InsV
Z)                ADR     R1,inserttrap
d!                MOV     R2,#0
n)                SWI     "XOS_Release"
x&                MOV     R0,#MouseV
�(                ADR     R1,mousetrap
�!                MOV     R2,#0
�)                SWI     "XOS_Release"
�+                LDMFD   R13!,{R0-R2,PC}
�
�.OS_Call
�-; On entry,     R0-R2   = SWI call params
�5;               R3      = SWI Number (not X form)
�,                STMFD   R13!,{R4,R5,R14}
�'                LDR     R5,SWIInstr
�&                BIC     R5,R5,#&FF
�#                �R     R5,R5,R3
�M                STR     R5,SWIInstr     ; Naughty ! Self-modifying code !
!                MOV     R4,PC
*                �R     R5,R4,#SVC_Mode
!                TEQP    R5,#0
"!                MOVNV   R0,R0
,&                STMFD   R13!,{R14}
6(.SWIInstr       SWI     "XOS_WriteC"
@&                LDMFD   R13!,{R14}
J!                TEQP    R4,#0
T!                MOVNV   R0,R0
^+                LDMFD   R13!,{R4,R5,PC}
h
r.altkeystatus   EQUB    0
|.leftstatus     EQUB    0
�.rightstatus    EQUB    0
�.upstatus       EQUB    0
�.downstatus     EQUB    0
�.lmbstatus      EQUB    0
�.mmbstatus      EQUB    0
�.rmbstatus      EQUB    0
�.mousespeed     EQUB    0
�.fake1val       EQUB    0
�.fake2val       EQUB    0
�.leftmouseval   EQUB    0
�.midmouseval    EQUB    0
�.rightmouseval  EQUB    0
�                ALIGN
]�
 F$="$.!"+name$+"."+name$+" "
�"S."+F$+�~org+" "+�~P%
&�"SetType "+F$+"Module"
0*Pointer 1
1�"$.!"+name$
N�
X
�ݤswi(swi$)
�!� Neat little macro or what ?
�� B%
�5$swi%=swi$:ș "OS_SWINumberFromString",,swi% � B%
�[OPT A%
�"                MOV     R3,#B%
�#                BL      OS_Call
�]=A%
�
00000000  0d 00 0a 1a f4 20 3e 24  2e 21 57 61 72 66 61 72  |..... >$.!Warfar|
00000010  69 6e 2e 57 61 72 66 53  72 63 0d 00 14 35 f4 20  |in.WarfSrc...5. |
00000020  57 61 72 66 61 72 69 6e  20 4d 6f 64 75 6c 65 20  |Warfarin Module |
00000030  56 31 2e 31 30 20 28 43  29 20 52 69 63 68 61 72  |V1.10 (C) Richar|
00000040  64 20 4b 2e 20 4c 6c 6f  79 64 20 31 39 39 30 0d  |d K. Lloyd 1990.|
00000050  00 1e 04 0d 00 28 15 f4  20 52 65 63 6f 6d 6d 65  |.....(.. Recomme|
00000060  6e 64 65 64 20 43 44 3a  0d 00 32 35 f4 20 44 69  |nded CD:..25. Di|
00000070  72 65 20 53 74 72 61 69  74 73 20 22 44 69 72 65  |re Straits "Dire|
00000080  20 53 74 72 61 69 74 73  22 20 28 74 68 65 69 72  | Straits" (their|
00000090  20 66 69 72 73 74 20 61  6c 62 75 6d 29 0d 00 3c  | first album)..<|
000000a0  27 f4 20 54 68 65 20 72  61 77 65 73 74 20 61 6e  |'. The rawest an|
000000b0  64 20 65 61 73 69 6c 79  20 74 68 65 20 62 65 73  |d easily the bes|
000000c0  74 2e 2e 2e 0d 00 46 04  0d 00 50 3d f4 20 41 68  |t.....F...P=. Ah|
000000d0  65 6d 2c 20 62 75 74 20  74 68 65 20 6e 65 77 20  |em, but the new |
000000e0  52 49 53 43 20 4f 53 20  50 52 4d 73 2c 20 56 6f  |RISC OS PRMs, Vo|
000000f0  6c 75 6d 65 20 49 20 50  61 67 65 20 31 32 32 20  |lume I Page 122 |
00000100  68 61 73 20 61 0d 00 5a  42 f4 20 6b 65 79 73 63  |has a..ZB. keysc|
00000110  61 6e 20 74 61 62 6c 65  20 74 68 61 74 2c 20 49  |an table that, I|
00000120  20 74 68 69 6e 6b 2c 20  68 61 73 20 69 74 73 20  | think, has its |
00000130  68 69 67 68 20 61 6e 64  20 6c 6f 77 20 68 65 78  |high and low hex|
00000140  20 64 69 67 69 74 73 0d  00 64 3d f4 20 6c 61 62  | digits..d=. lab|
00000150  65 6c 6c 65 64 20 74 68  65 20 77 72 6f 6e 67 20  |elled the wrong |
00000160  77 61 79 20 72 6f 75 6e  64 20 28 65 2e 67 2e 20  |way round (e.g. |
00000170  5a 20 3d 20 26 34 45 20  61 6e 64 20 6e 6f 74 20  |Z = &4E and not |
00000180  26 45 34 29 0d 00 6e 04  0d 00 78 45 f4 20 41 6e  |&E4)..n...xE. An|
00000190  6f 74 68 65 72 20 65 72  72 6f 72 3a 20 50 61 67  |other error: Pag|
000001a0  65 20 37 38 35 20 63 6c  61 69 6d 73 20 74 68 61  |e 785 claims tha|
000001b0  74 20 43 4d 4f 53 20 52  41 4d 20 6c 6f 63 61 74  |t CMOS RAM locat|
000001c0  69 6f 6e 20 31 39 31 20  68 6f 6c 64 73 0d 00 82  |ion 191 holds...|
000001d0  3d f4 20 74 68 65 20 27  6d 6f 75 73 65 20 6d 75  |=. the 'mouse mu|
000001e0  6c 74 69 70 6c 69 65 72  27 2e 20 49 74 20 64 6f  |ltiplier'. It do|
000001f0  65 73 6e 27 74 20 2d 20  6c 6f 63 61 74 69 6f 6e  |esn't - location|
00000200  20 31 39 34 20 64 6f 65  73 2e 0d 00 8c 04 0d 00  | 194 does.......|
00000210  96 3b f4 20 59 65 74 20  61 6e 6f 74 68 65 72 20  |.;. Yet another |
00000220  65 72 72 6f 72 3a 20 50  61 67 65 73 20 31 33 32  |error: Pages 132|
00000230  20 61 6e 64 20 31 33 38  20 61 72 65 20 69 64 65  | and 138 are ide|
00000240  6e 74 69 63 61 6c 20 21  21 0d 00 a0 41 f4 20 50  |ntical !!...A. P|
00000250  61 67 65 20 31 33 32 20  73 68 6f 75 6c 64 20 61  |age 132 should a|
00000260  63 74 75 61 6c 6c 79 20  62 65 20 61 20 64 65 73  |ctually be a des|
00000270  63 72 69 70 74 69 6f 6e  20 6f 66 20 4f 53 5f 42  |cription of OS_B|
00000280  79 74 65 20 31 34 35 2e  2e 2e 0d 00 aa 04 0d 00  |yte 145.........|
00000290  b4 1e 6e 61 6d 65 24 3d  22 57 61 72 66 61 72 69  |..name$="Warfari|
000002a0  6e 22 3a 76 24 3d 22 31  2e 31 30 22 0d 00 be 3b  |n":v$="1.10"...;|
000002b0  64 61 74 65 24 3d 22 31  30 20 53 65 70 20 31 39  |date$="10 Sep 19|
000002c0  39 30 22 3a f4 20 4d 49  44 24 28 54 49 4d 45 24  |90":. MID$(TIME$|
000002d0  2c 35 2c 31 31 29 20 66  6f 72 20 63 75 72 72 65  |,5,11) for curre|
000002e0  6e 74 20 64 61 74 65 0d  00 c8 25 76 65 72 24 3d  |nt date...%ver$=|
000002f0  6e 61 6d 65 24 2b bd 28  39 29 2b 76 24 2b 22 20  |name$+.(9)+v$+" |
00000300  28 22 2b 64 61 74 65 24  2b 22 29 22 0d 00 d2 0c  |("+date$+")"....|
00000310  62 6c 24 3d bd 28 30 29  0d 00 dc 2a 53 56 43 5f  |bl$=.(0)...*SVC_|
00000320  4d 6f 64 65 3d 33 3a 45  76 65 6e 74 56 3d 31 36  |Mode=3:EventV=16|
00000330  3a 49 6e 73 56 3d 32 30  3a 4d 6f 75 73 65 56 3d  |:InsV=20:MouseV=|
00000340  32 36 0d 00 e6 49 6d 6f  75 73 65 62 6f 6f 73 74  |26...Imouseboost|
00000350  25 3d 34 3a f4 20 41 64  64 65 64 20 74 6f 20 2a  |%=4:. Added to *|
00000360  43 6f 6e 66 2e 20 4d 6f  75 73 65 53 74 65 70 20  |Conf. MouseStep |
00000370  76 61 6c 75 65 20 62 65  66 6f 72 65 20 6d 75 6c  |value before mul|
00000380  74 69 70 6c 69 63 61 74  69 6f 6e 0d 00 f0 18 de  |tiplication.....|
00000390  20 6f 72 67 20 26 32 30  30 30 2c 73 77 69 25 20  | org &2000,swi% |
000003a0  26 33 30 0d 00 fa 04 0d  01 04 12 e3 20 41 25 3d  |&30......... A%=|
000003b0  30 20 b8 20 32 20 88 20  32 0d 01 0e 0a 50 25 3d  |0 . 2 . 2....P%=|
000003c0  6f 72 67 0d 01 18 0b 5b  4f 50 54 20 41 25 0d 01  |org....[OPT A%..|
000003d0  22 4d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |"M              |
000003e0  20 20 45 51 55 44 20 20  20 20 30 20 20 20 20 20  |  EQUD    0     |
000003f0  20 20 20 20 20 20 20 20  20 20 3b 20 4e 6f 20 73  |          ; No s|
00000400  74 61 72 74 20 61 64 64  72 20 28 6e 6f 74 20 61  |tart addr (not a|
00000410  70 70 6c 69 63 61 74 69  6f 6e 29 0d 01 2c 41 20  |pplication)..,A |
00000420  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 45  |               E|
00000430  51 55 44 20 20 20 20 69  6e 69 74 2d 6f 72 67 20  |QUD    init-org |
00000440  20 20 20 20 20 20 20 3b  20 49 6e 69 74 69 61 6c  |       ; Initial|
00000450  69 73 61 74 69 6f 6e 20  61 64 64 72 0d 01 36 3f  |isation addr..6?|
00000460  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000470  45 51 55 44 20 20 20 20  62 79 65 62 79 65 2d 6f  |EQUD    byebye-o|
00000480  72 67 20 20 20 20 20 20  3b 20 46 69 6e 61 6c 69  |rg      ; Finali|
00000490  73 61 74 69 6f 6e 20 61  64 64 72 0d 01 40 3f 20  |sation addr..@? |
000004a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 45  |               E|
000004b0  51 55 44 20 20 20 20 73  65 72 76 69 63 65 63 61  |QUD    serviceca|
000004c0  6c 6c 2d 6f 72 67 20 3b  20 53 65 72 76 69 63 65  |ll-org ; Service|
000004d0  20 63 61 6c 6c 20 61 64  64 72 0d 01 4a 3f 20 20  | call addr..J?  |
000004e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 45 51  |              EQ|
000004f0  55 44 20 20 20 20 74 69  74 6c 65 73 74 72 2d 6f  |UD    titlestr-o|
00000500  72 67 20 20 20 20 3b 20  54 69 74 6c 65 20 73 74  |rg    ; Title st|
00000510  72 69 6e 67 20 61 64 64  72 0d 01 54 3d 20 20 20  |ring addr..T=   |
00000520  20 20 20 20 20 20 20 20  20 20 20 20 20 45 51 55  |             EQU|
00000530  44 20 20 20 20 68 65 6c  70 73 74 72 2d 6f 72 67  |D    helpstr-org|
00000540  20 20 20 20 20 3b 20 2a  c7 92 20 73 74 72 69 6e  |     ; *.. strin|
00000550  67 20 61 64 64 72 0d 01  5e 4d 20 20 20 20 20 20  |g addr..^M      |
00000560  20 20 20 20 20 20 20 20  20 20 45 51 55 44 20 20  |          EQUD  |
00000570  20 20 6b 65 79 77 6f 72  64 73 2d 6f 72 67 20 20  |  keywords-org  |
00000580  20 20 3b 20 48 65 6c 70  2f 43 6f 6d 6d 61 6e 64  |  ; Help/Command|
00000590  20 6b 65 79 77 6f 72 64  20 74 61 62 6c 65 20 61  | keyword table a|
000005a0  64 64 72 0d 01 68 48 20  20 20 20 20 20 20 20 20  |ddr..hH         |
000005b0  20 20 20 20 20 20 20 45  51 55 44 20 20 20 20 30  |       EQUD    0|
000005c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
000005d0  20 4e 6f 20 65 78 74 72  61 20 53 57 49 73 20 73  | No extra SWIs s|
000005e0  75 70 70 6f 72 74 65 64  2e 2e 2e 0d 01 72 1d 20  |upported.....r. |
000005f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 45  |               E|
00000600  51 55 44 20 20 20 20 30  0d 01 7c 1d 20 20 20 20  |QUD    0..|.    |
00000610  20 20 20 20 20 20 20 20  20 20 20 20 45 51 55 44  |            EQUD|
00000620  20 20 20 20 30 0d 01 86  1d 20 20 20 20 20 20 20  |    0....       |
00000630  20 20 20 20 20 20 20 20  20 45 51 55 44 20 20 20  |         EQUD   |
00000640  20 30 0d 01 90 25 2e 74  69 74 6c 65 73 74 72 20  | 0...%.titlestr |
00000650  20 20 20 20 20 20 45 51  55 53 20 20 20 20 6e 61  |      EQUS    na|
00000660  6d 65 24 2b 62 6c 24 0d  01 9a 19 20 20 20 20 20  |me$+bl$....     |
00000670  20 20 20 20 20 20 20 20  20 20 20 41 4c 49 47 4e  |           ALIGN|
00000680  0d 01 a4 04 0d 01 ae 24  2e 68 65 6c 70 73 74 72  |.......$.helpstr|
00000690  20 20 20 20 20 20 20 20  45 51 55 53 20 20 20 20  |        EQUS    |
000006a0  76 65 72 24 2b 62 6c 24  0d 01 b8 19 20 20 20 20  |ver$+bl$....    |
000006b0  20 20 20 20 20 20 20 20  20 20 20 20 41 4c 49 47  |            ALIG|
000006c0  4e 0d 01 c2 04 0d 01 cc  25 2e 6b 65 79 77 6f 72  |N.......%.keywor|
000006d0  64 73 20 20 20 20 20 20  20 45 51 55 53 20 20 20  |ds       EQUS   |
000006e0  20 6e 61 6d 65 24 2b 62  6c 24 0d 01 d6 19 20 20  | name$+bl$....  |
000006f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 41 4c  |              AL|
00000700  49 47 4e 0d 01 e0 3a 20  20 20 20 20 20 20 20 20  |IGN...:         |
00000710  20 20 20 20 20 20 20 45  51 55 44 20 20 20 20 30  |       EQUD    0|
00000720  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00000730  20 4e 6f 20 2a 20 63 6f  6d 6d 61 6e 64 0d 01 ea  | No * command...|
00000740  3b 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |;               |
00000750  20 45 51 55 44 20 20 20  20 30 20 20 20 20 20 20  | EQUD    0      |
00000760  20 20 20 20 20 20 20 20  20 3b 20 4e 6f 20 70 61  |         ; No pa|
00000770  72 61 6d 65 74 65 72 73  0d 01 f4 40 20 20 20 20  |rameters...@    |
00000780  20 20 20 20 20 20 20 20  20 20 20 20 45 51 55 44  |            EQUD|
00000790  20 20 20 20 30 20 20 20  20 20 20 20 20 20 20 20  |    0           |
000007a0  20 20 20 20 3b 20 4e 6f  20 69 6e 76 61 6c 69 64  |    ; No invalid|
000007b0  20 6d 65 73 73 61 67 65  0d 01 fe 4c 20 20 20 20  | message...L    |
000007c0  20 20 20 20 20 20 20 20  20 20 20 20 45 51 55 44  |            EQUD|
000007d0  20 20 20 20 77 61 72 66  68 65 6c 70 2d 6f 72 67  |    warfhelp-org|
000007e0  20 20 20 20 3b 20 50 6f  69 6e 74 65 72 20 74 6f  |    ; Pointer to|
000007f0  20 2a 48 65 6c 70 20 57  61 72 66 61 72 69 6e 20  | *Help Warfarin |
00000800  74 65 78 74 0d 02 08 3e  20 20 20 20 20 20 20 20  |text...>        |
00000810  20 20 20 20 20 20 20 20  45 51 55 44 20 20 20 20  |        EQUD    |
00000820  30 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |0               |
00000830  3b 20 4e 6f 20 6d 6f 72  65 20 63 6f 6d 6d 61 6e  |; No more comman|
00000840  64 73 0d 02 12 04 0d 02  1c 7d 2e 77 61 72 66 68  |ds.......}.warfh|
00000850  65 6c 70 20 20 20 20 20  20 20 45 51 55 53 20 20  |elp       EQUS  |
00000860  20 20 22 54 68 65 20 22  2b 6e 61 6d 65 24 2b 22  |  "The "+name$+"|
00000870  20 6d 6f 64 75 6c 65 20  61 6c 6c 6f 77 73 20 79  | module allows y|
00000880  6f 75 72 20 6d 6f 75 73  65 20 74 6f 20 62 65 20  |our mouse to be |
00000890  63 6f 6e 74 72 6f 6c 6c  65 64 20 62 79 20 74 68  |controlled by th|
000008a0  65 20 75 73 65 20 6f 66  20 74 68 65 20 41 6c 74  |e use of the Alt|
000008b0  20 61 6e 64 20 63 75 72  73 6f 72 20 6b 65 79 73  | and cursor keys|
000008c0  2e 20 22 0d 02 26 87 20  20 20 20 20 20 20 20 20  |. "..&.         |
000008d0  20 20 20 20 20 20 20 45  51 55 53 20 20 20 20 22  |       EQUS    "|
000008e0  4d 6f 75 73 65 20 62 75  74 74 6f 6e 20 70 72 65  |Mouse button pre|
000008f0  73 73 65 73 20 63 61 6e  20 62 65 20 73 69 6d 75  |sses can be simu|
00000900  6c 61 74 65 64 20 77 69  74 68 20 41 6c 74 2d 49  |lated with Alt-I|
00000910  6e 73 65 72 74 20 28 4c  65 66 74 29 2c 20 41 6c  |nsert (Left), Al|
00000920  74 2d 48 6f 6d 65 20 28  4d 69 64 64 6c 65 29 20  |t-Home (Middle) |
00000930  61 6e 64 20 41 6c 74 2d  50 61 67 65 2d 55 70 20  |and Alt-Page-Up |
00000940  28 52 69 67 68 74 29 2e  20 22 0d 02 27 65 20 20  |(Right). "..'e  |
00000950  20 20 20 20 20 20 20 20  20 20 20 20 20 20 45 51  |              EQ|
00000960  55 53 20 20 20 20 22 54  68 65 73 65 20 64 65 66  |US    "These def|
00000970  61 75 6c 74 20 6b 65 79  73 20 63 61 6e 20 62 65  |ault keys can be|
00000980  20 65 61 73 69 6c 79 20  63 68 61 6e 67 65 64 20  | easily changed |
00000990  76 69 61 20 22 2b 6e 61  6d 65 24 2b 22 24 2a 20  |via "+name$+"$* |
000009a0  76 61 72 69 61 62 6c 65  73 2e 22 2b 62 6c 24 0d  |variables."+bl$.|
000009b0  02 30 19 20 20 20 20 20  20 20 20 20 20 20 20 20  |.0.             |
000009c0  20 20 20 41 4c 49 47 4e  0d 02 3a 04 0d 02 44 0f  |   ALIGN..:...D.|
000009d0  2e 74 72 61 70 65 76 65  6e 74 73 0d 02 4e 39 3b  |.trapevents..N9;|
000009e0  20 4f 6e 20 65 6e 74 72  79 2c 20 20 20 20 20 52  | On entry,     R|
000009f0  30 20 20 20 20 20 20 3d  20 31 33 20 74 6f 20 64  |0      = 13 to d|
00000a00  69 73 61 62 6c 65 2c 20  31 34 20 74 6f 20 65 6e  |isable, 14 to en|
00000a10  61 62 6c 65 0d 02 58 2c  20 20 20 20 20 20 20 20  |able..X,        |
00000a20  20 20 20 20 20 20 20 20  53 54 4d 46 44 20 20 20  |        STMFD   |
00000a30  52 31 33 21 2c 7b 52 31  2c 52 32 2c 52 31 34 7d  |R13!,{R1,R2,R14}|
00000a40  0d 02 62 4a 20 20 20 20  20 20 20 20 20 20 20 20  |..bJ            |
00000a50  20 20 20 20 4d 4f 56 20  20 20 20 20 52 31 2c 23  |    MOV     R1,#|
00000a60  32 20 20 20 20 20 20 20  20 20 20 20 3b 20 43 68  |2           ; Ch|
00000a70  61 72 61 63 74 65 72 20  69 6e 73 65 72 74 65 64  |aracter inserted|
00000a80  20 69 6e 20 62 75 66 66  65 72 0d 02 6c 26 20 20  | in buffer..l&  |
00000a90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 53 57  |              SW|
00000aa0  49 20 20 20 20 20 22 58  4f 53 5f 42 79 74 65 22  |I     "XOS_Byte"|
00000ab0  0d 02 76 3c 20 20 20 20  20 20 20 20 20 20 20 20  |..v<            |
00000ac0  20 20 20 20 4d 4f 56 20  20 20 20 20 52 31 2c 23  |    MOV     R1,#|
00000ad0  34 20 20 20 20 20 20 20  20 20 20 20 3b 20 53 63  |4           ; Sc|
00000ae0  72 65 65 6e 20 72 65 66  72 65 73 68 0d 02 80 26  |reen refresh...&|
00000af0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000b00  53 57 49 20 20 20 20 20  22 58 4f 53 5f 42 79 74  |SWI     "XOS_Byt|
00000b10  65 22 0d 02 8a 39 20 20  20 20 20 20 20 20 20 20  |e"...9          |
00000b20  20 20 20 20 20 20 4d 4f  56 20 20 20 20 20 52 31  |      MOV     R1|
00000b30  2c 23 31 31 20 20 20 20  20 20 20 20 20 20 3b 20  |,#11          ; |
00000b40  4b 65 79 20 75 70 2f 64  6f 77 6e 0d 02 94 26 20  |Key up/down...& |
00000b50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 53  |               S|
00000b60  57 49 20 20 20 20 20 22  58 4f 53 5f 42 79 74 65  |WI     "XOS_Byte|
00000b70  22 0d 02 9e 2b 20 20 20  20 20 20 20 20 20 20 20  |"...+           |
00000b80  20 20 20 20 20 4c 44 4d  46 44 20 20 20 52 31 33  |     LDMFD   R13|
00000b90  21 2c 7b 52 31 2c 52 32  2c 50 43 7d 0d 02 a8 04  |!,{R1,R2,PC}....|
00000ba0  0d 02 b2 11 2e 74 72 61  6e 73 6c 61 74 65 76 61  |.....translateva|
00000bb0  72 0d 02 bc 36 3b 20 4f  6e 20 65 6e 74 72 79 2c  |r...6; On entry,|
00000bc0  20 20 20 20 20 52 30 20  20 20 20 20 20 3d 20 50  |     R0      = P|
00000bd0  6f 69 6e 74 65 72 20 74  6f 20 76 61 72 69 61 62  |ointer to variab|
00000be0  6c 65 20 6e 61 6d 65 0d  02 c6 38 3b 20 20 20 20  |le name...8;    |
00000bf0  20 20 20 20 20 20 20 20  20 20 20 52 31 20 20 20  |           R1   |
00000c00  20 20 20 3d 20 44 65 66  61 75 6c 74 20 76 61 6c  |   = Default val|
00000c10  75 65 20 69 66 20 75 6e  64 65 66 69 6e 65 64 0d  |ue if undefined.|
00000c20  02 d0 2c 3b 20 4f 6e 20  65 78 69 74 2c 20 20 20  |..,; On exit,   |
00000c30  20 20 20 52 30 20 20 20  20 20 20 3d 20 56 61 6c  |   R0      = Val|
00000c40  75 65 20 72 65 74 75 72  6e 65 64 0d 02 da 2c 20  |ue returned..., |
00000c50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 53  |               S|
00000c60  54 4d 46 44 20 20 20 52  31 33 21 2c 7b 52 31 2d  |TMFD   R13!,{R1-|
00000c70  52 35 2c 52 31 34 7d 0d  02 e4 21 20 20 20 20 20  |R5,R14}...!     |
00000c80  20 20 20 20 20 20 20 20  20 20 20 4d 4f 56 20 20  |           MOV  |
00000c90  20 20 20 52 35 2c 52 31  0d 02 ee 3b 20 20 20 20  |   R5,R1...;    |
00000ca0  20 20 20 20 20 20 20 20  20 20 20 20 41 44 52 20  |            ADR |
00000cb0  20 20 20 20 52 31 2c 76  61 6c 75 65 72 65 61 64  |    R1,valueread|
00000cc0  20 20 20 20 3b 20 52 65  74 75 72 6e 20 62 75 66  |    ; Return buf|
00000cd0  66 65 72 0d 02 f8 39 20  20 20 20 20 20 20 20 20  |fer...9         |
00000ce0  20 20 20 20 20 20 20 4d  4f 56 20 20 20 20 20 52  |       MOV     R|
00000cf0  32 2c 23 34 20 20 20 20  20 20 20 20 20 20 20 3b  |2,#4           ;|
00000d00  20 42 75 66 66 65 72 20  73 69 7a 65 0d 03 02 41  | Buffer size...A|
00000d10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000d20  4d 4f 56 20 20 20 20 20  52 33 2c 23 30 20 20 20  |MOV     R3,#0   |
00000d30  20 20 20 20 20 20 20 20  3b 20 46 69 72 73 74 20  |        ; First |
00000d40  61 6e 64 20 6f 6e 6c 79  20 63 61 6c 6c 0d 03 0c  |and only call...|
00000d50  3c 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |<               |
00000d60  20 4d 4f 56 20 20 20 20  20 52 34 2c 23 30 20 20  | MOV     R4,#0  |
00000d70  20 20 20 20 20 20 20 20  20 3b 20 4e 6f 20 74 72  |         ; No tr|
00000d80  61 6e 73 6c 61 74 69 6f  6e 0d 03 16 2c 20 20 20  |anslation...,   |
00000d90  20 20 20 20 20 20 20 20  20 20 20 20 20 53 57 49  |             SWI|
00000da0  20 20 20 20 20 22 58 4f  53 5f 52 65 61 64 56 61  |     "XOS_ReadVa|
00000db0  72 56 61 6c 22 0d 03 20  28 20 20 20 20 20 20 20  |rVal".. (       |
00000dc0  20 20 20 20 20 20 20 20  20 4c 44 52 42 20 20 20  |         LDRB   |
00000dd0  20 52 30 2c 76 61 6c 75  65 72 65 61 64 0d 03 2a  | R0,valueread..*|
00000de0  39 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |9               |
00000df0  20 4d 4f 56 56 53 20 20  20 52 30 2c 52 35 20 20  | MOVVS   R0,R5  |
00000e00  20 20 20 20 20 20 20 20  20 3b 20 46 61 69 6c 65  |         ; Faile|
00000e10  64 20 63 61 6c 6c 0d 03  34 21 20 20 20 20 20 20  |d call..4!      |
00000e20  20 20 20 20 20 20 20 20  20 20 43 4d 50 20 20 20  |          CMP   |
00000e30  20 20 52 34 2c 23 31 0d  03 3e 3a 20 20 20 20 20  |  R4,#1..>:     |
00000e40  20 20 20 20 20 20 20 20  20 20 20 4d 4f 56 4e 45  |           MOVNE|
00000e50  20 20 20 52 30 2c 52 35  20 20 20 20 20 20 20 20  |   R0,R5        |
00000e60  20 20 20 3b 20 4e 6f 74  20 61 20 6e 75 6d 62 65  |   ; Not a numbe|
00000e70  72 0d 03 48 2b 20 20 20  20 20 20 20 20 20 20 20  |r..H+           |
00000e80  20 20 20 20 20 4c 44 4d  46 44 20 20 20 52 31 33  |     LDMFD   R13|
00000e90  21 2c 7b 52 31 2d 52 35  2c 50 43 7d 0d 03 52 1d  |!,{R1-R5,PC}..R.|
00000ea0  2e 76 61 6c 75 65 72 65  61 64 20 20 20 20 20 20  |.valueread      |
00000eb0  45 51 55 44 20 20 20 20  30 0d 03 5c 04 0d 03 66  |EQUD    0..\...f|
00000ec0  2c 2e 69 6e 69 74 20 20  20 20 20 20 20 20 20 20  |,.init          |
00000ed0  20 53 54 4d 46 44 20 20  20 52 31 33 21 2c 7b 52  | STMFD   R13!,{R|
00000ee0  30 2d 52 32 2c 52 31 34  7d 0d 03 70 26 20 20 20  |0-R2,R14}..p&   |
00000ef0  20 20 20 20 20 20 20 20  20 20 20 20 20 4d 4f 56  |             MOV|
00000f00  20 20 20 20 20 52 30 2c  23 45 76 65 6e 74 56 0d  |     R0,#EventV.|
00000f10  03 7a 28 20 20 20 20 20  20 20 20 20 20 20 20 20  |.z(             |
00000f20  20 20 20 41 44 52 20 20  20 20 20 52 31 2c 65 76  |   ADR     R1,ev|
00000f30  65 6e 74 74 72 61 70 0d  03 84 21 20 20 20 20 20  |enttrap...!     |
00000f40  20 20 20 20 20 20 20 20  20 20 20 4d 4f 56 20 20  |           MOV  |
00000f50  20 20 20 52 32 2c 23 30  0d 03 8e 4a 20 20 20 20  |   R2,#0...J    |
00000f60  20 20 20 20 20 20 20 20  20 20 20 20 53 54 52 20  |            STR |
00000f70  20 20 20 20 52 32 2c 61  6c 74 6b 65 79 73 74 61  |    R2,altkeysta|
00000f80  74 75 73 20 3b 20 41 6c  6c 20 73 70 65 63 69 61  |tus ; All specia|
00000f90  6c 20 6b 65 79 73 20 6e  6f 74 20 70 72 65 73 73  |l keys not press|
00000fa0  65 64 0d 03 98 2d 20 20  20 20 20 20 20 20 20 20  |ed...-          |
00000fb0  20 20 20 20 20 20 53 54  52 20 20 20 20 20 52 32  |      STR     R2|
00000fc0  2c 61 6c 74 6b 65 79 73  74 61 74 75 73 2b 34 0d  |,altkeystatus+4.|
00000fd0  03 a2 27 20 20 20 20 20  20 20 20 20 20 20 20 20  |..'             |
00000fe0  20 20 20 53 57 49 20 20  20 20 20 22 58 4f 53 5f  |   SWI     "XOS_|
00000ff0  43 6c 61 69 6d 22 0d 03  ac 24 20 20 20 20 20 20  |Claim"...$      |
00001000  20 20 20 20 20 20 20 20  20 20 4d 4f 56 20 20 20  |          MOV   |
00001010  20 20 52 30 2c 23 49 6e  73 56 0d 03 b6 29 20 20  |  R0,#InsV...)  |
00001020  20 20 20 20 20 20 20 20  20 20 20 20 20 20 41 44  |              AD|
00001030  52 20 20 20 20 20 52 31  2c 69 6e 73 65 72 74 74  |R     R1,insertt|
00001040  72 61 70 0d 03 c0 21 20  20 20 20 20 20 20 20 20  |rap...!         |
00001050  20 20 20 20 20 20 20 4d  4f 56 20 20 20 20 20 52  |       MOV     R|
00001060  32 2c 23 30 0d 03 ca 27  20 20 20 20 20 20 20 20  |2,#0...'        |
00001070  20 20 20 20 20 20 20 20  53 57 49 20 20 20 20 20  |        SWI     |
00001080  22 58 4f 53 5f 43 6c 61  69 6d 22 0d 03 d4 26 20  |"XOS_Claim"...& |
00001090  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4d  |               M|
000010a0  4f 56 20 20 20 20 20 52  30 2c 23 4d 6f 75 73 65  |OV     R0,#Mouse|
000010b0  56 0d 03 de 28 20 20 20  20 20 20 20 20 20 20 20  |V...(           |
000010c0  20 20 20 20 20 41 44 52  20 20 20 20 20 52 31 2c  |     ADR     R1,|
000010d0  6d 6f 75 73 65 74 72 61  70 0d 03 e8 21 20 20 20  |mousetrap...!   |
000010e0  20 20 20 20 20 20 20 20  20 20 20 20 20 4d 4f 56  |             MOV|
000010f0  20 20 20 20 20 52 32 2c  23 30 0d 03 f2 27 20 20  |     R2,#0...'  |
00001100  20 20 20 20 20 20 20 20  20 20 20 20 20 20 53 57  |              SW|
00001110  49 20 20 20 20 20 22 58  4f 53 5f 43 6c 61 69 6d  |I     "XOS_Claim|
00001120  22 0d 03 fc 22 20 20 20  20 20 20 20 20 20 20 20  |"..."           |
00001130  20 20 20 20 20 4d 4f 56  20 20 20 20 20 52 30 2c  |     MOV     R0,|
00001140  23 31 34 0d 04 06 43 20  20 20 20 20 20 20 20 20  |#14...C         |
00001150  20 20 20 20 20 20 20 42  4c 20 20 20 20 20 20 74  |       BL      t|
00001160  72 61 70 65 76 65 6e 74  73 20 20 20 20 20 20 3b  |rapevents      ;|
00001170  20 45 6e 61 62 6c 65 20  63 6c 61 69 6d 65 64 20  | Enable claimed |
00001180  65 76 65 6e 74 73 0d 04  10 23 20 20 20 20 20 20  |events...#      |
00001190  20 20 20 20 20 20 20 20  20 20 4d 4f 56 20 20 20  |          MOV   |
000011a0  20 20 52 30 2c 23 31 36  31 0d 04 1a 23 20 20 20  |  R0,#161...#   |
000011b0  20 20 20 20 20 20 20 20  20 20 20 20 20 4d 4f 56  |             MOV|
000011c0  20 20 20 20 20 52 31 2c  23 31 39 34 0d 04 24 45  |     R1,#194..$E|
000011d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000011e0  53 57 49 20 20 20 20 20  22 58 4f 53 5f 42 79 74  |SWI     "XOS_Byt|
000011f0  65 22 20 20 20 20 20 20  3b 20 52 65 61 64 20 4d  |e"      ; Read M|
00001200  6f 75 73 65 20 73 74 65  70 20 73 65 74 74 69 6e  |ouse step settin|
00001210  67 0d 04 2e 3e 20 20 20  20 20 20 20 20 20 20 20  |g...>           |
00001220  20 20 20 20 20 41 44 44  20 20 20 20 20 52 32 2c  |     ADD     R2,|
00001230  52 32 2c 23 6d 6f 75 73  65 62 6f 6f 73 74 25 20  |R2,#mouseboost% |
00001240  20 20 20 20 20 3b 20 42  6f 6f 73 74 20 69 74 0d  |     ; Boost it.|
00001250  04 38 29 20 20 20 20 20  20 20 20 20 20 20 20 20  |.8)             |
00001260  20 20 20 53 54 52 42 20  20 20 20 52 32 2c 6d 6f  |   STRB    R2,mo|
00001270  75 73 65 73 70 65 65 64  0d 04 42 28 20 20 20 20  |usespeed..B(    |
00001280  20 20 20 20 20 20 20 20  20 20 20 20 41 44 52 20  |            ADR |
00001290  20 20 20 20 52 30 2c 66  61 6b 65 31 6e 61 6d 65  |    R0,fake1name|
000012a0  0d 04 4c 46 20 20 20 20  20 20 20 20 20 20 20 20  |..LF            |
000012b0  20 20 20 20 4d 4f 56 20  20 20 20 20 52 31 2c 23  |    MOV     R1,#|
000012c0  26 35 45 20 3b 20 4d 6f  64 69 66 69 65 72 20 31  |&5E ; Modifier 1|
000012d0  20 20 20 20 2d 3e 20 26  35 45 20 2d 3e 20 4c 65  |    -> &5E -> Le|
000012e0  66 74 20 41 6c 74 0d 04  56 28 20 20 20 20 20 20  |ft Alt..V(      |
000012f0  20 20 20 20 20 20 20 20  20 20 42 4c 20 20 20 20  |          BL    |
00001300  20 20 74 72 61 6e 73 6c  61 74 65 76 61 72 0d 04  |  translatevar..|
00001310  60 27 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |`'              |
00001320  20 20 53 54 52 42 20 20  20 20 52 30 2c 66 61 6b  |  STRB    R0,fak|
00001330  65 31 76 61 6c 0d 04 6a  28 20 20 20 20 20 20 20  |e1val..j(       |
00001340  20 20 20 20 20 20 20 20  20 41 44 52 20 20 20 20  |         ADR    |
00001350  20 52 30 2c 66 61 6b 65  32 6e 61 6d 65 0d 04 74  | R0,fake2name..t|
00001360  47 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |G               |
00001370  20 4d 4f 56 20 20 20 20  20 52 31 2c 23 26 36 30  | MOV     R1,#&60|
00001380  20 3b 20 4d 6f 64 69 66  69 65 72 20 32 20 20 20  | ; Modifier 2   |
00001390  20 2d 3e 20 26 36 30 20  2d 3e 20 52 69 67 68 74  | -> &60 -> Right|
000013a0  20 41 6c 74 0d 04 7e 28  20 20 20 20 20 20 20 20  | Alt..~(        |
000013b0  20 20 20 20 20 20 20 20  42 4c 20 20 20 20 20 20  |        BL      |
000013c0  74 72 61 6e 73 6c 61 74  65 76 61 72 0d 04 88 27  |translatevar...'|
000013d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000013e0  53 54 52 42 20 20 20 20  52 30 2c 66 61 6b 65 32  |STRB    R0,fake2|
000013f0  76 61 6c 0d 04 92 2c 20  20 20 20 20 20 20 20 20  |val...,         |
00001400  20 20 20 20 20 20 20 41  44 52 20 20 20 20 20 52  |       ADR     R|
00001410  30 2c 6c 65 66 74 6d 6f  75 73 65 6e 61 6d 65 0d  |0,leftmousename.|
00001420  04 9c 44 20 20 20 20 20  20 20 20 20 20 20 20 20  |..D             |
00001430  20 20 20 4d 4f 56 20 20  20 20 20 52 31 2c 23 26  |   MOV     R1,#&|
00001440  31 46 20 3b 20 4c 65 66  74 20 20 20 62 75 74 74  |1F ; Left   butt|
00001450  6f 6e 20 2d 3e 20 26 31  46 20 2d 3e 20 49 6e 73  |on -> &1F -> Ins|
00001460  65 72 74 0d 04 a6 28 20  20 20 20 20 20 20 20 20  |ert...(         |
00001470  20 20 20 20 20 20 20 42  4c 20 20 20 20 20 20 74  |       BL      t|
00001480  72 61 6e 73 6c 61 74 65  76 61 72 0d 04 b0 2b 20  |ranslatevar...+ |
00001490  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 53  |               S|
000014a0  54 52 42 20 20 20 20 52  30 2c 6c 65 66 74 6d 6f  |TRB    R0,leftmo|
000014b0  75 73 65 76 61 6c 0d 04  ba 2b 20 20 20 20 20 20  |useval...+      |
000014c0  20 20 20 20 20 20 20 20  20 20 41 44 52 20 20 20  |          ADR   |
000014d0  20 20 52 30 2c 6d 69 64  6d 6f 75 73 65 6e 61 6d  |  R0,midmousenam|
000014e0  65 0d 04 c4 42 20 20 20  20 20 20 20 20 20 20 20  |e...B           |
000014f0  20 20 20 20 20 4d 4f 56  20 20 20 20 20 52 31 2c  |     MOV     R1,|
00001500  23 26 32 30 20 3b 20 4d  69 64 64 6c 65 20 62 75  |#&20 ; Middle bu|
00001510  74 74 6f 6e 20 2d 3e 20  26 32 30 20 2d 3e 20 48  |tton -> &20 -> H|
00001520  6f 6d 65 0d 04 ce 28 20  20 20 20 20 20 20 20 20  |ome...(         |
00001530  20 20 20 20 20 20 20 42  4c 20 20 20 20 20 20 74  |       BL      t|
00001540  72 61 6e 73 6c 61 74 65  76 61 72 0d 04 d8 2a 20  |ranslatevar...* |
00001550  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 53  |               S|
00001560  54 52 42 20 20 20 20 52  30 2c 6d 69 64 6d 6f 75  |TRB    R0,midmou|
00001570  73 65 76 61 6c 0d 04 e2  2d 20 20 20 20 20 20 20  |seval...-       |
00001580  20 20 20 20 20 20 20 20  20 41 44 52 20 20 20 20  |         ADR    |
00001590  20 52 30 2c 72 69 67 68  74 6d 6f 75 73 65 6e 61  | R0,rightmousena|
000015a0  6d 65 0d 04 ec 45 20 20  20 20 20 20 20 20 20 20  |me...E          |
000015b0  20 20 20 20 20 20 4d 4f  56 20 20 20 20 20 52 31  |      MOV     R1|
000015c0  2c 23 26 32 31 20 3b 20  52 69 67 68 74 20 20 62  |,#&21 ; Right  b|
000015d0  75 74 74 6f 6e 20 2d 3e  20 26 32 31 20 2d 3e 20  |utton -> &21 -> |
000015e0  50 61 67 65 20 55 70 0d  04 f6 28 20 20 20 20 20  |Page Up...(     |
000015f0  20 20 20 20 20 20 20 20  20 20 20 42 4c 20 20 20  |           BL   |
00001600  20 20 20 74 72 61 6e 73  6c 61 74 65 76 61 72 0d  |   translatevar.|
00001610  05 00 2c 20 20 20 20 20  20 20 20 20 20 20 20 20  |..,             |
00001620  20 20 20 53 54 52 42 20  20 20 20 52 30 2c 72 69  |   STRB    R0,ri|
00001630  67 68 74 6d 6f 75 73 65  76 61 6c 0d 05 0a 2b 20  |ghtmouseval...+ |
00001640  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4c  |               L|
00001650  44 4d 46 44 20 20 20 52  31 33 21 2c 7b 52 30 2d  |DMFD   R13!,{R0-|
00001660  52 32 2c 50 43 7d 0d 05  14 2e 2e 66 61 6b 65 31  |R2,PC}.....fake1|
00001670  6e 61 6d 65 20 20 20 20  20 20 45 51 55 53 20 20  |name      EQUS  |
00001680  20 20 6e 61 6d 65 24 2b  22 24 46 61 6b 65 31 22  |  name$+"$Fake1"|
00001690  2b 62 6c 24 0d 05 1e 2e  2e 66 61 6b 65 32 6e 61  |+bl$.....fake2na|
000016a0  6d 65 20 20 20 20 20 20  45 51 55 53 20 20 20 20  |me      EQUS    |
000016b0  6e 61 6d 65 24 2b 22 24  46 61 6b 65 32 22 2b 62  |name$+"$Fake2"+b|
000016c0  6c 24 0d 05 28 2d 2e 6c  65 66 74 6d 6f 75 73 65  |l$..(-.leftmouse|
000016d0  6e 61 6d 65 20 20 45 51  55 53 20 20 20 20 6e 61  |name  EQUS    na|
000016e0  6d 65 24 2b 22 24 4c 65  66 74 22 2b 62 6c 24 0d  |me$+"$Left"+bl$.|
000016f0  05 32 2f 2e 6d 69 64 6d  6f 75 73 65 6e 61 6d 65  |.2/.midmousename|
00001700  20 20 20 45 51 55 53 20  20 20 20 6e 61 6d 65 24  |   EQUS    name$|
00001710  2b 22 24 4d 69 64 64 6c  65 22 2b 62 6c 24 0d 05  |+"$Middle"+bl$..|
00001720  3c 2e 2e 72 69 67 68 74  6d 6f 75 73 65 6e 61 6d  |<..rightmousenam|
00001730  65 20 45 51 55 53 20 20  20 20 6e 61 6d 65 24 2b  |e EQUS    name$+|
00001740  22 24 52 69 67 68 74 22  2b 62 6c 24 0d 05 46 19  |"$Right"+bl$..F.|
00001750  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001760  41 4c 49 47 4e 0d 05 50  04 0d 05 5a 10 2e 73 65  |ALIGN..P...Z..se|
00001770  72 76 69 63 65 63 61 6c  6c 0d 05 64 31 3b 20 4f  |rvicecall..d1; O|
00001780  6e 20 65 6e 74 72 79 2c  20 20 20 20 20 52 31 20  |n entry,     R1 |
00001790  20 20 20 20 20 3d 20 53  65 72 76 69 63 65 20 63  |     = Service c|
000017a0  61 6c 6c 20 6e 75 6d 62  65 72 0d 05 6e 26 20 20  |all number..n&  |
000017b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 53 54  |              ST|
000017c0  4d 46 44 20 20 20 52 31  33 21 2c 7b 52 31 34 7d  |MFD   R13!,{R14}|
000017d0  0d 05 78 42 20 20 20 20  20 20 20 20 20 20 20 20  |..xB            |
000017e0  20 20 20 20 43 4d 50 20  20 20 20 20 52 31 2c 23  |    CMP     R1,#|
000017f0  26 32 37 20 20 20 20 20  20 20 20 20 3b 20 45 6e  |&27         ; En|
00001800  64 20 6f 66 20 6d 61 63  68 69 6e 65 20 72 65 73  |d of machine res|
00001810  65 74 0d 05 82 41 20 20  20 20 20 20 20 20 20 20  |et...A          |
00001820  20 20 20 20 20 20 42 4c  45 51 20 20 20 20 69 6e  |      BLEQ    in|
00001830  69 74 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |it            ; |
00001840  52 65 61 63 74 69 76 61  74 65 20 57 61 72 66 61  |Reactivate Warfa|
00001850  72 69 6e 0d 05 8c 25 20  20 20 20 20 20 20 20 20  |rin...%         |
00001860  20 20 20 20 20 20 20 4c  44 4d 46 44 20 20 20 52  |       LDMFD   R|
00001870  31 33 21 2c 7b 50 43 7d  0d 05 96 04 0d 05 a0 0e  |13!,{PC}........|
00001880  2e 65 76 65 6e 74 74 72  61 70 0d 05 aa 3f 3b 20  |.eventtrap...?; |
00001890  4f 6e 20 65 6e 74 72 79  2c 20 20 20 20 20 52 30  |On entry,     R0|
000018a0  20 20 20 20 20 20 3d 20  45 76 65 6e 74 20 6e 75  |      = Event nu|
000018b0  6d 62 65 72 20 28 31 31  20 66 6f 72 20 6b 65 79  |mber (11 for key|
000018c0  20 75 70 2f 64 6f 77 6e  29 0d 05 b4 2c 20 20 20  | up/down)...,   |
000018d0  20 20 20 20 20 20 20 20  20 20 20 20 20 53 54 4d  |             STM|
000018e0  46 44 20 20 20 52 31 33  21 2c 7b 52 30 2d 52 35  |FD   R13!,{R0-R5|
000018f0  2c 52 31 34 7d 0d 05 be  3a 20 20 20 20 20 20 20  |,R14}...:       |
00001900  20 20 20 20 20 20 20 20  20 43 4d 50 20 20 20 20  |         CMP    |
00001910  20 52 30 2c 23 31 31 20  20 3b 20 57 61 73 20 69  | R0,#11  ; Was i|
00001920  74 20 6b 65 79 20 75 70  2f 64 6f 77 6e 20 3f 0d  |t key up/down ?.|
00001930  05 c8 28 20 20 20 20 20  20 20 20 20 20 20 20 20  |..(             |
00001940  20 20 20 42 4e 45 20 20  20 20 20 6e 6f 74 6b 65  |   BNE     notke|
00001950  79 75 70 64 6f 77 6e 0d  05 d2 3a 3b 20 57 68 65  |yupdown...:; Whe|
00001960  6e 20 52 30 20 3d 20 31  31 2c 20 52 31 20 20 20  |n R0 = 11, R1   |
00001970  20 20 20 3d 20 30 20 66  6f 72 20 6b 65 79 20 75  |   = 0 for key u|
00001980  70 2c 20 31 20 66 6f 72  20 6b 65 79 20 64 6f 77  |p, 1 for key dow|
00001990  6e 0d 05 dc 3a 3b 20 20  20 20 20 20 20 20 20 20  |n...:;          |
000019a0  20 20 20 20 20 52 32 20  20 20 20 20 20 3d 20 49  |     R2      = I|
000019b0  6e 74 65 72 6e 61 6c 20  6b 65 79 20 63 6f 64 65  |nternal key code|
000019c0  20 28 50 61 67 65 20 31  32 32 29 0d 05 e6 27 20  | (Page 122)...' |
000019d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4c  |               L|
000019e0  44 52 42 20 20 20 20 52  33 2c 66 61 6b 65 31 76  |DRB    R3,fake1v|
000019f0  61 6c 0d 05 f0 37 20 20  20 20 20 20 20 20 20 20  |al...7          |
00001a00  20 20 20 20 20 20 43 4d  50 20 20 20 20 20 52 32  |      CMP     R2|
00001a10  2c 52 33 20 3b 20 57 61  73 20 69 74 20 6d 6f 64  |,R3 ; Was it mod|
00001a20  69 66 69 65 72 20 31 20  3f 0d 05 fa 27 20 20 20  |ifier 1 ?...'   |
00001a30  20 20 20 20 20 20 20 20  20 20 20 20 20 4c 44 52  |             LDR|
00001a40  4e 45 42 20 20 52 33 2c  66 61 6b 65 32 76 61 6c  |NEB  R3,fake2val|
00001a50  0d 06 04 37 20 20 20 20  20 20 20 20 20 20 20 20  |...7            |
00001a60  20 20 20 20 43 4d 50 4e  45 20 20 20 52 32 2c 52  |    CMPNE   R2,R|
00001a70  33 20 3b 20 57 61 73 20  69 74 20 6d 6f 64 69 66  |3 ; Was it modif|
00001a80  69 65 72 20 32 20 3f 0d  06 0e 28 20 20 20 20 20  |ier 2 ?...(     |
00001a90  20 20 20 20 20 20 20 20  20 20 20 42 4e 45 20 20  |           BNE  |
00001aa0  20 20 20 63 68 65 63 6b  74 68 65 72 65 73 74 0d  |   checktherest.|
00001ab0  06 18 43 20 20 20 20 20  20 20 20 20 20 20 20 20  |..C             |
00001ac0  20 20 20 4d 4f 56 53 20  20 20 20 52 31 2c 52 31  |   MOVS    R1,R1|
00001ad0  20 20 20 20 20 20 20 20  20 20 20 3b 20 49 66 20  |           ; If |
00001ae0  41 6c 74 20 72 65 6c 65  61 73 65 64 2c 20 74 68  |Alt released, th|
00001af0  65 6e 0d 06 22 49 20 20  20 20 20 20 20 20 20 20  |en.."I          |
00001b00  20 20 20 20 20 20 53 54  52 4e 45 42 20 20 52 31  |      STRNEB  R1|
00001b10  2c 61 6c 74 6b 65 79 73  74 61 74 75 73 20 3b 20  |,altkeystatus ; |
00001b20  6e 6f 20 6d 6f 76 65 6d  65 6e 74 2f 62 75 74 74  |no movement/butt|
00001b30  6f 6e 73 20 61 6e 79 6d  6f 72 65 0d 06 2c 2b 20  |ons anymore..,+ |
00001b40  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 53  |               S|
00001b50  54 52 45 51 20 20 20 52  31 2c 61 6c 74 6b 65 79  |TREQ   R1,altkey|
00001b60  73 74 61 74 75 73 0d 06  36 2d 20 20 20 20 20 20  |status..6-      |
00001b70  20 20 20 20 20 20 20 20  20 20 53 54 52 45 51 20  |          STREQ |
00001b80  20 20 52 31 2c 61 6c 74  6b 65 79 73 74 61 74 75  |  R1,altkeystatu|
00001b90  73 2b 34 0d 06 40 23 20  20 20 20 20 20 20 20 20  |s+4..@#         |
00001ba0  20 20 20 20 20 20 20 42  20 20 20 20 20 20 20 6e  |       B       n|
00001bb0  6f 65 76 65 6e 74 0d 06  4a 39 2e 63 68 65 63 6b  |oevent..J9.check|
00001bc0  74 68 65 72 65 73 74 20  20 20 43 4d 50 20 20 20  |therest   CMP   |
00001bd0  20 20 52 32 2c 23 26 36  32 20 3b 20 57 61 73 20  |  R2,#&62 ; Was |
00001be0  69 74 20 4c 65 66 74 20  41 72 72 6f 77 20 3f 0d  |it Left Arrow ?.|
00001bf0  06 54 29 20 20 20 20 20  20 20 20 20 20 20 20 20  |.T)             |
00001c00  20 20 20 53 54 52 45 51  42 20 20 52 31 2c 6c 65  |   STREQB  R1,le|
00001c10  66 74 73 74 61 74 75 73  0d 06 5e 23 20 20 20 20  |ftstatus..^#    |
00001c20  20 20 20 20 20 20 20 20  20 20 20 20 42 45 51 20  |            BEQ |
00001c30  20 20 20 20 6e 6f 65 76  65 6e 74 0d 06 68 3a 20  |    noevent..h: |
00001c40  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 43  |               C|
00001c50  4d 50 20 20 20 20 20 52  32 2c 23 26 36 34 20 3b  |MP     R2,#&64 ;|
00001c60  20 57 61 73 20 69 74 20  52 69 67 68 74 20 41 72  | Was it Right Ar|
00001c70  72 6f 77 20 3f 0d 06 72  2a 20 20 20 20 20 20 20  |row ?..r*       |
00001c80  20 20 20 20 20 20 20 20  20 53 54 52 45 51 42 20  |         STREQB |
00001c90  20 52 31 2c 72 69 67 68  74 73 74 61 74 75 73 0d  | R1,rightstatus.|
00001ca0  06 7c 23 20 20 20 20 20  20 20 20 20 20 20 20 20  |.|#             |
00001cb0  20 20 20 42 45 51 20 20  20 20 20 6e 6f 65 76 65  |   BEQ     noeve|
00001cc0  6e 74 0d 06 86 37 20 20  20 20 20 20 20 20 20 20  |nt...7          |
00001cd0  20 20 20 20 20 20 43 4d  50 20 20 20 20 20 52 32  |      CMP     R2|
00001ce0  2c 23 26 35 39 20 3b 20  57 61 73 20 69 74 20 55  |,#&59 ; Was it U|
00001cf0  70 20 41 72 72 6f 77 20  3f 0d 06 90 27 20 20 20  |p Arrow ?...'   |
00001d00  20 20 20 20 20 20 20 20  20 20 20 20 20 53 54 52  |             STR|
00001d10  45 51 42 20 20 52 31 2c  75 70 73 74 61 74 75 73  |EQB  R1,upstatus|
00001d20  0d 06 9a 23 20 20 20 20  20 20 20 20 20 20 20 20  |...#            |
00001d30  20 20 20 20 42 45 51 20  20 20 20 20 6e 6f 65 76  |    BEQ     noev|
00001d40  65 6e 74 0d 06 a4 39 20  20 20 20 20 20 20 20 20  |ent...9         |
00001d50  20 20 20 20 20 20 20 43  4d 50 20 20 20 20 20 52  |       CMP     R|
00001d60  32 2c 23 26 36 33 20 3b  20 57 61 73 20 69 74 20  |2,#&63 ; Was it |
00001d70  44 6f 77 6e 20 41 72 72  6f 77 20 3f 0d 06 ae 29  |Down Arrow ?...)|
00001d80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001d90  53 54 52 45 51 42 20 20  52 31 2c 64 6f 77 6e 73  |STREQB  R1,downs|
00001da0  74 61 74 75 73 0d 06 b8  23 20 20 20 20 20 20 20  |tatus...#       |
00001db0  20 20 20 20 20 20 20 20  20 42 45 51 20 20 20 20  |         BEQ    |
00001dc0  20 6e 6f 65 76 65 6e 74  0d 06 c2 2b 20 20 20 20  | noevent...+    |
00001dd0  20 20 20 20 20 20 20 20  20 20 20 20 4c 44 52 42  |            LDRB|
00001de0  20 20 20 20 52 33 2c 6c  65 66 74 6d 6f 75 73 65  |    R3,leftmouse|
00001df0  76 61 6c 0d 06 cc 3d 20  20 20 20 20 20 20 20 20  |val...=         |
00001e00  20 20 20 20 20 20 20 43  4d 50 20 20 20 20 20 52  |       CMP     R|
00001e10  32 2c 52 33 20 3b 20 57  61 73 20 69 74 20 4c 65  |2,R3 ; Was it Le|
00001e20  66 74 20 42 75 74 74 6f  6e 20 46 61 6b 65 20 3f  |ft Button Fake ?|
00001e30  0d 06 d6 28 20 20 20 20  20 20 20 20 20 20 20 20  |...(            |
00001e40  20 20 20 20 53 54 52 45  51 42 20 20 52 31 2c 6c  |    STREQB  R1,l|
00001e50  6d 62 73 74 61 74 75 73  0d 06 e0 23 20 20 20 20  |mbstatus...#    |
00001e60  20 20 20 20 20 20 20 20  20 20 20 20 42 45 51 20  |            BEQ |
00001e70  20 20 20 20 6e 6f 65 76  65 6e 74 0d 06 ea 2a 20  |    noevent...* |
00001e80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4c  |               L|
00001e90  44 52 42 20 20 20 20 52  33 2c 6d 69 64 6d 6f 75  |DRB    R3,midmou|
00001ea0  73 65 76 61 6c 0d 06 f4  3f 20 20 20 20 20 20 20  |seval...?       |
00001eb0  20 20 20 20 20 20 20 20  20 43 4d 50 20 20 20 20  |         CMP    |
00001ec0  20 52 32 2c 52 33 20 3b  20 57 61 73 20 69 74 20  | R2,R3 ; Was it |
00001ed0  4d 69 64 64 6c 65 20 42  75 74 74 6f 6e 20 46 61  |Middle Button Fa|
00001ee0  6b 65 20 3f 0d 06 fe 28  20 20 20 20 20 20 20 20  |ke ?...(        |
00001ef0  20 20 20 20 20 20 20 20  53 54 52 45 51 42 20 20  |        STREQB  |
00001f00  52 31 2c 6d 6d 62 73 74  61 74 75 73 0d 07 08 23  |R1,mmbstatus...#|
00001f10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001f20  42 45 51 20 20 20 20 20  6e 6f 65 76 65 6e 74 0d  |BEQ     noevent.|
00001f30  07 12 2c 20 20 20 20 20  20 20 20 20 20 20 20 20  |..,             |
00001f40  20 20 20 4c 44 52 42 20  20 20 20 52 33 2c 72 69  |   LDRB    R3,ri|
00001f50  67 68 74 6d 6f 75 73 65  76 61 6c 0d 07 1c 3e 20  |ghtmouseval...> |
00001f60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 43  |               C|
00001f70  4d 50 20 20 20 20 20 52  32 2c 52 33 20 3b 20 57  |MP     R2,R3 ; W|
00001f80  61 73 20 69 74 20 52 69  67 68 74 20 42 75 74 74  |as it Right Butt|
00001f90  6f 6e 20 46 61 6b 65 20  3f 0d 07 26 28 20 20 20  |on Fake ?..&(   |
00001fa0  20 20 20 20 20 20 20 20  20 20 20 20 20 53 54 52  |             STR|
00001fb0  45 51 42 20 20 52 31 2c  72 6d 62 73 74 61 74 75  |EQB  R1,rmbstatu|
00001fc0  73 0d 07 30 23 20 20 20  20 20 20 20 20 20 20 20  |s..0#           |
00001fd0  20 20 20 20 20 42 20 20  20 20 20 20 20 6e 6f 65  |     B       noe|
00001fe0  76 65 6e 74 0d 07 3a 3d  2e 6e 6f 74 6b 65 79 75  |vent..:=.notkeyu|
00001ff0  70 64 6f 77 6e 20 20 20  43 4d 50 20 20 20 20 20  |pdown   CMP     |
00002000  52 30 2c 23 34 20 20 20  3b 20 57 61 73 20 69 74  |R0,#4   ; Was it|
00002010  20 73 63 72 65 65 6e 20  72 65 66 72 65 73 68 20  | screen refresh |
00002020  3f 0d 07 44 23 20 20 20  20 20 20 20 20 20 20 20  |?..D#           |
00002030  20 20 20 20 20 42 4e 45  20 20 20 20 20 6e 6f 65  |     BNE     noe|
00002040  76 65 6e 74 0d 07 4e 42  20 20 20 20 20 20 20 20  |vent..NB        |
00002050  20 20 20 20 20 20 20 20  4c 44 52 42 20 20 20 20  |        LDRB    |
00002060  52 30 2c 61 6c 74 6b 65  79 73 74 61 74 75 73 20  |R0,altkeystatus |
00002070  3b 20 41 6c 74 20 6b 65  79 20 6d 75 73 74 20 62  |; Alt key must b|
00002080  65 20 64 6f 77 6e 0d 07  58 21 20 20 20 20 20 20  |e down..X!      |
00002090  20 20 20 20 20 20 20 20  20 20 4d 4f 56 53 20 20  |          MOVS  |
000020a0  20 20 52 30 2c 52 30 0d  07 62 23 20 20 20 20 20  |  R0,R0..b#     |
000020b0  20 20 20 20 20 20 20 20  20 20 20 42 45 51 20 20  |           BEQ  |
000020c0  20 20 20 6e 6f 65 76 65  6e 74 0d 07 6c 29 20 20  |   noevent..l)  |
000020d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 4c 44  |              LD|
000020e0  52 42 20 20 20 20 52 32  2c 6d 6f 75 73 65 73 70  |RB    R2,mousesp|
000020f0  65 65 64 0d 07 76 29 20  20 20 20 20 20 20 20 20  |eed..v)         |
00002100  20 20 20 20 20 20 20 4c  44 52 42 20 20 20 20 52  |       LDRB    R|
00002110  30 2c 6c 65 66 74 73 74  61 74 75 73 0d 07 80 2a  |0,leftstatus...*|
00002120  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002130  4c 44 52 42 20 20 20 20  52 31 2c 72 69 67 68 74  |LDRB    R1,right|
00002140  73 74 61 74 75 73 0d 07  8a 24 20 20 20 20 20 20  |status...$      |
00002150  20 20 20 20 20 20 20 20  20 20 53 55 42 20 20 20  |          SUB   |
00002160  20 20 52 31 2c 52 31 2c  52 30 0d 07 94 3b 20 20  |  R1,R1,R0...;  |
00002170  20 20 20 20 20 20 20 20  20 20 20 20 20 20 4d 55  |              MU|
00002180  4c 20 20 20 20 20 52 34  2c 52 31 2c 52 32 20 20  |L     R4,R1,R2  |
00002190  20 20 20 20 20 20 3b 20  46 69 6e 64 20 58 20 63  |      ; Find X c|
000021a0  68 61 6e 67 65 0d 07 9e  27 20 20 20 20 20 20 20  |hange...'       |
000021b0  20 20 20 20 20 20 20 20  20 4c 44 52 42 20 20 20  |         LDRB   |
000021c0  20 52 30 2c 75 70 73 74  61 74 75 73 0d 07 a8 29  | R0,upstatus...)|
000021d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000021e0  4c 44 52 42 20 20 20 20  52 31 2c 64 6f 77 6e 73  |LDRB    R1,downs|
000021f0  74 61 74 75 73 0d 07 b2  24 20 20 20 20 20 20 20  |tatus...$       |
00002200  20 20 20 20 20 20 20 20  20 53 55 42 20 20 20 20  |         SUB    |
00002210  20 52 30 2c 52 30 2c 52  31 0d 07 bc 3b 20 20 20  | R0,R0,R1...;   |
00002220  20 20 20 20 20 20 20 20  20 20 20 20 20 4d 55 4c  |             MUL|
00002230  53 20 20 20 20 52 35 2c  52 30 2c 52 32 20 20 20  |S    R5,R0,R2   |
00002240  20 20 20 20 20 3b 20 46  69 6e 64 20 59 20 63 68  |     ; Find Y ch|
00002250  61 6e 67 65 0d 07 c6 46  20 20 20 20 20 20 20 20  |ange...F        |
00002260  20 20 20 20 20 20 20 20  ec 51 53 20 20 52 34 2c  |        .QS  R4,|
00002270  52 34 20 20 20 20 20 20  20 20 20 20 20 3b 20 49  |R4           ; I|
00002280  66 20 62 6f 74 68 20 7a  65 72 6f 2c 20 6e 6f 20  |f both zero, no |
00002290  6d 6f 75 73 65 20 6d 6f  76 65 0d 07 d0 23 20 20  |mouse move...#  |
000022a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 42 45  |              BE|
000022b0  51 20 20 20 20 20 6e 6f  65 76 65 6e 74 0d 07 da  |Q     noevent...|
000022c0  27 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |'               |
000022d0  20 a4 73 77 69 20 20 20  28 22 4f 53 5f 4d 6f 75  | .swi   ("OS_Mou|
000022e0  73 65 22 29 0d 07 e4 24  20 20 20 20 20 20 20 20  |se")...$        |
000022f0  20 20 20 20 20 20 20 20  41 44 44 20 20 20 20 20  |        ADD     |
00002300  52 30 2c 52 30 2c 52 34  0d 07 ee 24 20 20 20 20  |R0,R0,R4...$    |
00002310  20 20 20 20 20 20 20 20  20 20 20 20 41 44 44 20  |            ADD |
00002320  20 20 20 20 52 32 2c 52  31 2c 52 35 0d 07 f8 2a  |    R2,R1,R5...*|
00002330  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002340  41 44 52 20 20 20 20 20  52 31 2c 6f 73 77 6f 72  |ADR     R1,oswor|
00002350  64 62 6c 6f 63 6b 0d 08  02 48 20 20 20 20 20 20  |dblock...H      |
00002360  20 20 20 20 20 20 20 20  20 20 53 54 52 42 20 20  |          STRB  |
00002370  20 20 52 30 2c 5b 52 31  2c 23 31 5d 20 20 20 20  |  R0,[R1,#1]    |
00002380  20 20 3b 20 53 74 6f 72  65 20 6e 65 77 20 6d 6f  |  ; Store new mo|
00002390  75 73 65 20 58 20 69 6e  20 62 6c 6f 63 6b 0d 08  |use X in block..|
000023a0  0c 28 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.(              |
000023b0  20 20 4d 4f 56 20 20 20  20 20 52 30 2c 52 30 2c  |  MOV     R0,R0,|
000023c0  4c 53 52 20 23 38 0d 08  16 26 20 20 20 20 20 20  |LSR #8...&      |
000023d0  20 20 20 20 20 20 20 20  20 20 53 54 52 42 20 20  |          STRB  |
000023e0  20 20 52 30 2c 5b 52 31  2c 23 32 5d 0d 08 20 48  |  R0,[R1,#2].. H|
000023f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002400  53 54 52 42 20 20 20 20  52 32 2c 5b 52 31 2c 23  |STRB    R2,[R1,#|
00002410  33 5d 20 20 20 20 20 20  3b 20 53 74 6f 72 65 20  |3]      ; Store |
00002420  6e 65 77 20 6d 6f 75 73  65 20 59 20 69 6e 20 62  |new mouse Y in b|
00002430  6c 6f 63 6b 0d 08 2a 28  20 20 20 20 20 20 20 20  |lock..*(        |
00002440  20 20 20 20 20 20 20 20  4d 4f 56 20 20 20 20 20  |        MOV     |
00002450  52 32 2c 52 32 2c 4c 53  52 20 23 38 0d 08 34 26  |R2,R2,LSR #8..4&|
00002460  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002470  53 54 52 42 20 20 20 20  52 32 2c 5b 52 31 2c 23  |STRB    R2,[R1,#|
00002480  34 5d 0d 08 3e 22 20 20  20 20 20 20 20 20 20 20  |4]..>"          |
00002490  20 20 20 20 20 20 4d 4f  56 20 20 20 20 20 52 30  |      MOV     R0|
000024a0  2c 23 32 31 0d 08 48 3f  20 20 20 20 20 20 20 20  |,#21..H?        |
000024b0  20 20 20 20 20 20 20 20  a4 73 77 69 20 20 20 28  |        .swi   (|
000024c0  22 4f 53 5f 57 6f 72 64  22 29 20 20 20 20 20 3b  |"OS_Word")     ;|
000024d0  20 53 65 74 20 6d 6f 75  73 65 20 70 6f 73 69 74  | Set mouse posit|
000024e0  69 6f 6e 0d 08 52 2b 2e  6e 6f 65 76 65 6e 74 20  |ion..R+.noevent |
000024f0  20 20 20 20 20 20 20 4c  44 4d 46 44 20 20 20 52  |       LDMFD   R|
00002500  31 33 21 2c 7b 52 30 2d  52 35 2c 50 43 7d 0d 08  |13!,{R0-R5,PC}..|
00002510  5c 28 2e 6f 73 77 6f 72  64 62 6c 6f 63 6b 20 20  |\(.oswordblock  |
00002520  20 20 45 51 55 53 20 20  20 20 bd 28 33 29 2b c4  |  EQUS    .(3)+.|
00002530  37 2c 62 6c 24 29 0d 08  66 04 0d 08 70 0e 2e 6d  |7,bl$)..f...p..m|
00002540  6f 75 73 65 74 72 61 70  0d 08 7a 27 3b 20 4f 6e  |ousetrap..z'; On|
00002550  20 65 6e 74 72 79 2c 20  20 20 20 20 52 30 2c 52  | entry,     R0,R|
00002560  31 20 20 20 3d 20 4d 6f  75 73 65 20 58 2c 59 0d  |1   = Mouse X,Y.|
00002570  08 84 2b 3b 20 20 20 20  20 20 20 20 20 20 20 20  |..+;            |
00002580  20 20 20 52 32 20 20 20  20 20 20 3d 20 4d 6f 75  |   R2      = Mou|
00002590  73 65 20 62 75 74 74 6f  6e 73 0d 08 8e 28 3b 20  |se buttons...(; |
000025a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 52 33  |              R3|
000025b0  20 20 20 20 20 20 3d 20  54 69 6d 65 20 73 74 61  |      = Time sta|
000025c0  6d 70 0d 08 98 4d 3b 20  4f 6e 20 65 78 69 74 2c  |mp...M; On exit,|
000025d0  20 20 20 20 20 20 52 32  20 20 20 20 20 20 3d 20  |      R2      = |
000025e0  50 6f 73 73 69 62 6c 79  20 66 61 6b 65 64 20 28  |Possibly faked (|
000025f0  64 65 70 65 6e 64 69 6e  67 20 6f 6e 20 41 6c 74  |depending on Alt|
00002600  29 20 6d 6f 75 73 65 20  62 75 74 74 6f 6e 73 0d  |) mouse buttons.|
00002610  08 a2 49 3b 20 4f 4b 2c  20 49 20 61 64 6d 69 74  |..I; OK, I admit|
00002620  20 69 74 2c 20 74 68 69  73 20 77 61 73 20 63 6f  | it, this was co|
00002630  70 69 65 64 20 76 65 72  62 61 74 69 6d 20 66 72  |pied verbatim fr|
00002640  6f 6d 20 50 61 67 65 20  38 32 2f 38 33 20 6f 66  |om Page 82/83 of|
00002650  20 74 68 65 20 6e 65 77  0d 08 ac 0d 3b 20 50 52  | the new....; PR|
00002660  4d 73 2e 2e 2e 0d 08 b6  31 20 20 20 20 20 20 20  |Ms......1       |
00002670  20 20 20 20 20 20 20 20  20 53 54 4d 46 44 20 20  |         STMFD  |
00002680  20 52 31 33 21 2c 7b 52  33 2c 52 31 30 2d 52 31  | R13!,{R3,R10-R1|
00002690  32 2c 52 31 34 7d 0d 08  c0 25 20 20 20 20 20 20  |2,R14}...%      |
000026a0  20 20 20 20 20 20 20 20  20 20 53 54 4d 46 44 20  |          STMFD |
000026b0  20 20 52 31 33 21 2c 7b  50 43 7d 0d 08 ca 26 20  |  R13!,{PC}...& |
000026c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 41  |               A|
000026d0  44 44 20 20 20 20 20 52  31 32 2c 52 31 33 2c 23  |DD     R12,R13,#|
000026e0  38 0d 08 d4 2c 20 20 20  20 20 20 20 20 20 20 20  |8...,           |
000026f0  20 20 20 20 20 4c 44 4d  49 41 20 20 20 52 31 32  |     LDMIA   R12|
00002700  2c 7b 52 31 30 2d 52 31  32 2c 50 43 7d 0d 08 de  |,{R10-R12,PC}...|
00002710  29 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |)               |
00002720  20 4c 44 52 20 20 20 20  20 52 31 32 2c 5b 52 31  | LDR     R12,[R1|
00002730  33 2c 23 31 32 5d 0d 08  e8 25 20 20 20 20 20 20  |3,#12]...%      |
00002740  20 20 20 20 20 20 20 20  20 20 53 54 4d 46 44 20  |          STMFD |
00002750  20 20 52 31 33 21 2c 7b  52 33 7d 0d 08 f2 3f 20  |  R13!,{R3}...? |
00002760  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4c  |               L|
00002770  44 52 42 20 20 20 20 52  33 2c 61 6c 74 6b 65 79  |DRB    R3,altkey|
00002780  73 74 61 74 75 73 20 3b  20 49 73 20 41 6c 74 20  |status ; Is Alt |
00002790  6b 65 79 20 64 6f 77 6e  20 3f 0d 08 fc 21 20 20  |key down ?...!  |
000027a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 4d 4f  |              MO|
000027b0  56 53 20 20 20 20 52 33  2c 52 33 0d 09 06 27 20  |VS    R3,R3...' |
000027c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 42  |               B|
000027d0  45 51 20 20 20 20 20 6e  6f 72 6d 61 6c 6d 6f 75  |EQ     normalmou|
000027e0  73 65 0d 09 10 4a 20 20  20 20 20 20 20 20 20 20  |se...J          |
000027f0  20 20 20 20 20 20 4c 44  52 42 20 20 20 20 52 33  |      LDRB    R3|
00002800  2c 72 6d 62 73 74 61 74  75 73 20 20 20 20 3b 20  |,rmbstatus    ; |
00002810  59 65 73 2c 20 73 6f 20  27 66 61 6b 65 27 20 6d  |Yes, so 'fake' m|
00002820  6f 75 73 65 20 62 75 74  74 6f 6e 73 0d 09 1a 23  |ouse buttons...#|
00002830  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002840  84 52 20 20 20 20 20 52  32 2c 52 32 2c 52 33 0d  |.R     R2,R2,R3.|
00002850  09 24 28 20 20 20 20 20  20 20 20 20 20 20 20 20  |.$(             |
00002860  20 20 20 4c 44 52 42 20  20 20 20 52 33 2c 6d 6d  |   LDRB    R3,mm|
00002870  62 73 74 61 74 75 73 0d  09 2e 2a 20 20 20 20 20  |bstatus...*     |
00002880  20 20 20 20 20 20 20 20  20 20 20 84 52 20 20 20  |           .R   |
00002890  20 20 52 32 2c 52 32 2c  52 33 2c 41 53 4c 20 23  |  R2,R2,R3,ASL #|
000028a0  31 0d 09 38 28 20 20 20  20 20 20 20 20 20 20 20  |1..8(           |
000028b0  20 20 20 20 20 4c 44 52  42 20 20 20 20 52 33 2c  |     LDRB    R3,|
000028c0  6c 6d 62 73 74 61 74 75  73 0d 09 42 2a 20 20 20  |lmbstatus..B*   |
000028d0  20 20 20 20 20 20 20 20  20 20 20 20 20 84 52 20  |             .R |
000028e0  20 20 20 20 52 32 2c 52  32 2c 52 33 2c 41 53 4c  |    R2,R2,R3,ASL|
000028f0  20 23 32 0d 09 4c 25 2e  6e 6f 72 6d 61 6c 6d 6f  | #2..L%.normalmo|
00002900  75 73 65 20 20 20 20 4c  44 4d 46 44 20 20 20 52  |use    LDMFD   R|
00002910  31 33 21 2c 7b 52 33 7d  0d 09 56 34 20 20 20 20  |13!,{R3}..V4    |
00002920  20 20 20 20 20 20 20 20  20 20 20 20 4c 44 4d 46  |            LDMF|
00002930  44 20 20 20 52 31 33 21  2c 7b 52 33 2c 52 31 30  |D   R13!,{R3,R10|
00002940  2d 52 31 32 2c 52 31 34  2c 50 43 7d 0d 09 60 04  |-R12,R14,PC}..`.|
00002950  0d 09 6a 0f 2e 69 6e 73  65 72 74 74 72 61 70 0d  |..j..inserttrap.|
00002960  09 74 31 3b 20 4f 6e 20  65 6e 74 72 79 2c 20 20  |.t1; On entry,  |
00002970  20 20 20 52 30 20 20 20  20 20 20 3d 20 42 79 74  |   R0      = Byt|
00002980  65 20 74 6f 20 62 65 20  69 6e 73 65 72 74 65 64  |e to be inserted|
00002990  0d 09 7e 2b 3b 20 20 20  20 20 20 20 20 20 20 20  |..~+;           |
000029a0  20 20 20 20 52 31 20 20  20 20 20 20 3d 20 42 75  |    R1      = Bu|
000029b0  66 66 65 72 20 6e 75 6d  62 65 72 0d 09 88 49 3b  |ffer number...I;|
000029c0  20 4e 6f 74 65 20 2d 20  63 75 72 73 6f 72 20 6b  | Note - cursor k|
000029d0  65 79 73 20 61 72 65 20  31 34 30 2d 31 34 33 20  |eys are 140-143 |
000029e0  64 65 63 69 6d 61 6c 20  77 68 65 6e 20 65 6e 74  |decimal when ent|
000029f0  65 72 69 6e 67 20 74 68  69 73 20 72 6f 75 74 69  |ering this routi|
00002a00  6e 65 20 21 0d 09 92 2c  20 20 20 20 20 20 20 20  |ne !...,        |
00002a10  20 20 20 20 20 20 20 20  53 54 4d 46 44 20 20 20  |        STMFD   |
00002a20  52 31 33 21 2c 7b 52 30  2d 52 33 2c 52 31 34 7d  |R13!,{R0-R3,R14}|
00002a30  0d 09 9c 49 20 20 20 20  20 20 20 20 20 20 20 20  |...I            |
00002a40  20 20 20 20 4d 4f 56 53  20 20 20 20 52 31 2c 52  |    MOVS    R1,R|
00002a50  31 20 20 20 20 20 20 20  20 20 20 20 3b 20 49 73  |1           ; Is|
00002a60  20 69 74 20 74 68 65 20  6b 65 79 62 6f 61 72 64  | it the keyboard|
00002a70  20 62 75 66 66 65 72 20  3f 0d 09 a6 26 20 20 20  | buffer ?...&   |
00002a80  20 20 20 20 20 20 20 20  20 20 20 20 20 42 4e 45  |             BNE|
00002a90  20 20 20 20 20 6e 6f 74  6b 65 79 62 75 66 66 0d  |     notkeybuff.|
00002aa0  09 b0 3c 20 20 20 20 20  20 20 20 20 20 20 20 20  |..<             |
00002ab0  20 20 20 4c 44 52 42 20  20 20 20 52 31 2c 61 6c  |   LDRB    R1,al|
00002ac0  74 6b 65 79 73 74 61 74  75 73 20 3b 20 41 6c 74  |tkeystatus ; Alt|
00002ad0  20 6b 65 79 20 64 6f 77  6e 20 3f 0d 09 ba 21 20  | key down ?...! |
00002ae0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 4d  |               M|
00002af0  4f 56 53 20 20 20 20 52  31 2c 52 31 0d 09 c4 26  |OVS    R1,R1...&|
00002b00  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002b10  42 45 51 20 20 20 20 20  6e 6f 74 6b 65 79 62 75  |BEQ     notkeybu|
00002b20  66 66 0d 09 ce 41 20 20  20 20 20 20 20 20 20 20  |ff...A          |
00002b30  20 20 20 20 20 20 43 4d  50 20 20 20 20 20 52 30  |      CMP     R0|
00002b40  2c 23 31 34 33 20 3b 20  49 73 20 69 74 20 69 6e  |,#143 ; Is it in|
00002b50  20 63 75 72 73 6f 72 20  6b 65 79 20 72 61 6e 67  | cursor key rang|
00002b60  65 20 3f 0d 09 d8 26 20  20 20 20 20 20 20 20 20  |e ?...&         |
00002b70  20 20 20 20 20 20 20 42  47 54 20 20 20 20 20 6e  |       BGT     n|
00002b80  6f 74 6b 65 79 62 75 66  66 0d 09 e2 3d 20 20 20  |otkeybuff...=   |
00002b90  20 20 20 20 20 20 20 20  20 20 20 20 20 43 4d 50  |             CMP|
00002ba0  20 20 20 20 20 52 30 2c  23 31 34 30 20 3b 20 59  |     R0,#140 ; Y|
00002bb0  65 73 2c 20 73 6f 20 63  6c 61 69 6d 20 74 68 69  |es, so claim thi|
00002bc0  73 20 63 61 6c 6c 0d 09  ec 2f 20 20 20 20 20 20  |s call.../      |
00002bd0  20 20 20 20 20 20 20 20  20 20 4c 44 4d 47 45 46  |          LDMGEF|
00002be0  44 20 52 31 33 21 2c 7b  52 30 2d 52 33 2c 52 31  |D R13!,{R0-R3,R1|
00002bf0  34 2c 50 43 7d 0d 09 f6  2b 2e 6e 6f 74 6b 65 79  |4,PC}...+.notkey|
00002c00  62 75 66 66 20 20 20 20  20 4c 44 4d 46 44 20 20  |buff     LDMFD  |
00002c10  20 52 31 33 21 2c 7b 52  30 2d 52 33 2c 50 43 7d  | R13!,{R0-R3,PC}|
00002c20  0d 0a 00 04 0d 0a 0a 2c  2e 62 79 65 62 79 65 20  |.......,.byebye |
00002c30  20 20 20 20 20 20 20 20  53 54 4d 46 44 20 20 20  |        STMFD   |
00002c40  52 31 33 21 2c 7b 52 30  2d 52 32 2c 52 31 34 7d  |R13!,{R0-R2,R14}|
00002c50  0d 0a 14 44 20 20 20 20  20 20 20 20 20 20 20 20  |...D            |
00002c60  20 20 20 20 4d 4f 56 20  20 20 20 20 52 30 2c 23  |    MOV     R0,#|
00002c70  31 33 20 20 20 20 20 20  20 20 20 20 3b 20 44 69  |13          ; Di|
00002c80  73 61 62 6c 65 20 63 6c  61 69 6d 65 64 20 65 76  |sable claimed ev|
00002c90  65 6e 74 73 0d 0a 1e 26  20 20 20 20 20 20 20 20  |ents...&        |
00002ca0  20 20 20 20 20 20 20 20  42 4c 20 20 20 20 20 20  |        BL      |
00002cb0  74 72 61 70 65 76 65 6e  74 73 0d 0a 28 26 20 20  |trapevents..(&  |
00002cc0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 4d 4f  |              MO|
00002cd0  56 20 20 20 20 20 52 30  2c 23 45 76 65 6e 74 56  |V     R0,#EventV|
00002ce0  0d 0a 32 28 20 20 20 20  20 20 20 20 20 20 20 20  |..2(            |
00002cf0  20 20 20 20 41 44 52 20  20 20 20 20 52 31 2c 65  |    ADR     R1,e|
00002d00  76 65 6e 74 74 72 61 70  0d 0a 3c 21 20 20 20 20  |venttrap..<!    |
00002d10  20 20 20 20 20 20 20 20  20 20 20 20 4d 4f 56 20  |            MOV |
00002d20  20 20 20 20 52 32 2c 23  30 0d 0a 46 29 20 20 20  |    R2,#0..F)   |
00002d30  20 20 20 20 20 20 20 20  20 20 20 20 20 53 57 49  |             SWI|
00002d40  20 20 20 20 20 22 58 4f  53 5f 52 65 6c 65 61 73  |     "XOS_Releas|
00002d50  65 22 0d 0a 50 24 20 20  20 20 20 20 20 20 20 20  |e"..P$          |
00002d60  20 20 20 20 20 20 4d 4f  56 20 20 20 20 20 52 30  |      MOV     R0|
00002d70  2c 23 49 6e 73 56 0d 0a  5a 29 20 20 20 20 20 20  |,#InsV..Z)      |
00002d80  20 20 20 20 20 20 20 20  20 20 41 44 52 20 20 20  |          ADR   |
00002d90  20 20 52 31 2c 69 6e 73  65 72 74 74 72 61 70 0d  |  R1,inserttrap.|
00002da0  0a 64 21 20 20 20 20 20  20 20 20 20 20 20 20 20  |.d!             |
00002db0  20 20 20 4d 4f 56 20 20  20 20 20 52 32 2c 23 30  |   MOV     R2,#0|
00002dc0  0d 0a 6e 29 20 20 20 20  20 20 20 20 20 20 20 20  |..n)            |
00002dd0  20 20 20 20 53 57 49 20  20 20 20 20 22 58 4f 53  |    SWI     "XOS|
00002de0  5f 52 65 6c 65 61 73 65  22 0d 0a 78 26 20 20 20  |_Release"..x&   |
00002df0  20 20 20 20 20 20 20 20  20 20 20 20 20 4d 4f 56  |             MOV|
00002e00  20 20 20 20 20 52 30 2c  23 4d 6f 75 73 65 56 0d  |     R0,#MouseV.|
00002e10  0a 82 28 20 20 20 20 20  20 20 20 20 20 20 20 20  |..(             |
00002e20  20 20 20 41 44 52 20 20  20 20 20 52 31 2c 6d 6f  |   ADR     R1,mo|
00002e30  75 73 65 74 72 61 70 0d  0a 8c 21 20 20 20 20 20  |usetrap...!     |
00002e40  20 20 20 20 20 20 20 20  20 20 20 4d 4f 56 20 20  |           MOV  |
00002e50  20 20 20 52 32 2c 23 30  0d 0a 96 29 20 20 20 20  |   R2,#0...)    |
00002e60  20 20 20 20 20 20 20 20  20 20 20 20 53 57 49 20  |            SWI |
00002e70  20 20 20 20 22 58 4f 53  5f 52 65 6c 65 61 73 65  |    "XOS_Release|
00002e80  22 0d 0a a0 2b 20 20 20  20 20 20 20 20 20 20 20  |"...+           |
00002e90  20 20 20 20 20 4c 44 4d  46 44 20 20 20 52 31 33  |     LDMFD   R13|
00002ea0  21 2c 7b 52 30 2d 52 32  2c 50 43 7d 0d 0a aa 04  |!,{R0-R2,PC}....|
00002eb0  0d 0a b4 0c 2e 4f 53 5f  43 61 6c 6c 0d 0a be 2d  |.....OS_Call...-|
00002ec0  3b 20 4f 6e 20 65 6e 74  72 79 2c 20 20 20 20 20  |; On entry,     |
00002ed0  52 30 2d 52 32 20 20 20  3d 20 53 57 49 20 63 61  |R0-R2   = SWI ca|
00002ee0  6c 6c 20 70 61 72 61 6d  73 0d 0a c8 35 3b 20 20  |ll params...5;  |
00002ef0  20 20 20 20 20 20 20 20  20 20 20 20 20 52 33 20  |             R3 |
00002f00  20 20 20 20 20 3d 20 53  57 49 20 4e 75 6d 62 65  |     = SWI Numbe|
00002f10  72 20 28 6e 6f 74 20 58  20 66 6f 72 6d 29 0d 0a  |r (not X form)..|
00002f20  d2 2c 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.,              |
00002f30  20 20 53 54 4d 46 44 20  20 20 52 31 33 21 2c 7b  |  STMFD   R13!,{|
00002f40  52 34 2c 52 35 2c 52 31  34 7d 0d 0a dc 27 20 20  |R4,R5,R14}...'  |
00002f50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 4c 44  |              LD|
00002f60  52 20 20 20 20 20 52 35  2c 53 57 49 49 6e 73 74  |R     R5,SWIInst|
00002f70  72 0d 0a e6 26 20 20 20  20 20 20 20 20 20 20 20  |r...&           |
00002f80  20 20 20 20 20 42 49 43  20 20 20 20 20 52 35 2c  |     BIC     R5,|
00002f90  52 35 2c 23 26 46 46 0d  0a f0 23 20 20 20 20 20  |R5,#&FF...#     |
00002fa0  20 20 20 20 20 20 20 20  20 20 20 84 52 20 20 20  |           .R   |
00002fb0  20 20 52 35 2c 52 35 2c  52 33 0d 0a fa 4d 20 20  |  R5,R5,R3...M  |
00002fc0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 53 54  |              ST|
00002fd0  52 20 20 20 20 20 52 35  2c 53 57 49 49 6e 73 74  |R     R5,SWIInst|
00002fe0  72 20 20 20 20 20 3b 20  4e 61 75 67 68 74 79 20  |r     ; Naughty |
00002ff0  21 20 53 65 6c 66 2d 6d  6f 64 69 66 79 69 6e 67  |! Self-modifying|
00003000  20 63 6f 64 65 20 21 0d  0b 04 21 20 20 20 20 20  | code !...!     |
00003010  20 20 20 20 20 20 20 20  20 20 20 4d 4f 56 20 20  |           MOV  |
00003020  20 20 20 52 34 2c 50 43  0d 0b 0e 2a 20 20 20 20  |   R4,PC...*    |
00003030  20 20 20 20 20 20 20 20  20 20 20 20 84 52 20 20  |            .R  |
00003040  20 20 20 52 35 2c 52 34  2c 23 53 56 43 5f 4d 6f  |   R5,R4,#SVC_Mo|
00003050  64 65 0d 0b 18 21 20 20  20 20 20 20 20 20 20 20  |de...!          |
00003060  20 20 20 20 20 20 54 45  51 50 20 20 20 20 52 35  |      TEQP    R5|
00003070  2c 23 30 0d 0b 22 21 20  20 20 20 20 20 20 20 20  |,#0.."!         |
00003080  20 20 20 20 20 20 20 4d  4f 56 4e 56 20 20 20 52  |       MOVNV   R|
00003090  30 2c 52 30 0d 0b 2c 26  20 20 20 20 20 20 20 20  |0,R0..,&        |
000030a0  20 20 20 20 20 20 20 20  53 54 4d 46 44 20 20 20  |        STMFD   |
000030b0  52 31 33 21 2c 7b 52 31  34 7d 0d 0b 36 28 2e 53  |R13!,{R14}..6(.S|
000030c0  57 49 49 6e 73 74 72 20  20 20 20 20 20 20 53 57  |WIInstr       SW|
000030d0  49 20 20 20 20 20 22 58  4f 53 5f 57 72 69 74 65  |I     "XOS_Write|
000030e0  43 22 0d 0b 40 26 20 20  20 20 20 20 20 20 20 20  |C"..@&          |
000030f0  20 20 20 20 20 20 4c 44  4d 46 44 20 20 20 52 31  |      LDMFD   R1|
00003100  33 21 2c 7b 52 31 34 7d  0d 0b 4a 21 20 20 20 20  |3!,{R14}..J!    |
00003110  20 20 20 20 20 20 20 20  20 20 20 20 54 45 51 50  |            TEQP|
00003120  20 20 20 20 52 34 2c 23  30 0d 0b 54 21 20 20 20  |    R4,#0..T!   |
00003130  20 20 20 20 20 20 20 20  20 20 20 20 20 4d 4f 56  |             MOV|
00003140  4e 56 20 20 20 52 30 2c  52 30 0d 0b 5e 2b 20 20  |NV   R0,R0..^+  |
00003150  20 20 20 20 20 20 20 20  20 20 20 20 20 20 4c 44  |              LD|
00003160  4d 46 44 20 20 20 52 31  33 21 2c 7b 52 34 2c 52  |MFD   R13!,{R4,R|
00003170  35 2c 50 43 7d 0d 0b 68  04 0d 0b 72 1d 2e 61 6c  |5,PC}..h...r..al|
00003180  74 6b 65 79 73 74 61 74  75 73 20 20 20 45 51 55  |tkeystatus   EQU|
00003190  42 20 20 20 20 30 0d 0b  7c 1d 2e 6c 65 66 74 73  |B    0..|..lefts|
000031a0  74 61 74 75 73 20 20 20  20 20 45 51 55 42 20 20  |tatus     EQUB  |
000031b0  20 20 30 0d 0b 86 1d 2e  72 69 67 68 74 73 74 61  |  0.....rightsta|
000031c0  74 75 73 20 20 20 20 45  51 55 42 20 20 20 20 30  |tus    EQUB    0|
000031d0  0d 0b 90 1d 2e 75 70 73  74 61 74 75 73 20 20 20  |.....upstatus   |
000031e0  20 20 20 20 45 51 55 42  20 20 20 20 30 0d 0b 9a  |    EQUB    0...|
000031f0  1d 2e 64 6f 77 6e 73 74  61 74 75 73 20 20 20 20  |..downstatus    |
00003200  20 45 51 55 42 20 20 20  20 30 0d 0b a4 1d 2e 6c  | EQUB    0.....l|
00003210  6d 62 73 74 61 74 75 73  20 20 20 20 20 20 45 51  |mbstatus      EQ|
00003220  55 42 20 20 20 20 30 0d  0b ae 1d 2e 6d 6d 62 73  |UB    0.....mmbs|
00003230  74 61 74 75 73 20 20 20  20 20 20 45 51 55 42 20  |tatus      EQUB |
00003240  20 20 20 30 0d 0b b8 1d  2e 72 6d 62 73 74 61 74  |   0.....rmbstat|
00003250  75 73 20 20 20 20 20 20  45 51 55 42 20 20 20 20  |us      EQUB    |
00003260  30 0d 0b c2 1d 2e 6d 6f  75 73 65 73 70 65 65 64  |0.....mousespeed|
00003270  20 20 20 20 20 45 51 55  42 20 20 20 20 30 0d 0b  |     EQUB    0..|
00003280  cc 1d 2e 66 61 6b 65 31  76 61 6c 20 20 20 20 20  |...fake1val     |
00003290  20 20 45 51 55 42 20 20  20 20 30 0d 0b d6 1d 2e  |  EQUB    0.....|
000032a0  66 61 6b 65 32 76 61 6c  20 20 20 20 20 20 20 45  |fake2val       E|
000032b0  51 55 42 20 20 20 20 30  0d 0b e0 1d 2e 6c 65 66  |QUB    0.....lef|
000032c0  74 6d 6f 75 73 65 76 61  6c 20 20 20 45 51 55 42  |tmouseval   EQUB|
000032d0  20 20 20 20 30 0d 0b ea  1d 2e 6d 69 64 6d 6f 75  |    0.....midmou|
000032e0  73 65 76 61 6c 20 20 20  20 45 51 55 42 20 20 20  |seval    EQUB   |
000032f0  20 30 0d 0b f4 1d 2e 72  69 67 68 74 6d 6f 75 73  | 0.....rightmous|
00003300  65 76 61 6c 20 20 45 51  55 42 20 20 20 20 30 0d  |eval  EQUB    0.|
00003310  0b fe 19 20 20 20 20 20  20 20 20 20 20 20 20 20  |...             |
00003320  20 20 20 41 4c 49 47 4e  0d 0c 08 06 5d ed 0d 0c  |   ALIGN....]...|
00003330  12 20 46 24 3d 22 24 2e  21 22 2b 6e 61 6d 65 24  |. F$="$.!"+name$|
00003340  2b 22 2e 22 2b 6e 61 6d  65 24 2b 22 20 22 0d 0c  |+"."+name$+" "..|
00003350  1c 1b ff 22 53 2e 22 2b  46 24 2b c3 7e 6f 72 67  |..."S."+F$+.~org|
00003360  2b 22 20 22 2b c3 7e 50  25 0d 0c 26 1b ff 22 53  |+" "+.~P%..&.."S|
00003370  65 74 54 79 70 65 20 22  2b 46 24 2b 22 4d 6f 64  |etType "+F$+"Mod|
00003380  75 6c 65 22 0d 0c 30 0e  2a 50 6f 69 6e 74 65 72  |ule"..0.*Pointer|
00003390  20 31 0d 0c 31 10 ff 22  24 2e 21 22 2b 6e 61 6d  | 1..1.."$.!"+nam|
000033a0  65 24 0d 0c 4e 05 e0 0d  0c 58 04 0d 0c 80 0f dd  |e$..N....X......|
000033b0  a4 73 77 69 28 73 77 69  24 29 0d 0c 8a 21 f4 20  |.swi(swi$)...!. |
000033c0  4e 65 61 74 20 6c 69 74  74 6c 65 20 6d 61 63 72  |Neat little macr|
000033d0  6f 20 6f 72 20 77 68 61  74 20 3f 0d 0c 94 08 ea  |o or what ?.....|
000033e0  20 42 25 0d 0c 9e 35 24  73 77 69 25 3d 73 77 69  | B%...5$swi%=swi|
000033f0  24 3a c8 99 20 22 4f 53  5f 53 57 49 4e 75 6d 62  |$:.. "OS_SWINumb|
00003400  65 72 46 72 6f 6d 53 74  72 69 6e 67 22 2c 2c 73  |erFromString",,s|
00003410  77 69 25 20 b8 20 42 25  0d 0c a8 0b 5b 4f 50 54  |wi% . B%....[OPT|
00003420  20 41 25 0d 0c b2 22 20  20 20 20 20 20 20 20 20  | A%..."         |
00003430  20 20 20 20 20 20 20 4d  4f 56 20 20 20 20 20 52  |       MOV     R|
00003440  33 2c 23 42 25 0d 0c bc  23 20 20 20 20 20 20 20  |3,#B%...#       |
00003450  20 20 20 20 20 20 20 20  20 42 4c 20 20 20 20 20  |         BL     |
00003460  20 4f 53 5f 43 61 6c 6c  0d 0c c6 08 5d 3d 41 25  | OS_Call....]=A%|
00003470  0d ff                                             |..|
00003472