Home » Archimedes archive » Acorn User » AU 1995-09.adf » !Regulars » Regulars/StarInfo/Stirling/!MityMouse/MightySrc

Regulars/StarInfo/Stirling/!MityMouse/MightySrc

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 » Acorn User » AU 1995-09.adf » !Regulars
Filename: Regulars/StarInfo/Stirling/!MityMouse/MightySrc
Read OK:
File size: 4F14 bytes
Load address: 0000
Exec address: 0000
Duplicates

There is 1 duplicate copy of this file in the archive:

File contents
    1REM>MightySrc
    2REM Version       1.00
    3REM Release date  04 Mar 1995
    4REM Author        Michael Stirling
    5REM Source code for module MightyMouse
    6REM Editor work area = 110
    7
    8ONERROR REPORT:PRINT" at line ";ERL:END
    9
   10REM ************************************************************************************
   11REM ALTER THE FOLLOWING 3 VARIABLES TO DEFINE LOCATION, BIT TO STORE BUTTONS STATUS
   12REM AND THE SWI CHUNK NUMBER IN CASE OF A CLASH WITH OTHER SOFTWARE
   13SwiChunk% =&7FF :REM Range: 0 to &7FF   
   14CMOSloc%  =30   :REM Range: 30 to 45       NOTE: User range reserved by Acorn
   15CMOSbit%  =0    :REM Range: 0 to 7
   16REM ************************************************************************************
   17
   18MODE MODE
   19OFF
   20version$="1.00"
   21
   22PROCSetUp
   23PROCasm
   24PROCsave
   25END
   26
   27DEFPROCSetUp
   28REM Perform range checking
   29range=FALSE
   30IF (SwiChunk% AND &7FF) <> SwiChunk% PRINT"SwiChunk% out of range 0 to &7FF":range=TRUE
   31IF (CMOSloc%  AND &0FF) <> CMOSloc%  PRINT"CMOSloc% out of range 0 to &FF"  :range=TRUE
   32IF (CMOSbit%  AND &007) <> CMOSbit%  PRINT"CMOSbit% out of range 0 to 7"    :range=TRUE
   33SYS "OS_ReadRAMFsLimits" TO R0,R1
   34IF R1-R0=0 PRINT"MightySrc requires a RAM disc of at least 8K to run.":range=TRUE
   35IF range=TRUE THEN END
   36
   37bit=CMOSbit%
   38CMOSbit%=1<<CMOSbit%
   39
   40REM Module variables
   41ModuleName$ ="MightyMouse"
   42SwiHeader$  ="MightyMouse"
   43
   44Bits1819%=%01
   45IF (Bits1819% AND %11) <> Bits1819% PRINT"Bits1819% out of range 0 to 3. See PRM for details of correct values to use.":END
   46Bits1819%=Bits1819%<<18
   47SwiChunk%=SwiChunk%<<06
   48SwiBase=Bits1819%+SwiChunk% :REM SwiBase must be MOD 64
   49REM SwiBase can never be anything other than MOD 64, but the following error check is kept for good measure
   50IF SwiBase MOD 64<>0 PRINT"SwiBase=&";~SwiBase". Must be MOD 64.":END
   51
   52REM Assembler variables
   53save        =TRUE
   54OptLo       =%1100
   55OptHi       =%1110
   56CodeSize    =4096
   57DIM code CodeSize, L%-1
   58
   59lk          =14
   60ENDPROC
   61
   62DEFPROCasm
   63PRINT'"Assembling module..."
   64FOR pass= OptLo TO OptHi STEP (OptHi - OptLo)
   65IF OptLo AND %100 THEN P%=0:O%=code ELSE P%=code:O%=0
   66
   67[   OPT     pass
   68    EQUD    0                   \Start code
   69    EQUD    init                \Initialisation code
   70    EQUD    final               \Finalisation code
   71    EQUD    service             \Service call handler
   72    EQUD    title               \Title string
   73    EQUD    help                \Help string
   74    EQUD    commands            \Help and command keyword table
   75    EQUD    SwiBase             \SWI chunk base number (optional)
   76    EQUD    SwiHandler          \SWI handler code      (optional)
   77    EQUD    SwiNames            \SWI decoding table    (optional)
   78    EQUD    0                   \SWI decoding code     (optional)
   79
   80.init
   81    STMFD   13!,{7-11,14}       \Must preserve R7-R11 & R13
   82    MOV     1,#CMOSloc%         \Read status
   83    MOV     4,#0                \at location CMOSloc%,
   84    BL      ReadWriteCmos       \bit CMOSbit%
   85    TST     2,#CMOSbit%
   86    BLNE    claim               \Swap buttons if configured swapped in CMOS RAM
   87    MOVEQ   0,#0
   88    STREQ   0,InterceptFlag     \Setting flag here is only important for initialisation after soft reset 
   89    ADRVS   0,ClaimErrorMsg     \Report MouseV claim failed, if it was not successful and
   90    LDMFD   13!,{7-11,PC}       \do not initialise module
   91
   92.ClaimErrorMsg
   93    EQUD    0
   94    EQUS    "MightyMouse module initialisation failed."
   95    EQUB    0
   96    ALIGN
   97
   98.final
   99    STMFD   13!,{7-11,14}
  100    BL      release
  101    LDMFD   13!,{7-11,PC}^      \NOTE - Do not want to generate error on exit as module will refuse to die.
  102                                \       Of course this means the computer might crash, if intercept routine
  103                                \       is still running, but it is umlikely to be.
  104
  105.service                        \Re-initialise module & display post-reset message 
  106    STMFD   13!,{0-11,14}
  107    CMP     1,#&27
  108    LDMNEFD 13!,{0-11,PC}
  109    BL      init
  110              
  111    LDR     0,InterceptFlag
  112    CMP     0,#0
  113    ADREQ   0,normal
  114    ADRNE   0,swop
  115    SWI     "OS_Write0"
  116    LDMFD   13!,{0-11,PC}^
  117
  118.normal
  119    EQUS    "Mouse buttons normal"
  120    EQUW    &0A0D
  121    EQUB    0
  122    ALIGN
  123
  124.swop
  125    EQUS    "Mouse buttons swapped"
  126    EQUW    &0A0D
  127    EQUB    0
  128    ALIGN
  129
  130.title
  131    EQUS    ModuleName$
  132    EQUB    0
  133    ALIGN
  134
  135.help
  136    EQUS    "MightyMouse	"+version$+" ("+MID$(TIME$,5,11)+") � Michael Stirling"
  137    EQUB    0
  138    ALIGN
  139
  140.commands
  141    EQUS    "Buttons"
  142    EQUB    0
  143    ALIGN
  144
  145    EQUD    decode
  146    EQUD    &00010100           \Information word
  147    EQUD    SyntaxMessage       \Error message
  148    EQUD    CommandHelp         \Help message
  149
  150    EQUS    "Buttons"            
  151    EQUB    0
  152    ALIGN
  153
  154    EQUD    DecodeStatus
  155    EQUD    &40000000         
  156    EQUD    0               
  157    EQUD    0
  158
  159    EQUS    "MightyInfo"
  160    EQUB    0
  161    ALIGN
  162
  163    EQUD    0
  164    EQUD    &20000000
  165    EQUD    0
  166    EQUD    HelpCode
  167    
  168    EQUD    0                   \Terminator
  169
  170.decode
  171    STMFD   13!,{7-11,14}       \R7-R11 must be preserved. R0=error pointer if anything goes wrong
  172
  173    CMP     1,#0                \If command has no parameters, then show CMOS button status
  174    BEQ     ShowStatus          
  175
  176    CMP     1,#1                \If command has more than 1 parameter,
  177    BHI     BadSyntax           \then terminate with an error message
  178
  179    LDRB    1,[0,#2]            \Note - OS always terminates parameters with &0D20
  180    CMP     1,#13               \If R1<>13 then parameter is not 1 character long,
  181    BNE     BadSyntax           \so terminate command with an error message
  182
  183    LDRB    0,[0]               \Get parameter, command has only 1 character, letter or digit
  184
  185    CMP     0,#ASC"0"           \If parameter is not one of characters 0,1,2,3
  186    BLT     BadSyntax           \then terminate command with an error message,
  187                                \otherwise command is valid & can be processed
  188    CMP     0,#ASC"3"
  189    BHI     BadSyntax       
  190
  191\PROCESS BUTTONS PARAMETER
  192
  193    SUB     0,0,#ASC"0"         \Get numeric value of ascii code. Note only bits 0 & 1 are actually required
  194    STR     0,args              \Save decoded argument parameter for later
  195
  196    TST     0,#%10              \Configure new setting?
  197    BEQ     SetCurrent          \NO - Jump straight to SetCurrent
  198
  199    TST     0,#%01              \swap or not?
  200    MOVEQ   3,#0                \NO
  201    MOVNE   3,#CMOSbit%         \YES
  202
  203    MOV     1,#CMOSloc%         \Store status in CMOS RAM
  204    MOV     4,#CMOSbit%          
  205    BL      ReadWriteCmos
  206
  207.SetCurrent
  208    LDR     1,InterceptFlag     \Get current intercept status
  209    LDR     0,args              \Retrieve argument parameter
  210    TST     0,#%01
  211    BNE     swap
  212
  213\NORMAL ROUTINE - RELEASE VECTOR IF NOT ALREADY RELEASED
  214    TST     1,#1                \Z=0, claimed  Z=1, not claimed
  215    BLNE    release             \Quit if not claimed, else release vector
  216    ADRVS   0,CantRelease
  217    LDMFD   13!,{7-11,PC}
  218
  219.CantRelease
  220    EQUD    0
  221    EQUS    "Cannot return mouse buttons to normal, try reloading MightyMouse module."
  222    EQUW    &0A0D
  223    EQUB    0
  224    ALIGN
  225
  226\SWAP ROUTINE - CLAIM VECTOR IF NOT ALREADY CLAIMED
  227.swap
  228    TST     1,#1                \Z=0, claimed  Z=1, not claimed
  229    BLEQ    claim               \Quit if claimed, else release vector
  230    ADRVS   0,CantClaim
  231    LDMFD   13!,{7-11,PC}
  232
  233.CantClaim
  234    EQUD    0
  235    EQUS    "Cannot swap mouse buttons, try reloading MightyMouse module."
  236    EQUB    0
  237    ALIGN
  238
  239.ShowStatus
  240    LDR     7,InterceptFlag
  241    TST     7,#1                \Z=0, claimed  Z=1, not claimed
  242    BNE     currently
  243
  244    SWI     "XOS_WriteS"
  245    EQUS    "Mouse buttons normal & "
  246    EQUB    0
  247    ALIGN
  248
  249    B       cmos
  250
  251.currently
  252    SWI     "XOS_WriteS"
  253    EQUS    "Mouse buttons swapped & "
  254    EQUB    0
  255    ALIGN
  256
  257.cmos
  258    MOV     1,#CMOSloc%
  259    MOV     4,#0                \Mask=0 to read CMOS status
  260    BL      ReadWriteCmos
  261
  262    TST     2,#CMOSbit%
  263    BNE     swapped
  264
  265    SWI     "XOS_WriteS"
  266    EQUS    "configured normal."
  267    EQUW    &0A0D
  268    EQUB    0
  269    ALIGN
  270
  271    LDMFD   13!,{7-11,PC}^      
  272
  273.swapped
  274    SWI     "XOS_WriteS"
  275    EQUS    "configured swapped."
  276    EQUW    &0A0D
  277    EQUB    0
  278    ALIGN
  279
  280    LDMFD   13!,{7-11,PC}^
  281
  282.BadSyntax
  283    ADR     0,SyntaxError
  284    TEQP    PC,#&10000003       \Set V, remembering processor state
  285    LDMFD   13!,{7-11,PC}
  286
  287.SyntaxError
  288    EQUD    0
  289.SyntaxMessage
  290    EQUS    "Syntax: Buttons [0|1|2|3]"
  291    EQUB    0
  292    ALIGN
  293
  294.CommandHelp
  295    EQUS    "*Buttons configures the mouse buttons for right or left-handed operation."
  296    EQUW    &0A0D
  297    EQUS    "*Buttons with no parameters displays the current & configured normal/swapped mouse buttons status."
  298    EQUW    &0A0D
  299    EQUW    &0A0D
  300    EQUS    "Syntax: Buttons [0|1|2|3]"
  301    EQUW    &0A0D
  302    EQUS    "��������0 = Buttons normal"
  303    EQUW    &0A0D
  304    EQUS    "��������1 = Buttons swapped"
  305    EQUW    &0A0D
  306    EQUS    "��������2 = Buttons normal��& setting stored in CMOS RAM"
  307    EQUW    &0A0D
  308    EQUS    "��������3 = Buttons swapped & setting stored in CMOS RAM"
  309    EQUB    0
  310    ALIGN
  311
  312.DecodeStatus
  313    STMFD   13!,{7-11,14}       \R7-R11 must be preserved. R0=error pointer if anything goes wrong
  314
  315    CMP     0,#0                \Has *Configure by itself been entered?
  316    ADREQ   0,config            \YES - display configuration message & quit
  317    SWIEQ   "XOS_Write0"        \NO  - check R0 is not command tail pointer
  318    LDMEQFD 13!,{7-11,PC}^
  319
  320    CMP     0,#1                \Has *Configure Buttons been attempted?
  321    ADRHI   0,BadConfig         \YES - display error message & quit
  322    TEQHIP  PC,#&30000003       \Set C&V, remembering processor state
  323    LDMHIFD 13!,{7-11,PC}
  324
  325    MOV     0,#161              \Get CMOS RAM buttons setting
  326    MOV     1,#CMOSloc%
  327    SWI     "XOS_Byte"
  328
  329    TST     2,#CMOSbit%         \Reflect buttons setting with screen message
  330    ADREQ   0,NormalMSG
  331    ADRNE   0,SwappedMSG
  332    SWI     "XOS_Write0"
  333
  334    LDMFD   13!,{7-11,PC}^
  335
  336.config
  337    EQUS    "*Buttons   <2|3>"
  338    EQUW    &0A0D
  339    EQUB    0
  340    ALIGN
  341
  342.BadConfig
  343    EQUD    0
  344    EQUS    "Use *Buttons <2|3> to set the CMOS configuration."
  345    EQUB    0
  346    ALIGN
  347
  348.NormalMSG
  349    EQUS    "Mouse buttons normal."
  350    EQUW    &0A0D
  351    EQUB    0
  352    ALIGN
  353
  354.SwappedMSG
  355    EQUS    "Mouse buttons swapped."
  356    EQUW    &0A0D
  357    EQUB    0
  358    ALIGN
  359
  360.HelpCode
  361    ADR     0,info
  362    MOVS    PC,14
  363
  364.info
  365    EQUS    "Module MightyMouse swaps the Select & Adjust mouse buttons for left-handed users."
  366    EQUW    &0A0D
  367    EQUS    "SWI base��= &"+STR$~SwiBase
  368    EQUW    &0A0D
  369    EQUS    "SWI chunk = &"+STR$~(SwiChunk%>>>6)
  370    EQUW    &0A0D
  371    EQUS    "Configuration stored at CMOS RAM location "+STR$CMOSloc%+", bit "+STR$(bit)+"."
  372    EQUD    &0A0D0A0D
  373    EQUS    "v"+version$+" � Michael Stirling ("+MID$(TIME$,5,11)+")"
  374    EQUW    &0A0D
  375    EQUB    0
  376    ALIGN
  377
  378.SwiHandler
  379    LDR     12,[12]             \Get workspace pointer
  380
  381    CMP     11,#(EndSwiTable-SwiTable)/4
  382    ADDCC   PC,PC,11,LSL#2      \Dispatch if in range
  383    B       UnknownSWI          \Unknown SWI
  384                   
  385.SwiTable
  386    B       buttons             \Jump to SWI 0
  387    B       ReadWriteCmos       \Jump to SWI 1
  388
  389.EndSwiTable
  390
  391.UnknownSWI
  392    ADR     0,RangeError
  393    ORRS    PC,14,#1<<28        \Exit with overflow flag set
  394
  395.RangeError
  396    EQUD    &1E6
  397    EQUS    "Module MightyMouse v"+version$+" supports only two SWIs (SWI base = &"+STR$~SwiBase+")"
  398    EQUB    0
  399    ALIGN
  400
  401.SwiNames
  402    EQUS    SwiHeader$
  403    EQUB    0
  404
  405    EQUS    "Buttons"
  406    EQUB    0
  407
  408    EQUS    "CmosAccess"
  409    EQUB    0
  410
  411    EQUB    0                   \Terminator
  412    ALIGN
  413
  414.buttons
  415    STMFD   13!,{1-9,14}
  416    TEQP    PC,#3               \Clear flags
  417
  418\REFLECT PREVIOUS SETTINGS IN R0
  419    STR     0,reg0              \Preserve input
  420    STR     1,reg1              \parameters for later
  421
  422    MOV     0,#161              \Get configured normal/swapped buttons state
  423    MOV     1,#CMOSloc%
  424    SWI     "XOS_Byte"          \State returned in R2 at CMOSbit%
  425
  426    LDR     0,reg0              \Get input parameter R0
  427    TST     2,#CMOSbit%         \Configured buttons swapped?
  428    ORRNE   0,0,#%10            \YES - set   bit 1 preserving all other bits
  429    BICEQ   0,0,#%10            \NO  - reset bit 1 preserving all other bits
  430
  431    LDR     2,InterceptFlag     \Get current normal/swapped buttons state
  432    TST     2,#%01              \Buttons swapped?
  433    ORRNE   0,0,#%01            \YES - set   bit 0 preserving all other bits
  434    BICEQ   0,0,#%01            \NO  - reset bit 0 preserving all other bits
  435
  436    STR     0,reg0old           \This value of R0 to be returned on exit from SWI
  437
  438\MODIFY CURRENT & CONFIGURED BUTTONS STATUS AS PER INPUT PARAMETERS
  439    LDR     0,reg0              \Retrieve input parameters
  440    LDR     1,reg1              \from earlier
  441
  442    TST     1,#%10              \Is R1 bit 1 = 1? (mask=write)
  443    BEQ     R1bit1zero          \NO  - check R1 bit 0
  444
  445    TST     0,#%10              \YES - Is R0 bit 1 = 0?
  446    MOVEQ   3,#0                \YES - CMOS RAM = 0
  447    MOVNE   3,#CMOSbit%         \NO  - CMOS RAM = 1
  448
  449    MOV     1,#CMOSloc%     
  450    MOV     4,#CMOSbit%         \Get mask for ReadWriteCmos
  451    BL      ReadWriteCmos       \Write value to CMOS RAM
  452    LDR     0,reg0              \Retrieve input parameters 
  453    LDR     1,reg1              \overwritten by ReadWriteCmos
  454
  455.R1bit1zero
  456    TST     1,#%01              \Is R1 bit 0 = 1?
  457    BEQ     R1bit0zero          \NO  - exit SWI
  458                                \YES - do below 
  459    LDR     1,InterceptFlag     \Get current buttons status
  460    TST     0,#%01              \Is R0 bit 0 = 0?
  461    BNE     R0bit0one           \NO  - claim   mouse vector
  462                                \YES - release mouse vector
  463
  464    TST     1,#1                \Is vector already released? (InterceptFlag=0)
  465    BLNE    release             \NO  - flag=1, release vector
  466
  467    ADRVS   0,SwiCantRelease    \Abort with error message if vector cannot be released
  468    LDMVSFD 13!,{1-9,14}        \Set V, while preserving
  469    ORRVSS  PC,14,#1<<28        \the other flags
  470
  471    B       R1bit0zero          \YES - exit SWI
  472
  473.R0bit0one
  474    TST     1,#1                \Is vector already claimed?  (InterceptFlag=1)
  475    BLEQ    claim               \NO  - flag=0, claim vector
  476                                \YES - exit SWI
  477    ADRVS   0,SwiCantClaim      \Abort with error message if vector cannot be claimed
  478    LDMVSFD 13!,{1-9,14}        \Set V, while preserving
  479    ORRVSS  PC,14,#1<<28        \the other flags
  480
  481.R1bit0zero
  482    LDR     0,reg0old
  483    LDMFD   13!,{1-9,PC}^       \Return to SWI caller, preserving flags
  484
  485.SwiCantClaim
  486    EQUD    &1A0                \Use this error number as no 'User' error numbers have been allocated
  487    EQUS    "MightyMouse SWI could not claim mouse vector, try reloading MightyMouse module."
  488    EQUB    0
  489    ALIGN
  490
  491.SwiCantRelease
  492    EQUD    &1A1                \Use this error number as no 'User' error numbers have been allocated
  493                                \This number is generated by OS_Release, the SWI most likely to fail
  494    EQUS    "MightyMouse SWI could not release mouse vector. Try reloading MightyMouse module."
  495    EQUB    0
  496    ALIGN
  497
  498.claim
  499    STMFD   13!,{0-2,14}
  500    MOV     0,#&1A
  501    ADR     1,intercept
  502    MOV     2,#0
  503    SWI     "XOS_Claim"
  504    MVNVC   0,#0                \Claim with flag=-1 if OS_Claim was successful,
  505    MOVVS   0,#0                \else release with 0
  506    STR   0,InterceptFlag
  507    LDMFD 13!,{0-2,PC}          \Allow V flag to be passed on if OS_Claim failed
  508
  509.release
  510    STMFD   13!,{0-2,14}
  511    MOV     0,#&1A
  512    ADR     1,intercept
  513    MOV     2,#0
  514    SWI     "XOS_Release"
  515    MOVVC   0,#0                \Release with flag=0 if OS_Release was successful,
  516    MVNVS   0,#0                \else claim with -1
  517    STRVC   0,InterceptFlag
  518    LDMFD   13!,{0-2,PC}        \Allow V flag to be passed on if OS_Release failed
  519
  520.intercept
  521    STMFD   13!,{9,10-12,14}
  522
  523\CALL SWI OS_MOUSE, MODIFYING RETURN ADDRESS
  524\SO THAT MY ROUTINE IS EXECUTED ON EXIT
  525    STMFD   13!,{PC}
  526    ADD     12,13,#8
  527    LDMIA   12,{10-12,PC}       \SWI executed here
  528    LDR     12,[13,#12]
  529
  530\OS_MOUSE POST-PROCESSED HERE
  531    TST       2,#%001           \Move R2 bit 0 to R9 bit 2
  532    ORRNE   9,2,#%100           \Move 1
  533    BICEQ   9,2,#%100           \Move 0
  534
  535    TST       2,#%100           \Move R9 bit 2 to R2 bit 0
  536    ORRNE   2,9,#%001           \Move 1
  537    BICEQ   2,9,#%001           \Move 0
  538
  539    LDMFD   13!,{9,10-12,14,PC}
  540
  541.ReadWriteCmos                  \ReadWriteCmos v1.00 - 04 Mar 1995
  542    STMFD   13!,{1,3,4,14}      \Preserve registers as per spec for ReadWriteCmos
  543
  544    AND     1,1,#&FF            \Ensure all input data is 8 bits wide
  545    AND     3,3,#&FF       
  546    AND     4,4,#&FF
  547
  548    MOV     0,#161              \Get value from CMOS RAM location
  549    SWI     "XOS_Byte"
  550
  551    STMFD   13!,{2}             \To be reloaded into R0 at the end. R0 = old CMOS RAM contents as per spec.
  552
  553    CMP     4,#0                \Is mask=0?
  554    BEQ     nWriteCMOS          \YES - all done, quit SWI
  555                                \NO  - process and store new CMOS value
  556\PERFORM READ/WRITE FUNCTION
  557    AND     3,4,3               \Store (R3 AND R4) in working register
  558    MVN     4,4                 \NOT R3
  559    AND     2,2,4               \(OldButtons AND NOT R4)
  560    ORR     2,2,3               \(Oldbuttons AND NOT R4) OR (R3 AND R4)
  561
  562    CMP     0,2                 \Is new value=old value?
  563    MOVNE   0,#162              \YES - do not write to CMOS RAM (improves performance)
  564    MOVNE   1,#CMOSloc%
  565    SWINE   "XOS_Byte"
  566
  567.nWriteCMOS
  568    LDMFD   13!,{0}             \R0 = old CMOS RAM contents
  569    LDMFD   13!,{1,3,4,PC}^
  570
  571\WORKING DATA STORED HERE
  572.InterceptFlag                  \0=routine not engaged, -1=engaged
  573    EQUD    0                   
  574.args                           \Temporary store for decoded argument parameter
  575    EQUD    0
  576.reg0old
  577    EQUD    0
  578.reg0
  579    EQUD    0
  580.reg1
  581    EQUD    0
  582
  583EQUS " MightyMouse v"+version$
  584.CodeEnd                        \Do not put anything else after this terminator, because it will not be saved
  585]
  586NEXT
  587SYS "OS_Module",11,code,CodeEnd
  588PRINT"Module transferred to RMA"'
  589
  590PRINT"Module name:        "ModuleName$
  591PRINT"Module help string: ";:SYS "OS_PrettyPrint",code+help
  592PRINT'"Module start:       &";~code
  593PRINT"Module end:         &";~code+CodeEnd
  594PRINT"Module length:      ";CodeEnd" bytes"
  595IF save=FALSE PRINT'"Module save OFF"
  596ENDPROC
  597
  598DEFPROCsave
  599IF save AND (OptLo AND %100) THEN
  600  FileName$="RAM::RamDisc0.$.MityMouse"
  601  PRINT'"Press a key to save module as '"FileName$"' Escape to abort.";
  602  key=GET
  603  PRINT
  604  SYS "OS_File",10,FileName$,&FFA,,code,code+CodeEnd
  605  PRINT"Saved"
  606ENDIF
  607ENDPROC
�>MightySrc
� Version       1.00
� Release date  04 Mar 1995
$� Author        Michael Stirling
(� Source code for module MightyMouse
� Editor work area = 110

� �:�" at line ";�:�
	

Z� ************************************************************************************
U� ALTER THE FOLLOWING 3 VARIABLES TO DEFINE LOCATION, BIT TO STORE BUTTONS STATUS
E� AND THE SWI CHUNK NUMBER IN CASE OF A CLASH WITH OTHER SOFTWARE

*SwiChunk% =&7FF :� Range: 0 to &7FF   
OCMOSloc%  =30   :� Range: 30 to 45       NOTE: User range reserved by Acorn
$CMOSbit%  =0    :� Range: 0 to 7
Z� ************************************************************************************

� �
�
version$="1.00"


�SetUp
�asm
	�save
�

��SetUp
� Perform range checking
range=�
Q� (SwiChunk% � &7FF) <> SwiChunk% �"SwiChunk% out of range 0 to &7FF":range=�
Q� (CMOSloc%  � &0FF) <> CMOSloc%  �"CMOSloc% out of range 0 to &FF"  :range=�
 Q� (CMOSbit%  � &007) <> CMOSbit%  �"CMOSbit% out of range 0 to 7"    :range=�
!#ș "OS_ReadRAMFsLimits" � R0,R1
"M� R1-R0=0 �"MightySrc requires a RAM disc of at least 8K to run.":range=�
#� range=� � �
$
%bit=CMOSbit%
&CMOSbit%=1<<CMOSbit%
'
(� Module variables
)ModuleName$ ="MightyMouse"
*SwiHeader$  ="MightyMouse"
+
,Bits1819%=%01
-v� (Bits1819% � %11) <> Bits1819% �"Bits1819% out of range 0 to 3. See PRM for details of correct values to use.":�
.Bits1819%=Bits1819%<<18
/SwiChunk%=SwiChunk%<<06
09SwiBase=Bits1819%+SwiChunk% :� SwiBase must be MOD 64
1m� SwiBase can never be anything other than MOD 64, but the following error check is kept for good measure
2@� SwiBase � 64<>0 �"SwiBase=&";~SwiBase". Must be MOD 64.":�
3
4� Assembler variables
5save        =�
6OptLo       =%1100
7OptHi       =%1110
8CodeSize    =4096
9� code CodeSize, L%-1
:
;lk          =14
<�
=
>	��asm
?�'"Assembling module..."
@+� pass= OptLo � OptHi � (OptHi - OptLo)
A0� OptLo � %100 � P%=0:O%=code � P%=code:O%=0
B
C[   OPT     pass
D/    EQUD    0                   \Start code
E8    EQUD    init                \Initialisation code
F6    EQUD    final               \Finalisation code
G9    EQUD    service             \Service call handler
H1    EQUD    title               \Title string
I0    EQUD    help                \Help string
JC    EQUD    commands            \Help and command keyword table
KE    EQUD    SwiBase             \SWI chunk base number (optional)
LE    EQUD    SwiHandler          \SWI handler code      (optional)
ME    EQUD    SwiNames            \SWI decoding table    (optional)
NE    EQUD    0                   \SWI decoding code     (optional)
O
P	.init
Q?    STMFD   13!,{7-11,14}       \Must preserve R7-R11 & R13
R0    MOV     1,#CMOSloc%         \Read status
S:    MOV     4,#0                \at location CMOSloc%,
T1    BL      ReadWriteCmos       \bit CMOSbit%
U    TST     2,#CMOSbit%
VS    BLNE    claim               \Swap buttons if configured swapped in CMOS RAM
W    �Q   0,#0
Xm    STREQ   0,InterceptFlag     \Setting flag here is only important for initialisation after soft reset 
Y]    ADRVS   0,ClaimErrorMsg     \Report MouseV claim failed, if it was not successful and
Z=    LDMFD   13!,{7-11,PC}       \do not initialise module
[
\.ClaimErrorMsg
]    EQUD    0
^;    EQUS    "MightyMouse module initialisation failed."
_    EQUB    0
`
    ALIGN
a
b
.final
c    STMFD   13!,{7-11,14}
d    BL      release
em    LDMFD   13!,{7-11,PC}^      \�E - Do not want to generate error on exit as module will refuse to die.
fo                                \       Of course this means the computer might crash, if intercept routine
gW                                \       is still running, but it is umlikely to be.
h
iW.service                        \Re-initialise module & display post-reset message 
j    STMFD   13!,{0-11,14}
k    CMP     1,#&27
l    LDMNEFD 13!,{0-11,PC}
m    BL      init
n              
o    LDR     0,InterceptFlag
p    CMP     0,#0
q    ADREQ   0,normal
r    ADRNE   0,swop
s    SWI     "OS_Write0"
t    LDMFD   13!,{0-11,PC}^
u
v.normal
w&    EQUS    "Mouse buttons normal"
x    EQUW    &0A0D
y    EQUB    0
z
    ALIGN
{
|	.swop
}'    EQUS    "Mouse buttons swapped"
~    EQUW    &0A0D
    EQUB    0
�
    ALIGN
�
�
.title
�    EQUS    ModuleName$
�    EQUB    0
�
    ALIGN
�
�	.help
�M    EQUS    "MightyMouse	"+version$+" ("+��$,5,11)+") � Michael Stirling"
�    EQUB    0
�
    ALIGN
�
�
.commands
�    EQUS    "Buttons"
�    EQUB    0
�
    ALIGN
�
�    EQUD    decode
�5    EQUD    &00010100           \Information word
�2    EQUD    SyntaxMessage       \Error message
�1    EQUD    CommandHelp         \Help message
�
�%    EQUS    "Buttons"            
�    EQUB    0
�
    ALIGN
�
�    EQUD    DecodeStatus
�"    EQUD    &40000000         
�     EQUD    0               
�    EQUD    0
�
�    EQUS    "MightyInfo"
�    EQUB    0
�
    ALIGN
�
�    EQUD    0
�    EQUD    &20000000
�    EQUD    0
�    EQUD    HelpCode
�    
�/    EQUD    0                   \Terminator
�
�.decode
�f    STMFD   13!,{7-11,14}       \R7-R11 must be preserved. R0=error pointer if anything goes wrong
�
�_    CMP     1,#0                \If command has no parameters, then show CMOS button status
�$    BEQ     ShowStatus          
�
�J    CMP     1,#1                \If command has more than 1 parameter,
�I    BHI     BadSyntax           \then terminate with an error message
�
�V    LDRB    1,[0,#2]            \Note - OS always terminates parameters with &0D20
�V    CMP     1,#13               \If R1<>13 then parameter is not 1 character long,
�O    BNE     BadSyntax           \so terminate command with an error message
�
�a    LDRB    0,[0]               \Get parameter, command has only 1 character, letter or digit
�
�P    CMP     0,#�"0"           \If parameter is not one of characters 0,1,2,3
�R    BLT     BadSyntax           \then terminate command with an error message,
�R                                \otherwise command is valid & can be processed
�    CMP     0,#�"3"
�     BHI     BadSyntax       
�
�\�ESS BUTTONS PARAMETER
�
�n    SUB     0,0,#�"0"         \Get numeric value of ascii code. Note only bits 0 & 1 are actually required
�N    STR     0,args              \Save decoded argument parameter for later
�
�;    TST     0,#%10              \Configure new setting?
�E    BEQ     SetCurrent          \NO - Jump straight to SetCurrent
�
�1    TST     0,#%01              \swap or not?
�$    �Q   3,#0                \NO
�(    MOVNE   3,#CMOSbit%         \YES
�
�=    MOV     1,#CMOSloc%         \Store status in CMOS RAM
�%    MOV     4,#CMOSbit%          
�    BL      ReadWriteCmos
�
�.SetCurrent
�A    LDR     1,InterceptFlag     \Get current intercept status
�@    LDR     0,args              \Retrieve argument parameter
�    TST     0,#%01
�    BNE     swap
�
�9\NORMAL ROUTINE - RELEASE VECTOR � � ALREADY RELEASED
�C    TST     1,#1                \Z=0, claimed  Z=1, not claimed
�M    BLNE    release             \Quit if not claimed, else release vector
�    ADRVS   0,CantRelease
�    LDMFD   13!,{7-11,PC}
�
�.CantRelease
�    EQUD    0
�Z    EQUS    "Cannot return mouse buttons to normal, try reloading MightyMouse module."
�    EQUW    &0A0D
�    EQUB    0
�
    ALIGN
�
�2\Ȕ ROUTINE - CLAIM VECTOR � � ALREADY CLAIMED
�	.swap
�C    TST     1,#1                \Z=0, claimed  Z=1, not claimed
�I    BLEQ    claim               \Quit if claimed, else release vector
�    ADRVS   0,CantClaim
�    LDMFD   13!,{7-11,PC}
�
�.CantClaim
�    EQUD    0
�N    EQUS    "Cannot swap mouse buttons, try reloading MightyMouse module."
�    EQUB    0
�
    ALIGN
�
�.ShowStatus
�    LDR     7,InterceptFlag
�C    TST     7,#1                \Z=0, claimed  Z=1, not claimed
�    BNE     currently
�
�    SWI     "XOS_WriteS"
�)    EQUS    "Mouse buttons normal & "
�    EQUB    0
�
    ALIGN
�
�    B       cmos
�
�.currently
�    SWI     "XOS_WriteS"
�*    EQUS    "Mouse buttons swapped & "
�    EQUB    0
�
    ALIGN

	.cmos
    MOV     1,#CMOSloc%
?    MOV     4,#0                \Mask=0 to read CMOS status
    BL      ReadWriteCmos

    TST     2,#CMOSbit%
    BNE     swapped

	    SWI     "XOS_WriteS"

$    EQUS    "configured normal."
    EQUW    &0A0D
    EQUB    0


    ALIGN

$    LDMFD   13!,{7-11,PC}^      

.swapped
    SWI     "XOS_WriteS"
%    EQUS    "configured swapped."
    EQUW    &0A0D
    EQUB    0

    ALIGN

    LDMFD   13!,{7-11,PC}^

.BadSyntax
    ADR     0,SyntaxError
G    TEQP    PC,#&10000003       \Set V, remembering processor state
    LDMFD   13!,{7-11,PC}

.SyntaxError
     EQUD    0
!.SyntaxMessage
"+    EQUS    "Syntax: Buttons [0|1|2|3]"
#    EQUB    0
$
    ALIGN
%
&.CommandHelp
'[    EQUS    "*Buttons configures the mouse buttons for right or left-handed operation."
(    EQUW    &0A0D
)t    EQUS    "*Buttons with no parameters displays the current & configured normal/swapped mouse buttons status."
*    EQUW    &0A0D
+    EQUW    &0A0D
,+    EQUS    "Syntax: Buttons [0|1|2|3]"
-    EQUW    &0A0D
.,    EQUS    "��������0 = Buttons normal"
/    EQUW    &0A0D
0-    EQUS    "��������1 = Buttons swapped"
1    EQUW    &0A0D
2J    EQUS    "��������2 = Buttons normal��& setting stored in CMOS RAM"
3    EQUW    &0A0D
4J    EQUS    "��������3 = Buttons swapped & setting stored in CMOS RAM"
5    EQUB    0
6
    ALIGN
7
8.DecodeStatus
9f    STMFD   13!,{7-11,14}       \R7-R11 must be preserved. R0=error pointer if anything goes wrong
:
;K    CMP     0,#0                \Has *Configure by itself been entered?
<O    ADREQ   0,config            \YES - display configuration message & quit
=O    SWIEQ   "XOS_Write0"        \NO  - check R0 is not command tail pointer
>    LDMEQFD 13!,{7-11,PC}^
?
@K    CMP     0,#1                \Has *Configure Buttons been attempted?
AG    ADRHI   0,BadConfig         \YES - display error message & quit
BI    TEQHIP  PC,#&30000003       \Set C&V, remembering processor state
C    LDMHIFD 13!,{7-11,PC}
D
EA    MOV     0,#161              \Get CMOS RAM buttons setting
F    MOV     1,#CMOSloc%
G    SWI     "XOS_Byte"
H
IP    TST     2,#CMOSbit%         \Reflect buttons setting with screen message
J    ADREQ   0,NormalMSG
K    ADRNE   0,SwappedMSG
L    SWI     "XOS_Write0"
M
N    LDMFD   13!,{7-11,PC}^
O
P.config
Q"    EQUS    "*Buttons   <2|3>"
R    EQUW    &0A0D
S    EQUB    0
T
    ALIGN
U
V.BadConfig
W    EQUD    0
XC    EQUS    "Use *Buttons <2|3> to set the CMOS configuration."
Y    EQUB    0
Z
    ALIGN
[
\.NormalMSG
]'    EQUS    "Mouse buttons normal."
^    EQUW    &0A0D
_    EQUB    0
`
    ALIGN
a
b.SwappedMSG
c(    EQUS    "Mouse buttons swapped."
d    EQUW    &0A0D
e    EQUB    0
f
    ALIGN
g
h
.HelpCode
i    ADR     0,info
j    MOVS    PC,14
k
l	.info
mc    EQUS    "Module MightyMouse swaps the Select & Adjust mouse buttons for left-handed users."
n    EQUW    &0A0D
o)    EQUS    "SWI base��= &"+�~SwiBase
p    EQUW    &0A0D
q1    EQUS    "SWI chunk = &"+�~(SwiChunk%>>>6)
r    EQUW    &0A0D
sZ    EQUS    "Configuration stored at CMOS RAM location "+�CMOSloc%+", bit "+�(bit)+"."
t    EQUD    &0A0D0A0D
uB    EQUS    "v"+version$+" � Michael Stirling ("+��$,5,11)+")"
v    EQUW    &0A0D
w    EQUB    0
x
    ALIGN
y
z.SwiHandler
{:    LDR     12,[12]             \Get workspace pointer
|
},    CMP     11,#(EndSwiTable-SwiTable)/4
~9    ADDCC   PC,PC,11,LSL#2      \Dispatch if in range
0    B       UnknownSWI          \Unknown SWI
�                   
�
.SwiTable
�2    B       buttons             \Jump to SWI 0
�2    B       ReadWriteCmos       \Jump to SWI 1
�
�.EndSwiTable
�
�.UnknownSWI
�    ADR     0,RangeError
�?    �RS    PC,14,#1<<28        \Exit with overflow flag set
�
�.RangeError
�    EQUD    &1E6
�e    EQUS    "Module MightyMouse v"+version$+" supports only two SWIs (SWI base = &"+�~SwiBase+")"
�    EQUB    0
�
    ALIGN
�
�
.SwiNames
�    EQUS    SwiHeader$
�    EQUB    0
�
�    EQUS    "Buttons"
�    EQUB    0
�
�    EQUS    "CmosAccess"
�    EQUB    0
�
�/    EQUB    0                   \Terminator
�
    ALIGN
�
�.buttons
�    STMFD   13!,{1-9,14}
�0    TEQP    PC,#3               \Clear flags
�
�$\REFLECT PREVIOUS SETTINGS IN R0
�3    STR     0,reg0              \Preserve input
�9    STR     1,reg1              \parameters for later
�
�P    MOV     0,#161              \Get configured normal/swapped buttons state
�    MOV     1,#CMOSloc%
�E    SWI     "XOS_Byte"          \State returned in R2 at CMOSbit%
�
�;    LDR     0,reg0              \Get input parameter R0
�@    TST     2,#CMOSbit%         \Configured buttons swapped?
�O    �RNE   0,0,#%10            \YES - set   bit 1 preserving all other bits
�P    BICEQ   0,0,#%10            \NO  - reset bit 1 preserving all other bits
�
�M    LDR     2,InterceptFlag     \Get current normal/swapped buttons state
�5    TST     2,#%01              \Buttons swapped?
�O    �RNE   0,0,#%01            \YES - set   bit 0 preserving all other bits
�P    BICEQ   0,0,#%01            \NO  - reset bit 0 preserving all other bits
�
�U    STR     0,reg0old           \This value of R0 to be returned on exit from SWI
�
�@\��Y CURRENT & CONFIGURED BUTTONS STATUS AS PER � PARAMETERS
�>    LDR     0,reg0              \Retrieve input parameters
�1    LDR     1,reg1              \from earlier
�
�B    TST     1,#%10              \Is R1 bit 1 = 1? (mask=write)
�9    BEQ     R1bit1zero          \NO  - check R1 bit 0
�
�;    TST     0,#%10              \YES - Is R0 bit 1 = 0?
�4    �Q   3,#0                \YES - CMOS RAM = 0
�7    MOVNE   3,#CMOSbit%         \NO  - CMOS RAM = 1
�
�     MOV     1,#CMOSloc%     
�?    MOV     4,#CMOSbit%         \Get mask for ReadWriteCmos
�<    BL      ReadWriteCmos       \Write value to CMOS RAM
�?    LDR     0,reg0              \Retrieve input parameters 
�A    LDR     1,reg1              \overwritten by ReadWriteCmos
�
�.R1bit1zero
�5    TST     1,#%01              \Is R1 bit 0 = 1?
�3    BEQ     R1bit0zero          \NO  - exit SWI
�4                                \YES - do below 
�?    LDR     1,InterceptFlag     \Get current buttons status
�5    TST     0,#%01              \Is R0 bit 0 = 0?
�?    BNE     R0bit0one           \NO  - claim   mouse vector
�?                                \YES - release mouse vector
�
�R    TST     1,#1                \Is vector already released? (InterceptFlag=0)
�A    BLNE    release             \NO  - flag=1, release vector
�
�Z    ADRVS   0,SwiCantRelease    \Abort with error message if vector cannot be released
�<    LDMVSFD 13!,{1-9,14}        \Set V, while preserving
�3    �RVSS  PC,14,#1<<28        \the other flags
�
�3    B       R1bit0zero          \YES - exit SWI
�
�.R0bit0one
�R    TST     1,#1                \Is vector already claimed?  (InterceptFlag=1)
�?    BLEQ    claim               \NO  - flag=0, claim vector
�3                                \YES - exit SWI
�Y    ADRVS   0,SwiCantClaim      \Abort with error message if vector cannot be claimed
�<    LDMVSFD 13!,{1-9,14}        \Set V, while preserving
�3    �RVSS  PC,14,#1<<28        \the other flags
�
�.R1bit0zero
�    LDR     0,reg0old
�K    LDMFD   13!,{1-9,PC}^       \Return to SWI caller, preserving flags
�
�.SwiCantClaim
�i    EQUD    &1A0                \Use this error number as no 'User' error numbers have been allocated
�a    EQUS    "MightyMouse SWI could not claim mouse vector, try reloading MightyMouse module."
�    EQUB    0
�
    ALIGN
�
�.SwiCantRelease
�i    EQUD    &1A1                \Use this error number as no 'User' error numbers have been allocated
�h                                \This number is generated by OS_Release, the SWI most likely to fail
�c    EQUS    "MightyMouse SWI could not release mouse vector. Try reloading MightyMouse module."
�    EQUB    0
�
    ALIGN
�
�
.claim
�    STMFD   13!,{0-2,14}
�    MOV     0,#&1A
�    ADR     1,intercept
�    MOV     2,#0
�    SWI     "XOS_Claim"
�S    MVNVC   0,#0                \Claim with flag=-1 if OS_Claim was successful,
�8    MOVVS   0,#0                \else release with 0
�    STR   0,InterceptFlag
�T    LDMFD 13!,{0-2,PC}          \Allow V flag to be passed on if OS_Claim failed
�
�.release
�    STMFD   13!,{0-2,14}
�    MOV     0,#&1A
    ADR     1,intercept
    MOV     2,#0
    SWI     "XOS_Release"
V    MOVVC   0,#0                \Release with flag=0 if OS_Release was successful,
7    MVNVS   0,#0                \else claim with -1
    STRVC   0,InterceptFlag
V    LDMFD   13!,{0-2,PC}        \Allow V flag to be passed on if OS_Release failed

.intercept
	     STMFD   13!,{9,10-12,14}


%\� SWI OS_MOUSE, ��YING � ADDRESS
*\SO THAT MY ROUTINE IS EXECUTED � EXIT

    STMFD   13!,{PC}
    ADD     12,13,#8
6    LDMIA   12,{10-12,PC}       \SWI executed here
    LDR     12,[13,#12]

\OS_MOUSE POST-�ESSED HERE
>    TST       2,#%001           \Move R2 bit 0 to R9 bit 2
*    �RNE   9,2,#%100           \Move 1
+    BICEQ   9,2,#%100           \Move 0

>    TST       2,#%100           \Move R9 bit 2 to R2 bit 0
*    �RNE   2,9,#%001           \Move 1
+    BICEQ   2,9,#%001           \Move 0

#    LDMFD   13!,{9,10-12,14,PC}

F.ReadWriteCmos                  \ReadWriteCmos v1.00 - 04 Mar 1995
U    STMFD   13!,{1,3,4,14}      \Preserve registers as per spec for ReadWriteCmos

 G    �     1,1,#&FF            \Ensure all input data is 8 bits wide
!    �     3,3,#&FF       
"    �     4,4,#&FF
#
$E    MOV     0,#161              \Get value from CMOS RAM location
%    SWI     "XOS_Byte"
&
'o    STMFD   13!,{2}             \To be reloaded into R0 at the end. R0 = old CMOS RAM contents as per spec.
(
)/    CMP     4,#0                \Is mask=0?
*=    BEQ     nWriteCMOS          \YES - all done, quit SWI
+K                                \NO  - process and store new CMOS value
,\PERFORM �/WRITE FUNCTION
-F    �     3,4,3               \Store (R3 � R4) in working register
.)    MVN     4,4                 \� R3
/6    �     2,2,4               \(OldButtons � � R4)
0C    �R     2,2,3               \(Oldbuttons � � R4) � (R3 � R4)
1
2<    CMP     0,2                 \Is new value=old value?
3Z    MOVNE   0,#162              \YES - do not write to CMOS RAM (improves performance)
4    MOVNE   1,#CMOSloc%
5    SWINE   "XOS_Byte"
6
7.nWriteCMOS
8?    LDMFD   13!,{0}             \R0 = old CMOS RAM contents
9    LDMFD   13!,{1,3,4,PC}^
:
;\WORKING � STORED HERE
<F.InterceptFlag                  \0=routine not engaged, -1=engaged
=$    EQUD    0                   
>S.args                           \Temporary store for decoded argument parameter
?    EQUD    0
@.reg0old
A    EQUD    0
B	.reg0
C    EQUD    0
D	.reg1
E    EQUD    0
F
G"EQUS " MightyMouse v"+version$
Hq.CodeEnd                        \Do not put anything else after this terminator, because it will not be saved
I]
J�
K"ș "OS_Module",11,code,CodeEnd
L!�"Module transferred to RMA"'
M
N&�"Module name:        "ModuleName$
O:�"Module help string: ";:ș "OS_PrettyPrint",code+help
P#�'"Module start:       &";~code
Q*�"Module end:         &";~code+CodeEnd
R+�"Module length:      ";CodeEnd" bytes"
S � save=� �'"Module save OFF"
T�
U
V
��save
W� save � (OptLo � %100) �
X+  FileName$="RAM::RamDisc0.$.MityMouse"
YG  �'"Press a key to save module as '"FileName$"' Escape to abort.";
Z  key=�
[  �
\7  ș "OS_File",10,FileName$,&FFA,,code,code+CodeEnd
]  �"Saved"
^�
_�
�
00000000  0d 00 01 0f f4 3e 4d 69  67 68 74 79 53 72 63 0d  |.....>MightySrc.|
00000010  00 02 18 f4 20 56 65 72  73 69 6f 6e 20 20 20 20  |.... Version    |
00000020  20 20 20 31 2e 30 30 0d  00 03 1f f4 20 52 65 6c  |   1.00..... Rel|
00000030  65 61 73 65 20 64 61 74  65 20 20 30 34 20 4d 61  |ease date  04 Ma|
00000040  72 20 31 39 39 35 0d 00  04 24 f4 20 41 75 74 68  |r 1995...$. Auth|
00000050  6f 72 20 20 20 20 20 20  20 20 4d 69 63 68 61 65  |or        Michae|
00000060  6c 20 53 74 69 72 6c 69  6e 67 0d 00 05 28 f4 20  |l Stirling...(. |
00000070  53 6f 75 72 63 65 20 63  6f 64 65 20 66 6f 72 20  |Source code for |
00000080  6d 6f 64 75 6c 65 20 4d  69 67 68 74 79 4d 6f 75  |module MightyMou|
00000090  73 65 0d 00 06 1c f4 20  45 64 69 74 6f 72 20 77  |se..... Editor w|
000000a0  6f 72 6b 20 61 72 65 61  20 3d 20 31 31 30 0d 00  |ork area = 110..|
000000b0  07 04 0d 00 08 19 ee 85  20 f6 3a f1 22 20 61 74  |........ .:." at|
000000c0  20 6c 69 6e 65 20 22 3b  9e 3a e0 0d 00 09 04 0d  | line ";.:......|
000000d0  00 0a 5a f4 20 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |..Z. ***********|
000000e0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000120  2a 2a 2a 2a 2a 2a 2a 2a  2a 0d 00 0b 55 f4 20 41  |*********...U. A|
00000130  4c 54 45 52 20 54 48 45  20 46 4f 4c 4c 4f 57 49  |LTER THE FOLLOWI|
00000140  4e 47 20 33 20 56 41 52  49 41 42 4c 45 53 20 54  |NG 3 VARIABLES T|
00000150  4f 20 44 45 46 49 4e 45  20 4c 4f 43 41 54 49 4f  |O DEFINE LOCATIO|
00000160  4e 2c 20 42 49 54 20 54  4f 20 53 54 4f 52 45 20  |N, BIT TO STORE |
00000170  42 55 54 54 4f 4e 53 20  53 54 41 54 55 53 0d 00  |BUTTONS STATUS..|
00000180  0c 45 f4 20 41 4e 44 20  54 48 45 20 53 57 49 20  |.E. AND THE SWI |
00000190  43 48 55 4e 4b 20 4e 55  4d 42 45 52 20 49 4e 20  |CHUNK NUMBER IN |
000001a0  43 41 53 45 20 4f 46 20  41 20 43 4c 41 53 48 20  |CASE OF A CLASH |
000001b0  57 49 54 48 20 4f 54 48  45 52 20 53 4f 46 54 57  |WITH OTHER SOFTW|
000001c0  41 52 45 0d 00 0d 2a 53  77 69 43 68 75 6e 6b 25  |ARE...*SwiChunk%|
000001d0  20 3d 26 37 46 46 20 3a  f4 20 52 61 6e 67 65 3a  | =&7FF :. Range:|
000001e0  20 30 20 74 6f 20 26 37  46 46 20 20 20 0d 00 0e  | 0 to &7FF   ...|
000001f0  4f 43 4d 4f 53 6c 6f 63  25 20 20 3d 33 30 20 20  |OCMOSloc%  =30  |
00000200  20 3a f4 20 52 61 6e 67  65 3a 20 33 30 20 74 6f  | :. Range: 30 to|
00000210  20 34 35 20 20 20 20 20  20 20 4e 4f 54 45 3a 20  | 45       NOTE: |
00000220  55 73 65 72 20 72 61 6e  67 65 20 72 65 73 65 72  |User range reser|
00000230  76 65 64 20 62 79 20 41  63 6f 72 6e 0d 00 0f 24  |ved by Acorn...$|
00000240  43 4d 4f 53 62 69 74 25  20 20 3d 30 20 20 20 20  |CMOSbit%  =0    |
00000250  3a f4 20 52 61 6e 67 65  3a 20 30 20 74 6f 20 37  |:. Range: 0 to 7|
00000260  0d 00 10 5a f4 20 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |...Z. **********|
00000270  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
000002b0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 0d 00 11 04 0d 00  |**********......|
000002c0  12 07 eb 20 eb 0d 00 13  05 87 0d 00 14 13 76 65  |... ..........ve|
000002d0  72 73 69 6f 6e 24 3d 22  31 2e 30 30 22 0d 00 15  |rsion$="1.00"...|
000002e0  04 0d 00 16 0a f2 53 65  74 55 70 0d 00 17 08 f2  |......SetUp.....|
000002f0  61 73 6d 0d 00 18 09 f2  73 61 76 65 0d 00 19 05  |asm.....save....|
00000300  e0 0d 00 1a 04 0d 00 1b  0b dd f2 53 65 74 55 70  |...........SetUp|
00000310  0d 00 1c 1c f4 20 50 65  72 66 6f 72 6d 20 72 61  |..... Perform ra|
00000320  6e 67 65 20 63 68 65 63  6b 69 6e 67 0d 00 1d 0b  |nge checking....|
00000330  72 61 6e 67 65 3d a3 0d  00 1e 51 e7 20 28 53 77  |range=....Q. (Sw|
00000340  69 43 68 75 6e 6b 25 20  80 20 26 37 46 46 29 20  |iChunk% . &7FF) |
00000350  3c 3e 20 53 77 69 43 68  75 6e 6b 25 20 f1 22 53  |<> SwiChunk% ."S|
00000360  77 69 43 68 75 6e 6b 25  20 6f 75 74 20 6f 66 20  |wiChunk% out of |
00000370  72 61 6e 67 65 20 30 20  74 6f 20 26 37 46 46 22  |range 0 to &7FF"|
00000380  3a 72 61 6e 67 65 3d b9  0d 00 1f 51 e7 20 28 43  |:range=....Q. (C|
00000390  4d 4f 53 6c 6f 63 25 20  20 80 20 26 30 46 46 29  |MOSloc%  . &0FF)|
000003a0  20 3c 3e 20 43 4d 4f 53  6c 6f 63 25 20 20 f1 22  | <> CMOSloc%  ."|
000003b0  43 4d 4f 53 6c 6f 63 25  20 6f 75 74 20 6f 66 20  |CMOSloc% out of |
000003c0  72 61 6e 67 65 20 30 20  74 6f 20 26 46 46 22 20  |range 0 to &FF" |
000003d0  20 3a 72 61 6e 67 65 3d  b9 0d 00 20 51 e7 20 28  | :range=... Q. (|
000003e0  43 4d 4f 53 62 69 74 25  20 20 80 20 26 30 30 37  |CMOSbit%  . &007|
000003f0  29 20 3c 3e 20 43 4d 4f  53 62 69 74 25 20 20 f1  |) <> CMOSbit%  .|
00000400  22 43 4d 4f 53 62 69 74  25 20 6f 75 74 20 6f 66  |"CMOSbit% out of|
00000410  20 72 61 6e 67 65 20 30  20 74 6f 20 37 22 20 20  | range 0 to 7"  |
00000420  20 20 3a 72 61 6e 67 65  3d b9 0d 00 21 23 c8 99  |  :range=...!#..|
00000430  20 22 4f 53 5f 52 65 61  64 52 41 4d 46 73 4c 69  | "OS_ReadRAMFsLi|
00000440  6d 69 74 73 22 20 b8 20  52 30 2c 52 31 0d 00 22  |mits" . R0,R1.."|
00000450  4d e7 20 52 31 2d 52 30  3d 30 20 f1 22 4d 69 67  |M. R1-R0=0 ."Mig|
00000460  68 74 79 53 72 63 20 72  65 71 75 69 72 65 73 20  |htySrc requires |
00000470  61 20 52 41 4d 20 64 69  73 63 20 6f 66 20 61 74  |a RAM disc of at|
00000480  20 6c 65 61 73 74 20 38  4b 20 74 6f 20 72 75 6e  | least 8K to run|
00000490  2e 22 3a 72 61 6e 67 65  3d b9 0d 00 23 11 e7 20  |.":range=...#.. |
000004a0  72 61 6e 67 65 3d b9 20  8c 20 e0 0d 00 24 04 0d  |range=. . ...$..|
000004b0  00 25 10 62 69 74 3d 43  4d 4f 53 62 69 74 25 0d  |.%.bit=CMOSbit%.|
000004c0  00 26 18 43 4d 4f 53 62  69 74 25 3d 31 3c 3c 43  |.&.CMOSbit%=1<<C|
000004d0  4d 4f 53 62 69 74 25 0d  00 27 04 0d 00 28 16 f4  |MOSbit%..'...(..|
000004e0  20 4d 6f 64 75 6c 65 20  76 61 72 69 61 62 6c 65  | Module variable|
000004f0  73 0d 00 29 1e 4d 6f 64  75 6c 65 4e 61 6d 65 24  |s..).ModuleName$|
00000500  20 3d 22 4d 69 67 68 74  79 4d 6f 75 73 65 22 0d  | ="MightyMouse".|
00000510  00 2a 1e 53 77 69 48 65  61 64 65 72 24 20 20 3d  |.*.SwiHeader$  =|
00000520  22 4d 69 67 68 74 79 4d  6f 75 73 65 22 0d 00 2b  |"MightyMouse"..+|
00000530  04 0d 00 2c 11 42 69 74  73 31 38 31 39 25 3d 25  |...,.Bits1819%=%|
00000540  30 31 0d 00 2d 76 e7 20  28 42 69 74 73 31 38 31  |01..-v. (Bits181|
00000550  39 25 20 80 20 25 31 31  29 20 3c 3e 20 42 69 74  |9% . %11) <> Bit|
00000560  73 31 38 31 39 25 20 f1  22 42 69 74 73 31 38 31  |s1819% ."Bits181|
00000570  39 25 20 6f 75 74 20 6f  66 20 72 61 6e 67 65 20  |9% out of range |
00000580  30 20 74 6f 20 33 2e 20  53 65 65 20 50 52 4d 20  |0 to 3. See PRM |
00000590  66 6f 72 20 64 65 74 61  69 6c 73 20 6f 66 20 63  |for details of c|
000005a0  6f 72 72 65 63 74 20 76  61 6c 75 65 73 20 74 6f  |orrect values to|
000005b0  20 75 73 65 2e 22 3a e0  0d 00 2e 1b 42 69 74 73  | use.":.....Bits|
000005c0  31 38 31 39 25 3d 42 69  74 73 31 38 31 39 25 3c  |1819%=Bits1819%<|
000005d0  3c 31 38 0d 00 2f 1b 53  77 69 43 68 75 6e 6b 25  |<18../.SwiChunk%|
000005e0  3d 53 77 69 43 68 75 6e  6b 25 3c 3c 30 36 0d 00  |=SwiChunk%<<06..|
000005f0  30 39 53 77 69 42 61 73  65 3d 42 69 74 73 31 38  |09SwiBase=Bits18|
00000600  31 39 25 2b 53 77 69 43  68 75 6e 6b 25 20 3a f4  |19%+SwiChunk% :.|
00000610  20 53 77 69 42 61 73 65  20 6d 75 73 74 20 62 65  | SwiBase must be|
00000620  20 4d 4f 44 20 36 34 0d  00 31 6d f4 20 53 77 69  | MOD 64..1m. Swi|
00000630  42 61 73 65 20 63 61 6e  20 6e 65 76 65 72 20 62  |Base can never b|
00000640  65 20 61 6e 79 74 68 69  6e 67 20 6f 74 68 65 72  |e anything other|
00000650  20 74 68 61 6e 20 4d 4f  44 20 36 34 2c 20 62 75  | than MOD 64, bu|
00000660  74 20 74 68 65 20 66 6f  6c 6c 6f 77 69 6e 67 20  |t the following |
00000670  65 72 72 6f 72 20 63 68  65 63 6b 20 69 73 20 6b  |error check is k|
00000680  65 70 74 20 66 6f 72 20  67 6f 6f 64 20 6d 65 61  |ept for good mea|
00000690  73 75 72 65 0d 00 32 40  e7 20 53 77 69 42 61 73  |sure..2@. SwiBas|
000006a0  65 20 83 20 36 34 3c 3e  30 20 f1 22 53 77 69 42  |e . 64<>0 ."SwiB|
000006b0  61 73 65 3d 26 22 3b 7e  53 77 69 42 61 73 65 22  |ase=&";~SwiBase"|
000006c0  2e 20 4d 75 73 74 20 62  65 20 4d 4f 44 20 36 34  |. Must be MOD 64|
000006d0  2e 22 3a e0 0d 00 33 04  0d 00 34 19 f4 20 41 73  |.":...3...4.. As|
000006e0  73 65 6d 62 6c 65 72 20  76 61 72 69 61 62 6c 65  |sembler variable|
000006f0  73 0d 00 35 12 73 61 76  65 20 20 20 20 20 20 20  |s..5.save       |
00000700  20 3d b9 0d 00 36 16 4f  70 74 4c 6f 20 20 20 20  | =...6.OptLo    |
00000710  20 20 20 3d 25 31 31 30  30 0d 00 37 16 4f 70 74  |   =%1100..7.Opt|
00000720  48 69 20 20 20 20 20 20  20 3d 25 31 31 31 30 0d  |Hi       =%1110.|
00000730  00 38 15 43 6f 64 65 53  69 7a 65 20 20 20 20 3d  |.8.CodeSize    =|
00000740  34 30 39 36 0d 00 39 19  de 20 63 6f 64 65 20 43  |4096..9.. code C|
00000750  6f 64 65 53 69 7a 65 2c  20 4c 25 2d 31 0d 00 3a  |odeSize, L%-1..:|
00000760  04 0d 00 3b 13 6c 6b 20  20 20 20 20 20 20 20 20  |...;.lk         |
00000770  20 3d 31 34 0d 00 3c 05  e1 0d 00 3d 04 0d 00 3e  | =14..<....=...>|
00000780  09 dd f2 61 73 6d 0d 00  3f 1c f1 27 22 41 73 73  |...asm..?..'"Ass|
00000790  65 6d 62 6c 69 6e 67 20  6d 6f 64 75 6c 65 2e 2e  |embling module..|
000007a0  2e 22 0d 00 40 2b e3 20  70 61 73 73 3d 20 4f 70  |."..@+. pass= Op|
000007b0  74 4c 6f 20 b8 20 4f 70  74 48 69 20 88 20 28 4f  |tLo . OptHi . (O|
000007c0  70 74 48 69 20 2d 20 4f  70 74 4c 6f 29 0d 00 41  |ptHi - OptLo)..A|
000007d0  30 e7 20 4f 70 74 4c 6f  20 80 20 25 31 30 30 20  |0. OptLo . %100 |
000007e0  8c 20 50 25 3d 30 3a 4f  25 3d 63 6f 64 65 20 8b  |. P%=0:O%=code .|
000007f0  20 50 25 3d 63 6f 64 65  3a 4f 25 3d 30 0d 00 42  | P%=code:O%=0..B|
00000800  04 0d 00 43 14 5b 20 20  20 4f 50 54 20 20 20 20  |...C.[   OPT    |
00000810  20 70 61 73 73 0d 00 44  2f 20 20 20 20 45 51 55  | pass..D/    EQU|
00000820  44 20 20 20 20 30 20 20  20 20 20 20 20 20 20 20  |D    0          |
00000830  20 20 20 20 20 20 20 20  20 5c 53 74 61 72 74 20  |         \Start |
00000840  63 6f 64 65 0d 00 45 38  20 20 20 20 45 51 55 44  |code..E8    EQUD|
00000850  20 20 20 20 69 6e 69 74  20 20 20 20 20 20 20 20  |    init        |
00000860  20 20 20 20 20 20 20 20  5c 49 6e 69 74 69 61 6c  |        \Initial|
00000870  69 73 61 74 69 6f 6e 20  63 6f 64 65 0d 00 46 36  |isation code..F6|
00000880  20 20 20 20 45 51 55 44  20 20 20 20 66 69 6e 61  |    EQUD    fina|
00000890  6c 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |l               |
000008a0  5c 46 69 6e 61 6c 69 73  61 74 69 6f 6e 20 63 6f  |\Finalisation co|
000008b0  64 65 0d 00 47 39 20 20  20 20 45 51 55 44 20 20  |de..G9    EQUD  |
000008c0  20 20 73 65 72 76 69 63  65 20 20 20 20 20 20 20  |  service       |
000008d0  20 20 20 20 20 20 5c 53  65 72 76 69 63 65 20 63  |      \Service c|
000008e0  61 6c 6c 20 68 61 6e 64  6c 65 72 0d 00 48 31 20  |all handler..H1 |
000008f0  20 20 20 45 51 55 44 20  20 20 20 74 69 74 6c 65  |   EQUD    title|
00000900  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 5c  |               \|
00000910  54 69 74 6c 65 20 73 74  72 69 6e 67 0d 00 49 30  |Title string..I0|
00000920  20 20 20 20 45 51 55 44  20 20 20 20 68 65 6c 70  |    EQUD    help|
00000930  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000940  5c 48 65 6c 70 20 73 74  72 69 6e 67 0d 00 4a 43  |\Help string..JC|
00000950  20 20 20 20 45 51 55 44  20 20 20 20 63 6f 6d 6d  |    EQUD    comm|
00000960  61 6e 64 73 20 20 20 20  20 20 20 20 20 20 20 20  |ands            |
00000970  5c 48 65 6c 70 20 61 6e  64 20 63 6f 6d 6d 61 6e  |\Help and comman|
00000980  64 20 6b 65 79 77 6f 72  64 20 74 61 62 6c 65 0d  |d keyword table.|
00000990  00 4b 45 20 20 20 20 45  51 55 44 20 20 20 20 53  |.KE    EQUD    S|
000009a0  77 69 42 61 73 65 20 20  20 20 20 20 20 20 20 20  |wiBase          |
000009b0  20 20 20 5c 53 57 49 20  63 68 75 6e 6b 20 62 61  |   \SWI chunk ba|
000009c0  73 65 20 6e 75 6d 62 65  72 20 28 6f 70 74 69 6f  |se number (optio|
000009d0  6e 61 6c 29 0d 00 4c 45  20 20 20 20 45 51 55 44  |nal)..LE    EQUD|
000009e0  20 20 20 20 53 77 69 48  61 6e 64 6c 65 72 20 20  |    SwiHandler  |
000009f0  20 20 20 20 20 20 20 20  5c 53 57 49 20 68 61 6e  |        \SWI han|
00000a00  64 6c 65 72 20 63 6f 64  65 20 20 20 20 20 20 28  |dler code      (|
00000a10  6f 70 74 69 6f 6e 61 6c  29 0d 00 4d 45 20 20 20  |optional)..ME   |
00000a20  20 45 51 55 44 20 20 20  20 53 77 69 4e 61 6d 65  | EQUD    SwiName|
00000a30  73 20 20 20 20 20 20 20  20 20 20 20 20 5c 53 57  |s            \SW|
00000a40  49 20 64 65 63 6f 64 69  6e 67 20 74 61 62 6c 65  |I decoding table|
00000a50  20 20 20 20 28 6f 70 74  69 6f 6e 61 6c 29 0d 00  |    (optional)..|
00000a60  4e 45 20 20 20 20 45 51  55 44 20 20 20 20 30 20  |NE    EQUD    0 |
00000a70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000a80  20 20 5c 53 57 49 20 64  65 63 6f 64 69 6e 67 20  |  \SWI decoding |
00000a90  63 6f 64 65 20 20 20 20  20 28 6f 70 74 69 6f 6e  |code     (option|
00000aa0  61 6c 29 0d 00 4f 04 0d  00 50 09 2e 69 6e 69 74  |al)..O...P..init|
00000ab0  0d 00 51 3f 20 20 20 20  53 54 4d 46 44 20 20 20  |..Q?    STMFD   |
00000ac0  31 33 21 2c 7b 37 2d 31  31 2c 31 34 7d 20 20 20  |13!,{7-11,14}   |
00000ad0  20 20 20 20 5c 4d 75 73  74 20 70 72 65 73 65 72  |    \Must preser|
00000ae0  76 65 20 52 37 2d 52 31  31 20 26 20 52 31 33 0d  |ve R7-R11 & R13.|
00000af0  00 52 30 20 20 20 20 4d  4f 56 20 20 20 20 20 31  |.R0    MOV     1|
00000b00  2c 23 43 4d 4f 53 6c 6f  63 25 20 20 20 20 20 20  |,#CMOSloc%      |
00000b10  20 20 20 5c 52 65 61 64  20 73 74 61 74 75 73 0d  |   \Read status.|
00000b20  00 53 3a 20 20 20 20 4d  4f 56 20 20 20 20 20 34  |.S:    MOV     4|
00000b30  2c 23 30 20 20 20 20 20  20 20 20 20 20 20 20 20  |,#0             |
00000b40  20 20 20 5c 61 74 20 6c  6f 63 61 74 69 6f 6e 20  |   \at location |
00000b50  43 4d 4f 53 6c 6f 63 25  2c 0d 00 54 31 20 20 20  |CMOSloc%,..T1   |
00000b60  20 42 4c 20 20 20 20 20  20 52 65 61 64 57 72 69  | BL      ReadWri|
00000b70  74 65 43 6d 6f 73 20 20  20 20 20 20 20 5c 62 69  |teCmos       \bi|
00000b80  74 20 43 4d 4f 53 62 69  74 25 0d 00 55 1b 20 20  |t CMOSbit%..U.  |
00000b90  20 20 54 53 54 20 20 20  20 20 32 2c 23 43 4d 4f  |  TST     2,#CMO|
00000ba0  53 62 69 74 25 0d 00 56  53 20 20 20 20 42 4c 4e  |Sbit%..VS    BLN|
00000bb0  45 20 20 20 20 63 6c 61  69 6d 20 20 20 20 20 20  |E    claim      |
00000bc0  20 20 20 20 20 20 20 20  20 5c 53 77 61 70 20 62  |         \Swap b|
00000bd0  75 74 74 6f 6e 73 20 69  66 20 63 6f 6e 66 69 67  |uttons if config|
00000be0  75 72 65 64 20 73 77 61  70 70 65 64 20 69 6e 20  |ured swapped in |
00000bf0  43 4d 4f 53 20 52 41 4d  0d 00 57 11 20 20 20 20  |CMOS RAM..W.    |
00000c00  ec 51 20 20 20 30 2c 23  30 0d 00 58 6d 20 20 20  |.Q   0,#0..Xm   |
00000c10  20 53 54 52 45 51 20 20  20 30 2c 49 6e 74 65 72  | STREQ   0,Inter|
00000c20  63 65 70 74 46 6c 61 67  20 20 20 20 20 5c 53 65  |ceptFlag     \Se|
00000c30  74 74 69 6e 67 20 66 6c  61 67 20 68 65 72 65 20  |tting flag here |
00000c40  69 73 20 6f 6e 6c 79 20  69 6d 70 6f 72 74 61 6e  |is only importan|
00000c50  74 20 66 6f 72 20 69 6e  69 74 69 61 6c 69 73 61  |t for initialisa|
00000c60  74 69 6f 6e 20 61 66 74  65 72 20 73 6f 66 74 20  |tion after soft |
00000c70  72 65 73 65 74 20 0d 00  59 5d 20 20 20 20 41 44  |reset ..Y]    AD|
00000c80  52 56 53 20 20 20 30 2c  43 6c 61 69 6d 45 72 72  |RVS   0,ClaimErr|
00000c90  6f 72 4d 73 67 20 20 20  20 20 5c 52 65 70 6f 72  |orMsg     \Repor|
00000ca0  74 20 4d 6f 75 73 65 56  20 63 6c 61 69 6d 20 66  |t MouseV claim f|
00000cb0  61 69 6c 65 64 2c 20 69  66 20 69 74 20 77 61 73  |ailed, if it was|
00000cc0  20 6e 6f 74 20 73 75 63  63 65 73 73 66 75 6c 20  | not successful |
00000cd0  61 6e 64 0d 00 5a 3d 20  20 20 20 4c 44 4d 46 44  |and..Z=    LDMFD|
00000ce0  20 20 20 31 33 21 2c 7b  37 2d 31 31 2c 50 43 7d  |   13!,{7-11,PC}|
00000cf0  20 20 20 20 20 20 20 5c  64 6f 20 6e 6f 74 20 69  |       \do not i|
00000d00  6e 69 74 69 61 6c 69 73  65 20 6d 6f 64 75 6c 65  |nitialise module|
00000d10  0d 00 5b 04 0d 00 5c 12  2e 43 6c 61 69 6d 45 72  |..[...\..ClaimEr|
00000d20  72 6f 72 4d 73 67 0d 00  5d 11 20 20 20 20 45 51  |rorMsg..].    EQ|
00000d30  55 44 20 20 20 20 30 0d  00 5e 3b 20 20 20 20 45  |UD    0..^;    E|
00000d40  51 55 53 20 20 20 20 22  4d 69 67 68 74 79 4d 6f  |QUS    "MightyMo|
00000d50  75 73 65 20 6d 6f 64 75  6c 65 20 69 6e 69 74 69  |use module initi|
00000d60  61 6c 69 73 61 74 69 6f  6e 20 66 61 69 6c 65 64  |alisation failed|
00000d70  2e 22 0d 00 5f 11 20 20  20 20 45 51 55 42 20 20  |.".._.    EQUB  |
00000d80  20 20 30 0d 00 60 0d 20  20 20 20 41 4c 49 47 4e  |  0..`.    ALIGN|
00000d90  0d 00 61 04 0d 00 62 0a  2e 66 69 6e 61 6c 0d 00  |..a...b..final..|
00000da0  63 1d 20 20 20 20 53 54  4d 46 44 20 20 20 31 33  |c.    STMFD   13|
00000db0  21 2c 7b 37 2d 31 31 2c  31 34 7d 0d 00 64 17 20  |!,{7-11,14}..d. |
00000dc0  20 20 20 42 4c 20 20 20  20 20 20 72 65 6c 65 61  |   BL      relea|
00000dd0  73 65 0d 00 65 6d 20 20  20 20 4c 44 4d 46 44 20  |se..em    LDMFD |
00000de0  20 20 31 33 21 2c 7b 37  2d 31 31 2c 50 43 7d 5e  |  13!,{7-11,PC}^|
00000df0  20 20 20 20 20 20 5c ac  45 20 2d 20 44 6f 20 6e  |      \.E - Do n|
00000e00  6f 74 20 77 61 6e 74 20  74 6f 20 67 65 6e 65 72  |ot want to gener|
00000e10  61 74 65 20 65 72 72 6f  72 20 6f 6e 20 65 78 69  |ate error on exi|
00000e20  74 20 61 73 20 6d 6f 64  75 6c 65 20 77 69 6c 6c  |t as module will|
00000e30  20 72 65 66 75 73 65 20  74 6f 20 64 69 65 2e 0d  | refuse to die..|
00000e40  00 66 6f 20 20 20 20 20  20 20 20 20 20 20 20 20  |.fo             |
00000e50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000e60  20 20 20 5c 20 20 20 20  20 20 20 4f 66 20 63 6f  |   \       Of co|
00000e70  75 72 73 65 20 74 68 69  73 20 6d 65 61 6e 73 20  |urse this means |
00000e80  74 68 65 20 63 6f 6d 70  75 74 65 72 20 6d 69 67  |the computer mig|
00000e90  68 74 20 63 72 61 73 68  2c 20 69 66 20 69 6e 74  |ht crash, if int|
00000ea0  65 72 63 65 70 74 20 72  6f 75 74 69 6e 65 0d 00  |ercept routine..|
00000eb0  67 57 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |gW              |
00000ec0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000ed0  20 20 5c 20 20 20 20 20  20 20 69 73 20 73 74 69  |  \       is sti|
00000ee0  6c 6c 20 72 75 6e 6e 69  6e 67 2c 20 62 75 74 20  |ll running, but |
00000ef0  69 74 20 69 73 20 75 6d  6c 69 6b 65 6c 79 20 74  |it is umlikely t|
00000f00  6f 20 62 65 2e 0d 00 68  04 0d 00 69 57 2e 73 65  |o be...h...iW.se|
00000f10  72 76 69 63 65 20 20 20  20 20 20 20 20 20 20 20  |rvice           |
00000f20  20 20 20 20 20 20 20 20  20 20 20 20 20 5c 52 65  |             \Re|
00000f30  2d 69 6e 69 74 69 61 6c  69 73 65 20 6d 6f 64 75  |-initialise modu|
00000f40  6c 65 20 26 20 64 69 73  70 6c 61 79 20 70 6f 73  |le & display pos|
00000f50  74 2d 72 65 73 65 74 20  6d 65 73 73 61 67 65 20  |t-reset message |
00000f60  0d 00 6a 1d 20 20 20 20  53 54 4d 46 44 20 20 20  |..j.    STMFD   |
00000f70  31 33 21 2c 7b 30 2d 31  31 2c 31 34 7d 0d 00 6b  |13!,{0-11,14}..k|
00000f80  16 20 20 20 20 43 4d 50  20 20 20 20 20 31 2c 23  |.    CMP     1,#|
00000f90  26 32 37 0d 00 6c 1d 20  20 20 20 4c 44 4d 4e 45  |&27..l.    LDMNE|
00000fa0  46 44 20 31 33 21 2c 7b  30 2d 31 31 2c 50 43 7d  |FD 13!,{0-11,PC}|
00000fb0  0d 00 6d 14 20 20 20 20  42 4c 20 20 20 20 20 20  |..m.    BL      |
00000fc0  69 6e 69 74 0d 00 6e 12  20 20 20 20 20 20 20 20  |init..n.        |
00000fd0  20 20 20 20 20 20 0d 00  6f 1f 20 20 20 20 4c 44  |      ..o.    LD|
00000fe0  52 20 20 20 20 20 30 2c  49 6e 74 65 72 63 65 70  |R     0,Intercep|
00000ff0  74 46 6c 61 67 0d 00 70  14 20 20 20 20 43 4d 50  |tFlag..p.    CMP|
00001000  20 20 20 20 20 30 2c 23  30 0d 00 71 18 20 20 20  |     0,#0..q.   |
00001010  20 41 44 52 45 51 20 20  20 30 2c 6e 6f 72 6d 61  | ADREQ   0,norma|
00001020  6c 0d 00 72 16 20 20 20  20 41 44 52 4e 45 20 20  |l..r.    ADRNE  |
00001030  20 30 2c 73 77 6f 70 0d  00 73 1b 20 20 20 20 53  | 0,swop..s.    S|
00001040  57 49 20 20 20 20 20 22  4f 53 5f 57 72 69 74 65  |WI     "OS_Write|
00001050  30 22 0d 00 74 1e 20 20  20 20 4c 44 4d 46 44 20  |0"..t.    LDMFD |
00001060  20 20 31 33 21 2c 7b 30  2d 31 31 2c 50 43 7d 5e  |  13!,{0-11,PC}^|
00001070  0d 00 75 04 0d 00 76 0b  2e 6e 6f 72 6d 61 6c 0d  |..u...v..normal.|
00001080  00 77 26 20 20 20 20 45  51 55 53 20 20 20 20 22  |.w&    EQUS    "|
00001090  4d 6f 75 73 65 20 62 75  74 74 6f 6e 73 20 6e 6f  |Mouse buttons no|
000010a0  72 6d 61 6c 22 0d 00 78  15 20 20 20 20 45 51 55  |rmal"..x.    EQU|
000010b0  57 20 20 20 20 26 30 41  30 44 0d 00 79 11 20 20  |W    &0A0D..y.  |
000010c0  20 20 45 51 55 42 20 20  20 20 30 0d 00 7a 0d 20  |  EQUB    0..z. |
000010d0  20 20 20 41 4c 49 47 4e  0d 00 7b 04 0d 00 7c 09  |   ALIGN..{...|.|
000010e0  2e 73 77 6f 70 0d 00 7d  27 20 20 20 20 45 51 55  |.swop..}'    EQU|
000010f0  53 20 20 20 20 22 4d 6f  75 73 65 20 62 75 74 74  |S    "Mouse butt|
00001100  6f 6e 73 20 73 77 61 70  70 65 64 22 0d 00 7e 15  |ons swapped"..~.|
00001110  20 20 20 20 45 51 55 57  20 20 20 20 26 30 41 30  |    EQUW    &0A0|
00001120  44 0d 00 7f 11 20 20 20  20 45 51 55 42 20 20 20  |D....    EQUB   |
00001130  20 30 0d 00 80 0d 20 20  20 20 41 4c 49 47 4e 0d  | 0....    ALIGN.|
00001140  00 81 04 0d 00 82 0a 2e  74 69 74 6c 65 0d 00 83  |........title...|
00001150  1b 20 20 20 20 45 51 55  53 20 20 20 20 4d 6f 64  |.    EQUS    Mod|
00001160  75 6c 65 4e 61 6d 65 24  0d 00 84 11 20 20 20 20  |uleName$....    |
00001170  45 51 55 42 20 20 20 20  30 0d 00 85 0d 20 20 20  |EQUB    0....   |
00001180  20 41 4c 49 47 4e 0d 00  86 04 0d 00 87 09 2e 68  | ALIGN.........h|
00001190  65 6c 70 0d 00 88 4d 20  20 20 20 45 51 55 53 20  |elp...M    EQUS |
000011a0  20 20 20 22 4d 69 67 68  74 79 4d 6f 75 73 65 09  |   "MightyMouse.|
000011b0  22 2b 76 65 72 73 69 6f  6e 24 2b 22 20 28 22 2b  |"+version$+" ("+|
000011c0  c1 91 24 2c 35 2c 31 31  29 2b 22 29 20 a9 20 4d  |..$,5,11)+") . M|
000011d0  69 63 68 61 65 6c 20 53  74 69 72 6c 69 6e 67 22  |ichael Stirling"|
000011e0  0d 00 89 11 20 20 20 20  45 51 55 42 20 20 20 20  |....    EQUB    |
000011f0  30 0d 00 8a 0d 20 20 20  20 41 4c 49 47 4e 0d 00  |0....    ALIGN..|
00001200  8b 04 0d 00 8c 0d 2e 63  6f 6d 6d 61 6e 64 73 0d  |.......commands.|
00001210  00 8d 19 20 20 20 20 45  51 55 53 20 20 20 20 22  |...    EQUS    "|
00001220  42 75 74 74 6f 6e 73 22  0d 00 8e 11 20 20 20 20  |Buttons"....    |
00001230  45 51 55 42 20 20 20 20  30 0d 00 8f 0d 20 20 20  |EQUB    0....   |
00001240  20 41 4c 49 47 4e 0d 00  90 04 0d 00 91 16 20 20  | ALIGN........  |
00001250  20 20 45 51 55 44 20 20  20 20 64 65 63 6f 64 65  |  EQUD    decode|
00001260  0d 00 92 35 20 20 20 20  45 51 55 44 20 20 20 20  |...5    EQUD    |
00001270  26 30 30 30 31 30 31 30  30 20 20 20 20 20 20 20  |&00010100       |
00001280  20 20 20 20 5c 49 6e 66  6f 72 6d 61 74 69 6f 6e  |    \Information|
00001290  20 77 6f 72 64 0d 00 93  32 20 20 20 20 45 51 55  | word...2    EQU|
000012a0  44 20 20 20 20 53 79 6e  74 61 78 4d 65 73 73 61  |D    SyntaxMessa|
000012b0  67 65 20 20 20 20 20 20  20 5c 45 72 72 6f 72 20  |ge       \Error |
000012c0  6d 65 73 73 61 67 65 0d  00 94 31 20 20 20 20 45  |message...1    E|
000012d0  51 55 44 20 20 20 20 43  6f 6d 6d 61 6e 64 48 65  |QUD    CommandHe|
000012e0  6c 70 20 20 20 20 20 20  20 20 20 5c 48 65 6c 70  |lp         \Help|
000012f0  20 6d 65 73 73 61 67 65  0d 00 95 04 0d 00 96 25  | message.......%|
00001300  20 20 20 20 45 51 55 53  20 20 20 20 22 42 75 74  |    EQUS    "But|
00001310  74 6f 6e 73 22 20 20 20  20 20 20 20 20 20 20 20  |tons"           |
00001320  20 0d 00 97 11 20 20 20  20 45 51 55 42 20 20 20  | ....    EQUB   |
00001330  20 30 0d 00 98 0d 20 20  20 20 41 4c 49 47 4e 0d  | 0....    ALIGN.|
00001340  00 99 04 0d 00 9a 1c 20  20 20 20 45 51 55 44 20  |.......    EQUD |
00001350  20 20 20 44 65 63 6f 64  65 53 74 61 74 75 73 0d  |   DecodeStatus.|
00001360  00 9b 22 20 20 20 20 45  51 55 44 20 20 20 20 26  |.."    EQUD    &|
00001370  34 30 30 30 30 30 30 30  20 20 20 20 20 20 20 20  |40000000        |
00001380  20 0d 00 9c 20 20 20 20  20 45 51 55 44 20 20 20  | ...     EQUD   |
00001390  20 30 20 20 20 20 20 20  20 20 20 20 20 20 20 20  | 0              |
000013a0  20 0d 00 9d 11 20 20 20  20 45 51 55 44 20 20 20  | ....    EQUD   |
000013b0  20 30 0d 00 9e 04 0d 00  9f 1c 20 20 20 20 45 51  | 0........    EQ|
000013c0  55 53 20 20 20 20 22 4d  69 67 68 74 79 49 6e 66  |US    "MightyInf|
000013d0  6f 22 0d 00 a0 11 20 20  20 20 45 51 55 42 20 20  |o"....    EQUB  |
000013e0  20 20 30 0d 00 a1 0d 20  20 20 20 41 4c 49 47 4e  |  0....    ALIGN|
000013f0  0d 00 a2 04 0d 00 a3 11  20 20 20 20 45 51 55 44  |........    EQUD|
00001400  20 20 20 20 30 0d 00 a4  19 20 20 20 20 45 51 55  |    0....    EQU|
00001410  44 20 20 20 20 26 32 30  30 30 30 30 30 30 0d 00  |D    &20000000..|
00001420  a5 11 20 20 20 20 45 51  55 44 20 20 20 20 30 0d  |..    EQUD    0.|
00001430  00 a6 18 20 20 20 20 45  51 55 44 20 20 20 20 48  |...    EQUD    H|
00001440  65 6c 70 43 6f 64 65 0d  00 a7 08 20 20 20 20 0d  |elpCode....    .|
00001450  00 a8 2f 20 20 20 20 45  51 55 44 20 20 20 20 30  |../    EQUD    0|
00001460  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001470  20 20 20 5c 54 65 72 6d  69 6e 61 74 6f 72 0d 00  |   \Terminator..|
00001480  a9 04 0d 00 aa 0b 2e 64  65 63 6f 64 65 0d 00 ab  |.......decode...|
00001490  66 20 20 20 20 53 54 4d  46 44 20 20 20 31 33 21  |f    STMFD   13!|
000014a0  2c 7b 37 2d 31 31 2c 31  34 7d 20 20 20 20 20 20  |,{7-11,14}      |
000014b0  20 5c 52 37 2d 52 31 31  20 6d 75 73 74 20 62 65  | \R7-R11 must be|
000014c0  20 70 72 65 73 65 72 76  65 64 2e 20 52 30 3d 65  | preserved. R0=e|
000014d0  72 72 6f 72 20 70 6f 69  6e 74 65 72 20 69 66 20  |rror pointer if |
000014e0  61 6e 79 74 68 69 6e 67  20 67 6f 65 73 20 77 72  |anything goes wr|
000014f0  6f 6e 67 0d 00 ac 04 0d  00 ad 5f 20 20 20 20 43  |ong......._    C|
00001500  4d 50 20 20 20 20 20 31  2c 23 30 20 20 20 20 20  |MP     1,#0     |
00001510  20 20 20 20 20 20 20 20  20 20 20 5c 49 66 20 63  |           \If c|
00001520  6f 6d 6d 61 6e 64 20 68  61 73 20 6e 6f 20 70 61  |ommand has no pa|
00001530  72 61 6d 65 74 65 72 73  2c 20 74 68 65 6e 20 73  |rameters, then s|
00001540  68 6f 77 20 43 4d 4f 53  20 62 75 74 74 6f 6e 20  |how CMOS button |
00001550  73 74 61 74 75 73 0d 00  ae 24 20 20 20 20 42 45  |status...$    BE|
00001560  51 20 20 20 20 20 53 68  6f 77 53 74 61 74 75 73  |Q     ShowStatus|
00001570  20 20 20 20 20 20 20 20  20 20 0d 00 af 04 0d 00  |          ......|
00001580  b0 4a 20 20 20 20 43 4d  50 20 20 20 20 20 31 2c  |.J    CMP     1,|
00001590  23 31 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |#1              |
000015a0  20 20 5c 49 66 20 63 6f  6d 6d 61 6e 64 20 68 61  |  \If command ha|
000015b0  73 20 6d 6f 72 65 20 74  68 61 6e 20 31 20 70 61  |s more than 1 pa|
000015c0  72 61 6d 65 74 65 72 2c  0d 00 b1 49 20 20 20 20  |rameter,...I    |
000015d0  42 48 49 20 20 20 20 20  42 61 64 53 79 6e 74 61  |BHI     BadSynta|
000015e0  78 20 20 20 20 20 20 20  20 20 20 20 5c 74 68 65  |x           \the|
000015f0  6e 20 74 65 72 6d 69 6e  61 74 65 20 77 69 74 68  |n terminate with|
00001600  20 61 6e 20 65 72 72 6f  72 20 6d 65 73 73 61 67  | an error messag|
00001610  65 0d 00 b2 04 0d 00 b3  56 20 20 20 20 4c 44 52  |e.......V    LDR|
00001620  42 20 20 20 20 31 2c 5b  30 2c 23 32 5d 20 20 20  |B    1,[0,#2]   |
00001630  20 20 20 20 20 20 20 20  20 5c 4e 6f 74 65 20 2d  |         \Note -|
00001640  20 4f 53 20 61 6c 77 61  79 73 20 74 65 72 6d 69  | OS always termi|
00001650  6e 61 74 65 73 20 70 61  72 61 6d 65 74 65 72 73  |nates parameters|
00001660  20 77 69 74 68 20 26 30  44 32 30 0d 00 b4 56 20  | with &0D20...V |
00001670  20 20 20 43 4d 50 20 20  20 20 20 31 2c 23 31 33  |   CMP     1,#13|
00001680  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 5c  |               \|
00001690  49 66 20 52 31 3c 3e 31  33 20 74 68 65 6e 20 70  |If R1<>13 then p|
000016a0  61 72 61 6d 65 74 65 72  20 69 73 20 6e 6f 74 20  |arameter is not |
000016b0  31 20 63 68 61 72 61 63  74 65 72 20 6c 6f 6e 67  |1 character long|
000016c0  2c 0d 00 b5 4f 20 20 20  20 42 4e 45 20 20 20 20  |,...O    BNE    |
000016d0  20 42 61 64 53 79 6e 74  61 78 20 20 20 20 20 20  | BadSyntax      |
000016e0  20 20 20 20 20 5c 73 6f  20 74 65 72 6d 69 6e 61  |     \so termina|
000016f0  74 65 20 63 6f 6d 6d 61  6e 64 20 77 69 74 68 20  |te command with |
00001700  61 6e 20 65 72 72 6f 72  20 6d 65 73 73 61 67 65  |an error message|
00001710  0d 00 b6 04 0d 00 b7 61  20 20 20 20 4c 44 52 42  |.......a    LDRB|
00001720  20 20 20 20 30 2c 5b 30  5d 20 20 20 20 20 20 20  |    0,[0]       |
00001730  20 20 20 20 20 20 20 20  5c 47 65 74 20 70 61 72  |        \Get par|
00001740  61 6d 65 74 65 72 2c 20  63 6f 6d 6d 61 6e 64 20  |ameter, command |
00001750  68 61 73 20 6f 6e 6c 79  20 31 20 63 68 61 72 61  |has only 1 chara|
00001760  63 74 65 72 2c 20 6c 65  74 74 65 72 20 6f 72 20  |cter, letter or |
00001770  64 69 67 69 74 0d 00 b8  04 0d 00 b9 50 20 20 20  |digit.......P   |
00001780  20 43 4d 50 20 20 20 20  20 30 2c 23 97 22 30 22  | CMP     0,#."0"|
00001790  20 20 20 20 20 20 20 20  20 20 20 5c 49 66 20 70  |           \If p|
000017a0  61 72 61 6d 65 74 65 72  20 69 73 20 6e 6f 74 20  |arameter is not |
000017b0  6f 6e 65 20 6f 66 20 63  68 61 72 61 63 74 65 72  |one of character|
000017c0  73 20 30 2c 31 2c 32 2c  33 0d 00 ba 52 20 20 20  |s 0,1,2,3...R   |
000017d0  20 42 4c 54 20 20 20 20  20 42 61 64 53 79 6e 74  | BLT     BadSynt|
000017e0  61 78 20 20 20 20 20 20  20 20 20 20 20 5c 74 68  |ax           \th|
000017f0  65 6e 20 74 65 72 6d 69  6e 61 74 65 20 63 6f 6d  |en terminate com|
00001800  6d 61 6e 64 20 77 69 74  68 20 61 6e 20 65 72 72  |mand with an err|
00001810  6f 72 20 6d 65 73 73 61  67 65 2c 0d 00 bb 52 20  |or message,...R |
00001820  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001830  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 5c  |               \|
00001840  6f 74 68 65 72 77 69 73  65 20 63 6f 6d 6d 61 6e  |otherwise comman|
00001850  64 20 69 73 20 76 61 6c  69 64 20 26 20 63 61 6e  |d is valid & can|
00001860  20 62 65 20 70 72 6f 63  65 73 73 65 64 0d 00 bc  | be processed...|
00001870  17 20 20 20 20 43 4d 50  20 20 20 20 20 30 2c 23  |.    CMP     0,#|
00001880  97 22 33 22 0d 00 bd 20  20 20 20 20 42 48 49 20  |."3"...     BHI |
00001890  20 20 20 20 42 61 64 53  79 6e 74 61 78 20 20 20  |    BadSyntax   |
000018a0  20 20 20 20 0d 00 be 04  0d 00 bf 1b 5c f2 45 53  |    ........\.ES|
000018b0  53 20 42 55 54 54 4f 4e  53 20 50 41 52 41 4d 45  |S BUTTONS PARAME|
000018c0  54 45 52 0d 00 c0 04 0d  00 c1 6e 20 20 20 20 53  |TER.......n    S|
000018d0  55 42 20 20 20 20 20 30  2c 30 2c 23 97 22 30 22  |UB     0,0,#."0"|
000018e0  20 20 20 20 20 20 20 20  20 5c 47 65 74 20 6e 75  |         \Get nu|
000018f0  6d 65 72 69 63 20 76 61  6c 75 65 20 6f 66 20 61  |meric value of a|
00001900  73 63 69 69 20 63 6f 64  65 2e 20 4e 6f 74 65 20  |scii code. Note |
00001910  6f 6e 6c 79 20 62 69 74  73 20 30 20 26 20 31 20  |only bits 0 & 1 |
00001920  61 72 65 20 61 63 74 75  61 6c 6c 79 20 72 65 71  |are actually req|
00001930  75 69 72 65 64 0d 00 c2  4e 20 20 20 20 53 54 52  |uired...N    STR|
00001940  20 20 20 20 20 30 2c 61  72 67 73 20 20 20 20 20  |     0,args     |
00001950  20 20 20 20 20 20 20 20  20 5c 53 61 76 65 20 64  |         \Save d|
00001960  65 63 6f 64 65 64 20 61  72 67 75 6d 65 6e 74 20  |ecoded argument |
00001970  70 61 72 61 6d 65 74 65  72 20 66 6f 72 20 6c 61  |parameter for la|
00001980  74 65 72 0d 00 c3 04 0d  00 c4 3b 20 20 20 20 54  |ter.......;    T|
00001990  53 54 20 20 20 20 20 30  2c 23 25 31 30 20 20 20  |ST     0,#%10   |
000019a0  20 20 20 20 20 20 20 20  20 20 20 5c 43 6f 6e 66  |           \Conf|
000019b0  69 67 75 72 65 20 6e 65  77 20 73 65 74 74 69 6e  |igure new settin|
000019c0  67 3f 0d 00 c5 45 20 20  20 20 42 45 51 20 20 20  |g?...E    BEQ   |
000019d0  20 20 53 65 74 43 75 72  72 65 6e 74 20 20 20 20  |  SetCurrent    |
000019e0  20 20 20 20 20 20 5c 4e  4f 20 2d 20 4a 75 6d 70  |      \NO - Jump|
000019f0  20 73 74 72 61 69 67 68  74 20 74 6f 20 53 65 74  | straight to Set|
00001a00  43 75 72 72 65 6e 74 0d  00 c6 04 0d 00 c7 31 20  |Current.......1 |
00001a10  20 20 20 54 53 54 20 20  20 20 20 30 2c 23 25 30  |   TST     0,#%0|
00001a20  31 20 20 20 20 20 20 20  20 20 20 20 20 20 20 5c  |1              \|
00001a30  73 77 61 70 20 6f 72 20  6e 6f 74 3f 0d 00 c8 24  |swap or not?...$|
00001a40  20 20 20 20 ec 51 20 20  20 33 2c 23 30 20 20 20  |    .Q   3,#0   |
00001a50  20 20 20 20 20 20 20 20  20 20 20 20 20 5c 4e 4f  |             \NO|
00001a60  0d 00 c9 28 20 20 20 20  4d 4f 56 4e 45 20 20 20  |...(    MOVNE   |
00001a70  33 2c 23 43 4d 4f 53 62  69 74 25 20 20 20 20 20  |3,#CMOSbit%     |
00001a80  20 20 20 20 5c 59 45 53  0d 00 ca 04 0d 00 cb 3d  |    \YES.......=|
00001a90  20 20 20 20 4d 4f 56 20  20 20 20 20 31 2c 23 43  |    MOV     1,#C|
00001aa0  4d 4f 53 6c 6f 63 25 20  20 20 20 20 20 20 20 20  |MOSloc%         |
00001ab0  5c 53 74 6f 72 65 20 73  74 61 74 75 73 20 69 6e  |\Store status in|
00001ac0  20 43 4d 4f 53 20 52 41  4d 0d 00 cc 25 20 20 20  | CMOS RAM...%   |
00001ad0  20 4d 4f 56 20 20 20 20  20 34 2c 23 43 4d 4f 53  | MOV     4,#CMOS|
00001ae0  62 69 74 25 20 20 20 20  20 20 20 20 20 20 0d 00  |bit%          ..|
00001af0  cd 1d 20 20 20 20 42 4c  20 20 20 20 20 20 52 65  |..    BL      Re|
00001b00  61 64 57 72 69 74 65 43  6d 6f 73 0d 00 ce 04 0d  |adWriteCmos.....|
00001b10  00 cf 0f 2e 53 65 74 43  75 72 72 65 6e 74 0d 00  |....SetCurrent..|
00001b20  d0 41 20 20 20 20 4c 44  52 20 20 20 20 20 31 2c  |.A    LDR     1,|
00001b30  49 6e 74 65 72 63 65 70  74 46 6c 61 67 20 20 20  |InterceptFlag   |
00001b40  20 20 5c 47 65 74 20 63  75 72 72 65 6e 74 20 69  |  \Get current i|
00001b50  6e 74 65 72 63 65 70 74  20 73 74 61 74 75 73 0d  |ntercept status.|
00001b60  00 d1 40 20 20 20 20 4c  44 52 20 20 20 20 20 30  |..@    LDR     0|
00001b70  2c 61 72 67 73 20 20 20  20 20 20 20 20 20 20 20  |,args           |
00001b80  20 20 20 5c 52 65 74 72  69 65 76 65 20 61 72 67  |   \Retrieve arg|
00001b90  75 6d 65 6e 74 20 70 61  72 61 6d 65 74 65 72 0d  |ument parameter.|
00001ba0  00 d2 16 20 20 20 20 54  53 54 20 20 20 20 20 30  |...    TST     0|
00001bb0  2c 23 25 30 31 0d 00 d3  14 20 20 20 20 42 4e 45  |,#%01....    BNE|
00001bc0  20 20 20 20 20 73 77 61  70 0d 00 d4 04 0d 00 d5  |     swap.......|
00001bd0  39 5c 4e 4f 52 4d 41 4c  20 52 4f 55 54 49 4e 45  |9\NORMAL ROUTINE|
00001be0  20 2d 20 52 45 4c 45 41  53 45 20 56 45 43 54 4f  | - RELEASE VECTO|
00001bf0  52 20 e7 20 ac 20 41 4c  52 45 41 44 59 20 52 45  |R . . ALREADY RE|
00001c00  4c 45 41 53 45 44 0d 00  d6 43 20 20 20 20 54 53  |LEASED...C    TS|
00001c10  54 20 20 20 20 20 31 2c  23 31 20 20 20 20 20 20  |T     1,#1      |
00001c20  20 20 20 20 20 20 20 20  20 20 5c 5a 3d 30 2c 20  |          \Z=0, |
00001c30  63 6c 61 69 6d 65 64 20  20 5a 3d 31 2c 20 6e 6f  |claimed  Z=1, no|
00001c40  74 20 63 6c 61 69 6d 65  64 0d 00 d7 4d 20 20 20  |t claimed...M   |
00001c50  20 42 4c 4e 45 20 20 20  20 72 65 6c 65 61 73 65  | BLNE    release|
00001c60  20 20 20 20 20 20 20 20  20 20 20 20 20 5c 51 75  |             \Qu|
00001c70  69 74 20 69 66 20 6e 6f  74 20 63 6c 61 69 6d 65  |it if not claime|
00001c80  64 2c 20 65 6c 73 65 20  72 65 6c 65 61 73 65 20  |d, else release |
00001c90  76 65 63 74 6f 72 0d 00  d8 1d 20 20 20 20 41 44  |vector....    AD|
00001ca0  52 56 53 20 20 20 30 2c  43 61 6e 74 52 65 6c 65  |RVS   0,CantRele|
00001cb0  61 73 65 0d 00 d9 1d 20  20 20 20 4c 44 4d 46 44  |ase....    LDMFD|
00001cc0  20 20 20 31 33 21 2c 7b  37 2d 31 31 2c 50 43 7d  |   13!,{7-11,PC}|
00001cd0  0d 00 da 04 0d 00 db 10  2e 43 61 6e 74 52 65 6c  |.........CantRel|
00001ce0  65 61 73 65 0d 00 dc 11  20 20 20 20 45 51 55 44  |ease....    EQUD|
00001cf0  20 20 20 20 30 0d 00 dd  5a 20 20 20 20 45 51 55  |    0...Z    EQU|
00001d00  53 20 20 20 20 22 43 61  6e 6e 6f 74 20 72 65 74  |S    "Cannot ret|
00001d10  75 72 6e 20 6d 6f 75 73  65 20 62 75 74 74 6f 6e  |urn mouse button|
00001d20  73 20 74 6f 20 6e 6f 72  6d 61 6c 2c 20 74 72 79  |s to normal, try|
00001d30  20 72 65 6c 6f 61 64 69  6e 67 20 4d 69 67 68 74  | reloading Might|
00001d40  79 4d 6f 75 73 65 20 6d  6f 64 75 6c 65 2e 22 0d  |yMouse module.".|
00001d50  00 de 15 20 20 20 20 45  51 55 57 20 20 20 20 26  |...    EQUW    &|
00001d60  30 41 30 44 0d 00 df 11  20 20 20 20 45 51 55 42  |0A0D....    EQUB|
00001d70  20 20 20 20 30 0d 00 e0  0d 20 20 20 20 41 4c 49  |    0....    ALI|
00001d80  47 4e 0d 00 e1 04 0d 00  e2 32 5c c8 94 20 52 4f  |GN.......2\.. RO|
00001d90  55 54 49 4e 45 20 2d 20  43 4c 41 49 4d 20 56 45  |UTINE - CLAIM VE|
00001da0  43 54 4f 52 20 e7 20 ac  20 41 4c 52 45 41 44 59  |CTOR . . ALREADY|
00001db0  20 43 4c 41 49 4d 45 44  0d 00 e3 09 2e 73 77 61  | CLAIMED.....swa|
00001dc0  70 0d 00 e4 43 20 20 20  20 54 53 54 20 20 20 20  |p...C    TST    |
00001dd0  20 31 2c 23 31 20 20 20  20 20 20 20 20 20 20 20  | 1,#1           |
00001de0  20 20 20 20 20 5c 5a 3d  30 2c 20 63 6c 61 69 6d  |     \Z=0, claim|
00001df0  65 64 20 20 5a 3d 31 2c  20 6e 6f 74 20 63 6c 61  |ed  Z=1, not cla|
00001e00  69 6d 65 64 0d 00 e5 49  20 20 20 20 42 4c 45 51  |imed...I    BLEQ|
00001e10  20 20 20 20 63 6c 61 69  6d 20 20 20 20 20 20 20  |    claim       |
00001e20  20 20 20 20 20 20 20 20  5c 51 75 69 74 20 69 66  |        \Quit if|
00001e30  20 63 6c 61 69 6d 65 64  2c 20 65 6c 73 65 20 72  | claimed, else r|
00001e40  65 6c 65 61 73 65 20 76  65 63 74 6f 72 0d 00 e6  |elease vector...|
00001e50  1b 20 20 20 20 41 44 52  56 53 20 20 20 30 2c 43  |.    ADRVS   0,C|
00001e60  61 6e 74 43 6c 61 69 6d  0d 00 e7 1d 20 20 20 20  |antClaim....    |
00001e70  4c 44 4d 46 44 20 20 20  31 33 21 2c 7b 37 2d 31  |LDMFD   13!,{7-1|
00001e80  31 2c 50 43 7d 0d 00 e8  04 0d 00 e9 0e 2e 43 61  |1,PC}.........Ca|
00001e90  6e 74 43 6c 61 69 6d 0d  00 ea 11 20 20 20 20 45  |ntClaim....    E|
00001ea0  51 55 44 20 20 20 20 30  0d 00 eb 4e 20 20 20 20  |QUD    0...N    |
00001eb0  45 51 55 53 20 20 20 20  22 43 61 6e 6e 6f 74 20  |EQUS    "Cannot |
00001ec0  73 77 61 70 20 6d 6f 75  73 65 20 62 75 74 74 6f  |swap mouse butto|
00001ed0  6e 73 2c 20 74 72 79 20  72 65 6c 6f 61 64 69 6e  |ns, try reloadin|
00001ee0  67 20 4d 69 67 68 74 79  4d 6f 75 73 65 20 6d 6f  |g MightyMouse mo|
00001ef0  64 75 6c 65 2e 22 0d 00  ec 11 20 20 20 20 45 51  |dule."....    EQ|
00001f00  55 42 20 20 20 20 30 0d  00 ed 0d 20 20 20 20 41  |UB    0....    A|
00001f10  4c 49 47 4e 0d 00 ee 04  0d 00 ef 0f 2e 53 68 6f  |LIGN.........Sho|
00001f20  77 53 74 61 74 75 73 0d  00 f0 1f 20 20 20 20 4c  |wStatus....    L|
00001f30  44 52 20 20 20 20 20 37  2c 49 6e 74 65 72 63 65  |DR     7,Interce|
00001f40  70 74 46 6c 61 67 0d 00  f1 43 20 20 20 20 54 53  |ptFlag...C    TS|
00001f50  54 20 20 20 20 20 37 2c  23 31 20 20 20 20 20 20  |T     7,#1      |
00001f60  20 20 20 20 20 20 20 20  20 20 5c 5a 3d 30 2c 20  |          \Z=0, |
00001f70  63 6c 61 69 6d 65 64 20  20 5a 3d 31 2c 20 6e 6f  |claimed  Z=1, no|
00001f80  74 20 63 6c 61 69 6d 65  64 0d 00 f2 19 20 20 20  |t claimed....   |
00001f90  20 42 4e 45 20 20 20 20  20 63 75 72 72 65 6e 74  | BNE     current|
00001fa0  6c 79 0d 00 f3 04 0d 00  f4 1c 20 20 20 20 53 57  |ly........    SW|
00001fb0  49 20 20 20 20 20 22 58  4f 53 5f 57 72 69 74 65  |I     "XOS_Write|
00001fc0  53 22 0d 00 f5 29 20 20  20 20 45 51 55 53 20 20  |S"...)    EQUS  |
00001fd0  20 20 22 4d 6f 75 73 65  20 62 75 74 74 6f 6e 73  |  "Mouse buttons|
00001fe0  20 6e 6f 72 6d 61 6c 20  26 20 22 0d 00 f6 11 20  | normal & ".... |
00001ff0  20 20 20 45 51 55 42 20  20 20 20 30 0d 00 f7 0d  |   EQUB    0....|
00002000  20 20 20 20 41 4c 49 47  4e 0d 00 f8 04 0d 00 f9  |    ALIGN.......|
00002010  14 20 20 20 20 42 20 20  20 20 20 20 20 63 6d 6f  |.    B       cmo|
00002020  73 0d 00 fa 04 0d 00 fb  0e 2e 63 75 72 72 65 6e  |s.........curren|
00002030  74 6c 79 0d 00 fc 1c 20  20 20 20 53 57 49 20 20  |tly....    SWI  |
00002040  20 20 20 22 58 4f 53 5f  57 72 69 74 65 53 22 0d  |   "XOS_WriteS".|
00002050  00 fd 2a 20 20 20 20 45  51 55 53 20 20 20 20 22  |..*    EQUS    "|
00002060  4d 6f 75 73 65 20 62 75  74 74 6f 6e 73 20 73 77  |Mouse buttons sw|
00002070  61 70 70 65 64 20 26 20  22 0d 00 fe 11 20 20 20  |apped & "....   |
00002080  20 45 51 55 42 20 20 20  20 30 0d 00 ff 0d 20 20  | EQUB    0....  |
00002090  20 20 41 4c 49 47 4e 0d  01 00 04 0d 01 01 09 2e  |  ALIGN.........|
000020a0  63 6d 6f 73 0d 01 02 1b  20 20 20 20 4d 4f 56 20  |cmos....    MOV |
000020b0  20 20 20 20 31 2c 23 43  4d 4f 53 6c 6f 63 25 0d  |    1,#CMOSloc%.|
000020c0  01 03 3f 20 20 20 20 4d  4f 56 20 20 20 20 20 34  |..?    MOV     4|
000020d0  2c 23 30 20 20 20 20 20  20 20 20 20 20 20 20 20  |,#0             |
000020e0  20 20 20 5c 4d 61 73 6b  3d 30 20 74 6f 20 72 65  |   \Mask=0 to re|
000020f0  61 64 20 43 4d 4f 53 20  73 74 61 74 75 73 0d 01  |ad CMOS status..|
00002100  04 1d 20 20 20 20 42 4c  20 20 20 20 20 20 52 65  |..    BL      Re|
00002110  61 64 57 72 69 74 65 43  6d 6f 73 0d 01 05 04 0d  |adWriteCmos.....|
00002120  01 06 1b 20 20 20 20 54  53 54 20 20 20 20 20 32  |...    TST     2|
00002130  2c 23 43 4d 4f 53 62 69  74 25 0d 01 07 17 20 20  |,#CMOSbit%....  |
00002140  20 20 42 4e 45 20 20 20  20 20 73 77 61 70 70 65  |  BNE     swappe|
00002150  64 0d 01 08 04 0d 01 09  1c 20 20 20 20 53 57 49  |d........    SWI|
00002160  20 20 20 20 20 22 58 4f  53 5f 57 72 69 74 65 53  |     "XOS_WriteS|
00002170  22 0d 01 0a 24 20 20 20  20 45 51 55 53 20 20 20  |"...$    EQUS   |
00002180  20 22 63 6f 6e 66 69 67  75 72 65 64 20 6e 6f 72  | "configured nor|
00002190  6d 61 6c 2e 22 0d 01 0b  15 20 20 20 20 45 51 55  |mal."....    EQU|
000021a0  57 20 20 20 20 26 30 41  30 44 0d 01 0c 11 20 20  |W    &0A0D....  |
000021b0  20 20 45 51 55 42 20 20  20 20 30 0d 01 0d 0d 20  |  EQUB    0.... |
000021c0  20 20 20 41 4c 49 47 4e  0d 01 0e 04 0d 01 0f 24  |   ALIGN.......$|
000021d0  20 20 20 20 4c 44 4d 46  44 20 20 20 31 33 21 2c  |    LDMFD   13!,|
000021e0  7b 37 2d 31 31 2c 50 43  7d 5e 20 20 20 20 20 20  |{7-11,PC}^      |
000021f0  0d 01 10 04 0d 01 11 0c  2e 73 77 61 70 70 65 64  |.........swapped|
00002200  0d 01 12 1c 20 20 20 20  53 57 49 20 20 20 20 20  |....    SWI     |
00002210  22 58 4f 53 5f 57 72 69  74 65 53 22 0d 01 13 25  |"XOS_WriteS"...%|
00002220  20 20 20 20 45 51 55 53  20 20 20 20 22 63 6f 6e  |    EQUS    "con|
00002230  66 69 67 75 72 65 64 20  73 77 61 70 70 65 64 2e  |figured swapped.|
00002240  22 0d 01 14 15 20 20 20  20 45 51 55 57 20 20 20  |"....    EQUW   |
00002250  20 26 30 41 30 44 0d 01  15 11 20 20 20 20 45 51  | &0A0D....    EQ|
00002260  55 42 20 20 20 20 30 0d  01 16 0d 20 20 20 20 41  |UB    0....    A|
00002270  4c 49 47 4e 0d 01 17 04  0d 01 18 1e 20 20 20 20  |LIGN........    |
00002280  4c 44 4d 46 44 20 20 20  31 33 21 2c 7b 37 2d 31  |LDMFD   13!,{7-1|
00002290  31 2c 50 43 7d 5e 0d 01  19 04 0d 01 1a 0e 2e 42  |1,PC}^.........B|
000022a0  61 64 53 79 6e 74 61 78  0d 01 1b 1d 20 20 20 20  |adSyntax....    |
000022b0  41 44 52 20 20 20 20 20  30 2c 53 79 6e 74 61 78  |ADR     0,Syntax|
000022c0  45 72 72 6f 72 0d 01 1c  47 20 20 20 20 54 45 51  |Error...G    TEQ|
000022d0  50 20 20 20 20 50 43 2c  23 26 31 30 30 30 30 30  |P    PC,#&100000|
000022e0  30 33 20 20 20 20 20 20  20 5c 53 65 74 20 56 2c  |03       \Set V,|
000022f0  20 72 65 6d 65 6d 62 65  72 69 6e 67 20 70 72 6f  | remembering pro|
00002300  63 65 73 73 6f 72 20 73  74 61 74 65 0d 01 1d 1d  |cessor state....|
00002310  20 20 20 20 4c 44 4d 46  44 20 20 20 31 33 21 2c  |    LDMFD   13!,|
00002320  7b 37 2d 31 31 2c 50 43  7d 0d 01 1e 04 0d 01 1f  |{7-11,PC}.......|
00002330  10 2e 53 79 6e 74 61 78  45 72 72 6f 72 0d 01 20  |..SyntaxError.. |
00002340  11 20 20 20 20 45 51 55  44 20 20 20 20 30 0d 01  |.    EQUD    0..|
00002350  21 12 2e 53 79 6e 74 61  78 4d 65 73 73 61 67 65  |!..SyntaxMessage|
00002360  0d 01 22 2b 20 20 20 20  45 51 55 53 20 20 20 20  |.."+    EQUS    |
00002370  22 53 79 6e 74 61 78 3a  20 42 75 74 74 6f 6e 73  |"Syntax: Buttons|
00002380  20 5b 30 7c 31 7c 32 7c  33 5d 22 0d 01 23 11 20  | [0|1|2|3]"..#. |
00002390  20 20 20 45 51 55 42 20  20 20 20 30 0d 01 24 0d  |   EQUB    0..$.|
000023a0  20 20 20 20 41 4c 49 47  4e 0d 01 25 04 0d 01 26  |    ALIGN..%...&|
000023b0  10 2e 43 6f 6d 6d 61 6e  64 48 65 6c 70 0d 01 27  |..CommandHelp..'|
000023c0  5b 20 20 20 20 45 51 55  53 20 20 20 20 22 2a 42  |[    EQUS    "*B|
000023d0  75 74 74 6f 6e 73 20 63  6f 6e 66 69 67 75 72 65  |uttons configure|
000023e0  73 20 74 68 65 20 6d 6f  75 73 65 20 62 75 74 74  |s the mouse butt|
000023f0  6f 6e 73 20 66 6f 72 20  72 69 67 68 74 20 6f 72  |ons for right or|
00002400  20 6c 65 66 74 2d 68 61  6e 64 65 64 20 6f 70 65  | left-handed ope|
00002410  72 61 74 69 6f 6e 2e 22  0d 01 28 15 20 20 20 20  |ration."..(.    |
00002420  45 51 55 57 20 20 20 20  26 30 41 30 44 0d 01 29  |EQUW    &0A0D..)|
00002430  74 20 20 20 20 45 51 55  53 20 20 20 20 22 2a 42  |t    EQUS    "*B|
00002440  75 74 74 6f 6e 73 20 77  69 74 68 20 6e 6f 20 70  |uttons with no p|
00002450  61 72 61 6d 65 74 65 72  73 20 64 69 73 70 6c 61  |arameters displa|
00002460  79 73 20 74 68 65 20 63  75 72 72 65 6e 74 20 26  |ys the current &|
00002470  20 63 6f 6e 66 69 67 75  72 65 64 20 6e 6f 72 6d  | configured norm|
00002480  61 6c 2f 73 77 61 70 70  65 64 20 6d 6f 75 73 65  |al/swapped mouse|
00002490  20 62 75 74 74 6f 6e 73  20 73 74 61 74 75 73 2e  | buttons status.|
000024a0  22 0d 01 2a 15 20 20 20  20 45 51 55 57 20 20 20  |"..*.    EQUW   |
000024b0  20 26 30 41 30 44 0d 01  2b 15 20 20 20 20 45 51  | &0A0D..+.    EQ|
000024c0  55 57 20 20 20 20 26 30  41 30 44 0d 01 2c 2b 20  |UW    &0A0D..,+ |
000024d0  20 20 20 45 51 55 53 20  20 20 20 22 53 79 6e 74  |   EQUS    "Synt|
000024e0  61 78 3a 20 42 75 74 74  6f 6e 73 20 5b 30 7c 31  |ax: Buttons [0|1|
000024f0  7c 32 7c 33 5d 22 0d 01  2d 15 20 20 20 20 45 51  ||2|3]"..-.    EQ|
00002500  55 57 20 20 20 20 26 30  41 30 44 0d 01 2e 2c 20  |UW    &0A0D..., |
00002510  20 20 20 45 51 55 53 20  20 20 20 22 a0 a0 a0 a0  |   EQUS    "....|
00002520  a0 a0 a0 a0 30 20 3d 20  42 75 74 74 6f 6e 73 20  |....0 = Buttons |
00002530  6e 6f 72 6d 61 6c 22 0d  01 2f 15 20 20 20 20 45  |normal"../.    E|
00002540  51 55 57 20 20 20 20 26  30 41 30 44 0d 01 30 2d  |QUW    &0A0D..0-|
00002550  20 20 20 20 45 51 55 53  20 20 20 20 22 a0 a0 a0  |    EQUS    "...|
00002560  a0 a0 a0 a0 a0 31 20 3d  20 42 75 74 74 6f 6e 73  |.....1 = Buttons|
00002570  20 73 77 61 70 70 65 64  22 0d 01 31 15 20 20 20  | swapped"..1.   |
00002580  20 45 51 55 57 20 20 20  20 26 30 41 30 44 0d 01  | EQUW    &0A0D..|
00002590  32 4a 20 20 20 20 45 51  55 53 20 20 20 20 22 a0  |2J    EQUS    ".|
000025a0  a0 a0 a0 a0 a0 a0 a0 32  20 3d 20 42 75 74 74 6f  |.......2 = Butto|
000025b0  6e 73 20 6e 6f 72 6d 61  6c a0 a0 26 20 73 65 74  |ns normal..& set|
000025c0  74 69 6e 67 20 73 74 6f  72 65 64 20 69 6e 20 43  |ting stored in C|
000025d0  4d 4f 53 20 52 41 4d 22  0d 01 33 15 20 20 20 20  |MOS RAM"..3.    |
000025e0  45 51 55 57 20 20 20 20  26 30 41 30 44 0d 01 34  |EQUW    &0A0D..4|
000025f0  4a 20 20 20 20 45 51 55  53 20 20 20 20 22 a0 a0  |J    EQUS    "..|
00002600  a0 a0 a0 a0 a0 a0 33 20  3d 20 42 75 74 74 6f 6e  |......3 = Button|
00002610  73 20 73 77 61 70 70 65  64 20 26 20 73 65 74 74  |s swapped & sett|
00002620  69 6e 67 20 73 74 6f 72  65 64 20 69 6e 20 43 4d  |ing stored in CM|
00002630  4f 53 20 52 41 4d 22 0d  01 35 11 20 20 20 20 45  |OS RAM"..5.    E|
00002640  51 55 42 20 20 20 20 30  0d 01 36 0d 20 20 20 20  |QUB    0..6.    |
00002650  41 4c 49 47 4e 0d 01 37  04 0d 01 38 11 2e 44 65  |ALIGN..7...8..De|
00002660  63 6f 64 65 53 74 61 74  75 73 0d 01 39 66 20 20  |codeStatus..9f  |
00002670  20 20 53 54 4d 46 44 20  20 20 31 33 21 2c 7b 37  |  STMFD   13!,{7|
00002680  2d 31 31 2c 31 34 7d 20  20 20 20 20 20 20 5c 52  |-11,14}       \R|
00002690  37 2d 52 31 31 20 6d 75  73 74 20 62 65 20 70 72  |7-R11 must be pr|
000026a0  65 73 65 72 76 65 64 2e  20 52 30 3d 65 72 72 6f  |eserved. R0=erro|
000026b0  72 20 70 6f 69 6e 74 65  72 20 69 66 20 61 6e 79  |r pointer if any|
000026c0  74 68 69 6e 67 20 67 6f  65 73 20 77 72 6f 6e 67  |thing goes wrong|
000026d0  0d 01 3a 04 0d 01 3b 4b  20 20 20 20 43 4d 50 20  |..:...;K    CMP |
000026e0  20 20 20 20 30 2c 23 30  20 20 20 20 20 20 20 20  |    0,#0        |
000026f0  20 20 20 20 20 20 20 20  5c 48 61 73 20 2a 43 6f  |        \Has *Co|
00002700  6e 66 69 67 75 72 65 20  62 79 20 69 74 73 65 6c  |nfigure by itsel|
00002710  66 20 62 65 65 6e 20 65  6e 74 65 72 65 64 3f 0d  |f been entered?.|
00002720  01 3c 4f 20 20 20 20 41  44 52 45 51 20 20 20 30  |.<O    ADREQ   0|
00002730  2c 63 6f 6e 66 69 67 20  20 20 20 20 20 20 20 20  |,config         |
00002740  20 20 20 5c 59 45 53 20  2d 20 64 69 73 70 6c 61  |   \YES - displa|
00002750  79 20 63 6f 6e 66 69 67  75 72 61 74 69 6f 6e 20  |y configuration |
00002760  6d 65 73 73 61 67 65 20  26 20 71 75 69 74 0d 01  |message & quit..|
00002770  3d 4f 20 20 20 20 53 57  49 45 51 20 20 20 22 58  |=O    SWIEQ   "X|
00002780  4f 53 5f 57 72 69 74 65  30 22 20 20 20 20 20 20  |OS_Write0"      |
00002790  20 20 5c 4e 4f 20 20 2d  20 63 68 65 63 6b 20 52  |  \NO  - check R|
000027a0  30 20 69 73 20 6e 6f 74  20 63 6f 6d 6d 61 6e 64  |0 is not command|
000027b0  20 74 61 69 6c 20 70 6f  69 6e 74 65 72 0d 01 3e  | tail pointer..>|
000027c0  1e 20 20 20 20 4c 44 4d  45 51 46 44 20 31 33 21  |.    LDMEQFD 13!|
000027d0  2c 7b 37 2d 31 31 2c 50  43 7d 5e 0d 01 3f 04 0d  |,{7-11,PC}^..?..|
000027e0  01 40 4b 20 20 20 20 43  4d 50 20 20 20 20 20 30  |.@K    CMP     0|
000027f0  2c 23 31 20 20 20 20 20  20 20 20 20 20 20 20 20  |,#1             |
00002800  20 20 20 5c 48 61 73 20  2a 43 6f 6e 66 69 67 75  |   \Has *Configu|
00002810  72 65 20 42 75 74 74 6f  6e 73 20 62 65 65 6e 20  |re Buttons been |
00002820  61 74 74 65 6d 70 74 65  64 3f 0d 01 41 47 20 20  |attempted?..AG  |
00002830  20 20 41 44 52 48 49 20  20 20 30 2c 42 61 64 43  |  ADRHI   0,BadC|
00002840  6f 6e 66 69 67 20 20 20  20 20 20 20 20 20 5c 59  |onfig         \Y|
00002850  45 53 20 2d 20 64 69 73  70 6c 61 79 20 65 72 72  |ES - display err|
00002860  6f 72 20 6d 65 73 73 61  67 65 20 26 20 71 75 69  |or message & qui|
00002870  74 0d 01 42 49 20 20 20  20 54 45 51 48 49 50 20  |t..BI    TEQHIP |
00002880  20 50 43 2c 23 26 33 30  30 30 30 30 30 33 20 20  | PC,#&30000003  |
00002890  20 20 20 20 20 5c 53 65  74 20 43 26 56 2c 20 72  |     \Set C&V, r|
000028a0  65 6d 65 6d 62 65 72 69  6e 67 20 70 72 6f 63 65  |emembering proce|
000028b0  73 73 6f 72 20 73 74 61  74 65 0d 01 43 1d 20 20  |ssor state..C.  |
000028c0  20 20 4c 44 4d 48 49 46  44 20 31 33 21 2c 7b 37  |  LDMHIFD 13!,{7|
000028d0  2d 31 31 2c 50 43 7d 0d  01 44 04 0d 01 45 41 20  |-11,PC}..D...EA |
000028e0  20 20 20 4d 4f 56 20 20  20 20 20 30 2c 23 31 36  |   MOV     0,#16|
000028f0  31 20 20 20 20 20 20 20  20 20 20 20 20 20 20 5c  |1              \|
00002900  47 65 74 20 43 4d 4f 53  20 52 41 4d 20 62 75 74  |Get CMOS RAM but|
00002910  74 6f 6e 73 20 73 65 74  74 69 6e 67 0d 01 46 1b  |tons setting..F.|
00002920  20 20 20 20 4d 4f 56 20  20 20 20 20 31 2c 23 43  |    MOV     1,#C|
00002930  4d 4f 53 6c 6f 63 25 0d  01 47 1a 20 20 20 20 53  |MOSloc%..G.    S|
00002940  57 49 20 20 20 20 20 22  58 4f 53 5f 42 79 74 65  |WI     "XOS_Byte|
00002950  22 0d 01 48 04 0d 01 49  50 20 20 20 20 54 53 54  |"..H...IP    TST|
00002960  20 20 20 20 20 32 2c 23  43 4d 4f 53 62 69 74 25  |     2,#CMOSbit%|
00002970  20 20 20 20 20 20 20 20  20 5c 52 65 66 6c 65 63  |         \Reflec|
00002980  74 20 62 75 74 74 6f 6e  73 20 73 65 74 74 69 6e  |t buttons settin|
00002990  67 20 77 69 74 68 20 73  63 72 65 65 6e 20 6d 65  |g with screen me|
000029a0  73 73 61 67 65 0d 01 4a  1b 20 20 20 20 41 44 52  |ssage..J.    ADR|
000029b0  45 51 20 20 20 30 2c 4e  6f 72 6d 61 6c 4d 53 47  |EQ   0,NormalMSG|
000029c0  0d 01 4b 1c 20 20 20 20  41 44 52 4e 45 20 20 20  |..K.    ADRNE   |
000029d0  30 2c 53 77 61 70 70 65  64 4d 53 47 0d 01 4c 1c  |0,SwappedMSG..L.|
000029e0  20 20 20 20 53 57 49 20  20 20 20 20 22 58 4f 53  |    SWI     "XOS|
000029f0  5f 57 72 69 74 65 30 22  0d 01 4d 04 0d 01 4e 1e  |_Write0"..M...N.|
00002a00  20 20 20 20 4c 44 4d 46  44 20 20 20 31 33 21 2c  |    LDMFD   13!,|
00002a10  7b 37 2d 31 31 2c 50 43  7d 5e 0d 01 4f 04 0d 01  |{7-11,PC}^..O...|
00002a20  50 0b 2e 63 6f 6e 66 69  67 0d 01 51 22 20 20 20  |P..config..Q"   |
00002a30  20 45 51 55 53 20 20 20  20 22 2a 42 75 74 74 6f  | EQUS    "*Butto|
00002a40  6e 73 20 20 20 3c 32 7c  33 3e 22 0d 01 52 15 20  |ns   <2|3>"..R. |
00002a50  20 20 20 45 51 55 57 20  20 20 20 26 30 41 30 44  |   EQUW    &0A0D|
00002a60  0d 01 53 11 20 20 20 20  45 51 55 42 20 20 20 20  |..S.    EQUB    |
00002a70  30 0d 01 54 0d 20 20 20  20 41 4c 49 47 4e 0d 01  |0..T.    ALIGN..|
00002a80  55 04 0d 01 56 0e 2e 42  61 64 43 6f 6e 66 69 67  |U...V..BadConfig|
00002a90  0d 01 57 11 20 20 20 20  45 51 55 44 20 20 20 20  |..W.    EQUD    |
00002aa0  30 0d 01 58 43 20 20 20  20 45 51 55 53 20 20 20  |0..XC    EQUS   |
00002ab0  20 22 55 73 65 20 2a 42  75 74 74 6f 6e 73 20 3c  | "Use *Buttons <|
00002ac0  32 7c 33 3e 20 74 6f 20  73 65 74 20 74 68 65 20  |2|3> to set the |
00002ad0  43 4d 4f 53 20 63 6f 6e  66 69 67 75 72 61 74 69  |CMOS configurati|
00002ae0  6f 6e 2e 22 0d 01 59 11  20 20 20 20 45 51 55 42  |on."..Y.    EQUB|
00002af0  20 20 20 20 30 0d 01 5a  0d 20 20 20 20 41 4c 49  |    0..Z.    ALI|
00002b00  47 4e 0d 01 5b 04 0d 01  5c 0e 2e 4e 6f 72 6d 61  |GN..[...\..Norma|
00002b10  6c 4d 53 47 0d 01 5d 27  20 20 20 20 45 51 55 53  |lMSG..]'    EQUS|
00002b20  20 20 20 20 22 4d 6f 75  73 65 20 62 75 74 74 6f  |    "Mouse butto|
00002b30  6e 73 20 6e 6f 72 6d 61  6c 2e 22 0d 01 5e 15 20  |ns normal."..^. |
00002b40  20 20 20 45 51 55 57 20  20 20 20 26 30 41 30 44  |   EQUW    &0A0D|
00002b50  0d 01 5f 11 20 20 20 20  45 51 55 42 20 20 20 20  |.._.    EQUB    |
00002b60  30 0d 01 60 0d 20 20 20  20 41 4c 49 47 4e 0d 01  |0..`.    ALIGN..|
00002b70  61 04 0d 01 62 0f 2e 53  77 61 70 70 65 64 4d 53  |a...b..SwappedMS|
00002b80  47 0d 01 63 28 20 20 20  20 45 51 55 53 20 20 20  |G..c(    EQUS   |
00002b90  20 22 4d 6f 75 73 65 20  62 75 74 74 6f 6e 73 20  | "Mouse buttons |
00002ba0  73 77 61 70 70 65 64 2e  22 0d 01 64 15 20 20 20  |swapped."..d.   |
00002bb0  20 45 51 55 57 20 20 20  20 26 30 41 30 44 0d 01  | EQUW    &0A0D..|
00002bc0  65 11 20 20 20 20 45 51  55 42 20 20 20 20 30 0d  |e.    EQUB    0.|
00002bd0  01 66 0d 20 20 20 20 41  4c 49 47 4e 0d 01 67 04  |.f.    ALIGN..g.|
00002be0  0d 01 68 0d 2e 48 65 6c  70 43 6f 64 65 0d 01 69  |..h..HelpCode..i|
00002bf0  16 20 20 20 20 41 44 52  20 20 20 20 20 30 2c 69  |.    ADR     0,i|
00002c00  6e 66 6f 0d 01 6a 15 20  20 20 20 4d 4f 56 53 20  |nfo..j.    MOVS |
00002c10  20 20 20 50 43 2c 31 34  0d 01 6b 04 0d 01 6c 09  |   PC,14..k...l.|
00002c20  2e 69 6e 66 6f 0d 01 6d  63 20 20 20 20 45 51 55  |.info..mc    EQU|
00002c30  53 20 20 20 20 22 4d 6f  64 75 6c 65 20 4d 69 67  |S    "Module Mig|
00002c40  68 74 79 4d 6f 75 73 65  20 73 77 61 70 73 20 74  |htyMouse swaps t|
00002c50  68 65 20 53 65 6c 65 63  74 20 26 20 41 64 6a 75  |he Select & Adju|
00002c60  73 74 20 6d 6f 75 73 65  20 62 75 74 74 6f 6e 73  |st mouse buttons|
00002c70  20 66 6f 72 20 6c 65 66  74 2d 68 61 6e 64 65 64  | for left-handed|
00002c80  20 75 73 65 72 73 2e 22  0d 01 6e 15 20 20 20 20  | users."..n.    |
00002c90  45 51 55 57 20 20 20 20  26 30 41 30 44 0d 01 6f  |EQUW    &0A0D..o|
00002ca0  29 20 20 20 20 45 51 55  53 20 20 20 20 22 53 57  |)    EQUS    "SW|
00002cb0  49 20 62 61 73 65 a0 a0  3d 20 26 22 2b c3 7e 53  |I base..= &"+.~S|
00002cc0  77 69 42 61 73 65 0d 01  70 15 20 20 20 20 45 51  |wiBase..p.    EQ|
00002cd0  55 57 20 20 20 20 26 30  41 30 44 0d 01 71 31 20  |UW    &0A0D..q1 |
00002ce0  20 20 20 45 51 55 53 20  20 20 20 22 53 57 49 20  |   EQUS    "SWI |
00002cf0  63 68 75 6e 6b 20 3d 20  26 22 2b c3 7e 28 53 77  |chunk = &"+.~(Sw|
00002d00  69 43 68 75 6e 6b 25 3e  3e 3e 36 29 0d 01 72 15  |iChunk%>>>6)..r.|
00002d10  20 20 20 20 45 51 55 57  20 20 20 20 26 30 41 30  |    EQUW    &0A0|
00002d20  44 0d 01 73 5a 20 20 20  20 45 51 55 53 20 20 20  |D..sZ    EQUS   |
00002d30  20 22 43 6f 6e 66 69 67  75 72 61 74 69 6f 6e 20  | "Configuration |
00002d40  73 74 6f 72 65 64 20 61  74 20 43 4d 4f 53 20 52  |stored at CMOS R|
00002d50  41 4d 20 6c 6f 63 61 74  69 6f 6e 20 22 2b c3 43  |AM location "+.C|
00002d60  4d 4f 53 6c 6f 63 25 2b  22 2c 20 62 69 74 20 22  |MOSloc%+", bit "|
00002d70  2b c3 28 62 69 74 29 2b  22 2e 22 0d 01 74 19 20  |+.(bit)+"."..t. |
00002d80  20 20 20 45 51 55 44 20  20 20 20 26 30 41 30 44  |   EQUD    &0A0D|
00002d90  30 41 30 44 0d 01 75 42  20 20 20 20 45 51 55 53  |0A0D..uB    EQUS|
00002da0  20 20 20 20 22 76 22 2b  76 65 72 73 69 6f 6e 24  |    "v"+version$|
00002db0  2b 22 20 a9 20 4d 69 63  68 61 65 6c 20 53 74 69  |+" . Michael Sti|
00002dc0  72 6c 69 6e 67 20 28 22  2b c1 91 24 2c 35 2c 31  |rling ("+..$,5,1|
00002dd0  31 29 2b 22 29 22 0d 01  76 15 20 20 20 20 45 51  |1)+")"..v.    EQ|
00002de0  55 57 20 20 20 20 26 30  41 30 44 0d 01 77 11 20  |UW    &0A0D..w. |
00002df0  20 20 20 45 51 55 42 20  20 20 20 30 0d 01 78 0d  |   EQUB    0..x.|
00002e00  20 20 20 20 41 4c 49 47  4e 0d 01 79 04 0d 01 7a  |    ALIGN..y...z|
00002e10  0f 2e 53 77 69 48 61 6e  64 6c 65 72 0d 01 7b 3a  |..SwiHandler..{:|
00002e20  20 20 20 20 4c 44 52 20  20 20 20 20 31 32 2c 5b  |    LDR     12,[|
00002e30  31 32 5d 20 20 20 20 20  20 20 20 20 20 20 20 20  |12]             |
00002e40  5c 47 65 74 20 77 6f 72  6b 73 70 61 63 65 20 70  |\Get workspace p|
00002e50  6f 69 6e 74 65 72 0d 01  7c 04 0d 01 7d 2c 20 20  |ointer..|...},  |
00002e60  20 20 43 4d 50 20 20 20  20 20 31 31 2c 23 28 45  |  CMP     11,#(E|
00002e70  6e 64 53 77 69 54 61 62  6c 65 2d 53 77 69 54 61  |ndSwiTable-SwiTa|
00002e80  62 6c 65 29 2f 34 0d 01  7e 39 20 20 20 20 41 44  |ble)/4..~9    AD|
00002e90  44 43 43 20 20 20 50 43  2c 50 43 2c 31 31 2c 4c  |DCC   PC,PC,11,L|
00002ea0  53 4c 23 32 20 20 20 20  20 20 5c 44 69 73 70 61  |SL#2      \Dispa|
00002eb0  74 63 68 20 69 66 20 69  6e 20 72 61 6e 67 65 0d  |tch if in range.|
00002ec0  01 7f 30 20 20 20 20 42  20 20 20 20 20 20 20 55  |..0    B       U|
00002ed0  6e 6b 6e 6f 77 6e 53 57  49 20 20 20 20 20 20 20  |nknownSWI       |
00002ee0  20 20 20 5c 55 6e 6b 6e  6f 77 6e 20 53 57 49 0d  |   \Unknown SWI.|
00002ef0  01 80 17 20 20 20 20 20  20 20 20 20 20 20 20 20  |...             |
00002f00  20 20 20 20 20 20 0d 01  81 0d 2e 53 77 69 54 61  |      .....SwiTa|
00002f10  62 6c 65 0d 01 82 32 20  20 20 20 42 20 20 20 20  |ble...2    B    |
00002f20  20 20 20 62 75 74 74 6f  6e 73 20 20 20 20 20 20  |   buttons      |
00002f30  20 20 20 20 20 20 20 5c  4a 75 6d 70 20 74 6f 20  |       \Jump to |
00002f40  53 57 49 20 30 0d 01 83  32 20 20 20 20 42 20 20  |SWI 0...2    B  |
00002f50  20 20 20 20 20 52 65 61  64 57 72 69 74 65 43 6d  |     ReadWriteCm|
00002f60  6f 73 20 20 20 20 20 20  20 5c 4a 75 6d 70 20 74  |os       \Jump t|
00002f70  6f 20 53 57 49 20 31 0d  01 84 04 0d 01 85 10 2e  |o SWI 1.........|
00002f80  45 6e 64 53 77 69 54 61  62 6c 65 0d 01 86 04 0d  |EndSwiTable.....|
00002f90  01 87 0f 2e 55 6e 6b 6e  6f 77 6e 53 57 49 0d 01  |....UnknownSWI..|
00002fa0  88 1c 20 20 20 20 41 44  52 20 20 20 20 20 30 2c  |..    ADR     0,|
00002fb0  52 61 6e 67 65 45 72 72  6f 72 0d 01 89 3f 20 20  |RangeError...?  |
00002fc0  20 20 84 52 53 20 20 20  20 50 43 2c 31 34 2c 23  |  .RS    PC,14,#|
00002fd0  31 3c 3c 32 38 20 20 20  20 20 20 20 20 5c 45 78  |1<<28        \Ex|
00002fe0  69 74 20 77 69 74 68 20  6f 76 65 72 66 6c 6f 77  |it with overflow|
00002ff0  20 66 6c 61 67 20 73 65  74 0d 01 8a 04 0d 01 8b  | flag set.......|
00003000  0f 2e 52 61 6e 67 65 45  72 72 6f 72 0d 01 8c 14  |..RangeError....|
00003010  20 20 20 20 45 51 55 44  20 20 20 20 26 31 45 36  |    EQUD    &1E6|
00003020  0d 01 8d 65 20 20 20 20  45 51 55 53 20 20 20 20  |...e    EQUS    |
00003030  22 4d 6f 64 75 6c 65 20  4d 69 67 68 74 79 4d 6f  |"Module MightyMo|
00003040  75 73 65 20 76 22 2b 76  65 72 73 69 6f 6e 24 2b  |use v"+version$+|
00003050  22 20 73 75 70 70 6f 72  74 73 20 6f 6e 6c 79 20  |" supports only |
00003060  74 77 6f 20 53 57 49 73  20 28 53 57 49 20 62 61  |two SWIs (SWI ba|
00003070  73 65 20 3d 20 26 22 2b  c3 7e 53 77 69 42 61 73  |se = &"+.~SwiBas|
00003080  65 2b 22 29 22 0d 01 8e  11 20 20 20 20 45 51 55  |e+")"....    EQU|
00003090  42 20 20 20 20 30 0d 01  8f 0d 20 20 20 20 41 4c  |B    0....    AL|
000030a0  49 47 4e 0d 01 90 04 0d  01 91 0d 2e 53 77 69 4e  |IGN.........SwiN|
000030b0  61 6d 65 73 0d 01 92 1a  20 20 20 20 45 51 55 53  |ames....    EQUS|
000030c0  20 20 20 20 53 77 69 48  65 61 64 65 72 24 0d 01  |    SwiHeader$..|
000030d0  93 11 20 20 20 20 45 51  55 42 20 20 20 20 30 0d  |..    EQUB    0.|
000030e0  01 94 04 0d 01 95 19 20  20 20 20 45 51 55 53 20  |.......    EQUS |
000030f0  20 20 20 22 42 75 74 74  6f 6e 73 22 0d 01 96 11  |   "Buttons"....|
00003100  20 20 20 20 45 51 55 42  20 20 20 20 30 0d 01 97  |    EQUB    0...|
00003110  04 0d 01 98 1c 20 20 20  20 45 51 55 53 20 20 20  |.....    EQUS   |
00003120  20 22 43 6d 6f 73 41 63  63 65 73 73 22 0d 01 99  | "CmosAccess"...|
00003130  11 20 20 20 20 45 51 55  42 20 20 20 20 30 0d 01  |.    EQUB    0..|
00003140  9a 04 0d 01 9b 2f 20 20  20 20 45 51 55 42 20 20  |...../    EQUB  |
00003150  20 20 30 20 20 20 20 20  20 20 20 20 20 20 20 20  |  0             |
00003160  20 20 20 20 20 20 5c 54  65 72 6d 69 6e 61 74 6f  |      \Terminato|
00003170  72 0d 01 9c 0d 20 20 20  20 41 4c 49 47 4e 0d 01  |r....    ALIGN..|
00003180  9d 04 0d 01 9e 0c 2e 62  75 74 74 6f 6e 73 0d 01  |.......buttons..|
00003190  9f 1c 20 20 20 20 53 54  4d 46 44 20 20 20 31 33  |..    STMFD   13|
000031a0  21 2c 7b 31 2d 39 2c 31  34 7d 0d 01 a0 30 20 20  |!,{1-9,14}...0  |
000031b0  20 20 54 45 51 50 20 20  20 20 50 43 2c 23 33 20  |  TEQP    PC,#3 |
000031c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 5c 43  |              \C|
000031d0  6c 65 61 72 20 66 6c 61  67 73 0d 01 a1 04 0d 01  |lear flags......|
000031e0  a2 24 5c 52 45 46 4c 45  43 54 20 50 52 45 56 49  |.$\REFLECT PREVI|
000031f0  4f 55 53 20 53 45 54 54  49 4e 47 53 20 49 4e 20  |OUS SETTINGS IN |
00003200  52 30 0d 01 a3 33 20 20  20 20 53 54 52 20 20 20  |R0...3    STR   |
00003210  20 20 30 2c 72 65 67 30  20 20 20 20 20 20 20 20  |  0,reg0        |
00003220  20 20 20 20 20 20 5c 50  72 65 73 65 72 76 65 20  |      \Preserve |
00003230  69 6e 70 75 74 0d 01 a4  39 20 20 20 20 53 54 52  |input...9    STR|
00003240  20 20 20 20 20 31 2c 72  65 67 31 20 20 20 20 20  |     1,reg1     |
00003250  20 20 20 20 20 20 20 20  20 5c 70 61 72 61 6d 65  |         \parame|
00003260  74 65 72 73 20 66 6f 72  20 6c 61 74 65 72 0d 01  |ters for later..|
00003270  a5 04 0d 01 a6 50 20 20  20 20 4d 4f 56 20 20 20  |.....P    MOV   |
00003280  20 20 30 2c 23 31 36 31  20 20 20 20 20 20 20 20  |  0,#161        |
00003290  20 20 20 20 20 20 5c 47  65 74 20 63 6f 6e 66 69  |      \Get confi|
000032a0  67 75 72 65 64 20 6e 6f  72 6d 61 6c 2f 73 77 61  |gured normal/swa|
000032b0  70 70 65 64 20 62 75 74  74 6f 6e 73 20 73 74 61  |pped buttons sta|
000032c0  74 65 0d 01 a7 1b 20 20  20 20 4d 4f 56 20 20 20  |te....    MOV   |
000032d0  20 20 31 2c 23 43 4d 4f  53 6c 6f 63 25 0d 01 a8  |  1,#CMOSloc%...|
000032e0  45 20 20 20 20 53 57 49  20 20 20 20 20 22 58 4f  |E    SWI     "XO|
000032f0  53 5f 42 79 74 65 22 20  20 20 20 20 20 20 20 20  |S_Byte"         |
00003300  20 5c 53 74 61 74 65 20  72 65 74 75 72 6e 65 64  | \State returned|
00003310  20 69 6e 20 52 32 20 61  74 20 43 4d 4f 53 62 69  | in R2 at CMOSbi|
00003320  74 25 0d 01 a9 04 0d 01  aa 3b 20 20 20 20 4c 44  |t%.......;    LD|
00003330  52 20 20 20 20 20 30 2c  72 65 67 30 20 20 20 20  |R     0,reg0    |
00003340  20 20 20 20 20 20 20 20  20 20 5c 47 65 74 20 69  |          \Get i|
00003350  6e 70 75 74 20 70 61 72  61 6d 65 74 65 72 20 52  |nput parameter R|
00003360  30 0d 01 ab 40 20 20 20  20 54 53 54 20 20 20 20  |0...@    TST    |
00003370  20 32 2c 23 43 4d 4f 53  62 69 74 25 20 20 20 20  | 2,#CMOSbit%    |
00003380  20 20 20 20 20 5c 43 6f  6e 66 69 67 75 72 65 64  |     \Configured|
00003390  20 62 75 74 74 6f 6e 73  20 73 77 61 70 70 65 64  | buttons swapped|
000033a0  3f 0d 01 ac 4f 20 20 20  20 84 52 4e 45 20 20 20  |?...O    .RNE   |
000033b0  30 2c 30 2c 23 25 31 30  20 20 20 20 20 20 20 20  |0,0,#%10        |
000033c0  20 20 20 20 5c 59 45 53  20 2d 20 73 65 74 20 20  |    \YES - set  |
000033d0  20 62 69 74 20 31 20 70  72 65 73 65 72 76 69 6e  | bit 1 preservin|
000033e0  67 20 61 6c 6c 20 6f 74  68 65 72 20 62 69 74 73  |g all other bits|
000033f0  0d 01 ad 50 20 20 20 20  42 49 43 45 51 20 20 20  |...P    BICEQ   |
00003400  30 2c 30 2c 23 25 31 30  20 20 20 20 20 20 20 20  |0,0,#%10        |
00003410  20 20 20 20 5c 4e 4f 20  20 2d 20 72 65 73 65 74  |    \NO  - reset|
00003420  20 62 69 74 20 31 20 70  72 65 73 65 72 76 69 6e  | bit 1 preservin|
00003430  67 20 61 6c 6c 20 6f 74  68 65 72 20 62 69 74 73  |g all other bits|
00003440  0d 01 ae 04 0d 01 af 4d  20 20 20 20 4c 44 52 20  |.......M    LDR |
00003450  20 20 20 20 32 2c 49 6e  74 65 72 63 65 70 74 46  |    2,InterceptF|
00003460  6c 61 67 20 20 20 20 20  5c 47 65 74 20 63 75 72  |lag     \Get cur|
00003470  72 65 6e 74 20 6e 6f 72  6d 61 6c 2f 73 77 61 70  |rent normal/swap|
00003480  70 65 64 20 62 75 74 74  6f 6e 73 20 73 74 61 74  |ped buttons stat|
00003490  65 0d 01 b0 35 20 20 20  20 54 53 54 20 20 20 20  |e...5    TST    |
000034a0  20 32 2c 23 25 30 31 20  20 20 20 20 20 20 20 20  | 2,#%01         |
000034b0  20 20 20 20 20 5c 42 75  74 74 6f 6e 73 20 73 77  |     \Buttons sw|
000034c0  61 70 70 65 64 3f 0d 01  b1 4f 20 20 20 20 84 52  |apped?...O    .R|
000034d0  4e 45 20 20 20 30 2c 30  2c 23 25 30 31 20 20 20  |NE   0,0,#%01   |
000034e0  20 20 20 20 20 20 20 20  20 5c 59 45 53 20 2d 20  |         \YES - |
000034f0  73 65 74 20 20 20 62 69  74 20 30 20 70 72 65 73  |set   bit 0 pres|
00003500  65 72 76 69 6e 67 20 61  6c 6c 20 6f 74 68 65 72  |erving all other|
00003510  20 62 69 74 73 0d 01 b2  50 20 20 20 20 42 49 43  | bits...P    BIC|
00003520  45 51 20 20 20 30 2c 30  2c 23 25 30 31 20 20 20  |EQ   0,0,#%01   |
00003530  20 20 20 20 20 20 20 20  20 5c 4e 4f 20 20 2d 20  |         \NO  - |
00003540  72 65 73 65 74 20 62 69  74 20 30 20 70 72 65 73  |reset bit 0 pres|
00003550  65 72 76 69 6e 67 20 61  6c 6c 20 6f 74 68 65 72  |erving all other|
00003560  20 62 69 74 73 0d 01 b3  04 0d 01 b4 55 20 20 20  | bits.......U   |
00003570  20 53 54 52 20 20 20 20  20 30 2c 72 65 67 30 6f  | STR     0,reg0o|
00003580  6c 64 20 20 20 20 20 20  20 20 20 20 20 5c 54 68  |ld           \Th|
00003590  69 73 20 76 61 6c 75 65  20 6f 66 20 52 30 20 74  |is value of R0 t|
000035a0  6f 20 62 65 20 72 65 74  75 72 6e 65 64 20 6f 6e  |o be returned on|
000035b0  20 65 78 69 74 20 66 72  6f 6d 20 53 57 49 0d 01  | exit from SWI..|
000035c0  b5 04 0d 01 b6 40 5c 83  e7 59 20 43 55 52 52 45  |.....@\..Y CURRE|
000035d0  4e 54 20 26 20 43 4f 4e  46 49 47 55 52 45 44 20  |NT & CONFIGURED |
000035e0  42 55 54 54 4f 4e 53 20  53 54 41 54 55 53 20 41  |BUTTONS STATUS A|
000035f0  53 20 50 45 52 20 e8 20  50 41 52 41 4d 45 54 45  |S PER . PARAMETE|
00003600  52 53 0d 01 b7 3e 20 20  20 20 4c 44 52 20 20 20  |RS...>    LDR   |
00003610  20 20 30 2c 72 65 67 30  20 20 20 20 20 20 20 20  |  0,reg0        |
00003620  20 20 20 20 20 20 5c 52  65 74 72 69 65 76 65 20  |      \Retrieve |
00003630  69 6e 70 75 74 20 70 61  72 61 6d 65 74 65 72 73  |input parameters|
00003640  0d 01 b8 31 20 20 20 20  4c 44 52 20 20 20 20 20  |...1    LDR     |
00003650  31 2c 72 65 67 31 20 20  20 20 20 20 20 20 20 20  |1,reg1          |
00003660  20 20 20 20 5c 66 72 6f  6d 20 65 61 72 6c 69 65  |    \from earlie|
00003670  72 0d 01 b9 04 0d 01 ba  42 20 20 20 20 54 53 54  |r.......B    TST|
00003680  20 20 20 20 20 31 2c 23  25 31 30 20 20 20 20 20  |     1,#%10     |
00003690  20 20 20 20 20 20 20 20  20 5c 49 73 20 52 31 20  |         \Is R1 |
000036a0  62 69 74 20 31 20 3d 20  31 3f 20 28 6d 61 73 6b  |bit 1 = 1? (mask|
000036b0  3d 77 72 69 74 65 29 0d  01 bb 39 20 20 20 20 42  |=write)...9    B|
000036c0  45 51 20 20 20 20 20 52  31 62 69 74 31 7a 65 72  |EQ     R1bit1zer|
000036d0  6f 20 20 20 20 20 20 20  20 20 20 5c 4e 4f 20 20  |o          \NO  |
000036e0  2d 20 63 68 65 63 6b 20  52 31 20 62 69 74 20 30  |- check R1 bit 0|
000036f0  0d 01 bc 04 0d 01 bd 3b  20 20 20 20 54 53 54 20  |.......;    TST |
00003700  20 20 20 20 30 2c 23 25  31 30 20 20 20 20 20 20  |    0,#%10      |
00003710  20 20 20 20 20 20 20 20  5c 59 45 53 20 2d 20 49  |        \YES - I|
00003720  73 20 52 30 20 62 69 74  20 31 20 3d 20 30 3f 0d  |s R0 bit 1 = 0?.|
00003730  01 be 34 20 20 20 20 ec  51 20 20 20 33 2c 23 30  |..4    .Q   3,#0|
00003740  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003750  5c 59 45 53 20 2d 20 43  4d 4f 53 20 52 41 4d 20  |\YES - CMOS RAM |
00003760  3d 20 30 0d 01 bf 37 20  20 20 20 4d 4f 56 4e 45  |= 0...7    MOVNE|
00003770  20 20 20 33 2c 23 43 4d  4f 53 62 69 74 25 20 20  |   3,#CMOSbit%  |
00003780  20 20 20 20 20 20 20 5c  4e 4f 20 20 2d 20 43 4d  |       \NO  - CM|
00003790  4f 53 20 52 41 4d 20 3d  20 31 0d 01 c0 04 0d 01  |OS RAM = 1......|
000037a0  c1 20 20 20 20 20 4d 4f  56 20 20 20 20 20 31 2c  |.     MOV     1,|
000037b0  23 43 4d 4f 53 6c 6f 63  25 20 20 20 20 20 0d 01  |#CMOSloc%     ..|
000037c0  c2 3f 20 20 20 20 4d 4f  56 20 20 20 20 20 34 2c  |.?    MOV     4,|
000037d0  23 43 4d 4f 53 62 69 74  25 20 20 20 20 20 20 20  |#CMOSbit%       |
000037e0  20 20 5c 47 65 74 20 6d  61 73 6b 20 66 6f 72 20  |  \Get mask for |
000037f0  52 65 61 64 57 72 69 74  65 43 6d 6f 73 0d 01 c3  |ReadWriteCmos...|
00003800  3c 20 20 20 20 42 4c 20  20 20 20 20 20 52 65 61  |<    BL      Rea|
00003810  64 57 72 69 74 65 43 6d  6f 73 20 20 20 20 20 20  |dWriteCmos      |
00003820  20 5c 57 72 69 74 65 20  76 61 6c 75 65 20 74 6f  | \Write value to|
00003830  20 43 4d 4f 53 20 52 41  4d 0d 01 c4 3f 20 20 20  | CMOS RAM...?   |
00003840  20 4c 44 52 20 20 20 20  20 30 2c 72 65 67 30 20  | LDR     0,reg0 |
00003850  20 20 20 20 20 20 20 20  20 20 20 20 20 5c 52 65  |             \Re|
00003860  74 72 69 65 76 65 20 69  6e 70 75 74 20 70 61 72  |trieve input par|
00003870  61 6d 65 74 65 72 73 20  0d 01 c5 41 20 20 20 20  |ameters ...A    |
00003880  4c 44 52 20 20 20 20 20  31 2c 72 65 67 31 20 20  |LDR     1,reg1  |
00003890  20 20 20 20 20 20 20 20  20 20 20 20 5c 6f 76 65  |            \ove|
000038a0  72 77 72 69 74 74 65 6e  20 62 79 20 52 65 61 64  |rwritten by Read|
000038b0  57 72 69 74 65 43 6d 6f  73 0d 01 c6 04 0d 01 c7  |WriteCmos.......|
000038c0  0f 2e 52 31 62 69 74 31  7a 65 72 6f 0d 01 c8 35  |..R1bit1zero...5|
000038d0  20 20 20 20 54 53 54 20  20 20 20 20 31 2c 23 25  |    TST     1,#%|
000038e0  30 31 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |01              |
000038f0  5c 49 73 20 52 31 20 62  69 74 20 30 20 3d 20 31  |\Is R1 bit 0 = 1|
00003900  3f 0d 01 c9 33 20 20 20  20 42 45 51 20 20 20 20  |?...3    BEQ    |
00003910  20 52 31 62 69 74 30 7a  65 72 6f 20 20 20 20 20  | R1bit0zero     |
00003920  20 20 20 20 20 5c 4e 4f  20 20 2d 20 65 78 69 74  |     \NO  - exit|
00003930  20 53 57 49 0d 01 ca 34  20 20 20 20 20 20 20 20  | SWI...4        |
00003940  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003950  20 20 20 20 20 20 20 20  5c 59 45 53 20 2d 20 64  |        \YES - d|
00003960  6f 20 62 65 6c 6f 77 20  0d 01 cb 3f 20 20 20 20  |o below ...?    |
00003970  4c 44 52 20 20 20 20 20  31 2c 49 6e 74 65 72 63  |LDR     1,Interc|
00003980  65 70 74 46 6c 61 67 20  20 20 20 20 5c 47 65 74  |eptFlag     \Get|
00003990  20 63 75 72 72 65 6e 74  20 62 75 74 74 6f 6e 73  | current buttons|
000039a0  20 73 74 61 74 75 73 0d  01 cc 35 20 20 20 20 54  | status...5    T|
000039b0  53 54 20 20 20 20 20 30  2c 23 25 30 31 20 20 20  |ST     0,#%01   |
000039c0  20 20 20 20 20 20 20 20  20 20 20 5c 49 73 20 52  |           \Is R|
000039d0  30 20 62 69 74 20 30 20  3d 20 30 3f 0d 01 cd 3f  |0 bit 0 = 0?...?|
000039e0  20 20 20 20 42 4e 45 20  20 20 20 20 52 30 62 69  |    BNE     R0bi|
000039f0  74 30 6f 6e 65 20 20 20  20 20 20 20 20 20 20 20  |t0one           |
00003a00  5c 4e 4f 20 20 2d 20 63  6c 61 69 6d 20 20 20 6d  |\NO  - claim   m|
00003a10  6f 75 73 65 20 76 65 63  74 6f 72 0d 01 ce 3f 20  |ouse vector...? |
00003a20  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003a30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 5c  |               \|
00003a40  59 45 53 20 2d 20 72 65  6c 65 61 73 65 20 6d 6f  |YES - release mo|
00003a50  75 73 65 20 76 65 63 74  6f 72 0d 01 cf 04 0d 01  |use vector......|
00003a60  d0 52 20 20 20 20 54 53  54 20 20 20 20 20 31 2c  |.R    TST     1,|
00003a70  23 31 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |#1              |
00003a80  20 20 5c 49 73 20 76 65  63 74 6f 72 20 61 6c 72  |  \Is vector alr|
00003a90  65 61 64 79 20 72 65 6c  65 61 73 65 64 3f 20 28  |eady released? (|
00003aa0  49 6e 74 65 72 63 65 70  74 46 6c 61 67 3d 30 29  |InterceptFlag=0)|
00003ab0  0d 01 d1 41 20 20 20 20  42 4c 4e 45 20 20 20 20  |...A    BLNE    |
00003ac0  72 65 6c 65 61 73 65 20  20 20 20 20 20 20 20 20  |release         |
00003ad0  20 20 20 20 5c 4e 4f 20  20 2d 20 66 6c 61 67 3d  |    \NO  - flag=|
00003ae0  31 2c 20 72 65 6c 65 61  73 65 20 76 65 63 74 6f  |1, release vecto|
00003af0  72 0d 01 d2 04 0d 01 d3  5a 20 20 20 20 41 44 52  |r.......Z    ADR|
00003b00  56 53 20 20 20 30 2c 53  77 69 43 61 6e 74 52 65  |VS   0,SwiCantRe|
00003b10  6c 65 61 73 65 20 20 20  20 5c 41 62 6f 72 74 20  |lease    \Abort |
00003b20  77 69 74 68 20 65 72 72  6f 72 20 6d 65 73 73 61  |with error messa|
00003b30  67 65 20 69 66 20 76 65  63 74 6f 72 20 63 61 6e  |ge if vector can|
00003b40  6e 6f 74 20 62 65 20 72  65 6c 65 61 73 65 64 0d  |not be released.|
00003b50  01 d4 3c 20 20 20 20 4c  44 4d 56 53 46 44 20 31  |..<    LDMVSFD 1|
00003b60  33 21 2c 7b 31 2d 39 2c  31 34 7d 20 20 20 20 20  |3!,{1-9,14}     |
00003b70  20 20 20 5c 53 65 74 20  56 2c 20 77 68 69 6c 65  |   \Set V, while|
00003b80  20 70 72 65 73 65 72 76  69 6e 67 0d 01 d5 33 20  | preserving...3 |
00003b90  20 20 20 84 52 56 53 53  20 20 50 43 2c 31 34 2c  |   .RVSS  PC,14,|
00003ba0  23 31 3c 3c 32 38 20 20  20 20 20 20 20 20 5c 74  |#1<<28        \t|
00003bb0  68 65 20 6f 74 68 65 72  20 66 6c 61 67 73 0d 01  |he other flags..|
00003bc0  d6 04 0d 01 d7 33 20 20  20 20 42 20 20 20 20 20  |.....3    B     |
00003bd0  20 20 52 31 62 69 74 30  7a 65 72 6f 20 20 20 20  |  R1bit0zero    |
00003be0  20 20 20 20 20 20 5c 59  45 53 20 2d 20 65 78 69  |      \YES - exi|
00003bf0  74 20 53 57 49 0d 01 d8  04 0d 01 d9 0e 2e 52 30  |t SWI.........R0|
00003c00  62 69 74 30 6f 6e 65 0d  01 da 52 20 20 20 20 54  |bit0one...R    T|
00003c10  53 54 20 20 20 20 20 31  2c 23 31 20 20 20 20 20  |ST     1,#1     |
00003c20  20 20 20 20 20 20 20 20  20 20 20 5c 49 73 20 76  |           \Is v|
00003c30  65 63 74 6f 72 20 61 6c  72 65 61 64 79 20 63 6c  |ector already cl|
00003c40  61 69 6d 65 64 3f 20 20  28 49 6e 74 65 72 63 65  |aimed?  (Interce|
00003c50  70 74 46 6c 61 67 3d 31  29 0d 01 db 3f 20 20 20  |ptFlag=1)...?   |
00003c60  20 42 4c 45 51 20 20 20  20 63 6c 61 69 6d 20 20  | BLEQ    claim  |
00003c70  20 20 20 20 20 20 20 20  20 20 20 20 20 5c 4e 4f  |             \NO|
00003c80  20 20 2d 20 66 6c 61 67  3d 30 2c 20 63 6c 61 69  |  - flag=0, clai|
00003c90  6d 20 76 65 63 74 6f 72  0d 01 dc 33 20 20 20 20  |m vector...3    |
00003ca0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003cb0  20 20 20 20 20 20 20 20  20 20 20 20 5c 59 45 53  |            \YES|
00003cc0  20 2d 20 65 78 69 74 20  53 57 49 0d 01 dd 59 20  | - exit SWI...Y |
00003cd0  20 20 20 41 44 52 56 53  20 20 20 30 2c 53 77 69  |   ADRVS   0,Swi|
00003ce0  43 61 6e 74 43 6c 61 69  6d 20 20 20 20 20 20 5c  |CantClaim      \|
00003cf0  41 62 6f 72 74 20 77 69  74 68 20 65 72 72 6f 72  |Abort with error|
00003d00  20 6d 65 73 73 61 67 65  20 69 66 20 76 65 63 74  | message if vect|
00003d10  6f 72 20 63 61 6e 6e 6f  74 20 62 65 20 63 6c 61  |or cannot be cla|
00003d20  69 6d 65 64 0d 01 de 3c  20 20 20 20 4c 44 4d 56  |imed...<    LDMV|
00003d30  53 46 44 20 31 33 21 2c  7b 31 2d 39 2c 31 34 7d  |SFD 13!,{1-9,14}|
00003d40  20 20 20 20 20 20 20 20  5c 53 65 74 20 56 2c 20  |        \Set V, |
00003d50  77 68 69 6c 65 20 70 72  65 73 65 72 76 69 6e 67  |while preserving|
00003d60  0d 01 df 33 20 20 20 20  84 52 56 53 53 20 20 50  |...3    .RVSS  P|
00003d70  43 2c 31 34 2c 23 31 3c  3c 32 38 20 20 20 20 20  |C,14,#1<<28     |
00003d80  20 20 20 5c 74 68 65 20  6f 74 68 65 72 20 66 6c  |   \the other fl|
00003d90  61 67 73 0d 01 e0 04 0d  01 e1 0f 2e 52 31 62 69  |ags.........R1bi|
00003da0  74 30 7a 65 72 6f 0d 01  e2 19 20 20 20 20 4c 44  |t0zero....    LD|
00003db0  52 20 20 20 20 20 30 2c  72 65 67 30 6f 6c 64 0d  |R     0,reg0old.|
00003dc0  01 e3 4b 20 20 20 20 4c  44 4d 46 44 20 20 20 31  |..K    LDMFD   1|
00003dd0  33 21 2c 7b 31 2d 39 2c  50 43 7d 5e 20 20 20 20  |3!,{1-9,PC}^    |
00003de0  20 20 20 5c 52 65 74 75  72 6e 20 74 6f 20 53 57  |   \Return to SW|
00003df0  49 20 63 61 6c 6c 65 72  2c 20 70 72 65 73 65 72  |I caller, preser|
00003e00  76 69 6e 67 20 66 6c 61  67 73 0d 01 e4 04 0d 01  |ving flags......|
00003e10  e5 11 2e 53 77 69 43 61  6e 74 43 6c 61 69 6d 0d  |...SwiCantClaim.|
00003e20  01 e6 69 20 20 20 20 45  51 55 44 20 20 20 20 26  |..i    EQUD    &|
00003e30  31 41 30 20 20 20 20 20  20 20 20 20 20 20 20 20  |1A0             |
00003e40  20 20 20 5c 55 73 65 20  74 68 69 73 20 65 72 72  |   \Use this err|
00003e50  6f 72 20 6e 75 6d 62 65  72 20 61 73 20 6e 6f 20  |or number as no |
00003e60  27 55 73 65 72 27 20 65  72 72 6f 72 20 6e 75 6d  |'User' error num|
00003e70  62 65 72 73 20 68 61 76  65 20 62 65 65 6e 20 61  |bers have been a|
00003e80  6c 6c 6f 63 61 74 65 64  0d 01 e7 61 20 20 20 20  |llocated...a    |
00003e90  45 51 55 53 20 20 20 20  22 4d 69 67 68 74 79 4d  |EQUS    "MightyM|
00003ea0  6f 75 73 65 20 53 57 49  20 63 6f 75 6c 64 20 6e  |ouse SWI could n|
00003eb0  6f 74 20 63 6c 61 69 6d  20 6d 6f 75 73 65 20 76  |ot claim mouse v|
00003ec0  65 63 74 6f 72 2c 20 74  72 79 20 72 65 6c 6f 61  |ector, try reloa|
00003ed0  64 69 6e 67 20 4d 69 67  68 74 79 4d 6f 75 73 65  |ding MightyMouse|
00003ee0  20 6d 6f 64 75 6c 65 2e  22 0d 01 e8 11 20 20 20  | module."....   |
00003ef0  20 45 51 55 42 20 20 20  20 30 0d 01 e9 0d 20 20  | EQUB    0....  |
00003f00  20 20 41 4c 49 47 4e 0d  01 ea 04 0d 01 eb 13 2e  |  ALIGN.........|
00003f10  53 77 69 43 61 6e 74 52  65 6c 65 61 73 65 0d 01  |SwiCantRelease..|
00003f20  ec 69 20 20 20 20 45 51  55 44 20 20 20 20 26 31  |.i    EQUD    &1|
00003f30  41 31 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |A1              |
00003f40  20 20 5c 55 73 65 20 74  68 69 73 20 65 72 72 6f  |  \Use this erro|
00003f50  72 20 6e 75 6d 62 65 72  20 61 73 20 6e 6f 20 27  |r number as no '|
00003f60  55 73 65 72 27 20 65 72  72 6f 72 20 6e 75 6d 62  |User' error numb|
00003f70  65 72 73 20 68 61 76 65  20 62 65 65 6e 20 61 6c  |ers have been al|
00003f80  6c 6f 63 61 74 65 64 0d  01 ed 68 20 20 20 20 20  |located...h     |
00003f90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003fa0  20 20 20 20 20 20 20 20  20 20 20 5c 54 68 69 73  |           \This|
00003fb0  20 6e 75 6d 62 65 72 20  69 73 20 67 65 6e 65 72  | number is gener|
00003fc0  61 74 65 64 20 62 79 20  4f 53 5f 52 65 6c 65 61  |ated by OS_Relea|
00003fd0  73 65 2c 20 74 68 65 20  53 57 49 20 6d 6f 73 74  |se, the SWI most|
00003fe0  20 6c 69 6b 65 6c 79 20  74 6f 20 66 61 69 6c 0d  | likely to fail.|
00003ff0  01 ee 63 20 20 20 20 45  51 55 53 20 20 20 20 22  |..c    EQUS    "|
00004000  4d 69 67 68 74 79 4d 6f  75 73 65 20 53 57 49 20  |MightyMouse SWI |
00004010  63 6f 75 6c 64 20 6e 6f  74 20 72 65 6c 65 61 73  |could not releas|
00004020  65 20 6d 6f 75 73 65 20  76 65 63 74 6f 72 2e 20  |e mouse vector. |
00004030  54 72 79 20 72 65 6c 6f  61 64 69 6e 67 20 4d 69  |Try reloading Mi|
00004040  67 68 74 79 4d 6f 75 73  65 20 6d 6f 64 75 6c 65  |ghtyMouse module|
00004050  2e 22 0d 01 ef 11 20 20  20 20 45 51 55 42 20 20  |."....    EQUB  |
00004060  20 20 30 0d 01 f0 0d 20  20 20 20 41 4c 49 47 4e  |  0....    ALIGN|
00004070  0d 01 f1 04 0d 01 f2 0a  2e 63 6c 61 69 6d 0d 01  |.........claim..|
00004080  f3 1c 20 20 20 20 53 54  4d 46 44 20 20 20 31 33  |..    STMFD   13|
00004090  21 2c 7b 30 2d 32 2c 31  34 7d 0d 01 f4 16 20 20  |!,{0-2,14}....  |
000040a0  20 20 4d 4f 56 20 20 20  20 20 30 2c 23 26 31 41  |  MOV     0,#&1A|
000040b0  0d 01 f5 1b 20 20 20 20  41 44 52 20 20 20 20 20  |....    ADR     |
000040c0  31 2c 69 6e 74 65 72 63  65 70 74 0d 01 f6 14 20  |1,intercept.... |
000040d0  20 20 20 4d 4f 56 20 20  20 20 20 32 2c 23 30 0d  |   MOV     2,#0.|
000040e0  01 f7 1b 20 20 20 20 53  57 49 20 20 20 20 20 22  |...    SWI     "|
000040f0  58 4f 53 5f 43 6c 61 69  6d 22 0d 01 f8 53 20 20  |XOS_Claim"...S  |
00004100  20 20 4d 56 4e 56 43 20  20 20 30 2c 23 30 20 20  |  MVNVC   0,#0  |
00004110  20 20 20 20 20 20 20 20  20 20 20 20 20 20 5c 43  |              \C|
00004120  6c 61 69 6d 20 77 69 74  68 20 66 6c 61 67 3d 2d  |laim with flag=-|
00004130  31 20 69 66 20 4f 53 5f  43 6c 61 69 6d 20 77 61  |1 if OS_Claim wa|
00004140  73 20 73 75 63 63 65 73  73 66 75 6c 2c 0d 01 f9  |s successful,...|
00004150  38 20 20 20 20 4d 4f 56  56 53 20 20 20 30 2c 23  |8    MOVVS   0,#|
00004160  30 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |0               |
00004170  20 5c 65 6c 73 65 20 72  65 6c 65 61 73 65 20 77  | \else release w|
00004180  69 74 68 20 30 0d 01 fa  1d 20 20 20 20 53 54 52  |ith 0....    STR|
00004190  20 20 20 30 2c 49 6e 74  65 72 63 65 70 74 46 6c  |   0,InterceptFl|
000041a0  61 67 0d 01 fb 54 20 20  20 20 4c 44 4d 46 44 20  |ag...T    LDMFD |
000041b0  31 33 21 2c 7b 30 2d 32  2c 50 43 7d 20 20 20 20  |13!,{0-2,PC}    |
000041c0  20 20 20 20 20 20 5c 41  6c 6c 6f 77 20 56 20 66  |      \Allow V f|
000041d0  6c 61 67 20 74 6f 20 62  65 20 70 61 73 73 65 64  |lag to be passed|
000041e0  20 6f 6e 20 69 66 20 4f  53 5f 43 6c 61 69 6d 20  | on if OS_Claim |
000041f0  66 61 69 6c 65 64 0d 01  fc 04 0d 01 fd 0c 2e 72  |failed.........r|
00004200  65 6c 65 61 73 65 0d 01  fe 1c 20 20 20 20 53 54  |elease....    ST|
00004210  4d 46 44 20 20 20 31 33  21 2c 7b 30 2d 32 2c 31  |MFD   13!,{0-2,1|
00004220  34 7d 0d 01 ff 16 20 20  20 20 4d 4f 56 20 20 20  |4}....    MOV   |
00004230  20 20 30 2c 23 26 31 41  0d 02 00 1b 20 20 20 20  |  0,#&1A....    |
00004240  41 44 52 20 20 20 20 20  31 2c 69 6e 74 65 72 63  |ADR     1,interc|
00004250  65 70 74 0d 02 01 14 20  20 20 20 4d 4f 56 20 20  |ept....    MOV  |
00004260  20 20 20 32 2c 23 30 0d  02 02 1d 20 20 20 20 53  |   2,#0....    S|
00004270  57 49 20 20 20 20 20 22  58 4f 53 5f 52 65 6c 65  |WI     "XOS_Rele|
00004280  61 73 65 22 0d 02 03 56  20 20 20 20 4d 4f 56 56  |ase"...V    MOVV|
00004290  43 20 20 20 30 2c 23 30  20 20 20 20 20 20 20 20  |C   0,#0        |
000042a0  20 20 20 20 20 20 20 20  5c 52 65 6c 65 61 73 65  |        \Release|
000042b0  20 77 69 74 68 20 66 6c  61 67 3d 30 20 69 66 20  | with flag=0 if |
000042c0  4f 53 5f 52 65 6c 65 61  73 65 20 77 61 73 20 73  |OS_Release was s|
000042d0  75 63 63 65 73 73 66 75  6c 2c 0d 02 04 37 20 20  |uccessful,...7  |
000042e0  20 20 4d 56 4e 56 53 20  20 20 30 2c 23 30 20 20  |  MVNVS   0,#0  |
000042f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 5c 65  |              \e|
00004300  6c 73 65 20 63 6c 61 69  6d 20 77 69 74 68 20 2d  |lse claim with -|
00004310  31 0d 02 05 1f 20 20 20  20 53 54 52 56 43 20 20  |1....    STRVC  |
00004320  20 30 2c 49 6e 74 65 72  63 65 70 74 46 6c 61 67  | 0,InterceptFlag|
00004330  0d 02 06 56 20 20 20 20  4c 44 4d 46 44 20 20 20  |...V    LDMFD   |
00004340  31 33 21 2c 7b 30 2d 32  2c 50 43 7d 20 20 20 20  |13!,{0-2,PC}    |
00004350  20 20 20 20 5c 41 6c 6c  6f 77 20 56 20 66 6c 61  |    \Allow V fla|
00004360  67 20 74 6f 20 62 65 20  70 61 73 73 65 64 20 6f  |g to be passed o|
00004370  6e 20 69 66 20 4f 53 5f  52 65 6c 65 61 73 65 20  |n if OS_Release |
00004380  66 61 69 6c 65 64 0d 02  07 04 0d 02 08 0e 2e 69  |failed.........i|
00004390  6e 74 65 72 63 65 70 74  0d 02 09 20 20 20 20 20  |ntercept...     |
000043a0  53 54 4d 46 44 20 20 20  31 33 21 2c 7b 39 2c 31  |STMFD   13!,{9,1|
000043b0  30 2d 31 32 2c 31 34 7d  0d 02 0a 04 0d 02 0b 25  |0-12,14}.......%|
000043c0  5c d6 20 53 57 49 20 4f  53 5f 4d 4f 55 53 45 2c  |\. SWI OS_MOUSE,|
000043d0  20 83 e7 59 49 4e 47 20  f8 20 41 44 44 52 45 53  | ..YING . ADDRES|
000043e0  53 0d 02 0c 2a 5c 53 4f  20 54 48 41 54 20 4d 59  |S...*\SO THAT MY|
000043f0  20 52 4f 55 54 49 4e 45  20 49 53 20 45 58 45 43  | ROUTINE IS EXEC|
00004400  55 54 45 44 20 ee 20 45  58 49 54 0d 02 0d 18 20  |UTED . EXIT.... |
00004410  20 20 20 53 54 4d 46 44  20 20 20 31 33 21 2c 7b  |   STMFD   13!,{|
00004420  50 43 7d 0d 02 0e 18 20  20 20 20 41 44 44 20 20  |PC}....    ADD  |
00004430  20 20 20 31 32 2c 31 33  2c 23 38 0d 02 0f 36 20  |   12,13,#8...6 |
00004440  20 20 20 4c 44 4d 49 41  20 20 20 31 32 2c 7b 31  |   LDMIA   12,{1|
00004450  30 2d 31 32 2c 50 43 7d  20 20 20 20 20 20 20 5c  |0-12,PC}       \|
00004460  53 57 49 20 65 78 65 63  75 74 65 64 20 68 65 72  |SWI executed her|
00004470  65 0d 02 10 1b 20 20 20  20 4c 44 52 20 20 20 20  |e....    LDR    |
00004480  20 31 32 2c 5b 31 33 2c  23 31 32 5d 0d 02 11 04  | 12,[13,#12]....|
00004490  0d 02 12 1e 5c 4f 53 5f  4d 4f 55 53 45 20 50 4f  |....\OS_MOUSE PO|
000044a0  53 54 2d f2 45 53 53 45  44 20 48 45 52 45 0d 02  |ST-.ESSED HERE..|
000044b0  13 3e 20 20 20 20 54 53  54 20 20 20 20 20 20 20  |.>    TST       |
000044c0  32 2c 23 25 30 30 31 20  20 20 20 20 20 20 20 20  |2,#%001         |
000044d0  20 20 5c 4d 6f 76 65 20  52 32 20 62 69 74 20 30  |  \Move R2 bit 0|
000044e0  20 74 6f 20 52 39 20 62  69 74 20 32 0d 02 14 2a  | to R9 bit 2...*|
000044f0  20 20 20 20 84 52 4e 45  20 20 20 39 2c 32 2c 23  |    .RNE   9,2,#|
00004500  25 31 30 30 20 20 20 20  20 20 20 20 20 20 20 5c  |%100           \|
00004510  4d 6f 76 65 20 31 0d 02  15 2b 20 20 20 20 42 49  |Move 1...+    BI|
00004520  43 45 51 20 20 20 39 2c  32 2c 23 25 31 30 30 20  |CEQ   9,2,#%100 |
00004530  20 20 20 20 20 20 20 20  20 20 5c 4d 6f 76 65 20  |          \Move |
00004540  30 0d 02 16 04 0d 02 17  3e 20 20 20 20 54 53 54  |0.......>    TST|
00004550  20 20 20 20 20 20 20 32  2c 23 25 31 30 30 20 20  |       2,#%100  |
00004560  20 20 20 20 20 20 20 20  20 5c 4d 6f 76 65 20 52  |         \Move R|
00004570  39 20 62 69 74 20 32 20  74 6f 20 52 32 20 62 69  |9 bit 2 to R2 bi|
00004580  74 20 30 0d 02 18 2a 20  20 20 20 84 52 4e 45 20  |t 0...*    .RNE |
00004590  20 20 32 2c 39 2c 23 25  30 30 31 20 20 20 20 20  |  2,9,#%001     |
000045a0  20 20 20 20 20 20 5c 4d  6f 76 65 20 31 0d 02 19  |      \Move 1...|
000045b0  2b 20 20 20 20 42 49 43  45 51 20 20 20 32 2c 39  |+    BICEQ   2,9|
000045c0  2c 23 25 30 30 31 20 20  20 20 20 20 20 20 20 20  |,#%001          |
000045d0  20 5c 4d 6f 76 65 20 30  0d 02 1a 04 0d 02 1b 23  | \Move 0.......#|
000045e0  20 20 20 20 4c 44 4d 46  44 20 20 20 31 33 21 2c  |    LDMFD   13!,|
000045f0  7b 39 2c 31 30 2d 31 32  2c 31 34 2c 50 43 7d 0d  |{9,10-12,14,PC}.|
00004600  02 1c 04 0d 02 1d 46 2e  52 65 61 64 57 72 69 74  |......F.ReadWrit|
00004610  65 43 6d 6f 73 20 20 20  20 20 20 20 20 20 20 20  |eCmos           |
00004620  20 20 20 20 20 20 20 5c  52 65 61 64 57 72 69 74  |       \ReadWrit|
00004630  65 43 6d 6f 73 20 76 31  2e 30 30 20 2d 20 30 34  |eCmos v1.00 - 04|
00004640  20 4d 61 72 20 31 39 39  35 0d 02 1e 55 20 20 20  | Mar 1995...U   |
00004650  20 53 54 4d 46 44 20 20  20 31 33 21 2c 7b 31 2c  | STMFD   13!,{1,|
00004660  33 2c 34 2c 31 34 7d 20  20 20 20 20 20 5c 50 72  |3,4,14}      \Pr|
00004670  65 73 65 72 76 65 20 72  65 67 69 73 74 65 72 73  |eserve registers|
00004680  20 61 73 20 70 65 72 20  73 70 65 63 20 66 6f 72  | as per spec for|
00004690  20 52 65 61 64 57 72 69  74 65 43 6d 6f 73 0d 02  | ReadWriteCmos..|
000046a0  1f 04 0d 02 20 47 20 20  20 20 80 20 20 20 20 20  |.... G    .     |
000046b0  31 2c 31 2c 23 26 46 46  20 20 20 20 20 20 20 20  |1,1,#&FF        |
000046c0  20 20 20 20 5c 45 6e 73  75 72 65 20 61 6c 6c 20  |    \Ensure all |
000046d0  69 6e 70 75 74 20 64 61  74 61 20 69 73 20 38 20  |input data is 8 |
000046e0  62 69 74 73 20 77 69 64  65 0d 02 21 1d 20 20 20  |bits wide..!.   |
000046f0  20 80 20 20 20 20 20 33  2c 33 2c 23 26 46 46 20  | .     3,3,#&FF |
00004700  20 20 20 20 20 20 0d 02  22 16 20 20 20 20 80 20  |      ..".    . |
00004710  20 20 20 20 34 2c 34 2c  23 26 46 46 0d 02 23 04  |    4,4,#&FF..#.|
00004720  0d 02 24 45 20 20 20 20  4d 4f 56 20 20 20 20 20  |..$E    MOV     |
00004730  30 2c 23 31 36 31 20 20  20 20 20 20 20 20 20 20  |0,#161          |
00004740  20 20 20 20 5c 47 65 74  20 76 61 6c 75 65 20 66  |    \Get value f|
00004750  72 6f 6d 20 43 4d 4f 53  20 52 41 4d 20 6c 6f 63  |rom CMOS RAM loc|
00004760  61 74 69 6f 6e 0d 02 25  1a 20 20 20 20 53 57 49  |ation..%.    SWI|
00004770  20 20 20 20 20 22 58 4f  53 5f 42 79 74 65 22 0d  |     "XOS_Byte".|
00004780  02 26 04 0d 02 27 6f 20  20 20 20 53 54 4d 46 44  |.&...'o    STMFD|
00004790  20 20 20 31 33 21 2c 7b  32 7d 20 20 20 20 20 20  |   13!,{2}      |
000047a0  20 20 20 20 20 20 20 5c  54 6f 20 62 65 20 72 65  |       \To be re|
000047b0  6c 6f 61 64 65 64 20 69  6e 74 6f 20 52 30 20 61  |loaded into R0 a|
000047c0  74 20 74 68 65 20 65 6e  64 2e 20 52 30 20 3d 20  |t the end. R0 = |
000047d0  6f 6c 64 20 43 4d 4f 53  20 52 41 4d 20 63 6f 6e  |old CMOS RAM con|
000047e0  74 65 6e 74 73 20 61 73  20 70 65 72 20 73 70 65  |tents as per spe|
000047f0  63 2e 0d 02 28 04 0d 02  29 2f 20 20 20 20 43 4d  |c...(...)/    CM|
00004800  50 20 20 20 20 20 34 2c  23 30 20 20 20 20 20 20  |P     4,#0      |
00004810  20 20 20 20 20 20 20 20  20 20 5c 49 73 20 6d 61  |          \Is ma|
00004820  73 6b 3d 30 3f 0d 02 2a  3d 20 20 20 20 42 45 51  |sk=0?..*=    BEQ|
00004830  20 20 20 20 20 6e 57 72  69 74 65 43 4d 4f 53 20  |     nWriteCMOS |
00004840  20 20 20 20 20 20 20 20  20 5c 59 45 53 20 2d 20  |         \YES - |
00004850  61 6c 6c 20 64 6f 6e 65  2c 20 71 75 69 74 20 53  |all done, quit S|
00004860  57 49 0d 02 2b 4b 20 20  20 20 20 20 20 20 20 20  |WI..+K          |
00004870  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004880  20 20 20 20 20 20 5c 4e  4f 20 20 2d 20 70 72 6f  |      \NO  - pro|
00004890  63 65 73 73 20 61 6e 64  20 73 74 6f 72 65 20 6e  |cess and store n|
000048a0  65 77 20 43 4d 4f 53 20  76 61 6c 75 65 0d 02 2c  |ew CMOS value..,|
000048b0  1d 5c 50 45 52 46 4f 52  4d 20 f3 2f 57 52 49 54  |.\PERFORM ./WRIT|
000048c0  45 20 46 55 4e 43 54 49  4f 4e 0d 02 2d 46 20 20  |E FUNCTION..-F  |
000048d0  20 20 80 20 20 20 20 20  33 2c 34 2c 33 20 20 20  |  .     3,4,3   |
000048e0  20 20 20 20 20 20 20 20  20 20 20 20 5c 53 74 6f  |            \Sto|
000048f0  72 65 20 28 52 33 20 80  20 52 34 29 20 69 6e 20  |re (R3 . R4) in |
00004900  77 6f 72 6b 69 6e 67 20  72 65 67 69 73 74 65 72  |working register|
00004910  0d 02 2e 29 20 20 20 20  4d 56 4e 20 20 20 20 20  |...)    MVN     |
00004920  34 2c 34 20 20 20 20 20  20 20 20 20 20 20 20 20  |4,4             |
00004930  20 20 20 20 5c ac 20 52  33 0d 02 2f 36 20 20 20  |    \. R3../6   |
00004940  20 80 20 20 20 20 20 32  2c 32 2c 34 20 20 20 20  | .     2,2,4    |
00004950  20 20 20 20 20 20 20 20  20 20 20 5c 28 4f 6c 64  |           \(Old|
00004960  42 75 74 74 6f 6e 73 20  80 20 ac 20 52 34 29 0d  |Buttons . . R4).|
00004970  02 30 43 20 20 20 20 84  52 20 20 20 20 20 32 2c  |.0C    .R     2,|
00004980  32 2c 33 20 20 20 20 20  20 20 20 20 20 20 20 20  |2,3             |
00004990  20 20 5c 28 4f 6c 64 62  75 74 74 6f 6e 73 20 80  |  \(Oldbuttons .|
000049a0  20 ac 20 52 34 29 20 84  20 28 52 33 20 80 20 52  | . R4) . (R3 . R|
000049b0  34 29 0d 02 31 04 0d 02  32 3c 20 20 20 20 43 4d  |4)..1...2<    CM|
000049c0  50 20 20 20 20 20 30 2c  32 20 20 20 20 20 20 20  |P     0,2       |
000049d0  20 20 20 20 20 20 20 20  20 20 5c 49 73 20 6e 65  |          \Is ne|
000049e0  77 20 76 61 6c 75 65 3d  6f 6c 64 20 76 61 6c 75  |w value=old valu|
000049f0  65 3f 0d 02 33 5a 20 20  20 20 4d 4f 56 4e 45 20  |e?..3Z    MOVNE |
00004a00  20 20 30 2c 23 31 36 32  20 20 20 20 20 20 20 20  |  0,#162        |
00004a10  20 20 20 20 20 20 5c 59  45 53 20 2d 20 64 6f 20  |      \YES - do |
00004a20  6e 6f 74 20 77 72 69 74  65 20 74 6f 20 43 4d 4f  |not write to CMO|
00004a30  53 20 52 41 4d 20 28 69  6d 70 72 6f 76 65 73 20  |S RAM (improves |
00004a40  70 65 72 66 6f 72 6d 61  6e 63 65 29 0d 02 34 1b  |performance)..4.|
00004a50  20 20 20 20 4d 4f 56 4e  45 20 20 20 31 2c 23 43  |    MOVNE   1,#C|
00004a60  4d 4f 53 6c 6f 63 25 0d  02 35 1a 20 20 20 20 53  |MOSloc%..5.    S|
00004a70  57 49 4e 45 20 20 20 22  58 4f 53 5f 42 79 74 65  |WINE   "XOS_Byte|
00004a80  22 0d 02 36 04 0d 02 37  0f 2e 6e 57 72 69 74 65  |"..6...7..nWrite|
00004a90  43 4d 4f 53 0d 02 38 3f  20 20 20 20 4c 44 4d 46  |CMOS..8?    LDMF|
00004aa0  44 20 20 20 31 33 21 2c  7b 30 7d 20 20 20 20 20  |D   13!,{0}     |
00004ab0  20 20 20 20 20 20 20 20  5c 52 30 20 3d 20 6f 6c  |        \R0 = ol|
00004ac0  64 20 43 4d 4f 53 20 52  41 4d 20 63 6f 6e 74 65  |d CMOS RAM conte|
00004ad0  6e 74 73 0d 02 39 1f 20  20 20 20 4c 44 4d 46 44  |nts..9.    LDMFD|
00004ae0  20 20 20 31 33 21 2c 7b  31 2c 33 2c 34 2c 50 43  |   13!,{1,3,4,PC|
00004af0  7d 5e 0d 02 3a 04 0d 02  3b 1a 5c 57 4f 52 4b 49  |}^..:...;.\WORKI|
00004b00  4e 47 20 dc 20 53 54 4f  52 45 44 20 48 45 52 45  |NG . STORED HERE|
00004b10  0d 02 3c 46 2e 49 6e 74  65 72 63 65 70 74 46 6c  |..<F.InterceptFl|
00004b20  61 67 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |ag              |
00004b30  20 20 20 20 5c 30 3d 72  6f 75 74 69 6e 65 20 6e  |    \0=routine n|
00004b40  6f 74 20 65 6e 67 61 67  65 64 2c 20 2d 31 3d 65  |ot engaged, -1=e|
00004b50  6e 67 61 67 65 64 0d 02  3d 24 20 20 20 20 45 51  |ngaged..=$    EQ|
00004b60  55 44 20 20 20 20 30 20  20 20 20 20 20 20 20 20  |UD    0         |
00004b70  20 20 20 20 20 20 20 20  20 20 0d 02 3e 53 2e 61  |          ..>S.a|
00004b80  72 67 73 20 20 20 20 20  20 20 20 20 20 20 20 20  |rgs             |
00004b90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 5c 54  |              \T|
00004ba0  65 6d 70 6f 72 61 72 79  20 73 74 6f 72 65 20 66  |emporary store f|
00004bb0  6f 72 20 64 65 63 6f 64  65 64 20 61 72 67 75 6d  |or decoded argum|
00004bc0  65 6e 74 20 70 61 72 61  6d 65 74 65 72 0d 02 3f  |ent parameter..?|
00004bd0  11 20 20 20 20 45 51 55  44 20 20 20 20 30 0d 02  |.    EQUD    0..|
00004be0  40 0c 2e 72 65 67 30 6f  6c 64 0d 02 41 11 20 20  |@..reg0old..A.  |
00004bf0  20 20 45 51 55 44 20 20  20 20 30 0d 02 42 09 2e  |  EQUD    0..B..|
00004c00  72 65 67 30 0d 02 43 11  20 20 20 20 45 51 55 44  |reg0..C.    EQUD|
00004c10  20 20 20 20 30 0d 02 44  09 2e 72 65 67 31 0d 02  |    0..D..reg1..|
00004c20  45 11 20 20 20 20 45 51  55 44 20 20 20 20 30 0d  |E.    EQUD    0.|
00004c30  02 46 04 0d 02 47 22 45  51 55 53 20 22 20 4d 69  |.F...G"EQUS " Mi|
00004c40  67 68 74 79 4d 6f 75 73  65 20 76 22 2b 76 65 72  |ghtyMouse v"+ver|
00004c50  73 69 6f 6e 24 0d 02 48  71 2e 43 6f 64 65 45 6e  |sion$..Hq.CodeEn|
00004c60  64 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |d               |
00004c70  20 20 20 20 20 20 20 20  20 5c 44 6f 20 6e 6f 74  |         \Do not|
00004c80  20 70 75 74 20 61 6e 79  74 68 69 6e 67 20 65 6c  | put anything el|
00004c90  73 65 20 61 66 74 65 72  20 74 68 69 73 20 74 65  |se after this te|
00004ca0  72 6d 69 6e 61 74 6f 72  2c 20 62 65 63 61 75 73  |rminator, becaus|
00004cb0  65 20 69 74 20 77 69 6c  6c 20 6e 6f 74 20 62 65  |e it will not be|
00004cc0  20 73 61 76 65 64 0d 02  49 05 5d 0d 02 4a 05 ed  | saved..I.]..J..|
00004cd0  0d 02 4b 22 c8 99 20 22  4f 53 5f 4d 6f 64 75 6c  |..K".. "OS_Modul|
00004ce0  65 22 2c 31 31 2c 63 6f  64 65 2c 43 6f 64 65 45  |e",11,code,CodeE|
00004cf0  6e 64 0d 02 4c 21 f1 22  4d 6f 64 75 6c 65 20 74  |nd..L!."Module t|
00004d00  72 61 6e 73 66 65 72 72  65 64 20 74 6f 20 52 4d  |ransferred to RM|
00004d10  41 22 27 0d 02 4d 04 0d  02 4e 26 f1 22 4d 6f 64  |A"'..M...N&."Mod|
00004d20  75 6c 65 20 6e 61 6d 65  3a 20 20 20 20 20 20 20  |ule name:       |
00004d30  20 22 4d 6f 64 75 6c 65  4e 61 6d 65 24 0d 02 4f  | "ModuleName$..O|
00004d40  3a f1 22 4d 6f 64 75 6c  65 20 68 65 6c 70 20 73  |:."Module help s|
00004d50  74 72 69 6e 67 3a 20 22  3b 3a c8 99 20 22 4f 53  |tring: ";:.. "OS|
00004d60  5f 50 72 65 74 74 79 50  72 69 6e 74 22 2c 63 6f  |_PrettyPrint",co|
00004d70  64 65 2b 68 65 6c 70 0d  02 50 23 f1 27 22 4d 6f  |de+help..P#.'"Mo|
00004d80  64 75 6c 65 20 73 74 61  72 74 3a 20 20 20 20 20  |dule start:     |
00004d90  20 20 26 22 3b 7e 63 6f  64 65 0d 02 51 2a f1 22  |  &";~code..Q*."|
00004da0  4d 6f 64 75 6c 65 20 65  6e 64 3a 20 20 20 20 20  |Module end:     |
00004db0  20 20 20 20 26 22 3b 7e  63 6f 64 65 2b 43 6f 64  |    &";~code+Cod|
00004dc0  65 45 6e 64 0d 02 52 2b  f1 22 4d 6f 64 75 6c 65  |eEnd..R+."Module|
00004dd0  20 6c 65 6e 67 74 68 3a  20 20 20 20 20 20 22 3b  | length:      ";|
00004de0  43 6f 64 65 45 6e 64 22  20 62 79 74 65 73 22 0d  |CodeEnd" bytes".|
00004df0  02 53 20 e7 20 73 61 76  65 3d a3 20 f1 27 22 4d  |.S . save=. .'"M|
00004e00  6f 64 75 6c 65 20 73 61  76 65 20 4f 46 46 22 0d  |odule save OFF".|
00004e10  02 54 05 e1 0d 02 55 04  0d 02 56 0a dd f2 73 61  |.T....U...V...sa|
00004e20  76 65 0d 02 57 1d e7 20  73 61 76 65 20 80 20 28  |ve..W.. save . (|
00004e30  4f 70 74 4c 6f 20 80 20  25 31 30 30 29 20 8c 0d  |OptLo . %100) ..|
00004e40  02 58 2b 20 20 46 69 6c  65 4e 61 6d 65 24 3d 22  |.X+  FileName$="|
00004e50  52 41 4d 3a 3a 52 61 6d  44 69 73 63 30 2e 24 2e  |RAM::RamDisc0.$.|
00004e60  4d 69 74 79 4d 6f 75 73  65 22 0d 02 59 47 20 20  |MityMouse"..YG  |
00004e70  f1 27 22 50 72 65 73 73  20 61 20 6b 65 79 20 74  |.'"Press a key t|
00004e80  6f 20 73 61 76 65 20 6d  6f 64 75 6c 65 20 61 73  |o save module as|
00004e90  20 27 22 46 69 6c 65 4e  61 6d 65 24 22 27 20 45  | '"FileName$"' E|
00004ea0  73 63 61 70 65 20 74 6f  20 61 62 6f 72 74 2e 22  |scape to abort."|
00004eb0  3b 0d 02 5a 0b 20 20 6b  65 79 3d a5 0d 02 5b 07  |;..Z.  key=...[.|
00004ec0  20 20 f1 0d 02 5c 37 20  20 c8 99 20 22 4f 53 5f  |  ...\7  .. "OS_|
00004ed0  46 69 6c 65 22 2c 31 30  2c 46 69 6c 65 4e 61 6d  |File",10,FileNam|
00004ee0  65 24 2c 26 46 46 41 2c  2c 63 6f 64 65 2c 63 6f  |e$,&FFA,,code,co|
00004ef0  64 65 2b 43 6f 64 65 45  6e 64 0d 02 5d 0e 20 20  |de+CodeEnd..].  |
00004f00  f1 22 53 61 76 65 64 22  0d 02 5e 05 cd 0d 02 5f  |."Saved"..^...._|
00004f10  05 e1 0d ff                                       |....|
00004f14