Home » Archimedes archive » Acorn User » AU 1994-08.adf » !WimpTools_WimpTools » !WimpTools/WmpLb_Code

!WimpTools/WmpLb_Code

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 1994-08.adf » !WimpTools_WimpTools
Filename: !WimpTools/WmpLb_Code
Read OK:
File size: C0D3 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM >WmpLb_Code
   20REM (c) Matt Lewis
   30REM
   40REM
   50ON ERROR ERROR EXT ERL,REPORT$+" at line "+STR$ERL
   60:
   70MODE0
   80date$=MID$(TIME$,5,11)
   90SwiNumber=&47C80
  100ErrorBase=&809B00
  110blk=&400
  120DIM store% &2000
  130ws=12
  140sp=13
  150link=14
  160pc=15
  170:
  180tasks=0
  190activetasks=4
  200:
  210FOR pass%=4 TO 7 STEP 3
  220O%=store%
  230P%=0
  240[ OPT pass%
  250;
  260; ************************************************************************
  270; *                           MODULE HEADER CODE                         *
  280; ************************************************************************
  290;
  300.start
  310EQUD 0                          ;  start up code
  320EQUD initmod                    ;  initialisation code
  330EQUD finishmod                  ;  finalisation code
  340EQUD 0                          ;  service module code
  350EQUD title                      ;  module title string
  360EQUD helpst                     ;  module help string
  370EQUD 0                          ;  help and command table
  380EQUD SwiNumber                  ;  swi base number
  390EQUD swicode                    ;  swi handling code
  400EQUD switable                   ;  swi decoding table
  410EQUD 0                          ;  swi decoding code
  420;
  430; ************************************************************************
  440; *                           MODULE SUPPORT CODE                        *
  450; ************************************************************************
  460;
  470.title
  480EQUS "WimpTools"
  490EQUB 0
  500ALIGN
  510.helpst
  520EQUS "Wimp Tools"
  530EQUB 9
  540EQUS "1.43 ("+date$+") by Matt Lewis � Weird Sheep Software"
  550EQUB 0
  560ALIGN
  570ALIGN
  580;
  590.initmod                        ; set up module and claim
  600   STMFD (sp)!,{link}           ; module workspace
  610   MOV   r1,ws
  620   LDR   ws,[ws]
  630   CMP   ws,#0                  ; are we already active?
  640   LDMNEFD (sp)!,{pc}
  650   MOV   r0,#6
  660   MOV   r3,#&800               ; claim space of 2K
  670   SWI   "OS_Module"
  680   STR   r2,[r1]
  690   MOV   r0,#0
  700   STR   r0,[r2]                ; clear number of active tasks to 0
  710   STR   r0,[r2,#4]             ; clear active task flags
  720   LDMFD (sp)!,{pc}
  730;
  740.finishmod                      ; shut down module and relinquish
  750   STMFD (sp)!,{link}           ; module memory space
  760   TEQ   r10,#0
  770   LDMEQFD (sp)!,{pc}
  780   LDR   ws,[ws]
  790   LDR   r0,[ws]                ; check any tasks using this module
  800   TEQ   r0,#0                  ; if so relinquish their space
  810   BEQ   finishmod2
  820   LDR   r1,[ws,#4]
  830   MOV   r3,#1
  840   ADD   r4,ws,#32              ; data starts at block + 32
  850   MOV   r0,#7
  860.finishmod1
  870   TST   r1,r3                  ; is the bit set in the flag?
  880   BNE   finishmod1a
  890   ADD   r4,r4,#32              ; no - goto next block
  900   MOV   r3,r3,LSL#1
  910   TST   r3,#1<<31              ; is it bit 31 - illegal therefore no more
  920   BEQ   finishmod1
  930   B     finishmod2
  940.finishmod1a
  950   MOV   r5,#0                  ; blocks used
  960.finishmodloop
  970   LDR   r2,[r4,r5]
  980   TEQ   r2,#0
  990   SWINE "XOS_Module"           ; any allocated - if so release memory!
 1000   ADD   r5,r5,#4
 1010   TEQ   r5,#32
 1020   BNE   finishmodloop
 1030.finishmod2
 1040   MOV   r0,#7
 1050   MOV   r2,ws
 1060   SWI   "OS_Module"
 1070   LDMFD (sp)!,{pc}
 1080;
 1090; ************************************************************************
 1100; *                               SWI HANDLER                            *
 1110; ************************************************************************
 1120;
 1130.switable                       ; table of swi names recognised
 1140EQUS "WSWimpTools"              ; by this module
 1150EQUB 0
 1160EQUS "Version"
 1170EQUB 0
 1180EQUS "TaskIcon"
 1190EQUB 0
 1200EQUS "PopOpenWindow"
 1210EQUB 0
 1220EQUS "OpenPaneWindow"
 1230EQUB 0
 1240EQUS "PopOpenPaneWindow"
 1250EQUB 0
 1260EQUS "CloseWindow"
 1270EQUB 0
 1280EQUS "ToggleIcon"
 1290EQUB 0
 1300EQUS "SetIconSelect"
 1310EQUB 0
 1320EQUS "GetIconSelectState"
 1330EQUB 0
 1340EQUS "SetIconEnable"
 1350EQUB 0
 1360EQUS "GetIconEnableState"
 1370EQUB 0
 1380EQUS "SetIconText"
 1390EQUB 0
 1400EQUS "GetIconText"
 1410EQUB 0
 1420EQUS "SetIconValidation"
 1430EQUB 0
 1440EQUS "GetIconValidation"
 1450EQUB 0
 1460EQUS "SetWindowTitle"
 1470EQUB 0
 1480EQUS "GetWindowTitle"
 1490EQUB 0
 1500EQUS "UpdateWindow"
 1510EQUB 0
 1520EQUS "MakeMenuHeader"
 1530EQUB 0
 1540EQUS "MakeMenuItem"
 1550EQUB 0
 1560EQUS "SetMenuItemText"
 1570EQUB 0
 1580EQUS "GetMenuItemText"
 1590EQUB 0
 1600EQUS "MakeMenuItemLast"
 1610EQUB 0
 1620EQUS "SetMenuItemTick"
 1630EQUB 0
 1640EQUS "GetMenuItemTick"
 1650EQUB 0
 1660EQUS "SetMenuItemMessage"
 1670EQUB 0
 1680EQUS "GetMenuItemMessage"
 1690EQUB 0
 1700EQUS "SetMenuItemEnable"
 1710EQUB 0
 1720EQUS "GetMenuItemEnable"
 1730EQUB 0
 1740EQUS "SetMenuItemOptions"
 1750EQUB 0
 1760EQUS "GetMenuItemOptions"
 1770EQUB 0
 1780EQUS "AttachSubMenu"
 1790EQUB 0
 1800EQUS "LoadMenus"
 1810EQUB 0
 1820EQUS "IconBarMenu"
 1830EQUB 0
 1840EQUS "MenuAdjust"
 1850EQUB 0
 1860EQUS "MakeMenu"
 1870EQUB 0
 1880EQUS "GetText"
 1890EQUB 0
 1900EQUS "StartDrag"
 1910EQUB 0
 1920EQUS "SendSave"
 1930EQUB 0
 1940EQUS "SendLoad"
 1950EQUB 0
 1960EQUS "SendSaveAck"
 1970EQUB 0
 1980EQUS "SendLoadAck"
 1990EQUB 0
 2000EQUS "LoadTemplates"
 2010EQUB 0
 2020EQUS "WindowConvertParameter"
 2030EQUB 0
 2040EQUS "GetTemplateInfo"
 2050EQUB 0
 2060EQUS "LoseTemplateFonts"
 2070EQUB 0
 2080EQUS "Register"
 2090EQUB 0
 2100EQUS "DeRegister"
 2110EQUB 0
 2120EQUS "LoadSprites"
 2130EQUB 0
 2140EQUS "GetLeaf"
 2150EQUB 0
 2160ALIGN
 2170EQUD 0
 2180;
 2190.swicode                        ; SWI start up code
 2200   STMFD (sp)!,{link}
 2210   STMFD (sp)!,{r8-r11}
 2220   LDR   ws,[ws]                ; load r12 with the workspace pointer
 2230   CMP   r11,#49                ; check offset number
 2240   BGT   dontknowswi            ; error if too big for this module
 2250   MOV   r9,r11,LSL#2           ; calculate offset for jump
 2260   ADD   r9,r9,pc               ; taking into account ARM
 2270   MOV   pc,r9                  ; pipelining by adjusting by 4 bytes
 2280;
 2290; the following is the
 2300; SWI jump table
 2310;
 2320   B     version
 2330   B     taskicon
 2340   B     popwind
 2350   B     openpanewindow
 2360   B     popopenpanewindow
 2370   B     closewind
 2380   B     toggleicon
 2390   B     setselect
 2400   B     geticonselect
 2410   B     seticonenable
 2420   B     geticonenable
 2430   B     seticontext
 2440   B     geticontext
 2450   B     seticonvalidation
 2460   B     geticonvalidation
 2470   B     setwindowtitle
 2480   B     getwindowtitle
 2490   B     updatewindow
 2500   B     menuheader
 2510   B     makemenuitem
 2520   B     setmenuitem
 2530   B     getmenuitem
 2540   B     setmenuitemlast
 2550   B     settick
 2560   B     gettick
 2570   B     setmessage
 2580   B     getmessage
 2590   B     setenable
 2600   B     getenable
 2610   B     setmenuoptions
 2620   B     getmenuoptions
 2630   B     attachsub
 2640   B     loadmenus
 2650   B     iconbarmenu
 2660   B     menuadjust
 2670   B     makemenu
 2680   B     gettext
 2690   B     startdrag
 2700   B     sendsave
 2710   B     sendload
 2720   B     sendsaveack
 2730   B     sendloadack
 2740   B     loadtemplates
 2750   B     windowconvert
 2760   B     gettemplateinfo
 2770   B     losetemplatefonts
 2780   B     register
 2790   B     deregister
 2800   B     loadsprites
 2810   B     swigetleaf
 2820;
 2830; ************************************************************************
 2840; *                           MAIN SWI CODING                            *
 2850; ************************************************************************
 2860;
 2870.exitswi                        ; restore registers and exit module
 2880   LDMFD (sp)!,{r8-r11}
 2890   LDMFD (sp)!,{pc}
 2900;
 2910.makeerror                      ; make error message
 2920   LDMFD (sp)!,{r8-r11}         ; r0 points to error message block
 2930   LDMFD (sp)!,{link}
 2940   ORR   link,link,#1<<28
 2950   MOVS  pc,link
 2960;
 2970.strnotindirected               ; error message
 2980   LDMFD (sp)!,{r1}
 2990.strnotindirected2
 3000   ADR   r0,notindstr
 3010   B     makeerror
 3020;
 3030.notindstr
 3040EQUD  ErrorBase+2
 3050EQUS  "Icon/Menu string is not indirected"
 3060EQUB  0
 3070ALIGN
 3080;
 3090.dontknowswi                    ; error message
 3100   ADR   r0,dontknowstr
 3110   B     makeerror
 3120;
 3130;
 3140.dontknowstr
 3150EQUD  ErrorBase+1
 3160EQUS  "WimpLib does not recognise that SWI"
 3170EQUB  0
 3180ALIGN
 3190;
 3200; r0 = 0 returns r0 = version number
 3210; r0 =-1 prints version
 3220;
 3230.version
 3240   CMP   r0,#0
 3250   MOVEQ r0,#142
 3260   BEQ   exitswi
 3270   SWI   "OS_WriteS"
 3280EQUS  "Wimp Library Version 1.42 ("+date$+")"
 3290EQUB 10
 3300EQUB 10
 3310EQUB 13
 3320EQUB  0
 3330ALIGN
 3340   B     exitswi
 3350;
 3360; this subroutine checks a register and if it points to the table of window
 3370; names and handles checks r0.  If r0 < &100 then it contains a window
 3380; number.  Otherwise it contains the address of a window string.  It
 3390; converts the string or number to the window handle using
 3400; Window Convert Parameter
 3410;
 3420; convertname1 - r1 carries the address of the handle block
 3430;
 3440.convertname1
 3450   STMFD (sp)!,{r1,r2,link}
 3460   MOV   r2,r0
 3470   CMP   r2,#&100
 3480   MOVLT r0,#2
 3490   MOVGE r0,#4
 3500   SWI   "XWSWimpTools_WindowConvertParameter"
 3510   LDMFD (sp)!,{r1,r2,pc}
 3520;
 3530; convertname3 - r3 carries the address of the handle block
 3540;
 3550.convertname3
 3560   STMFD (sp)!,{r1,r2,link}
 3570   MOV   r1,r3
 3580   MOV   r2,r0
 3590   CMP   r2,#&100
 3600   MOVLT r0,#2
 3610   MOVGE r0,#4
 3620   SWI   "XWSWimpTools_WindowConvertParameter"
 3630   LDMFD (sp)!,{r1,r2,pc}
 3640;
 3650;
 3660; convertname4 - r4 carries the address of the handle block
 3670;
 3680.convertname4
 3690   STMFD (sp)!,{r1,r2,link}
 3700   MOV   r1,r4
 3710   MOV   r2,r0
 3720   CMP   r2,#&100
 3730   MOVLT r0,#2
 3740   MOVGE r0,#4
 3750   SWI   "XWSWimpTools_WindowConvertParameter"
 3760   LDMFD (sp)!,{r1,r2,pc}
 3770;
 3780; r0 = window handle
 3790;
 3800.popwind
 3810   STMFD (sp)!,{r1}
 3820   TEQ   r1,#0
 3830   BLNE  convertname1
 3840   ADD   r1,ws,#blk
 3850   STR   r0,[r1]
 3860   SWI   "XWimp_GetWindowState"
 3870   SWIVC "XWimp_OpenWindow"
 3880   LDMFD (sp)!,{r1}
 3890   B     exitswi
 3900;
 3910; r1  = block returned by Poll 2
 3920; r2  = icon to fit pane to
 3930; r3  = window handle of pane window
 3940;
 3950.openpanewindow
 3960   TEQ   r4,#0
 3970   BEQ   openpanewindow1
 3980   STMFD (sp)!,{r0}
 3990   MOV   r0,r3
 4000   BL    convertname4
 4010   MOV   r3,r0
 4020   LDMFD (sp)!,{r0}
 4030.openpanewindow1
 4040   LDR   r8,[r1]
 4050   LDR   r9,[r1,#20]
 4060   LDR   r10,[r1,#4]
 4070   SUB   r10,r10,r9
 4080   LDR   r9,[r1,#24]
 4090   LDR   r11,[r1,#16]
 4100   SUB   r11,r11,r9
 4110   MOV   r9,r1
 4120   ADD   r1,ws,#blk
 4130   ADD   r1,r1,#40
 4140   STR   r8,[r1]
 4150   STR   r2,[r1,#4]
 4160   SWI   "XWimp_GetIconState"
 4170   BVS   exitswi
 4180   STMFD (sp)!,{r4-r7}
 4190   LDR   r4,[r1,#8]
 4200   ADD   r4,r4,r10
 4210   LDR   r5,[r1,#12]
 4220   ADD   r5,r5,r11
 4230   LDR   r6,[r1,#16]
 4240   ADD   r6,r6,r10
 4250   LDR   r7,[r1,#20]
 4260   ADD   r7,r7,r11
 4270   STR   r3,[r1]
 4280   SWI   "XWimp_GetWindowState"
 4290   LDMVSFD   (sp)!,{r4-r7}
 4300   BVS   exitswi
 4310   STR   r4,[1,#4]
 4320   STR   r5,[r1,#8]
 4330   STR   r6,[r1,#12]
 4340   STR   r7,[r1,#16]
 4350   LDR   r8,[r9,#28]
 4360   STR   r8,[r1,#28]
 4370   LDMFD (sp)!,{r4-r7}
 4380   SWI   "XWimp_OpenWindow"
 4390   BVS   exitswi
 4400   MOV   r1,r9
 4410   STR   r3,[r1,#28]
 4420   SWI   "XWimp_OpenWindow"
 4430   B     exitswi
 4440;
 4450; As above but r0 = window handle
 4460;
 4470.popopenpanewindow
 4480   STMFD (sp)!,{r1}
 4490   ADD   r1,ws,#blk
 4500   TEQ   r4,#0
 4510   BLNE  convertname4
 4520   STR   r0,[r1]
 4530   SWI   "XWimp_GetWindowState"
 4540   LDMVSFD   (sp)!,{r1}
 4550   BVS   exitswi
 4560   MVN   r8,#0
 4570   STR   r8,[r1,#28]
 4580   SWI   "XWSWimpTools_OpenPaneWindow"
 4590   LDMFD (sp)!,{r1}
 4600   B     exitswi
 4610;
 4620; r0 = window handle
 4630;
 4640.closewind
 4650   STMFD (sp)!,{r1}
 4660   TEQ   r1,#0
 4670   BLNE  convertname1
 4680   ADD   r1,ws,#blk
 4690   STR   r0,[r1]
 4700   SWI   "XWimp_CloseWindow"
 4710   LDMFD (sp)!,{r1}
 4720   B     exitswi
 4730;
 4740; GETSTATE
 4750; --------
 4760; this routine sets up a block to get an icons state
 4770;
 4780.getstate
 4790   STMFD (sp)!,{r7,link}
 4800   MOV   r7,r1
 4810   ADD   r1,ws,#blk
 4820   STR   r0,[r1,#0]
 4830   STR   r7,[r1,#4]
 4840   LDMFD (sp)!,{r7,pc}
 4850;
 4860; r0 = window handle
 4870; r1 = icon handle
 4880; returns :
 4890; r0 = new icon state true or false (-1 or 0)
 4900;
 4910.toggleicon
 4920   STMFD (sp)!,{r1}
 4930   TEQ   r3,#0
 4940   BLNE  convertname3
 4950   BL    getstate
 4960   SWI   "XWimp_GetIconState"
 4970   BVS   toggleout
 4980   LDR   r9,[r1,#24]
 4990   AND   r9,r9,#1<<21
 5000   MOV   r11,#1<<21
 5010   EOR   r9,r9,r11
 5020   MOV   r10,r9
 5030   STR   r9,[r1,#8]
 5040   STR   r11,[r1,#12]
 5050   SWI   "XWimp_SetIconState"
 5060   BVS   toggleout
 5070   MVN   r0,#0
 5080   CMP   r10,#0
 5090   MOVEQ r0,#0
 5100.toggleout
 5110   LDMFD (sp)!,{r1}
 5120   B     exitswi
 5130;
 5140; r0 = window handle
 5150; r1 = icon handle
 5160; r2 = true or false to set or unset (-1 or 0)
 5170;
 5180.setselect
 5190   STMFD (sp)!,{r1}
 5200   TEQ   r3,#0
 5210   BLNE  convertname3
 5220   BL    getstate
 5230   SWI   "XWimp_GetIconState"
 5240   BVS   setselectout
 5250   AND   r9,r2,#1<<21
 5260   STR   r9,[r1,#8]
 5270   MOV   r9,#1<<21
 5280   STR   r9,[r1,#12]
 5290   SWI   "XWimp_SetIconState"
 5300.setselectout
 5310   LDMFD (sp)!,{r1}
 5320   B     exitswi
 5330;
 5340; r0 = window handle
 5350; r1 = icon handle
 5360; returns :
 5370; r2 = true or false to set or unset (-1 or 0)
 5380;
 5390.geticonselect
 5400   STMFD (sp)!,{r1}
 5410   TEQ   r3,#0
 5420   BLNE  convertname3
 5430   BL    getstate
 5440   SWI   "XWimp_GetIconState"
 5450   BVS   exitswi
 5460   LDR   r9,[r1,#24]
 5470   AND   r9,r9,#1<<21
 5480   MVN   r0,#0
 5490   CMP   r9,#0
 5500   MOVEQ r0,#0
 5510.getselectout
 5520   LDMFD (sp)!,{r1}
 5530   B     exitswi
 5540;
 5550; r0 = window handle
 5560; r1 = icon handle
 5570; r2 = true or false to set or unset (-1 or 0)
 5580;
 5590.seticonenable
 5600   STMFD (sp)!,{r1}
 5610   TEQ   r3,#0
 5620   BLNE  convertname3
 5630   BL    getstate
 5640   SWI   "XWimp_GetIconState"
 5650   BVS   enableout
 5660   AND   r9,r2,#1<<22
 5670   STR   r9,[r1,#8]
 5680   MOV   r9,#1<<22
 5690   STR   r9,[r1,#12]
 5700   SWI   "XWimp_SetIconState"
 5710.enableout
 5720   LDMFD (sp)!,{r1}
 5730   B     exitswi
 5740;
 5750; r0 = window handle
 5760; r1 = icon handle
 5770; returns
 5780; r2 = true or false to set or unset (-1 or 0)
 5790;
 5800.geticonenable
 5810   STMFD (sp)!,{r1}
 5820   TEQ   r3,#0
 5830   BLNE  convertname3
 5840   BL    getstate
 5850   SWI   "XWimp_GetIconState"
 5860   BVS   getenableout
 5870   LDR   r9,[r1,#24]
 5880   AND   r9,r9,#1<<22
 5890   MVN   r0,#0
 5900   CMP   r9,#0
 5910   MOVEQ r0,#0
 5920.getenableout
 5930   LDMFD (sp)!,{r1}
 5940   B     exitswi
 5950;
 5960; r0 = window handle
 5970; r1 = icon handle
 5980; r2 = string ending in a control character ie ASCII < 33
 5990;
 6000.seticontext
 6010   STMFD (sp)!,{r1}
 6020   TEQ   r3,#0
 6030   BLNE  convertname3
 6040   BL    getstate
 6050   SWI   "XWimp_GetIconState"
 6060   BVS   settextout
 6070   LDR   r9,[r1,#24]
 6080   TST   r9,#1<<8
 6090   BEQ   strnotindirected
 6100   MOV   r9,#0
 6110   STR   r9,[r1,#8]
 6120   STR   r9,[r1,#12]
 6130   MOV   r9,r2
 6140   LDR   r10,[r1,#28]
 6150   LDR   r11,[r1,#36]
 6160   BL    copystring
 6170   SWI   "XWimp_SetIconState"
 6180.settextout
 6190   LDMFD (sp)!,{r1}
 6200   B     exitswi
 6210;
 6220; r0 = window handle
 6230; r1 = icon handle
 6240; returns :
 6250; r0 = text string
 6260;
 6270.geticontext
 6280   STMFD (sp)!,{r1}
 6290   TEQ   r3,#0
 6300   BLNE  convertname3
 6310   BL    getstate
 6320   SWI   "XWimp_GetIconState"
 6330   BVS   gettextout
 6340   LDR   r9,[r1,#24]
 6350   TST   r9,#1<<8
 6360   ADDEQ r0,r1,#28
 6370   BEQ   gettextout
 6380   LDR   r0,[r1,#28]
 6390.gettextout
 6400   LDMFD (sp)!,{r1}
 6410   B     exitswi
 6420;
 6430; r0 = window handle
 6440; r1 = icon handle
 6450; r2 = string ending in a control character ie ASCII < 33
 6460;
 6470.seticonvalidation
 6480   STMFD (sp)!,{r1}
 6490   TEQ   r3,#0
 6500   BLNE  convertname3
 6510   BL    getstate
 6520   SWI   "XWimp_GetIconState"
 6530   BVS   setvalidout
 6540   LDR   r9,[r1,#24]
 6550   TST   r9,#1<<8
 6560   BEQ   strnotindirected
 6570   MOV   r9,0
 6580   STR   r9,[r1,#8]
 6590   STR   r9,[r1,#12]
 6600   MOV   r9,r2
 6610   LDR   r10,[r1,#32]
 6620   MOV   r11,#255
 6630   BL    copystring
 6640   SWI   "XWimp_SetIconState"
 6650.setvalidout
 6660   LDMFD (sp)!,{r1}
 6670   B     exitswi
 6680;
 6690; r0 = window handle
 6700; r1 = icon handle
 6710; returns :
 6720; r0 = text string
 6730;
 6740.geticonvalidation
 6750   STMFD (sp)!,{r1}
 6760   TEQ   r3,#0
 6770   BLNE  convertname3
 6780   BL    getstate
 6790   SWI   "XWimp_GetIconState"
 6800   BVS   getvalidout
 6810   LDR   r9,[r1,#24]
 6820   TST   r9,#1<<8
 6830   BEQ   strnotindirected
 6840   LDR   r0,[r1,#32]
 6850.getvalidout
 6860   LDMFD (sp)!,{r1}
 6870   B     exitswi
 6880;
 6890; r0 = window handle
 6900; r2 = text string
 6910;
 6920.setwindowtitle
 6930   STMFD (sp)!,{r1}
 6940   TEQ   r3,#0
 6950   BLNE  convertname3
 6960   ADD   r1,ws,#blk
 6970   STR   r0,[r1]
 6980   SWI   "XWimp_GetWindowInfo"
 6990   BVS   settitleout
 7000   LDR   r8,[r1,#60]
 7010   TST   r8,#1<<8
 7020   BEQ   wstrnotindirected
 7030   MOV   r9,r2
 7040   LDR   r10,[r1,#76]
 7050   LDR   r11,[r1,#84]
 7060   BL    copystring
 7070.settitleout
 7080   LDMFD (sp)!,{r1}
 7090   B     exitswi
 7100;
 7110.wstrnotindirected               ; error message
 7120   LDMFD (sp)!,{r1}
 7130   ADR   r0,wnotindstr
 7140   B     makeerror
 7150;
 7160.wnotindstr
 7170EQUD  ErrorBase+12
 7180EQUS  "Window title string is not indirected"
 7190EQUB  0
 7200ALIGN
 7210;
 7220; r0 = window handle
 7230;
 7240; returns
 7250;
 7260; r2 = text string
 7270;
 7280.getwindowtitle
 7290   STMFD (sp)!,{r1}
 7300   TEQ   r3,#0
 7310   BLNE  convertname3
 7320   ADD   r1,ws,#blk
 7330   STR   r0,[r1]
 7340   SWI   "XWimp_GetWindowInfo"
 7350   BVS   gettitleout
 7360   LDR   r8,[r1,#60]
 7370   TST   r8,#1<<8
 7380   ADDEQ r2,r1,#76
 7390   BEQ   gettitleout
 7400   LDR   r2,[r1,#76]
 7410.gettitleout
 7420   LDMFD (sp)!,{r1}
 7430   B     exitswi
 7440;
 7450; r0 = window handle
 7460;
 7470.updatewindow
 7480   STMFD (sp)!,{r1,r2,r3,r4}
 7490   TEQ   r1,#0
 7500   BLNE  convertname1
 7510   ADD   r1,ws,#blk
 7520   STR   r0,[r1]
 7530   SWI   "XWimp_GetWindowState"
 7540   BVS   updatewindow1
 7550   LDR   r0,[r1,#32]
 7560   TST   r0,#1<<16
 7570   BEQ   updatewindow1
 7580   SWI   "XWimp_GetWindowOutline"
 7590   LDR   r0,[r1,#4]
 7600   LDR   r2,[r1,#8]
 7610   LDR   r3,[r1,#12]
 7620   LDR   r4,[r1,#16]
 7630   MOV   r1,r0
 7640   MVN   r0,#0
 7650   SWIVC "XWimp_ForceRedraw"
 7660.updatewindow1
 7670   LDMFD (sp)!,{r1,r2,r3,r4}
 7680   B     exitswi
 7690;
 7700; r0 = menu block
 7710; r1 = menu string
 7720; r2 = width of menu in OS units
 7730; returns:
 7740; r0 = position in menu block for first menu item
 7750;
 7760.menuheader
 7770   MOV   r9,r1
 7780   MOV   r10,r0
 7790   MOV   r11,#11
 7800   BL    copystring
 7810   LDR   r9,(menudata)
 7820   STR   r9,[r0,#12]
 7830   STR   r2,[r0,#16]
 7840   MOV   r9,#44
 7850   STR   r9,[r0,#20]
 7860   MOV   r9,#0
 7870   STR   r9,[r0,#24]
 7880   ADD   r0,r0,#28
 7890   B     exitswi
 7900.menudata
 7910EQUD     &00070207
 7920;
 7930.makemenuitem
 7940   TEQ   r3,#0
 7950   BEQ   makemenuitem2
 7960   LDR   r8,(textdata)
 7970   TEQ   r4,#0
 7980   ORRNE r8,r8,#&F000
 7990   ORRNE r2,r2,#1<<2
 8000   STR   r2,[r0]
 8010   STR   r8,[r0,#8]
 8020   MOV   r9,r1
 8030   MOV   r10,r3
 8040   MOV   r11,#255
 8050   BL    copystring
 8060   STR   r3,[r0,#12]
 8070   TEQ   r4,#0
 8080   STREQ r11,[r0,#20]
 8090   STRNE r4,[r0,#20]
 8100   MVN   r8,#0
 8110   STR   r8,[r0,#16]
 8120   STR   r8,[r0,#4]
 8130   MOV   r3,r10
 8140   ADD   r0,r0,#24
 8150   B     exitswi
 8160.textdata
 8170EQUD     &07000121
 8180.textdata2
 8190EQUD     &07000021
 8200;
 8210; r0 = menu block
 8220; r1 = text string
 8230; r2 = options
 8240; returns:
 8250; r0 = position of next menu item ( for next make menu item call )
 8260;
 8270.makemenuitem2
 8280   STR   r2,[r0,#0]
 8290   MVN   r8,#0
 8300   STR   r8,[r0,#4]
 8310   LDR   r8,(textdata2)
 8320   STR   r8,[r0,#8]
 8330   ADD   r10,r0,#12
 8340   MOV   r9,r1
 8350   MOV   r11,#11
 8360   BL    copystring
 8370   ADD   r0,r0,#24
 8380   B     exitswi
 8390;
 8400; r0 = menu block
 8410; r1 = menu item number ( starting at 0 )
 8420; r2 = menu string
 8430;
 8440.setmenuitem
 8450   ADD   r8,r0,#28
 8460   ADD   r8,r8,r1,LSL#4
 8470   ADD   r8,r8,r1,LSL#3
 8480   LDR   r9,[r8,#8]
 8490   TST   r9,#1<<8
 8500   BEQ   strnotindirected2
 8510   LDR   r10,[r8,#12]
 8520   MOV   r9,r2
 8530   LDR   r11,[r8,#20]
 8540   BL    copystring
 8550   B     exitswi
 8560;
 8570; r0 = menu block
 8580; r1 = menu item number ( starting at 0 )
 8590; returns:
 8600; r0 = menu item text
 8610;
 8620.getmenuitem
 8630   ADD   r8,r0,#28
 8640   ADD   r8,r8,r1,LSL#4
 8650   ADD   r8,r8,r1,LSL#3
 8660   LDR   r0,[r8,#8]
 8670   TST   r0,#1<<8
 8680   ADDEQ r0,r8,#12
 8690   BEQ   exitswi
 8700   LDR   r0,[r8,#12]
 8710   B     exitswi
 8720;
 8730.setmenuitemlast
 8740   ADD   r8,r0,#28
 8750   ADD   r8,r8,r1,LSL#4
 8760   ADD   r8,r8,r1,LSL#3
 8770   LDR   r0,[r8,#0]
 8780   MVN   r10,#&80
 8790   AND   r2,r2,#&80
 8800   AND   r0,r0,r10
 8810   ORR   r0,r0,#&80
 8820   STR   r0,[r8,#0]
 8830   B     exitswi
 8840;
 8850.settick
 8860   ADD   r8,r0,#28
 8870   ADD   r8,r8,r1,LSL#4
 8880   ADD   r8,r8,r1,LSL#3
 8890   MVN   r9,#1
 8900   LDR   r0,[r8,#0]
 8910   AND   r0,r0,r9
 8920   AND   r2,r2,#1
 8930   ORR   r0,r0,r2
 8940   STR   r0,[r8,#0]
 8950   B     exitswi
 8960;
 8970.gettick
 8980   ADD   r8,r0,#28
 8990   ADD   r8,r8,r1,LSL#4
 9000   ADD   r8,r8,r1,LSL#3
 9010   LDR   r10,[r8,#0]
 9020   TST   r10,#1
 9030   MOV   r0,#0
 9040   MVNNE r0,#0
 9050   B     exitswi
 9060;
 9070.setmessage
 9080   ADD   r8,r0,#28
 9090   ADD   r8,r8,r1,LSL#4
 9100   ADD   r8,r8,r1,LSL#3
 9110   MVN   r9,#1<<3
 9120   LDR   r0,[r8,#0]
 9130   AND   r0,r0,r9
 9140   AND   r2,r2,#1<<3
 9150   ORR   r0,r0,r2
 9160   STR   r0,[r8,#0]
 9170   B     exitswi
 9180;
 9190.getmessage
 9200   ADD   r8,r0,#28
 9210   ADD   r8,r8,r1,LSL#4
 9220   ADD   r8,r8,r1,LSL#3
 9230   LDR   r10,[r8,#0]
 9240   TST   r10,#1<<3
 9250   MOV   r0,#0
 9260   MVNNE r0,#0
 9270   B     exitswi
 9280;
 9290.setenable
 9300   ADD   r8,r0,#28
 9310   ADD   r8,r8,r1,LSL#4
 9320   ADD   r8,r8,r1,LSL#3
 9330   MVN   r9,#1<<22
 9340   LDR   r0,[r8,#8]
 9350   AND   r0,r0,r9
 9360   AND   r2,r2,#1<<22
 9370   ORR   r0,r0,r2
 9380   STR   r0,[r8,#8]
 9390   B     exitswi
 9400;
 9410.getenable
 9420   ADD   r8,r0,#28
 9430   ADD   r8,r8,r1,LSL#4
 9440   ADD   r8,r8,r1,LSL#3
 9450   LDR   r10,[r8,#8]
 9460   TST   r10,#1<<22
 9470   MOV   r0,#0
 9480   MVNNE r0,#0
 9490   B     exitswi
 9500;
 9510.attachsub
 9520   TEQ   r3,#0
 9530   BEQ   attachsub1
 9540   STMFD (sp)!,{r0}
 9550   MOV   r0,r2
 9560   BL    convertname3
 9570   MOV   r2,r0
 9580   LDMFD (sp)!,{r0}
 9590.attachsub1
 9600   ADD   r8,r0,#28
 9610   ADD   r8,r8,r1,LSL#4
 9620   ADD   r8,r8,r1,LSL#3
 9630   STR   r2,[r8,#4]
 9640   B     exitswi
 9650;
 9660.loadmenus
 9670   B     notimplemented
 9680;
 9690.gettext
 9700   B     exitswi
 9710;
 9720.taskicon
 9730   STMFD (sp)!,{r1,r7}
 9740   MOV   r7,r1
 9750   ADD   r1,ws,#blk
 9760   STR   r0,[r1,#0]
 9770   MOV   r0,#0
 9780   STR   r0,[r1,#4]
 9790   STR   r0,[r1,#8]
 9800   MOV   r0,#68
 9810   STR   r0,[r1,#12]
 9820   STR   r0,[r1,#16]
 9830   ADR   r8,flagdata
 9840   LDR   r0,[r8,r7,LSL#2]
 9850   STR   r0,[r1,#20]
 9860   CMP   r7,#0                  ; is it a normal sprite?
 9870   BNE   taskicon1
 9880   ADD   r10,r1,#24
 9890   MOV   r9,r2
 9900   MOV   r11,#12
 9910   BL    copystring
 9920   B     taskicon0
 9930.taskicon1                      ; if not then r2 is a block with the
 9940   STR   r2,[r1,#24]            ; sprite name in it
 9950   MVN   r0,#0
 9960   STR   r0,[r1,#28]
 9970   MOV   r9,r2
 9980   BL    countchars             ; find the length of the string
 9990   STR   r11,[r1,#32]
10000   CMP   r7,#1
10010   BNE   taskicon0              ; check to see if it an
10020                                ; indirected sprite
10030   STR   r3,[r1,#28]            ; and point to spritepool
10040.taskicon0
10050   SWI   "XWimp_CreateIcon"
10060   LDMFD (sp)!,{r1,r7}
10070   B     exitswi
10080.flagdata
10090   EQUD  &7000301A
10100   EQUD  &7000311A
10110   EQUD  &7000313D
10120;
10130.setmenuoptions
10140   ADD   r7,r0,#28
10150   ADD   r7,r7,r1,LSL#4
10160   ADD   r7,r7,r1,LSL#3
10170   LDR   r0,[r7,#0]
10180   STR   r2,[r7,#0]
10190   B     exitswi
10200;
10210.getmenuoptions
10220   ADD   r7,r0,#28
10230   ADD   r7,r7,r1,LSL#4
10240   ADD   r7,r7,r1,LSL#3
10250   LDR   r0,[r7,#0]
10260   B     exitswi
10270;
10280.iconbarmenu
10290   STMFD (sp)!,{r1-r3}
10300   MOV   r8,r0
10310   ADD   r1,ws,#blk
10320   SWI   "XWimp_GetPointerInfo"
10330   BVS   iconbarout
10340   LDR   r2,[r1,#0]
10350   SUB   r2,r2,#64
10360   MOV   r3,#96
10370   ADD   r9,r8,#28
10380.barmenu1
10390   ADD   r3,r3,#44
10400   LDR   r10,[r9,#0]
10410   TST   r10,#1<<1
10420   ADDNE r3,r3,#24
10430   ADD   r9,r9,#24
10440   TST   r10,#1<<7
10450   BEQ   barmenu1
10460   MOV   r1,r8
10470   SWI   "XWimp_CreateMenu"
10480.iconbarout
10490   LDMFD (sp)!,{r1-r3}
10500   B     exitswi
10510;
10520.menuadjust
10530   STMFD (sp)!,{r1-r3}
10540   MOV   r8,r0
10550   ADD   r1,ws,#blk
10560   SWI   "XWimp_GetPointerInfo"
10570   BVS   menuadjout
10580   LDR   r9,[r1,#8]
10590   TST   r9,#1
10600   BEQ   menuadjout
10610   MOV   r1,r8
10620   MOV   r2,#0
10630   MOV   r3,#0
10640   SWI   "XWimp_CreateMenu"
10650.menuadjout
10660   LDMFD (sp)!,{r1-r3}
10670   B     exitswi
10680;
10690; the following routine reads the character before the menu entry in the
10700; string and decodes it as
10710;
10720; AND = ticked !
10730; - = dashed line follows
10740; > = generate messages for submenu
10750; OR = dimmed
10760; ? = writeable
10770;
10780.readmenuflag
10790   LDRB  r6,[r3,#0]
10800   TEQ   r6,#ASC"�"
10810   ORREQ r8,r8,#1<<0
10820   ADDEQ r3,r3,#1
10830   MOVEQ pc,link
10840   TEQ   r6,#ASC"-"
10850   ORREQ r8,r8,#1<<1
10860   ADDEQ r3,r3,#1
10870   MOVEQ pc,link
10880   TEQ   r6,#ASC"?"
10890   ORREQ r8,r8,#1<<2
10900   ADDEQ r3,r3,#1
10910   MOVEQ pc,link
10920   TEQ   r6,#ASC">"
10930   ORREQ r8,r8,#1<<3
10940   ADDEQ r3,r3,#1
10950   MOVEQ pc,link
10960   TEQ   r6,#ASC"�"
10970   ORREQ r7,r7,#1<<22
10980   ADDEQ r3,r3,#1
10990   MOV   pc,link
11000;
11010;  r0  = menu block
11020;  r1  = indirected text string block
11030;  r2  = menu string
11040;
11050;  returns
11060;  r0  = next location after menu block
11070;  r1  = next location in string block
11080;
11090.makemenu
11100   STMFD (sp)!,{r6,r7}
11110   MOV   r8,#0
11120   LDRB  r9,[r3,#0]
11130   TEQ   r9,#ASC"#"
11140   ADDEQ r3,r3,#1
11150   STRNE r8,[r0,#0]
11160   BNE   makemenu1
11170   MOV   r9,r3
11180   MOV   r10,#ASC(",")
11190   BL    countspecial
11200   TST   r11,#&100
11210   BNE   badmenustring
11220   CMP   r11,#11
11230   BGT   badmenutitle
11240   MOV   r9,r3
11250   MOV   r10,r0
11260   BL    copychars
11270   ADD   r3,r9,#1
11280.makemenu1
11290   LDR   r8,(menudata)
11300   STR   r8,[r0,#12]
11310   MOV   r8,#44
11320   STR   r8,[r0,#20]
11330   STR   r2,[r0,#16]
11340   MOV   r9,#0
11350   STR   r9,[r0,#24]
11360   ADD   r0,r0,#28
11370.makemenuloop
11380   MOV   r8,#0
11390   LDR   r7,(textdata2)
11400   BL    readmenuflag
11410   BL    readmenuflag
11420   BL    readmenuflag
11430   BL    readmenuflag
11440   BL    readmenuflag
11450   MVN   r9,#0
11460   STR   r9,[r0,#4]
11470   MOV   r9,r3
11480   MOV   r10,#ASC","
11490   BL    countspecial
11500   TST   r11,#&100
11510   ORRNE r8,r8,#1<<7
11520   ANDNE r11,r11,#&FF
11530   STR   r8,[r0]
11540   CMP   r11,#11
11550   BGT   makemenu2
11560   STR   r7,[r0,#8]
11570   MOV   r9,r3
11580   ADD   r10,r0,#12
11590   BL    copychars
11600   ADD   r3,r9,#1
11610   ADD   r0,r0,#24
11620   LDRB  r9,[r3,#-1]
11630   TEQ   r9,#ASC","
11640   BEQ   makemenuloop
11650   B     makemenuout
11660.makemenu2
11670   ORR   r7,r7,#&100
11680   STR   r7,[r0,#8]
11690   STR   r11,[r0,#20]
11700   STR   r1,[r0,#12]
11710   MVN   r9,#0
11720   STR   r9,[r0,#16]
11730   MOV   r9,r3
11740   MOV   r10,r1
11750   BL    copychars
11760   ADD   r3,r9,#1
11770   ADD   r1,r10,#1
11780   ADD   r0,r0,#24
11790   LDRB  r9,[r3,#-1]
11800   TEQ   r9,#ASC","
11810   BEQ   makemenuloop
11820.makemenuout
11830   LDMFD (sp)!,{r6,r7}
11840   B     exitswi
11850;
11860.badmenustring                 ; error message
11870   LDMFD (sp)!,{r6,r7}
11880   ADR   r0,bdmenustr
11890   B     makeerror
11900;
11910.bdmenustr
11920EQUD  ErrorBase+4
11930EQUS  "Incorrect menu desription string!"
11940EQUB  0
11950ALIGN
11960;
11970.badmenutitle                  ; error message
11980   LDMFD (sp)!,{r6,r7}
11990   ADR   r0,bdmenutle
12000   B     makeerror
12010;
12020.bdmenutle
12030EQUD  ErrorBase+5
12040EQUS  "Menu title too long!"
12050EQUB  0
12060ALIGN
12070;
12080;  r0  = window handle
12090;  r1  = icon number
12100;  r2  = sprite block
12110;
12120;  returns
12130;  r0  = drag type ; -1 = used DragASprite ; 0 = used Wimp_DragBox
12140;
12150.startdrag
12160   STMFD (sp)!,{r3-r7}
12170   TEQ   r3,#0
12180   BLNE  convertname3
12190   MOV   r8,r0
12200   MOV   r9,r1
12210   ADD   r1,ws,#blk
12220   STR   r8,[r1]
12230   SWI   "XWimp_GetWindowState"
12240   BVS   setupdragout
12250   LDR   r7,[r1,#20]
12260   LDR   r10,[r1,#4]
12270   SUB   r10,r10,r7
12280   LDR   r7,[r1,#24]
12290   LDR   r11,[r1,#16]
12300   SUB   r11,r11,r7
12310   STR   r9,[r1,#4]
12320   SWI   "XWimp_GetIconState"
12330   BVS   setupdragout
12340   MOV   r7,#5
12350   STR   r7,[r1,#4]
12360   LDR   r7,[r1,#8]
12370   ADD   r7,r10,r7
12380   STR   r7,[r1,#8]
12390   LDR   r7,[r1,#12]
12400   ADD   r7,r11,r7
12410   STR   r7,[r1,#12]
12420   LDR   r7,[r1,#16]
12430   ADD   r7,r10,r7
12440   STR   r7,[r1,#16]
12450   LDR   r7,[r1,#20]
12460   ADD   r7,r11,r7
12470   STR   r7,[r1,#20]
12480   MOV   r7,#0
12490   STR   r7,[r1,#24]
12500   STR   r7,[r1,#28]
12510   MVN   r7,#&80000000
12520   STR   r7,[r1,#32]
12530   STR   r7,[r1,#36]
12540   MOV   r7,r2
12550   ADR   r1,(dragasprite)
12560   SWI   "XOS_SWINumberFromString"
12570   BVS   wimpdrag
12580   MOV   r0,#161
12590   MOV   r1,#28
12600   SWI   "XOS_Byte"
12610   BVS   exitswi
12620   TST   r2,#1<<1
12630   BEQ   wimpdrag
12640   ADD   r1,ws,#(blk+48)
12650   STR   r8,[r1]
12660   STR   r9,[r1,#4]
12670   SWI   "XWimp_GetIconState"
12680   BVS   setupdragout
12690   LDR   r0,[r1,#24]
12700   TST   r0,#2
12710   BEQ   wimpdrag
12720   TST   r0,#1
12730   BNE   dragindirect
12740   TST   r0,#&100
12750.dragdirect
12760   LDRNE r2,[r1,#28]
12770   ADDEQ r2,r1,#28
12780   MOV   r1,r7
12790.dragsprite
12800   MOV   r0,#%11000101
12810   ADD   r3,ws,#blk
12820   ADD   r3,r3,#8
12830   ADD   r4,r3,#16
12840   SWI   "XDragASprite_Start"
12850   MVN   r0,#0
12860   B     setupdragout
12870.wimpdrag
12880   ADD   r1,ws,#blk
12890   SWI   "XWimp_DragBox"
12900   BVS   setupdragout
12910   MOV   r0,#0
12920   ADDS  r0,r0,r0
12930.setupdragout
12940   LDMFD (sp)!,{r3-r7}
12950   B     exitswi
12960.dragindirect
12970   TST   r0,#&100
12980   BEQ   dragdirect
12990   LDR   r0,[r1,#32]
13000   CMN   r0,#1
13010   LDREQ r2,[r1,#28]
13020   MOVEQ r1,r7
13030   BEQ   dragsprite
13040   LDR   r2,[r1,#32]
13050.dragindirect1
13060   LDRB  r0,[r2],#1
13070   CMP   r0,#32
13080   BLT   wimpdrag
13090   TEQ   r0,#ASC";"
13100   BEQ   dragindirect1
13110   ORR   r0,r0,#&20
13120   TEQ   r0,#ASC"s"
13130   MOVEQ r1,r7
13140   BEQ   dragsprite
13150.dragindirect2
13160   LDRB  r0,[r2],#1
13170   CMP   r0,#32
13180   BLT   wimpdrag
13190   TEQ   r0,#ASC";"
13200   BEQ   dragindirect1
13210   B     dragindirect2
13220;
13230.dragasprite
13240EQUS "DragASprite_Start"
13250EQUB 0
13260ALIGN
13270;
13280.sendsave
13290   STMFD (sp)!,{r0-r3}
13300   MOV   r9,r2
13310   SWI   "XWimp_GetPointerInfo"      ; get position of pointer
13320   BVS   startsaveout
13330   LDR   r8,[r1,#12]
13340   STR   r8,[r1,#20]                 ; r1!20 = destination window handle
13350   LDR   r8,[r1,#16]
13360   STR   r8,[r1,#24]                 ; r1!24 = destination icon handle
13370   LDR   r8,[r1]
13380   STR   r8,[r1,#28]                 ; r1!28 = pointer x position
13390   LDR   r8,[r1,#4]
13400   STR   r8,[r1,#32]                 ; r1!32 = pointer y position
13410   STR   r4,[r1,#36]                 ; r1!36 = r4 (size of data to save)
13420   MOV   r8,#0
13430   STR   r8,[r1,#12]                 ; set r1!12=0 originating message
13440   MOV   r8,#1
13450   STR   r8,[r1,#16]                 ; Message_DataSave (type 1)
13460   STR   r9,[r1,#40]                 ; r9 =value of r2, r1!40=r9 (file type)
13470   MOV   r9,r3
13480   ADD   r10,r1,#44                  ; r3 (file name of file to save)
13490   MOV   r11,#255
13500   BL    getleaf                     ; get file leaf name
13510   BL    copystring                  ; copy it!
13520   ADD   r8,r11,#47                  ; put size of block = 44 + name length
13530   LDR   r11,(maskto4)
13540   AND   r8,r8,r11
13550   STR   r8,[r1]
13560   MOV   r0,#18
13570   LDR   r2,[r1,#20]
13580   LDR   r3,[r1,#24]
13590   SWI   "XWimp_SendMessage"         ; send the message
13600.startsaveout
13610   LDMFD (sp)!,{r0-r3}
13620   B     exitswi
13630;
13640.maskto4
13650   EQUD  &FFFFFFFC
13660;
13670.sendload
13680   STMFD (sp)!,{r0-r3}
13690   MOV   r9,r0
13700   LDR   r0,[r1,#8]
13710   STR   r0,[r1,#12]                 ; put r1!12=r1!8
13720   MOV   r0,#3                       ; Message_DataLoad (type 3)
13730   STR   r0,[r1,#16]
13740   ADD   r10,r1,#44
13750   MOV   r11,#255
13760   BL    copystring
13770   ADD   r0,r11,#47
13780   LDR   r11,(maskto4)
13790   AND   r0,r0,r11
13800   STR   r0,[r1]
13810   MOV   r0,#18
13820   LDR   r2,[r1,#20]
13830   LDR   r3,[r1,#24]
13840   SWI   "XWimp_SendMessage"
13850   LDMFD (sp)!,{r0-r3}
13860   B     exitswi
13870;
13880.sendsaveack
13890   STMFD (sp)!,{r0,r2,r3}
13900   ADD   r10,r1,#44
13910   ADR   r9,(wimpscrap)
13920   MOV   r11,#14
13930   BL    copystring                  ; copy <Wimp$Scrap> to file name field
13940   LDR   r2,[r1,#4]
13950   LDR   r8,[r1,#8]                  ; put r1!12=r1!8
13960   STR   r8,[r1,#12]
13970   MOV   r8,#2
13980   STR   r8,[r1,#16]                 ; Message_DataSaveAck (type 2)
13990   MOV   r8,#60
14000   STR   r8,[r1]                     ; block length = 44+16
14010   MVN   r8,#0
14020   STR   r8,[r1,#36]                 ; data size =-1 (data not safe)
14030   MOV   r0,#17
14040   MOV   r3,#0
14050   SWI   "XWimp_SendMessage"         ; send the message
14060   LDMFD (sp)!,{r0,r2,r3}
14070   B     exitswi
14080.wimpscrap
14090   EQUS  "<Wimp$Scrap>"
14100   EQUB  0
14110   ALIGN
14120;
14130.sendloadack
14140   STMFD (sp)!,{r0-r3}
14150   LDR   r0,[r1,#8]
14160   STR   r0,[r1,#12]                 ; put r1!12=r1!8 (your ref)
14170   MOV   r0,#4                       ; Message_DataLoadAck (type 4)
14180   STR   r0,[r1,#16]
14190   ADD   r9,r1,#44
14200   BL    countchars
14210   ADD   r0,r11,#47
14220   LDR   r11,(maskto4)
14230   AND   r0,r0,r11
14240   STR   r0,[r1]
14250   MOV   r0,#17
14260   LDR   r2,[r1,#20]
14270   LDR   r3,[r1,#24]
14280   SWI   "XWimp_SendMessage"
14290   LDMFD (sp)!,{r0-r3}
14300   B     exitswi
14310;
14320.loadtemplates                       ; r1  = window transfer block
14330   STMFD (sp)!,{r4-r6}               ; r2  = indirect sprite data area
14340   MOV   r8,r4                       ; r3  = end of above
14350   TEQ   r6,#0                       ; r4  = data block to store window
14360   MOVNE r4,r6                       ;       names and handles
14370   MVNEQ r4,#1                       ; r5  = sprite block
14380   BEQ   loadtemplates0              ; r6  = font handle table
14390   MOV   r0,#0
14400   MOV   r7,#256
14410.loadtemplates0a
14420   STRB  r0,[r6],#1                  ; set font handle block to zero
14430   SUB   r7,r7,#1
14440   TEQ   r7,#0
14450   BNE   loadtemplates0a
14460.loadtemplates0
14470   MOV   r9,r5
14480   MOV   r6,#0
14490   MOV   r7,#0
14500.loadtemplates1
14510   ADD   r5,ws,#blk
14520   LDR   r0,(star)
14530   STR   r0,[r5]
14540   SWI   "XWimp_LoadTemplate"        ; r1 - r3 as above
14550   BVS   loadtemplateserr            ; r4 = font table or -1
14560   TEQ   r6,#0                       ; r5 = template name or "*"
14570   BEQ   loadtemplatesout            ; r6 = template number with that name
14580   ADD   r7,r7,#1
14590   STMFD (sp)!,{r9}
14600   ADD   r9,ws,#blk
14610   ADD   r10,r8,#4                   ; returns r5 = full name
14620   MOV   r11,#16                     ; r6 = next template or 0 if all read
14630   BL    copystring
14640   LDMFD (sp)!,{r9}
14650   STR   r9,[r1,#64]
14660   SWI   "XWimp_CreateWindow"
14670   BVS   loadtemplateserr
14680   STR   r0,[r8]
14690   ADD   r8,r8,#20
14700   B     loadtemplates1
14710.loadtemplatesout
14720   MVN   r0,#0
14730   STR   r0,[r8]
14740   MOV   r0,r7                      ; r0  = returns number of windows
14750   LDMFD (sp)!,{r4-r6}
14760   B     exitswi
14770.loadtemplateserr
14780   LDMFD (sp)!,{r4-r6}
14790   ADR   r0,templateerr
14800   B     makeerror
14810.templateerr
14820EQUD ErrorBase+63
14830EQUS "Error while loading templates!"
14840EQUB 0
14850ALIGN
14860.star
14870   EQUS  "*"
14880   EQUB  0
14890   ALIGN
14900;
14910; window handle block format
14920;
14930; 4  bytes  = window handle
14940; 16 bytes  = window name from template file
14950;
14960; block ends with -1
14970;
14980; r0        = 0   convert window handle to number ( 0 to n )
14990; r0        = 1   convert window handle to name
15000; r0        = 2   convert window number to handle
15010; r0        = 3   convert window number to name
15020; r0        = 4   convert window name   to handle
15030; r0        = 5   convert window name   to number
15040;
15050; r1        = handle block
15060; r2        = parameter
15070;
15080; returns
15090;
15100; r0        = result
15110;
15120.windowconvert
15130   CMP   r0,#5                  ; check offset number
15140   BGT   dontknowconvert        ; error if too big for this module
15150   MOV   r8,r0,LSL#2            ; calculate offset for jump
15160   ADD   r8,r8,pc               ; taking into account ARM
15170   MOV   pc,r8                  ; pipelining by adjusting by 4 bytes
15180;
15190;  branch table
15200;
15210   B     whandletonum
15220   B     whandletoname
15230   B     wnumbertohandle
15240   B     wnumbertoname
15250   B     wnametohandle
15260   B     wnametonumber
15270;
15280.whandletonum
15290   MOV   r8,#0
15300   MOV   r9,#0
15310.whandletonum1
15320   LDR   r10,[r1,r8]
15330   CMN   r10,#1
15340   BEQ   nosuchwindhand
15350   CMP   r10,r2
15360   ADDNE r8,r8,#20
15370   ADDNE r9,r9,#1
15380   BNE   whandletonum1
15390   MOV   r0,r9
15400   B     exitswi
15410;
15420.whandletoname
15430   CMN   r2,#1
15440   ADREQ r0,iconbarstr
15450   BEQ   exitswi
15460   CMN   r2,#2
15470   ADREQ r0,backdropstr
15480   MOV   r8,#0
15490.whandletoname1
15500   LDR   r10,[r1,r8]
15510   CMN   r10,#1
15520   BEQ   nosuchwindhand
15530   CMP   r10,r2
15540   ADDNE r8,r8,#20
15550   BNE   whandletoname1
15560   ADD   r0,r8,#4
15570   ADD   r0,r0,r1
15580   B     exitswi
15590;
15600.iconbarstr
15610   EQUS  "iconbar"
15620   EQUB  0
15630   ALIGN
15640;
15650.backdropstr
15660   EQUS  "backdrop"
15670   EQUB  0
15680   ALIGN
15690;
15700.wnumbertohandle
15710   MOV   r8,#0
15720   MOV   r9,#0
15730.wnumbertohandle1
15740   LDR   r10,[r1,r8]
15750   CMN   r10,#1
15760   BEQ   nosuchwindnum
15770   CMP   r9,r2
15780   ADDNE r8,r8,#20
15790   ADDNE r9,r9,#1
15800   BNE   wnumbertohandle1
15810   LDR   r0,[r1,r8]
15820   B     exitswi
15830;
15840.wnumbertoname
15850   CMN   r2,#1
15860   ADREQ r0,iconbarstr
15870   BEQ   exitswi
15880   CMN   r2,#2
15890   ADREQ r0,backdropstr
15900   MOV   r8,#0
15910   MOV   r9,#0
15920.wnumbertoname1
15930   LDR   r10,[r1,r8]
15940   CMN   r10,#1
15950   BEQ   nosuchwindnum
15960   CMP   r9,r2
15970   ADDNE r8,r8,#20
15980   ADDNE r9,r9,#1
15990   BNE   wnumbertoname1
16000   ADD   r0,r8,#4
16010   ADD   r0,r0,r1
16020   B     exitswi
16030;
16040.wnametohandle
16050   MOV   r8,r1
16060   MOV   r9,r2
16070.wnametohandle1
16080   ADD   r10,r8,#4
16090   BL    comparestr
16100   LDR   r0,[r8]
16110   CMN   r11,#1
16120   BEQ   exitswi
16130   CMN   r0,#1
16140   BEQ   nosuchwind
16150   ADD   r8,r8,#20
16160   B     wnametohandle1
16170;
16180.wnametonumber
16190   MOV   r8,r1
16200   MOV   r9,r2
16210   MOV   r2,#0
16220.wnametonumber1
16230   ADD   r10,r8,#4
16240   BL    comparestr
16250   CMN   r11,#1
16260   MOVEQ r0,r2
16270   MOVEQ r2,r9
16280   BEQ   exitswi
16290   LDR   r0,[r8]
16300   CMN   r0,#1
16310   BNE   nosuchwind
16320   ADD   r2,r2,#1
16330   ADD   r8,r8,#20
16340   B     wnametonumber1
16350;
16360.nosuchwindhand                 ; error message
16370   ADR   r0,nswhand
16380   B     makeerror
16390;
16400.nswhand
16410EQUD  ErrorBase+7
16420EQUS  "No such window handle!"
16430EQUB  0
16440ALIGN
16450;
16460.nosuchwindnum                  ; error message
16470   ADR   r0,nswnum
16480   B     makeerror
16490;
16500.nswnum
16510EQUD  ErrorBase+8
16520EQUS  "No such window number!"
16530EQUB  0
16540ALIGN
16550;
16560.nosuchwind                     ; error message
16570   ADR   r0,nsw
16580   B     makeerror
16590;
16600.nsw
16610EQUD  ErrorBase+9
16620EQUS  "No such window!"
16630EQUB  0
16640ALIGN
16650;
16660.dontknowconvert                ; error message
16670   ADR   r0,dntknwconv
16680   B     makeerror
16690;
16700.dntknwconv
16710EQUD  ErrorBase+6
16720EQUS  "Bad conversion routine number in R0!"
16730EQUB  0
16740ALIGN
16750;
16760; r1 = template font block
16770;
16780.losetemplatefonts
16790   STMFD (sp)!,{r2}
16800   MOV   r8,#1
16810.losefonts1
16820   LDRB  r2,[r1,r8]
16830   TEQ   r2,#0
16840   BEQ   losefonts2
16850.losefonts3
16860   SWI   "XFont_LoseFont"
16870   BVS   losefonts4
16880   SUB   r2,r2,#1
16890   CMP   r2,#0
16900   BGT   losefonts3
16910.losefonts2
16920   ADD   r8,r8,#1
16930   CMP   r8,#256
16940   BLT   losefonts1
16950.losefonts4
16960   LDMFD (sp)!,{r2}
16970   B     exitswi
16980;
16990; returns
17000; r0 = task id for wimptools
17010; r1 = task info block ( in RMA )
17020;
17030.register
17040   LDR   r8,[ws]                    ; number of tasks registered with module
17050   CMP   r8,#31
17060   BGE   toomanytasks
17070   ADD   r8,r8,#1
17080   STR   r8,[ws]                    ; increase by 1
17090   LDR   r8,[ws,#4]                 ; get flags - bit set for block being
17100   MOV   r9,#1                      ; used by that task
17110   MOV   r10,#32
17120   MOV   r0,#0
17130.register1
17140   TST   r8,r9
17150   BEQ   register2
17160   MOV   r9,r9,LSL#1
17170   ADD   r0,r0,#1
17180   TST   r9,#1<<31
17190   BNE   toomanytasks
17200   B     register1
17210.register2
17220   ORR   r8,r8,r9
17230   STR   r8,[ws,#4]
17240   MOV   r11,#0
17250   ADD   r10,ws,r0,LSL#5
17260   ADD   r10,r10,#32
17270   MOV   r1,r10
17280   STR   r11,[r10],#4               ; clear memory block
17290   STR   r11,[r10],#4
17300   STR   r11,[r10],#4
17310   STR   r11,[r10],#4
17320   STR   r11,[r10],#4
17330   STR   r11,[r10],#4
17340   STR   r11,[r10],#4
17350   STR   r11,[r10],#4
17360   B     exitswi
17370;
17380.toomanytasks
17390   ADR   r0,toomanytasksstr
17400   B     makeerror
17410;
17420.toomanytasksstr
17430EQUD  ErrorBase+13
17440EQUS  "Too many tasks!  This module can only register 31 tasks."
17450EQUB  0
17460ALIGN
17470;
17480; r0 = task id
17490;
17500.deregister
17510   MOV   r8,#1
17520   MOV   r9,r8,LSL r0
17530   LDR   r10,[ws,#4]
17540   TST   r10,r9             ; check task bit in flag word
17550   BEQ   badtaskid          ; if not set bad id
17560   MVN   r9,r9
17570   AND   r10,r10,r9
17580   STR   r10,[ws,#4]        ; clear bit in word
17590   LDR   r10,[ws]
17600   TEQ   r10,#0
17610   SUBNE r10,r10,#1         ; reduce active tasks by 1
17620   STR   r10,[ws]
17630   ADD   r8,ws,r0,LSL #5    ; get address of task block
17640   ADD   r8,r8,#32
17650   MOV   r9,#0
17660   MOV   r0,#7
17670.deregister1
17680   LDR   r2,[r8,r9]
17690   TEQ   r2,#0
17700   SWINE "XOS_Module"
17710   BVS   deregister2
17720   ADD   r9,r9,#4
17730   CMP   r9,#32
17740   BLT   deregister1
17750.deregister2
17760   B     exitswi
17770;
17780.badtaskid
17790   ADR   r0,badtaskidstr
17800   B     makeerror
17810;
17820.badtaskidstr
17830EQUD  ErrorBase+14
17840EQUS  "Bad task id!"
17850EQUB 0
17860ALIGN
17870;
17880; r0 = task id
17890; r1 = filename
17900; returns
17910; r1 = spriteblock
17920;
17930.loadsprites
17940   STMFD (sp)!,{r2-r4}
17950   MOV   r8,#1
17960   MOV   r9,r8,LSL r0
17970   LDR   r10,[ws,#4]
17980   TST   r10,r9
17990   LDMEQFD  (sp)!,{r2-r4}
18000   BEQ   badtaskid
18010   ADD   r8,ws,r0,LSL #5
18020   ADD   r8,r8,#32
18030   LDR   r0,[r8]
18040   TEQ   r0,#0
18050   LDMNEFD  (sp)!,{r2-r4}
18060   BNE   sptspaceused
18070   MOV   r0,#5
18080   SWI   "XOS_File"
18090   BVS   loadsprites1
18100   TEQ   r0,#0
18110   BEQ   nospritefile
18120   ADD   r4,r4,#16
18130   MOV   r3,r4
18140   MOV   r0,#6
18150   SWI   "XOS_Module"
18160   BVS   loadsprites1
18170   STR   r2,[r8]
18180   STR   r4,[r2]
18190   MOV   r0,#16
18200   STR   r0,[r2,#8]
18210   MOV   r9,r2
18220   MOV   r2,r1
18230   MOV   r1,r9
18240   MOV   r0,#9
18250   ADD   r0,r0,#&100
18260   SWI   "XOS_SpriteOp"
18270   BVS   loadsprites1
18280   MOV   r0,#10
18290   ADD   r0,r0,#&100
18300   SWI   "XOS_SpriteOp"
18310.loadsprites1
18320   LDMFD (sp)!,{r2-r4}
18330   B     exitswi
18340;
18350.nospritefile
18360   LDMFD (sp)!,{r2-r4}
18370   ADR   r0,nosptfilestr
18380   B     makeerror
18390.nosptfilestr
18400   EQUD  ErrorBase+14
18410   EQUS  "Sprite file not found!"
18420   EQUB  0
18430   ALIGN
18440;
18450.sptspaceused
18460   ADR   r0,sptspaceusedstr
18470   B     makeerror
18480.sptspaceusedstr
18490   EQUD  ErrorBase+15
18500   EQUS  "RMA has been already allocated for sprites for this module!"
18510   EQUB  0
18520   ALIGN
18530;
18540.gettemplateinfo
18550   B  notimplemented
18560;
18570.notimplemented
18580   ADR   r0,notimplementedstr
18590   B     makeerror
18600;
18610.notimplementedstr
18620EQUD  ErrorBase+10
18630EQUS  "SWI not implemented in this version of WimpTools.  Please contact Matt Lewis, Field House, Primrose Hill, Cowbridge, South Glam, CF7 7DU, for an updated version of this module."
18640EQUB 0
18650ALIGN
18660;
18670; **********************************************************************
18680; *    The following routines are string handling routines swi calls   *
18690; **********************************************************************
18700;
18710; r0 = full string
18720;
18730; returns
18740;
18750; r1 = leaf of string
18760;
18770.swigetleaf
18780   STMFD (sp)!,{r0}
18790   MOV   r8,r0
18800.swigetleaf1
18810   LDRB  r9,[r0],#1
18820   TEQ   r9,#ASC"."
18830   MOVEQ r8,r0
18840   CMP   r9,#&20
18850   BGT   swigetleaf1
18860   MOV   r1,r8
18870   LDMFD (sp)!,{r0}
18880   B     exitswi
18890;
18900; **********************************************************************
18910; *    The following routines are general string handling routines     *
18920; **********************************************************************
18930;
18940; COMPARESTR
18950; ----------
18960;
18970; This routine compares two strings are returns TRUE if equal or FALSE
18980; if not
18990;
19000; r9  = string 1
19010; r10 = string 2
19020;
19030; returns
19040;
19050; r11 = result
19060;
19070.comparestr
19080   STMFD (sp)!,{r0,r1,r2,r9,r10,link}
19090   MOV   r2,#32
19100.comparestr1
19110   LDRB  r0,[r9],#1
19120   LDRB  r1,[r10],#1
19130   CMP   r0,r2
19140   CMPLT r1,r2
19150   MVNLT r11,#0
19160   BLT   compareout
19170   CMP   r0,r1
19180   BEQ   comparestr1
19190   MOV   r11,#0
19200.compareout
19210   LDMFD (sp)!,{r0,r1,r2,r9,r10,pc}
19220;
19230; CHECKCHAR
19240; ---------
19250;
19260; This routine tests to see whether a certain character is contained
19270; within the string
19280;
19290; r9  = string
19300; r11 = character
19310;
19320; returns
19330; r11 = -1 if string contains character 0 if not
19340;
19350.checkchar
19360   STMFD (sp)!,{r0,r1,r9,link}
19370   MOV   r1,r11
19380   MVN   r11,#0
19390.checkchar1
19400   LDRB  r0,[r9],#1
19410   TEQ   r0,r1
19420   MOVEQ r11,#0
19430   CMP   r0,#32
19440   BGE   checkchar1
19450   LDMFD (sp)!,{r0,r1,r9,pc}
19460;
19470; GETLEAF
19480; -------
19490;
19500; This routine returns r9 pointing to the leaf of the string pointed to
19510; by r9
19520;
19530; r9  = string
19540;
19550; returns
19560; r9  = leaf of string
19570;
19580.getleaf
19590   STMFD (sp)!,{r0,r1,link}
19600   MOV   r1,r9                         ; store start of screen in r1
19610.getleaf1
19620   LDRB  r0,[r9],#1                    ; get a character and r9=r9+1
19630   TEQ   r0,#ASC"."                    ; is it a .
19640   MOVEQ r1,r9                         ; put r1=r9 (character after . )
19650   CMP   r0,#32                        ; end of string?
19660   BGE   getleaf1                      ; no  - get next character
19670   MOV   r9,r1                         ; yes - put r9=r1 <either start of
19680   LDMFD (sp)!,{r0,r1,pc}              ; string or start of leaf name>
19690;
19700; COUNTSPECIAL
19710; ------------
19720;
19730; Counts the characters in a string up to but not including the character
19740; in r10
19750;
19760; r9  = source string
19770; r10 = character to count to
19780; r11 = number of characters counted
19790;
19800.countspecial
19810   STMFD (sp)!,{r0,link}
19820   MOV   r11,#0
19830.counts1
19840   LDRB  r0,[r9],#1
19850   CMP   r0,#32
19860   ORRLT r11,r11,#&100
19870   BLT   countsout
19880   TEQ   r0,r10
19890   ADDNE r11,r11,#1
19900   BNE   counts1
19910.countsout
19920   LDMFD (sp)!,{r0,pc}
19930;
19940; COPYCHARS
19950; ---------
19960;
19970; Copies r11 characters from the string pointed to by r9 to the block
19980; pointed to by r10 ending the string with a NULL character (CHR$0)
19990;
20000; r9  = source string
20010; r10 = destination string
20020; r11 = number of characters to copy
20030;
20040.copychars
20050   STMFD (sp)!,{r0,link}
20060.copychar1
20070   LDRB  r0,[r9],#1
20080   STRB  r0,[r10],#1
20090   SUBS  r11,r11,#1
20100   BNE   copychar1
20110   STRB  r11,[r10,#0]
20120   LDMFD (sp)!,{r0,pc}
20130;
20140; COPYSTRING
20150; ----------
20160;
20170; Copies the string pointed to by r9 to the block pointed to by r10.  The
20180; maximum size of the string is held in r11.  If the string at r9 exceeds
20190; this then only r11 characters are copied.
20200;
20210; r9  = source string ending in a character value of < 32 ie control char
20220; r10 = destination block.  It ends string in a NULL (CHR$0) character
20230; r11 = maximum string length
20240;
20250; returns the following parameters
20260; r10 = byte after end of destination string
20270; r11 = length of string copied
20280;
20290.copystring
20300   STMFD (sp)!,{r0,r1,link}
20310   MOV   r0,#0
20320.copystr1
20330   LDRB  r1,[r9,r0]
20340   STRB  r1,[r10,r0]
20350   ADD   r0,r0,#1
20360   CMP   r0,r11
20370   BGE   copystr2
20380   CMP   r1,#32
20390   BGE   copystr1
20400.copystr2
20410   MOV   r1,#0
20420   STRB  r1,[r10,r0]
20430   ADD   r11,r0,#1
20440   ADD   r10,r10,r11
20450   LDMFD (sp)!,{r0,r1,pc}
20460;
20470; COUNTCHARS
20480; ----------
20490;
20500; The routine counts the number of characters in the string at R9.  It
20510; counts all characters up to but not including the first control character
20520; ie character < 32
20530;
20540; r9  = source string
20550;
20560; returns
20570; r11 = length of string
20580;
20590.countchars
20600   STMFD (sp)!,{r0,link}
20610   MOV   r11,#0
20620.count1
20630   LDRB  r0,[r9,r11]
20640   CMP   r0,#32
20650   BLT   count2
20660   ADD   r11,r11,#1
20670   CMP   r11,#255
20680   BLT   count1
20690   LDMFD (sp)!,{r0,link}
20700   ADR   r0,toolong
20710   ORR   link,link,#1<<28
20720   MOVS  pc,link
20730.count2
20740   LDMFD (sp)!,{r0,pc}
20750;
20760.toolong
20770EQUD ErrorBase+2
20780EQUS "Text string is too long for WimpLib"
20790EQUB 0
20800ALIGN
20810;
20820.toofar
20830   SWI   "OS_WriteS"
20840EQUS "Jump's gone too far!!!!!!!!!!!!!!!!!!!!"
20850EQUB 0
20860ALIGN
20870   LDMFD (sp)!,{pc}
20880;
20890]
20900NEXT pass%
20910OSCLI "Save WimpTools "+STR$~store%+" "+STR$~O%
20920*SETTYPE WimpTools module
20930END

� >WmpLb_Code
� (c) Matt Lewis
�
(�
2� � � � �,�$+" at line "+Þ
<:
F�0
Pdate$=��$,5,11)
ZSwiNumber=&47C80
dErrorBase=&809B00
nblk=&400
x� store% &2000
�	ws=12
�	sp=13
�link=14
�	pc=15
�:
�tasks=0
�activetasks=4
�:
�� pass%=4 � 7 � 3
�
O%=store%
�P%=0
�[ OPT pass%
�;
N; ************************************************************************
L; *                           �ULE HEADER CODE                         *
N; ************************************************************************
";
,
.start
64EQUD 0                          ;  start up code
@:EQUD initmod                    ;  initialisation code
J8EQUD finishmod                  ;  finalisation code
T:EQUD 0                          ;  service module code
^:EQUD title                      ;  module title string
h9EQUD helpst                     ;  module help string
r=EQUD 0                          ;  help and command table
|6EQUD SwiNumber                  ;  swi base number
�8EQUD swicode                    ;  swi handling code
�9EQUD switable                   ;  swi decoding table
�8EQUD 0                          ;  swi decoding code
�;
�N; ************************************************************************
�L; *                           �ULE SUPPORT CODE                        *
�N; ************************************************************************
�;
�
.title
�EQUS "WimpTools"
�
EQUB 0
�	ALIGN
�.helpst
EQUS "Wimp Tools"

EQUB 9
@EQUS "1.43 ("+date$+") by Matt Lewis � Weird Sheep Software"
&
EQUB 0
0	ALIGN
:	ALIGN
D;
N=.initmod                        ; set up module and claim
X6   STMFD (sp)!,{link}           ; module workspace
b   MOV   r1,ws
l   LDR   ws,[ws]
v<   CMP   ws,#0                  ; are we already active?
�   LDMNEFD (sp)!,{pc}
�   MOV   r0,#6
�7   MOV   r3,#&800               ; claim space of 2K
�   SWI   "OS_Module"
�   STR   r2,[r1]
�   MOV   r0,#0
�G   STR   r0,[r2]                ; clear number of active tasks to 0
�=   STR   r0,[r2,#4]             ; clear active task flags
�   LDMFD (sp)!,{pc}
�;
�E.finishmod                      ; shut down module and relinquish
�9   STMFD (sp)!,{link}           ; module memory space
�   TEQ   r10,#0
   LDMEQFD (sp)!,{pc}
   LDR   ws,[ws]
G   LDR   r0,[ws]                ; check any tasks using this module
 B   TEQ   r0,#0                  ; if so relinquish their space
*   BEQ   finishmod2
4   LDR   r1,[ws,#4]
>   MOV   r3,#1
H?   ADD   r4,ws,#32              ; data starts at block + 32
R   MOV   r0,#7
\.finishmod1
fA   TST   r1,r3                  ; is the bit set in the flag?
p   BNE   finishmod1a
z:   ADD   r4,r4,#32              ; no - goto next block
�   MOV   r3,r3,LSL#1
�N   TST   r3,#1<<31              ; is it bit 31 - illegal therefore no more
�   BEQ   finishmod1
�   B     finishmod2
�.finishmod1a
�1   MOV   r5,#0                  ; blocks used
�.finishmodloop
�   LDR   r2,[r4,r5]
�   TEQ   r2,#0
�K   SWINE "XOS_Module"           ; any allocated - if so release memory!
�   ADD   r5,r5,#4
�   TEQ   r5,#32
�   BNE   finishmodloop
.finishmod2
   MOV   r0,#7
   MOV   r2,ws
$   SWI   "OS_Module"
.   LDMFD (sp)!,{pc}
8;
BN; ************************************************************************
LN; *                               SWI HANDLER                            *
VN; ************************************************************************
`;
jC.switable                       ; table of swi names recognised
t4EQUS "WSWimpTools"              ; by this module
~
EQUB 0
�EQUS "Version"
�
EQUB 0
�EQUS "TaskIcon"
�
EQUB 0
�EQUS "PopOpenWindow"
�
EQUB 0
�EQUS "OpenPaneWindow"
�
EQUB 0
�EQUS "PopOpenPaneWindow"
�
EQUB 0
�EQUS "CloseWindow"
�
EQUB 0
EQUS "ToggleIcon"


EQUB 0
EQUS "SetIconSelect"

EQUB 0
(EQUS "GetIconSelectState"
2
EQUB 0
<EQUS "SetIconEnable"
F
EQUB 0
PEQUS "GetIconEnableState"
Z
EQUB 0
dEQUS "SetIconText"
n
EQUB 0
xEQUS "GetIconText"
�
EQUB 0
�EQUS "SetIconValidation"
�
EQUB 0
�EQUS "GetIconValidation"
�
EQUB 0
�EQUS "SetWindowTitle"
�
EQUB 0
�EQUS "GetWindowTitle"
�
EQUB 0
�EQUS "UpdateWindow"
�
EQUB 0
�EQUS "MakeMenuHeader"
�
EQUB 0
EQUS "MakeMenuItem"

EQUB 0
EQUS "SetMenuItemText"
"
EQUB 0
,EQUS "GetMenuItemText"
6
EQUB 0
@EQUS "MakeMenuItemLast"
J
EQUB 0
TEQUS "SetMenuItemTick"
^
EQUB 0
hEQUS "GetMenuItemTick"
r
EQUB 0
|EQUS "SetMenuItemMessage"
�
EQUB 0
�EQUS "GetMenuItemMessage"
�
EQUB 0
�EQUS "SetMenuItemEnable"
�
EQUB 0
�EQUS "GetMenuItemEnable"
�
EQUB 0
�EQUS "SetMenuItemOptions"
�
EQUB 0
�EQUS "GetMenuItemOptions"
�
EQUB 0
�EQUS "AttachSubMenu"
�
EQUB 0
EQUS "LoadMenus"

EQUB 0
EQUS "IconBarMenu"
&
EQUB 0
0EQUS "MenuAdjust"
:
EQUB 0
DEQUS "MakeMenu"
N
EQUB 0
XEQUS "GetText"
b
EQUB 0
lEQUS "StartDrag"
v
EQUB 0
�EQUS "SendSave"
�
EQUB 0
�EQUS "SendLoad"
�
EQUB 0
�EQUS "SendSaveAck"
�
EQUB 0
�EQUS "SendLoadAck"
�
EQUB 0
�EQUS "LoadTemplates"
�
EQUB 0
�!EQUS "WindowConvertParameter"
�
EQUB 0
�EQUS "GetTemplateInfo"

EQUB 0
EQUS "LoseTemplateFonts"

EQUB 0
 EQUS "Register"
*
EQUB 0
4EQUS "DeRegister"
>
EQUB 0
HEQUS "LoadSprites"
R
EQUB 0
\EQUS "GetLeaf"
f
EQUB 0
p	ALIGN
z
EQUD 0
�;
�7.swicode                        ; SWI start up code
�   STMFD (sp)!,{link}
�   STMFD (sp)!,{r8-r11}
�I   LDR   ws,[ws]                ; load r12 with the workspace pointer
�9   CMP   r11,#49                ; check offset number
�F   BGT   dontknowswi            ; error if too big for this module
�?   MOV   r9,r11,LSL#2           ; calculate offset for jump
�=   ADD   r9,r9,pc               ; taking into account ARM
�H   MOV   pc,r9                  ; pipelining by adjusting by 4 bytes
�;
�; the following is the
�; SWI jump table
	;
	   B     version
	   B     taskicon
	$   B     popwind
	.   B     openpanewindow
	8   B     popopenpanewindow
	B   B     closewind
	L   B     toggleicon
	V   B     setselect
	`   B     geticonselect
	j   B     seticonenable
	t   B     geticonenable
	~   B     seticontext
	�   B     geticontext
	�   B     seticonvalidation
	�   B     geticonvalidation
	�   B     setwindowtitle
	�   B     getwindowtitle
	�   B     updatewindow
	�   B     menuheader
	�   B     makemenuitem
	�   B     setmenuitem
	�   B     getmenuitem
	�   B     setmenuitemlast
	�   B     settick
   B     gettick

   B     setmessage
   B     getmessage
   B     setenable
(   B     getenable
2   B     setmenuoptions
<   B     getmenuoptions
F   B     attachsub
P   B     loadmenus
Z   B     iconbarmenu
d   B     menuadjust
n   B     makemenu
x   B     gettext
�   B     startdrag
�   B     sendsave
�   B     sendload
�   B     sendsaveack
�   B     sendloadack
�   B     loadtemplates
�   B     windowconvert
�   B     gettemplateinfo
�   B     losetemplatefonts
�   B     register
�   B     deregister
�   B     loadsprites
�   B     swigetleaf
;
N; ************************************************************************
N; *                           MAIN SWI CODING                            *
"N; ************************************************************************
,;
6G.exitswi                        ; restore registers and exit module
@   LDMFD (sp)!,{r8-r11}
J   LDMFD (sp)!,{pc}
T;
^8.makeerror                      ; make error message
hF   LDMFD (sp)!,{r8-r11}         ; r0 points to error message block
r   LDMFD (sp)!,{link}
|   �R   link,link,#1<<28
�   MOVS  pc,link
�;
�3.strnotindirected               ; error message
�   LDMFD (sp)!,{r1}
�.strnotindirected2
�   ADR   r0,notindstr
�   B     makeerror
�;
�.notindstr
�EQUD  ErrorBase+2
�.EQUS  "Icon/Menu string is not indirected"
�EQUB  0
�	ALIGN
;
3.dontknowswi                    ; error message
   ADR   r0,dontknowstr
&   B     makeerror
0;
:;
D.dontknowstr
NEQUD  ErrorBase+1
X/EQUS  "WimpLib does not recognise that SWI"
bEQUB  0
l	ALIGN
v;
�(; r0 = 0 returns r0 = version number
�; r0 =-1 prints version
�;
�.version
�   CMP   r0,#0
�   �Q r0,#142
�   BEQ   exitswi
�   SWI   "OS_WriteS"
�1EQUS  "Wimp Library Version 1.42 ("+date$+")"
�EQUB 10
�EQUB 10
�EQUB 13
�EQUB  0

	ALIGN

   B     exitswi

;

 O; this subroutine checks a register and if it points to the table of window

*J; names and handles checks r0.  If r0 < &100 then it contains a window

4H; number.  Otherwise it contains the address of a window string.  It

>>; converts the string or number to the window handle using

H; Window Convert Parameter

R;

\?; convertname1 - r1 carries the address of the handle block

f;

p.convertname1

z   STMFD (sp)!,{r1,r2,link}

�   MOV   r2,r0

�   CMP   r2,#&100

�   MOVLT r0,#2

�   MOVGE r0,#4

�2   SWI   "XWSWimpTools_WindowConvertParameter"

�   LDMFD (sp)!,{r1,r2,pc}

�;

�?; convertname3 - r3 carries the address of the handle block

�;

�.convertname3

�   STMFD (sp)!,{r1,r2,link}

�   MOV   r1,r3

�   MOV   r2,r0
   CMP   r2,#&100
   MOVLT r0,#2
   MOVGE r0,#4
$2   SWI   "XWSWimpTools_WindowConvertParameter"
.   LDMFD (sp)!,{r1,r2,pc}
8;
B;
L?; convertname4 - r4 carries the address of the handle block
V;
`.convertname4
j   STMFD (sp)!,{r1,r2,link}
t   MOV   r1,r4
~   MOV   r2,r0
�   CMP   r2,#&100
�   MOVLT r0,#2
�   MOVGE r0,#4
�2   SWI   "XWSWimpTools_WindowConvertParameter"
�   LDMFD (sp)!,{r1,r2,pc}
�;
�; r0 = window handle
�;
�.popwind
�   STMFD (sp)!,{r1}
�   TEQ   r1,#0
�   BLNE  convertname1
   ADD   r1,ws,#blk

   STR   r0,[r1]
#   SWI   "XWimp_GetWindowState"
   SWIVC "XWimp_OpenWindow"
(   LDMFD (sp)!,{r1}
2   B     exitswi
<;
F$; r1  = block returned by Poll 2
P; r2  = icon to fit pane to
Z(; r3  = window handle of pane window
d;
n.openpanewindow
x   TEQ   r4,#0
�   BEQ   openpanewindow1
�   STMFD (sp)!,{r0}
�   MOV   r0,r3
�   BL    convertname4
�   MOV   r3,r0
�   LDMFD (sp)!,{r0}
�.openpanewindow1
�   LDR   r8,[r1]
�   LDR   r9,[r1,#20]
�   LDR   r10,[r1,#4]
�   SUB   r10,r10,r9
�   LDR   r9,[r1,#24]
�   LDR   r11,[r1,#16]
   SUB   r11,r11,r9
   MOV   r9,r1
   ADD   r1,ws,#blk
"   ADD   r1,r1,#40
,   STR   r8,[r1]
6   STR   r2,[r1,#4]
@!   SWI   "XWimp_GetIconState"
J   BVS   exitswi
T   STMFD (sp)!,{r4-r7}
^   LDR   r4,[r1,#8]
h   ADD   r4,r4,r10
r   LDR   r5,[r1,#12]
|   ADD   r5,r5,r11
�   LDR   r6,[r1,#16]
�   ADD   r6,r6,r10
�   LDR   r7,[r1,#20]
�   ADD   r7,r7,r11
�   STR   r3,[r1]
�#   SWI   "XWimp_GetWindowState"
�   LDMVSFD   (sp)!,{r4-r7}
�   BVS   exitswi
�   STR   r4,[1,#4]
�   STR   r5,[r1,#8]
�   STR   r6,[r1,#12]
�   STR   r7,[r1,#16]
�   LDR   r8,[r9,#28]
   STR   r8,[r1,#28]
   LDMFD (sp)!,{r4-r7}
   SWI   "XWimp_OpenWindow"
&   BVS   exitswi
0   MOV   r1,r9
:   STR   r3,[r1,#28]
D   SWI   "XWimp_OpenWindow"
N   B     exitswi
X;
b%; As above but r0 = window handle
l;
v.popopenpanewindow
�   STMFD (sp)!,{r1}
�   ADD   r1,ws,#blk
�   TEQ   r4,#0
�   BLNE  convertname4
�   STR   r0,[r1]
�#   SWI   "XWimp_GetWindowState"
�   LDMVSFD   (sp)!,{r1}
�   BVS   exitswi
�   MVN   r8,#0
�   STR   r8,[r1,#28]
�*   SWI   "XWSWimpTools_OpenPaneWindow"
�   LDMFD (sp)!,{r1}
�   B     exitswi
;
; r0 = window handle
;
 .closewind
*   STMFD (sp)!,{r1}
4   TEQ   r1,#0
>   BLNE  convertname1
H   ADD   r1,ws,#blk
R   STR   r0,[r1]
\    SWI   "XWimp_CloseWindow"
f   LDMFD (sp)!,{r1}
p   B     exitswi
z;
�; �STATE
�; --------
�8; this routine sets up a block to get an icons state
�;
�
.getstate
�   STMFD (sp)!,{r7,link}
�   MOV   r7,r1
�   ADD   r1,ws,#blk
�   STR   r0,[r1,#0]
�   STR   r7,[r1,#4]
�   LDMFD (sp)!,{r7,pc}
�;
�; r0 = window handle
; r1 = icon handle
; returns :
1; r0 = new icon state true or false (-1 or 0)
$;
..toggleicon
8   STMFD (sp)!,{r1}
B   TEQ   r3,#0
L   BLNE  convertname3
V   BL    getstate
`!   SWI   "XWimp_GetIconState"
j   BVS   toggleout
t   LDR   r9,[r1,#24]
~   �   r9,r9,#1<<21
�   MOV   r11,#1<<21
�   �   r9,r9,r11
�   MOV   r10,r9
�   STR   r9,[r1,#8]
�   STR   r11,[r1,#12]
�!   SWI   "XWimp_SetIconState"
�   BVS   toggleout
�   MVN   r0,#0
�   CMP   r10,#0
�   �Q r0,#0
�.toggleout
�   LDMFD (sp)!,{r1}
   B     exitswi

;
; r0 = window handle
; r1 = icon handle
(2; r2 = true or false to set or unset (-1 or 0)
2;
<.setselect
F   STMFD (sp)!,{r1}
P   TEQ   r3,#0
Z   BLNE  convertname3
d   BL    getstate
n!   SWI   "XWimp_GetIconState"
x   BVS   setselectout
�   �   r9,r2,#1<<21
�   STR   r9,[r1,#8]
�   MOV   r9,#1<<21
�   STR   r9,[r1,#12]
�!   SWI   "XWimp_SetIconState"
�.setselectout
�   LDMFD (sp)!,{r1}
�   B     exitswi
�;
�; r0 = window handle
�; r1 = icon handle
�; returns :
�2; r2 = true or false to set or unset (-1 or 0)
;
.geticonselect
   STMFD (sp)!,{r1}
"   TEQ   r3,#0
,   BLNE  convertname3
6   BL    getstate
@!   SWI   "XWimp_GetIconState"
J   BVS   exitswi
T   LDR   r9,[r1,#24]
^   �   r9,r9,#1<<21
h   MVN   r0,#0
r   CMP   r9,#0
|   �Q r0,#0
�.getselectout
�   LDMFD (sp)!,{r1}
�   B     exitswi
�;
�; r0 = window handle
�; r1 = icon handle
�2; r2 = true or false to set or unset (-1 or 0)
�;
�.seticonenable
�   STMFD (sp)!,{r1}
�   TEQ   r3,#0
�   BLNE  convertname3
�   BL    getstate
!   SWI   "XWimp_GetIconState"
   BVS   enableout
   �   r9,r2,#1<<22
&   STR   r9,[r1,#8]
0   MOV   r9,#1<<22
:   STR   r9,[r1,#12]
D!   SWI   "XWimp_SetIconState"
N.enableout
X   LDMFD (sp)!,{r1}
b   B     exitswi
l;
v; r0 = window handle
�; r1 = icon handle
�
; returns
�2; r2 = true or false to set or unset (-1 or 0)
�;
�.geticonenable
�   STMFD (sp)!,{r1}
�   TEQ   r3,#0
�   BLNE  convertname3
�   BL    getstate
�!   SWI   "XWimp_GetIconState"
�   BVS   getenableout
�   LDR   r9,[r1,#24]
�   �   r9,r9,#1<<22
   MVN   r0,#0
   CMP   r9,#0
   �Q r0,#0
 .getenableout
*   LDMFD (sp)!,{r1}
4   B     exitswi
>;
H; r0 = window handle
R; r1 = icon handle
\;; r2 = string ending in a control character ie �II < 33
f;
p.seticontext
z   STMFD (sp)!,{r1}
�   TEQ   r3,#0
�   BLNE  convertname3
�   BL    getstate
�!   SWI   "XWimp_GetIconState"
�   BVS   settextout
�   LDR   r9,[r1,#24]
�   TST   r9,#1<<8
�   BEQ   strnotindirected
�   MOV   r9,#0
�   STR   r9,[r1,#8]
�   STR   r9,[r1,#12]
�   MOV   r9,r2
�   LDR   r10,[r1,#28]
   LDR   r11,[r1,#36]
   BL    copystring
!   SWI   "XWimp_SetIconState"
$.settextout
.   LDMFD (sp)!,{r1}
8   B     exitswi
B;
L; r0 = window handle
V; r1 = icon handle
`; returns :
j; r0 = text string
t;
~.geticontext
�   STMFD (sp)!,{r1}
�   TEQ   r3,#0
�   BLNE  convertname3
�   BL    getstate
�!   SWI   "XWimp_GetIconState"
�   BVS   gettextout
�   LDR   r9,[r1,#24]
�   TST   r9,#1<<8
�   ADDEQ r0,r1,#28
�   BEQ   gettextout
�   LDR   r0,[r1,#28]
�.gettextout
   LDMFD (sp)!,{r1}

   B     exitswi
;
; r0 = window handle
(; r1 = icon handle
2;; r2 = string ending in a control character ie �II < 33
<;
F.seticonvalidation
P   STMFD (sp)!,{r1}
Z   TEQ   r3,#0
d   BLNE  convertname3
n   BL    getstate
x!   SWI   "XWimp_GetIconState"
�   BVS   setvalidout
�   LDR   r9,[r1,#24]
�   TST   r9,#1<<8
�   BEQ   strnotindirected
�   MOV   r9,0
�   STR   r9,[r1,#8]
�   STR   r9,[r1,#12]
�   MOV   r9,r2
�   LDR   r10,[r1,#32]
�   MOV   r11,#255
�   BL    copystring
�!   SWI   "XWimp_SetIconState"
�.setvalidout
   LDMFD (sp)!,{r1}
   B     exitswi
;
"; r0 = window handle
,; r1 = icon handle
6; returns :
@; r0 = text string
J;
T.geticonvalidation
^   STMFD (sp)!,{r1}
h   TEQ   r3,#0
r   BLNE  convertname3
|   BL    getstate
�!   SWI   "XWimp_GetIconState"
�   BVS   getvalidout
�   LDR   r9,[r1,#24]
�   TST   r9,#1<<8
�   BEQ   strnotindirected
�   LDR   r0,[r1,#32]
�.getvalidout
�   LDMFD (sp)!,{r1}
�   B     exitswi
�;
�; r0 = window handle
�; r2 = text string
�;
.setwindowtitle
   STMFD (sp)!,{r1}
   TEQ   r3,#0
&   BLNE  convertname3
0   ADD   r1,ws,#blk
:   STR   r0,[r1]
D"   SWI   "XWimp_GetWindowInfo"
N   BVS   settitleout
X   LDR   r8,[r1,#60]
b   TST   r8,#1<<8
l   BEQ   wstrnotindirected
v   MOV   r9,r2
�   LDR   r10,[r1,#76]
�   LDR   r11,[r1,#84]
�   BL    copystring
�.settitleout
�   LDMFD (sp)!,{r1}
�   B     exitswi
�;
�4.wstrnotindirected               ; error message
�   LDMFD (sp)!,{r1}
�   ADR   r0,wnotindstr
�   B     makeerror
�;
�.wnotindstr
EQUD  ErrorBase+12
1EQUS  "Window title string is not indirected"
EQUB  0
 	ALIGN
*;
4; r0 = window handle
>;
H
; returns
R;
\; r2 = text string
f;
p.getwindowtitle
z   STMFD (sp)!,{r1}
�   TEQ   r3,#0
�   BLNE  convertname3
�   ADD   r1,ws,#blk
�   STR   r0,[r1]
�"   SWI   "XWimp_GetWindowInfo"
�   BVS   gettitleout
�   LDR   r8,[r1,#60]
�   TST   r8,#1<<8
�   ADDEQ r2,r1,#76
�   BEQ   gettitleout
�   LDR   r2,[r1,#76]
�.gettitleout
�   LDMFD (sp)!,{r1}
   B     exitswi
;
; r0 = window handle
$;
..updatewindow
8    STMFD (sp)!,{r1,r2,r3,r4}
B   TEQ   r1,#0
L   BLNE  convertname1
V   ADD   r1,ws,#blk
`   STR   r0,[r1]
j#   SWI   "XWimp_GetWindowState"
t   BVS   updatewindow1
~   LDR   r0,[r1,#32]
�   TST   r0,#1<<16
�   BEQ   updatewindow1
�%   SWI   "XWimp_GetWindowOutline"
�   LDR   r0,[r1,#4]
�   LDR   r2,[r1,#8]
�   LDR   r3,[r1,#12]
�   LDR   r4,[r1,#16]
�   MOV   r1,r0
�   MVN   r0,#0
�    SWIVC "XWimp_ForceRedraw"
�.updatewindow1
�    LDMFD (sp)!,{r1,r2,r3,r4}
   B     exitswi

;
; r0 = menu block
; r1 = menu string
($; r2 = width of menu in OS units
2; returns:
<5; r0 = position in menu block for first menu item
F;
P.menuheader
Z   MOV   r9,r1
d   MOV   r10,r0
n   MOV   r11,#11
x   BL    copystring
�   LDR   r9,(menudata)
�   STR   r9,[r0,#12]
�   STR   r2,[r0,#16]
�   MOV   r9,#44
�   STR   r9,[r0,#20]
�   MOV   r9,#0
�   STR   r9,[r0,#24]
�   ADD   r0,r0,#28
�   B     exitswi
�
.menudata
�EQUD     &00070207
�;
�.makemenuitem
   TEQ   r3,#0
   BEQ   makemenuitem2
   LDR   r8,(textdata)
"   TEQ   r4,#0
,   �RNE r8,r8,#&F000
6   �RNE r2,r2,#1<<2
@   STR   r2,[r0]
J   STR   r8,[r0,#8]
T   MOV   r9,r1
^   MOV   r10,r3
h   MOV   r11,#255
r   BL    copystring
|   STR   r3,[r0,#12]
�   TEQ   r4,#0
�   STREQ r11,[r0,#20]
�   STRNE r4,[r0,#20]
�   MVN   r8,#0
�   STR   r8,[r0,#16]
�   STR   r8,[r0,#4]
�   MOV   r3,r10
�   ADD   r0,r0,#24
�   B     exitswi
�
.textdata
�EQUD     &07000121
�.textdata2
�EQUD     &07000021
 ;
 ; r0 = menu block
 ; r1 = text string
 &; r2 = options
 0; returns:
 :F; r0 = position of next menu item ( for next make menu item call )
 D;
 N.makemenuitem2
 X   STR   r2,[r0,#0]
 b   MVN   r8,#0
 l   STR   r8,[r0,#4]
 v   LDR   r8,(textdata2)
 �   STR   r8,[r0,#8]
 �   ADD   r10,r0,#12
 �   MOV   r9,r1
 �   MOV   r11,#11
 �   BL    copystring
 �   ADD   r0,r0,#24
 �   B     exitswi
 �;
 �; r0 = menu block
 �-; r1 = menu item number ( starting at 0 )
 �; r2 = menu string
 �;
 �.setmenuitem
!   ADD   r8,r0,#28
!   ADD   r8,r8,r1,LSL#4
!   ADD   r8,r8,r1,LSL#3
!    LDR   r9,[r8,#8]
!*   TST   r9,#1<<8
!4   BEQ   strnotindirected2
!>   LDR   r10,[r8,#12]
!H   MOV   r9,r2
!R   LDR   r11,[r8,#20]
!\   BL    copystring
!f   B     exitswi
!p;
!z; r0 = menu block
!�-; r1 = menu item number ( starting at 0 )
!�; returns:
!�; r0 = menu item text
!�;
!�.getmenuitem
!�   ADD   r8,r0,#28
!�   ADD   r8,r8,r1,LSL#4
!�   ADD   r8,r8,r1,LSL#3
!�   LDR   r0,[r8,#8]
!�   TST   r0,#1<<8
!�   ADDEQ r0,r8,#12
!�   BEQ   exitswi
!�   LDR   r0,[r8,#12]
"   B     exitswi
";
".setmenuitemlast
"$   ADD   r8,r0,#28
".   ADD   r8,r8,r1,LSL#4
"8   ADD   r8,r8,r1,LSL#3
"B   LDR   r0,[r8,#0]
"L   MVN   r10,#&80
"V   �   r2,r2,#&80
"`   �   r0,r0,r10
"j   �R   r0,r0,#&80
"t   STR   r0,[r8,#0]
"~   B     exitswi
"�;
"�.settick
"�   ADD   r8,r0,#28
"�   ADD   r8,r8,r1,LSL#4
"�   ADD   r8,r8,r1,LSL#3
"�   MVN   r9,#1
"�   LDR   r0,[r8,#0]
"�   �   r0,r0,r9
"�   �   r2,r2,#1
"�   �R   r0,r0,r2
"�   STR   r0,[r8,#0]
"�   B     exitswi
#;
#
.gettick
#   ADD   r8,r0,#28
#   ADD   r8,r8,r1,LSL#4
#(   ADD   r8,r8,r1,LSL#3
#2   LDR   r10,[r8,#0]
#<   TST   r10,#1
#F   MOV   r0,#0
#P   MVNNE r0,#0
#Z   B     exitswi
#d;
#n.setmessage
#x   ADD   r8,r0,#28
#�   ADD   r8,r8,r1,LSL#4
#�   ADD   r8,r8,r1,LSL#3
#�   MVN   r9,#1<<3
#�   LDR   r0,[r8,#0]
#�   �   r0,r0,r9
#�   �   r2,r2,#1<<3
#�   �R   r0,r0,r2
#�   STR   r0,[r8,#0]
#�   B     exitswi
#�;
#�.getmessage
#�   ADD   r8,r0,#28
#�   ADD   r8,r8,r1,LSL#4
$   ADD   r8,r8,r1,LSL#3
$   LDR   r10,[r8,#0]
$   TST   r10,#1<<3
$"   MOV   r0,#0
$,   MVNNE r0,#0
$6   B     exitswi
$@;
$J.setenable
$T   ADD   r8,r0,#28
$^   ADD   r8,r8,r1,LSL#4
$h   ADD   r8,r8,r1,LSL#3
$r   MVN   r9,#1<<22
$|   LDR   r0,[r8,#8]
$�   �   r0,r0,r9
$�   �   r2,r2,#1<<22
$�   �R   r0,r0,r2
$�   STR   r0,[r8,#8]
$�   B     exitswi
$�;
$�.getenable
$�   ADD   r8,r0,#28
$�   ADD   r8,r8,r1,LSL#4
$�   ADD   r8,r8,r1,LSL#3
$�   LDR   r10,[r8,#8]
$�   TST   r10,#1<<22
$�   MOV   r0,#0
%   MVNNE r0,#0
%   B     exitswi
%;
%&.attachsub
%0   TEQ   r3,#0
%:   BEQ   attachsub1
%D   STMFD (sp)!,{r0}
%N   MOV   r0,r2
%X   BL    convertname3
%b   MOV   r2,r0
%l   LDMFD (sp)!,{r0}
%v.attachsub1
%�   ADD   r8,r0,#28
%�   ADD   r8,r8,r1,LSL#4
%�   ADD   r8,r8,r1,LSL#3
%�   STR   r2,[r8,#4]
%�   B     exitswi
%�;
%�.loadmenus
%�   B     notimplemented
%�;
%�.gettext
%�   B     exitswi
%�;
%�
.taskicon
&   STMFD (sp)!,{r1,r7}
&   MOV   r7,r1
&   ADD   r1,ws,#blk
&    STR   r0,[r1,#0]
&*   MOV   r0,#0
&4   STR   r0,[r1,#4]
&>   STR   r0,[r1,#8]
&H   MOV   r0,#68
&R   STR   r0,[r1,#12]
&\   STR   r0,[r1,#16]
&f   ADR   r8,flagdata
&p   LDR   r0,[r8,r7,LSL#2]
&z   STR   r0,[r1,#20]
&�<   CMP   r7,#0                  ; is it a normal sprite?
&�   BNE   taskicon1
&�   ADD   r10,r1,#24
&�   MOV   r9,r2
&�   MOV   r11,#12
&�   BL    copystring
&�   B     taskicon0
&�H.taskicon1                      ; if not then r2 is a block with the
&�7   STR   r2,[r1,#24]            ; sprite name in it
&�   MVN   r0,#0
&�   STR   r0,[r1,#28]
&�   MOV   r9,r2
&�C   BL    countchars             ; find the length of the string
'   STR   r11,[r1,#32]
'   CMP   r7,#1
';   BNE   taskicon0              ; check to see if it an
'$7                                ; indirected sprite
'.=   STR   r3,[r1,#28]            ; and point to spritepool
'8.taskicon0
'B   SWI   "XWimp_CreateIcon"
'L   LDMFD (sp)!,{r1,r7}
'V   B     exitswi
'`
.flagdata
'j   EQUD  &7000301A
't   EQUD  &7000311A
'~   EQUD  &7000313D
'�;
'�.setmenuoptions
'�   ADD   r7,r0,#28
'�   ADD   r7,r7,r1,LSL#4
'�   ADD   r7,r7,r1,LSL#3
'�   LDR   r0,[r7,#0]
'�   STR   r2,[r7,#0]
'�   B     exitswi
'�;
'�.getmenuoptions
'�   ADD   r7,r0,#28
'�   ADD   r7,r7,r1,LSL#4
(   ADD   r7,r7,r1,LSL#3
(
   LDR   r0,[r7,#0]
(   B     exitswi
(;
((.iconbarmenu
(2   STMFD (sp)!,{r1-r3}
(<   MOV   r8,r0
(F   ADD   r1,ws,#blk
(P#   SWI   "XWimp_GetPointerInfo"
(Z   BVS   iconbarout
(d   LDR   r2,[r1,#0]
(n   SUB   r2,r2,#64
(x   MOV   r3,#96
(�   ADD   r9,r8,#28
(�
.barmenu1
(�   ADD   r3,r3,#44
(�   LDR   r10,[r9,#0]
(�   TST   r10,#1<<1
(�   ADDNE r3,r3,#24
(�   ADD   r9,r9,#24
(�   TST   r10,#1<<7
(�   BEQ   barmenu1
(�   MOV   r1,r8
(�   SWI   "XWimp_CreateMenu"
(�.iconbarout
(�   LDMFD (sp)!,{r1-r3}
)   B     exitswi
);
).menuadjust
)"   STMFD (sp)!,{r1-r3}
),   MOV   r8,r0
)6   ADD   r1,ws,#blk
)@#   SWI   "XWimp_GetPointerInfo"
)J   BVS   menuadjout
)T   LDR   r9,[r1,#8]
)^   TST   r9,#1
)h   BEQ   menuadjout
)r   MOV   r1,r8
)|   MOV   r2,#0
)�   MOV   r3,#0
)�   SWI   "XWimp_CreateMenu"
)�.menuadjout
)�   LDMFD (sp)!,{r1-r3}
)�   B     exitswi
)�;
)�L; the following routine reads the character before the menu entry in the
)�; string and decodes it as
)�;
)�; � = ticked !
)�; - = dashed line follows
)�'; > = generate messages for submenu
)�; � = dimmed
*; ? = writeable
*;
*.readmenuflag
*&   LDRB  r6,[r3,#0]
*0   TEQ   r6,#�"�"
*:   �REQ r8,r8,#1<<0
*D   ADDEQ r3,r3,#1
*N   �Q pc,link
*X   TEQ   r6,#�"-"
*b   �REQ r8,r8,#1<<1
*l   ADDEQ r3,r3,#1
*v   �Q pc,link
*�   TEQ   r6,#�"?"
*�   �REQ r8,r8,#1<<2
*�   ADDEQ r3,r3,#1
*�   �Q pc,link
*�   TEQ   r6,#�">"
*�   �REQ r8,r8,#1<<3
*�   ADDEQ r3,r3,#1
*�   �Q pc,link
*�   TEQ   r6,#�"�"
*�   �REQ r7,r7,#1<<22
*�   ADDEQ r3,r3,#1
*�   MOV   pc,link
*�;
+;  r0  = menu block
+);  r1  = indirected text string block
+;  r2  = menu string
+ ;
+*;  returns
+4+;  r0  = next location after menu block
+>*;  r1  = next location in string block
+H;
+R
.makemenu
+\   STMFD (sp)!,{r6,r7}
+f   MOV   r8,#0
+p   LDRB  r9,[r3,#0]
+z   TEQ   r9,#�"#"
+�   ADDEQ r3,r3,#1
+�   STRNE r8,[r0,#0]
+�   BNE   makemenu1
+�   MOV   r9,r3
+�   MOV   r10,#�(",")
+�   BL    countspecial
+�   TST   r11,#&100
+�   BNE   badmenustring
+�   CMP   r11,#11
+�   BGT   badmenutitle
+�   MOV   r9,r3
+�   MOV   r10,r0
+�   BL    copychars
,   ADD   r3,r9,#1
,.makemenu1
,   LDR   r8,(menudata)
,$   STR   r8,[r0,#12]
,.   MOV   r8,#44
,8   STR   r8,[r0,#20]
,B   STR   r2,[r0,#16]
,L   MOV   r9,#0
,V   STR   r9,[r0,#24]
,`   ADD   r0,r0,#28
,j.makemenuloop
,t   MOV   r8,#0
,~   LDR   r7,(textdata2)
,�   BL    readmenuflag
,�   BL    readmenuflag
,�   BL    readmenuflag
,�   BL    readmenuflag
,�   BL    readmenuflag
,�   MVN   r9,#0
,�   STR   r9,[r0,#4]
,�   MOV   r9,r3
,�   MOV   r10,#�","
,�   BL    countspecial
,�   TST   r11,#&100
,�   �RNE r8,r8,#1<<7
-   �NE r11,r11,#&FF
-
   STR   r8,[r0]
-   CMP   r11,#11
-   BGT   makemenu2
-(   STR   r7,[r0,#8]
-2   MOV   r9,r3
-<   ADD   r10,r0,#12
-F   BL    copychars
-P   ADD   r3,r9,#1
-Z   ADD   r0,r0,#24
-d   LDRB  r9,[r3,#-1]
-n   TEQ   r9,#�","
-x   BEQ   makemenuloop
-�   B     makemenuout
-�.makemenu2
-�   �R   r7,r7,#&100
-�   STR   r7,[r0,#8]
-�   STR   r11,[r0,#20]
-�   STR   r1,[r0,#12]
-�   MVN   r9,#0
-�   STR   r9,[r0,#16]
-�   MOV   r9,r3
-�   MOV   r10,r1
-�   BL    copychars
-�   ADD   r3,r9,#1
-�   ADD   r1,r10,#1
.   ADD   r0,r0,#24
.   LDRB  r9,[r3,#-1]
.   TEQ   r9,#�","
."   BEQ   makemenuloop
.,.makemenuout
.6   LDMFD (sp)!,{r6,r7}
.@   B     exitswi
.J;
.T2.badmenustring                 ; error message
.^   LDMFD (sp)!,{r6,r7}
.h   ADR   r0,bdmenustr
.r   B     makeerror
.|;
.�.bdmenustr
.�EQUD  ErrorBase+4
.�-EQUS  "Incorrect menu desription string!"
.�EQUB  0
.�	ALIGN
.�;
.�2.badmenutitle                  ; error message
.�   LDMFD (sp)!,{r6,r7}
.�   ADR   r0,bdmenutle
.�   B     makeerror
.�;
.�.bdmenutle
.�EQUD  ErrorBase+5
/ EQUS  "Menu title too long!"
/EQUB  0
/	ALIGN
/&;
/0;  r0  = window handle
/:;  r1  = icon number
/D;  r2  = sprite block
/N;
/X;  returns
/bF;  r0  = drag type ; -1 = used DragASprite ; 0 = used Wimp_DragBox
/l;
/v.startdrag
/�   STMFD (sp)!,{r3-r7}
/�   TEQ   r3,#0
/�   BLNE  convertname3
/�   MOV   r8,r0
/�   MOV   r9,r1
/�   ADD   r1,ws,#blk
/�   STR   r8,[r1]
/�#   SWI   "XWimp_GetWindowState"
/�   BVS   setupdragout
/�   LDR   r7,[r1,#20]
/�   LDR   r10,[r1,#4]
/�   SUB   r10,r10,r7
/�   LDR   r7,[r1,#24]
0   LDR   r11,[r1,#16]
0   SUB   r11,r11,r7
0   STR   r9,[r1,#4]
0 !   SWI   "XWimp_GetIconState"
0*   BVS   setupdragout
04   MOV   r7,#5
0>   STR   r7,[r1,#4]
0H   LDR   r7,[r1,#8]
0R   ADD   r7,r10,r7
0\   STR   r7,[r1,#8]
0f   LDR   r7,[r1,#12]
0p   ADD   r7,r11,r7
0z   STR   r7,[r1,#12]
0�   LDR   r7,[r1,#16]
0�   ADD   r7,r10,r7
0�   STR   r7,[r1,#16]
0�   LDR   r7,[r1,#20]
0�   ADD   r7,r11,r7
0�   STR   r7,[r1,#20]
0�   MOV   r7,#0
0�   STR   r7,[r1,#24]
0�   STR   r7,[r1,#28]
0�   MVN   r7,#&80000000
0�   STR   r7,[r1,#32]
0�   STR   r7,[r1,#36]
0�   MOV   r7,r2
1   ADR   r1,(dragasprite)
1&   SWI   "XOS_SWINumberFromString"
1   BVS   wimpdrag
1$   MOV   r0,#161
1.   MOV   r1,#28
18   SWI   "XOS_Byte"
1B   BVS   exitswi
1L   TST   r2,#1<<1
1V   BEQ   wimpdrag
1`   ADD   r1,ws,#(blk+48)
1j   STR   r8,[r1]
1t   STR   r9,[r1,#4]
1~!   SWI   "XWimp_GetIconState"
1�   BVS   setupdragout
1�   LDR   r0,[r1,#24]
1�   TST   r0,#2
1�   BEQ   wimpdrag
1�   TST   r0,#1
1�   BNE   dragindirect
1�   TST   r0,#&100
1�.dragdirect
1�   LDRNE r2,[r1,#28]
1�   ADDEQ r2,r1,#28
1�   MOV   r1,r7
1�.dragsprite
2   MOV   r0,#%11000101
2
   ADD   r3,ws,#blk
2   ADD   r3,r3,#8
2   ADD   r4,r3,#16
2(!   SWI   "XDragASprite_Start"
22   MVN   r0,#0
2<   B     setupdragout
2F
.wimpdrag
2P   ADD   r1,ws,#blk
2Z   SWI   "XWimp_DragBox"
2d   BVS   setupdragout
2n   MOV   r0,#0
2x   ADDS  r0,r0,r0
2�.setupdragout
2�   LDMFD (sp)!,{r3-r7}
2�   B     exitswi
2�.dragindirect
2�   TST   r0,#&100
2�   BEQ   dragdirect
2�   LDR   r0,[r1,#32]
2�   CMN   r0,#1
2�   LDREQ r2,[r1,#28]
2�   �Q r1,r7
2�   BEQ   dragsprite
2�   LDR   r2,[r1,#32]
2�.dragindirect1
3   LDRB  r0,[r2],#1
3   CMP   r0,#32
3   BLT   wimpdrag
3"   TEQ   r0,#�";"
3,   BEQ   dragindirect1
36   �R   r0,r0,#&20
3@   TEQ   r0,#�"s"
3J   �Q r1,r7
3T   BEQ   dragsprite
3^.dragindirect2
3h   LDRB  r0,[r2],#1
3r   CMP   r0,#32
3|   BLT   wimpdrag
3�   TEQ   r0,#�";"
3�   BEQ   dragindirect1
3�   B     dragindirect2
3�;
3�.dragasprite
3�EQUS "DragASprite_Start"
3�
EQUB 0
3�	ALIGN
3�;
3�
.sendsave
3�   STMFD (sp)!,{r0-r3}
3�   MOV   r9,r2
3�B   SWI   "XWimp_GetPointerInfo"      ; get position of pointer
4   BVS   startsaveout
4   LDR   r8,[r1,#12]
4L   STR   r8,[r1,#20]                 ; r1!20 = destination window handle
4&   LDR   r8,[r1,#16]
40J   STR   r8,[r1,#24]                 ; r1!24 = destination icon handle
4:   LDR   r8,[r1]
4DE   STR   r8,[r1,#28]                 ; r1!28 = pointer x position
4N   LDR   r8,[r1,#4]
4XE   STR   r8,[r1,#32]                 ; r1!32 = pointer y position
4bL   STR   r4,[r1,#36]                 ; r1!36 = r4 (size of data to save)
4l   MOV   r8,#0
4vJ   STR   r8,[r1,#12]                 ; set r1!12=0 originating message
4�   MOV   r8,#1
4�D   STR   r8,[r1,#16]                 ; Message_DataSave (type 1)
4�P   STR   r9,[r1,#40]                 ; r9 =value of r2, r1!40=r9 (file type)
4�   MOV   r9,r3
4�I   ADD   r10,r1,#44                  ; r3 (file name of file to save)
4�   MOV   r11,#255
4�=   BL    getleaf                     ; get file leaf name
4�3   BL    copystring                  ; copy it!
4�O   ADD   r8,r11,#47                  ; put size of block = 44 + name length
4�   LDR   r11,(maskto4)
4�   �   r8,r8,r11
4�   STR   r8,[r1]
4�   MOV   r0,#18
5   LDR   r2,[r1,#20]
5   LDR   r3,[r1,#24]
5;   SWI   "XWimp_SendMessage"         ; send the message
5 .startsaveout
5*   LDMFD (sp)!,{r0-r3}
54   B     exitswi
5>;
5H.maskto4
5R   EQUD  &FFFFFFFC
5\;
5f
.sendload
5p   STMFD (sp)!,{r0-r3}
5z   MOV   r9,r0
5�   LDR   r0,[r1,#8]
5�9   STR   r0,[r1,#12]                 ; put r1!12=r1!8
5�D   MOV   r0,#3                       ; Message_DataLoad (type 3)
5�   STR   r0,[r1,#16]
5�   ADD   r10,r1,#44
5�   MOV   r11,#255
5�   BL    copystring
5�   ADD   r0,r11,#47
5�   LDR   r11,(maskto4)
5�   �   r0,r0,r11
5�   STR   r0,[r1]
5�   MOV   r0,#18
5�   LDR   r2,[r1,#20]
6   LDR   r3,[r1,#24]
6    SWI   "XWimp_SendMessage"
6   LDMFD (sp)!,{r0-r3}
6$   B     exitswi
6.;
68.sendsaveack
6B   STMFD (sp)!,{r0,r2,r3}
6L   ADD   r10,r1,#44
6V   ADR   r9,(wimpscrap)
6`   MOV   r11,#14
6jO   BL    copystring                  ; copy <Wimp$Scrap> to file name field
6t   LDR   r2,[r1,#4]
6~9   LDR   r8,[r1,#8]                  ; put r1!12=r1!8
6�   STR   r8,[r1,#12]
6�   MOV   r8,#2
6�G   STR   r8,[r1,#16]                 ; Message_DataSaveAck (type 2)
6�   MOV   r8,#60
6�?   STR   r8,[r1]                     ; block length = 44+16
6�   MVN   r8,#0
6�H   STR   r8,[r1,#36]                 ; data size =-1 (data not safe)
6�   MOV   r0,#17
6�   MOV   r3,#0
6�;   SWI   "XWimp_SendMessage"         ; send the message
6�   LDMFD (sp)!,{r0,r2,r3}
6�   B     exitswi
7.wimpscrap
7
   EQUS  "<Wimp$Scrap>"
7   EQUB  0
7   ALIGN
7(;
72.sendloadack
7<   STMFD (sp)!,{r0-r3}
7F   LDR   r0,[r1,#8]
7PD   STR   r0,[r1,#12]                 ; put r1!12=r1!8 (your ref)
7ZG   MOV   r0,#4                       ; Message_DataLoadAck (type 4)
7d   STR   r0,[r1,#16]
7n   ADD   r9,r1,#44
7x   BL    countchars
7�   ADD   r0,r11,#47
7�   LDR   r11,(maskto4)
7�   �   r0,r0,r11
7�   STR   r0,[r1]
7�   MOV   r0,#17
7�   LDR   r2,[r1,#20]
7�   LDR   r3,[r1,#24]
7�    SWI   "XWimp_SendMessage"
7�   LDMFD (sp)!,{r0-r3}
7�   B     exitswi
7�;
7�F.loadtemplates                       ; r1  = window transfer block
7�J   STMFD (sp)!,{r4-r6}               ; r2  = indirect sprite data area
8=   MOV   r8,r4                       ; r3  = end of above
8K   TEQ   r6,#0                       ; r4  = data block to store window
8B   MOVNE r4,r6                       ;       names and handles
8"=   MVNEQ r4,#1                       ; r5  = sprite block
8,B   BEQ   loadtemplates0              ; r6  = font handle table
86   MOV   r0,#0
8@   MOV   r7,#256
8J.loadtemplates0a
8TH   STRB  r0,[r6],#1                  ; set font handle block to zero
8^   SUB   r7,r7,#1
8h   TEQ   r7,#0
8r   BNE   loadtemplates0a
8|.loadtemplates0
8�   MOV   r9,r5
8�   MOV   r6,#0
8�   MOV   r7,#0
8�.loadtemplates1
8�   ADD   r5,ws,#blk
8�   LDR   r0,(star)
8�   STR   r0,[r5]
8�;   SWI   "XWimp_LoadTemplate"        ; r1 - r3 as above
8�@   BVS   loadtemplateserr            ; r4 = font table or -1
8�D   TEQ   r6,#0                       ; r5 = template name or "*"
8�N   BEQ   loadtemplatesout            ; r6 = template number with that name
8�   ADD   r7,r7,#1
8�   STMFD (sp)!,{r9}
9   ADD   r9,ws,#blk
9A   ADD   r10,r8,#4                   ; returns r5 = full name
9N   MOV   r11,#16                     ; r6 = next template or 0 if all read
9&   BL    copystring
90   LDMFD (sp)!,{r9}
9:   STR   r9,[r1,#64]
9D!   SWI   "XWimp_CreateWindow"
9N   BVS   loadtemplateserr
9X   STR   r0,[r8]
9b   ADD   r8,r8,#20
9l   B     loadtemplates1
9v.loadtemplatesout
9�   MVN   r0,#0
9�   STR   r0,[r8]
9�I   MOV   r0,r7                      ; r0  = returns number of windows
9�   LDMFD (sp)!,{r4-r6}
9�   B     exitswi
9�.loadtemplateserr
9�   LDMFD (sp)!,{r4-r6}
9�   ADR   r0,templateerr
9�   B     makeerror
9�.templateerr
9�EQUD ErrorBase+63
9�)EQUS "Error while loading templates!"
9�
EQUB 0
:	ALIGN
:	.star
:   EQUS  "*"
:    EQUB  0
:*   ALIGN
:4;
:> ; window handle block format
:H;
:R; 4  bytes  = window handle
:\0; 16 bytes  = window name from template file
:f;
:p; block ends with -1
:z;
:�@; r0        = 0   convert window handle to number ( 0 to n )
:�3; r0        = 1   convert window handle to name
:�5; r0        = 2   convert window number to handle
:�3; r0        = 3   convert window number to name
:�5; r0        = 4   convert window name   to handle
:�5; r0        = 5   convert window name   to number
:�;
:�; r1        = handle block
:�; r2        = parameter
:�;
:�
; returns
:�;
:�; r0        = result
;;
;.windowconvert
;9   CMP   r0,#5                  ; check offset number
;$F   BGT   dontknowconvert        ; error if too big for this module
;.?   MOV   r8,r0,LSL#2            ; calculate offset for jump
;8=   ADD   r8,r8,pc               ; taking into account ARM
;BH   MOV   pc,r8                  ; pipelining by adjusting by 4 bytes
;L;
;V;  branch table
;`;
;j   B     whandletonum
;t   B     whandletoname
;~   B     wnumbertohandle
;�   B     wnumbertoname
;�   B     wnametohandle
;�   B     wnametonumber
;�;
;�.whandletonum
;�   MOV   r8,#0
;�   MOV   r9,#0
;�.whandletonum1
;�   LDR   r10,[r1,r8]
;�   CMN   r10,#1
;�   BEQ   nosuchwindhand
;�   CMP   r10,r2
<   ADDNE r8,r8,#20
<
   ADDNE r9,r9,#1
<   BNE   whandletonum1
<   MOV   r0,r9
<(   B     exitswi
<2;
<<.whandletoname
<F   CMN   r2,#1
<P   ADREQ r0,iconbarstr
<Z   BEQ   exitswi
<d   CMN   r2,#2
<n   ADREQ r0,backdropstr
<x   MOV   r8,#0
<�.whandletoname1
<�   LDR   r10,[r1,r8]
<�   CMN   r10,#1
<�   BEQ   nosuchwindhand
<�   CMP   r10,r2
<�   ADDNE r8,r8,#20
<�   BNE   whandletoname1
<�   ADD   r0,r8,#4
<�   ADD   r0,r0,r1
<�   B     exitswi
<�;
<�.iconbarstr
<�   EQUS  "iconbar"
=   EQUB  0
=   ALIGN
=;
=".backdropstr
=,   EQUS  "backdrop"
=6   EQUB  0
=@   ALIGN
=J;
=T.wnumbertohandle
=^   MOV   r8,#0
=h   MOV   r9,#0
=r.wnumbertohandle1
=|   LDR   r10,[r1,r8]
=�   CMN   r10,#1
=�   BEQ   nosuchwindnum
=�   CMP   r9,r2
=�   ADDNE r8,r8,#20
=�   ADDNE r9,r9,#1
=�   BNE   wnumbertohandle1
=�   LDR   r0,[r1,r8]
=�   B     exitswi
=�;
=�.wnumbertoname
=�   CMN   r2,#1
=�   ADREQ r0,iconbarstr
=�   BEQ   exitswi
>   CMN   r2,#2
>   ADREQ r0,backdropstr
>   MOV   r8,#0
>&   MOV   r9,#0
>0.wnumbertoname1
>:   LDR   r10,[r1,r8]
>D   CMN   r10,#1
>N   BEQ   nosuchwindnum
>X   CMP   r9,r2
>b   ADDNE r8,r8,#20
>l   ADDNE r9,r9,#1
>v   BNE   wnumbertoname1
>�   ADD   r0,r8,#4
>�   ADD   r0,r0,r1
>�   B     exitswi
>�;
>�.wnametohandle
>�   MOV   r8,r1
>�   MOV   r9,r2
>�.wnametohandle1
>�   ADD   r10,r8,#4
>�   BL    comparestr
>�   LDR   r0,[r8]
>�   CMN   r11,#1
>�   BEQ   exitswi
?   CMN   r0,#1
?   BEQ   nosuchwind
?   ADD   r8,r8,#20
?    B     wnametohandle1
?*;
?4.wnametonumber
?>   MOV   r8,r1
?H   MOV   r9,r2
?R   MOV   r2,#0
?\.wnametonumber1
?f   ADD   r10,r8,#4
?p   BL    comparestr
?z   CMN   r11,#1
?�   �Q r0,r2
?�   �Q r2,r9
?�   BEQ   exitswi
?�   LDR   r0,[r8]
?�   CMN   r0,#1
?�   BNE   nosuchwind
?�   ADD   r2,r2,#1
?�   ADD   r8,r8,#20
?�   B     wnametonumber1
?�;
?�3.nosuchwindhand                 ; error message
?�   ADR   r0,nswhand
?�   B     makeerror
@;
@.nswhand
@EQUD  ErrorBase+7
@$"EQUS  "No such window handle!"
@.EQUB  0
@8	ALIGN
@B;
@L3.nosuchwindnum                  ; error message
@V   ADR   r0,nswnum
@`   B     makeerror
@j;
@t.nswnum
@~EQUD  ErrorBase+8
@�"EQUS  "No such window number!"
@�EQUB  0
@�	ALIGN
@�;
@�3.nosuchwind                     ; error message
@�   ADR   r0,nsw
@�   B     makeerror
@�;
@�.nsw
@�EQUD  ErrorBase+9
@�EQUS  "No such window!"
@�EQUB  0
A	ALIGN
A
;
A3.dontknowconvert                ; error message
A   ADR   r0,dntknwconv
A(   B     makeerror
A2;
A<.dntknwconv
AFEQUD  ErrorBase+6
AP0EQUS  "Bad conversion routine number in R0!"
AZEQUB  0
Ad	ALIGN
An;
Ax; r1 = template font block
A�;
A�.losetemplatefonts
A�   STMFD (sp)!,{r2}
A�   MOV   r8,#1
A�.losefonts1
A�   LDRB  r2,[r1,r8]
A�   TEQ   r2,#0
A�   BEQ   losefonts2
A�.losefonts3
A�   SWI   "XFont_LoseFont"
A�   BVS   losefonts4
A�   SUB   r2,r2,#1
A�   CMP   r2,#0
B   BGT   losefonts3
B.losefonts2
B   ADD   r8,r8,#1
B"   CMP   r8,#256
B,   BLT   losefonts1
B6.losefonts4
B@   LDMFD (sp)!,{r2}
BJ   B     exitswi
BT;
B^
; returns
Bh ; r0 = task id for wimptools
Br%; r1 = task info block ( in RMA )
B|;
B�
.register
B�P   LDR   r8,[ws]                    ; number of tasks registered with module
B�   CMP   r8,#31
B�   BGE   toomanytasks
B�   ADD   r8,r8,#1
B�7   STR   r8,[ws]                    ; increase by 1
B�M   LDR   r8,[ws,#4]                 ; get flags - bit set for block being
B�;   MOV   r9,#1                      ; used by that task
B�   MOV   r10,#32
B�   MOV   r0,#0
B�.register1
B�   TST   r8,r9
B�   BEQ   register2
C   MOV   r9,r9,LSL#1
C   ADD   r0,r0,#1
C   TST   r9,#1<<31
C&   BNE   toomanytasks
C0   B     register1
C:.register2
CD   �R   r8,r8,r9
CN   STR   r8,[ws,#4]
CX   MOV   r11,#0
Cb   ADD   r10,ws,r0,LSL#5
Cl   ADD   r10,r10,#32
Cv   MOV   r1,r10
C�<   STR   r11,[r10],#4               ; clear memory block
C�   STR   r11,[r10],#4
C�   STR   r11,[r10],#4
C�   STR   r11,[r10],#4
C�   STR   r11,[r10],#4
C�   STR   r11,[r10],#4
C�   STR   r11,[r10],#4
C�   STR   r11,[r10],#4
C�   B     exitswi
C�;
C�.toomanytasks
C�   ADR   r0,toomanytasksstr
C�   B     makeerror
D;
D.toomanytasksstr
DEQUD  ErrorBase+13
D DEQUS  "Too many tasks!  This module can only register 31 tasks."
D*EQUB  0
D4	ALIGN
D>;
DH; r0 = task id
DR;
D\.deregister
Df   MOV   r8,#1
Dp   MOV   r9,r8,LSL r0
Dz   LDR   r10,[ws,#4]
D�=   TST   r10,r9             ; check task bit in flag word
D�3   BEQ   badtaskid          ; if not set bad id
D�   MVN   r9,r9
D�   �   r10,r10,r9
D�3   STR   r10,[ws,#4]        ; clear bit in word
D�   LDR   r10,[ws]
D�   TEQ   r10,#0
D�:   SUBNE r10,r10,#1         ; reduce active tasks by 1
D�   STR   r10,[ws]
D�;   ADD   r8,ws,r0,LSL #5    ; get address of task block
D�   ADD   r8,r8,#32
D�   MOV   r9,#0
D�   MOV   r0,#7
E.deregister1
E   LDR   r2,[r8,r9]
E   TEQ   r2,#0
E$   SWINE "XOS_Module"
E.   BVS   deregister2
E8   ADD   r9,r9,#4
EB   CMP   r9,#32
EL   BLT   deregister1
EV.deregister2
E`   B     exitswi
Ej;
Et.badtaskid
E~   ADR   r0,badtaskidstr
E�   B     makeerror
E�;
E�.badtaskidstr
E�EQUD  ErrorBase+14
E�EQUS  "Bad task id!"
E�
EQUB 0
E�	ALIGN
E�;
E�; r0 = task id
E�; r1 = filename
E�
; returns
E�; r1 = spriteblock
F;
F
.loadsprites
F   STMFD (sp)!,{r2-r4}
F   MOV   r8,#1
F(   MOV   r9,r8,LSL r0
F2   LDR   r10,[ws,#4]
F<   TST   r10,r9
FF   LDMEQFD  (sp)!,{r2-r4}
FP   BEQ   badtaskid
FZ   ADD   r8,ws,r0,LSL #5
Fd   ADD   r8,r8,#32
Fn   LDR   r0,[r8]
Fx   TEQ   r0,#0
F�   LDMNEFD  (sp)!,{r2-r4}
F�   BNE   sptspaceused
F�   MOV   r0,#5
F�   SWI   "XOS_File"
F�   BVS   loadsprites1
F�   TEQ   r0,#0
F�   BEQ   nospritefile
F�   ADD   r4,r4,#16
F�   MOV   r3,r4
F�   MOV   r0,#6
F�   SWI   "XOS_Module"
F�   BVS   loadsprites1
F�   STR   r2,[r8]
G   STR   r4,[r2]
G   MOV   r0,#16
G   STR   r0,[r2,#8]
G"   MOV   r9,r2
G,   MOV   r2,r1
G6   MOV   r1,r9
G@   MOV   r0,#9
GJ   ADD   r0,r0,#&100
GT   SWI   "XOS_SpriteOp"
G^   BVS   loadsprites1
Gh   MOV   r0,#10
Gr   ADD   r0,r0,#&100
G|   SWI   "XOS_SpriteOp"
G�.loadsprites1
G�   LDMFD (sp)!,{r2-r4}
G�   B     exitswi
G�;
G�.nospritefile
G�   LDMFD (sp)!,{r2-r4}
G�   ADR   r0,nosptfilestr
G�   B     makeerror
G�.nosptfilestr
G�   EQUD  ErrorBase+14
G�%   EQUS  "Sprite file not found!"
G�   EQUB  0
G�   ALIGN
H;
H.sptspaceused
H   ADR   r0,sptspaceusedstr
H&   B     makeerror
H0.sptspaceusedstr
H:   EQUD  ErrorBase+15
HDJ   EQUS  "RMA has been already allocated for sprites for this module!"
HN   EQUB  0
HX   ALIGN
Hb;
Hl.gettemplateinfo
Hv   B  notimplemented
H�;
H�.notimplemented
H�!   ADR   r0,notimplementedstr
H�   B     makeerror
H�;
H�.notimplementedstr
H�EQUD  ErrorBase+10
HƼEQUS  "SWI not implemented in this version of WimpTools.  Please contact Matt Lewis, Field House, Primrose Hill, Cowbridge, South Glam, CF7 7DU, for an updated version of this module."
H�
EQUB 0
H�	ALIGN
H�;
H�L; **********************************************************************
H�L; *    The following routines are string handling routines swi calls   *
IL; **********************************************************************
I;
I; r0 = full string
I ;
I*
; returns
I4;
I>; r1 = leaf of string
IH;
IR.swigetleaf
I\   STMFD (sp)!,{r0}
If   MOV   r8,r0
Ip.swigetleaf1
Iz   LDRB  r9,[r0],#1
I�   TEQ   r9,#�"."
I�   �Q r8,r0
I�   CMP   r9,#&20
I�   BGT   swigetleaf1
I�   MOV   r1,r8
I�   LDMFD (sp)!,{r0}
I�   B     exitswi
I�;
I�L; **********************************************************************
I�L; *    The following routines are general string handling routines     *
I�L; **********************************************************************
I�;
I�; COMPARESTR
J; ----------
J;
JC; This routine compares two strings are returns � if equal or �
J$; if not
J.;
J8; r9  = string 1
JB; r10 = string 2
JL;
JV
; returns
J`;
Jj; r11 = result
Jt;
J~.comparestr
J�)   STMFD (sp)!,{r0,r1,r2,r9,r10,link}
J�   MOV   r2,#32
J�.comparestr1
J�   LDRB  r0,[r9],#1
J�   LDRB  r1,[r10],#1
J�   CMP   r0,r2
J�   CMPLT r1,r2
J�   MVNLT r11,#0
J�   BLT   compareout
J�   CMP   r0,r1
J�   BEQ   comparestr1
J�   MOV   r11,#0
K.compareout
K
'   LDMFD (sp)!,{r0,r1,r2,r9,r10,pc}
K;
K; CHECKCHAR
K(; ---------
K2;
K<H; This routine tests to see whether a certain character is contained
KF; within the string
KP;
KZ; r9  = string
Kd; r11 = character
Kn;
Kx
; returns
K�4; r11 = -1 if string contains character 0 if not
K�;
K�.checkchar
K�"   STMFD (sp)!,{r0,r1,r9,link}
K�   MOV   r1,r11
K�   MVN   r11,#0
K�.checkchar1
K�   LDRB  r0,[r9],#1
K�   TEQ   r0,r1
K�   �Q r11,#0
K�   CMP   r0,#32
K�   BGE   checkchar1
K�    LDMFD (sp)!,{r0,r1,r9,pc}
L;
L; �LEAF
L
; -------
L";
L,K; This routine returns r9 pointing to the leaf of the string pointed to
L6; by r9
L@;
LJ; r9  = string
LT;
L^
; returns
Lh; r9  = leaf of string
Lr;
L|.getleaf
L�   STMFD (sp)!,{r0,r1,link}
L�H   MOV   r1,r9                         ; store start of screen in r1
L�
.getleaf1
L�H   LDRB  r0,[r9],#1                    ; get a character and r9=r9+1
L�4   TEQ   r0,#�"."                    ; is it a .
L�H   �Q r1,r9                         ; put r1=r9 (character after . )
L�;   CMP   r0,#32                        ; end of string?
L�E   BGE   getleaf1                      ; no  - get next character
L�M   MOV   r9,r1                         ; yes - put r9=r1 <either start of
L�J   LDMFD (sp)!,{r0,r1,pc}              ; string or start of leaf name>
L�;
L�; COUNTSPECIAL
L�; ------------
M;
MM; Counts the characters in a string up to but not including the character
M; in r10
M&;
M0; r9  = source string
M:!; r10 = character to count to
MD(; r11 = number of characters counted
MN;
MX.countspecial
Mb   STMFD (sp)!,{r0,link}
Ml   MOV   r11,#0
Mv.counts1
M�   LDRB  r0,[r9],#1
M�   CMP   r0,#32
M�   �RLT r11,r11,#&100
M�   BLT   countsout
M�   TEQ   r0,r10
M�   ADDNE r11,r11,#1
M�   BNE   counts1
M�.countsout
M�   LDMFD (sp)!,{r0,pc}
M�;
M�; COPYCHARS
M�; ---------
M�;
NI; Copies r11 characters from the string pointed to by r9 to the block
ND; pointed to by r10 ending the string with a NULL character (�0)
N;
N ; r9  = source string
N*; r10 = destination string
N4(; r11 = number of characters to copy
N>;
NH.copychars
NR   STMFD (sp)!,{r0,link}
N\.copychar1
Nf   LDRB  r0,[r9],#1
Np   STRB  r0,[r10],#1
Nz   SUBS  r11,r11,#1
N�   BNE   copychar1
N�   STRB  r11,[r10,#0]
N�   LDMFD (sp)!,{r0,pc}
N�;
N�; COPYSTRING
N�; ----------
N�;
N�M; Copies the string pointed to by r9 to the block pointed to by r10.  The
N�M; maximum size of the string is held in r11.  If the string at r9 exceeds
N�/; this then only r11 characters are copied.
N�;
N�M; r9  = source string ending in a character value of < 32 ie control char
N�G; r10 = destination block.  It ends string in a NULL (�0) character
O!; r11 = maximum string length
O;
O&; returns the following parameters
O$0; r10 = byte after end of destination string
O.#; r11 = length of string copied
O8;
OB.copystring
OL   STMFD (sp)!,{r0,r1,link}
OV   MOV   r0,#0
O`
.copystr1
Oj   LDRB  r1,[r9,r0]
Ot   STRB  r1,[r10,r0]
O~   ADD   r0,r0,#1
O�   CMP   r0,r11
O�   BGE   copystr2
O�   CMP   r1,#32
O�   BGE   copystr1
O�
.copystr2
O�   MOV   r1,#0
O�   STRB  r1,[r10,r0]
O�   ADD   r11,r0,#1
O�   ADD   r10,r10,r11
O�   LDMFD (sp)!,{r0,r1,pc}
O�;
O�; COUNTCHARS
P; ----------
P
;
PJ; The routine counts the number of characters in the string at R9.  It
PO; counts all characters up to but not including the first control character
P(; ie character < 32
P2;
P<; r9  = source string
PF;
PP
; returns
PZ; r11 = length of string
Pd;
Pn.countchars
Px   STMFD (sp)!,{r0,link}
P�   MOV   r11,#0
P�.count1
P�   LDRB  r0,[r9,r11]
P�   CMP   r0,#32
P�   BLT   count2
P�   ADD   r11,r11,#1
P�   CMP   r11,#255
P�   BLT   count1
P�   LDMFD (sp)!,{r0,link}
P�   ADR   r0,toolong
P�   �R   link,link,#1<<28
P�   MOVS  pc,link
P�.count2
Q   LDMFD (sp)!,{r0,pc}
Q;
Q.toolong
Q"EQUD ErrorBase+2
Q,.EQUS "Text string is too long for WimpLib"
Q6
EQUB 0
Q@	ALIGN
QJ;
QT.toofar
Q^   SWI   "OS_WriteS"
Qh2EQUS "Jump's gone too far!!!!!!!!!!!!!!!!!!!!"
Qr
EQUB 0
Q|	ALIGN
Q�   LDMFD (sp)!,{pc}
Q�;
Q�]
Q�� pass%
Q�)� "Save WimpTools "+�~store%+" "+�~O%
Q�*SETTYPE WimpTools module
Q��
�
00000000  0d 00 0a 11 f4 20 3e 57  6d 70 4c 62 5f 43 6f 64  |..... >WmpLb_Cod|
00000010  65 0d 00 14 14 f4 20 28  63 29 20 4d 61 74 74 20  |e..... (c) Matt |
00000020  4c 65 77 69 73 0d 00 1e  05 f4 0d 00 28 05 f4 0d  |Lewis.......(...|
00000030  00 32 1f ee 20 85 20 85  20 a2 20 9e 2c f6 24 2b  |.2.. . . . .,.$+|
00000040  22 20 61 74 20 6c 69 6e  65 20 22 2b c3 9e 0d 00  |" at line "+....|
00000050  3c 05 3a 0d 00 46 06 eb  30 0d 00 50 13 64 61 74  |<.:..F..0..P.dat|
00000060  65 24 3d c1 91 24 2c 35  2c 31 31 29 0d 00 5a 14  |e$=..$,5,11)..Z.|
00000070  53 77 69 4e 75 6d 62 65  72 3d 26 34 37 43 38 30  |SwiNumber=&47C80|
00000080  0d 00 64 15 45 72 72 6f  72 42 61 73 65 3d 26 38  |..d.ErrorBase=&8|
00000090  30 39 42 30 30 0d 00 6e  0c 62 6c 6b 3d 26 34 30  |09B00..n.blk=&40|
000000a0  30 0d 00 78 12 de 20 73  74 6f 72 65 25 20 26 32  |0..x.. store% &2|
000000b0  30 30 30 0d 00 82 09 77  73 3d 31 32 0d 00 8c 09  |000....ws=12....|
000000c0  73 70 3d 31 33 0d 00 96  0b 6c 69 6e 6b 3d 31 34  |sp=13....link=14|
000000d0  0d 00 a0 09 70 63 3d 31  35 0d 00 aa 05 3a 0d 00  |....pc=15....:..|
000000e0  b4 0b 74 61 73 6b 73 3d  30 0d 00 be 11 61 63 74  |..tasks=0....act|
000000f0  69 76 65 74 61 73 6b 73  3d 34 0d 00 c8 05 3a 0d  |ivetasks=4....:.|
00000100  00 d2 15 e3 20 70 61 73  73 25 3d 34 20 b8 20 37  |.... pass%=4 . 7|
00000110  20 88 20 33 0d 00 dc 0d  4f 25 3d 73 74 6f 72 65  | . 3....O%=store|
00000120  25 0d 00 e6 08 50 25 3d  30 0d 00 f0 0f 5b 20 4f  |%....P%=0....[ O|
00000130  50 54 20 70 61 73 73 25  0d 00 fa 05 3b 0d 01 04  |PT pass%....;...|
00000140  4e 3b 20 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |N; *************|
00000150  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000180  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 0d 01 0e 4c 3b  |***********...L;|
00000190  20 2a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  | *              |
000001a0  20 20 20 20 20 20 20 20  20 20 20 20 20 83 55 4c  |             .UL|
000001b0  45 20 48 45 41 44 45 52  20 43 4f 44 45 20 20 20  |E HEADER CODE   |
000001c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000001d0  20 20 20 20 20 20 2a 0d  01 18 4e 3b 20 2a 2a 2a  |      *...N; ***|
000001e0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000220  2a 2a 2a 2a 2a 0d 01 22  05 3b 0d 01 2c 0a 2e 73  |*****..".;..,..s|
00000230  74 61 72 74 0d 01 36 34  45 51 55 44 20 30 20 20  |tart..64EQUD 0  |
00000240  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000250  20 20 20 20 20 20 20 20  3b 20 20 73 74 61 72 74  |        ;  start|
00000260  20 75 70 20 63 6f 64 65  0d 01 40 3a 45 51 55 44  | up code..@:EQUD|
00000270  20 69 6e 69 74 6d 6f 64  20 20 20 20 20 20 20 20  | initmod        |
00000280  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 20 69  |            ;  i|
00000290  6e 69 74 69 61 6c 69 73  61 74 69 6f 6e 20 63 6f  |nitialisation co|
000002a0  64 65 0d 01 4a 38 45 51  55 44 20 66 69 6e 69 73  |de..J8EQUD finis|
000002b0  68 6d 6f 64 20 20 20 20  20 20 20 20 20 20 20 20  |hmod            |
000002c0  20 20 20 20 20 20 3b 20  20 66 69 6e 61 6c 69 73  |      ;  finalis|
000002d0  61 74 69 6f 6e 20 63 6f  64 65 0d 01 54 3a 45 51  |ation code..T:EQ|
000002e0  55 44 20 30 20 20 20 20  20 20 20 20 20 20 20 20  |UD 0            |
000002f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00000300  20 73 65 72 76 69 63 65  20 6d 6f 64 75 6c 65 20  | service module |
00000310  63 6f 64 65 0d 01 5e 3a  45 51 55 44 20 74 69 74  |code..^:EQUD tit|
00000320  6c 65 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |le              |
00000330  20 20 20 20 20 20 20 20  3b 20 20 6d 6f 64 75 6c  |        ;  modul|
00000340  65 20 74 69 74 6c 65 20  73 74 72 69 6e 67 0d 01  |e title string..|
00000350  68 39 45 51 55 44 20 68  65 6c 70 73 74 20 20 20  |h9EQUD helpst   |
00000360  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000370  20 20 3b 20 20 6d 6f 64  75 6c 65 20 68 65 6c 70  |  ;  module help|
00000380  20 73 74 72 69 6e 67 0d  01 72 3d 45 51 55 44 20  | string..r=EQUD |
00000390  30 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |0               |
000003a0  20 20 20 20 20 20 20 20  20 20 20 3b 20 20 68 65  |           ;  he|
000003b0  6c 70 20 61 6e 64 20 63  6f 6d 6d 61 6e 64 20 74  |lp and command t|
000003c0  61 62 6c 65 0d 01 7c 36  45 51 55 44 20 53 77 69  |able..|6EQUD Swi|
000003d0  4e 75 6d 62 65 72 20 20  20 20 20 20 20 20 20 20  |Number          |
000003e0  20 20 20 20 20 20 20 20  3b 20 20 73 77 69 20 62  |        ;  swi b|
000003f0  61 73 65 20 6e 75 6d 62  65 72 0d 01 86 38 45 51  |ase number...8EQ|
00000400  55 44 20 73 77 69 63 6f  64 65 20 20 20 20 20 20  |UD swicode      |
00000410  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00000420  20 73 77 69 20 68 61 6e  64 6c 69 6e 67 20 63 6f  | swi handling co|
00000430  64 65 0d 01 90 39 45 51  55 44 20 73 77 69 74 61  |de...9EQUD swita|
00000440  62 6c 65 20 20 20 20 20  20 20 20 20 20 20 20 20  |ble             |
00000450  20 20 20 20 20 20 3b 20  20 73 77 69 20 64 65 63  |      ;  swi dec|
00000460  6f 64 69 6e 67 20 74 61  62 6c 65 0d 01 9a 38 45  |oding table...8E|
00000470  51 55 44 20 30 20 20 20  20 20 20 20 20 20 20 20  |QUD 0           |
00000480  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00000490  20 20 73 77 69 20 64 65  63 6f 64 69 6e 67 20 63  |  swi decoding c|
000004a0  6f 64 65 0d 01 a4 05 3b  0d 01 ae 4e 3b 20 2a 2a  |ode....;...N; **|
000004b0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
000004f0  2a 2a 2a 2a 2a 2a 0d 01  b8 4c 3b 20 2a 20 20 20  |******...L; *   |
00000500  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000510  20 20 20 20 20 20 20 20  83 55 4c 45 20 53 55 50  |        .ULE SUP|
00000520  50 4f 52 54 20 43 4f 44  45 20 20 20 20 20 20 20  |PORT CODE       |
00000530  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000540  20 2a 0d 01 c2 4e 3b 20  2a 2a 2a 2a 2a 2a 2a 2a  | *...N; ********|
00000550  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000590  0d 01 cc 05 3b 0d 01 d6  0a 2e 74 69 74 6c 65 0d  |....;.....title.|
000005a0  01 e0 14 45 51 55 53 20  22 57 69 6d 70 54 6f 6f  |...EQUS "WimpToo|
000005b0  6c 73 22 0d 01 ea 0a 45  51 55 42 20 30 0d 01 f4  |ls"....EQUB 0...|
000005c0  09 41 4c 49 47 4e 0d 01  fe 0b 2e 68 65 6c 70 73  |.ALIGN.....helps|
000005d0  74 0d 02 08 15 45 51 55  53 20 22 57 69 6d 70 20  |t....EQUS "Wimp |
000005e0  54 6f 6f 6c 73 22 0d 02  12 0a 45 51 55 42 20 39  |Tools"....EQUB 9|
000005f0  0d 02 1c 40 45 51 55 53  20 22 31 2e 34 33 20 28  |...@EQUS "1.43 (|
00000600  22 2b 64 61 74 65 24 2b  22 29 20 62 79 20 4d 61  |"+date$+") by Ma|
00000610  74 74 20 4c 65 77 69 73  20 a9 20 57 65 69 72 64  |tt Lewis . Weird|
00000620  20 53 68 65 65 70 20 53  6f 66 74 77 61 72 65 22  | Sheep Software"|
00000630  0d 02 26 0a 45 51 55 42  20 30 0d 02 30 09 41 4c  |..&.EQUB 0..0.AL|
00000640  49 47 4e 0d 02 3a 09 41  4c 49 47 4e 0d 02 44 05  |IGN..:.ALIGN..D.|
00000650  3b 0d 02 4e 3d 2e 69 6e  69 74 6d 6f 64 20 20 20  |;..N=.initmod   |
00000660  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000670  20 20 20 20 20 3b 20 73  65 74 20 75 70 20 6d 6f  |     ; set up mo|
00000680  64 75 6c 65 20 61 6e 64  20 63 6c 61 69 6d 0d 02  |dule and claim..|
00000690  58 36 20 20 20 53 54 4d  46 44 20 28 73 70 29 21  |X6   STMFD (sp)!|
000006a0  2c 7b 6c 69 6e 6b 7d 20  20 20 20 20 20 20 20 20  |,{link}         |
000006b0  20 20 3b 20 6d 6f 64 75  6c 65 20 77 6f 72 6b 73  |  ; module works|
000006c0  70 61 63 65 0d 02 62 12  20 20 20 4d 4f 56 20 20  |pace..b.   MOV  |
000006d0  20 72 31 2c 77 73 0d 02  6c 14 20 20 20 4c 44 52  | r1,ws..l.   LDR|
000006e0  20 20 20 77 73 2c 5b 77  73 5d 0d 02 76 3c 20 20  |   ws,[ws]..v<  |
000006f0  20 43 4d 50 20 20 20 77  73 2c 23 30 20 20 20 20  | CMP   ws,#0    |
00000700  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00000710  61 72 65 20 77 65 20 61  6c 72 65 61 64 79 20 61  |are we already a|
00000720  63 74 69 76 65 3f 0d 02  80 19 20 20 20 4c 44 4d  |ctive?....   LDM|
00000730  4e 45 46 44 20 28 73 70  29 21 2c 7b 70 63 7d 0d  |NEFD (sp)!,{pc}.|
00000740  02 8a 12 20 20 20 4d 4f  56 20 20 20 72 30 2c 23  |...   MOV   r0,#|
00000750  36 0d 02 94 37 20 20 20  4d 4f 56 20 20 20 72 33  |6...7   MOV   r3|
00000760  2c 23 26 38 30 30 20 20  20 20 20 20 20 20 20 20  |,#&800          |
00000770  20 20 20 20 20 3b 20 63  6c 61 69 6d 20 73 70 61  |     ; claim spa|
00000780  63 65 20 6f 66 20 32 4b  0d 02 9e 18 20 20 20 53  |ce of 2K....   S|
00000790  57 49 20 20 20 22 4f 53  5f 4d 6f 64 75 6c 65 22  |WI   "OS_Module"|
000007a0  0d 02 a8 14 20 20 20 53  54 52 20 20 20 72 32 2c  |....   STR   r2,|
000007b0  5b 72 31 5d 0d 02 b2 12  20 20 20 4d 4f 56 20 20  |[r1]....   MOV  |
000007c0  20 72 30 2c 23 30 0d 02  bc 47 20 20 20 53 54 52  | r0,#0...G   STR|
000007d0  20 20 20 72 30 2c 5b 72  32 5d 20 20 20 20 20 20  |   r0,[r2]      |
000007e0  20 20 20 20 20 20 20 20  20 20 3b 20 63 6c 65 61  |          ; clea|
000007f0  72 20 6e 75 6d 62 65 72  20 6f 66 20 61 63 74 69  |r number of acti|
00000800  76 65 20 74 61 73 6b 73  20 74 6f 20 30 0d 02 c6  |ve tasks to 0...|
00000810  3d 20 20 20 53 54 52 20  20 20 72 30 2c 5b 72 32  |=   STR   r0,[r2|
00000820  2c 23 34 5d 20 20 20 20  20 20 20 20 20 20 20 20  |,#4]            |
00000830  20 3b 20 63 6c 65 61 72  20 61 63 74 69 76 65 20  | ; clear active |
00000840  74 61 73 6b 20 66 6c 61  67 73 0d 02 d0 17 20 20  |task flags....  |
00000850  20 4c 44 4d 46 44 20 28  73 70 29 21 2c 7b 70 63  | LDMFD (sp)!,{pc|
00000860  7d 0d 02 da 05 3b 0d 02  e4 45 2e 66 69 6e 69 73  |}....;...E.finis|
00000870  68 6d 6f 64 20 20 20 20  20 20 20 20 20 20 20 20  |hmod            |
00000880  20 20 20 20 20 20 20 20  20 20 3b 20 73 68 75 74  |          ; shut|
00000890  20 64 6f 77 6e 20 6d 6f  64 75 6c 65 20 61 6e 64  | down module and|
000008a0  20 72 65 6c 69 6e 71 75  69 73 68 0d 02 ee 39 20  | relinquish...9 |
000008b0  20 20 53 54 4d 46 44 20  28 73 70 29 21 2c 7b 6c  |  STMFD (sp)!,{l|
000008c0  69 6e 6b 7d 20 20 20 20  20 20 20 20 20 20 20 3b  |ink}           ;|
000008d0  20 6d 6f 64 75 6c 65 20  6d 65 6d 6f 72 79 20 73  | module memory s|
000008e0  70 61 63 65 0d 02 f8 13  20 20 20 54 45 51 20 20  |pace....   TEQ  |
000008f0  20 72 31 30 2c 23 30 0d  03 02 19 20 20 20 4c 44  | r10,#0....   LD|
00000900  4d 45 51 46 44 20 28 73  70 29 21 2c 7b 70 63 7d  |MEQFD (sp)!,{pc}|
00000910  0d 03 0c 14 20 20 20 4c  44 52 20 20 20 77 73 2c  |....   LDR   ws,|
00000920  5b 77 73 5d 0d 03 16 47  20 20 20 4c 44 52 20 20  |[ws]...G   LDR  |
00000930  20 72 30 2c 5b 77 73 5d  20 20 20 20 20 20 20 20  | r0,[ws]        |
00000940  20 20 20 20 20 20 20 20  3b 20 63 68 65 63 6b 20  |        ; check |
00000950  61 6e 79 20 74 61 73 6b  73 20 75 73 69 6e 67 20  |any tasks using |
00000960  74 68 69 73 20 6d 6f 64  75 6c 65 0d 03 20 42 20  |this module.. B |
00000970  20 20 54 45 51 20 20 20  72 30 2c 23 30 20 20 20  |  TEQ   r0,#0   |
00000980  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00000990  20 69 66 20 73 6f 20 72  65 6c 69 6e 71 75 69 73  | if so relinquis|
000009a0  68 20 74 68 65 69 72 20  73 70 61 63 65 0d 03 2a  |h their space..*|
000009b0  17 20 20 20 42 45 51 20  20 20 66 69 6e 69 73 68  |.   BEQ   finish|
000009c0  6d 6f 64 32 0d 03 34 17  20 20 20 4c 44 52 20 20  |mod2..4.   LDR  |
000009d0  20 72 31 2c 5b 77 73 2c  23 34 5d 0d 03 3e 12 20  | r1,[ws,#4]..>. |
000009e0  20 20 4d 4f 56 20 20 20  72 33 2c 23 31 0d 03 48  |  MOV   r3,#1..H|
000009f0  3f 20 20 20 41 44 44 20  20 20 72 34 2c 77 73 2c  |?   ADD   r4,ws,|
00000a00  23 33 32 20 20 20 20 20  20 20 20 20 20 20 20 20  |#32             |
00000a10  20 3b 20 64 61 74 61 20  73 74 61 72 74 73 20 61  | ; data starts a|
00000a20  74 20 62 6c 6f 63 6b 20  2b 20 33 32 0d 03 52 12  |t block + 32..R.|
00000a30  20 20 20 4d 4f 56 20 20  20 72 30 2c 23 37 0d 03  |   MOV   r0,#7..|
00000a40  5c 0f 2e 66 69 6e 69 73  68 6d 6f 64 31 0d 03 66  |\..finishmod1..f|
00000a50  41 20 20 20 54 53 54 20  20 20 72 31 2c 72 33 20  |A   TST   r1,r3 |
00000a60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000a70  20 3b 20 69 73 20 74 68  65 20 62 69 74 20 73 65  | ; is the bit se|
00000a80  74 20 69 6e 20 74 68 65  20 66 6c 61 67 3f 0d 03  |t in the flag?..|
00000a90  70 18 20 20 20 42 4e 45  20 20 20 66 69 6e 69 73  |p.   BNE   finis|
00000aa0  68 6d 6f 64 31 61 0d 03  7a 3a 20 20 20 41 44 44  |hmod1a..z:   ADD|
00000ab0  20 20 20 72 34 2c 72 34  2c 23 33 32 20 20 20 20  |   r4,r4,#32    |
00000ac0  20 20 20 20 20 20 20 20  20 20 3b 20 6e 6f 20 2d  |          ; no -|
00000ad0  20 67 6f 74 6f 20 6e 65  78 74 20 62 6c 6f 63 6b  | goto next block|
00000ae0  0d 03 84 18 20 20 20 4d  4f 56 20 20 20 72 33 2c  |....   MOV   r3,|
00000af0  72 33 2c 4c 53 4c 23 31  0d 03 8e 4e 20 20 20 54  |r3,LSL#1...N   T|
00000b00  53 54 20 20 20 72 33 2c  23 31 3c 3c 33 31 20 20  |ST   r3,#1<<31  |
00000b10  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 69 73  |            ; is|
00000b20  20 69 74 20 62 69 74 20  33 31 20 2d 20 69 6c 6c  | it bit 31 - ill|
00000b30  65 67 61 6c 20 74 68 65  72 65 66 6f 72 65 20 6e  |egal therefore n|
00000b40  6f 20 6d 6f 72 65 0d 03  98 17 20 20 20 42 45 51  |o more....   BEQ|
00000b50  20 20 20 66 69 6e 69 73  68 6d 6f 64 31 0d 03 a2  |   finishmod1...|
00000b60  17 20 20 20 42 20 20 20  20 20 66 69 6e 69 73 68  |.   B     finish|
00000b70  6d 6f 64 32 0d 03 ac 10  2e 66 69 6e 69 73 68 6d  |mod2.....finishm|
00000b80  6f 64 31 61 0d 03 b6 31  20 20 20 4d 4f 56 20 20  |od1a...1   MOV  |
00000b90  20 72 35 2c 23 30 20 20  20 20 20 20 20 20 20 20  | r5,#0          |
00000ba0  20 20 20 20 20 20 20 20  3b 20 62 6c 6f 63 6b 73  |        ; blocks|
00000bb0  20 75 73 65 64 0d 03 c0  12 2e 66 69 6e 69 73 68  | used.....finish|
00000bc0  6d 6f 64 6c 6f 6f 70 0d  03 ca 17 20 20 20 4c 44  |modloop....   LD|
00000bd0  52 20 20 20 72 32 2c 5b  72 34 2c 72 35 5d 0d 03  |R   r2,[r4,r5]..|
00000be0  d4 12 20 20 20 54 45 51  20 20 20 72 32 2c 23 30  |..   TEQ   r2,#0|
00000bf0  0d 03 de 4b 20 20 20 53  57 49 4e 45 20 22 58 4f  |...K   SWINE "XO|
00000c00  53 5f 4d 6f 64 75 6c 65  22 20 20 20 20 20 20 20  |S_Module"       |
00000c10  20 20 20 20 3b 20 61 6e  79 20 61 6c 6c 6f 63 61  |    ; any alloca|
00000c20  74 65 64 20 2d 20 69 66  20 73 6f 20 72 65 6c 65  |ted - if so rele|
00000c30  61 73 65 20 6d 65 6d 6f  72 79 21 0d 03 e8 15 20  |ase memory!.... |
00000c40  20 20 41 44 44 20 20 20  72 35 2c 72 35 2c 23 34  |  ADD   r5,r5,#4|
00000c50  0d 03 f2 13 20 20 20 54  45 51 20 20 20 72 35 2c  |....   TEQ   r5,|
00000c60  23 33 32 0d 03 fc 1a 20  20 20 42 4e 45 20 20 20  |#32....   BNE   |
00000c70  66 69 6e 69 73 68 6d 6f  64 6c 6f 6f 70 0d 04 06  |finishmodloop...|
00000c80  0f 2e 66 69 6e 69 73 68  6d 6f 64 32 0d 04 10 12  |..finishmod2....|
00000c90  20 20 20 4d 4f 56 20 20  20 72 30 2c 23 37 0d 04  |   MOV   r0,#7..|
00000ca0  1a 12 20 20 20 4d 4f 56  20 20 20 72 32 2c 77 73  |..   MOV   r2,ws|
00000cb0  0d 04 24 18 20 20 20 53  57 49 20 20 20 22 4f 53  |..$.   SWI   "OS|
00000cc0  5f 4d 6f 64 75 6c 65 22  0d 04 2e 17 20 20 20 4c  |_Module"....   L|
00000cd0  44 4d 46 44 20 28 73 70  29 21 2c 7b 70 63 7d 0d  |DMFD (sp)!,{pc}.|
00000ce0  04 38 05 3b 0d 04 42 4e  3b 20 2a 2a 2a 2a 2a 2a  |.8.;..BN; ******|
00000cf0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000d30  2a 2a 0d 04 4c 4e 3b 20  2a 20 20 20 20 20 20 20  |**..LN; *       |
00000d40  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000d50  20 20 20 20 20 20 20 20  53 57 49 20 48 41 4e 44  |        SWI HAND|
00000d60  4c 45 52 20 20 20 20 20  20 20 20 20 20 20 20 20  |LER             |
00000d70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 2a  |               *|
00000d80  0d 04 56 4e 3b 20 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |..VN; **********|
00000d90  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000dc0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 0d 04  |**************..|
00000dd0  60 05 3b 0d 04 6a 43 2e  73 77 69 74 61 62 6c 65  |`.;..jC.switable|
00000de0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000df0  20 20 20 20 20 20 20 3b  20 74 61 62 6c 65 20 6f  |       ; table o|
00000e00  66 20 73 77 69 20 6e 61  6d 65 73 20 72 65 63 6f  |f swi names reco|
00000e10  67 6e 69 73 65 64 0d 04  74 34 45 51 55 53 20 22  |gnised..t4EQUS "|
00000e20  57 53 57 69 6d 70 54 6f  6f 6c 73 22 20 20 20 20  |WSWimpTools"    |
00000e30  20 20 20 20 20 20 20 20  20 20 3b 20 62 79 20 74  |          ; by t|
00000e40  68 69 73 20 6d 6f 64 75  6c 65 0d 04 7e 0a 45 51  |his module..~.EQ|
00000e50  55 42 20 30 0d 04 88 12  45 51 55 53 20 22 56 65  |UB 0....EQUS "Ve|
00000e60  72 73 69 6f 6e 22 0d 04  92 0a 45 51 55 42 20 30  |rsion"....EQUB 0|
00000e70  0d 04 9c 13 45 51 55 53  20 22 54 61 73 6b 49 63  |....EQUS "TaskIc|
00000e80  6f 6e 22 0d 04 a6 0a 45  51 55 42 20 30 0d 04 b0  |on"....EQUB 0...|
00000e90  18 45 51 55 53 20 22 50  6f 70 4f 70 65 6e 57 69  |.EQUS "PopOpenWi|
00000ea0  6e 64 6f 77 22 0d 04 ba  0a 45 51 55 42 20 30 0d  |ndow"....EQUB 0.|
00000eb0  04 c4 19 45 51 55 53 20  22 4f 70 65 6e 50 61 6e  |...EQUS "OpenPan|
00000ec0  65 57 69 6e 64 6f 77 22  0d 04 ce 0a 45 51 55 42  |eWindow"....EQUB|
00000ed0  20 30 0d 04 d8 1c 45 51  55 53 20 22 50 6f 70 4f  | 0....EQUS "PopO|
00000ee0  70 65 6e 50 61 6e 65 57  69 6e 64 6f 77 22 0d 04  |penPaneWindow"..|
00000ef0  e2 0a 45 51 55 42 20 30  0d 04 ec 16 45 51 55 53  |..EQUB 0....EQUS|
00000f00  20 22 43 6c 6f 73 65 57  69 6e 64 6f 77 22 0d 04  | "CloseWindow"..|
00000f10  f6 0a 45 51 55 42 20 30  0d 05 00 15 45 51 55 53  |..EQUB 0....EQUS|
00000f20  20 22 54 6f 67 67 6c 65  49 63 6f 6e 22 0d 05 0a  | "ToggleIcon"...|
00000f30  0a 45 51 55 42 20 30 0d  05 14 18 45 51 55 53 20  |.EQUB 0....EQUS |
00000f40  22 53 65 74 49 63 6f 6e  53 65 6c 65 63 74 22 0d  |"SetIconSelect".|
00000f50  05 1e 0a 45 51 55 42 20  30 0d 05 28 1d 45 51 55  |...EQUB 0..(.EQU|
00000f60  53 20 22 47 65 74 49 63  6f 6e 53 65 6c 65 63 74  |S "GetIconSelect|
00000f70  53 74 61 74 65 22 0d 05  32 0a 45 51 55 42 20 30  |State"..2.EQUB 0|
00000f80  0d 05 3c 18 45 51 55 53  20 22 53 65 74 49 63 6f  |..<.EQUS "SetIco|
00000f90  6e 45 6e 61 62 6c 65 22  0d 05 46 0a 45 51 55 42  |nEnable"..F.EQUB|
00000fa0  20 30 0d 05 50 1d 45 51  55 53 20 22 47 65 74 49  | 0..P.EQUS "GetI|
00000fb0  63 6f 6e 45 6e 61 62 6c  65 53 74 61 74 65 22 0d  |conEnableState".|
00000fc0  05 5a 0a 45 51 55 42 20  30 0d 05 64 16 45 51 55  |.Z.EQUB 0..d.EQU|
00000fd0  53 20 22 53 65 74 49 63  6f 6e 54 65 78 74 22 0d  |S "SetIconText".|
00000fe0  05 6e 0a 45 51 55 42 20  30 0d 05 78 16 45 51 55  |.n.EQUB 0..x.EQU|
00000ff0  53 20 22 47 65 74 49 63  6f 6e 54 65 78 74 22 0d  |S "GetIconText".|
00001000  05 82 0a 45 51 55 42 20  30 0d 05 8c 1c 45 51 55  |...EQUB 0....EQU|
00001010  53 20 22 53 65 74 49 63  6f 6e 56 61 6c 69 64 61  |S "SetIconValida|
00001020  74 69 6f 6e 22 0d 05 96  0a 45 51 55 42 20 30 0d  |tion"....EQUB 0.|
00001030  05 a0 1c 45 51 55 53 20  22 47 65 74 49 63 6f 6e  |...EQUS "GetIcon|
00001040  56 61 6c 69 64 61 74 69  6f 6e 22 0d 05 aa 0a 45  |Validation"....E|
00001050  51 55 42 20 30 0d 05 b4  19 45 51 55 53 20 22 53  |QUB 0....EQUS "S|
00001060  65 74 57 69 6e 64 6f 77  54 69 74 6c 65 22 0d 05  |etWindowTitle"..|
00001070  be 0a 45 51 55 42 20 30  0d 05 c8 19 45 51 55 53  |..EQUB 0....EQUS|
00001080  20 22 47 65 74 57 69 6e  64 6f 77 54 69 74 6c 65  | "GetWindowTitle|
00001090  22 0d 05 d2 0a 45 51 55  42 20 30 0d 05 dc 17 45  |"....EQUB 0....E|
000010a0  51 55 53 20 22 55 70 64  61 74 65 57 69 6e 64 6f  |QUS "UpdateWindo|
000010b0  77 22 0d 05 e6 0a 45 51  55 42 20 30 0d 05 f0 19  |w"....EQUB 0....|
000010c0  45 51 55 53 20 22 4d 61  6b 65 4d 65 6e 75 48 65  |EQUS "MakeMenuHe|
000010d0  61 64 65 72 22 0d 05 fa  0a 45 51 55 42 20 30 0d  |ader"....EQUB 0.|
000010e0  06 04 17 45 51 55 53 20  22 4d 61 6b 65 4d 65 6e  |...EQUS "MakeMen|
000010f0  75 49 74 65 6d 22 0d 06  0e 0a 45 51 55 42 20 30  |uItem"....EQUB 0|
00001100  0d 06 18 1a 45 51 55 53  20 22 53 65 74 4d 65 6e  |....EQUS "SetMen|
00001110  75 49 74 65 6d 54 65 78  74 22 0d 06 22 0a 45 51  |uItemText"..".EQ|
00001120  55 42 20 30 0d 06 2c 1a  45 51 55 53 20 22 47 65  |UB 0..,.EQUS "Ge|
00001130  74 4d 65 6e 75 49 74 65  6d 54 65 78 74 22 0d 06  |tMenuItemText"..|
00001140  36 0a 45 51 55 42 20 30  0d 06 40 1b 45 51 55 53  |6.EQUB 0..@.EQUS|
00001150  20 22 4d 61 6b 65 4d 65  6e 75 49 74 65 6d 4c 61  | "MakeMenuItemLa|
00001160  73 74 22 0d 06 4a 0a 45  51 55 42 20 30 0d 06 54  |st"..J.EQUB 0..T|
00001170  1a 45 51 55 53 20 22 53  65 74 4d 65 6e 75 49 74  |.EQUS "SetMenuIt|
00001180  65 6d 54 69 63 6b 22 0d  06 5e 0a 45 51 55 42 20  |emTick"..^.EQUB |
00001190  30 0d 06 68 1a 45 51 55  53 20 22 47 65 74 4d 65  |0..h.EQUS "GetMe|
000011a0  6e 75 49 74 65 6d 54 69  63 6b 22 0d 06 72 0a 45  |nuItemTick"..r.E|
000011b0  51 55 42 20 30 0d 06 7c  1d 45 51 55 53 20 22 53  |QUB 0..|.EQUS "S|
000011c0  65 74 4d 65 6e 75 49 74  65 6d 4d 65 73 73 61 67  |etMenuItemMessag|
000011d0  65 22 0d 06 86 0a 45 51  55 42 20 30 0d 06 90 1d  |e"....EQUB 0....|
000011e0  45 51 55 53 20 22 47 65  74 4d 65 6e 75 49 74 65  |EQUS "GetMenuIte|
000011f0  6d 4d 65 73 73 61 67 65  22 0d 06 9a 0a 45 51 55  |mMessage"....EQU|
00001200  42 20 30 0d 06 a4 1c 45  51 55 53 20 22 53 65 74  |B 0....EQUS "Set|
00001210  4d 65 6e 75 49 74 65 6d  45 6e 61 62 6c 65 22 0d  |MenuItemEnable".|
00001220  06 ae 0a 45 51 55 42 20  30 0d 06 b8 1c 45 51 55  |...EQUB 0....EQU|
00001230  53 20 22 47 65 74 4d 65  6e 75 49 74 65 6d 45 6e  |S "GetMenuItemEn|
00001240  61 62 6c 65 22 0d 06 c2  0a 45 51 55 42 20 30 0d  |able"....EQUB 0.|
00001250  06 cc 1d 45 51 55 53 20  22 53 65 74 4d 65 6e 75  |...EQUS "SetMenu|
00001260  49 74 65 6d 4f 70 74 69  6f 6e 73 22 0d 06 d6 0a  |ItemOptions"....|
00001270  45 51 55 42 20 30 0d 06  e0 1d 45 51 55 53 20 22  |EQUB 0....EQUS "|
00001280  47 65 74 4d 65 6e 75 49  74 65 6d 4f 70 74 69 6f  |GetMenuItemOptio|
00001290  6e 73 22 0d 06 ea 0a 45  51 55 42 20 30 0d 06 f4  |ns"....EQUB 0...|
000012a0  18 45 51 55 53 20 22 41  74 74 61 63 68 53 75 62  |.EQUS "AttachSub|
000012b0  4d 65 6e 75 22 0d 06 fe  0a 45 51 55 42 20 30 0d  |Menu"....EQUB 0.|
000012c0  07 08 14 45 51 55 53 20  22 4c 6f 61 64 4d 65 6e  |...EQUS "LoadMen|
000012d0  75 73 22 0d 07 12 0a 45  51 55 42 20 30 0d 07 1c  |us"....EQUB 0...|
000012e0  16 45 51 55 53 20 22 49  63 6f 6e 42 61 72 4d 65  |.EQUS "IconBarMe|
000012f0  6e 75 22 0d 07 26 0a 45  51 55 42 20 30 0d 07 30  |nu"..&.EQUB 0..0|
00001300  15 45 51 55 53 20 22 4d  65 6e 75 41 64 6a 75 73  |.EQUS "MenuAdjus|
00001310  74 22 0d 07 3a 0a 45 51  55 42 20 30 0d 07 44 13  |t"..:.EQUB 0..D.|
00001320  45 51 55 53 20 22 4d 61  6b 65 4d 65 6e 75 22 0d  |EQUS "MakeMenu".|
00001330  07 4e 0a 45 51 55 42 20  30 0d 07 58 12 45 51 55  |.N.EQUB 0..X.EQU|
00001340  53 20 22 47 65 74 54 65  78 74 22 0d 07 62 0a 45  |S "GetText"..b.E|
00001350  51 55 42 20 30 0d 07 6c  14 45 51 55 53 20 22 53  |QUB 0..l.EQUS "S|
00001360  74 61 72 74 44 72 61 67  22 0d 07 76 0a 45 51 55  |tartDrag"..v.EQU|
00001370  42 20 30 0d 07 80 13 45  51 55 53 20 22 53 65 6e  |B 0....EQUS "Sen|
00001380  64 53 61 76 65 22 0d 07  8a 0a 45 51 55 42 20 30  |dSave"....EQUB 0|
00001390  0d 07 94 13 45 51 55 53  20 22 53 65 6e 64 4c 6f  |....EQUS "SendLo|
000013a0  61 64 22 0d 07 9e 0a 45  51 55 42 20 30 0d 07 a8  |ad"....EQUB 0...|
000013b0  16 45 51 55 53 20 22 53  65 6e 64 53 61 76 65 41  |.EQUS "SendSaveA|
000013c0  63 6b 22 0d 07 b2 0a 45  51 55 42 20 30 0d 07 bc  |ck"....EQUB 0...|
000013d0  16 45 51 55 53 20 22 53  65 6e 64 4c 6f 61 64 41  |.EQUS "SendLoadA|
000013e0  63 6b 22 0d 07 c6 0a 45  51 55 42 20 30 0d 07 d0  |ck"....EQUB 0...|
000013f0  18 45 51 55 53 20 22 4c  6f 61 64 54 65 6d 70 6c  |.EQUS "LoadTempl|
00001400  61 74 65 73 22 0d 07 da  0a 45 51 55 42 20 30 0d  |ates"....EQUB 0.|
00001410  07 e4 21 45 51 55 53 20  22 57 69 6e 64 6f 77 43  |..!EQUS "WindowC|
00001420  6f 6e 76 65 72 74 50 61  72 61 6d 65 74 65 72 22  |onvertParameter"|
00001430  0d 07 ee 0a 45 51 55 42  20 30 0d 07 f8 1a 45 51  |....EQUB 0....EQ|
00001440  55 53 20 22 47 65 74 54  65 6d 70 6c 61 74 65 49  |US "GetTemplateI|
00001450  6e 66 6f 22 0d 08 02 0a  45 51 55 42 20 30 0d 08  |nfo"....EQUB 0..|
00001460  0c 1c 45 51 55 53 20 22  4c 6f 73 65 54 65 6d 70  |..EQUS "LoseTemp|
00001470  6c 61 74 65 46 6f 6e 74  73 22 0d 08 16 0a 45 51  |lateFonts"....EQ|
00001480  55 42 20 30 0d 08 20 13  45 51 55 53 20 22 52 65  |UB 0.. .EQUS "Re|
00001490  67 69 73 74 65 72 22 0d  08 2a 0a 45 51 55 42 20  |gister"..*.EQUB |
000014a0  30 0d 08 34 15 45 51 55  53 20 22 44 65 52 65 67  |0..4.EQUS "DeReg|
000014b0  69 73 74 65 72 22 0d 08  3e 0a 45 51 55 42 20 30  |ister"..>.EQUB 0|
000014c0  0d 08 48 16 45 51 55 53  20 22 4c 6f 61 64 53 70  |..H.EQUS "LoadSp|
000014d0  72 69 74 65 73 22 0d 08  52 0a 45 51 55 42 20 30  |rites"..R.EQUB 0|
000014e0  0d 08 5c 12 45 51 55 53  20 22 47 65 74 4c 65 61  |..\.EQUS "GetLea|
000014f0  66 22 0d 08 66 0a 45 51  55 42 20 30 0d 08 70 09  |f"..f.EQUB 0..p.|
00001500  41 4c 49 47 4e 0d 08 7a  0a 45 51 55 44 20 30 0d  |ALIGN..z.EQUD 0.|
00001510  08 84 05 3b 0d 08 8e 37  2e 73 77 69 63 6f 64 65  |...;...7.swicode|
00001520  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001530  20 20 20 20 20 20 20 20  3b 20 53 57 49 20 73 74  |        ; SWI st|
00001540  61 72 74 20 75 70 20 63  6f 64 65 0d 08 98 19 20  |art up code.... |
00001550  20 20 53 54 4d 46 44 20  28 73 70 29 21 2c 7b 6c  |  STMFD (sp)!,{l|
00001560  69 6e 6b 7d 0d 08 a2 1b  20 20 20 53 54 4d 46 44  |ink}....   STMFD|
00001570  20 28 73 70 29 21 2c 7b  72 38 2d 72 31 31 7d 0d  | (sp)!,{r8-r11}.|
00001580  08 ac 49 20 20 20 4c 44  52 20 20 20 77 73 2c 5b  |..I   LDR   ws,[|
00001590  77 73 5d 20 20 20 20 20  20 20 20 20 20 20 20 20  |ws]             |
000015a0  20 20 20 3b 20 6c 6f 61  64 20 72 31 32 20 77 69  |   ; load r12 wi|
000015b0  74 68 20 74 68 65 20 77  6f 72 6b 73 70 61 63 65  |th the workspace|
000015c0  20 70 6f 69 6e 74 65 72  0d 08 b6 39 20 20 20 43  | pointer...9   C|
000015d0  4d 50 20 20 20 72 31 31  2c 23 34 39 20 20 20 20  |MP   r11,#49    |
000015e0  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 63 68  |            ; ch|
000015f0  65 63 6b 20 6f 66 66 73  65 74 20 6e 75 6d 62 65  |eck offset numbe|
00001600  72 0d 08 c0 46 20 20 20  42 47 54 20 20 20 64 6f  |r...F   BGT   do|
00001610  6e 74 6b 6e 6f 77 73 77  69 20 20 20 20 20 20 20  |ntknowswi       |
00001620  20 20 20 20 20 3b 20 65  72 72 6f 72 20 69 66 20  |     ; error if |
00001630  74 6f 6f 20 62 69 67 20  66 6f 72 20 74 68 69 73  |too big for this|
00001640  20 6d 6f 64 75 6c 65 0d  08 ca 3f 20 20 20 4d 4f  | module...?   MO|
00001650  56 20 20 20 72 39 2c 72  31 31 2c 4c 53 4c 23 32  |V   r9,r11,LSL#2|
00001660  20 20 20 20 20 20 20 20  20 20 20 3b 20 63 61 6c  |           ; cal|
00001670  63 75 6c 61 74 65 20 6f  66 66 73 65 74 20 66 6f  |culate offset fo|
00001680  72 20 6a 75 6d 70 0d 08  d4 3d 20 20 20 41 44 44  |r jump...=   ADD|
00001690  20 20 20 72 39 2c 72 39  2c 70 63 20 20 20 20 20  |   r9,r9,pc     |
000016a0  20 20 20 20 20 20 20 20  20 20 3b 20 74 61 6b 69  |          ; taki|
000016b0  6e 67 20 69 6e 74 6f 20  61 63 63 6f 75 6e 74 20  |ng into account |
000016c0  41 52 4d 0d 08 de 48 20  20 20 4d 4f 56 20 20 20  |ARM...H   MOV   |
000016d0  70 63 2c 72 39 20 20 20  20 20 20 20 20 20 20 20  |pc,r9           |
000016e0  20 20 20 20 20 20 20 3b  20 70 69 70 65 6c 69 6e  |       ; pipelin|
000016f0  69 6e 67 20 62 79 20 61  64 6a 75 73 74 69 6e 67  |ing by adjusting|
00001700  20 62 79 20 34 20 62 79  74 65 73 0d 08 e8 05 3b  | by 4 bytes....;|
00001710  0d 08 f2 1a 3b 20 74 68  65 20 66 6f 6c 6c 6f 77  |....; the follow|
00001720  69 6e 67 20 69 73 20 74  68 65 0d 08 fc 14 3b 20  |ing is the....; |
00001730  53 57 49 20 6a 75 6d 70  20 74 61 62 6c 65 0d 09  |SWI jump table..|
00001740  06 05 3b 0d 09 10 14 20  20 20 42 20 20 20 20 20  |..;....   B     |
00001750  76 65 72 73 69 6f 6e 0d  09 1a 15 20 20 20 42 20  |version....   B |
00001760  20 20 20 20 74 61 73 6b  69 63 6f 6e 0d 09 24 14  |    taskicon..$.|
00001770  20 20 20 42 20 20 20 20  20 70 6f 70 77 69 6e 64  |   B     popwind|
00001780  0d 09 2e 1b 20 20 20 42  20 20 20 20 20 6f 70 65  |....   B     ope|
00001790  6e 70 61 6e 65 77 69 6e  64 6f 77 0d 09 38 1e 20  |npanewindow..8. |
000017a0  20 20 42 20 20 20 20 20  70 6f 70 6f 70 65 6e 70  |  B     popopenp|
000017b0  61 6e 65 77 69 6e 64 6f  77 0d 09 42 16 20 20 20  |anewindow..B.   |
000017c0  42 20 20 20 20 20 63 6c  6f 73 65 77 69 6e 64 0d  |B     closewind.|
000017d0  09 4c 17 20 20 20 42 20  20 20 20 20 74 6f 67 67  |.L.   B     togg|
000017e0  6c 65 69 63 6f 6e 0d 09  56 16 20 20 20 42 20 20  |leicon..V.   B  |
000017f0  20 20 20 73 65 74 73 65  6c 65 63 74 0d 09 60 1a  |   setselect..`.|
00001800  20 20 20 42 20 20 20 20  20 67 65 74 69 63 6f 6e  |   B     geticon|
00001810  73 65 6c 65 63 74 0d 09  6a 1a 20 20 20 42 20 20  |select..j.   B  |
00001820  20 20 20 73 65 74 69 63  6f 6e 65 6e 61 62 6c 65  |   seticonenable|
00001830  0d 09 74 1a 20 20 20 42  20 20 20 20 20 67 65 74  |..t.   B     get|
00001840  69 63 6f 6e 65 6e 61 62  6c 65 0d 09 7e 18 20 20  |iconenable..~.  |
00001850  20 42 20 20 20 20 20 73  65 74 69 63 6f 6e 74 65  | B     seticonte|
00001860  78 74 0d 09 88 18 20 20  20 42 20 20 20 20 20 67  |xt....   B     g|
00001870  65 74 69 63 6f 6e 74 65  78 74 0d 09 92 1e 20 20  |eticontext....  |
00001880  20 42 20 20 20 20 20 73  65 74 69 63 6f 6e 76 61  | B     seticonva|
00001890  6c 69 64 61 74 69 6f 6e  0d 09 9c 1e 20 20 20 42  |lidation....   B|
000018a0  20 20 20 20 20 67 65 74  69 63 6f 6e 76 61 6c 69  |     geticonvali|
000018b0  64 61 74 69 6f 6e 0d 09  a6 1b 20 20 20 42 20 20  |dation....   B  |
000018c0  20 20 20 73 65 74 77 69  6e 64 6f 77 74 69 74 6c  |   setwindowtitl|
000018d0  65 0d 09 b0 1b 20 20 20  42 20 20 20 20 20 67 65  |e....   B     ge|
000018e0  74 77 69 6e 64 6f 77 74  69 74 6c 65 0d 09 ba 19  |twindowtitle....|
000018f0  20 20 20 42 20 20 20 20  20 75 70 64 61 74 65 77  |   B     updatew|
00001900  69 6e 64 6f 77 0d 09 c4  17 20 20 20 42 20 20 20  |indow....   B   |
00001910  20 20 6d 65 6e 75 68 65  61 64 65 72 0d 09 ce 19  |  menuheader....|
00001920  20 20 20 42 20 20 20 20  20 6d 61 6b 65 6d 65 6e  |   B     makemen|
00001930  75 69 74 65 6d 0d 09 d8  18 20 20 20 42 20 20 20  |uitem....   B   |
00001940  20 20 73 65 74 6d 65 6e  75 69 74 65 6d 0d 09 e2  |  setmenuitem...|
00001950  18 20 20 20 42 20 20 20  20 20 67 65 74 6d 65 6e  |.   B     getmen|
00001960  75 69 74 65 6d 0d 09 ec  1c 20 20 20 42 20 20 20  |uitem....   B   |
00001970  20 20 73 65 74 6d 65 6e  75 69 74 65 6d 6c 61 73  |  setmenuitemlas|
00001980  74 0d 09 f6 14 20 20 20  42 20 20 20 20 20 73 65  |t....   B     se|
00001990  74 74 69 63 6b 0d 0a 00  14 20 20 20 42 20 20 20  |ttick....   B   |
000019a0  20 20 67 65 74 74 69 63  6b 0d 0a 0a 17 20 20 20  |  gettick....   |
000019b0  42 20 20 20 20 20 73 65  74 6d 65 73 73 61 67 65  |B     setmessage|
000019c0  0d 0a 14 17 20 20 20 42  20 20 20 20 20 67 65 74  |....   B     get|
000019d0  6d 65 73 73 61 67 65 0d  0a 1e 16 20 20 20 42 20  |message....   B |
000019e0  20 20 20 20 73 65 74 65  6e 61 62 6c 65 0d 0a 28  |    setenable..(|
000019f0  16 20 20 20 42 20 20 20  20 20 67 65 74 65 6e 61  |.   B     getena|
00001a00  62 6c 65 0d 0a 32 1b 20  20 20 42 20 20 20 20 20  |ble..2.   B     |
00001a10  73 65 74 6d 65 6e 75 6f  70 74 69 6f 6e 73 0d 0a  |setmenuoptions..|
00001a20  3c 1b 20 20 20 42 20 20  20 20 20 67 65 74 6d 65  |<.   B     getme|
00001a30  6e 75 6f 70 74 69 6f 6e  73 0d 0a 46 16 20 20 20  |nuoptions..F.   |
00001a40  42 20 20 20 20 20 61 74  74 61 63 68 73 75 62 0d  |B     attachsub.|
00001a50  0a 50 16 20 20 20 42 20  20 20 20 20 6c 6f 61 64  |.P.   B     load|
00001a60  6d 65 6e 75 73 0d 0a 5a  18 20 20 20 42 20 20 20  |menus..Z.   B   |
00001a70  20 20 69 63 6f 6e 62 61  72 6d 65 6e 75 0d 0a 64  |  iconbarmenu..d|
00001a80  17 20 20 20 42 20 20 20  20 20 6d 65 6e 75 61 64  |.   B     menuad|
00001a90  6a 75 73 74 0d 0a 6e 15  20 20 20 42 20 20 20 20  |just..n.   B    |
00001aa0  20 6d 61 6b 65 6d 65 6e  75 0d 0a 78 14 20 20 20  | makemenu..x.   |
00001ab0  42 20 20 20 20 20 67 65  74 74 65 78 74 0d 0a 82  |B     gettext...|
00001ac0  16 20 20 20 42 20 20 20  20 20 73 74 61 72 74 64  |.   B     startd|
00001ad0  72 61 67 0d 0a 8c 15 20  20 20 42 20 20 20 20 20  |rag....   B     |
00001ae0  73 65 6e 64 73 61 76 65  0d 0a 96 15 20 20 20 42  |sendsave....   B|
00001af0  20 20 20 20 20 73 65 6e  64 6c 6f 61 64 0d 0a a0  |     sendload...|
00001b00  18 20 20 20 42 20 20 20  20 20 73 65 6e 64 73 61  |.   B     sendsa|
00001b10  76 65 61 63 6b 0d 0a aa  18 20 20 20 42 20 20 20  |veack....   B   |
00001b20  20 20 73 65 6e 64 6c 6f  61 64 61 63 6b 0d 0a b4  |  sendloadack...|
00001b30  1a 20 20 20 42 20 20 20  20 20 6c 6f 61 64 74 65  |.   B     loadte|
00001b40  6d 70 6c 61 74 65 73 0d  0a be 1a 20 20 20 42 20  |mplates....   B |
00001b50  20 20 20 20 77 69 6e 64  6f 77 63 6f 6e 76 65 72  |    windowconver|
00001b60  74 0d 0a c8 1c 20 20 20  42 20 20 20 20 20 67 65  |t....   B     ge|
00001b70  74 74 65 6d 70 6c 61 74  65 69 6e 66 6f 0d 0a d2  |ttemplateinfo...|
00001b80  1e 20 20 20 42 20 20 20  20 20 6c 6f 73 65 74 65  |.   B     losete|
00001b90  6d 70 6c 61 74 65 66 6f  6e 74 73 0d 0a dc 15 20  |mplatefonts.... |
00001ba0  20 20 42 20 20 20 20 20  72 65 67 69 73 74 65 72  |  B     register|
00001bb0  0d 0a e6 17 20 20 20 42  20 20 20 20 20 64 65 72  |....   B     der|
00001bc0  65 67 69 73 74 65 72 0d  0a f0 18 20 20 20 42 20  |egister....   B |
00001bd0  20 20 20 20 6c 6f 61 64  73 70 72 69 74 65 73 0d  |    loadsprites.|
00001be0  0a fa 17 20 20 20 42 20  20 20 20 20 73 77 69 67  |...   B     swig|
00001bf0  65 74 6c 65 61 66 0d 0b  04 05 3b 0d 0b 0e 4e 3b  |etleaf....;...N;|
00001c00  20 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  | ***************|
00001c10  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00001c40  2a 2a 2a 2a 2a 2a 2a 2a  2a 0d 0b 18 4e 3b 20 2a  |*********...N; *|
00001c50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001c60  20 20 20 20 20 20 20 20  20 20 20 4d 41 49 4e 20  |           MAIN |
00001c70  53 57 49 20 43 4f 44 49  4e 47 20 20 20 20 20 20  |SWI CODING      |
00001c80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001c90  20 20 20 20 20 20 2a 0d  0b 22 4e 3b 20 2a 2a 2a  |      *.."N; ***|
00001ca0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00001ce0  2a 2a 2a 2a 2a 0d 0b 2c  05 3b 0d 0b 36 47 2e 65  |*****..,.;..6G.e|
00001cf0  78 69 74 73 77 69 20 20  20 20 20 20 20 20 20 20  |xitswi          |
00001d00  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00001d10  72 65 73 74 6f 72 65 20  72 65 67 69 73 74 65 72  |restore register|
00001d20  73 20 61 6e 64 20 65 78  69 74 20 6d 6f 64 75 6c  |s and exit modul|
00001d30  65 0d 0b 40 1b 20 20 20  4c 44 4d 46 44 20 28 73  |e..@.   LDMFD (s|
00001d40  70 29 21 2c 7b 72 38 2d  72 31 31 7d 0d 0b 4a 17  |p)!,{r8-r11}..J.|
00001d50  20 20 20 4c 44 4d 46 44  20 28 73 70 29 21 2c 7b  |   LDMFD (sp)!,{|
00001d60  70 63 7d 0d 0b 54 05 3b  0d 0b 5e 38 2e 6d 61 6b  |pc}..T.;..^8.mak|
00001d70  65 65 72 72 6f 72 20 20  20 20 20 20 20 20 20 20  |eerror          |
00001d80  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 6d 61  |            ; ma|
00001d90  6b 65 20 65 72 72 6f 72  20 6d 65 73 73 61 67 65  |ke error message|
00001da0  0d 0b 68 46 20 20 20 4c  44 4d 46 44 20 28 73 70  |..hF   LDMFD (sp|
00001db0  29 21 2c 7b 72 38 2d 72  31 31 7d 20 20 20 20 20  |)!,{r8-r11}     |
00001dc0  20 20 20 20 3b 20 72 30  20 70 6f 69 6e 74 73 20  |    ; r0 points |
00001dd0  74 6f 20 65 72 72 6f 72  20 6d 65 73 73 61 67 65  |to error message|
00001de0  20 62 6c 6f 63 6b 0d 0b  72 19 20 20 20 4c 44 4d  | block..r.   LDM|
00001df0  46 44 20 28 73 70 29 21  2c 7b 6c 69 6e 6b 7d 0d  |FD (sp)!,{link}.|
00001e00  0b 7c 1c 20 20 20 84 52  20 20 20 6c 69 6e 6b 2c  |.|.   .R   link,|
00001e10  6c 69 6e 6b 2c 23 31 3c  3c 32 38 0d 0b 86 14 20  |link,#1<<28.... |
00001e20  20 20 4d 4f 56 53 20 20  70 63 2c 6c 69 6e 6b 0d  |  MOVS  pc,link.|
00001e30  0b 90 05 3b 0d 0b 9a 33  2e 73 74 72 6e 6f 74 69  |...;...3.strnoti|
00001e40  6e 64 69 72 65 63 74 65  64 20 20 20 20 20 20 20  |ndirected       |
00001e50  20 20 20 20 20 20 20 20  3b 20 65 72 72 6f 72 20  |        ; error |
00001e60  6d 65 73 73 61 67 65 0d  0b a4 17 20 20 20 4c 44  |message....   LD|
00001e70  4d 46 44 20 28 73 70 29  21 2c 7b 72 31 7d 0d 0b  |MFD (sp)!,{r1}..|
00001e80  ae 16 2e 73 74 72 6e 6f  74 69 6e 64 69 72 65 63  |...strnotindirec|
00001e90  74 65 64 32 0d 0b b8 19  20 20 20 41 44 52 20 20  |ted2....   ADR  |
00001ea0  20 72 30 2c 6e 6f 74 69  6e 64 73 74 72 0d 0b c2  | r0,notindstr...|
00001eb0  16 20 20 20 42 20 20 20  20 20 6d 61 6b 65 65 72  |.   B     makeer|
00001ec0  72 6f 72 0d 0b cc 05 3b  0d 0b d6 0e 2e 6e 6f 74  |ror....;.....not|
00001ed0  69 6e 64 73 74 72 0d 0b  e0 15 45 51 55 44 20 20  |indstr....EQUD  |
00001ee0  45 72 72 6f 72 42 61 73  65 2b 32 0d 0b ea 2e 45  |ErrorBase+2....E|
00001ef0  51 55 53 20 20 22 49 63  6f 6e 2f 4d 65 6e 75 20  |QUS  "Icon/Menu |
00001f00  73 74 72 69 6e 67 20 69  73 20 6e 6f 74 20 69 6e  |string is not in|
00001f10  64 69 72 65 63 74 65 64  22 0d 0b f4 0b 45 51 55  |directed"....EQU|
00001f20  42 20 20 30 0d 0b fe 09  41 4c 49 47 4e 0d 0c 08  |B  0....ALIGN...|
00001f30  05 3b 0d 0c 12 33 2e 64  6f 6e 74 6b 6e 6f 77 73  |.;...3.dontknows|
00001f40  77 69 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |wi              |
00001f50  20 20 20 20 20 20 3b 20  65 72 72 6f 72 20 6d 65  |      ; error me|
00001f60  73 73 61 67 65 0d 0c 1c  1b 20 20 20 41 44 52 20  |ssage....   ADR |
00001f70  20 20 72 30 2c 64 6f 6e  74 6b 6e 6f 77 73 74 72  |  r0,dontknowstr|
00001f80  0d 0c 26 16 20 20 20 42  20 20 20 20 20 6d 61 6b  |..&.   B     mak|
00001f90  65 65 72 72 6f 72 0d 0c  30 05 3b 0d 0c 3a 05 3b  |eerror..0.;..:.;|
00001fa0  0d 0c 44 10 2e 64 6f 6e  74 6b 6e 6f 77 73 74 72  |..D..dontknowstr|
00001fb0  0d 0c 4e 15 45 51 55 44  20 20 45 72 72 6f 72 42  |..N.EQUD  ErrorB|
00001fc0  61 73 65 2b 31 0d 0c 58  2f 45 51 55 53 20 20 22  |ase+1..X/EQUS  "|
00001fd0  57 69 6d 70 4c 69 62 20  64 6f 65 73 20 6e 6f 74  |WimpLib does not|
00001fe0  20 72 65 63 6f 67 6e 69  73 65 20 74 68 61 74 20  | recognise that |
00001ff0  53 57 49 22 0d 0c 62 0b  45 51 55 42 20 20 30 0d  |SWI"..b.EQUB  0.|
00002000  0c 6c 09 41 4c 49 47 4e  0d 0c 76 05 3b 0d 0c 80  |.l.ALIGN..v.;...|
00002010  28 3b 20 72 30 20 3d 20  30 20 72 65 74 75 72 6e  |(; r0 = 0 return|
00002020  73 20 72 30 20 3d 20 76  65 72 73 69 6f 6e 20 6e  |s r0 = version n|
00002030  75 6d 62 65 72 0d 0c 8a  1b 3b 20 72 30 20 3d 2d  |umber....; r0 =-|
00002040  31 20 70 72 69 6e 74 73  20 76 65 72 73 69 6f 6e  |1 prints version|
00002050  0d 0c 94 05 3b 0d 0c 9e  0c 2e 76 65 72 73 69 6f  |....;.....versio|
00002060  6e 0d 0c a8 12 20 20 20  43 4d 50 20 20 20 72 30  |n....   CMP   r0|
00002070  2c 23 30 0d 0c b2 11 20  20 20 ec 51 20 72 30 2c  |,#0....   .Q r0,|
00002080  23 31 34 32 0d 0c bc 14  20 20 20 42 45 51 20 20  |#142....   BEQ  |
00002090  20 65 78 69 74 73 77 69  0d 0c c6 18 20 20 20 53  | exitswi....   S|
000020a0  57 49 20 20 20 22 4f 53  5f 57 72 69 74 65 53 22  |WI   "OS_WriteS"|
000020b0  0d 0c d0 31 45 51 55 53  20 20 22 57 69 6d 70 20  |...1EQUS  "Wimp |
000020c0  4c 69 62 72 61 72 79 20  56 65 72 73 69 6f 6e 20  |Library Version |
000020d0  31 2e 34 32 20 28 22 2b  64 61 74 65 24 2b 22 29  |1.42 ("+date$+")|
000020e0  22 0d 0c da 0b 45 51 55  42 20 31 30 0d 0c e4 0b  |"....EQUB 10....|
000020f0  45 51 55 42 20 31 30 0d  0c ee 0b 45 51 55 42 20  |EQUB 10....EQUB |
00002100  31 33 0d 0c f8 0b 45 51  55 42 20 20 30 0d 0d 02  |13....EQUB  0...|
00002110  09 41 4c 49 47 4e 0d 0d  0c 14 20 20 20 42 20 20  |.ALIGN....   B  |
00002120  20 20 20 65 78 69 74 73  77 69 0d 0d 16 05 3b 0d  |   exitswi....;.|
00002130  0d 20 4f 3b 20 74 68 69  73 20 73 75 62 72 6f 75  |. O; this subrou|
00002140  74 69 6e 65 20 63 68 65  63 6b 73 20 61 20 72 65  |tine checks a re|
00002150  67 69 73 74 65 72 20 61  6e 64 20 69 66 20 69 74  |gister and if it|
00002160  20 70 6f 69 6e 74 73 20  74 6f 20 74 68 65 20 74  | points to the t|
00002170  61 62 6c 65 20 6f 66 20  77 69 6e 64 6f 77 0d 0d  |able of window..|
00002180  2a 4a 3b 20 6e 61 6d 65  73 20 61 6e 64 20 68 61  |*J; names and ha|
00002190  6e 64 6c 65 73 20 63 68  65 63 6b 73 20 72 30 2e  |ndles checks r0.|
000021a0  20 20 49 66 20 72 30 20  3c 20 26 31 30 30 20 74  |  If r0 < &100 t|
000021b0  68 65 6e 20 69 74 20 63  6f 6e 74 61 69 6e 73 20  |hen it contains |
000021c0  61 20 77 69 6e 64 6f 77  0d 0d 34 48 3b 20 6e 75  |a window..4H; nu|
000021d0  6d 62 65 72 2e 20 20 4f  74 68 65 72 77 69 73 65  |mber.  Otherwise|
000021e0  20 69 74 20 63 6f 6e 74  61 69 6e 73 20 74 68 65  | it contains the|
000021f0  20 61 64 64 72 65 73 73  20 6f 66 20 61 20 77 69  | address of a wi|
00002200  6e 64 6f 77 20 73 74 72  69 6e 67 2e 20 20 49 74  |ndow string.  It|
00002210  0d 0d 3e 3e 3b 20 63 6f  6e 76 65 72 74 73 20 74  |..>>; converts t|
00002220  68 65 20 73 74 72 69 6e  67 20 6f 72 20 6e 75 6d  |he string or num|
00002230  62 65 72 20 74 6f 20 74  68 65 20 77 69 6e 64 6f  |ber to the windo|
00002240  77 20 68 61 6e 64 6c 65  20 75 73 69 6e 67 0d 0d  |w handle using..|
00002250  48 1e 3b 20 57 69 6e 64  6f 77 20 43 6f 6e 76 65  |H.; Window Conve|
00002260  72 74 20 50 61 72 61 6d  65 74 65 72 0d 0d 52 05  |rt Parameter..R.|
00002270  3b 0d 0d 5c 3f 3b 20 63  6f 6e 76 65 72 74 6e 61  |;..\?; convertna|
00002280  6d 65 31 20 2d 20 72 31  20 63 61 72 72 69 65 73  |me1 - r1 carries|
00002290  20 74 68 65 20 61 64 64  72 65 73 73 20 6f 66 20  | the address of |
000022a0  74 68 65 20 68 61 6e 64  6c 65 20 62 6c 6f 63 6b  |the handle block|
000022b0  0d 0d 66 05 3b 0d 0d 70  11 2e 63 6f 6e 76 65 72  |..f.;..p..conver|
000022c0  74 6e 61 6d 65 31 0d 0d  7a 1f 20 20 20 53 54 4d  |tname1..z.   STM|
000022d0  46 44 20 28 73 70 29 21  2c 7b 72 31 2c 72 32 2c  |FD (sp)!,{r1,r2,|
000022e0  6c 69 6e 6b 7d 0d 0d 84  12 20 20 20 4d 4f 56 20  |link}....   MOV |
000022f0  20 20 72 32 2c 72 30 0d  0d 8e 15 20 20 20 43 4d  |  r2,r0....   CM|
00002300  50 20 20 20 72 32 2c 23  26 31 30 30 0d 0d 98 12  |P   r2,#&100....|
00002310  20 20 20 4d 4f 56 4c 54  20 72 30 2c 23 32 0d 0d  |   MOVLT r0,#2..|
00002320  a2 12 20 20 20 4d 4f 56  47 45 20 72 30 2c 23 34  |..   MOVGE r0,#4|
00002330  0d 0d ac 32 20 20 20 53  57 49 20 20 20 22 58 57  |...2   SWI   "XW|
00002340  53 57 69 6d 70 54 6f 6f  6c 73 5f 57 69 6e 64 6f  |SWimpTools_Windo|
00002350  77 43 6f 6e 76 65 72 74  50 61 72 61 6d 65 74 65  |wConvertParamete|
00002360  72 22 0d 0d b6 1d 20 20  20 4c 44 4d 46 44 20 28  |r"....   LDMFD (|
00002370  73 70 29 21 2c 7b 72 31  2c 72 32 2c 70 63 7d 0d  |sp)!,{r1,r2,pc}.|
00002380  0d c0 05 3b 0d 0d ca 3f  3b 20 63 6f 6e 76 65 72  |...;...?; conver|
00002390  74 6e 61 6d 65 33 20 2d  20 72 33 20 63 61 72 72  |tname3 - r3 carr|
000023a0  69 65 73 20 74 68 65 20  61 64 64 72 65 73 73 20  |ies the address |
000023b0  6f 66 20 74 68 65 20 68  61 6e 64 6c 65 20 62 6c  |of the handle bl|
000023c0  6f 63 6b 0d 0d d4 05 3b  0d 0d de 11 2e 63 6f 6e  |ock....;.....con|
000023d0  76 65 72 74 6e 61 6d 65  33 0d 0d e8 1f 20 20 20  |vertname3....   |
000023e0  53 54 4d 46 44 20 28 73  70 29 21 2c 7b 72 31 2c  |STMFD (sp)!,{r1,|
000023f0  72 32 2c 6c 69 6e 6b 7d  0d 0d f2 12 20 20 20 4d  |r2,link}....   M|
00002400  4f 56 20 20 20 72 31 2c  72 33 0d 0d fc 12 20 20  |OV   r1,r3....  |
00002410  20 4d 4f 56 20 20 20 72  32 2c 72 30 0d 0e 06 15  | MOV   r2,r0....|
00002420  20 20 20 43 4d 50 20 20  20 72 32 2c 23 26 31 30  |   CMP   r2,#&10|
00002430  30 0d 0e 10 12 20 20 20  4d 4f 56 4c 54 20 72 30  |0....   MOVLT r0|
00002440  2c 23 32 0d 0e 1a 12 20  20 20 4d 4f 56 47 45 20  |,#2....   MOVGE |
00002450  72 30 2c 23 34 0d 0e 24  32 20 20 20 53 57 49 20  |r0,#4..$2   SWI |
00002460  20 20 22 58 57 53 57 69  6d 70 54 6f 6f 6c 73 5f  |  "XWSWimpTools_|
00002470  57 69 6e 64 6f 77 43 6f  6e 76 65 72 74 50 61 72  |WindowConvertPar|
00002480  61 6d 65 74 65 72 22 0d  0e 2e 1d 20 20 20 4c 44  |ameter"....   LD|
00002490  4d 46 44 20 28 73 70 29  21 2c 7b 72 31 2c 72 32  |MFD (sp)!,{r1,r2|
000024a0  2c 70 63 7d 0d 0e 38 05  3b 0d 0e 42 05 3b 0d 0e  |,pc}..8.;..B.;..|
000024b0  4c 3f 3b 20 63 6f 6e 76  65 72 74 6e 61 6d 65 34  |L?; convertname4|
000024c0  20 2d 20 72 34 20 63 61  72 72 69 65 73 20 74 68  | - r4 carries th|
000024d0  65 20 61 64 64 72 65 73  73 20 6f 66 20 74 68 65  |e address of the|
000024e0  20 68 61 6e 64 6c 65 20  62 6c 6f 63 6b 0d 0e 56  | handle block..V|
000024f0  05 3b 0d 0e 60 11 2e 63  6f 6e 76 65 72 74 6e 61  |.;..`..convertna|
00002500  6d 65 34 0d 0e 6a 1f 20  20 20 53 54 4d 46 44 20  |me4..j.   STMFD |
00002510  28 73 70 29 21 2c 7b 72  31 2c 72 32 2c 6c 69 6e  |(sp)!,{r1,r2,lin|
00002520  6b 7d 0d 0e 74 12 20 20  20 4d 4f 56 20 20 20 72  |k}..t.   MOV   r|
00002530  31 2c 72 34 0d 0e 7e 12  20 20 20 4d 4f 56 20 20  |1,r4..~.   MOV  |
00002540  20 72 32 2c 72 30 0d 0e  88 15 20 20 20 43 4d 50  | r2,r0....   CMP|
00002550  20 20 20 72 32 2c 23 26  31 30 30 0d 0e 92 12 20  |   r2,#&100.... |
00002560  20 20 4d 4f 56 4c 54 20  72 30 2c 23 32 0d 0e 9c  |  MOVLT r0,#2...|
00002570  12 20 20 20 4d 4f 56 47  45 20 72 30 2c 23 34 0d  |.   MOVGE r0,#4.|
00002580  0e a6 32 20 20 20 53 57  49 20 20 20 22 58 57 53  |..2   SWI   "XWS|
00002590  57 69 6d 70 54 6f 6f 6c  73 5f 57 69 6e 64 6f 77  |WimpTools_Window|
000025a0  43 6f 6e 76 65 72 74 50  61 72 61 6d 65 74 65 72  |ConvertParameter|
000025b0  22 0d 0e b0 1d 20 20 20  4c 44 4d 46 44 20 28 73  |"....   LDMFD (s|
000025c0  70 29 21 2c 7b 72 31 2c  72 32 2c 70 63 7d 0d 0e  |p)!,{r1,r2,pc}..|
000025d0  ba 05 3b 0d 0e c4 18 3b  20 72 30 20 3d 20 77 69  |..;....; r0 = wi|
000025e0  6e 64 6f 77 20 68 61 6e  64 6c 65 0d 0e ce 05 3b  |ndow handle....;|
000025f0  0d 0e d8 0c 2e 70 6f 70  77 69 6e 64 0d 0e e2 17  |.....popwind....|
00002600  20 20 20 53 54 4d 46 44  20 28 73 70 29 21 2c 7b  |   STMFD (sp)!,{|
00002610  72 31 7d 0d 0e ec 12 20  20 20 54 45 51 20 20 20  |r1}....   TEQ   |
00002620  72 31 2c 23 30 0d 0e f6  19 20 20 20 42 4c 4e 45  |r1,#0....   BLNE|
00002630  20 20 63 6f 6e 76 65 72  74 6e 61 6d 65 31 0d 0f  |  convertname1..|
00002640  00 17 20 20 20 41 44 44  20 20 20 72 31 2c 77 73  |..   ADD   r1,ws|
00002650  2c 23 62 6c 6b 0d 0f 0a  14 20 20 20 53 54 52 20  |,#blk....   STR |
00002660  20 20 72 30 2c 5b 72 31  5d 0d 0f 14 23 20 20 20  |  r0,[r1]...#   |
00002670  53 57 49 20 20 20 22 58  57 69 6d 70 5f 47 65 74  |SWI   "XWimp_Get|
00002680  57 69 6e 64 6f 77 53 74  61 74 65 22 0d 0f 1e 1f  |WindowState"....|
00002690  20 20 20 53 57 49 56 43  20 22 58 57 69 6d 70 5f  |   SWIVC "XWimp_|
000026a0  4f 70 65 6e 57 69 6e 64  6f 77 22 0d 0f 28 17 20  |OpenWindow"..(. |
000026b0  20 20 4c 44 4d 46 44 20  28 73 70 29 21 2c 7b 72  |  LDMFD (sp)!,{r|
000026c0  31 7d 0d 0f 32 14 20 20  20 42 20 20 20 20 20 65  |1}..2.   B     e|
000026d0  78 69 74 73 77 69 0d 0f  3c 05 3b 0d 0f 46 24 3b  |xitswi..<.;..F$;|
000026e0  20 72 31 20 20 3d 20 62  6c 6f 63 6b 20 72 65 74  | r1  = block ret|
000026f0  75 72 6e 65 64 20 62 79  20 50 6f 6c 6c 20 32 0d  |urned by Poll 2.|
00002700  0f 50 1f 3b 20 72 32 20  20 3d 20 69 63 6f 6e 20  |.P.; r2  = icon |
00002710  74 6f 20 66 69 74 20 70  61 6e 65 20 74 6f 0d 0f  |to fit pane to..|
00002720  5a 28 3b 20 72 33 20 20  3d 20 77 69 6e 64 6f 77  |Z(; r3  = window|
00002730  20 68 61 6e 64 6c 65 20  6f 66 20 70 61 6e 65 20  | handle of pane |
00002740  77 69 6e 64 6f 77 0d 0f  64 05 3b 0d 0f 6e 13 2e  |window..d.;..n..|
00002750  6f 70 65 6e 70 61 6e 65  77 69 6e 64 6f 77 0d 0f  |openpanewindow..|
00002760  78 12 20 20 20 54 45 51  20 20 20 72 34 2c 23 30  |x.   TEQ   r4,#0|
00002770  0d 0f 82 1c 20 20 20 42  45 51 20 20 20 6f 70 65  |....   BEQ   ope|
00002780  6e 70 61 6e 65 77 69 6e  64 6f 77 31 0d 0f 8c 17  |npanewindow1....|
00002790  20 20 20 53 54 4d 46 44  20 28 73 70 29 21 2c 7b  |   STMFD (sp)!,{|
000027a0  72 30 7d 0d 0f 96 12 20  20 20 4d 4f 56 20 20 20  |r0}....   MOV   |
000027b0  72 30 2c 72 33 0d 0f a0  19 20 20 20 42 4c 20 20  |r0,r3....   BL  |
000027c0  20 20 63 6f 6e 76 65 72  74 6e 61 6d 65 34 0d 0f  |  convertname4..|
000027d0  aa 12 20 20 20 4d 4f 56  20 20 20 72 33 2c 72 30  |..   MOV   r3,r0|
000027e0  0d 0f b4 17 20 20 20 4c  44 4d 46 44 20 28 73 70  |....   LDMFD (sp|
000027f0  29 21 2c 7b 72 30 7d 0d  0f be 14 2e 6f 70 65 6e  |)!,{r0}.....open|
00002800  70 61 6e 65 77 69 6e 64  6f 77 31 0d 0f c8 14 20  |panewindow1.... |
00002810  20 20 4c 44 52 20 20 20  72 38 2c 5b 72 31 5d 0d  |  LDR   r8,[r1].|
00002820  0f d2 18 20 20 20 4c 44  52 20 20 20 72 39 2c 5b  |...   LDR   r9,[|
00002830  72 31 2c 23 32 30 5d 0d  0f dc 18 20 20 20 4c 44  |r1,#20]....   LD|
00002840  52 20 20 20 72 31 30 2c  5b 72 31 2c 23 34 5d 0d  |R   r10,[r1,#4].|
00002850  0f e6 17 20 20 20 53 55  42 20 20 20 72 31 30 2c  |...   SUB   r10,|
00002860  72 31 30 2c 72 39 0d 0f  f0 18 20 20 20 4c 44 52  |r10,r9....   LDR|
00002870  20 20 20 72 39 2c 5b 72  31 2c 23 32 34 5d 0d 0f  |   r9,[r1,#24]..|
00002880  fa 19 20 20 20 4c 44 52  20 20 20 72 31 31 2c 5b  |..   LDR   r11,[|
00002890  72 31 2c 23 31 36 5d 0d  10 04 17 20 20 20 53 55  |r1,#16]....   SU|
000028a0  42 20 20 20 72 31 31 2c  72 31 31 2c 72 39 0d 10  |B   r11,r11,r9..|
000028b0  0e 12 20 20 20 4d 4f 56  20 20 20 72 39 2c 72 31  |..   MOV   r9,r1|
000028c0  0d 10 18 17 20 20 20 41  44 44 20 20 20 72 31 2c  |....   ADD   r1,|
000028d0  77 73 2c 23 62 6c 6b 0d  10 22 16 20 20 20 41 44  |ws,#blk..".   AD|
000028e0  44 20 20 20 72 31 2c 72  31 2c 23 34 30 0d 10 2c  |D   r1,r1,#40..,|
000028f0  14 20 20 20 53 54 52 20  20 20 72 38 2c 5b 72 31  |.   STR   r8,[r1|
00002900  5d 0d 10 36 17 20 20 20  53 54 52 20 20 20 72 32  |]..6.   STR   r2|
00002910  2c 5b 72 31 2c 23 34 5d  0d 10 40 21 20 20 20 53  |,[r1,#4]..@!   S|
00002920  57 49 20 20 20 22 58 57  69 6d 70 5f 47 65 74 49  |WI   "XWimp_GetI|
00002930  63 6f 6e 53 74 61 74 65  22 0d 10 4a 14 20 20 20  |conState"..J.   |
00002940  42 56 53 20 20 20 65 78  69 74 73 77 69 0d 10 54  |BVS   exitswi..T|
00002950  1a 20 20 20 53 54 4d 46  44 20 28 73 70 29 21 2c  |.   STMFD (sp)!,|
00002960  7b 72 34 2d 72 37 7d 0d  10 5e 17 20 20 20 4c 44  |{r4-r7}..^.   LD|
00002970  52 20 20 20 72 34 2c 5b  72 31 2c 23 38 5d 0d 10  |R   r4,[r1,#8]..|
00002980  68 16 20 20 20 41 44 44  20 20 20 72 34 2c 72 34  |h.   ADD   r4,r4|
00002990  2c 72 31 30 0d 10 72 18  20 20 20 4c 44 52 20 20  |,r10..r.   LDR  |
000029a0  20 72 35 2c 5b 72 31 2c  23 31 32 5d 0d 10 7c 16  | r5,[r1,#12]..|.|
000029b0  20 20 20 41 44 44 20 20  20 72 35 2c 72 35 2c 72  |   ADD   r5,r5,r|
000029c0  31 31 0d 10 86 18 20 20  20 4c 44 52 20 20 20 72  |11....   LDR   r|
000029d0  36 2c 5b 72 31 2c 23 31  36 5d 0d 10 90 16 20 20  |6,[r1,#16]....  |
000029e0  20 41 44 44 20 20 20 72  36 2c 72 36 2c 72 31 30  | ADD   r6,r6,r10|
000029f0  0d 10 9a 18 20 20 20 4c  44 52 20 20 20 72 37 2c  |....   LDR   r7,|
00002a00  5b 72 31 2c 23 32 30 5d  0d 10 a4 16 20 20 20 41  |[r1,#20]....   A|
00002a10  44 44 20 20 20 72 37 2c  72 37 2c 72 31 31 0d 10  |DD   r7,r7,r11..|
00002a20  ae 14 20 20 20 53 54 52  20 20 20 72 33 2c 5b 72  |..   STR   r3,[r|
00002a30  31 5d 0d 10 b8 23 20 20  20 53 57 49 20 20 20 22  |1]...#   SWI   "|
00002a40  58 57 69 6d 70 5f 47 65  74 57 69 6e 64 6f 77 53  |XWimp_GetWindowS|
00002a50  74 61 74 65 22 0d 10 c2  1e 20 20 20 4c 44 4d 56  |tate"....   LDMV|
00002a60  53 46 44 20 20 20 28 73  70 29 21 2c 7b 72 34 2d  |SFD   (sp)!,{r4-|
00002a70  72 37 7d 0d 10 cc 14 20  20 20 42 56 53 20 20 20  |r7}....   BVS   |
00002a80  65 78 69 74 73 77 69 0d  10 d6 16 20 20 20 53 54  |exitswi....   ST|
00002a90  52 20 20 20 72 34 2c 5b  31 2c 23 34 5d 0d 10 e0  |R   r4,[1,#4]...|
00002aa0  17 20 20 20 53 54 52 20  20 20 72 35 2c 5b 72 31  |.   STR   r5,[r1|
00002ab0  2c 23 38 5d 0d 10 ea 18  20 20 20 53 54 52 20 20  |,#8]....   STR  |
00002ac0  20 72 36 2c 5b 72 31 2c  23 31 32 5d 0d 10 f4 18  | r6,[r1,#12]....|
00002ad0  20 20 20 53 54 52 20 20  20 72 37 2c 5b 72 31 2c  |   STR   r7,[r1,|
00002ae0  23 31 36 5d 0d 10 fe 18  20 20 20 4c 44 52 20 20  |#16]....   LDR  |
00002af0  20 72 38 2c 5b 72 39 2c  23 32 38 5d 0d 11 08 18  | r8,[r9,#28]....|
00002b00  20 20 20 53 54 52 20 20  20 72 38 2c 5b 72 31 2c  |   STR   r8,[r1,|
00002b10  23 32 38 5d 0d 11 12 1a  20 20 20 4c 44 4d 46 44  |#28]....   LDMFD|
00002b20  20 28 73 70 29 21 2c 7b  72 34 2d 72 37 7d 0d 11  | (sp)!,{r4-r7}..|
00002b30  1c 1f 20 20 20 53 57 49  20 20 20 22 58 57 69 6d  |..   SWI   "XWim|
00002b40  70 5f 4f 70 65 6e 57 69  6e 64 6f 77 22 0d 11 26  |p_OpenWindow"..&|
00002b50  14 20 20 20 42 56 53 20  20 20 65 78 69 74 73 77  |.   BVS   exitsw|
00002b60  69 0d 11 30 12 20 20 20  4d 4f 56 20 20 20 72 31  |i..0.   MOV   r1|
00002b70  2c 72 39 0d 11 3a 18 20  20 20 53 54 52 20 20 20  |,r9..:.   STR   |
00002b80  72 33 2c 5b 72 31 2c 23  32 38 5d 0d 11 44 1f 20  |r3,[r1,#28]..D. |
00002b90  20 20 53 57 49 20 20 20  22 58 57 69 6d 70 5f 4f  |  SWI   "XWimp_O|
00002ba0  70 65 6e 57 69 6e 64 6f  77 22 0d 11 4e 14 20 20  |penWindow"..N.  |
00002bb0  20 42 20 20 20 20 20 65  78 69 74 73 77 69 0d 11  | B     exitswi..|
00002bc0  58 05 3b 0d 11 62 25 3b  20 41 73 20 61 62 6f 76  |X.;..b%; As abov|
00002bd0  65 20 62 75 74 20 72 30  20 3d 20 77 69 6e 64 6f  |e but r0 = windo|
00002be0  77 20 68 61 6e 64 6c 65  0d 11 6c 05 3b 0d 11 76  |w handle..l.;..v|
00002bf0  16 2e 70 6f 70 6f 70 65  6e 70 61 6e 65 77 69 6e  |..popopenpanewin|
00002c00  64 6f 77 0d 11 80 17 20  20 20 53 54 4d 46 44 20  |dow....   STMFD |
00002c10  28 73 70 29 21 2c 7b 72  31 7d 0d 11 8a 17 20 20  |(sp)!,{r1}....  |
00002c20  20 41 44 44 20 20 20 72  31 2c 77 73 2c 23 62 6c  | ADD   r1,ws,#bl|
00002c30  6b 0d 11 94 12 20 20 20  54 45 51 20 20 20 72 34  |k....   TEQ   r4|
00002c40  2c 23 30 0d 11 9e 19 20  20 20 42 4c 4e 45 20 20  |,#0....   BLNE  |
00002c50  63 6f 6e 76 65 72 74 6e  61 6d 65 34 0d 11 a8 14  |convertname4....|
00002c60  20 20 20 53 54 52 20 20  20 72 30 2c 5b 72 31 5d  |   STR   r0,[r1]|
00002c70  0d 11 b2 23 20 20 20 53  57 49 20 20 20 22 58 57  |...#   SWI   "XW|
00002c80  69 6d 70 5f 47 65 74 57  69 6e 64 6f 77 53 74 61  |imp_GetWindowSta|
00002c90  74 65 22 0d 11 bc 1b 20  20 20 4c 44 4d 56 53 46  |te"....   LDMVSF|
00002ca0  44 20 20 20 28 73 70 29  21 2c 7b 72 31 7d 0d 11  |D   (sp)!,{r1}..|
00002cb0  c6 14 20 20 20 42 56 53  20 20 20 65 78 69 74 73  |..   BVS   exits|
00002cc0  77 69 0d 11 d0 12 20 20  20 4d 56 4e 20 20 20 72  |wi....   MVN   r|
00002cd0  38 2c 23 30 0d 11 da 18  20 20 20 53 54 52 20 20  |8,#0....   STR  |
00002ce0  20 72 38 2c 5b 72 31 2c  23 32 38 5d 0d 11 e4 2a  | r8,[r1,#28]...*|
00002cf0  20 20 20 53 57 49 20 20  20 22 58 57 53 57 69 6d  |   SWI   "XWSWim|
00002d00  70 54 6f 6f 6c 73 5f 4f  70 65 6e 50 61 6e 65 57  |pTools_OpenPaneW|
00002d10  69 6e 64 6f 77 22 0d 11  ee 17 20 20 20 4c 44 4d  |indow"....   LDM|
00002d20  46 44 20 28 73 70 29 21  2c 7b 72 31 7d 0d 11 f8  |FD (sp)!,{r1}...|
00002d30  14 20 20 20 42 20 20 20  20 20 65 78 69 74 73 77  |.   B     exitsw|
00002d40  69 0d 12 02 05 3b 0d 12  0c 18 3b 20 72 30 20 3d  |i....;....; r0 =|
00002d50  20 77 69 6e 64 6f 77 20  68 61 6e 64 6c 65 0d 12  | window handle..|
00002d60  16 05 3b 0d 12 20 0e 2e  63 6c 6f 73 65 77 69 6e  |..;.. ..closewin|
00002d70  64 0d 12 2a 17 20 20 20  53 54 4d 46 44 20 28 73  |d..*.   STMFD (s|
00002d80  70 29 21 2c 7b 72 31 7d  0d 12 34 12 20 20 20 54  |p)!,{r1}..4.   T|
00002d90  45 51 20 20 20 72 31 2c  23 30 0d 12 3e 19 20 20  |EQ   r1,#0..>.  |
00002da0  20 42 4c 4e 45 20 20 63  6f 6e 76 65 72 74 6e 61  | BLNE  convertna|
00002db0  6d 65 31 0d 12 48 17 20  20 20 41 44 44 20 20 20  |me1..H.   ADD   |
00002dc0  72 31 2c 77 73 2c 23 62  6c 6b 0d 12 52 14 20 20  |r1,ws,#blk..R.  |
00002dd0  20 53 54 52 20 20 20 72  30 2c 5b 72 31 5d 0d 12  | STR   r0,[r1]..|
00002de0  5c 20 20 20 20 53 57 49  20 20 20 22 58 57 69 6d  |\    SWI   "XWim|
00002df0  70 5f 43 6c 6f 73 65 57  69 6e 64 6f 77 22 0d 12  |p_CloseWindow"..|
00002e00  66 17 20 20 20 4c 44 4d  46 44 20 28 73 70 29 21  |f.   LDMFD (sp)!|
00002e10  2c 7b 72 31 7d 0d 12 70  14 20 20 20 42 20 20 20  |,{r1}..p.   B   |
00002e20  20 20 65 78 69 74 73 77  69 0d 12 7a 05 3b 0d 12  |  exitswi..z.;..|
00002e30  84 0c 3b 20 a5 53 54 41  54 45 0d 12 8e 0e 3b 20  |..; .STATE....; |
00002e40  2d 2d 2d 2d 2d 2d 2d 2d  0d 12 98 38 3b 20 74 68  |--------...8; th|
00002e50  69 73 20 72 6f 75 74 69  6e 65 20 73 65 74 73 20  |is routine sets |
00002e60  75 70 20 61 20 62 6c 6f  63 6b 20 74 6f 20 67 65  |up a block to ge|
00002e70  74 20 61 6e 20 69 63 6f  6e 73 20 73 74 61 74 65  |t an icons state|
00002e80  0d 12 a2 05 3b 0d 12 ac  0d 2e 67 65 74 73 74 61  |....;.....getsta|
00002e90  74 65 0d 12 b6 1c 20 20  20 53 54 4d 46 44 20 28  |te....   STMFD (|
00002ea0  73 70 29 21 2c 7b 72 37  2c 6c 69 6e 6b 7d 0d 12  |sp)!,{r7,link}..|
00002eb0  c0 12 20 20 20 4d 4f 56  20 20 20 72 37 2c 72 31  |..   MOV   r7,r1|
00002ec0  0d 12 ca 17 20 20 20 41  44 44 20 20 20 72 31 2c  |....   ADD   r1,|
00002ed0  77 73 2c 23 62 6c 6b 0d  12 d4 17 20 20 20 53 54  |ws,#blk....   ST|
00002ee0  52 20 20 20 72 30 2c 5b  72 31 2c 23 30 5d 0d 12  |R   r0,[r1,#0]..|
00002ef0  de 17 20 20 20 53 54 52  20 20 20 72 37 2c 5b 72  |..   STR   r7,[r|
00002f00  31 2c 23 34 5d 0d 12 e8  1a 20 20 20 4c 44 4d 46  |1,#4]....   LDMF|
00002f10  44 20 28 73 70 29 21 2c  7b 72 37 2c 70 63 7d 0d  |D (sp)!,{r7,pc}.|
00002f20  12 f2 05 3b 0d 12 fc 18  3b 20 72 30 20 3d 20 77  |...;....; r0 = w|
00002f30  69 6e 64 6f 77 20 68 61  6e 64 6c 65 0d 13 06 16  |indow handle....|
00002f40  3b 20 72 31 20 3d 20 69  63 6f 6e 20 68 61 6e 64  |; r1 = icon hand|
00002f50  6c 65 0d 13 10 0f 3b 20  72 65 74 75 72 6e 73 20  |le....; returns |
00002f60  3a 0d 13 1a 31 3b 20 72  30 20 3d 20 6e 65 77 20  |:...1; r0 = new |
00002f70  69 63 6f 6e 20 73 74 61  74 65 20 74 72 75 65 20  |icon state true |
00002f80  6f 72 20 66 61 6c 73 65  20 28 2d 31 20 6f 72 20  |or false (-1 or |
00002f90  30 29 0d 13 24 05 3b 0d  13 2e 0f 2e 74 6f 67 67  |0)..$.;.....togg|
00002fa0  6c 65 69 63 6f 6e 0d 13  38 17 20 20 20 53 54 4d  |leicon..8.   STM|
00002fb0  46 44 20 28 73 70 29 21  2c 7b 72 31 7d 0d 13 42  |FD (sp)!,{r1}..B|
00002fc0  12 20 20 20 54 45 51 20  20 20 72 33 2c 23 30 0d  |.   TEQ   r3,#0.|
00002fd0  13 4c 19 20 20 20 42 4c  4e 45 20 20 63 6f 6e 76  |.L.   BLNE  conv|
00002fe0  65 72 74 6e 61 6d 65 33  0d 13 56 15 20 20 20 42  |ertname3..V.   B|
00002ff0  4c 20 20 20 20 67 65 74  73 74 61 74 65 0d 13 60  |L    getstate..`|
00003000  21 20 20 20 53 57 49 20  20 20 22 58 57 69 6d 70  |!   SWI   "XWimp|
00003010  5f 47 65 74 49 63 6f 6e  53 74 61 74 65 22 0d 13  |_GetIconState"..|
00003020  6a 16 20 20 20 42 56 53  20 20 20 74 6f 67 67 6c  |j.   BVS   toggl|
00003030  65 6f 75 74 0d 13 74 18  20 20 20 4c 44 52 20 20  |eout..t.   LDR  |
00003040  20 72 39 2c 5b 72 31 2c  23 32 34 5d 0d 13 7e 17  | r9,[r1,#24]..~.|
00003050  20 20 20 80 20 20 20 72  39 2c 72 39 2c 23 31 3c  |   .   r9,r9,#1<|
00003060  3c 32 31 0d 13 88 17 20  20 20 4d 4f 56 20 20 20  |<21....   MOV   |
00003070  72 31 31 2c 23 31 3c 3c  32 31 0d 13 92 14 20 20  |r11,#1<<21....  |
00003080  20 82 20 20 20 72 39 2c  72 39 2c 72 31 31 0d 13  | .   r9,r9,r11..|
00003090  9c 13 20 20 20 4d 4f 56  20 20 20 72 31 30 2c 72  |..   MOV   r10,r|
000030a0  39 0d 13 a6 17 20 20 20  53 54 52 20 20 20 72 39  |9....   STR   r9|
000030b0  2c 5b 72 31 2c 23 38 5d  0d 13 b0 19 20 20 20 53  |,[r1,#8]....   S|
000030c0  54 52 20 20 20 72 31 31  2c 5b 72 31 2c 23 31 32  |TR   r11,[r1,#12|
000030d0  5d 0d 13 ba 21 20 20 20  53 57 49 20 20 20 22 58  |]...!   SWI   "X|
000030e0  57 69 6d 70 5f 53 65 74  49 63 6f 6e 53 74 61 74  |Wimp_SetIconStat|
000030f0  65 22 0d 13 c4 16 20 20  20 42 56 53 20 20 20 74  |e"....   BVS   t|
00003100  6f 67 67 6c 65 6f 75 74  0d 13 ce 12 20 20 20 4d  |oggleout....   M|
00003110  56 4e 20 20 20 72 30 2c  23 30 0d 13 d8 13 20 20  |VN   r0,#0....  |
00003120  20 43 4d 50 20 20 20 72  31 30 2c 23 30 0d 13 e2  | CMP   r10,#0...|
00003130  0f 20 20 20 ec 51 20 72  30 2c 23 30 0d 13 ec 0e  |.   .Q r0,#0....|
00003140  2e 74 6f 67 67 6c 65 6f  75 74 0d 13 f6 17 20 20  |.toggleout....  |
00003150  20 4c 44 4d 46 44 20 28  73 70 29 21 2c 7b 72 31  | LDMFD (sp)!,{r1|
00003160  7d 0d 14 00 14 20 20 20  42 20 20 20 20 20 65 78  |}....   B     ex|
00003170  69 74 73 77 69 0d 14 0a  05 3b 0d 14 14 18 3b 20  |itswi....;....; |
00003180  72 30 20 3d 20 77 69 6e  64 6f 77 20 68 61 6e 64  |r0 = window hand|
00003190  6c 65 0d 14 1e 16 3b 20  72 31 20 3d 20 69 63 6f  |le....; r1 = ico|
000031a0  6e 20 68 61 6e 64 6c 65  0d 14 28 32 3b 20 72 32  |n handle..(2; r2|
000031b0  20 3d 20 74 72 75 65 20  6f 72 20 66 61 6c 73 65  | = true or false|
000031c0  20 74 6f 20 73 65 74 20  6f 72 20 75 6e 73 65 74  | to set or unset|
000031d0  20 28 2d 31 20 6f 72 20  30 29 0d 14 32 05 3b 0d  | (-1 or 0)..2.;.|
000031e0  14 3c 0e 2e 73 65 74 73  65 6c 65 63 74 0d 14 46  |.<..setselect..F|
000031f0  17 20 20 20 53 54 4d 46  44 20 28 73 70 29 21 2c  |.   STMFD (sp)!,|
00003200  7b 72 31 7d 0d 14 50 12  20 20 20 54 45 51 20 20  |{r1}..P.   TEQ  |
00003210  20 72 33 2c 23 30 0d 14  5a 19 20 20 20 42 4c 4e  | r3,#0..Z.   BLN|
00003220  45 20 20 63 6f 6e 76 65  72 74 6e 61 6d 65 33 0d  |E  convertname3.|
00003230  14 64 15 20 20 20 42 4c  20 20 20 20 67 65 74 73  |.d.   BL    gets|
00003240  74 61 74 65 0d 14 6e 21  20 20 20 53 57 49 20 20  |tate..n!   SWI  |
00003250  20 22 58 57 69 6d 70 5f  47 65 74 49 63 6f 6e 53  | "XWimp_GetIconS|
00003260  74 61 74 65 22 0d 14 78  19 20 20 20 42 56 53 20  |tate"..x.   BVS |
00003270  20 20 73 65 74 73 65 6c  65 63 74 6f 75 74 0d 14  |  setselectout..|
00003280  82 17 20 20 20 80 20 20  20 72 39 2c 72 32 2c 23  |..   .   r9,r2,#|
00003290  31 3c 3c 32 31 0d 14 8c  17 20 20 20 53 54 52 20  |1<<21....   STR |
000032a0  20 20 72 39 2c 5b 72 31  2c 23 38 5d 0d 14 96 16  |  r9,[r1,#8]....|
000032b0  20 20 20 4d 4f 56 20 20  20 72 39 2c 23 31 3c 3c  |   MOV   r9,#1<<|
000032c0  32 31 0d 14 a0 18 20 20  20 53 54 52 20 20 20 72  |21....   STR   r|
000032d0  39 2c 5b 72 31 2c 23 31  32 5d 0d 14 aa 21 20 20  |9,[r1,#12]...!  |
000032e0  20 53 57 49 20 20 20 22  58 57 69 6d 70 5f 53 65  | SWI   "XWimp_Se|
000032f0  74 49 63 6f 6e 53 74 61  74 65 22 0d 14 b4 11 2e  |tIconState".....|
00003300  73 65 74 73 65 6c 65 63  74 6f 75 74 0d 14 be 17  |setselectout....|
00003310  20 20 20 4c 44 4d 46 44  20 28 73 70 29 21 2c 7b  |   LDMFD (sp)!,{|
00003320  72 31 7d 0d 14 c8 14 20  20 20 42 20 20 20 20 20  |r1}....   B     |
00003330  65 78 69 74 73 77 69 0d  14 d2 05 3b 0d 14 dc 18  |exitswi....;....|
00003340  3b 20 72 30 20 3d 20 77  69 6e 64 6f 77 20 68 61  |; r0 = window ha|
00003350  6e 64 6c 65 0d 14 e6 16  3b 20 72 31 20 3d 20 69  |ndle....; r1 = i|
00003360  63 6f 6e 20 68 61 6e 64  6c 65 0d 14 f0 0f 3b 20  |con handle....; |
00003370  72 65 74 75 72 6e 73 20  3a 0d 14 fa 32 3b 20 72  |returns :...2; r|
00003380  32 20 3d 20 74 72 75 65  20 6f 72 20 66 61 6c 73  |2 = true or fals|
00003390  65 20 74 6f 20 73 65 74  20 6f 72 20 75 6e 73 65  |e to set or unse|
000033a0  74 20 28 2d 31 20 6f 72  20 30 29 0d 15 04 05 3b  |t (-1 or 0)....;|
000033b0  0d 15 0e 12 2e 67 65 74  69 63 6f 6e 73 65 6c 65  |.....geticonsele|
000033c0  63 74 0d 15 18 17 20 20  20 53 54 4d 46 44 20 28  |ct....   STMFD (|
000033d0  73 70 29 21 2c 7b 72 31  7d 0d 15 22 12 20 20 20  |sp)!,{r1}..".   |
000033e0  54 45 51 20 20 20 72 33  2c 23 30 0d 15 2c 19 20  |TEQ   r3,#0..,. |
000033f0  20 20 42 4c 4e 45 20 20  63 6f 6e 76 65 72 74 6e  |  BLNE  convertn|
00003400  61 6d 65 33 0d 15 36 15  20 20 20 42 4c 20 20 20  |ame3..6.   BL   |
00003410  20 67 65 74 73 74 61 74  65 0d 15 40 21 20 20 20  | getstate..@!   |
00003420  53 57 49 20 20 20 22 58  57 69 6d 70 5f 47 65 74  |SWI   "XWimp_Get|
00003430  49 63 6f 6e 53 74 61 74  65 22 0d 15 4a 14 20 20  |IconState"..J.  |
00003440  20 42 56 53 20 20 20 65  78 69 74 73 77 69 0d 15  | BVS   exitswi..|
00003450  54 18 20 20 20 4c 44 52  20 20 20 72 39 2c 5b 72  |T.   LDR   r9,[r|
00003460  31 2c 23 32 34 5d 0d 15  5e 17 20 20 20 80 20 20  |1,#24]..^.   .  |
00003470  20 72 39 2c 72 39 2c 23  31 3c 3c 32 31 0d 15 68  | r9,r9,#1<<21..h|
00003480  12 20 20 20 4d 56 4e 20  20 20 72 30 2c 23 30 0d  |.   MVN   r0,#0.|
00003490  15 72 12 20 20 20 43 4d  50 20 20 20 72 39 2c 23  |.r.   CMP   r9,#|
000034a0  30 0d 15 7c 0f 20 20 20  ec 51 20 72 30 2c 23 30  |0..|.   .Q r0,#0|
000034b0  0d 15 86 11 2e 67 65 74  73 65 6c 65 63 74 6f 75  |.....getselectou|
000034c0  74 0d 15 90 17 20 20 20  4c 44 4d 46 44 20 28 73  |t....   LDMFD (s|
000034d0  70 29 21 2c 7b 72 31 7d  0d 15 9a 14 20 20 20 42  |p)!,{r1}....   B|
000034e0  20 20 20 20 20 65 78 69  74 73 77 69 0d 15 a4 05  |     exitswi....|
000034f0  3b 0d 15 ae 18 3b 20 72  30 20 3d 20 77 69 6e 64  |;....; r0 = wind|
00003500  6f 77 20 68 61 6e 64 6c  65 0d 15 b8 16 3b 20 72  |ow handle....; r|
00003510  31 20 3d 20 69 63 6f 6e  20 68 61 6e 64 6c 65 0d  |1 = icon handle.|
00003520  15 c2 32 3b 20 72 32 20  3d 20 74 72 75 65 20 6f  |..2; r2 = true o|
00003530  72 20 66 61 6c 73 65 20  74 6f 20 73 65 74 20 6f  |r false to set o|
00003540  72 20 75 6e 73 65 74 20  28 2d 31 20 6f 72 20 30  |r unset (-1 or 0|
00003550  29 0d 15 cc 05 3b 0d 15  d6 12 2e 73 65 74 69 63  |)....;.....setic|
00003560  6f 6e 65 6e 61 62 6c 65  0d 15 e0 17 20 20 20 53  |onenable....   S|
00003570  54 4d 46 44 20 28 73 70  29 21 2c 7b 72 31 7d 0d  |TMFD (sp)!,{r1}.|
00003580  15 ea 12 20 20 20 54 45  51 20 20 20 72 33 2c 23  |...   TEQ   r3,#|
00003590  30 0d 15 f4 19 20 20 20  42 4c 4e 45 20 20 63 6f  |0....   BLNE  co|
000035a0  6e 76 65 72 74 6e 61 6d  65 33 0d 15 fe 15 20 20  |nvertname3....  |
000035b0  20 42 4c 20 20 20 20 67  65 74 73 74 61 74 65 0d  | BL    getstate.|
000035c0  16 08 21 20 20 20 53 57  49 20 20 20 22 58 57 69  |..!   SWI   "XWi|
000035d0  6d 70 5f 47 65 74 49 63  6f 6e 53 74 61 74 65 22  |mp_GetIconState"|
000035e0  0d 16 12 16 20 20 20 42  56 53 20 20 20 65 6e 61  |....   BVS   ena|
000035f0  62 6c 65 6f 75 74 0d 16  1c 17 20 20 20 80 20 20  |bleout....   .  |
00003600  20 72 39 2c 72 32 2c 23  31 3c 3c 32 32 0d 16 26  | r9,r2,#1<<22..&|
00003610  17 20 20 20 53 54 52 20  20 20 72 39 2c 5b 72 31  |.   STR   r9,[r1|
00003620  2c 23 38 5d 0d 16 30 16  20 20 20 4d 4f 56 20 20  |,#8]..0.   MOV  |
00003630  20 72 39 2c 23 31 3c 3c  32 32 0d 16 3a 18 20 20  | r9,#1<<22..:.  |
00003640  20 53 54 52 20 20 20 72  39 2c 5b 72 31 2c 23 31  | STR   r9,[r1,#1|
00003650  32 5d 0d 16 44 21 20 20  20 53 57 49 20 20 20 22  |2]..D!   SWI   "|
00003660  58 57 69 6d 70 5f 53 65  74 49 63 6f 6e 53 74 61  |XWimp_SetIconSta|
00003670  74 65 22 0d 16 4e 0e 2e  65 6e 61 62 6c 65 6f 75  |te"..N..enableou|
00003680  74 0d 16 58 17 20 20 20  4c 44 4d 46 44 20 28 73  |t..X.   LDMFD (s|
00003690  70 29 21 2c 7b 72 31 7d  0d 16 62 14 20 20 20 42  |p)!,{r1}..b.   B|
000036a0  20 20 20 20 20 65 78 69  74 73 77 69 0d 16 6c 05  |     exitswi..l.|
000036b0  3b 0d 16 76 18 3b 20 72  30 20 3d 20 77 69 6e 64  |;..v.; r0 = wind|
000036c0  6f 77 20 68 61 6e 64 6c  65 0d 16 80 16 3b 20 72  |ow handle....; r|
000036d0  31 20 3d 20 69 63 6f 6e  20 68 61 6e 64 6c 65 0d  |1 = icon handle.|
000036e0  16 8a 0d 3b 20 72 65 74  75 72 6e 73 0d 16 94 32  |...; returns...2|
000036f0  3b 20 72 32 20 3d 20 74  72 75 65 20 6f 72 20 66  |; r2 = true or f|
00003700  61 6c 73 65 20 74 6f 20  73 65 74 20 6f 72 20 75  |alse to set or u|
00003710  6e 73 65 74 20 28 2d 31  20 6f 72 20 30 29 0d 16  |nset (-1 or 0)..|
00003720  9e 05 3b 0d 16 a8 12 2e  67 65 74 69 63 6f 6e 65  |..;.....geticone|
00003730  6e 61 62 6c 65 0d 16 b2  17 20 20 20 53 54 4d 46  |nable....   STMF|
00003740  44 20 28 73 70 29 21 2c  7b 72 31 7d 0d 16 bc 12  |D (sp)!,{r1}....|
00003750  20 20 20 54 45 51 20 20  20 72 33 2c 23 30 0d 16  |   TEQ   r3,#0..|
00003760  c6 19 20 20 20 42 4c 4e  45 20 20 63 6f 6e 76 65  |..   BLNE  conve|
00003770  72 74 6e 61 6d 65 33 0d  16 d0 15 20 20 20 42 4c  |rtname3....   BL|
00003780  20 20 20 20 67 65 74 73  74 61 74 65 0d 16 da 21  |    getstate...!|
00003790  20 20 20 53 57 49 20 20  20 22 58 57 69 6d 70 5f  |   SWI   "XWimp_|
000037a0  47 65 74 49 63 6f 6e 53  74 61 74 65 22 0d 16 e4  |GetIconState"...|
000037b0  19 20 20 20 42 56 53 20  20 20 67 65 74 65 6e 61  |.   BVS   getena|
000037c0  62 6c 65 6f 75 74 0d 16  ee 18 20 20 20 4c 44 52  |bleout....   LDR|
000037d0  20 20 20 72 39 2c 5b 72  31 2c 23 32 34 5d 0d 16  |   r9,[r1,#24]..|
000037e0  f8 17 20 20 20 80 20 20  20 72 39 2c 72 39 2c 23  |..   .   r9,r9,#|
000037f0  31 3c 3c 32 32 0d 17 02  12 20 20 20 4d 56 4e 20  |1<<22....   MVN |
00003800  20 20 72 30 2c 23 30 0d  17 0c 12 20 20 20 43 4d  |  r0,#0....   CM|
00003810  50 20 20 20 72 39 2c 23  30 0d 17 16 0f 20 20 20  |P   r9,#0....   |
00003820  ec 51 20 72 30 2c 23 30  0d 17 20 11 2e 67 65 74  |.Q r0,#0.. ..get|
00003830  65 6e 61 62 6c 65 6f 75  74 0d 17 2a 17 20 20 20  |enableout..*.   |
00003840  4c 44 4d 46 44 20 28 73  70 29 21 2c 7b 72 31 7d  |LDMFD (sp)!,{r1}|
00003850  0d 17 34 14 20 20 20 42  20 20 20 20 20 65 78 69  |..4.   B     exi|
00003860  74 73 77 69 0d 17 3e 05  3b 0d 17 48 18 3b 20 72  |tswi..>.;..H.; r|
00003870  30 20 3d 20 77 69 6e 64  6f 77 20 68 61 6e 64 6c  |0 = window handl|
00003880  65 0d 17 52 16 3b 20 72  31 20 3d 20 69 63 6f 6e  |e..R.; r1 = icon|
00003890  20 68 61 6e 64 6c 65 0d  17 5c 3b 3b 20 72 32 20  | handle..\;; r2 |
000038a0  3d 20 73 74 72 69 6e 67  20 65 6e 64 69 6e 67 20  |= string ending |
000038b0  69 6e 20 61 20 63 6f 6e  74 72 6f 6c 20 63 68 61  |in a control cha|
000038c0  72 61 63 74 65 72 20 69  65 20 97 49 49 20 3c 20  |racter ie .II < |
000038d0  33 33 0d 17 66 05 3b 0d  17 70 10 2e 73 65 74 69  |33..f.;..p..seti|
000038e0  63 6f 6e 74 65 78 74 0d  17 7a 17 20 20 20 53 54  |context..z.   ST|
000038f0  4d 46 44 20 28 73 70 29  21 2c 7b 72 31 7d 0d 17  |MFD (sp)!,{r1}..|
00003900  84 12 20 20 20 54 45 51  20 20 20 72 33 2c 23 30  |..   TEQ   r3,#0|
00003910  0d 17 8e 19 20 20 20 42  4c 4e 45 20 20 63 6f 6e  |....   BLNE  con|
00003920  76 65 72 74 6e 61 6d 65  33 0d 17 98 15 20 20 20  |vertname3....   |
00003930  42 4c 20 20 20 20 67 65  74 73 74 61 74 65 0d 17  |BL    getstate..|
00003940  a2 21 20 20 20 53 57 49  20 20 20 22 58 57 69 6d  |.!   SWI   "XWim|
00003950  70 5f 47 65 74 49 63 6f  6e 53 74 61 74 65 22 0d  |p_GetIconState".|
00003960  17 ac 17 20 20 20 42 56  53 20 20 20 73 65 74 74  |...   BVS   sett|
00003970  65 78 74 6f 75 74 0d 17  b6 18 20 20 20 4c 44 52  |extout....   LDR|
00003980  20 20 20 72 39 2c 5b 72  31 2c 23 32 34 5d 0d 17  |   r9,[r1,#24]..|
00003990  c0 15 20 20 20 54 53 54  20 20 20 72 39 2c 23 31  |..   TST   r9,#1|
000039a0  3c 3c 38 0d 17 ca 1d 20  20 20 42 45 51 20 20 20  |<<8....   BEQ   |
000039b0  73 74 72 6e 6f 74 69 6e  64 69 72 65 63 74 65 64  |strnotindirected|
000039c0  0d 17 d4 12 20 20 20 4d  4f 56 20 20 20 72 39 2c  |....   MOV   r9,|
000039d0  23 30 0d 17 de 17 20 20  20 53 54 52 20 20 20 72  |#0....   STR   r|
000039e0  39 2c 5b 72 31 2c 23 38  5d 0d 17 e8 18 20 20 20  |9,[r1,#8]....   |
000039f0  53 54 52 20 20 20 72 39  2c 5b 72 31 2c 23 31 32  |STR   r9,[r1,#12|
00003a00  5d 0d 17 f2 12 20 20 20  4d 4f 56 20 20 20 72 39  |]....   MOV   r9|
00003a10  2c 72 32 0d 17 fc 19 20  20 20 4c 44 52 20 20 20  |,r2....   LDR   |
00003a20  72 31 30 2c 5b 72 31 2c  23 32 38 5d 0d 18 06 19  |r10,[r1,#28]....|
00003a30  20 20 20 4c 44 52 20 20  20 72 31 31 2c 5b 72 31  |   LDR   r11,[r1|
00003a40  2c 23 33 36 5d 0d 18 10  17 20 20 20 42 4c 20 20  |,#36]....   BL  |
00003a50  20 20 63 6f 70 79 73 74  72 69 6e 67 0d 18 1a 21  |  copystring...!|
00003a60  20 20 20 53 57 49 20 20  20 22 58 57 69 6d 70 5f  |   SWI   "XWimp_|
00003a70  53 65 74 49 63 6f 6e 53  74 61 74 65 22 0d 18 24  |SetIconState"..$|
00003a80  0f 2e 73 65 74 74 65 78  74 6f 75 74 0d 18 2e 17  |..settextout....|
00003a90  20 20 20 4c 44 4d 46 44  20 28 73 70 29 21 2c 7b  |   LDMFD (sp)!,{|
00003aa0  72 31 7d 0d 18 38 14 20  20 20 42 20 20 20 20 20  |r1}..8.   B     |
00003ab0  65 78 69 74 73 77 69 0d  18 42 05 3b 0d 18 4c 18  |exitswi..B.;..L.|
00003ac0  3b 20 72 30 20 3d 20 77  69 6e 64 6f 77 20 68 61  |; r0 = window ha|
00003ad0  6e 64 6c 65 0d 18 56 16  3b 20 72 31 20 3d 20 69  |ndle..V.; r1 = i|
00003ae0  63 6f 6e 20 68 61 6e 64  6c 65 0d 18 60 0f 3b 20  |con handle..`.; |
00003af0  72 65 74 75 72 6e 73 20  3a 0d 18 6a 16 3b 20 72  |returns :..j.; r|
00003b00  30 20 3d 20 74 65 78 74  20 73 74 72 69 6e 67 0d  |0 = text string.|
00003b10  18 74 05 3b 0d 18 7e 10  2e 67 65 74 69 63 6f 6e  |.t.;..~..geticon|
00003b20  74 65 78 74 0d 18 88 17  20 20 20 53 54 4d 46 44  |text....   STMFD|
00003b30  20 28 73 70 29 21 2c 7b  72 31 7d 0d 18 92 12 20  | (sp)!,{r1}.... |
00003b40  20 20 54 45 51 20 20 20  72 33 2c 23 30 0d 18 9c  |  TEQ   r3,#0...|
00003b50  19 20 20 20 42 4c 4e 45  20 20 63 6f 6e 76 65 72  |.   BLNE  conver|
00003b60  74 6e 61 6d 65 33 0d 18  a6 15 20 20 20 42 4c 20  |tname3....   BL |
00003b70  20 20 20 67 65 74 73 74  61 74 65 0d 18 b0 21 20  |   getstate...! |
00003b80  20 20 53 57 49 20 20 20  22 58 57 69 6d 70 5f 47  |  SWI   "XWimp_G|
00003b90  65 74 49 63 6f 6e 53 74  61 74 65 22 0d 18 ba 17  |etIconState"....|
00003ba0  20 20 20 42 56 53 20 20  20 67 65 74 74 65 78 74  |   BVS   gettext|
00003bb0  6f 75 74 0d 18 c4 18 20  20 20 4c 44 52 20 20 20  |out....   LDR   |
00003bc0  72 39 2c 5b 72 31 2c 23  32 34 5d 0d 18 ce 15 20  |r9,[r1,#24].... |
00003bd0  20 20 54 53 54 20 20 20  72 39 2c 23 31 3c 3c 38  |  TST   r9,#1<<8|
00003be0  0d 18 d8 16 20 20 20 41  44 44 45 51 20 72 30 2c  |....   ADDEQ r0,|
00003bf0  72 31 2c 23 32 38 0d 18  e2 17 20 20 20 42 45 51  |r1,#28....   BEQ|
00003c00  20 20 20 67 65 74 74 65  78 74 6f 75 74 0d 18 ec  |   gettextout...|
00003c10  18 20 20 20 4c 44 52 20  20 20 72 30 2c 5b 72 31  |.   LDR   r0,[r1|
00003c20  2c 23 32 38 5d 0d 18 f6  0f 2e 67 65 74 74 65 78  |,#28].....gettex|
00003c30  74 6f 75 74 0d 19 00 17  20 20 20 4c 44 4d 46 44  |tout....   LDMFD|
00003c40  20 28 73 70 29 21 2c 7b  72 31 7d 0d 19 0a 14 20  | (sp)!,{r1}.... |
00003c50  20 20 42 20 20 20 20 20  65 78 69 74 73 77 69 0d  |  B     exitswi.|
00003c60  19 14 05 3b 0d 19 1e 18  3b 20 72 30 20 3d 20 77  |...;....; r0 = w|
00003c70  69 6e 64 6f 77 20 68 61  6e 64 6c 65 0d 19 28 16  |indow handle..(.|
00003c80  3b 20 72 31 20 3d 20 69  63 6f 6e 20 68 61 6e 64  |; r1 = icon hand|
00003c90  6c 65 0d 19 32 3b 3b 20  72 32 20 3d 20 73 74 72  |le..2;; r2 = str|
00003ca0  69 6e 67 20 65 6e 64 69  6e 67 20 69 6e 20 61 20  |ing ending in a |
00003cb0  63 6f 6e 74 72 6f 6c 20  63 68 61 72 61 63 74 65  |control characte|
00003cc0  72 20 69 65 20 97 49 49  20 3c 20 33 33 0d 19 3c  |r ie .II < 33..<|
00003cd0  05 3b 0d 19 46 16 2e 73  65 74 69 63 6f 6e 76 61  |.;..F..seticonva|
00003ce0  6c 69 64 61 74 69 6f 6e  0d 19 50 17 20 20 20 53  |lidation..P.   S|
00003cf0  54 4d 46 44 20 28 73 70  29 21 2c 7b 72 31 7d 0d  |TMFD (sp)!,{r1}.|
00003d00  19 5a 12 20 20 20 54 45  51 20 20 20 72 33 2c 23  |.Z.   TEQ   r3,#|
00003d10  30 0d 19 64 19 20 20 20  42 4c 4e 45 20 20 63 6f  |0..d.   BLNE  co|
00003d20  6e 76 65 72 74 6e 61 6d  65 33 0d 19 6e 15 20 20  |nvertname3..n.  |
00003d30  20 42 4c 20 20 20 20 67  65 74 73 74 61 74 65 0d  | BL    getstate.|
00003d40  19 78 21 20 20 20 53 57  49 20 20 20 22 58 57 69  |.x!   SWI   "XWi|
00003d50  6d 70 5f 47 65 74 49 63  6f 6e 53 74 61 74 65 22  |mp_GetIconState"|
00003d60  0d 19 82 18 20 20 20 42  56 53 20 20 20 73 65 74  |....   BVS   set|
00003d70  76 61 6c 69 64 6f 75 74  0d 19 8c 18 20 20 20 4c  |validout....   L|
00003d80  44 52 20 20 20 72 39 2c  5b 72 31 2c 23 32 34 5d  |DR   r9,[r1,#24]|
00003d90  0d 19 96 15 20 20 20 54  53 54 20 20 20 72 39 2c  |....   TST   r9,|
00003da0  23 31 3c 3c 38 0d 19 a0  1d 20 20 20 42 45 51 20  |#1<<8....   BEQ |
00003db0  20 20 73 74 72 6e 6f 74  69 6e 64 69 72 65 63 74  |  strnotindirect|
00003dc0  65 64 0d 19 aa 11 20 20  20 4d 4f 56 20 20 20 72  |ed....   MOV   r|
00003dd0  39 2c 30 0d 19 b4 17 20  20 20 53 54 52 20 20 20  |9,0....   STR   |
00003de0  72 39 2c 5b 72 31 2c 23  38 5d 0d 19 be 18 20 20  |r9,[r1,#8]....  |
00003df0  20 53 54 52 20 20 20 72  39 2c 5b 72 31 2c 23 31  | STR   r9,[r1,#1|
00003e00  32 5d 0d 19 c8 12 20 20  20 4d 4f 56 20 20 20 72  |2]....   MOV   r|
00003e10  39 2c 72 32 0d 19 d2 19  20 20 20 4c 44 52 20 20  |9,r2....   LDR  |
00003e20  20 72 31 30 2c 5b 72 31  2c 23 33 32 5d 0d 19 dc  | r10,[r1,#32]...|
00003e30  15 20 20 20 4d 4f 56 20  20 20 72 31 31 2c 23 32  |.   MOV   r11,#2|
00003e40  35 35 0d 19 e6 17 20 20  20 42 4c 20 20 20 20 63  |55....   BL    c|
00003e50  6f 70 79 73 74 72 69 6e  67 0d 19 f0 21 20 20 20  |opystring...!   |
00003e60  53 57 49 20 20 20 22 58  57 69 6d 70 5f 53 65 74  |SWI   "XWimp_Set|
00003e70  49 63 6f 6e 53 74 61 74  65 22 0d 19 fa 10 2e 73  |IconState".....s|
00003e80  65 74 76 61 6c 69 64 6f  75 74 0d 1a 04 17 20 20  |etvalidout....  |
00003e90  20 4c 44 4d 46 44 20 28  73 70 29 21 2c 7b 72 31  | LDMFD (sp)!,{r1|
00003ea0  7d 0d 1a 0e 14 20 20 20  42 20 20 20 20 20 65 78  |}....   B     ex|
00003eb0  69 74 73 77 69 0d 1a 18  05 3b 0d 1a 22 18 3b 20  |itswi....;..".; |
00003ec0  72 30 20 3d 20 77 69 6e  64 6f 77 20 68 61 6e 64  |r0 = window hand|
00003ed0  6c 65 0d 1a 2c 16 3b 20  72 31 20 3d 20 69 63 6f  |le..,.; r1 = ico|
00003ee0  6e 20 68 61 6e 64 6c 65  0d 1a 36 0f 3b 20 72 65  |n handle..6.; re|
00003ef0  74 75 72 6e 73 20 3a 0d  1a 40 16 3b 20 72 30 20  |turns :..@.; r0 |
00003f00  3d 20 74 65 78 74 20 73  74 72 69 6e 67 0d 1a 4a  |= text string..J|
00003f10  05 3b 0d 1a 54 16 2e 67  65 74 69 63 6f 6e 76 61  |.;..T..geticonva|
00003f20  6c 69 64 61 74 69 6f 6e  0d 1a 5e 17 20 20 20 53  |lidation..^.   S|
00003f30  54 4d 46 44 20 28 73 70  29 21 2c 7b 72 31 7d 0d  |TMFD (sp)!,{r1}.|
00003f40  1a 68 12 20 20 20 54 45  51 20 20 20 72 33 2c 23  |.h.   TEQ   r3,#|
00003f50  30 0d 1a 72 19 20 20 20  42 4c 4e 45 20 20 63 6f  |0..r.   BLNE  co|
00003f60  6e 76 65 72 74 6e 61 6d  65 33 0d 1a 7c 15 20 20  |nvertname3..|.  |
00003f70  20 42 4c 20 20 20 20 67  65 74 73 74 61 74 65 0d  | BL    getstate.|
00003f80  1a 86 21 20 20 20 53 57  49 20 20 20 22 58 57 69  |..!   SWI   "XWi|
00003f90  6d 70 5f 47 65 74 49 63  6f 6e 53 74 61 74 65 22  |mp_GetIconState"|
00003fa0  0d 1a 90 18 20 20 20 42  56 53 20 20 20 67 65 74  |....   BVS   get|
00003fb0  76 61 6c 69 64 6f 75 74  0d 1a 9a 18 20 20 20 4c  |validout....   L|
00003fc0  44 52 20 20 20 72 39 2c  5b 72 31 2c 23 32 34 5d  |DR   r9,[r1,#24]|
00003fd0  0d 1a a4 15 20 20 20 54  53 54 20 20 20 72 39 2c  |....   TST   r9,|
00003fe0  23 31 3c 3c 38 0d 1a ae  1d 20 20 20 42 45 51 20  |#1<<8....   BEQ |
00003ff0  20 20 73 74 72 6e 6f 74  69 6e 64 69 72 65 63 74  |  strnotindirect|
00004000  65 64 0d 1a b8 18 20 20  20 4c 44 52 20 20 20 72  |ed....   LDR   r|
00004010  30 2c 5b 72 31 2c 23 33  32 5d 0d 1a c2 10 2e 67  |0,[r1,#32].....g|
00004020  65 74 76 61 6c 69 64 6f  75 74 0d 1a cc 17 20 20  |etvalidout....  |
00004030  20 4c 44 4d 46 44 20 28  73 70 29 21 2c 7b 72 31  | LDMFD (sp)!,{r1|
00004040  7d 0d 1a d6 14 20 20 20  42 20 20 20 20 20 65 78  |}....   B     ex|
00004050  69 74 73 77 69 0d 1a e0  05 3b 0d 1a ea 18 3b 20  |itswi....;....; |
00004060  72 30 20 3d 20 77 69 6e  64 6f 77 20 68 61 6e 64  |r0 = window hand|
00004070  6c 65 0d 1a f4 16 3b 20  72 32 20 3d 20 74 65 78  |le....; r2 = tex|
00004080  74 20 73 74 72 69 6e 67  0d 1a fe 05 3b 0d 1b 08  |t string....;...|
00004090  13 2e 73 65 74 77 69 6e  64 6f 77 74 69 74 6c 65  |..setwindowtitle|
000040a0  0d 1b 12 17 20 20 20 53  54 4d 46 44 20 28 73 70  |....   STMFD (sp|
000040b0  29 21 2c 7b 72 31 7d 0d  1b 1c 12 20 20 20 54 45  |)!,{r1}....   TE|
000040c0  51 20 20 20 72 33 2c 23  30 0d 1b 26 19 20 20 20  |Q   r3,#0..&.   |
000040d0  42 4c 4e 45 20 20 63 6f  6e 76 65 72 74 6e 61 6d  |BLNE  convertnam|
000040e0  65 33 0d 1b 30 17 20 20  20 41 44 44 20 20 20 72  |e3..0.   ADD   r|
000040f0  31 2c 77 73 2c 23 62 6c  6b 0d 1b 3a 14 20 20 20  |1,ws,#blk..:.   |
00004100  53 54 52 20 20 20 72 30  2c 5b 72 31 5d 0d 1b 44  |STR   r0,[r1]..D|
00004110  22 20 20 20 53 57 49 20  20 20 22 58 57 69 6d 70  |"   SWI   "XWimp|
00004120  5f 47 65 74 57 69 6e 64  6f 77 49 6e 66 6f 22 0d  |_GetWindowInfo".|
00004130  1b 4e 18 20 20 20 42 56  53 20 20 20 73 65 74 74  |.N.   BVS   sett|
00004140  69 74 6c 65 6f 75 74 0d  1b 58 18 20 20 20 4c 44  |itleout..X.   LD|
00004150  52 20 20 20 72 38 2c 5b  72 31 2c 23 36 30 5d 0d  |R   r8,[r1,#60].|
00004160  1b 62 15 20 20 20 54 53  54 20 20 20 72 38 2c 23  |.b.   TST   r8,#|
00004170  31 3c 3c 38 0d 1b 6c 1e  20 20 20 42 45 51 20 20  |1<<8..l.   BEQ  |
00004180  20 77 73 74 72 6e 6f 74  69 6e 64 69 72 65 63 74  | wstrnotindirect|
00004190  65 64 0d 1b 76 12 20 20  20 4d 4f 56 20 20 20 72  |ed..v.   MOV   r|
000041a0  39 2c 72 32 0d 1b 80 19  20 20 20 4c 44 52 20 20  |9,r2....   LDR  |
000041b0  20 72 31 30 2c 5b 72 31  2c 23 37 36 5d 0d 1b 8a  | r10,[r1,#76]...|
000041c0  19 20 20 20 4c 44 52 20  20 20 72 31 31 2c 5b 72  |.   LDR   r11,[r|
000041d0  31 2c 23 38 34 5d 0d 1b  94 17 20 20 20 42 4c 20  |1,#84]....   BL |
000041e0  20 20 20 63 6f 70 79 73  74 72 69 6e 67 0d 1b 9e  |   copystring...|
000041f0  10 2e 73 65 74 74 69 74  6c 65 6f 75 74 0d 1b a8  |..settitleout...|
00004200  17 20 20 20 4c 44 4d 46  44 20 28 73 70 29 21 2c  |.   LDMFD (sp)!,|
00004210  7b 72 31 7d 0d 1b b2 14  20 20 20 42 20 20 20 20  |{r1}....   B    |
00004220  20 65 78 69 74 73 77 69  0d 1b bc 05 3b 0d 1b c6  | exitswi....;...|
00004230  34 2e 77 73 74 72 6e 6f  74 69 6e 64 69 72 65 63  |4.wstrnotindirec|
00004240  74 65 64 20 20 20 20 20  20 20 20 20 20 20 20 20  |ted             |
00004250  20 20 3b 20 65 72 72 6f  72 20 6d 65 73 73 61 67  |  ; error messag|
00004260  65 0d 1b d0 17 20 20 20  4c 44 4d 46 44 20 28 73  |e....   LDMFD (s|
00004270  70 29 21 2c 7b 72 31 7d  0d 1b da 1a 20 20 20 41  |p)!,{r1}....   A|
00004280  44 52 20 20 20 72 30 2c  77 6e 6f 74 69 6e 64 73  |DR   r0,wnotinds|
00004290  74 72 0d 1b e4 16 20 20  20 42 20 20 20 20 20 6d  |tr....   B     m|
000042a0  61 6b 65 65 72 72 6f 72  0d 1b ee 05 3b 0d 1b f8  |akeerror....;...|
000042b0  0f 2e 77 6e 6f 74 69 6e  64 73 74 72 0d 1c 02 16  |..wnotindstr....|
000042c0  45 51 55 44 20 20 45 72  72 6f 72 42 61 73 65 2b  |EQUD  ErrorBase+|
000042d0  31 32 0d 1c 0c 31 45 51  55 53 20 20 22 57 69 6e  |12...1EQUS  "Win|
000042e0  64 6f 77 20 74 69 74 6c  65 20 73 74 72 69 6e 67  |dow title string|
000042f0  20 69 73 20 6e 6f 74 20  69 6e 64 69 72 65 63 74  | is not indirect|
00004300  65 64 22 0d 1c 16 0b 45  51 55 42 20 20 30 0d 1c  |ed"....EQUB  0..|
00004310  20 09 41 4c 49 47 4e 0d  1c 2a 05 3b 0d 1c 34 18  | .ALIGN..*.;..4.|
00004320  3b 20 72 30 20 3d 20 77  69 6e 64 6f 77 20 68 61  |; r0 = window ha|
00004330  6e 64 6c 65 0d 1c 3e 05  3b 0d 1c 48 0d 3b 20 72  |ndle..>.;..H.; r|
00004340  65 74 75 72 6e 73 0d 1c  52 05 3b 0d 1c 5c 16 3b  |eturns..R.;..\.;|
00004350  20 72 32 20 3d 20 74 65  78 74 20 73 74 72 69 6e  | r2 = text strin|
00004360  67 0d 1c 66 05 3b 0d 1c  70 13 2e 67 65 74 77 69  |g..f.;..p..getwi|
00004370  6e 64 6f 77 74 69 74 6c  65 0d 1c 7a 17 20 20 20  |ndowtitle..z.   |
00004380  53 54 4d 46 44 20 28 73  70 29 21 2c 7b 72 31 7d  |STMFD (sp)!,{r1}|
00004390  0d 1c 84 12 20 20 20 54  45 51 20 20 20 72 33 2c  |....   TEQ   r3,|
000043a0  23 30 0d 1c 8e 19 20 20  20 42 4c 4e 45 20 20 63  |#0....   BLNE  c|
000043b0  6f 6e 76 65 72 74 6e 61  6d 65 33 0d 1c 98 17 20  |onvertname3.... |
000043c0  20 20 41 44 44 20 20 20  72 31 2c 77 73 2c 23 62  |  ADD   r1,ws,#b|
000043d0  6c 6b 0d 1c a2 14 20 20  20 53 54 52 20 20 20 72  |lk....   STR   r|
000043e0  30 2c 5b 72 31 5d 0d 1c  ac 22 20 20 20 53 57 49  |0,[r1]..."   SWI|
000043f0  20 20 20 22 58 57 69 6d  70 5f 47 65 74 57 69 6e  |   "XWimp_GetWin|
00004400  64 6f 77 49 6e 66 6f 22  0d 1c b6 18 20 20 20 42  |dowInfo"....   B|
00004410  56 53 20 20 20 67 65 74  74 69 74 6c 65 6f 75 74  |VS   gettitleout|
00004420  0d 1c c0 18 20 20 20 4c  44 52 20 20 20 72 38 2c  |....   LDR   r8,|
00004430  5b 72 31 2c 23 36 30 5d  0d 1c ca 15 20 20 20 54  |[r1,#60]....   T|
00004440  53 54 20 20 20 72 38 2c  23 31 3c 3c 38 0d 1c d4  |ST   r8,#1<<8...|
00004450  16 20 20 20 41 44 44 45  51 20 72 32 2c 72 31 2c  |.   ADDEQ r2,r1,|
00004460  23 37 36 0d 1c de 18 20  20 20 42 45 51 20 20 20  |#76....   BEQ   |
00004470  67 65 74 74 69 74 6c 65  6f 75 74 0d 1c e8 18 20  |gettitleout.... |
00004480  20 20 4c 44 52 20 20 20  72 32 2c 5b 72 31 2c 23  |  LDR   r2,[r1,#|
00004490  37 36 5d 0d 1c f2 10 2e  67 65 74 74 69 74 6c 65  |76].....gettitle|
000044a0  6f 75 74 0d 1c fc 17 20  20 20 4c 44 4d 46 44 20  |out....   LDMFD |
000044b0  28 73 70 29 21 2c 7b 72  31 7d 0d 1d 06 14 20 20  |(sp)!,{r1}....  |
000044c0  20 42 20 20 20 20 20 65  78 69 74 73 77 69 0d 1d  | B     exitswi..|
000044d0  10 05 3b 0d 1d 1a 18 3b  20 72 30 20 3d 20 77 69  |..;....; r0 = wi|
000044e0  6e 64 6f 77 20 68 61 6e  64 6c 65 0d 1d 24 05 3b  |ndow handle..$.;|
000044f0  0d 1d 2e 11 2e 75 70 64  61 74 65 77 69 6e 64 6f  |.....updatewindo|
00004500  77 0d 1d 38 20 20 20 20  53 54 4d 46 44 20 28 73  |w..8    STMFD (s|
00004510  70 29 21 2c 7b 72 31 2c  72 32 2c 72 33 2c 72 34  |p)!,{r1,r2,r3,r4|
00004520  7d 0d 1d 42 12 20 20 20  54 45 51 20 20 20 72 31  |}..B.   TEQ   r1|
00004530  2c 23 30 0d 1d 4c 19 20  20 20 42 4c 4e 45 20 20  |,#0..L.   BLNE  |
00004540  63 6f 6e 76 65 72 74 6e  61 6d 65 31 0d 1d 56 17  |convertname1..V.|
00004550  20 20 20 41 44 44 20 20  20 72 31 2c 77 73 2c 23  |   ADD   r1,ws,#|
00004560  62 6c 6b 0d 1d 60 14 20  20 20 53 54 52 20 20 20  |blk..`.   STR   |
00004570  72 30 2c 5b 72 31 5d 0d  1d 6a 23 20 20 20 53 57  |r0,[r1]..j#   SW|
00004580  49 20 20 20 22 58 57 69  6d 70 5f 47 65 74 57 69  |I   "XWimp_GetWi|
00004590  6e 64 6f 77 53 74 61 74  65 22 0d 1d 74 1a 20 20  |ndowState"..t.  |
000045a0  20 42 56 53 20 20 20 75  70 64 61 74 65 77 69 6e  | BVS   updatewin|
000045b0  64 6f 77 31 0d 1d 7e 18  20 20 20 4c 44 52 20 20  |dow1..~.   LDR  |
000045c0  20 72 30 2c 5b 72 31 2c  23 33 32 5d 0d 1d 88 16  | r0,[r1,#32]....|
000045d0  20 20 20 54 53 54 20 20  20 72 30 2c 23 31 3c 3c  |   TST   r0,#1<<|
000045e0  31 36 0d 1d 92 1a 20 20  20 42 45 51 20 20 20 75  |16....   BEQ   u|
000045f0  70 64 61 74 65 77 69 6e  64 6f 77 31 0d 1d 9c 25  |pdatewindow1...%|
00004600  20 20 20 53 57 49 20 20  20 22 58 57 69 6d 70 5f  |   SWI   "XWimp_|
00004610  47 65 74 57 69 6e 64 6f  77 4f 75 74 6c 69 6e 65  |GetWindowOutline|
00004620  22 0d 1d a6 17 20 20 20  4c 44 52 20 20 20 72 30  |"....   LDR   r0|
00004630  2c 5b 72 31 2c 23 34 5d  0d 1d b0 17 20 20 20 4c  |,[r1,#4]....   L|
00004640  44 52 20 20 20 72 32 2c  5b 72 31 2c 23 38 5d 0d  |DR   r2,[r1,#8].|
00004650  1d ba 18 20 20 20 4c 44  52 20 20 20 72 33 2c 5b  |...   LDR   r3,[|
00004660  72 31 2c 23 31 32 5d 0d  1d c4 18 20 20 20 4c 44  |r1,#12]....   LD|
00004670  52 20 20 20 72 34 2c 5b  72 31 2c 23 31 36 5d 0d  |R   r4,[r1,#16].|
00004680  1d ce 12 20 20 20 4d 4f  56 20 20 20 72 31 2c 72  |...   MOV   r1,r|
00004690  30 0d 1d d8 12 20 20 20  4d 56 4e 20 20 20 72 30  |0....   MVN   r0|
000046a0  2c 23 30 0d 1d e2 20 20  20 20 53 57 49 56 43 20  |,#0...    SWIVC |
000046b0  22 58 57 69 6d 70 5f 46  6f 72 63 65 52 65 64 72  |"XWimp_ForceRedr|
000046c0  61 77 22 0d 1d ec 12 2e  75 70 64 61 74 65 77 69  |aw".....updatewi|
000046d0  6e 64 6f 77 31 0d 1d f6  20 20 20 20 4c 44 4d 46  |ndow1...    LDMF|
000046e0  44 20 28 73 70 29 21 2c  7b 72 31 2c 72 32 2c 72  |D (sp)!,{r1,r2,r|
000046f0  33 2c 72 34 7d 0d 1e 00  14 20 20 20 42 20 20 20  |3,r4}....   B   |
00004700  20 20 65 78 69 74 73 77  69 0d 1e 0a 05 3b 0d 1e  |  exitswi....;..|
00004710  14 15 3b 20 72 30 20 3d  20 6d 65 6e 75 20 62 6c  |..; r0 = menu bl|
00004720  6f 63 6b 0d 1e 1e 16 3b  20 72 31 20 3d 20 6d 65  |ock....; r1 = me|
00004730  6e 75 20 73 74 72 69 6e  67 0d 1e 28 24 3b 20 72  |nu string..($; r|
00004740  32 20 3d 20 77 69 64 74  68 20 6f 66 20 6d 65 6e  |2 = width of men|
00004750  75 20 69 6e 20 4f 53 20  75 6e 69 74 73 0d 1e 32  |u in OS units..2|
00004760  0e 3b 20 72 65 74 75 72  6e 73 3a 0d 1e 3c 35 3b  |.; returns:..<5;|
00004770  20 72 30 20 3d 20 70 6f  73 69 74 69 6f 6e 20 69  | r0 = position i|
00004780  6e 20 6d 65 6e 75 20 62  6c 6f 63 6b 20 66 6f 72  |n menu block for|
00004790  20 66 69 72 73 74 20 6d  65 6e 75 20 69 74 65 6d  | first menu item|
000047a0  0d 1e 46 05 3b 0d 1e 50  0f 2e 6d 65 6e 75 68 65  |..F.;..P..menuhe|
000047b0  61 64 65 72 0d 1e 5a 12  20 20 20 4d 4f 56 20 20  |ader..Z.   MOV  |
000047c0  20 72 39 2c 72 31 0d 1e  64 13 20 20 20 4d 4f 56  | r9,r1..d.   MOV|
000047d0  20 20 20 72 31 30 2c 72  30 0d 1e 6e 14 20 20 20  |   r10,r0..n.   |
000047e0  4d 4f 56 20 20 20 72 31  31 2c 23 31 31 0d 1e 78  |MOV   r11,#11..x|
000047f0  17 20 20 20 42 4c 20 20  20 20 63 6f 70 79 73 74  |.   BL    copyst|
00004800  72 69 6e 67 0d 1e 82 1a  20 20 20 4c 44 52 20 20  |ring....   LDR  |
00004810  20 72 39 2c 28 6d 65 6e  75 64 61 74 61 29 0d 1e  | r9,(menudata)..|
00004820  8c 18 20 20 20 53 54 52  20 20 20 72 39 2c 5b 72  |..   STR   r9,[r|
00004830  30 2c 23 31 32 5d 0d 1e  96 18 20 20 20 53 54 52  |0,#12]....   STR|
00004840  20 20 20 72 32 2c 5b 72  30 2c 23 31 36 5d 0d 1e  |   r2,[r0,#16]..|
00004850  a0 13 20 20 20 4d 4f 56  20 20 20 72 39 2c 23 34  |..   MOV   r9,#4|
00004860  34 0d 1e aa 18 20 20 20  53 54 52 20 20 20 72 39  |4....   STR   r9|
00004870  2c 5b 72 30 2c 23 32 30  5d 0d 1e b4 12 20 20 20  |,[r0,#20]....   |
00004880  4d 4f 56 20 20 20 72 39  2c 23 30 0d 1e be 18 20  |MOV   r9,#0.... |
00004890  20 20 53 54 52 20 20 20  72 39 2c 5b 72 30 2c 23  |  STR   r9,[r0,#|
000048a0  32 34 5d 0d 1e c8 16 20  20 20 41 44 44 20 20 20  |24]....   ADD   |
000048b0  72 30 2c 72 30 2c 23 32  38 0d 1e d2 14 20 20 20  |r0,r0,#28....   |
000048c0  42 20 20 20 20 20 65 78  69 74 73 77 69 0d 1e dc  |B     exitswi...|
000048d0  0d 2e 6d 65 6e 75 64 61  74 61 0d 1e e6 16 45 51  |..menudata....EQ|
000048e0  55 44 20 20 20 20 20 26  30 30 30 37 30 32 30 37  |UD     &00070207|
000048f0  0d 1e f0 05 3b 0d 1e fa  11 2e 6d 61 6b 65 6d 65  |....;.....makeme|
00004900  6e 75 69 74 65 6d 0d 1f  04 12 20 20 20 54 45 51  |nuitem....   TEQ|
00004910  20 20 20 72 33 2c 23 30  0d 1f 0e 1a 20 20 20 42  |   r3,#0....   B|
00004920  45 51 20 20 20 6d 61 6b  65 6d 65 6e 75 69 74 65  |EQ   makemenuite|
00004930  6d 32 0d 1f 18 1a 20 20  20 4c 44 52 20 20 20 72  |m2....   LDR   r|
00004940  38 2c 28 74 65 78 74 64  61 74 61 29 0d 1f 22 12  |8,(textdata)..".|
00004950  20 20 20 54 45 51 20 20  20 72 34 2c 23 30 0d 1f  |   TEQ   r4,#0..|
00004960  2c 18 20 20 20 84 52 4e  45 20 72 38 2c 72 38 2c  |,.   .RNE r8,r8,|
00004970  23 26 46 30 30 30 0d 1f  36 17 20 20 20 84 52 4e  |#&F000..6.   .RN|
00004980  45 20 72 32 2c 72 32 2c  23 31 3c 3c 32 0d 1f 40  |E r2,r2,#1<<2..@|
00004990  14 20 20 20 53 54 52 20  20 20 72 32 2c 5b 72 30  |.   STR   r2,[r0|
000049a0  5d 0d 1f 4a 17 20 20 20  53 54 52 20 20 20 72 38  |]..J.   STR   r8|
000049b0  2c 5b 72 30 2c 23 38 5d  0d 1f 54 12 20 20 20 4d  |,[r0,#8]..T.   M|
000049c0  4f 56 20 20 20 72 39 2c  72 31 0d 1f 5e 13 20 20  |OV   r9,r1..^.  |
000049d0  20 4d 4f 56 20 20 20 72  31 30 2c 72 33 0d 1f 68  | MOV   r10,r3..h|
000049e0  15 20 20 20 4d 4f 56 20  20 20 72 31 31 2c 23 32  |.   MOV   r11,#2|
000049f0  35 35 0d 1f 72 17 20 20  20 42 4c 20 20 20 20 63  |55..r.   BL    c|
00004a00  6f 70 79 73 74 72 69 6e  67 0d 1f 7c 18 20 20 20  |opystring..|.   |
00004a10  53 54 52 20 20 20 72 33  2c 5b 72 30 2c 23 31 32  |STR   r3,[r0,#12|
00004a20  5d 0d 1f 86 12 20 20 20  54 45 51 20 20 20 72 34  |]....   TEQ   r4|
00004a30  2c 23 30 0d 1f 90 19 20  20 20 53 54 52 45 51 20  |,#0....   STREQ |
00004a40  72 31 31 2c 5b 72 30 2c  23 32 30 5d 0d 1f 9a 18  |r11,[r0,#20]....|
00004a50  20 20 20 53 54 52 4e 45  20 72 34 2c 5b 72 30 2c  |   STRNE r4,[r0,|
00004a60  23 32 30 5d 0d 1f a4 12  20 20 20 4d 56 4e 20 20  |#20]....   MVN  |
00004a70  20 72 38 2c 23 30 0d 1f  ae 18 20 20 20 53 54 52  | r8,#0....   STR|
00004a80  20 20 20 72 38 2c 5b 72  30 2c 23 31 36 5d 0d 1f  |   r8,[r0,#16]..|
00004a90  b8 17 20 20 20 53 54 52  20 20 20 72 38 2c 5b 72  |..   STR   r8,[r|
00004aa0  30 2c 23 34 5d 0d 1f c2  13 20 20 20 4d 4f 56 20  |0,#4]....   MOV |
00004ab0  20 20 72 33 2c 72 31 30  0d 1f cc 16 20 20 20 41  |  r3,r10....   A|
00004ac0  44 44 20 20 20 72 30 2c  72 30 2c 23 32 34 0d 1f  |DD   r0,r0,#24..|
00004ad0  d6 14 20 20 20 42 20 20  20 20 20 65 78 69 74 73  |..   B     exits|
00004ae0  77 69 0d 1f e0 0d 2e 74  65 78 74 64 61 74 61 0d  |wi.....textdata.|
00004af0  1f ea 16 45 51 55 44 20  20 20 20 20 26 30 37 30  |...EQUD     &070|
00004b00  30 30 31 32 31 0d 1f f4  0e 2e 74 65 78 74 64 61  |00121.....textda|
00004b10  74 61 32 0d 1f fe 16 45  51 55 44 20 20 20 20 20  |ta2....EQUD     |
00004b20  26 30 37 30 30 30 30 32  31 0d 20 08 05 3b 0d 20  |&07000021. ..;. |
00004b30  12 15 3b 20 72 30 20 3d  20 6d 65 6e 75 20 62 6c  |..; r0 = menu bl|
00004b40  6f 63 6b 0d 20 1c 16 3b  20 72 31 20 3d 20 74 65  |ock. ..; r1 = te|
00004b50  78 74 20 73 74 72 69 6e  67 0d 20 26 12 3b 20 72  |xt string. &.; r|
00004b60  32 20 3d 20 6f 70 74 69  6f 6e 73 0d 20 30 0e 3b  |2 = options. 0.;|
00004b70  20 72 65 74 75 72 6e 73  3a 0d 20 3a 46 3b 20 72  | returns:. :F; r|
00004b80  30 20 3d 20 70 6f 73 69  74 69 6f 6e 20 6f 66 20  |0 = position of |
00004b90  6e 65 78 74 20 6d 65 6e  75 20 69 74 65 6d 20 28  |next menu item (|
00004ba0  20 66 6f 72 20 6e 65 78  74 20 6d 61 6b 65 20 6d  | for next make m|
00004bb0  65 6e 75 20 69 74 65 6d  20 63 61 6c 6c 20 29 0d  |enu item call ).|
00004bc0  20 44 05 3b 0d 20 4e 12  2e 6d 61 6b 65 6d 65 6e  | D.;. N..makemen|
00004bd0  75 69 74 65 6d 32 0d 20  58 17 20 20 20 53 54 52  |uitem2. X.   STR|
00004be0  20 20 20 72 32 2c 5b 72  30 2c 23 30 5d 0d 20 62  |   r2,[r0,#0]. b|
00004bf0  12 20 20 20 4d 56 4e 20  20 20 72 38 2c 23 30 0d  |.   MVN   r8,#0.|
00004c00  20 6c 17 20 20 20 53 54  52 20 20 20 72 38 2c 5b  | l.   STR   r8,[|
00004c10  72 30 2c 23 34 5d 0d 20  76 1b 20 20 20 4c 44 52  |r0,#4]. v.   LDR|
00004c20  20 20 20 72 38 2c 28 74  65 78 74 64 61 74 61 32  |   r8,(textdata2|
00004c30  29 0d 20 80 17 20 20 20  53 54 52 20 20 20 72 38  |). ..   STR   r8|
00004c40  2c 5b 72 30 2c 23 38 5d  0d 20 8a 17 20 20 20 41  |,[r0,#8]. ..   A|
00004c50  44 44 20 20 20 72 31 30  2c 72 30 2c 23 31 32 0d  |DD   r10,r0,#12.|
00004c60  20 94 12 20 20 20 4d 4f  56 20 20 20 72 39 2c 72  | ..   MOV   r9,r|
00004c70  31 0d 20 9e 14 20 20 20  4d 4f 56 20 20 20 72 31  |1. ..   MOV   r1|
00004c80  31 2c 23 31 31 0d 20 a8  17 20 20 20 42 4c 20 20  |1,#11. ..   BL  |
00004c90  20 20 63 6f 70 79 73 74  72 69 6e 67 0d 20 b2 16  |  copystring. ..|
00004ca0  20 20 20 41 44 44 20 20  20 72 30 2c 72 30 2c 23  |   ADD   r0,r0,#|
00004cb0  32 34 0d 20 bc 14 20 20  20 42 20 20 20 20 20 65  |24. ..   B     e|
00004cc0  78 69 74 73 77 69 0d 20  c6 05 3b 0d 20 d0 15 3b  |xitswi. ..;. ..;|
00004cd0  20 72 30 20 3d 20 6d 65  6e 75 20 62 6c 6f 63 6b  | r0 = menu block|
00004ce0  0d 20 da 2d 3b 20 72 31  20 3d 20 6d 65 6e 75 20  |. .-; r1 = menu |
00004cf0  69 74 65 6d 20 6e 75 6d  62 65 72 20 28 20 73 74  |item number ( st|
00004d00  61 72 74 69 6e 67 20 61  74 20 30 20 29 0d 20 e4  |arting at 0 ). .|
00004d10  16 3b 20 72 32 20 3d 20  6d 65 6e 75 20 73 74 72  |.; r2 = menu str|
00004d20  69 6e 67 0d 20 ee 05 3b  0d 20 f8 10 2e 73 65 74  |ing. ..;. ...set|
00004d30  6d 65 6e 75 69 74 65 6d  0d 21 02 16 20 20 20 41  |menuitem.!..   A|
00004d40  44 44 20 20 20 72 38 2c  72 30 2c 23 32 38 0d 21  |DD   r8,r0,#28.!|
00004d50  0c 1b 20 20 20 41 44 44  20 20 20 72 38 2c 72 38  |..   ADD   r8,r8|
00004d60  2c 72 31 2c 4c 53 4c 23  34 0d 21 16 1b 20 20 20  |,r1,LSL#4.!..   |
00004d70  41 44 44 20 20 20 72 38  2c 72 38 2c 72 31 2c 4c  |ADD   r8,r8,r1,L|
00004d80  53 4c 23 33 0d 21 20 17  20 20 20 4c 44 52 20 20  |SL#3.! .   LDR  |
00004d90  20 72 39 2c 5b 72 38 2c  23 38 5d 0d 21 2a 15 20  | r9,[r8,#8].!*. |
00004da0  20 20 54 53 54 20 20 20  72 39 2c 23 31 3c 3c 38  |  TST   r9,#1<<8|
00004db0  0d 21 34 1e 20 20 20 42  45 51 20 20 20 73 74 72  |.!4.   BEQ   str|
00004dc0  6e 6f 74 69 6e 64 69 72  65 63 74 65 64 32 0d 21  |notindirected2.!|
00004dd0  3e 19 20 20 20 4c 44 52  20 20 20 72 31 30 2c 5b  |>.   LDR   r10,[|
00004de0  72 38 2c 23 31 32 5d 0d  21 48 12 20 20 20 4d 4f  |r8,#12].!H.   MO|
00004df0  56 20 20 20 72 39 2c 72  32 0d 21 52 19 20 20 20  |V   r9,r2.!R.   |
00004e00  4c 44 52 20 20 20 72 31  31 2c 5b 72 38 2c 23 32  |LDR   r11,[r8,#2|
00004e10  30 5d 0d 21 5c 17 20 20  20 42 4c 20 20 20 20 63  |0].!\.   BL    c|
00004e20  6f 70 79 73 74 72 69 6e  67 0d 21 66 14 20 20 20  |opystring.!f.   |
00004e30  42 20 20 20 20 20 65 78  69 74 73 77 69 0d 21 70  |B     exitswi.!p|
00004e40  05 3b 0d 21 7a 15 3b 20  72 30 20 3d 20 6d 65 6e  |.;.!z.; r0 = men|
00004e50  75 20 62 6c 6f 63 6b 0d  21 84 2d 3b 20 72 31 20  |u block.!.-; r1 |
00004e60  3d 20 6d 65 6e 75 20 69  74 65 6d 20 6e 75 6d 62  |= menu item numb|
00004e70  65 72 20 28 20 73 74 61  72 74 69 6e 67 20 61 74  |er ( starting at|
00004e80  20 30 20 29 0d 21 8e 0e  3b 20 72 65 74 75 72 6e  | 0 ).!..; return|
00004e90  73 3a 0d 21 98 19 3b 20  72 30 20 3d 20 6d 65 6e  |s:.!..; r0 = men|
00004ea0  75 20 69 74 65 6d 20 74  65 78 74 0d 21 a2 05 3b  |u item text.!..;|
00004eb0  0d 21 ac 10 2e 67 65 74  6d 65 6e 75 69 74 65 6d  |.!...getmenuitem|
00004ec0  0d 21 b6 16 20 20 20 41  44 44 20 20 20 72 38 2c  |.!..   ADD   r8,|
00004ed0  72 30 2c 23 32 38 0d 21  c0 1b 20 20 20 41 44 44  |r0,#28.!..   ADD|
00004ee0  20 20 20 72 38 2c 72 38  2c 72 31 2c 4c 53 4c 23  |   r8,r8,r1,LSL#|
00004ef0  34 0d 21 ca 1b 20 20 20  41 44 44 20 20 20 72 38  |4.!..   ADD   r8|
00004f00  2c 72 38 2c 72 31 2c 4c  53 4c 23 33 0d 21 d4 17  |,r8,r1,LSL#3.!..|
00004f10  20 20 20 4c 44 52 20 20  20 72 30 2c 5b 72 38 2c  |   LDR   r0,[r8,|
00004f20  23 38 5d 0d 21 de 15 20  20 20 54 53 54 20 20 20  |#8].!..   TST   |
00004f30  72 30 2c 23 31 3c 3c 38  0d 21 e8 16 20 20 20 41  |r0,#1<<8.!..   A|
00004f40  44 44 45 51 20 72 30 2c  72 38 2c 23 31 32 0d 21  |DDEQ r0,r8,#12.!|
00004f50  f2 14 20 20 20 42 45 51  20 20 20 65 78 69 74 73  |..   BEQ   exits|
00004f60  77 69 0d 21 fc 18 20 20  20 4c 44 52 20 20 20 72  |wi.!..   LDR   r|
00004f70  30 2c 5b 72 38 2c 23 31  32 5d 0d 22 06 14 20 20  |0,[r8,#12]."..  |
00004f80  20 42 20 20 20 20 20 65  78 69 74 73 77 69 0d 22  | B     exitswi."|
00004f90  10 05 3b 0d 22 1a 14 2e  73 65 74 6d 65 6e 75 69  |..;."...setmenui|
00004fa0  74 65 6d 6c 61 73 74 0d  22 24 16 20 20 20 41 44  |temlast."$.   AD|
00004fb0  44 20 20 20 72 38 2c 72  30 2c 23 32 38 0d 22 2e  |D   r8,r0,#28.".|
00004fc0  1b 20 20 20 41 44 44 20  20 20 72 38 2c 72 38 2c  |.   ADD   r8,r8,|
00004fd0  72 31 2c 4c 53 4c 23 34  0d 22 38 1b 20 20 20 41  |r1,LSL#4."8.   A|
00004fe0  44 44 20 20 20 72 38 2c  72 38 2c 72 31 2c 4c 53  |DD   r8,r8,r1,LS|
00004ff0  4c 23 33 0d 22 42 17 20  20 20 4c 44 52 20 20 20  |L#3."B.   LDR   |
00005000  72 30 2c 5b 72 38 2c 23  30 5d 0d 22 4c 15 20 20  |r0,[r8,#0]."L.  |
00005010  20 4d 56 4e 20 20 20 72  31 30 2c 23 26 38 30 0d  | MVN   r10,#&80.|
00005020  22 56 15 20 20 20 80 20  20 20 72 32 2c 72 32 2c  |"V.   .   r2,r2,|
00005030  23 26 38 30 0d 22 60 14  20 20 20 80 20 20 20 72  |#&80."`.   .   r|
00005040  30 2c 72 30 2c 72 31 30  0d 22 6a 16 20 20 20 84  |0,r0,r10."j.   .|
00005050  52 20 20 20 72 30 2c 72  30 2c 23 26 38 30 0d 22  |R   r0,r0,#&80."|
00005060  74 17 20 20 20 53 54 52  20 20 20 72 30 2c 5b 72  |t.   STR   r0,[r|
00005070  38 2c 23 30 5d 0d 22 7e  14 20 20 20 42 20 20 20  |8,#0]."~.   B   |
00005080  20 20 65 78 69 74 73 77  69 0d 22 88 05 3b 0d 22  |  exitswi."..;."|
00005090  92 0c 2e 73 65 74 74 69  63 6b 0d 22 9c 16 20 20  |...settick."..  |
000050a0  20 41 44 44 20 20 20 72  38 2c 72 30 2c 23 32 38  | ADD   r8,r0,#28|
000050b0  0d 22 a6 1b 20 20 20 41  44 44 20 20 20 72 38 2c  |."..   ADD   r8,|
000050c0  72 38 2c 72 31 2c 4c 53  4c 23 34 0d 22 b0 1b 20  |r8,r1,LSL#4.".. |
000050d0  20 20 41 44 44 20 20 20  72 38 2c 72 38 2c 72 31  |  ADD   r8,r8,r1|
000050e0  2c 4c 53 4c 23 33 0d 22  ba 12 20 20 20 4d 56 4e  |,LSL#3."..   MVN|
000050f0  20 20 20 72 39 2c 23 31  0d 22 c4 17 20 20 20 4c  |   r9,#1."..   L|
00005100  44 52 20 20 20 72 30 2c  5b 72 38 2c 23 30 5d 0d  |DR   r0,[r8,#0].|
00005110  22 ce 13 20 20 20 80 20  20 20 72 30 2c 72 30 2c  |"..   .   r0,r0,|
00005120  72 39 0d 22 d8 13 20 20  20 80 20 20 20 72 32 2c  |r9."..   .   r2,|
00005130  72 32 2c 23 31 0d 22 e2  14 20 20 20 84 52 20 20  |r2,#1."..   .R  |
00005140  20 72 30 2c 72 30 2c 72  32 0d 22 ec 17 20 20 20  | r0,r0,r2."..   |
00005150  53 54 52 20 20 20 72 30  2c 5b 72 38 2c 23 30 5d  |STR   r0,[r8,#0]|
00005160  0d 22 f6 14 20 20 20 42  20 20 20 20 20 65 78 69  |."..   B     exi|
00005170  74 73 77 69 0d 23 00 05  3b 0d 23 0a 0c 2e 67 65  |tswi.#..;.#...ge|
00005180  74 74 69 63 6b 0d 23 14  16 20 20 20 41 44 44 20  |ttick.#..   ADD |
00005190  20 20 72 38 2c 72 30 2c  23 32 38 0d 23 1e 1b 20  |  r8,r0,#28.#.. |
000051a0  20 20 41 44 44 20 20 20  72 38 2c 72 38 2c 72 31  |  ADD   r8,r8,r1|
000051b0  2c 4c 53 4c 23 34 0d 23  28 1b 20 20 20 41 44 44  |,LSL#4.#(.   ADD|
000051c0  20 20 20 72 38 2c 72 38  2c 72 31 2c 4c 53 4c 23  |   r8,r8,r1,LSL#|
000051d0  33 0d 23 32 18 20 20 20  4c 44 52 20 20 20 72 31  |3.#2.   LDR   r1|
000051e0  30 2c 5b 72 38 2c 23 30  5d 0d 23 3c 13 20 20 20  |0,[r8,#0].#<.   |
000051f0  54 53 54 20 20 20 72 31  30 2c 23 31 0d 23 46 12  |TST   r10,#1.#F.|
00005200  20 20 20 4d 4f 56 20 20  20 72 30 2c 23 30 0d 23  |   MOV   r0,#0.#|
00005210  50 12 20 20 20 4d 56 4e  4e 45 20 72 30 2c 23 30  |P.   MVNNE r0,#0|
00005220  0d 23 5a 14 20 20 20 42  20 20 20 20 20 65 78 69  |.#Z.   B     exi|
00005230  74 73 77 69 0d 23 64 05  3b 0d 23 6e 0f 2e 73 65  |tswi.#d.;.#n..se|
00005240  74 6d 65 73 73 61 67 65  0d 23 78 16 20 20 20 41  |tmessage.#x.   A|
00005250  44 44 20 20 20 72 38 2c  72 30 2c 23 32 38 0d 23  |DD   r8,r0,#28.#|
00005260  82 1b 20 20 20 41 44 44  20 20 20 72 38 2c 72 38  |..   ADD   r8,r8|
00005270  2c 72 31 2c 4c 53 4c 23  34 0d 23 8c 1b 20 20 20  |,r1,LSL#4.#..   |
00005280  41 44 44 20 20 20 72 38  2c 72 38 2c 72 31 2c 4c  |ADD   r8,r8,r1,L|
00005290  53 4c 23 33 0d 23 96 15  20 20 20 4d 56 4e 20 20  |SL#3.#..   MVN  |
000052a0  20 72 39 2c 23 31 3c 3c  33 0d 23 a0 17 20 20 20  | r9,#1<<3.#..   |
000052b0  4c 44 52 20 20 20 72 30  2c 5b 72 38 2c 23 30 5d  |LDR   r0,[r8,#0]|
000052c0  0d 23 aa 13 20 20 20 80  20 20 20 72 30 2c 72 30  |.#..   .   r0,r0|
000052d0  2c 72 39 0d 23 b4 16 20  20 20 80 20 20 20 72 32  |,r9.#..   .   r2|
000052e0  2c 72 32 2c 23 31 3c 3c  33 0d 23 be 14 20 20 20  |,r2,#1<<3.#..   |
000052f0  84 52 20 20 20 72 30 2c  72 30 2c 72 32 0d 23 c8  |.R   r0,r0,r2.#.|
00005300  17 20 20 20 53 54 52 20  20 20 72 30 2c 5b 72 38  |.   STR   r0,[r8|
00005310  2c 23 30 5d 0d 23 d2 14  20 20 20 42 20 20 20 20  |,#0].#..   B    |
00005320  20 65 78 69 74 73 77 69  0d 23 dc 05 3b 0d 23 e6  | exitswi.#..;.#.|
00005330  0f 2e 67 65 74 6d 65 73  73 61 67 65 0d 23 f0 16  |..getmessage.#..|
00005340  20 20 20 41 44 44 20 20  20 72 38 2c 72 30 2c 23  |   ADD   r8,r0,#|
00005350  32 38 0d 23 fa 1b 20 20  20 41 44 44 20 20 20 72  |28.#..   ADD   r|
00005360  38 2c 72 38 2c 72 31 2c  4c 53 4c 23 34 0d 24 04  |8,r8,r1,LSL#4.$.|
00005370  1b 20 20 20 41 44 44 20  20 20 72 38 2c 72 38 2c  |.   ADD   r8,r8,|
00005380  72 31 2c 4c 53 4c 23 33  0d 24 0e 18 20 20 20 4c  |r1,LSL#3.$..   L|
00005390  44 52 20 20 20 72 31 30  2c 5b 72 38 2c 23 30 5d  |DR   r10,[r8,#0]|
000053a0  0d 24 18 16 20 20 20 54  53 54 20 20 20 72 31 30  |.$..   TST   r10|
000053b0  2c 23 31 3c 3c 33 0d 24  22 12 20 20 20 4d 4f 56  |,#1<<3.$".   MOV|
000053c0  20 20 20 72 30 2c 23 30  0d 24 2c 12 20 20 20 4d  |   r0,#0.$,.   M|
000053d0  56 4e 4e 45 20 72 30 2c  23 30 0d 24 36 14 20 20  |VNNE r0,#0.$6.  |
000053e0  20 42 20 20 20 20 20 65  78 69 74 73 77 69 0d 24  | B     exitswi.$|
000053f0  40 05 3b 0d 24 4a 0e 2e  73 65 74 65 6e 61 62 6c  |@.;.$J..setenabl|
00005400  65 0d 24 54 16 20 20 20  41 44 44 20 20 20 72 38  |e.$T.   ADD   r8|
00005410  2c 72 30 2c 23 32 38 0d  24 5e 1b 20 20 20 41 44  |,r0,#28.$^.   AD|
00005420  44 20 20 20 72 38 2c 72  38 2c 72 31 2c 4c 53 4c  |D   r8,r8,r1,LSL|
00005430  23 34 0d 24 68 1b 20 20  20 41 44 44 20 20 20 72  |#4.$h.   ADD   r|
00005440  38 2c 72 38 2c 72 31 2c  4c 53 4c 23 33 0d 24 72  |8,r8,r1,LSL#3.$r|
00005450  16 20 20 20 4d 56 4e 20  20 20 72 39 2c 23 31 3c  |.   MVN   r9,#1<|
00005460  3c 32 32 0d 24 7c 17 20  20 20 4c 44 52 20 20 20  |<22.$|.   LDR   |
00005470  72 30 2c 5b 72 38 2c 23  38 5d 0d 24 86 13 20 20  |r0,[r8,#8].$..  |
00005480  20 80 20 20 20 72 30 2c  72 30 2c 72 39 0d 24 90  | .   r0,r0,r9.$.|
00005490  17 20 20 20 80 20 20 20  72 32 2c 72 32 2c 23 31  |.   .   r2,r2,#1|
000054a0  3c 3c 32 32 0d 24 9a 14  20 20 20 84 52 20 20 20  |<<22.$..   .R   |
000054b0  72 30 2c 72 30 2c 72 32  0d 24 a4 17 20 20 20 53  |r0,r0,r2.$..   S|
000054c0  54 52 20 20 20 72 30 2c  5b 72 38 2c 23 38 5d 0d  |TR   r0,[r8,#8].|
000054d0  24 ae 14 20 20 20 42 20  20 20 20 20 65 78 69 74  |$..   B     exit|
000054e0  73 77 69 0d 24 b8 05 3b  0d 24 c2 0e 2e 67 65 74  |swi.$..;.$...get|
000054f0  65 6e 61 62 6c 65 0d 24  cc 16 20 20 20 41 44 44  |enable.$..   ADD|
00005500  20 20 20 72 38 2c 72 30  2c 23 32 38 0d 24 d6 1b  |   r8,r0,#28.$..|
00005510  20 20 20 41 44 44 20 20  20 72 38 2c 72 38 2c 72  |   ADD   r8,r8,r|
00005520  31 2c 4c 53 4c 23 34 0d  24 e0 1b 20 20 20 41 44  |1,LSL#4.$..   AD|
00005530  44 20 20 20 72 38 2c 72  38 2c 72 31 2c 4c 53 4c  |D   r8,r8,r1,LSL|
00005540  23 33 0d 24 ea 18 20 20  20 4c 44 52 20 20 20 72  |#3.$..   LDR   r|
00005550  31 30 2c 5b 72 38 2c 23  38 5d 0d 24 f4 17 20 20  |10,[r8,#8].$..  |
00005560  20 54 53 54 20 20 20 72  31 30 2c 23 31 3c 3c 32  | TST   r10,#1<<2|
00005570  32 0d 24 fe 12 20 20 20  4d 4f 56 20 20 20 72 30  |2.$..   MOV   r0|
00005580  2c 23 30 0d 25 08 12 20  20 20 4d 56 4e 4e 45 20  |,#0.%..   MVNNE |
00005590  72 30 2c 23 30 0d 25 12  14 20 20 20 42 20 20 20  |r0,#0.%..   B   |
000055a0  20 20 65 78 69 74 73 77  69 0d 25 1c 05 3b 0d 25  |  exitswi.%..;.%|
000055b0  26 0e 2e 61 74 74 61 63  68 73 75 62 0d 25 30 12  |&..attachsub.%0.|
000055c0  20 20 20 54 45 51 20 20  20 72 33 2c 23 30 0d 25  |   TEQ   r3,#0.%|
000055d0  3a 17 20 20 20 42 45 51  20 20 20 61 74 74 61 63  |:.   BEQ   attac|
000055e0  68 73 75 62 31 0d 25 44  17 20 20 20 53 54 4d 46  |hsub1.%D.   STMF|
000055f0  44 20 28 73 70 29 21 2c  7b 72 30 7d 0d 25 4e 12  |D (sp)!,{r0}.%N.|
00005600  20 20 20 4d 4f 56 20 20  20 72 30 2c 72 32 0d 25  |   MOV   r0,r2.%|
00005610  58 19 20 20 20 42 4c 20  20 20 20 63 6f 6e 76 65  |X.   BL    conve|
00005620  72 74 6e 61 6d 65 33 0d  25 62 12 20 20 20 4d 4f  |rtname3.%b.   MO|
00005630  56 20 20 20 72 32 2c 72  30 0d 25 6c 17 20 20 20  |V   r2,r0.%l.   |
00005640  4c 44 4d 46 44 20 28 73  70 29 21 2c 7b 72 30 7d  |LDMFD (sp)!,{r0}|
00005650  0d 25 76 0f 2e 61 74 74  61 63 68 73 75 62 31 0d  |.%v..attachsub1.|
00005660  25 80 16 20 20 20 41 44  44 20 20 20 72 38 2c 72  |%..   ADD   r8,r|
00005670  30 2c 23 32 38 0d 25 8a  1b 20 20 20 41 44 44 20  |0,#28.%..   ADD |
00005680  20 20 72 38 2c 72 38 2c  72 31 2c 4c 53 4c 23 34  |  r8,r8,r1,LSL#4|
00005690  0d 25 94 1b 20 20 20 41  44 44 20 20 20 72 38 2c  |.%..   ADD   r8,|
000056a0  72 38 2c 72 31 2c 4c 53  4c 23 33 0d 25 9e 17 20  |r8,r1,LSL#3.%.. |
000056b0  20 20 53 54 52 20 20 20  72 32 2c 5b 72 38 2c 23  |  STR   r2,[r8,#|
000056c0  34 5d 0d 25 a8 14 20 20  20 42 20 20 20 20 20 65  |4].%..   B     e|
000056d0  78 69 74 73 77 69 0d 25  b2 05 3b 0d 25 bc 0e 2e  |xitswi.%..;.%...|
000056e0  6c 6f 61 64 6d 65 6e 75  73 0d 25 c6 1b 20 20 20  |loadmenus.%..   |
000056f0  42 20 20 20 20 20 6e 6f  74 69 6d 70 6c 65 6d 65  |B     notimpleme|
00005700  6e 74 65 64 0d 25 d0 05  3b 0d 25 da 0c 2e 67 65  |nted.%..;.%...ge|
00005710  74 74 65 78 74 0d 25 e4  14 20 20 20 42 20 20 20  |ttext.%..   B   |
00005720  20 20 65 78 69 74 73 77  69 0d 25 ee 05 3b 0d 25  |  exitswi.%..;.%|
00005730  f8 0d 2e 74 61 73 6b 69  63 6f 6e 0d 26 02 1a 20  |...taskicon.&.. |
00005740  20 20 53 54 4d 46 44 20  28 73 70 29 21 2c 7b 72  |  STMFD (sp)!,{r|
00005750  31 2c 72 37 7d 0d 26 0c  12 20 20 20 4d 4f 56 20  |1,r7}.&..   MOV |
00005760  20 20 72 37 2c 72 31 0d  26 16 17 20 20 20 41 44  |  r7,r1.&..   AD|
00005770  44 20 20 20 72 31 2c 77  73 2c 23 62 6c 6b 0d 26  |D   r1,ws,#blk.&|
00005780  20 17 20 20 20 53 54 52  20 20 20 72 30 2c 5b 72  | .   STR   r0,[r|
00005790  31 2c 23 30 5d 0d 26 2a  12 20 20 20 4d 4f 56 20  |1,#0].&*.   MOV |
000057a0  20 20 72 30 2c 23 30 0d  26 34 17 20 20 20 53 54  |  r0,#0.&4.   ST|
000057b0  52 20 20 20 72 30 2c 5b  72 31 2c 23 34 5d 0d 26  |R   r0,[r1,#4].&|
000057c0  3e 17 20 20 20 53 54 52  20 20 20 72 30 2c 5b 72  |>.   STR   r0,[r|
000057d0  31 2c 23 38 5d 0d 26 48  13 20 20 20 4d 4f 56 20  |1,#8].&H.   MOV |
000057e0  20 20 72 30 2c 23 36 38  0d 26 52 18 20 20 20 53  |  r0,#68.&R.   S|
000057f0  54 52 20 20 20 72 30 2c  5b 72 31 2c 23 31 32 5d  |TR   r0,[r1,#12]|
00005800  0d 26 5c 18 20 20 20 53  54 52 20 20 20 72 30 2c  |.&\.   STR   r0,|
00005810  5b 72 31 2c 23 31 36 5d  0d 26 66 18 20 20 20 41  |[r1,#16].&f.   A|
00005820  44 52 20 20 20 72 38 2c  66 6c 61 67 64 61 74 61  |DR   r8,flagdata|
00005830  0d 26 70 1d 20 20 20 4c  44 52 20 20 20 72 30 2c  |.&p.   LDR   r0,|
00005840  5b 72 38 2c 72 37 2c 4c  53 4c 23 32 5d 0d 26 7a  |[r8,r7,LSL#2].&z|
00005850  18 20 20 20 53 54 52 20  20 20 72 30 2c 5b 72 31  |.   STR   r0,[r1|
00005860  2c 23 32 30 5d 0d 26 84  3c 20 20 20 43 4d 50 20  |,#20].&.<   CMP |
00005870  20 20 72 37 2c 23 30 20  20 20 20 20 20 20 20 20  |  r7,#0         |
00005880  20 20 20 20 20 20 20 20  20 3b 20 69 73 20 69 74  |         ; is it|
00005890  20 61 20 6e 6f 72 6d 61  6c 20 73 70 72 69 74 65  | a normal sprite|
000058a0  3f 0d 26 8e 16 20 20 20  42 4e 45 20 20 20 74 61  |?.&..   BNE   ta|
000058b0  73 6b 69 63 6f 6e 31 0d  26 98 17 20 20 20 41 44  |skicon1.&..   AD|
000058c0  44 20 20 20 72 31 30 2c  72 31 2c 23 32 34 0d 26  |D   r10,r1,#24.&|
000058d0  a2 12 20 20 20 4d 4f 56  20 20 20 72 39 2c 72 32  |..   MOV   r9,r2|
000058e0  0d 26 ac 14 20 20 20 4d  4f 56 20 20 20 72 31 31  |.&..   MOV   r11|
000058f0  2c 23 31 32 0d 26 b6 17  20 20 20 42 4c 20 20 20  |,#12.&..   BL   |
00005900  20 63 6f 70 79 73 74 72  69 6e 67 0d 26 c0 16 20  | copystring.&.. |
00005910  20 20 42 20 20 20 20 20  74 61 73 6b 69 63 6f 6e  |  B     taskicon|
00005920  30 0d 26 ca 48 2e 74 61  73 6b 69 63 6f 6e 31 20  |0.&.H.taskicon1 |
00005930  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00005940  20 20 20 20 20 3b 20 69  66 20 6e 6f 74 20 74 68  |     ; if not th|
00005950  65 6e 20 72 32 20 69 73  20 61 20 62 6c 6f 63 6b  |en r2 is a block|
00005960  20 77 69 74 68 20 74 68  65 0d 26 d4 37 20 20 20  | with the.&.7   |
00005970  53 54 52 20 20 20 72 32  2c 5b 72 31 2c 23 32 34  |STR   r2,[r1,#24|
00005980  5d 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 73  |]            ; s|
00005990  70 72 69 74 65 20 6e 61  6d 65 20 69 6e 20 69 74  |prite name in it|
000059a0  0d 26 de 12 20 20 20 4d  56 4e 20 20 20 72 30 2c  |.&..   MVN   r0,|
000059b0  23 30 0d 26 e8 18 20 20  20 53 54 52 20 20 20 72  |#0.&..   STR   r|
000059c0  30 2c 5b 72 31 2c 23 32  38 5d 0d 26 f2 12 20 20  |0,[r1,#28].&..  |
000059d0  20 4d 4f 56 20 20 20 72  39 2c 72 32 0d 26 fc 43  | MOV   r9,r2.&.C|
000059e0  20 20 20 42 4c 20 20 20  20 63 6f 75 6e 74 63 68  |   BL    countch|
000059f0  61 72 73 20 20 20 20 20  20 20 20 20 20 20 20 20  |ars             |
00005a00  3b 20 66 69 6e 64 20 74  68 65 20 6c 65 6e 67 74  |; find the lengt|
00005a10  68 20 6f 66 20 74 68 65  20 73 74 72 69 6e 67 0d  |h of the string.|
00005a20  27 06 19 20 20 20 53 54  52 20 20 20 72 31 31 2c  |'..   STR   r11,|
00005a30  5b 72 31 2c 23 33 32 5d  0d 27 10 12 20 20 20 43  |[r1,#32].'..   C|
00005a40  4d 50 20 20 20 72 37 2c  23 31 0d 27 1a 3b 20 20  |MP   r7,#1.'.;  |
00005a50  20 42 4e 45 20 20 20 74  61 73 6b 69 63 6f 6e 30  | BNE   taskicon0|
00005a60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
00005a70  63 68 65 63 6b 20 74 6f  20 73 65 65 20 69 66 20  |check to see if |
00005a80  69 74 20 61 6e 0d 27 24  37 20 20 20 20 20 20 20  |it an.'$7       |
00005a90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00005aa0  20 20 20 20 20 20 20 20  20 3b 20 69 6e 64 69 72  |         ; indir|
00005ab0  65 63 74 65 64 20 73 70  72 69 74 65 0d 27 2e 3d  |ected sprite.'.=|
00005ac0  20 20 20 53 54 52 20 20  20 72 33 2c 5b 72 31 2c  |   STR   r3,[r1,|
00005ad0  23 32 38 5d 20 20 20 20  20 20 20 20 20 20 20 20  |#28]            |
00005ae0  3b 20 61 6e 64 20 70 6f  69 6e 74 20 74 6f 20 73  |; and point to s|
00005af0  70 72 69 74 65 70 6f 6f  6c 0d 27 38 0e 2e 74 61  |pritepool.'8..ta|
00005b00  73 6b 69 63 6f 6e 30 0d  27 42 1f 20 20 20 53 57  |skicon0.'B.   SW|
00005b10  49 20 20 20 22 58 57 69  6d 70 5f 43 72 65 61 74  |I   "XWimp_Creat|
00005b20  65 49 63 6f 6e 22 0d 27  4c 1a 20 20 20 4c 44 4d  |eIcon".'L.   LDM|
00005b30  46 44 20 28 73 70 29 21  2c 7b 72 31 2c 72 37 7d  |FD (sp)!,{r1,r7}|
00005b40  0d 27 56 14 20 20 20 42  20 20 20 20 20 65 78 69  |.'V.   B     exi|
00005b50  74 73 77 69 0d 27 60 0d  2e 66 6c 61 67 64 61 74  |tswi.'`..flagdat|
00005b60  61 0d 27 6a 16 20 20 20  45 51 55 44 20 20 26 37  |a.'j.   EQUD  &7|
00005b70  30 30 30 33 30 31 41 0d  27 74 16 20 20 20 45 51  |000301A.'t.   EQ|
00005b80  55 44 20 20 26 37 30 30  30 33 31 31 41 0d 27 7e  |UD  &7000311A.'~|
00005b90  16 20 20 20 45 51 55 44  20 20 26 37 30 30 30 33  |.   EQUD  &70003|
00005ba0  31 33 44 0d 27 88 05 3b  0d 27 92 13 2e 73 65 74  |13D.'..;.'...set|
00005bb0  6d 65 6e 75 6f 70 74 69  6f 6e 73 0d 27 9c 16 20  |menuoptions.'.. |
00005bc0  20 20 41 44 44 20 20 20  72 37 2c 72 30 2c 23 32  |  ADD   r7,r0,#2|
00005bd0  38 0d 27 a6 1b 20 20 20  41 44 44 20 20 20 72 37  |8.'..   ADD   r7|
00005be0  2c 72 37 2c 72 31 2c 4c  53 4c 23 34 0d 27 b0 1b  |,r7,r1,LSL#4.'..|
00005bf0  20 20 20 41 44 44 20 20  20 72 37 2c 72 37 2c 72  |   ADD   r7,r7,r|
00005c00  31 2c 4c 53 4c 23 33 0d  27 ba 17 20 20 20 4c 44  |1,LSL#3.'..   LD|
00005c10  52 20 20 20 72 30 2c 5b  72 37 2c 23 30 5d 0d 27  |R   r0,[r7,#0].'|
00005c20  c4 17 20 20 20 53 54 52  20 20 20 72 32 2c 5b 72  |..   STR   r2,[r|
00005c30  37 2c 23 30 5d 0d 27 ce  14 20 20 20 42 20 20 20  |7,#0].'..   B   |
00005c40  20 20 65 78 69 74 73 77  69 0d 27 d8 05 3b 0d 27  |  exitswi.'..;.'|
00005c50  e2 13 2e 67 65 74 6d 65  6e 75 6f 70 74 69 6f 6e  |...getmenuoption|
00005c60  73 0d 27 ec 16 20 20 20  41 44 44 20 20 20 72 37  |s.'..   ADD   r7|
00005c70  2c 72 30 2c 23 32 38 0d  27 f6 1b 20 20 20 41 44  |,r0,#28.'..   AD|
00005c80  44 20 20 20 72 37 2c 72  37 2c 72 31 2c 4c 53 4c  |D   r7,r7,r1,LSL|
00005c90  23 34 0d 28 00 1b 20 20  20 41 44 44 20 20 20 72  |#4.(..   ADD   r|
00005ca0  37 2c 72 37 2c 72 31 2c  4c 53 4c 23 33 0d 28 0a  |7,r7,r1,LSL#3.(.|
00005cb0  17 20 20 20 4c 44 52 20  20 20 72 30 2c 5b 72 37  |.   LDR   r0,[r7|
00005cc0  2c 23 30 5d 0d 28 14 14  20 20 20 42 20 20 20 20  |,#0].(..   B    |
00005cd0  20 65 78 69 74 73 77 69  0d 28 1e 05 3b 0d 28 28  | exitswi.(..;.((|
00005ce0  10 2e 69 63 6f 6e 62 61  72 6d 65 6e 75 0d 28 32  |..iconbarmenu.(2|
00005cf0  1a 20 20 20 53 54 4d 46  44 20 28 73 70 29 21 2c  |.   STMFD (sp)!,|
00005d00  7b 72 31 2d 72 33 7d 0d  28 3c 12 20 20 20 4d 4f  |{r1-r3}.(<.   MO|
00005d10  56 20 20 20 72 38 2c 72  30 0d 28 46 17 20 20 20  |V   r8,r0.(F.   |
00005d20  41 44 44 20 20 20 72 31  2c 77 73 2c 23 62 6c 6b  |ADD   r1,ws,#blk|
00005d30  0d 28 50 23 20 20 20 53  57 49 20 20 20 22 58 57  |.(P#   SWI   "XW|
00005d40  69 6d 70 5f 47 65 74 50  6f 69 6e 74 65 72 49 6e  |imp_GetPointerIn|
00005d50  66 6f 22 0d 28 5a 17 20  20 20 42 56 53 20 20 20  |fo".(Z.   BVS   |
00005d60  69 63 6f 6e 62 61 72 6f  75 74 0d 28 64 17 20 20  |iconbarout.(d.  |
00005d70  20 4c 44 52 20 20 20 72  32 2c 5b 72 31 2c 23 30  | LDR   r2,[r1,#0|
00005d80  5d 0d 28 6e 16 20 20 20  53 55 42 20 20 20 72 32  |].(n.   SUB   r2|
00005d90  2c 72 32 2c 23 36 34 0d  28 78 13 20 20 20 4d 4f  |,r2,#64.(x.   MO|
00005da0  56 20 20 20 72 33 2c 23  39 36 0d 28 82 16 20 20  |V   r3,#96.(..  |
00005db0  20 41 44 44 20 20 20 72  39 2c 72 38 2c 23 32 38  | ADD   r9,r8,#28|
00005dc0  0d 28 8c 0d 2e 62 61 72  6d 65 6e 75 31 0d 28 96  |.(...barmenu1.(.|
00005dd0  16 20 20 20 41 44 44 20  20 20 72 33 2c 72 33 2c  |.   ADD   r3,r3,|
00005de0  23 34 34 0d 28 a0 18 20  20 20 4c 44 52 20 20 20  |#44.(..   LDR   |
00005df0  72 31 30 2c 5b 72 39 2c  23 30 5d 0d 28 aa 16 20  |r10,[r9,#0].(.. |
00005e00  20 20 54 53 54 20 20 20  72 31 30 2c 23 31 3c 3c  |  TST   r10,#1<<|
00005e10  31 0d 28 b4 16 20 20 20  41 44 44 4e 45 20 72 33  |1.(..   ADDNE r3|
00005e20  2c 72 33 2c 23 32 34 0d  28 be 16 20 20 20 41 44  |,r3,#24.(..   AD|
00005e30  44 20 20 20 72 39 2c 72  39 2c 23 32 34 0d 28 c8  |D   r9,r9,#24.(.|
00005e40  16 20 20 20 54 53 54 20  20 20 72 31 30 2c 23 31  |.   TST   r10,#1|
00005e50  3c 3c 37 0d 28 d2 15 20  20 20 42 45 51 20 20 20  |<<7.(..   BEQ   |
00005e60  62 61 72 6d 65 6e 75 31  0d 28 dc 12 20 20 20 4d  |barmenu1.(..   M|
00005e70  4f 56 20 20 20 72 31 2c  72 38 0d 28 e6 1f 20 20  |OV   r1,r8.(..  |
00005e80  20 53 57 49 20 20 20 22  58 57 69 6d 70 5f 43 72  | SWI   "XWimp_Cr|
00005e90  65 61 74 65 4d 65 6e 75  22 0d 28 f0 0f 2e 69 63  |eateMenu".(...ic|
00005ea0  6f 6e 62 61 72 6f 75 74  0d 28 fa 1a 20 20 20 4c  |onbarout.(..   L|
00005eb0  44 4d 46 44 20 28 73 70  29 21 2c 7b 72 31 2d 72  |DMFD (sp)!,{r1-r|
00005ec0  33 7d 0d 29 04 14 20 20  20 42 20 20 20 20 20 65  |3}.)..   B     e|
00005ed0  78 69 74 73 77 69 0d 29  0e 05 3b 0d 29 18 0f 2e  |xitswi.)..;.)...|
00005ee0  6d 65 6e 75 61 64 6a 75  73 74 0d 29 22 1a 20 20  |menuadjust.)".  |
00005ef0  20 53 54 4d 46 44 20 28  73 70 29 21 2c 7b 72 31  | STMFD (sp)!,{r1|
00005f00  2d 72 33 7d 0d 29 2c 12  20 20 20 4d 4f 56 20 20  |-r3}.),.   MOV  |
00005f10  20 72 38 2c 72 30 0d 29  36 17 20 20 20 41 44 44  | r8,r0.)6.   ADD|
00005f20  20 20 20 72 31 2c 77 73  2c 23 62 6c 6b 0d 29 40  |   r1,ws,#blk.)@|
00005f30  23 20 20 20 53 57 49 20  20 20 22 58 57 69 6d 70  |#   SWI   "XWimp|
00005f40  5f 47 65 74 50 6f 69 6e  74 65 72 49 6e 66 6f 22  |_GetPointerInfo"|
00005f50  0d 29 4a 17 20 20 20 42  56 53 20 20 20 6d 65 6e  |.)J.   BVS   men|
00005f60  75 61 64 6a 6f 75 74 0d  29 54 17 20 20 20 4c 44  |uadjout.)T.   LD|
00005f70  52 20 20 20 72 39 2c 5b  72 31 2c 23 38 5d 0d 29  |R   r9,[r1,#8].)|
00005f80  5e 12 20 20 20 54 53 54  20 20 20 72 39 2c 23 31  |^.   TST   r9,#1|
00005f90  0d 29 68 17 20 20 20 42  45 51 20 20 20 6d 65 6e  |.)h.   BEQ   men|
00005fa0  75 61 64 6a 6f 75 74 0d  29 72 12 20 20 20 4d 4f  |uadjout.)r.   MO|
00005fb0  56 20 20 20 72 31 2c 72  38 0d 29 7c 12 20 20 20  |V   r1,r8.)|.   |
00005fc0  4d 4f 56 20 20 20 72 32  2c 23 30 0d 29 86 12 20  |MOV   r2,#0.).. |
00005fd0  20 20 4d 4f 56 20 20 20  72 33 2c 23 30 0d 29 90  |  MOV   r3,#0.).|
00005fe0  1f 20 20 20 53 57 49 20  20 20 22 58 57 69 6d 70  |.   SWI   "XWimp|
00005ff0  5f 43 72 65 61 74 65 4d  65 6e 75 22 0d 29 9a 0f  |_CreateMenu".)..|
00006000  2e 6d 65 6e 75 61 64 6a  6f 75 74 0d 29 a4 1a 20  |.menuadjout.).. |
00006010  20 20 4c 44 4d 46 44 20  28 73 70 29 21 2c 7b 72  |  LDMFD (sp)!,{r|
00006020  31 2d 72 33 7d 0d 29 ae  14 20 20 20 42 20 20 20  |1-r3}.)..   B   |
00006030  20 20 65 78 69 74 73 77  69 0d 29 b8 05 3b 0d 29  |  exitswi.)..;.)|
00006040  c2 4c 3b 20 74 68 65 20  66 6f 6c 6c 6f 77 69 6e  |.L; the followin|
00006050  67 20 72 6f 75 74 69 6e  65 20 72 65 61 64 73 20  |g routine reads |
00006060  74 68 65 20 63 68 61 72  61 63 74 65 72 20 62 65  |the character be|
00006070  66 6f 72 65 20 74 68 65  20 6d 65 6e 75 20 65 6e  |fore the menu en|
00006080  74 72 79 20 69 6e 20 74  68 65 0d 29 cc 1e 3b 20  |try in the.)..; |
00006090  73 74 72 69 6e 67 20 61  6e 64 20 64 65 63 6f 64  |string and decod|
000060a0  65 73 20 69 74 20 61 73  0d 29 d6 05 3b 0d 29 e0  |es it as.)..;.).|
000060b0  12 3b 20 80 20 3d 20 74  69 63 6b 65 64 20 21 0d  |.; . = ticked !.|
000060c0  29 ea 1d 3b 20 2d 20 3d  20 64 61 73 68 65 64 20  |)..; - = dashed |
000060d0  6c 69 6e 65 20 66 6f 6c  6c 6f 77 73 0d 29 f4 27  |line follows.).'|
000060e0  3b 20 3e 20 3d 20 67 65  6e 65 72 61 74 65 20 6d  |; > = generate m|
000060f0  65 73 73 61 67 65 73 20  66 6f 72 20 73 75 62 6d  |essages for subm|
00006100  65 6e 75 0d 29 fe 10 3b  20 84 20 3d 20 64 69 6d  |enu.)..; . = dim|
00006110  6d 65 64 0d 2a 08 13 3b  20 3f 20 3d 20 77 72 69  |med.*..; ? = wri|
00006120  74 65 61 62 6c 65 0d 2a  12 05 3b 0d 2a 1c 11 2e  |teable.*..;.*...|
00006130  72 65 61 64 6d 65 6e 75  66 6c 61 67 0d 2a 26 17  |readmenuflag.*&.|
00006140  20 20 20 4c 44 52 42 20  20 72 36 2c 5b 72 33 2c  |   LDRB  r6,[r3,|
00006150  23 30 5d 0d 2a 30 15 20  20 20 54 45 51 20 20 20  |#0].*0.   TEQ   |
00006160  72 36 2c 23 97 22 80 22  0d 2a 3a 17 20 20 20 84  |r6,#.".".*:.   .|
00006170  52 45 51 20 72 38 2c 72  38 2c 23 31 3c 3c 30 0d  |REQ r8,r8,#1<<0.|
00006180  2a 44 15 20 20 20 41 44  44 45 51 20 72 33 2c 72  |*D.   ADDEQ r3,r|
00006190  33 2c 23 31 0d 2a 4e 11  20 20 20 ec 51 20 70 63  |3,#1.*N.   .Q pc|
000061a0  2c 6c 69 6e 6b 0d 2a 58  15 20 20 20 54 45 51 20  |,link.*X.   TEQ |
000061b0  20 20 72 36 2c 23 97 22  2d 22 0d 2a 62 17 20 20  |  r6,#."-".*b.  |
000061c0  20 84 52 45 51 20 72 38  2c 72 38 2c 23 31 3c 3c  | .REQ r8,r8,#1<<|
000061d0  31 0d 2a 6c 15 20 20 20  41 44 44 45 51 20 72 33  |1.*l.   ADDEQ r3|
000061e0  2c 72 33 2c 23 31 0d 2a  76 11 20 20 20 ec 51 20  |,r3,#1.*v.   .Q |
000061f0  70 63 2c 6c 69 6e 6b 0d  2a 80 15 20 20 20 54 45  |pc,link.*..   TE|
00006200  51 20 20 20 72 36 2c 23  97 22 3f 22 0d 2a 8a 17  |Q   r6,#."?".*..|
00006210  20 20 20 84 52 45 51 20  72 38 2c 72 38 2c 23 31  |   .REQ r8,r8,#1|
00006220  3c 3c 32 0d 2a 94 15 20  20 20 41 44 44 45 51 20  |<<2.*..   ADDEQ |
00006230  72 33 2c 72 33 2c 23 31  0d 2a 9e 11 20 20 20 ec  |r3,r3,#1.*..   .|
00006240  51 20 70 63 2c 6c 69 6e  6b 0d 2a a8 15 20 20 20  |Q pc,link.*..   |
00006250  54 45 51 20 20 20 72 36  2c 23 97 22 3e 22 0d 2a  |TEQ   r6,#.">".*|
00006260  b2 17 20 20 20 84 52 45  51 20 72 38 2c 72 38 2c  |..   .REQ r8,r8,|
00006270  23 31 3c 3c 33 0d 2a bc  15 20 20 20 41 44 44 45  |#1<<3.*..   ADDE|
00006280  51 20 72 33 2c 72 33 2c  23 31 0d 2a c6 11 20 20  |Q r3,r3,#1.*..  |
00006290  20 ec 51 20 70 63 2c 6c  69 6e 6b 0d 2a d0 15 20  | .Q pc,link.*.. |
000062a0  20 20 54 45 51 20 20 20  72 36 2c 23 97 22 84 22  |  TEQ   r6,#."."|
000062b0  0d 2a da 18 20 20 20 84  52 45 51 20 72 37 2c 72  |.*..   .REQ r7,r|
000062c0  37 2c 23 31 3c 3c 32 32  0d 2a e4 15 20 20 20 41  |7,#1<<22.*..   A|
000062d0  44 44 45 51 20 72 33 2c  72 33 2c 23 31 0d 2a ee  |DDEQ r3,r3,#1.*.|
000062e0  14 20 20 20 4d 4f 56 20  20 20 70 63 2c 6c 69 6e  |.   MOV   pc,lin|
000062f0  6b 0d 2a f8 05 3b 0d 2b  02 17 3b 20 20 72 30 20  |k.*..;.+..;  r0 |
00006300  20 3d 20 6d 65 6e 75 20  62 6c 6f 63 6b 0d 2b 0c  | = menu block.+.|
00006310  29 3b 20 20 72 31 20 20  3d 20 69 6e 64 69 72 65  |);  r1  = indire|
00006320  63 74 65 64 20 74 65 78  74 20 73 74 72 69 6e 67  |cted text string|
00006330  20 62 6c 6f 63 6b 0d 2b  16 18 3b 20 20 72 32 20  | block.+..;  r2 |
00006340  20 3d 20 6d 65 6e 75 20  73 74 72 69 6e 67 0d 2b  | = menu string.+|
00006350  20 05 3b 0d 2b 2a 0e 3b  20 20 72 65 74 75 72 6e  | .;.+*.;  return|
00006360  73 0d 2b 34 2b 3b 20 20  72 30 20 20 3d 20 6e 65  |s.+4+;  r0  = ne|
00006370  78 74 20 6c 6f 63 61 74  69 6f 6e 20 61 66 74 65  |xt location afte|
00006380  72 20 6d 65 6e 75 20 62  6c 6f 63 6b 0d 2b 3e 2a  |r menu block.+>*|
00006390  3b 20 20 72 31 20 20 3d  20 6e 65 78 74 20 6c 6f  |;  r1  = next lo|
000063a0  63 61 74 69 6f 6e 20 69  6e 20 73 74 72 69 6e 67  |cation in string|
000063b0  20 62 6c 6f 63 6b 0d 2b  48 05 3b 0d 2b 52 0d 2e  | block.+H.;.+R..|
000063c0  6d 61 6b 65 6d 65 6e 75  0d 2b 5c 1a 20 20 20 53  |makemenu.+\.   S|
000063d0  54 4d 46 44 20 28 73 70  29 21 2c 7b 72 36 2c 72  |TMFD (sp)!,{r6,r|
000063e0  37 7d 0d 2b 66 12 20 20  20 4d 4f 56 20 20 20 72  |7}.+f.   MOV   r|
000063f0  38 2c 23 30 0d 2b 70 17  20 20 20 4c 44 52 42 20  |8,#0.+p.   LDRB |
00006400  20 72 39 2c 5b 72 33 2c  23 30 5d 0d 2b 7a 15 20  | r9,[r3,#0].+z. |
00006410  20 20 54 45 51 20 20 20  72 39 2c 23 97 22 23 22  |  TEQ   r9,#."#"|
00006420  0d 2b 84 15 20 20 20 41  44 44 45 51 20 72 33 2c  |.+..   ADDEQ r3,|
00006430  72 33 2c 23 31 0d 2b 8e  17 20 20 20 53 54 52 4e  |r3,#1.+..   STRN|
00006440  45 20 72 38 2c 5b 72 30  2c 23 30 5d 0d 2b 98 16  |E r8,[r0,#0].+..|
00006450  20 20 20 42 4e 45 20 20  20 6d 61 6b 65 6d 65 6e  |   BNE   makemen|
00006460  75 31 0d 2b a2 12 20 20  20 4d 4f 56 20 20 20 72  |u1.+..   MOV   r|
00006470  39 2c 72 33 0d 2b ac 18  20 20 20 4d 4f 56 20 20  |9,r3.+..   MOV  |
00006480  20 72 31 30 2c 23 97 28  22 2c 22 29 0d 2b b6 19  | r10,#.(",").+..|
00006490  20 20 20 42 4c 20 20 20  20 63 6f 75 6e 74 73 70  |   BL    countsp|
000064a0  65 63 69 61 6c 0d 2b c0  16 20 20 20 54 53 54 20  |ecial.+..   TST |
000064b0  20 20 72 31 31 2c 23 26  31 30 30 0d 2b ca 1a 20  |  r11,#&100.+.. |
000064c0  20 20 42 4e 45 20 20 20  62 61 64 6d 65 6e 75 73  |  BNE   badmenus|
000064d0  74 72 69 6e 67 0d 2b d4  14 20 20 20 43 4d 50 20  |tring.+..   CMP |
000064e0  20 20 72 31 31 2c 23 31  31 0d 2b de 19 20 20 20  |  r11,#11.+..   |
000064f0  42 47 54 20 20 20 62 61  64 6d 65 6e 75 74 69 74  |BGT   badmenutit|
00006500  6c 65 0d 2b e8 12 20 20  20 4d 4f 56 20 20 20 72  |le.+..   MOV   r|
00006510  39 2c 72 33 0d 2b f2 13  20 20 20 4d 4f 56 20 20  |9,r3.+..   MOV  |
00006520  20 72 31 30 2c 72 30 0d  2b fc 16 20 20 20 42 4c  | r10,r0.+..   BL|
00006530  20 20 20 20 63 6f 70 79  63 68 61 72 73 0d 2c 06  |    copychars.,.|
00006540  15 20 20 20 41 44 44 20  20 20 72 33 2c 72 39 2c  |.   ADD   r3,r9,|
00006550  23 31 0d 2c 10 0e 2e 6d  61 6b 65 6d 65 6e 75 31  |#1.,...makemenu1|
00006560  0d 2c 1a 1a 20 20 20 4c  44 52 20 20 20 72 38 2c  |.,..   LDR   r8,|
00006570  28 6d 65 6e 75 64 61 74  61 29 0d 2c 24 18 20 20  |(menudata).,$.  |
00006580  20 53 54 52 20 20 20 72  38 2c 5b 72 30 2c 23 31  | STR   r8,[r0,#1|
00006590  32 5d 0d 2c 2e 13 20 20  20 4d 4f 56 20 20 20 72  |2].,..   MOV   r|
000065a0  38 2c 23 34 34 0d 2c 38  18 20 20 20 53 54 52 20  |8,#44.,8.   STR |
000065b0  20 20 72 38 2c 5b 72 30  2c 23 32 30 5d 0d 2c 42  |  r8,[r0,#20].,B|
000065c0  18 20 20 20 53 54 52 20  20 20 72 32 2c 5b 72 30  |.   STR   r2,[r0|
000065d0  2c 23 31 36 5d 0d 2c 4c  12 20 20 20 4d 4f 56 20  |,#16].,L.   MOV |
000065e0  20 20 72 39 2c 23 30 0d  2c 56 18 20 20 20 53 54  |  r9,#0.,V.   ST|
000065f0  52 20 20 20 72 39 2c 5b  72 30 2c 23 32 34 5d 0d  |R   r9,[r0,#24].|
00006600  2c 60 16 20 20 20 41 44  44 20 20 20 72 30 2c 72  |,`.   ADD   r0,r|
00006610  30 2c 23 32 38 0d 2c 6a  11 2e 6d 61 6b 65 6d 65  |0,#28.,j..makeme|
00006620  6e 75 6c 6f 6f 70 0d 2c  74 12 20 20 20 4d 4f 56  |nuloop.,t.   MOV|
00006630  20 20 20 72 38 2c 23 30  0d 2c 7e 1b 20 20 20 4c  |   r8,#0.,~.   L|
00006640  44 52 20 20 20 72 37 2c  28 74 65 78 74 64 61 74  |DR   r7,(textdat|
00006650  61 32 29 0d 2c 88 19 20  20 20 42 4c 20 20 20 20  |a2).,..   BL    |
00006660  72 65 61 64 6d 65 6e 75  66 6c 61 67 0d 2c 92 19  |readmenuflag.,..|
00006670  20 20 20 42 4c 20 20 20  20 72 65 61 64 6d 65 6e  |   BL    readmen|
00006680  75 66 6c 61 67 0d 2c 9c  19 20 20 20 42 4c 20 20  |uflag.,..   BL  |
00006690  20 20 72 65 61 64 6d 65  6e 75 66 6c 61 67 0d 2c  |  readmenuflag.,|
000066a0  a6 19 20 20 20 42 4c 20  20 20 20 72 65 61 64 6d  |..   BL    readm|
000066b0  65 6e 75 66 6c 61 67 0d  2c b0 19 20 20 20 42 4c  |enuflag.,..   BL|
000066c0  20 20 20 20 72 65 61 64  6d 65 6e 75 66 6c 61 67  |    readmenuflag|
000066d0  0d 2c ba 12 20 20 20 4d  56 4e 20 20 20 72 39 2c  |.,..   MVN   r9,|
000066e0  23 30 0d 2c c4 17 20 20  20 53 54 52 20 20 20 72  |#0.,..   STR   r|
000066f0  39 2c 5b 72 30 2c 23 34  5d 0d 2c ce 12 20 20 20  |9,[r0,#4].,..   |
00006700  4d 4f 56 20 20 20 72 39  2c 72 33 0d 2c d8 16 20  |MOV   r9,r3.,.. |
00006710  20 20 4d 4f 56 20 20 20  72 31 30 2c 23 97 22 2c  |  MOV   r10,#.",|
00006720  22 0d 2c e2 19 20 20 20  42 4c 20 20 20 20 63 6f  |".,..   BL    co|
00006730  75 6e 74 73 70 65 63 69  61 6c 0d 2c ec 16 20 20  |untspecial.,..  |
00006740  20 54 53 54 20 20 20 72  31 31 2c 23 26 31 30 30  | TST   r11,#&100|
00006750  0d 2c f6 17 20 20 20 84  52 4e 45 20 72 38 2c 72  |.,..   .RNE r8,r|
00006760  38 2c 23 31 3c 3c 37 0d  2d 00 17 20 20 20 80 4e  |8,#1<<7.-..   .N|
00006770  45 20 72 31 31 2c 72 31  31 2c 23 26 46 46 0d 2d  |E r11,r11,#&FF.-|
00006780  0a 14 20 20 20 53 54 52  20 20 20 72 38 2c 5b 72  |..   STR   r8,[r|
00006790  30 5d 0d 2d 14 14 20 20  20 43 4d 50 20 20 20 72  |0].-..   CMP   r|
000067a0  31 31 2c 23 31 31 0d 2d  1e 16 20 20 20 42 47 54  |11,#11.-..   BGT|
000067b0  20 20 20 6d 61 6b 65 6d  65 6e 75 32 0d 2d 28 17  |   makemenu2.-(.|
000067c0  20 20 20 53 54 52 20 20  20 72 37 2c 5b 72 30 2c  |   STR   r7,[r0,|
000067d0  23 38 5d 0d 2d 32 12 20  20 20 4d 4f 56 20 20 20  |#8].-2.   MOV   |
000067e0  72 39 2c 72 33 0d 2d 3c  17 20 20 20 41 44 44 20  |r9,r3.-<.   ADD |
000067f0  20 20 72 31 30 2c 72 30  2c 23 31 32 0d 2d 46 16  |  r10,r0,#12.-F.|
00006800  20 20 20 42 4c 20 20 20  20 63 6f 70 79 63 68 61  |   BL    copycha|
00006810  72 73 0d 2d 50 15 20 20  20 41 44 44 20 20 20 72  |rs.-P.   ADD   r|
00006820  33 2c 72 39 2c 23 31 0d  2d 5a 16 20 20 20 41 44  |3,r9,#1.-Z.   AD|
00006830  44 20 20 20 72 30 2c 72  30 2c 23 32 34 0d 2d 64  |D   r0,r0,#24.-d|
00006840  18 20 20 20 4c 44 52 42  20 20 72 39 2c 5b 72 33  |.   LDRB  r9,[r3|
00006850  2c 23 2d 31 5d 0d 2d 6e  15 20 20 20 54 45 51 20  |,#-1].-n.   TEQ |
00006860  20 20 72 39 2c 23 97 22  2c 22 0d 2d 78 19 20 20  |  r9,#.",".-x.  |
00006870  20 42 45 51 20 20 20 6d  61 6b 65 6d 65 6e 75 6c  | BEQ   makemenul|
00006880  6f 6f 70 0d 2d 82 18 20  20 20 42 20 20 20 20 20  |oop.-..   B     |
00006890  6d 61 6b 65 6d 65 6e 75  6f 75 74 0d 2d 8c 0e 2e  |makemenuout.-...|
000068a0  6d 61 6b 65 6d 65 6e 75  32 0d 2d 96 17 20 20 20  |makemenu2.-..   |
000068b0  84 52 20 20 20 72 37 2c  72 37 2c 23 26 31 30 30  |.R   r7,r7,#&100|
000068c0  0d 2d a0 17 20 20 20 53  54 52 20 20 20 72 37 2c  |.-..   STR   r7,|
000068d0  5b 72 30 2c 23 38 5d 0d  2d aa 19 20 20 20 53 54  |[r0,#8].-..   ST|
000068e0  52 20 20 20 72 31 31 2c  5b 72 30 2c 23 32 30 5d  |R   r11,[r0,#20]|
000068f0  0d 2d b4 18 20 20 20 53  54 52 20 20 20 72 31 2c  |.-..   STR   r1,|
00006900  5b 72 30 2c 23 31 32 5d  0d 2d be 12 20 20 20 4d  |[r0,#12].-..   M|
00006910  56 4e 20 20 20 72 39 2c  23 30 0d 2d c8 18 20 20  |VN   r9,#0.-..  |
00006920  20 53 54 52 20 20 20 72  39 2c 5b 72 30 2c 23 31  | STR   r9,[r0,#1|
00006930  36 5d 0d 2d d2 12 20 20  20 4d 4f 56 20 20 20 72  |6].-..   MOV   r|
00006940  39 2c 72 33 0d 2d dc 13  20 20 20 4d 4f 56 20 20  |9,r3.-..   MOV  |
00006950  20 72 31 30 2c 72 31 0d  2d e6 16 20 20 20 42 4c  | r10,r1.-..   BL|
00006960  20 20 20 20 63 6f 70 79  63 68 61 72 73 0d 2d f0  |    copychars.-.|
00006970  15 20 20 20 41 44 44 20  20 20 72 33 2c 72 39 2c  |.   ADD   r3,r9,|
00006980  23 31 0d 2d fa 16 20 20  20 41 44 44 20 20 20 72  |#1.-..   ADD   r|
00006990  31 2c 72 31 30 2c 23 31  0d 2e 04 16 20 20 20 41  |1,r10,#1....   A|
000069a0  44 44 20 20 20 72 30 2c  72 30 2c 23 32 34 0d 2e  |DD   r0,r0,#24..|
000069b0  0e 18 20 20 20 4c 44 52  42 20 20 72 39 2c 5b 72  |..   LDRB  r9,[r|
000069c0  33 2c 23 2d 31 5d 0d 2e  18 15 20 20 20 54 45 51  |3,#-1]....   TEQ|
000069d0  20 20 20 72 39 2c 23 97  22 2c 22 0d 2e 22 19 20  |   r9,#.","..". |
000069e0  20 20 42 45 51 20 20 20  6d 61 6b 65 6d 65 6e 75  |  BEQ   makemenu|
000069f0  6c 6f 6f 70 0d 2e 2c 10  2e 6d 61 6b 65 6d 65 6e  |loop..,..makemen|
00006a00  75 6f 75 74 0d 2e 36 1a  20 20 20 4c 44 4d 46 44  |uout..6.   LDMFD|
00006a10  20 28 73 70 29 21 2c 7b  72 36 2c 72 37 7d 0d 2e  | (sp)!,{r6,r7}..|
00006a20  40 14 20 20 20 42 20 20  20 20 20 65 78 69 74 73  |@.   B     exits|
00006a30  77 69 0d 2e 4a 05 3b 0d  2e 54 32 2e 62 61 64 6d  |wi..J.;..T2.badm|
00006a40  65 6e 75 73 74 72 69 6e  67 20 20 20 20 20 20 20  |enustring       |
00006a50  20 20 20 20 20 20 20 20  20 20 3b 20 65 72 72 6f  |          ; erro|
00006a60  72 20 6d 65 73 73 61 67  65 0d 2e 5e 1a 20 20 20  |r message..^.   |
00006a70  4c 44 4d 46 44 20 28 73  70 29 21 2c 7b 72 36 2c  |LDMFD (sp)!,{r6,|
00006a80  72 37 7d 0d 2e 68 19 20  20 20 41 44 52 20 20 20  |r7}..h.   ADR   |
00006a90  72 30 2c 62 64 6d 65 6e  75 73 74 72 0d 2e 72 16  |r0,bdmenustr..r.|
00006aa0  20 20 20 42 20 20 20 20  20 6d 61 6b 65 65 72 72  |   B     makeerr|
00006ab0  6f 72 0d 2e 7c 05 3b 0d  2e 86 0e 2e 62 64 6d 65  |or..|.;.....bdme|
00006ac0  6e 75 73 74 72 0d 2e 90  15 45 51 55 44 20 20 45  |nustr....EQUD  E|
00006ad0  72 72 6f 72 42 61 73 65  2b 34 0d 2e 9a 2d 45 51  |rrorBase+4...-EQ|
00006ae0  55 53 20 20 22 49 6e 63  6f 72 72 65 63 74 20 6d  |US  "Incorrect m|
00006af0  65 6e 75 20 64 65 73 72  69 70 74 69 6f 6e 20 73  |enu desription s|
00006b00  74 72 69 6e 67 21 22 0d  2e a4 0b 45 51 55 42 20  |tring!"....EQUB |
00006b10  20 30 0d 2e ae 09 41 4c  49 47 4e 0d 2e b8 05 3b  | 0....ALIGN....;|
00006b20  0d 2e c2 32 2e 62 61 64  6d 65 6e 75 74 69 74 6c  |...2.badmenutitl|
00006b30  65 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |e               |
00006b40  20 20 20 3b 20 65 72 72  6f 72 20 6d 65 73 73 61  |   ; error messa|
00006b50  67 65 0d 2e cc 1a 20 20  20 4c 44 4d 46 44 20 28  |ge....   LDMFD (|
00006b60  73 70 29 21 2c 7b 72 36  2c 72 37 7d 0d 2e d6 19  |sp)!,{r6,r7}....|
00006b70  20 20 20 41 44 52 20 20  20 72 30 2c 62 64 6d 65  |   ADR   r0,bdme|
00006b80  6e 75 74 6c 65 0d 2e e0  16 20 20 20 42 20 20 20  |nutle....   B   |
00006b90  20 20 6d 61 6b 65 65 72  72 6f 72 0d 2e ea 05 3b  |  makeerror....;|
00006ba0  0d 2e f4 0e 2e 62 64 6d  65 6e 75 74 6c 65 0d 2e  |.....bdmenutle..|
00006bb0  fe 15 45 51 55 44 20 20  45 72 72 6f 72 42 61 73  |..EQUD  ErrorBas|
00006bc0  65 2b 35 0d 2f 08 20 45  51 55 53 20 20 22 4d 65  |e+5./. EQUS  "Me|
00006bd0  6e 75 20 74 69 74 6c 65  20 74 6f 6f 20 6c 6f 6e  |nu title too lon|
00006be0  67 21 22 0d 2f 12 0b 45  51 55 42 20 20 30 0d 2f  |g!"./..EQUB  0./|
00006bf0  1c 09 41 4c 49 47 4e 0d  2f 26 05 3b 0d 2f 30 1a  |..ALIGN./&.;./0.|
00006c00  3b 20 20 72 30 20 20 3d  20 77 69 6e 64 6f 77 20  |;  r0  = window |
00006c10  68 61 6e 64 6c 65 0d 2f  3a 18 3b 20 20 72 31 20  |handle./:.;  r1 |
00006c20  20 3d 20 69 63 6f 6e 20  6e 75 6d 62 65 72 0d 2f  | = icon number./|
00006c30  44 19 3b 20 20 72 32 20  20 3d 20 73 70 72 69 74  |D.;  r2  = sprit|
00006c40  65 20 62 6c 6f 63 6b 0d  2f 4e 05 3b 0d 2f 58 0e  |e block./N.;./X.|
00006c50  3b 20 20 72 65 74 75 72  6e 73 0d 2f 62 46 3b 20  |;  returns./bF; |
00006c60  20 72 30 20 20 3d 20 64  72 61 67 20 74 79 70 65  | r0  = drag type|
00006c70  20 3b 20 2d 31 20 3d 20  75 73 65 64 20 44 72 61  | ; -1 = used Dra|
00006c80  67 41 53 70 72 69 74 65  20 3b 20 30 20 3d 20 75  |gASprite ; 0 = u|
00006c90  73 65 64 20 57 69 6d 70  5f 44 72 61 67 42 6f 78  |sed Wimp_DragBox|
00006ca0  0d 2f 6c 05 3b 0d 2f 76  0e 2e 73 74 61 72 74 64  |./l.;./v..startd|
00006cb0  72 61 67 0d 2f 80 1a 20  20 20 53 54 4d 46 44 20  |rag./..   STMFD |
00006cc0  28 73 70 29 21 2c 7b 72  33 2d 72 37 7d 0d 2f 8a  |(sp)!,{r3-r7}./.|
00006cd0  12 20 20 20 54 45 51 20  20 20 72 33 2c 23 30 0d  |.   TEQ   r3,#0.|
00006ce0  2f 94 19 20 20 20 42 4c  4e 45 20 20 63 6f 6e 76  |/..   BLNE  conv|
00006cf0  65 72 74 6e 61 6d 65 33  0d 2f 9e 12 20 20 20 4d  |ertname3./..   M|
00006d00  4f 56 20 20 20 72 38 2c  72 30 0d 2f a8 12 20 20  |OV   r8,r0./..  |
00006d10  20 4d 4f 56 20 20 20 72  39 2c 72 31 0d 2f b2 17  | MOV   r9,r1./..|
00006d20  20 20 20 41 44 44 20 20  20 72 31 2c 77 73 2c 23  |   ADD   r1,ws,#|
00006d30  62 6c 6b 0d 2f bc 14 20  20 20 53 54 52 20 20 20  |blk./..   STR   |
00006d40  72 38 2c 5b 72 31 5d 0d  2f c6 23 20 20 20 53 57  |r8,[r1]./.#   SW|
00006d50  49 20 20 20 22 58 57 69  6d 70 5f 47 65 74 57 69  |I   "XWimp_GetWi|
00006d60  6e 64 6f 77 53 74 61 74  65 22 0d 2f d0 19 20 20  |ndowState"./..  |
00006d70  20 42 56 53 20 20 20 73  65 74 75 70 64 72 61 67  | BVS   setupdrag|
00006d80  6f 75 74 0d 2f da 18 20  20 20 4c 44 52 20 20 20  |out./..   LDR   |
00006d90  72 37 2c 5b 72 31 2c 23  32 30 5d 0d 2f e4 18 20  |r7,[r1,#20]./.. |
00006da0  20 20 4c 44 52 20 20 20  72 31 30 2c 5b 72 31 2c  |  LDR   r10,[r1,|
00006db0  23 34 5d 0d 2f ee 17 20  20 20 53 55 42 20 20 20  |#4]./..   SUB   |
00006dc0  72 31 30 2c 72 31 30 2c  72 37 0d 2f f8 18 20 20  |r10,r10,r7./..  |
00006dd0  20 4c 44 52 20 20 20 72  37 2c 5b 72 31 2c 23 32  | LDR   r7,[r1,#2|
00006de0  34 5d 0d 30 02 19 20 20  20 4c 44 52 20 20 20 72  |4].0..   LDR   r|
00006df0  31 31 2c 5b 72 31 2c 23  31 36 5d 0d 30 0c 17 20  |11,[r1,#16].0.. |
00006e00  20 20 53 55 42 20 20 20  72 31 31 2c 72 31 31 2c  |  SUB   r11,r11,|
00006e10  72 37 0d 30 16 17 20 20  20 53 54 52 20 20 20 72  |r7.0..   STR   r|
00006e20  39 2c 5b 72 31 2c 23 34  5d 0d 30 20 21 20 20 20  |9,[r1,#4].0 !   |
00006e30  53 57 49 20 20 20 22 58  57 69 6d 70 5f 47 65 74  |SWI   "XWimp_Get|
00006e40  49 63 6f 6e 53 74 61 74  65 22 0d 30 2a 19 20 20  |IconState".0*.  |
00006e50  20 42 56 53 20 20 20 73  65 74 75 70 64 72 61 67  | BVS   setupdrag|
00006e60  6f 75 74 0d 30 34 12 20  20 20 4d 4f 56 20 20 20  |out.04.   MOV   |
00006e70  72 37 2c 23 35 0d 30 3e  17 20 20 20 53 54 52 20  |r7,#5.0>.   STR |
00006e80  20 20 72 37 2c 5b 72 31  2c 23 34 5d 0d 30 48 17  |  r7,[r1,#4].0H.|
00006e90  20 20 20 4c 44 52 20 20  20 72 37 2c 5b 72 31 2c  |   LDR   r7,[r1,|
00006ea0  23 38 5d 0d 30 52 16 20  20 20 41 44 44 20 20 20  |#8].0R.   ADD   |
00006eb0  72 37 2c 72 31 30 2c 72  37 0d 30 5c 17 20 20 20  |r7,r10,r7.0\.   |
00006ec0  53 54 52 20 20 20 72 37  2c 5b 72 31 2c 23 38 5d  |STR   r7,[r1,#8]|
00006ed0  0d 30 66 18 20 20 20 4c  44 52 20 20 20 72 37 2c  |.0f.   LDR   r7,|
00006ee0  5b 72 31 2c 23 31 32 5d  0d 30 70 16 20 20 20 41  |[r1,#12].0p.   A|
00006ef0  44 44 20 20 20 72 37 2c  72 31 31 2c 72 37 0d 30  |DD   r7,r11,r7.0|
00006f00  7a 18 20 20 20 53 54 52  20 20 20 72 37 2c 5b 72  |z.   STR   r7,[r|
00006f10  31 2c 23 31 32 5d 0d 30  84 18 20 20 20 4c 44 52  |1,#12].0..   LDR|
00006f20  20 20 20 72 37 2c 5b 72  31 2c 23 31 36 5d 0d 30  |   r7,[r1,#16].0|
00006f30  8e 16 20 20 20 41 44 44  20 20 20 72 37 2c 72 31  |..   ADD   r7,r1|
00006f40  30 2c 72 37 0d 30 98 18  20 20 20 53 54 52 20 20  |0,r7.0..   STR  |
00006f50  20 72 37 2c 5b 72 31 2c  23 31 36 5d 0d 30 a2 18  | r7,[r1,#16].0..|
00006f60  20 20 20 4c 44 52 20 20  20 72 37 2c 5b 72 31 2c  |   LDR   r7,[r1,|
00006f70  23 32 30 5d 0d 30 ac 16  20 20 20 41 44 44 20 20  |#20].0..   ADD  |
00006f80  20 72 37 2c 72 31 31 2c  72 37 0d 30 b6 18 20 20  | r7,r11,r7.0..  |
00006f90  20 53 54 52 20 20 20 72  37 2c 5b 72 31 2c 23 32  | STR   r7,[r1,#2|
00006fa0  30 5d 0d 30 c0 12 20 20  20 4d 4f 56 20 20 20 72  |0].0..   MOV   r|
00006fb0  37 2c 23 30 0d 30 ca 18  20 20 20 53 54 52 20 20  |7,#0.0..   STR  |
00006fc0  20 72 37 2c 5b 72 31 2c  23 32 34 5d 0d 30 d4 18  | r7,[r1,#24].0..|
00006fd0  20 20 20 53 54 52 20 20  20 72 37 2c 5b 72 31 2c  |   STR   r7,[r1,|
00006fe0  23 32 38 5d 0d 30 de 1a  20 20 20 4d 56 4e 20 20  |#28].0..   MVN  |
00006ff0  20 72 37 2c 23 26 38 30  30 30 30 30 30 30 0d 30  | r7,#&80000000.0|
00007000  e8 18 20 20 20 53 54 52  20 20 20 72 37 2c 5b 72  |..   STR   r7,[r|
00007010  31 2c 23 33 32 5d 0d 30  f2 18 20 20 20 53 54 52  |1,#32].0..   STR|
00007020  20 20 20 72 37 2c 5b 72  31 2c 23 33 36 5d 0d 30  |   r7,[r1,#36].0|
00007030  fc 12 20 20 20 4d 4f 56  20 20 20 72 37 2c 72 32  |..   MOV   r7,r2|
00007040  0d 31 06 1d 20 20 20 41  44 52 20 20 20 72 31 2c  |.1..   ADR   r1,|
00007050  28 64 72 61 67 61 73 70  72 69 74 65 29 0d 31 10  |(dragasprite).1.|
00007060  26 20 20 20 53 57 49 20  20 20 22 58 4f 53 5f 53  |&   SWI   "XOS_S|
00007070  57 49 4e 75 6d 62 65 72  46 72 6f 6d 53 74 72 69  |WINumberFromStri|
00007080  6e 67 22 0d 31 1a 15 20  20 20 42 56 53 20 20 20  |ng".1..   BVS   |
00007090  77 69 6d 70 64 72 61 67  0d 31 24 14 20 20 20 4d  |wimpdrag.1$.   M|
000070a0  4f 56 20 20 20 72 30 2c  23 31 36 31 0d 31 2e 13  |OV   r0,#161.1..|
000070b0  20 20 20 4d 4f 56 20 20  20 72 31 2c 23 32 38 0d  |   MOV   r1,#28.|
000070c0  31 38 17 20 20 20 53 57  49 20 20 20 22 58 4f 53  |18.   SWI   "XOS|
000070d0  5f 42 79 74 65 22 0d 31  42 14 20 20 20 42 56 53  |_Byte".1B.   BVS|
000070e0  20 20 20 65 78 69 74 73  77 69 0d 31 4c 15 20 20  |   exitswi.1L.  |
000070f0  20 54 53 54 20 20 20 72  32 2c 23 31 3c 3c 31 0d  | TST   r2,#1<<1.|
00007100  31 56 15 20 20 20 42 45  51 20 20 20 77 69 6d 70  |1V.   BEQ   wimp|
00007110  64 72 61 67 0d 31 60 1c  20 20 20 41 44 44 20 20  |drag.1`.   ADD  |
00007120  20 72 31 2c 77 73 2c 23  28 62 6c 6b 2b 34 38 29  | r1,ws,#(blk+48)|
00007130  0d 31 6a 14 20 20 20 53  54 52 20 20 20 72 38 2c  |.1j.   STR   r8,|
00007140  5b 72 31 5d 0d 31 74 17  20 20 20 53 54 52 20 20  |[r1].1t.   STR  |
00007150  20 72 39 2c 5b 72 31 2c  23 34 5d 0d 31 7e 21 20  | r9,[r1,#4].1~! |
00007160  20 20 53 57 49 20 20 20  22 58 57 69 6d 70 5f 47  |  SWI   "XWimp_G|
00007170  65 74 49 63 6f 6e 53 74  61 74 65 22 0d 31 88 19  |etIconState".1..|
00007180  20 20 20 42 56 53 20 20  20 73 65 74 75 70 64 72  |   BVS   setupdr|
00007190  61 67 6f 75 74 0d 31 92  18 20 20 20 4c 44 52 20  |agout.1..   LDR |
000071a0  20 20 72 30 2c 5b 72 31  2c 23 32 34 5d 0d 31 9c  |  r0,[r1,#24].1.|
000071b0  12 20 20 20 54 53 54 20  20 20 72 30 2c 23 32 0d  |.   TST   r0,#2.|
000071c0  31 a6 15 20 20 20 42 45  51 20 20 20 77 69 6d 70  |1..   BEQ   wimp|
000071d0  64 72 61 67 0d 31 b0 12  20 20 20 54 53 54 20 20  |drag.1..   TST  |
000071e0  20 72 30 2c 23 31 0d 31  ba 19 20 20 20 42 4e 45  | r0,#1.1..   BNE|
000071f0  20 20 20 64 72 61 67 69  6e 64 69 72 65 63 74 0d  |   dragindirect.|
00007200  31 c4 15 20 20 20 54 53  54 20 20 20 72 30 2c 23  |1..   TST   r0,#|
00007210  26 31 30 30 0d 31 ce 0f  2e 64 72 61 67 64 69 72  |&100.1...dragdir|
00007220  65 63 74 0d 31 d8 18 20  20 20 4c 44 52 4e 45 20  |ect.1..   LDRNE |
00007230  72 32 2c 5b 72 31 2c 23  32 38 5d 0d 31 e2 16 20  |r2,[r1,#28].1.. |
00007240  20 20 41 44 44 45 51 20  72 32 2c 72 31 2c 23 32  |  ADDEQ r2,r1,#2|
00007250  38 0d 31 ec 12 20 20 20  4d 4f 56 20 20 20 72 31  |8.1..   MOV   r1|
00007260  2c 72 37 0d 31 f6 0f 2e  64 72 61 67 73 70 72 69  |,r7.1...dragspri|
00007270  74 65 0d 32 00 1a 20 20  20 4d 4f 56 20 20 20 72  |te.2..   MOV   r|
00007280  30 2c 23 25 31 31 30 30  30 31 30 31 0d 32 0a 17  |0,#%11000101.2..|
00007290  20 20 20 41 44 44 20 20  20 72 33 2c 77 73 2c 23  |   ADD   r3,ws,#|
000072a0  62 6c 6b 0d 32 14 15 20  20 20 41 44 44 20 20 20  |blk.2..   ADD   |
000072b0  72 33 2c 72 33 2c 23 38  0d 32 1e 16 20 20 20 41  |r3,r3,#8.2..   A|
000072c0  44 44 20 20 20 72 34 2c  72 33 2c 23 31 36 0d 32  |DD   r4,r3,#16.2|
000072d0  28 21 20 20 20 53 57 49  20 20 20 22 58 44 72 61  |(!   SWI   "XDra|
000072e0  67 41 53 70 72 69 74 65  5f 53 74 61 72 74 22 0d  |gASprite_Start".|
000072f0  32 32 12 20 20 20 4d 56  4e 20 20 20 72 30 2c 23  |22.   MVN   r0,#|
00007300  30 0d 32 3c 19 20 20 20  42 20 20 20 20 20 73 65  |0.2<.   B     se|
00007310  74 75 70 64 72 61 67 6f  75 74 0d 32 46 0d 2e 77  |tupdragout.2F..w|
00007320  69 6d 70 64 72 61 67 0d  32 50 17 20 20 20 41 44  |impdrag.2P.   AD|
00007330  44 20 20 20 72 31 2c 77  73 2c 23 62 6c 6b 0d 32  |D   r1,ws,#blk.2|
00007340  5a 1c 20 20 20 53 57 49  20 20 20 22 58 57 69 6d  |Z.   SWI   "XWim|
00007350  70 5f 44 72 61 67 42 6f  78 22 0d 32 64 19 20 20  |p_DragBox".2d.  |
00007360  20 42 56 53 20 20 20 73  65 74 75 70 64 72 61 67  | BVS   setupdrag|
00007370  6f 75 74 0d 32 6e 12 20  20 20 4d 4f 56 20 20 20  |out.2n.   MOV   |
00007380  72 30 2c 23 30 0d 32 78  15 20 20 20 41 44 44 53  |r0,#0.2x.   ADDS|
00007390  20 20 72 30 2c 72 30 2c  72 30 0d 32 82 11 2e 73  |  r0,r0,r0.2...s|
000073a0  65 74 75 70 64 72 61 67  6f 75 74 0d 32 8c 1a 20  |etupdragout.2.. |
000073b0  20 20 4c 44 4d 46 44 20  28 73 70 29 21 2c 7b 72  |  LDMFD (sp)!,{r|
000073c0  33 2d 72 37 7d 0d 32 96  14 20 20 20 42 20 20 20  |3-r7}.2..   B   |
000073d0  20 20 65 78 69 74 73 77  69 0d 32 a0 11 2e 64 72  |  exitswi.2...dr|
000073e0  61 67 69 6e 64 69 72 65  63 74 0d 32 aa 15 20 20  |agindirect.2..  |
000073f0  20 54 53 54 20 20 20 72  30 2c 23 26 31 30 30 0d  | TST   r0,#&100.|
00007400  32 b4 17 20 20 20 42 45  51 20 20 20 64 72 61 67  |2..   BEQ   drag|
00007410  64 69 72 65 63 74 0d 32  be 18 20 20 20 4c 44 52  |direct.2..   LDR|
00007420  20 20 20 72 30 2c 5b 72  31 2c 23 33 32 5d 0d 32  |   r0,[r1,#32].2|
00007430  c8 12 20 20 20 43 4d 4e  20 20 20 72 30 2c 23 31  |..   CMN   r0,#1|
00007440  0d 32 d2 18 20 20 20 4c  44 52 45 51 20 72 32 2c  |.2..   LDREQ r2,|
00007450  5b 72 31 2c 23 32 38 5d  0d 32 dc 0f 20 20 20 ec  |[r1,#28].2..   .|
00007460  51 20 72 31 2c 72 37 0d  32 e6 17 20 20 20 42 45  |Q r1,r7.2..   BE|
00007470  51 20 20 20 64 72 61 67  73 70 72 69 74 65 0d 32  |Q   dragsprite.2|
00007480  f0 18 20 20 20 4c 44 52  20 20 20 72 32 2c 5b 72  |..   LDR   r2,[r|
00007490  31 2c 23 33 32 5d 0d 32  fa 12 2e 64 72 61 67 69  |1,#32].2...dragi|
000074a0  6e 64 69 72 65 63 74 31  0d 33 04 17 20 20 20 4c  |ndirect1.3..   L|
000074b0  44 52 42 20 20 72 30 2c  5b 72 32 5d 2c 23 31 0d  |DRB  r0,[r2],#1.|
000074c0  33 0e 13 20 20 20 43 4d  50 20 20 20 72 30 2c 23  |3..   CMP   r0,#|
000074d0  33 32 0d 33 18 15 20 20  20 42 4c 54 20 20 20 77  |32.3..   BLT   w|
000074e0  69 6d 70 64 72 61 67 0d  33 22 15 20 20 20 54 45  |impdrag.3".   TE|
000074f0  51 20 20 20 72 30 2c 23  97 22 3b 22 0d 33 2c 1a  |Q   r0,#.";".3,.|
00007500  20 20 20 42 45 51 20 20  20 64 72 61 67 69 6e 64  |   BEQ   dragind|
00007510  69 72 65 63 74 31 0d 33  36 16 20 20 20 84 52 20  |irect1.36.   .R |
00007520  20 20 72 30 2c 72 30 2c  23 26 32 30 0d 33 40 15  |  r0,r0,#&20.3@.|
00007530  20 20 20 54 45 51 20 20  20 72 30 2c 23 97 22 73  |   TEQ   r0,#."s|
00007540  22 0d 33 4a 0f 20 20 20  ec 51 20 72 31 2c 72 37  |".3J.   .Q r1,r7|
00007550  0d 33 54 17 20 20 20 42  45 51 20 20 20 64 72 61  |.3T.   BEQ   dra|
00007560  67 73 70 72 69 74 65 0d  33 5e 12 2e 64 72 61 67  |gsprite.3^..drag|
00007570  69 6e 64 69 72 65 63 74  32 0d 33 68 17 20 20 20  |indirect2.3h.   |
00007580  4c 44 52 42 20 20 72 30  2c 5b 72 32 5d 2c 23 31  |LDRB  r0,[r2],#1|
00007590  0d 33 72 13 20 20 20 43  4d 50 20 20 20 72 30 2c  |.3r.   CMP   r0,|
000075a0  23 33 32 0d 33 7c 15 20  20 20 42 4c 54 20 20 20  |#32.3|.   BLT   |
000075b0  77 69 6d 70 64 72 61 67  0d 33 86 15 20 20 20 54  |wimpdrag.3..   T|
000075c0  45 51 20 20 20 72 30 2c  23 97 22 3b 22 0d 33 90  |EQ   r0,#.";".3.|
000075d0  1a 20 20 20 42 45 51 20  20 20 64 72 61 67 69 6e  |.   BEQ   dragin|
000075e0  64 69 72 65 63 74 31 0d  33 9a 1a 20 20 20 42 20  |direct1.3..   B |
000075f0  20 20 20 20 64 72 61 67  69 6e 64 69 72 65 63 74  |    dragindirect|
00007600  32 0d 33 a4 05 3b 0d 33  ae 10 2e 64 72 61 67 61  |2.3..;.3...draga|
00007610  73 70 72 69 74 65 0d 33  b8 1c 45 51 55 53 20 22  |sprite.3..EQUS "|
00007620  44 72 61 67 41 53 70 72  69 74 65 5f 53 74 61 72  |DragASprite_Star|
00007630  74 22 0d 33 c2 0a 45 51  55 42 20 30 0d 33 cc 09  |t".3..EQUB 0.3..|
00007640  41 4c 49 47 4e 0d 33 d6  05 3b 0d 33 e0 0d 2e 73  |ALIGN.3..;.3...s|
00007650  65 6e 64 73 61 76 65 0d  33 ea 1a 20 20 20 53 54  |endsave.3..   ST|
00007660  4d 46 44 20 28 73 70 29  21 2c 7b 72 30 2d 72 33  |MFD (sp)!,{r0-r3|
00007670  7d 0d 33 f4 12 20 20 20  4d 4f 56 20 20 20 72 39  |}.3..   MOV   r9|
00007680  2c 72 32 0d 33 fe 42 20  20 20 53 57 49 20 20 20  |,r2.3.B   SWI   |
00007690  22 58 57 69 6d 70 5f 47  65 74 50 6f 69 6e 74 65  |"XWimp_GetPointe|
000076a0  72 49 6e 66 6f 22 20 20  20 20 20 20 3b 20 67 65  |rInfo"      ; ge|
000076b0  74 20 70 6f 73 69 74 69  6f 6e 20 6f 66 20 70 6f  |t position of po|
000076c0  69 6e 74 65 72 0d 34 08  19 20 20 20 42 56 53 20  |inter.4..   BVS |
000076d0  20 20 73 74 61 72 74 73  61 76 65 6f 75 74 0d 34  |  startsaveout.4|
000076e0  12 18 20 20 20 4c 44 52  20 20 20 72 38 2c 5b 72  |..   LDR   r8,[r|
000076f0  31 2c 23 31 32 5d 0d 34  1c 4c 20 20 20 53 54 52  |1,#12].4.L   STR|
00007700  20 20 20 72 38 2c 5b 72  31 2c 23 32 30 5d 20 20  |   r8,[r1,#20]  |
00007710  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00007720  20 72 31 21 32 30 20 3d  20 64 65 73 74 69 6e 61  | r1!20 = destina|
00007730  74 69 6f 6e 20 77 69 6e  64 6f 77 20 68 61 6e 64  |tion window hand|
00007740  6c 65 0d 34 26 18 20 20  20 4c 44 52 20 20 20 72  |le.4&.   LDR   r|
00007750  38 2c 5b 72 31 2c 23 31  36 5d 0d 34 30 4a 20 20  |8,[r1,#16].40J  |
00007760  20 53 54 52 20 20 20 72  38 2c 5b 72 31 2c 23 32  | STR   r8,[r1,#2|
00007770  34 5d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |4]              |
00007780  20 20 20 3b 20 72 31 21  32 34 20 3d 20 64 65 73  |   ; r1!24 = des|
00007790  74 69 6e 61 74 69 6f 6e  20 69 63 6f 6e 20 68 61  |tination icon ha|
000077a0  6e 64 6c 65 0d 34 3a 14  20 20 20 4c 44 52 20 20  |ndle.4:.   LDR  |
000077b0  20 72 38 2c 5b 72 31 5d  0d 34 44 45 20 20 20 53  | r8,[r1].4DE   S|
000077c0  54 52 20 20 20 72 38 2c  5b 72 31 2c 23 32 38 5d  |TR   r8,[r1,#28]|
000077d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000077e0  20 3b 20 72 31 21 32 38  20 3d 20 70 6f 69 6e 74  | ; r1!28 = point|
000077f0  65 72 20 78 20 70 6f 73  69 74 69 6f 6e 0d 34 4e  |er x position.4N|
00007800  17 20 20 20 4c 44 52 20  20 20 72 38 2c 5b 72 31  |.   LDR   r8,[r1|
00007810  2c 23 34 5d 0d 34 58 45  20 20 20 53 54 52 20 20  |,#4].4XE   STR  |
00007820  20 72 38 2c 5b 72 31 2c  23 33 32 5d 20 20 20 20  | r8,[r1,#32]    |
00007830  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 72  |             ; r|
00007840  31 21 33 32 20 3d 20 70  6f 69 6e 74 65 72 20 79  |1!32 = pointer y|
00007850  20 70 6f 73 69 74 69 6f  6e 0d 34 62 4c 20 20 20  | position.4bL   |
00007860  53 54 52 20 20 20 72 34  2c 5b 72 31 2c 23 33 36  |STR   r4,[r1,#36|
00007870  5d 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |]               |
00007880  20 20 3b 20 72 31 21 33  36 20 3d 20 72 34 20 28  |  ; r1!36 = r4 (|
00007890  73 69 7a 65 20 6f 66 20  64 61 74 61 20 74 6f 20  |size of data to |
000078a0  73 61 76 65 29 0d 34 6c  12 20 20 20 4d 4f 56 20  |save).4l.   MOV |
000078b0  20 20 72 38 2c 23 30 0d  34 76 4a 20 20 20 53 54  |  r8,#0.4vJ   ST|
000078c0  52 20 20 20 72 38 2c 5b  72 31 2c 23 31 32 5d 20  |R   r8,[r1,#12] |
000078d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000078e0  3b 20 73 65 74 20 72 31  21 31 32 3d 30 20 6f 72  |; set r1!12=0 or|
000078f0  69 67 69 6e 61 74 69 6e  67 20 6d 65 73 73 61 67  |iginating messag|
00007900  65 0d 34 80 12 20 20 20  4d 4f 56 20 20 20 72 38  |e.4..   MOV   r8|
00007910  2c 23 31 0d 34 8a 44 20  20 20 53 54 52 20 20 20  |,#1.4.D   STR   |
00007920  72 38 2c 5b 72 31 2c 23  31 36 5d 20 20 20 20 20  |r8,[r1,#16]     |
00007930  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 4d 65  |            ; Me|
00007940  73 73 61 67 65 5f 44 61  74 61 53 61 76 65 20 28  |ssage_DataSave (|
00007950  74 79 70 65 20 31 29 0d  34 94 50 20 20 20 53 54  |type 1).4.P   ST|
00007960  52 20 20 20 72 39 2c 5b  72 31 2c 23 34 30 5d 20  |R   r9,[r1,#40] |
00007970  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00007980  3b 20 72 39 20 3d 76 61  6c 75 65 20 6f 66 20 72  |; r9 =value of r|
00007990  32 2c 20 72 31 21 34 30  3d 72 39 20 28 66 69 6c  |2, r1!40=r9 (fil|
000079a0  65 20 74 79 70 65 29 0d  34 9e 12 20 20 20 4d 4f  |e type).4..   MO|
000079b0  56 20 20 20 72 39 2c 72  33 0d 34 a8 49 20 20 20  |V   r9,r3.4.I   |
000079c0  41 44 44 20 20 20 72 31  30 2c 72 31 2c 23 34 34  |ADD   r10,r1,#44|
000079d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000079e0  20 20 3b 20 72 33 20 28  66 69 6c 65 20 6e 61 6d  |  ; r3 (file nam|
000079f0  65 20 6f 66 20 66 69 6c  65 20 74 6f 20 73 61 76  |e of file to sav|
00007a00  65 29 0d 34 b2 15 20 20  20 4d 4f 56 20 20 20 72  |e).4..   MOV   r|
00007a10  31 31 2c 23 32 35 35 0d  34 bc 3d 20 20 20 42 4c  |11,#255.4.=   BL|
00007a20  20 20 20 20 67 65 74 6c  65 61 66 20 20 20 20 20  |    getleaf     |
00007a30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00007a40  3b 20 67 65 74 20 66 69  6c 65 20 6c 65 61 66 20  |; get file leaf |
00007a50  6e 61 6d 65 0d 34 c6 33  20 20 20 42 4c 20 20 20  |name.4.3   BL   |
00007a60  20 63 6f 70 79 73 74 72  69 6e 67 20 20 20 20 20  | copystring     |
00007a70  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 63  |             ; c|
00007a80  6f 70 79 20 69 74 21 0d  34 d0 4f 20 20 20 41 44  |opy it!.4.O   AD|
00007a90  44 20 20 20 72 38 2c 72  31 31 2c 23 34 37 20 20  |D   r8,r11,#47  |
00007aa0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00007ab0  3b 20 70 75 74 20 73 69  7a 65 20 6f 66 20 62 6c  |; put size of bl|
00007ac0  6f 63 6b 20 3d 20 34 34  20 2b 20 6e 61 6d 65 20  |ock = 44 + name |
00007ad0  6c 65 6e 67 74 68 0d 34  da 1a 20 20 20 4c 44 52  |length.4..   LDR|
00007ae0  20 20 20 72 31 31 2c 28  6d 61 73 6b 74 6f 34 29  |   r11,(maskto4)|
00007af0  0d 34 e4 14 20 20 20 80  20 20 20 72 38 2c 72 38  |.4..   .   r8,r8|
00007b00  2c 72 31 31 0d 34 ee 14  20 20 20 53 54 52 20 20  |,r11.4..   STR  |
00007b10  20 72 38 2c 5b 72 31 5d  0d 34 f8 13 20 20 20 4d  | r8,[r1].4..   M|
00007b20  4f 56 20 20 20 72 30 2c  23 31 38 0d 35 02 18 20  |OV   r0,#18.5.. |
00007b30  20 20 4c 44 52 20 20 20  72 32 2c 5b 72 31 2c 23  |  LDR   r2,[r1,#|
00007b40  32 30 5d 0d 35 0c 18 20  20 20 4c 44 52 20 20 20  |20].5..   LDR   |
00007b50  72 33 2c 5b 72 31 2c 23  32 34 5d 0d 35 16 3b 20  |r3,[r1,#24].5.; |
00007b60  20 20 53 57 49 20 20 20  22 58 57 69 6d 70 5f 53  |  SWI   "XWimp_S|
00007b70  65 6e 64 4d 65 73 73 61  67 65 22 20 20 20 20 20  |endMessage"     |
00007b80  20 20 20 20 3b 20 73 65  6e 64 20 74 68 65 20 6d  |    ; send the m|
00007b90  65 73 73 61 67 65 0d 35  20 11 2e 73 74 61 72 74  |essage.5 ..start|
00007ba0  73 61 76 65 6f 75 74 0d  35 2a 1a 20 20 20 4c 44  |saveout.5*.   LD|
00007bb0  4d 46 44 20 28 73 70 29  21 2c 7b 72 30 2d 72 33  |MFD (sp)!,{r0-r3|
00007bc0  7d 0d 35 34 14 20 20 20  42 20 20 20 20 20 65 78  |}.54.   B     ex|
00007bd0  69 74 73 77 69 0d 35 3e  05 3b 0d 35 48 0c 2e 6d  |itswi.5>.;.5H..m|
00007be0  61 73 6b 74 6f 34 0d 35  52 16 20 20 20 45 51 55  |askto4.5R.   EQU|
00007bf0  44 20 20 26 46 46 46 46  46 46 46 43 0d 35 5c 05  |D  &FFFFFFFC.5\.|
00007c00  3b 0d 35 66 0d 2e 73 65  6e 64 6c 6f 61 64 0d 35  |;.5f..sendload.5|
00007c10  70 1a 20 20 20 53 54 4d  46 44 20 28 73 70 29 21  |p.   STMFD (sp)!|
00007c20  2c 7b 72 30 2d 72 33 7d  0d 35 7a 12 20 20 20 4d  |,{r0-r3}.5z.   M|
00007c30  4f 56 20 20 20 72 39 2c  72 30 0d 35 84 17 20 20  |OV   r9,r0.5..  |
00007c40  20 4c 44 52 20 20 20 72  30 2c 5b 72 31 2c 23 38  | LDR   r0,[r1,#8|
00007c50  5d 0d 35 8e 39 20 20 20  53 54 52 20 20 20 72 30  |].5.9   STR   r0|
00007c60  2c 5b 72 31 2c 23 31 32  5d 20 20 20 20 20 20 20  |,[r1,#12]       |
00007c70  20 20 20 20 20 20 20 20  20 20 3b 20 70 75 74 20  |          ; put |
00007c80  72 31 21 31 32 3d 72 31  21 38 0d 35 98 44 20 20  |r1!12=r1!8.5.D  |
00007c90  20 4d 4f 56 20 20 20 72  30 2c 23 33 20 20 20 20  | MOV   r0,#3    |
00007ca0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00007cb0  20 20 20 3b 20 4d 65 73  73 61 67 65 5f 44 61 74  |   ; Message_Dat|
00007cc0  61 4c 6f 61 64 20 28 74  79 70 65 20 33 29 0d 35  |aLoad (type 3).5|
00007cd0  a2 18 20 20 20 53 54 52  20 20 20 72 30 2c 5b 72  |..   STR   r0,[r|
00007ce0  31 2c 23 31 36 5d 0d 35  ac 17 20 20 20 41 44 44  |1,#16].5..   ADD|
00007cf0  20 20 20 72 31 30 2c 72  31 2c 23 34 34 0d 35 b6  |   r10,r1,#44.5.|
00007d00  15 20 20 20 4d 4f 56 20  20 20 72 31 31 2c 23 32  |.   MOV   r11,#2|
00007d10  35 35 0d 35 c0 17 20 20  20 42 4c 20 20 20 20 63  |55.5..   BL    c|
00007d20  6f 70 79 73 74 72 69 6e  67 0d 35 ca 17 20 20 20  |opystring.5..   |
00007d30  41 44 44 20 20 20 72 30  2c 72 31 31 2c 23 34 37  |ADD   r0,r11,#47|
00007d40  0d 35 d4 1a 20 20 20 4c  44 52 20 20 20 72 31 31  |.5..   LDR   r11|
00007d50  2c 28 6d 61 73 6b 74 6f  34 29 0d 35 de 14 20 20  |,(maskto4).5..  |
00007d60  20 80 20 20 20 72 30 2c  72 30 2c 72 31 31 0d 35  | .   r0,r0,r11.5|
00007d70  e8 14 20 20 20 53 54 52  20 20 20 72 30 2c 5b 72  |..   STR   r0,[r|
00007d80  31 5d 0d 35 f2 13 20 20  20 4d 4f 56 20 20 20 72  |1].5..   MOV   r|
00007d90  30 2c 23 31 38 0d 35 fc  18 20 20 20 4c 44 52 20  |0,#18.5..   LDR |
00007da0  20 20 72 32 2c 5b 72 31  2c 23 32 30 5d 0d 36 06  |  r2,[r1,#20].6.|
00007db0  18 20 20 20 4c 44 52 20  20 20 72 33 2c 5b 72 31  |.   LDR   r3,[r1|
00007dc0  2c 23 32 34 5d 0d 36 10  20 20 20 20 53 57 49 20  |,#24].6.    SWI |
00007dd0  20 20 22 58 57 69 6d 70  5f 53 65 6e 64 4d 65 73  |  "XWimp_SendMes|
00007de0  73 61 67 65 22 0d 36 1a  1a 20 20 20 4c 44 4d 46  |sage".6..   LDMF|
00007df0  44 20 28 73 70 29 21 2c  7b 72 30 2d 72 33 7d 0d  |D (sp)!,{r0-r3}.|
00007e00  36 24 14 20 20 20 42 20  20 20 20 20 65 78 69 74  |6$.   B     exit|
00007e10  73 77 69 0d 36 2e 05 3b  0d 36 38 10 2e 73 65 6e  |swi.6..;.68..sen|
00007e20  64 73 61 76 65 61 63 6b  0d 36 42 1d 20 20 20 53  |dsaveack.6B.   S|
00007e30  54 4d 46 44 20 28 73 70  29 21 2c 7b 72 30 2c 72  |TMFD (sp)!,{r0,r|
00007e40  32 2c 72 33 7d 0d 36 4c  17 20 20 20 41 44 44 20  |2,r3}.6L.   ADD |
00007e50  20 20 72 31 30 2c 72 31  2c 23 34 34 0d 36 56 1b  |  r10,r1,#44.6V.|
00007e60  20 20 20 41 44 52 20 20  20 72 39 2c 28 77 69 6d  |   ADR   r9,(wim|
00007e70  70 73 63 72 61 70 29 0d  36 60 14 20 20 20 4d 4f  |pscrap).6`.   MO|
00007e80  56 20 20 20 72 31 31 2c  23 31 34 0d 36 6a 4f 20  |V   r11,#14.6jO |
00007e90  20 20 42 4c 20 20 20 20  63 6f 70 79 73 74 72 69  |  BL    copystri|
00007ea0  6e 67 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |ng              |
00007eb0  20 20 20 20 3b 20 63 6f  70 79 20 3c 57 69 6d 70  |    ; copy <Wimp|
00007ec0  24 53 63 72 61 70 3e 20  74 6f 20 66 69 6c 65 20  |$Scrap> to file |
00007ed0  6e 61 6d 65 20 66 69 65  6c 64 0d 36 74 17 20 20  |name field.6t.  |
00007ee0  20 4c 44 52 20 20 20 72  32 2c 5b 72 31 2c 23 34  | LDR   r2,[r1,#4|
00007ef0  5d 0d 36 7e 39 20 20 20  4c 44 52 20 20 20 72 38  |].6~9   LDR   r8|
00007f00  2c 5b 72 31 2c 23 38 5d  20 20 20 20 20 20 20 20  |,[r1,#8]        |
00007f10  20 20 20 20 20 20 20 20  20 20 3b 20 70 75 74 20  |          ; put |
00007f20  72 31 21 31 32 3d 72 31  21 38 0d 36 88 18 20 20  |r1!12=r1!8.6..  |
00007f30  20 53 54 52 20 20 20 72  38 2c 5b 72 31 2c 23 31  | STR   r8,[r1,#1|
00007f40  32 5d 0d 36 92 12 20 20  20 4d 4f 56 20 20 20 72  |2].6..   MOV   r|
00007f50  38 2c 23 32 0d 36 9c 47  20 20 20 53 54 52 20 20  |8,#2.6.G   STR  |
00007f60  20 72 38 2c 5b 72 31 2c  23 31 36 5d 20 20 20 20  | r8,[r1,#16]    |
00007f70  20 20 20 20 20 20 20 20  20 20 20 20 20 3b 20 4d  |             ; M|
00007f80  65 73 73 61 67 65 5f 44  61 74 61 53 61 76 65 41  |essage_DataSaveA|
00007f90  63 6b 20 28 74 79 70 65  20 32 29 0d 36 a6 13 20  |ck (type 2).6.. |
00007fa0  20 20 4d 4f 56 20 20 20  72 38 2c 23 36 30 0d 36  |  MOV   r8,#60.6|
00007fb0  b0 3f 20 20 20 53 54 52  20 20 20 72 38 2c 5b 72  |.?   STR   r8,[r|
00007fc0  31 5d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |1]              |
00007fd0  20 20 20 20 20 20 20 3b  20 62 6c 6f 63 6b 20 6c  |       ; block l|
00007fe0  65 6e 67 74 68 20 3d 20  34 34 2b 31 36 0d 36 ba  |ength = 44+16.6.|
00007ff0  12 20 20 20 4d 56 4e 20  20 20 72 38 2c 23 30 0d  |.   MVN   r8,#0.|
00008000  36 c4 48 20 20 20 53 54  52 20 20 20 72 38 2c 5b  |6.H   STR   r8,[|
00008010  72 31 2c 23 33 36 5d 20  20 20 20 20 20 20 20 20  |r1,#36]         |
00008020  20 20 20 20 20 20 20 20  3b 20 64 61 74 61 20 73  |        ; data s|
00008030  69 7a 65 20 3d 2d 31 20  28 64 61 74 61 20 6e 6f  |ize =-1 (data no|
00008040  74 20 73 61 66 65 29 0d  36 ce 13 20 20 20 4d 4f  |t safe).6..   MO|
00008050  56 20 20 20 72 30 2c 23  31 37 0d 36 d8 12 20 20  |V   r0,#17.6..  |
00008060  20 4d 4f 56 20 20 20 72  33 2c 23 30 0d 36 e2 3b  | MOV   r3,#0.6.;|
00008070  20 20 20 53 57 49 20 20  20 22 58 57 69 6d 70 5f  |   SWI   "XWimp_|
00008080  53 65 6e 64 4d 65 73 73  61 67 65 22 20 20 20 20  |SendMessage"    |
00008090  20 20 20 20 20 3b 20 73  65 6e 64 20 74 68 65 20  |     ; send the |
000080a0  6d 65 73 73 61 67 65 0d  36 ec 1d 20 20 20 4c 44  |message.6..   LD|
000080b0  4d 46 44 20 28 73 70 29  21 2c 7b 72 30 2c 72 32  |MFD (sp)!,{r0,r2|
000080c0  2c 72 33 7d 0d 36 f6 14  20 20 20 42 20 20 20 20  |,r3}.6..   B    |
000080d0  20 65 78 69 74 73 77 69  0d 37 00 0e 2e 77 69 6d  | exitswi.7...wim|
000080e0  70 73 63 72 61 70 0d 37  0a 1b 20 20 20 45 51 55  |pscrap.7..   EQU|
000080f0  53 20 20 22 3c 57 69 6d  70 24 53 63 72 61 70 3e  |S  "<Wimp$Scrap>|
00008100  22 0d 37 14 0e 20 20 20  45 51 55 42 20 20 30 0d  |".7..   EQUB  0.|
00008110  37 1e 0c 20 20 20 41 4c  49 47 4e 0d 37 28 05 3b  |7..   ALIGN.7(.;|
00008120  0d 37 32 10 2e 73 65 6e  64 6c 6f 61 64 61 63 6b  |.72..sendloadack|
00008130  0d 37 3c 1a 20 20 20 53  54 4d 46 44 20 28 73 70  |.7<.   STMFD (sp|
00008140  29 21 2c 7b 72 30 2d 72  33 7d 0d 37 46 17 20 20  |)!,{r0-r3}.7F.  |
00008150  20 4c 44 52 20 20 20 72  30 2c 5b 72 31 2c 23 38  | LDR   r0,[r1,#8|
00008160  5d 0d 37 50 44 20 20 20  53 54 52 20 20 20 72 30  |].7PD   STR   r0|
00008170  2c 5b 72 31 2c 23 31 32  5d 20 20 20 20 20 20 20  |,[r1,#12]       |
00008180  20 20 20 20 20 20 20 20  20 20 3b 20 70 75 74 20  |          ; put |
00008190  72 31 21 31 32 3d 72 31  21 38 20 28 79 6f 75 72  |r1!12=r1!8 (your|
000081a0  20 72 65 66 29 0d 37 5a  47 20 20 20 4d 4f 56 20  | ref).7ZG   MOV |
000081b0  20 20 72 30 2c 23 34 20  20 20 20 20 20 20 20 20  |  r0,#4         |
000081c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
000081d0  4d 65 73 73 61 67 65 5f  44 61 74 61 4c 6f 61 64  |Message_DataLoad|
000081e0  41 63 6b 20 28 74 79 70  65 20 34 29 0d 37 64 18  |Ack (type 4).7d.|
000081f0  20 20 20 53 54 52 20 20  20 72 30 2c 5b 72 31 2c  |   STR   r0,[r1,|
00008200  23 31 36 5d 0d 37 6e 16  20 20 20 41 44 44 20 20  |#16].7n.   ADD  |
00008210  20 72 39 2c 72 31 2c 23  34 34 0d 37 78 17 20 20  | r9,r1,#44.7x.  |
00008220  20 42 4c 20 20 20 20 63  6f 75 6e 74 63 68 61 72  | BL    countchar|
00008230  73 0d 37 82 17 20 20 20  41 44 44 20 20 20 72 30  |s.7..   ADD   r0|
00008240  2c 72 31 31 2c 23 34 37  0d 37 8c 1a 20 20 20 4c  |,r11,#47.7..   L|
00008250  44 52 20 20 20 72 31 31  2c 28 6d 61 73 6b 74 6f  |DR   r11,(maskto|
00008260  34 29 0d 37 96 14 20 20  20 80 20 20 20 72 30 2c  |4).7..   .   r0,|
00008270  72 30 2c 72 31 31 0d 37  a0 14 20 20 20 53 54 52  |r0,r11.7..   STR|
00008280  20 20 20 72 30 2c 5b 72  31 5d 0d 37 aa 13 20 20  |   r0,[r1].7..  |
00008290  20 4d 4f 56 20 20 20 72  30 2c 23 31 37 0d 37 b4  | MOV   r0,#17.7.|
000082a0  18 20 20 20 4c 44 52 20  20 20 72 32 2c 5b 72 31  |.   LDR   r2,[r1|
000082b0  2c 23 32 30 5d 0d 37 be  18 20 20 20 4c 44 52 20  |,#20].7..   LDR |
000082c0  20 20 72 33 2c 5b 72 31  2c 23 32 34 5d 0d 37 c8  |  r3,[r1,#24].7.|
000082d0  20 20 20 20 53 57 49 20  20 20 22 58 57 69 6d 70  |    SWI   "XWimp|
000082e0  5f 53 65 6e 64 4d 65 73  73 61 67 65 22 0d 37 d2  |_SendMessage".7.|
000082f0  1a 20 20 20 4c 44 4d 46  44 20 28 73 70 29 21 2c  |.   LDMFD (sp)!,|
00008300  7b 72 30 2d 72 33 7d 0d  37 dc 14 20 20 20 42 20  |{r0-r3}.7..   B |
00008310  20 20 20 20 65 78 69 74  73 77 69 0d 37 e6 05 3b  |    exitswi.7..;|
00008320  0d 37 f0 46 2e 6c 6f 61  64 74 65 6d 70 6c 61 74  |.7.F.loadtemplat|
00008330  65 73 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |es              |
00008340  20 20 20 20 20 20 20 20  20 3b 20 72 31 20 20 3d  |         ; r1  =|
00008350  20 77 69 6e 64 6f 77 20  74 72 61 6e 73 66 65 72  | window transfer|
00008360  20 62 6c 6f 63 6b 0d 37  fa 4a 20 20 20 53 54 4d  | block.7.J   STM|
00008370  46 44 20 28 73 70 29 21  2c 7b 72 34 2d 72 36 7d  |FD (sp)!,{r4-r6}|
00008380  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00008390  20 72 32 20 20 3d 20 69  6e 64 69 72 65 63 74 20  | r2  = indirect |
000083a0  73 70 72 69 74 65 20 64  61 74 61 20 61 72 65 61  |sprite data area|
000083b0  0d 38 04 3d 20 20 20 4d  4f 56 20 20 20 72 38 2c  |.8.=   MOV   r8,|
000083c0  72 34 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |r4              |
000083d0  20 20 20 20 20 20 20 20  20 3b 20 72 33 20 20 3d  |         ; r3  =|
000083e0  20 65 6e 64 20 6f 66 20  61 62 6f 76 65 0d 38 0e  | end of above.8.|
000083f0  4b 20 20 20 54 45 51 20  20 20 72 36 2c 23 30 20  |K   TEQ   r6,#0 |
00008400  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00008410  20 20 20 20 20 20 3b 20  72 34 20 20 3d 20 64 61  |      ; r4  = da|
00008420  74 61 20 62 6c 6f 63 6b  20 74 6f 20 73 74 6f 72  |ta block to stor|
00008430  65 20 77 69 6e 64 6f 77  0d 38 18 42 20 20 20 4d  |e window.8.B   M|
00008440  4f 56 4e 45 20 72 34 2c  72 36 20 20 20 20 20 20  |OVNE r4,r6      |
00008450  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00008460  20 3b 20 20 20 20 20 20  20 6e 61 6d 65 73 20 61  | ;       names a|
00008470  6e 64 20 68 61 6e 64 6c  65 73 0d 38 22 3d 20 20  |nd handles.8"=  |
00008480  20 4d 56 4e 45 51 20 72  34 2c 23 31 20 20 20 20  | MVNEQ r4,#1    |
00008490  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000084a0  20 20 20 3b 20 72 35 20  20 3d 20 73 70 72 69 74  |   ; r5  = sprit|
000084b0  65 20 62 6c 6f 63 6b 0d  38 2c 42 20 20 20 42 45  |e block.8,B   BE|
000084c0  51 20 20 20 6c 6f 61 64  74 65 6d 70 6c 61 74 65  |Q   loadtemplate|
000084d0  73 30 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |s0              |
000084e0  3b 20 72 36 20 20 3d 20  66 6f 6e 74 20 68 61 6e  |; r6  = font han|
000084f0  64 6c 65 20 74 61 62 6c  65 0d 38 36 12 20 20 20  |dle table.86.   |
00008500  4d 4f 56 20 20 20 72 30  2c 23 30 0d 38 40 14 20  |MOV   r0,#0.8@. |
00008510  20 20 4d 4f 56 20 20 20  72 37 2c 23 32 35 36 0d  |  MOV   r7,#256.|
00008520  38 4a 14 2e 6c 6f 61 64  74 65 6d 70 6c 61 74 65  |8J..loadtemplate|
00008530  73 30 61 0d 38 54 48 20  20 20 53 54 52 42 20 20  |s0a.8TH   STRB  |
00008540  72 30 2c 5b 72 36 5d 2c  23 31 20 20 20 20 20 20  |r0,[r6],#1      |
00008550  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 73 65  |            ; se|
00008560  74 20 66 6f 6e 74 20 68  61 6e 64 6c 65 20 62 6c  |t font handle bl|
00008570  6f 63 6b 20 74 6f 20 7a  65 72 6f 0d 38 5e 15 20  |ock to zero.8^. |
00008580  20 20 53 55 42 20 20 20  72 37 2c 72 37 2c 23 31  |  SUB   r7,r7,#1|
00008590  0d 38 68 12 20 20 20 54  45 51 20 20 20 72 37 2c  |.8h.   TEQ   r7,|
000085a0  23 30 0d 38 72 1c 20 20  20 42 4e 45 20 20 20 6c  |#0.8r.   BNE   l|
000085b0  6f 61 64 74 65 6d 70 6c  61 74 65 73 30 61 0d 38  |oadtemplates0a.8|
000085c0  7c 13 2e 6c 6f 61 64 74  65 6d 70 6c 61 74 65 73  ||..loadtemplates|
000085d0  30 0d 38 86 12 20 20 20  4d 4f 56 20 20 20 72 39  |0.8..   MOV   r9|
000085e0  2c 72 35 0d 38 90 12 20  20 20 4d 4f 56 20 20 20  |,r5.8..   MOV   |
000085f0  72 36 2c 23 30 0d 38 9a  12 20 20 20 4d 4f 56 20  |r6,#0.8..   MOV |
00008600  20 20 72 37 2c 23 30 0d  38 a4 13 2e 6c 6f 61 64  |  r7,#0.8...load|
00008610  74 65 6d 70 6c 61 74 65  73 31 0d 38 ae 17 20 20  |templates1.8..  |
00008620  20 41 44 44 20 20 20 72  35 2c 77 73 2c 23 62 6c  | ADD   r5,ws,#bl|
00008630  6b 0d 38 b8 16 20 20 20  4c 44 52 20 20 20 72 30  |k.8..   LDR   r0|
00008640  2c 28 73 74 61 72 29 0d  38 c2 14 20 20 20 53 54  |,(star).8..   ST|
00008650  52 20 20 20 72 30 2c 5b  72 35 5d 0d 38 cc 3b 20  |R   r0,[r5].8.; |
00008660  20 20 53 57 49 20 20 20  22 58 57 69 6d 70 5f 4c  |  SWI   "XWimp_L|
00008670  6f 61 64 54 65 6d 70 6c  61 74 65 22 20 20 20 20  |oadTemplate"    |
00008680  20 20 20 20 3b 20 72 31  20 2d 20 72 33 20 61 73  |    ; r1 - r3 as|
00008690  20 61 62 6f 76 65 0d 38  d6 40 20 20 20 42 56 53  | above.8.@   BVS|
000086a0  20 20 20 6c 6f 61 64 74  65 6d 70 6c 61 74 65 73  |   loadtemplates|
000086b0  65 72 72 20 20 20 20 20  20 20 20 20 20 20 20 3b  |err            ;|
000086c0  20 72 34 20 3d 20 66 6f  6e 74 20 74 61 62 6c 65  | r4 = font table|
000086d0  20 6f 72 20 2d 31 0d 38  e0 44 20 20 20 54 45 51  | or -1.8.D   TEQ|
000086e0  20 20 20 72 36 2c 23 30  20 20 20 20 20 20 20 20  |   r6,#0        |
000086f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00008700  20 72 35 20 3d 20 74 65  6d 70 6c 61 74 65 20 6e  | r5 = template n|
00008710  61 6d 65 20 6f 72 20 22  2a 22 0d 38 ea 4e 20 20  |ame or "*".8.N  |
00008720  20 42 45 51 20 20 20 6c  6f 61 64 74 65 6d 70 6c  | BEQ   loadtempl|
00008730  61 74 65 73 6f 75 74 20  20 20 20 20 20 20 20 20  |atesout         |
00008740  20 20 20 3b 20 72 36 20  3d 20 74 65 6d 70 6c 61  |   ; r6 = templa|
00008750  74 65 20 6e 75 6d 62 65  72 20 77 69 74 68 20 74  |te number with t|
00008760  68 61 74 20 6e 61 6d 65  0d 38 f4 15 20 20 20 41  |hat name.8..   A|
00008770  44 44 20 20 20 72 37 2c  72 37 2c 23 31 0d 38 fe  |DD   r7,r7,#1.8.|
00008780  17 20 20 20 53 54 4d 46  44 20 28 73 70 29 21 2c  |.   STMFD (sp)!,|
00008790  7b 72 39 7d 0d 39 08 17  20 20 20 41 44 44 20 20  |{r9}.9..   ADD  |
000087a0  20 72 39 2c 77 73 2c 23  62 6c 6b 0d 39 12 41 20  | r9,ws,#blk.9.A |
000087b0  20 20 41 44 44 20 20 20  72 31 30 2c 72 38 2c 23  |  ADD   r10,r8,#|
000087c0  34 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |4               |
000087d0  20 20 20 20 3b 20 72 65  74 75 72 6e 73 20 72 35  |    ; returns r5|
000087e0  20 3d 20 66 75 6c 6c 20  6e 61 6d 65 0d 39 1c 4e  | = full name.9.N|
000087f0  20 20 20 4d 4f 56 20 20  20 72 31 31 2c 23 31 36  |   MOV   r11,#16|
00008800  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00008810  20 20 20 20 20 3b 20 72  36 20 3d 20 6e 65 78 74  |     ; r6 = next|
00008820  20 74 65 6d 70 6c 61 74  65 20 6f 72 20 30 20 69  | template or 0 i|
00008830  66 20 61 6c 6c 20 72 65  61 64 0d 39 26 17 20 20  |f all read.9&.  |
00008840  20 42 4c 20 20 20 20 63  6f 70 79 73 74 72 69 6e  | BL    copystrin|
00008850  67 0d 39 30 17 20 20 20  4c 44 4d 46 44 20 28 73  |g.90.   LDMFD (s|
00008860  70 29 21 2c 7b 72 39 7d  0d 39 3a 18 20 20 20 53  |p)!,{r9}.9:.   S|
00008870  54 52 20 20 20 72 39 2c  5b 72 31 2c 23 36 34 5d  |TR   r9,[r1,#64]|
00008880  0d 39 44 21 20 20 20 53  57 49 20 20 20 22 58 57  |.9D!   SWI   "XW|
00008890  69 6d 70 5f 43 72 65 61  74 65 57 69 6e 64 6f 77  |imp_CreateWindow|
000088a0  22 0d 39 4e 1d 20 20 20  42 56 53 20 20 20 6c 6f  |".9N.   BVS   lo|
000088b0  61 64 74 65 6d 70 6c 61  74 65 73 65 72 72 0d 39  |adtemplateserr.9|
000088c0  58 14 20 20 20 53 54 52  20 20 20 72 30 2c 5b 72  |X.   STR   r0,[r|
000088d0  38 5d 0d 39 62 16 20 20  20 41 44 44 20 20 20 72  |8].9b.   ADD   r|
000088e0  38 2c 72 38 2c 23 32 30  0d 39 6c 1b 20 20 20 42  |8,r8,#20.9l.   B|
000088f0  20 20 20 20 20 6c 6f 61  64 74 65 6d 70 6c 61 74  |     loadtemplat|
00008900  65 73 31 0d 39 76 15 2e  6c 6f 61 64 74 65 6d 70  |es1.9v..loadtemp|
00008910  6c 61 74 65 73 6f 75 74  0d 39 80 12 20 20 20 4d  |latesout.9..   M|
00008920  56 4e 20 20 20 72 30 2c  23 30 0d 39 8a 14 20 20  |VN   r0,#0.9..  |
00008930  20 53 54 52 20 20 20 72  30 2c 5b 72 38 5d 0d 39  | STR   r0,[r8].9|
00008940  94 49 20 20 20 4d 4f 56  20 20 20 72 30 2c 72 37  |.I   MOV   r0,r7|
00008950  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00008960  20 20 20 20 20 20 3b 20  72 30 20 20 3d 20 72 65  |      ; r0  = re|
00008970  74 75 72 6e 73 20 6e 75  6d 62 65 72 20 6f 66 20  |turns number of |
00008980  77 69 6e 64 6f 77 73 0d  39 9e 1a 20 20 20 4c 44  |windows.9..   LD|
00008990  4d 46 44 20 28 73 70 29  21 2c 7b 72 34 2d 72 36  |MFD (sp)!,{r4-r6|
000089a0  7d 0d 39 a8 14 20 20 20  42 20 20 20 20 20 65 78  |}.9..   B     ex|
000089b0  69 74 73 77 69 0d 39 b2  15 2e 6c 6f 61 64 74 65  |itswi.9...loadte|
000089c0  6d 70 6c 61 74 65 73 65  72 72 0d 39 bc 1a 20 20  |mplateserr.9..  |
000089d0  20 4c 44 4d 46 44 20 28  73 70 29 21 2c 7b 72 34  | LDMFD (sp)!,{r4|
000089e0  2d 72 36 7d 0d 39 c6 1b  20 20 20 41 44 52 20 20  |-r6}.9..   ADR  |
000089f0  20 72 30 2c 74 65 6d 70  6c 61 74 65 65 72 72 0d  | r0,templateerr.|
00008a00  39 d0 16 20 20 20 42 20  20 20 20 20 6d 61 6b 65  |9..   B     make|
00008a10  65 72 72 6f 72 0d 39 da  10 2e 74 65 6d 70 6c 61  |error.9...templa|
00008a20  74 65 65 72 72 0d 39 e4  15 45 51 55 44 20 45 72  |teerr.9..EQUD Er|
00008a30  72 6f 72 42 61 73 65 2b  36 33 0d 39 ee 29 45 51  |rorBase+63.9.)EQ|
00008a40  55 53 20 22 45 72 72 6f  72 20 77 68 69 6c 65 20  |US "Error while |
00008a50  6c 6f 61 64 69 6e 67 20  74 65 6d 70 6c 61 74 65  |loading template|
00008a60  73 21 22 0d 39 f8 0a 45  51 55 42 20 30 0d 3a 02  |s!".9..EQUB 0.:.|
00008a70  09 41 4c 49 47 4e 0d 3a  0c 09 2e 73 74 61 72 0d  |.ALIGN.:...star.|
00008a80  3a 16 10 20 20 20 45 51  55 53 20 20 22 2a 22 0d  |:..   EQUS  "*".|
00008a90  3a 20 0e 20 20 20 45 51  55 42 20 20 30 0d 3a 2a  |: .   EQUB  0.:*|
00008aa0  0c 20 20 20 41 4c 49 47  4e 0d 3a 34 05 3b 0d 3a  |.   ALIGN.:4.;.:|
00008ab0  3e 20 3b 20 77 69 6e 64  6f 77 20 68 61 6e 64 6c  |> ; window handl|
00008ac0  65 20 62 6c 6f 63 6b 20  66 6f 72 6d 61 74 0d 3a  |e block format.:|
00008ad0  48 05 3b 0d 3a 52 1f 3b  20 34 20 20 62 79 74 65  |H.;.:R.; 4  byte|
00008ae0  73 20 20 3d 20 77 69 6e  64 6f 77 20 68 61 6e 64  |s  = window hand|
00008af0  6c 65 0d 3a 5c 30 3b 20  31 36 20 62 79 74 65 73  |le.:\0; 16 bytes|
00008b00  20 20 3d 20 77 69 6e 64  6f 77 20 6e 61 6d 65 20  |  = window name |
00008b10  66 72 6f 6d 20 74 65 6d  70 6c 61 74 65 20 66 69  |from template fi|
00008b20  6c 65 0d 3a 66 05 3b 0d  3a 70 18 3b 20 62 6c 6f  |le.:f.;.:p.; blo|
00008b30  63 6b 20 65 6e 64 73 20  77 69 74 68 20 2d 31 0d  |ck ends with -1.|
00008b40  3a 7a 05 3b 0d 3a 84 40  3b 20 72 30 20 20 20 20  |:z.;.:.@; r0    |
00008b50  20 20 20 20 3d 20 30 20  20 20 63 6f 6e 76 65 72  |    = 0   conver|
00008b60  74 20 77 69 6e 64 6f 77  20 68 61 6e 64 6c 65 20  |t window handle |
00008b70  74 6f 20 6e 75 6d 62 65  72 20 28 20 30 20 74 6f  |to number ( 0 to|
00008b80  20 6e 20 29 0d 3a 8e 33  3b 20 72 30 20 20 20 20  | n ).:.3; r0    |
00008b90  20 20 20 20 3d 20 31 20  20 20 63 6f 6e 76 65 72  |    = 1   conver|
00008ba0  74 20 77 69 6e 64 6f 77  20 68 61 6e 64 6c 65 20  |t window handle |
00008bb0  74 6f 20 6e 61 6d 65 0d  3a 98 35 3b 20 72 30 20  |to name.:.5; r0 |
00008bc0  20 20 20 20 20 20 20 3d  20 32 20 20 20 63 6f 6e  |       = 2   con|
00008bd0  76 65 72 74 20 77 69 6e  64 6f 77 20 6e 75 6d 62  |vert window numb|
00008be0  65 72 20 74 6f 20 68 61  6e 64 6c 65 0d 3a a2 33  |er to handle.:.3|
00008bf0  3b 20 72 30 20 20 20 20  20 20 20 20 3d 20 33 20  |; r0        = 3 |
00008c00  20 20 63 6f 6e 76 65 72  74 20 77 69 6e 64 6f 77  |  convert window|
00008c10  20 6e 75 6d 62 65 72 20  74 6f 20 6e 61 6d 65 0d  | number to name.|
00008c20  3a ac 35 3b 20 72 30 20  20 20 20 20 20 20 20 3d  |:.5; r0        =|
00008c30  20 34 20 20 20 63 6f 6e  76 65 72 74 20 77 69 6e  | 4   convert win|
00008c40  64 6f 77 20 6e 61 6d 65  20 20 20 74 6f 20 68 61  |dow name   to ha|
00008c50  6e 64 6c 65 0d 3a b6 35  3b 20 72 30 20 20 20 20  |ndle.:.5; r0    |
00008c60  20 20 20 20 3d 20 35 20  20 20 63 6f 6e 76 65 72  |    = 5   conver|
00008c70  74 20 77 69 6e 64 6f 77  20 6e 61 6d 65 20 20 20  |t window name   |
00008c80  74 6f 20 6e 75 6d 62 65  72 0d 3a c0 05 3b 0d 3a  |to number.:..;.:|
00008c90  ca 1e 3b 20 72 31 20 20  20 20 20 20 20 20 3d 20  |..; r1        = |
00008ca0  68 61 6e 64 6c 65 20 62  6c 6f 63 6b 0d 3a d4 1b  |handle block.:..|
00008cb0  3b 20 72 32 20 20 20 20  20 20 20 20 3d 20 70 61  |; r2        = pa|
00008cc0  72 61 6d 65 74 65 72 0d  3a de 05 3b 0d 3a e8 0d  |rameter.:..;.:..|
00008cd0  3b 20 72 65 74 75 72 6e  73 0d 3a f2 05 3b 0d 3a  |; returns.:..;.:|
00008ce0  fc 18 3b 20 72 30 20 20  20 20 20 20 20 20 3d 20  |..; r0        = |
00008cf0  72 65 73 75 6c 74 0d 3b  06 05 3b 0d 3b 10 12 2e  |result.;..;.;...|
00008d00  77 69 6e 64 6f 77 63 6f  6e 76 65 72 74 0d 3b 1a  |windowconvert.;.|
00008d10  39 20 20 20 43 4d 50 20  20 20 72 30 2c 23 35 20  |9   CMP   r0,#5 |
00008d20  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00008d30  20 3b 20 63 68 65 63 6b  20 6f 66 66 73 65 74 20  | ; check offset |
00008d40  6e 75 6d 62 65 72 0d 3b  24 46 20 20 20 42 47 54  |number.;$F   BGT|
00008d50  20 20 20 64 6f 6e 74 6b  6e 6f 77 63 6f 6e 76 65  |   dontknowconve|
00008d60  72 74 20 20 20 20 20 20  20 20 3b 20 65 72 72 6f  |rt        ; erro|
00008d70  72 20 69 66 20 74 6f 6f  20 62 69 67 20 66 6f 72  |r if too big for|
00008d80  20 74 68 69 73 20 6d 6f  64 75 6c 65 0d 3b 2e 3f  | this module.;.?|
00008d90  20 20 20 4d 4f 56 20 20  20 72 38 2c 72 30 2c 4c  |   MOV   r8,r0,L|
00008da0  53 4c 23 32 20 20 20 20  20 20 20 20 20 20 20 20  |SL#2            |
00008db0  3b 20 63 61 6c 63 75 6c  61 74 65 20 6f 66 66 73  |; calculate offs|
00008dc0  65 74 20 66 6f 72 20 6a  75 6d 70 0d 3b 38 3d 20  |et for jump.;8= |
00008dd0  20 20 41 44 44 20 20 20  72 38 2c 72 38 2c 70 63  |  ADD   r8,r8,pc|
00008de0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3b  |               ;|
00008df0  20 74 61 6b 69 6e 67 20  69 6e 74 6f 20 61 63 63  | taking into acc|
00008e00  6f 75 6e 74 20 41 52 4d  0d 3b 42 48 20 20 20 4d  |ount ARM.;BH   M|
00008e10  4f 56 20 20 20 70 63 2c  72 38 20 20 20 20 20 20  |OV   pc,r8      |
00008e20  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 70 69  |            ; pi|
00008e30  70 65 6c 69 6e 69 6e 67  20 62 79 20 61 64 6a 75  |pelining by adju|
00008e40  73 74 69 6e 67 20 62 79  20 34 20 62 79 74 65 73  |sting by 4 bytes|
00008e50  0d 3b 4c 05 3b 0d 3b 56  13 3b 20 20 62 72 61 6e  |.;L.;.;V.;  bran|
00008e60  63 68 20 74 61 62 6c 65  0d 3b 60 05 3b 0d 3b 6a  |ch table.;`.;.;j|
00008e70  19 20 20 20 42 20 20 20  20 20 77 68 61 6e 64 6c  |.   B     whandl|
00008e80  65 74 6f 6e 75 6d 0d 3b  74 1a 20 20 20 42 20 20  |etonum.;t.   B  |
00008e90  20 20 20 77 68 61 6e 64  6c 65 74 6f 6e 61 6d 65  |   whandletoname|
00008ea0  0d 3b 7e 1c 20 20 20 42  20 20 20 20 20 77 6e 75  |.;~.   B     wnu|
00008eb0  6d 62 65 72 74 6f 68 61  6e 64 6c 65 0d 3b 88 1a  |mbertohandle.;..|
00008ec0  20 20 20 42 20 20 20 20  20 77 6e 75 6d 62 65 72  |   B     wnumber|
00008ed0  74 6f 6e 61 6d 65 0d 3b  92 1a 20 20 20 42 20 20  |toname.;..   B  |
00008ee0  20 20 20 77 6e 61 6d 65  74 6f 68 61 6e 64 6c 65  |   wnametohandle|
00008ef0  0d 3b 9c 1a 20 20 20 42  20 20 20 20 20 77 6e 61  |.;..   B     wna|
00008f00  6d 65 74 6f 6e 75 6d 62  65 72 0d 3b a6 05 3b 0d  |metonumber.;..;.|
00008f10  3b b0 11 2e 77 68 61 6e  64 6c 65 74 6f 6e 75 6d  |;...whandletonum|
00008f20  0d 3b ba 12 20 20 20 4d  4f 56 20 20 20 72 38 2c  |.;..   MOV   r8,|
00008f30  23 30 0d 3b c4 12 20 20  20 4d 4f 56 20 20 20 72  |#0.;..   MOV   r|
00008f40  39 2c 23 30 0d 3b ce 12  2e 77 68 61 6e 64 6c 65  |9,#0.;...whandle|
00008f50  74 6f 6e 75 6d 31 0d 3b  d8 18 20 20 20 4c 44 52  |tonum1.;..   LDR|
00008f60  20 20 20 72 31 30 2c 5b  72 31 2c 72 38 5d 0d 3b  |   r10,[r1,r8].;|
00008f70  e2 13 20 20 20 43 4d 4e  20 20 20 72 31 30 2c 23  |..   CMN   r10,#|
00008f80  31 0d 3b ec 1b 20 20 20  42 45 51 20 20 20 6e 6f  |1.;..   BEQ   no|
00008f90  73 75 63 68 77 69 6e 64  68 61 6e 64 0d 3b f6 13  |suchwindhand.;..|
00008fa0  20 20 20 43 4d 50 20 20  20 72 31 30 2c 72 32 0d  |   CMP   r10,r2.|
00008fb0  3c 00 16 20 20 20 41 44  44 4e 45 20 72 38 2c 72  |<..   ADDNE r8,r|
00008fc0  38 2c 23 32 30 0d 3c 0a  15 20 20 20 41 44 44 4e  |8,#20.<..   ADDN|
00008fd0  45 20 72 39 2c 72 39 2c  23 31 0d 3c 14 1a 20 20  |E r9,r9,#1.<..  |
00008fe0  20 42 4e 45 20 20 20 77  68 61 6e 64 6c 65 74 6f  | BNE   whandleto|
00008ff0  6e 75 6d 31 0d 3c 1e 12  20 20 20 4d 4f 56 20 20  |num1.<..   MOV  |
00009000  20 72 30 2c 72 39 0d 3c  28 14 20 20 20 42 20 20  | r0,r9.<(.   B  |
00009010  20 20 20 65 78 69 74 73  77 69 0d 3c 32 05 3b 0d  |   exitswi.<2.;.|
00009020  3c 3c 12 2e 77 68 61 6e  64 6c 65 74 6f 6e 61 6d  |<<..whandletonam|
00009030  65 0d 3c 46 12 20 20 20  43 4d 4e 20 20 20 72 32  |e.<F.   CMN   r2|
00009040  2c 23 31 0d 3c 50 1a 20  20 20 41 44 52 45 51 20  |,#1.<P.   ADREQ |
00009050  72 30 2c 69 63 6f 6e 62  61 72 73 74 72 0d 3c 5a  |r0,iconbarstr.<Z|
00009060  14 20 20 20 42 45 51 20  20 20 65 78 69 74 73 77  |.   BEQ   exitsw|
00009070  69 0d 3c 64 12 20 20 20  43 4d 4e 20 20 20 72 32  |i.<d.   CMN   r2|
00009080  2c 23 32 0d 3c 6e 1b 20  20 20 41 44 52 45 51 20  |,#2.<n.   ADREQ |
00009090  72 30 2c 62 61 63 6b 64  72 6f 70 73 74 72 0d 3c  |r0,backdropstr.<|
000090a0  78 12 20 20 20 4d 4f 56  20 20 20 72 38 2c 23 30  |x.   MOV   r8,#0|
000090b0  0d 3c 82 13 2e 77 68 61  6e 64 6c 65 74 6f 6e 61  |.<...whandletona|
000090c0  6d 65 31 0d 3c 8c 18 20  20 20 4c 44 52 20 20 20  |me1.<..   LDR   |
000090d0  72 31 30 2c 5b 72 31 2c  72 38 5d 0d 3c 96 13 20  |r10,[r1,r8].<.. |
000090e0  20 20 43 4d 4e 20 20 20  72 31 30 2c 23 31 0d 3c  |  CMN   r10,#1.<|
000090f0  a0 1b 20 20 20 42 45 51  20 20 20 6e 6f 73 75 63  |..   BEQ   nosuc|
00009100  68 77 69 6e 64 68 61 6e  64 0d 3c aa 13 20 20 20  |hwindhand.<..   |
00009110  43 4d 50 20 20 20 72 31  30 2c 72 32 0d 3c b4 16  |CMP   r10,r2.<..|
00009120  20 20 20 41 44 44 4e 45  20 72 38 2c 72 38 2c 23  |   ADDNE r8,r8,#|
00009130  32 30 0d 3c be 1b 20 20  20 42 4e 45 20 20 20 77  |20.<..   BNE   w|
00009140  68 61 6e 64 6c 65 74 6f  6e 61 6d 65 31 0d 3c c8  |handletoname1.<.|
00009150  15 20 20 20 41 44 44 20  20 20 72 30 2c 72 38 2c  |.   ADD   r0,r8,|
00009160  23 34 0d 3c d2 15 20 20  20 41 44 44 20 20 20 72  |#4.<..   ADD   r|
00009170  30 2c 72 30 2c 72 31 0d  3c dc 14 20 20 20 42 20  |0,r0,r1.<..   B |
00009180  20 20 20 20 65 78 69 74  73 77 69 0d 3c e6 05 3b  |    exitswi.<..;|
00009190  0d 3c f0 0f 2e 69 63 6f  6e 62 61 72 73 74 72 0d  |.<...iconbarstr.|
000091a0  3c fa 16 20 20 20 45 51  55 53 20 20 22 69 63 6f  |<..   EQUS  "ico|
000091b0  6e 62 61 72 22 0d 3d 04  0e 20 20 20 45 51 55 42  |nbar".=..   EQUB|
000091c0  20 20 30 0d 3d 0e 0c 20  20 20 41 4c 49 47 4e 0d  |  0.=..   ALIGN.|
000091d0  3d 18 05 3b 0d 3d 22 10  2e 62 61 63 6b 64 72 6f  |=..;.="..backdro|
000091e0  70 73 74 72 0d 3d 2c 17  20 20 20 45 51 55 53 20  |pstr.=,.   EQUS |
000091f0  20 22 62 61 63 6b 64 72  6f 70 22 0d 3d 36 0e 20  | "backdrop".=6. |
00009200  20 20 45 51 55 42 20 20  30 0d 3d 40 0c 20 20 20  |  EQUB  0.=@.   |
00009210  41 4c 49 47 4e 0d 3d 4a  05 3b 0d 3d 54 14 2e 77  |ALIGN.=J.;.=T..w|
00009220  6e 75 6d 62 65 72 74 6f  68 61 6e 64 6c 65 0d 3d  |numbertohandle.=|
00009230  5e 12 20 20 20 4d 4f 56  20 20 20 72 38 2c 23 30  |^.   MOV   r8,#0|
00009240  0d 3d 68 12 20 20 20 4d  4f 56 20 20 20 72 39 2c  |.=h.   MOV   r9,|
00009250  23 30 0d 3d 72 15 2e 77  6e 75 6d 62 65 72 74 6f  |#0.=r..wnumberto|
00009260  68 61 6e 64 6c 65 31 0d  3d 7c 18 20 20 20 4c 44  |handle1.=|.   LD|
00009270  52 20 20 20 72 31 30 2c  5b 72 31 2c 72 38 5d 0d  |R   r10,[r1,r8].|
00009280  3d 86 13 20 20 20 43 4d  4e 20 20 20 72 31 30 2c  |=..   CMN   r10,|
00009290  23 31 0d 3d 90 1a 20 20  20 42 45 51 20 20 20 6e  |#1.=..   BEQ   n|
000092a0  6f 73 75 63 68 77 69 6e  64 6e 75 6d 0d 3d 9a 12  |osuchwindnum.=..|
000092b0  20 20 20 43 4d 50 20 20  20 72 39 2c 72 32 0d 3d  |   CMP   r9,r2.=|
000092c0  a4 16 20 20 20 41 44 44  4e 45 20 72 38 2c 72 38  |..   ADDNE r8,r8|
000092d0  2c 23 32 30 0d 3d ae 15  20 20 20 41 44 44 4e 45  |,#20.=..   ADDNE|
000092e0  20 72 39 2c 72 39 2c 23  31 0d 3d b8 1d 20 20 20  | r9,r9,#1.=..   |
000092f0  42 4e 45 20 20 20 77 6e  75 6d 62 65 72 74 6f 68  |BNE   wnumbertoh|
00009300  61 6e 64 6c 65 31 0d 3d  c2 17 20 20 20 4c 44 52  |andle1.=..   LDR|
00009310  20 20 20 72 30 2c 5b 72  31 2c 72 38 5d 0d 3d cc  |   r0,[r1,r8].=.|
00009320  14 20 20 20 42 20 20 20  20 20 65 78 69 74 73 77  |.   B     exitsw|
00009330  69 0d 3d d6 05 3b 0d 3d  e0 12 2e 77 6e 75 6d 62  |i.=..;.=...wnumb|
00009340  65 72 74 6f 6e 61 6d 65  0d 3d ea 12 20 20 20 43  |ertoname.=..   C|
00009350  4d 4e 20 20 20 72 32 2c  23 31 0d 3d f4 1a 20 20  |MN   r2,#1.=..  |
00009360  20 41 44 52 45 51 20 72  30 2c 69 63 6f 6e 62 61  | ADREQ r0,iconba|
00009370  72 73 74 72 0d 3d fe 14  20 20 20 42 45 51 20 20  |rstr.=..   BEQ  |
00009380  20 65 78 69 74 73 77 69  0d 3e 08 12 20 20 20 43  | exitswi.>..   C|
00009390  4d 4e 20 20 20 72 32 2c  23 32 0d 3e 12 1b 20 20  |MN   r2,#2.>..  |
000093a0  20 41 44 52 45 51 20 72  30 2c 62 61 63 6b 64 72  | ADREQ r0,backdr|
000093b0  6f 70 73 74 72 0d 3e 1c  12 20 20 20 4d 4f 56 20  |opstr.>..   MOV |
000093c0  20 20 72 38 2c 23 30 0d  3e 26 12 20 20 20 4d 4f  |  r8,#0.>&.   MO|
000093d0  56 20 20 20 72 39 2c 23  30 0d 3e 30 13 2e 77 6e  |V   r9,#0.>0..wn|
000093e0  75 6d 62 65 72 74 6f 6e  61 6d 65 31 0d 3e 3a 18  |umbertoname1.>:.|
000093f0  20 20 20 4c 44 52 20 20  20 72 31 30 2c 5b 72 31  |   LDR   r10,[r1|
00009400  2c 72 38 5d 0d 3e 44 13  20 20 20 43 4d 4e 20 20  |,r8].>D.   CMN  |
00009410  20 72 31 30 2c 23 31 0d  3e 4e 1a 20 20 20 42 45  | r10,#1.>N.   BE|
00009420  51 20 20 20 6e 6f 73 75  63 68 77 69 6e 64 6e 75  |Q   nosuchwindnu|
00009430  6d 0d 3e 58 12 20 20 20  43 4d 50 20 20 20 72 39  |m.>X.   CMP   r9|
00009440  2c 72 32 0d 3e 62 16 20  20 20 41 44 44 4e 45 20  |,r2.>b.   ADDNE |
00009450  72 38 2c 72 38 2c 23 32  30 0d 3e 6c 15 20 20 20  |r8,r8,#20.>l.   |
00009460  41 44 44 4e 45 20 72 39  2c 72 39 2c 23 31 0d 3e  |ADDNE r9,r9,#1.>|
00009470  76 1b 20 20 20 42 4e 45  20 20 20 77 6e 75 6d 62  |v.   BNE   wnumb|
00009480  65 72 74 6f 6e 61 6d 65  31 0d 3e 80 15 20 20 20  |ertoname1.>..   |
00009490  41 44 44 20 20 20 72 30  2c 72 38 2c 23 34 0d 3e  |ADD   r0,r8,#4.>|
000094a0  8a 15 20 20 20 41 44 44  20 20 20 72 30 2c 72 30  |..   ADD   r0,r0|
000094b0  2c 72 31 0d 3e 94 14 20  20 20 42 20 20 20 20 20  |,r1.>..   B     |
000094c0  65 78 69 74 73 77 69 0d  3e 9e 05 3b 0d 3e a8 12  |exitswi.>..;.>..|
000094d0  2e 77 6e 61 6d 65 74 6f  68 61 6e 64 6c 65 0d 3e  |.wnametohandle.>|
000094e0  b2 12 20 20 20 4d 4f 56  20 20 20 72 38 2c 72 31  |..   MOV   r8,r1|
000094f0  0d 3e bc 12 20 20 20 4d  4f 56 20 20 20 72 39 2c  |.>..   MOV   r9,|
00009500  72 32 0d 3e c6 13 2e 77  6e 61 6d 65 74 6f 68 61  |r2.>...wnametoha|
00009510  6e 64 6c 65 31 0d 3e d0  16 20 20 20 41 44 44 20  |ndle1.>..   ADD |
00009520  20 20 72 31 30 2c 72 38  2c 23 34 0d 3e da 17 20  |  r10,r8,#4.>.. |
00009530  20 20 42 4c 20 20 20 20  63 6f 6d 70 61 72 65 73  |  BL    compares|
00009540  74 72 0d 3e e4 14 20 20  20 4c 44 52 20 20 20 72  |tr.>..   LDR   r|
00009550  30 2c 5b 72 38 5d 0d 3e  ee 13 20 20 20 43 4d 4e  |0,[r8].>..   CMN|
00009560  20 20 20 72 31 31 2c 23  31 0d 3e f8 14 20 20 20  |   r11,#1.>..   |
00009570  42 45 51 20 20 20 65 78  69 74 73 77 69 0d 3f 02  |BEQ   exitswi.?.|
00009580  12 20 20 20 43 4d 4e 20  20 20 72 30 2c 23 31 0d  |.   CMN   r0,#1.|
00009590  3f 0c 17 20 20 20 42 45  51 20 20 20 6e 6f 73 75  |?..   BEQ   nosu|
000095a0  63 68 77 69 6e 64 0d 3f  16 16 20 20 20 41 44 44  |chwind.?..   ADD|
000095b0  20 20 20 72 38 2c 72 38  2c 23 32 30 0d 3f 20 1b  |   r8,r8,#20.? .|
000095c0  20 20 20 42 20 20 20 20  20 77 6e 61 6d 65 74 6f  |   B     wnameto|
000095d0  68 61 6e 64 6c 65 31 0d  3f 2a 05 3b 0d 3f 34 12  |handle1.?*.;.?4.|
000095e0  2e 77 6e 61 6d 65 74 6f  6e 75 6d 62 65 72 0d 3f  |.wnametonumber.?|
000095f0  3e 12 20 20 20 4d 4f 56  20 20 20 72 38 2c 72 31  |>.   MOV   r8,r1|
00009600  0d 3f 48 12 20 20 20 4d  4f 56 20 20 20 72 39 2c  |.?H.   MOV   r9,|
00009610  72 32 0d 3f 52 12 20 20  20 4d 4f 56 20 20 20 72  |r2.?R.   MOV   r|
00009620  32 2c 23 30 0d 3f 5c 13  2e 77 6e 61 6d 65 74 6f  |2,#0.?\..wnameto|
00009630  6e 75 6d 62 65 72 31 0d  3f 66 16 20 20 20 41 44  |number1.?f.   AD|
00009640  44 20 20 20 72 31 30 2c  72 38 2c 23 34 0d 3f 70  |D   r10,r8,#4.?p|
00009650  17 20 20 20 42 4c 20 20  20 20 63 6f 6d 70 61 72  |.   BL    compar|
00009660  65 73 74 72 0d 3f 7a 13  20 20 20 43 4d 4e 20 20  |estr.?z.   CMN  |
00009670  20 72 31 31 2c 23 31 0d  3f 84 0f 20 20 20 ec 51  | r11,#1.?..   .Q|
00009680  20 72 30 2c 72 32 0d 3f  8e 0f 20 20 20 ec 51 20  | r0,r2.?..   .Q |
00009690  72 32 2c 72 39 0d 3f 98  14 20 20 20 42 45 51 20  |r2,r9.?..   BEQ |
000096a0  20 20 65 78 69 74 73 77  69 0d 3f a2 14 20 20 20  |  exitswi.?..   |
000096b0  4c 44 52 20 20 20 72 30  2c 5b 72 38 5d 0d 3f ac  |LDR   r0,[r8].?.|
000096c0  12 20 20 20 43 4d 4e 20  20 20 72 30 2c 23 31 0d  |.   CMN   r0,#1.|
000096d0  3f b6 17 20 20 20 42 4e  45 20 20 20 6e 6f 73 75  |?..   BNE   nosu|
000096e0  63 68 77 69 6e 64 0d 3f  c0 15 20 20 20 41 44 44  |chwind.?..   ADD|
000096f0  20 20 20 72 32 2c 72 32  2c 23 31 0d 3f ca 16 20  |   r2,r2,#1.?.. |
00009700  20 20 41 44 44 20 20 20  72 38 2c 72 38 2c 23 32  |  ADD   r8,r8,#2|
00009710  30 0d 3f d4 1b 20 20 20  42 20 20 20 20 20 77 6e  |0.?..   B     wn|
00009720  61 6d 65 74 6f 6e 75 6d  62 65 72 31 0d 3f de 05  |ametonumber1.?..|
00009730  3b 0d 3f e8 33 2e 6e 6f  73 75 63 68 77 69 6e 64  |;.?.3.nosuchwind|
00009740  68 61 6e 64 20 20 20 20  20 20 20 20 20 20 20 20  |hand            |
00009750  20 20 20 20 20 3b 20 65  72 72 6f 72 20 6d 65 73  |     ; error mes|
00009760  73 61 67 65 0d 3f f2 17  20 20 20 41 44 52 20 20  |sage.?..   ADR  |
00009770  20 72 30 2c 6e 73 77 68  61 6e 64 0d 3f fc 16 20  | r0,nswhand.?.. |
00009780  20 20 42 20 20 20 20 20  6d 61 6b 65 65 72 72 6f  |  B     makeerro|
00009790  72 0d 40 06 05 3b 0d 40  10 0c 2e 6e 73 77 68 61  |r.@..;.@...nswha|
000097a0  6e 64 0d 40 1a 15 45 51  55 44 20 20 45 72 72 6f  |nd.@..EQUD  Erro|
000097b0  72 42 61 73 65 2b 37 0d  40 24 22 45 51 55 53 20  |rBase+7.@$"EQUS |
000097c0  20 22 4e 6f 20 73 75 63  68 20 77 69 6e 64 6f 77  | "No such window|
000097d0  20 68 61 6e 64 6c 65 21  22 0d 40 2e 0b 45 51 55  | handle!".@..EQU|
000097e0  42 20 20 30 0d 40 38 09  41 4c 49 47 4e 0d 40 42  |B  0.@8.ALIGN.@B|
000097f0  05 3b 0d 40 4c 33 2e 6e  6f 73 75 63 68 77 69 6e  |.;.@L3.nosuchwin|
00009800  64 6e 75 6d 20 20 20 20  20 20 20 20 20 20 20 20  |dnum            |
00009810  20 20 20 20 20 20 3b 20  65 72 72 6f 72 20 6d 65  |      ; error me|
00009820  73 73 61 67 65 0d 40 56  16 20 20 20 41 44 52 20  |ssage.@V.   ADR |
00009830  20 20 72 30 2c 6e 73 77  6e 75 6d 0d 40 60 16 20  |  r0,nswnum.@`. |
00009840  20 20 42 20 20 20 20 20  6d 61 6b 65 65 72 72 6f  |  B     makeerro|
00009850  72 0d 40 6a 05 3b 0d 40  74 0b 2e 6e 73 77 6e 75  |r.@j.;.@t..nswnu|
00009860  6d 0d 40 7e 15 45 51 55  44 20 20 45 72 72 6f 72  |m.@~.EQUD  Error|
00009870  42 61 73 65 2b 38 0d 40  88 22 45 51 55 53 20 20  |Base+8.@."EQUS  |
00009880  22 4e 6f 20 73 75 63 68  20 77 69 6e 64 6f 77 20  |"No such window |
00009890  6e 75 6d 62 65 72 21 22  0d 40 92 0b 45 51 55 42  |number!".@..EQUB|
000098a0  20 20 30 0d 40 9c 09 41  4c 49 47 4e 0d 40 a6 05  |  0.@..ALIGN.@..|
000098b0  3b 0d 40 b0 33 2e 6e 6f  73 75 63 68 77 69 6e 64  |;.@.3.nosuchwind|
000098c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000098d0  20 20 20 20 20 3b 20 65  72 72 6f 72 20 6d 65 73  |     ; error mes|
000098e0  73 61 67 65 0d 40 ba 13  20 20 20 41 44 52 20 20  |sage.@..   ADR  |
000098f0  20 72 30 2c 6e 73 77 0d  40 c4 16 20 20 20 42 20  | r0,nsw.@..   B |
00009900  20 20 20 20 6d 61 6b 65  65 72 72 6f 72 0d 40 ce  |    makeerror.@.|
00009910  05 3b 0d 40 d8 08 2e 6e  73 77 0d 40 e2 15 45 51  |.;.@...nsw.@..EQ|
00009920  55 44 20 20 45 72 72 6f  72 42 61 73 65 2b 39 0d  |UD  ErrorBase+9.|
00009930  40 ec 1b 45 51 55 53 20  20 22 4e 6f 20 73 75 63  |@..EQUS  "No suc|
00009940  68 20 77 69 6e 64 6f 77  21 22 0d 40 f6 0b 45 51  |h window!".@..EQ|
00009950  55 42 20 20 30 0d 41 00  09 41 4c 49 47 4e 0d 41  |UB  0.A..ALIGN.A|
00009960  0a 05 3b 0d 41 14 33 2e  64 6f 6e 74 6b 6e 6f 77  |..;.A.3.dontknow|
00009970  63 6f 6e 76 65 72 74 20  20 20 20 20 20 20 20 20  |convert         |
00009980  20 20 20 20 20 20 20 3b  20 65 72 72 6f 72 20 6d  |       ; error m|
00009990  65 73 73 61 67 65 0d 41  1e 1a 20 20 20 41 44 52  |essage.A..   ADR|
000099a0  20 20 20 72 30 2c 64 6e  74 6b 6e 77 63 6f 6e 76  |   r0,dntknwconv|
000099b0  0d 41 28 16 20 20 20 42  20 20 20 20 20 6d 61 6b  |.A(.   B     mak|
000099c0  65 65 72 72 6f 72 0d 41  32 05 3b 0d 41 3c 0f 2e  |eerror.A2.;.A<..|
000099d0  64 6e 74 6b 6e 77 63 6f  6e 76 0d 41 46 15 45 51  |dntknwconv.AF.EQ|
000099e0  55 44 20 20 45 72 72 6f  72 42 61 73 65 2b 36 0d  |UD  ErrorBase+6.|
000099f0  41 50 30 45 51 55 53 20  20 22 42 61 64 20 63 6f  |AP0EQUS  "Bad co|
00009a00  6e 76 65 72 73 69 6f 6e  20 72 6f 75 74 69 6e 65  |nversion routine|
00009a10  20 6e 75 6d 62 65 72 20  69 6e 20 52 30 21 22 0d  | number in R0!".|
00009a20  41 5a 0b 45 51 55 42 20  20 30 0d 41 64 09 41 4c  |AZ.EQUB  0.Ad.AL|
00009a30  49 47 4e 0d 41 6e 05 3b  0d 41 78 1e 3b 20 72 31  |IGN.An.;.Ax.; r1|
00009a40  20 3d 20 74 65 6d 70 6c  61 74 65 20 66 6f 6e 74  | = template font|
00009a50  20 62 6c 6f 63 6b 0d 41  82 05 3b 0d 41 8c 16 2e  | block.A..;.A...|
00009a60  6c 6f 73 65 74 65 6d 70  6c 61 74 65 66 6f 6e 74  |losetemplatefont|
00009a70  73 0d 41 96 17 20 20 20  53 54 4d 46 44 20 28 73  |s.A..   STMFD (s|
00009a80  70 29 21 2c 7b 72 32 7d  0d 41 a0 12 20 20 20 4d  |p)!,{r2}.A..   M|
00009a90  4f 56 20 20 20 72 38 2c  23 31 0d 41 aa 0f 2e 6c  |OV   r8,#1.A...l|
00009aa0  6f 73 65 66 6f 6e 74 73  31 0d 41 b4 17 20 20 20  |osefonts1.A..   |
00009ab0  4c 44 52 42 20 20 72 32  2c 5b 72 31 2c 72 38 5d  |LDRB  r2,[r1,r8]|
00009ac0  0d 41 be 12 20 20 20 54  45 51 20 20 20 72 32 2c  |.A..   TEQ   r2,|
00009ad0  23 30 0d 41 c8 17 20 20  20 42 45 51 20 20 20 6c  |#0.A..   BEQ   l|
00009ae0  6f 73 65 66 6f 6e 74 73  32 0d 41 d2 0f 2e 6c 6f  |osefonts2.A...lo|
00009af0  73 65 66 6f 6e 74 73 33  0d 41 dc 1d 20 20 20 53  |sefonts3.A..   S|
00009b00  57 49 20 20 20 22 58 46  6f 6e 74 5f 4c 6f 73 65  |WI   "XFont_Lose|
00009b10  46 6f 6e 74 22 0d 41 e6  17 20 20 20 42 56 53 20  |Font".A..   BVS |
00009b20  20 20 6c 6f 73 65 66 6f  6e 74 73 34 0d 41 f0 15  |  losefonts4.A..|
00009b30  20 20 20 53 55 42 20 20  20 72 32 2c 72 32 2c 23  |   SUB   r2,r2,#|
00009b40  31 0d 41 fa 12 20 20 20  43 4d 50 20 20 20 72 32  |1.A..   CMP   r2|
00009b50  2c 23 30 0d 42 04 17 20  20 20 42 47 54 20 20 20  |,#0.B..   BGT   |
00009b60  6c 6f 73 65 66 6f 6e 74  73 33 0d 42 0e 0f 2e 6c  |losefonts3.B...l|
00009b70  6f 73 65 66 6f 6e 74 73  32 0d 42 18 15 20 20 20  |osefonts2.B..   |
00009b80  41 44 44 20 20 20 72 38  2c 72 38 2c 23 31 0d 42  |ADD   r8,r8,#1.B|
00009b90  22 14 20 20 20 43 4d 50  20 20 20 72 38 2c 23 32  |".   CMP   r8,#2|
00009ba0  35 36 0d 42 2c 17 20 20  20 42 4c 54 20 20 20 6c  |56.B,.   BLT   l|
00009bb0  6f 73 65 66 6f 6e 74 73  31 0d 42 36 0f 2e 6c 6f  |osefonts1.B6..lo|
00009bc0  73 65 66 6f 6e 74 73 34  0d 42 40 17 20 20 20 4c  |sefonts4.B@.   L|
00009bd0  44 4d 46 44 20 28 73 70  29 21 2c 7b 72 32 7d 0d  |DMFD (sp)!,{r2}.|
00009be0  42 4a 14 20 20 20 42 20  20 20 20 20 65 78 69 74  |BJ.   B     exit|
00009bf0  73 77 69 0d 42 54 05 3b  0d 42 5e 0d 3b 20 72 65  |swi.BT.;.B^.; re|
00009c00  74 75 72 6e 73 0d 42 68  20 3b 20 72 30 20 3d 20  |turns.Bh ; r0 = |
00009c10  74 61 73 6b 20 69 64 20  66 6f 72 20 77 69 6d 70  |task id for wimp|
00009c20  74 6f 6f 6c 73 0d 42 72  25 3b 20 72 31 20 3d 20  |tools.Br%; r1 = |
00009c30  74 61 73 6b 20 69 6e 66  6f 20 62 6c 6f 63 6b 20  |task info block |
00009c40  28 20 69 6e 20 52 4d 41  20 29 0d 42 7c 05 3b 0d  |( in RMA ).B|.;.|
00009c50  42 86 0d 2e 72 65 67 69  73 74 65 72 0d 42 90 50  |B...register.B.P|
00009c60  20 20 20 4c 44 52 20 20  20 72 38 2c 5b 77 73 5d  |   LDR   r8,[ws]|
00009c70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00009c80  20 20 20 20 3b 20 6e 75  6d 62 65 72 20 6f 66 20  |    ; number of |
00009c90  74 61 73 6b 73 20 72 65  67 69 73 74 65 72 65 64  |tasks registered|
00009ca0  20 77 69 74 68 20 6d 6f  64 75 6c 65 0d 42 9a 13  | with module.B..|
00009cb0  20 20 20 43 4d 50 20 20  20 72 38 2c 23 33 31 0d  |   CMP   r8,#31.|
00009cc0  42 a4 19 20 20 20 42 47  45 20 20 20 74 6f 6f 6d  |B..   BGE   toom|
00009cd0  61 6e 79 74 61 73 6b 73  0d 42 ae 15 20 20 20 41  |anytasks.B..   A|
00009ce0  44 44 20 20 20 72 38 2c  72 38 2c 23 31 0d 42 b8  |DD   r8,r8,#1.B.|
00009cf0  37 20 20 20 53 54 52 20  20 20 72 38 2c 5b 77 73  |7   STR   r8,[ws|
00009d00  5d 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |]               |
00009d10  20 20 20 20 20 3b 20 69  6e 63 72 65 61 73 65 20  |     ; increase |
00009d20  62 79 20 31 0d 42 c2 4d  20 20 20 4c 44 52 20 20  |by 1.B.M   LDR  |
00009d30  20 72 38 2c 5b 77 73 2c  23 34 5d 20 20 20 20 20  | r8,[ws,#4]     |
00009d40  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 67 65  |            ; ge|
00009d50  74 20 66 6c 61 67 73 20  2d 20 62 69 74 20 73 65  |t flags - bit se|
00009d60  74 20 66 6f 72 20 62 6c  6f 63 6b 20 62 65 69 6e  |t for block bein|
00009d70  67 0d 42 cc 3b 20 20 20  4d 4f 56 20 20 20 72 39  |g.B.;   MOV   r9|
00009d80  2c 23 31 20 20 20 20 20  20 20 20 20 20 20 20 20  |,#1             |
00009d90  20 20 20 20 20 20 20 20  20 3b 20 75 73 65 64 20  |         ; used |
00009da0  62 79 20 74 68 61 74 20  74 61 73 6b 0d 42 d6 14  |by that task.B..|
00009db0  20 20 20 4d 4f 56 20 20  20 72 31 30 2c 23 33 32  |   MOV   r10,#32|
00009dc0  0d 42 e0 12 20 20 20 4d  4f 56 20 20 20 72 30 2c  |.B..   MOV   r0,|
00009dd0  23 30 0d 42 ea 0e 2e 72  65 67 69 73 74 65 72 31  |#0.B...register1|
00009de0  0d 42 f4 12 20 20 20 54  53 54 20 20 20 72 38 2c  |.B..   TST   r8,|
00009df0  72 39 0d 42 fe 16 20 20  20 42 45 51 20 20 20 72  |r9.B..   BEQ   r|
00009e00  65 67 69 73 74 65 72 32  0d 43 08 18 20 20 20 4d  |egister2.C..   M|
00009e10  4f 56 20 20 20 72 39 2c  72 39 2c 4c 53 4c 23 31  |OV   r9,r9,LSL#1|
00009e20  0d 43 12 15 20 20 20 41  44 44 20 20 20 72 30 2c  |.C..   ADD   r0,|
00009e30  72 30 2c 23 31 0d 43 1c  16 20 20 20 54 53 54 20  |r0,#1.C..   TST |
00009e40  20 20 72 39 2c 23 31 3c  3c 33 31 0d 43 26 19 20  |  r9,#1<<31.C&. |
00009e50  20 20 42 4e 45 20 20 20  74 6f 6f 6d 61 6e 79 74  |  BNE   toomanyt|
00009e60  61 73 6b 73 0d 43 30 16  20 20 20 42 20 20 20 20  |asks.C0.   B    |
00009e70  20 72 65 67 69 73 74 65  72 31 0d 43 3a 0e 2e 72  | register1.C:..r|
00009e80  65 67 69 73 74 65 72 32  0d 43 44 14 20 20 20 84  |egister2.CD.   .|
00009e90  52 20 20 20 72 38 2c 72  38 2c 72 39 0d 43 4e 17  |R   r8,r8,r9.CN.|
00009ea0  20 20 20 53 54 52 20 20  20 72 38 2c 5b 77 73 2c  |   STR   r8,[ws,|
00009eb0  23 34 5d 0d 43 58 13 20  20 20 4d 4f 56 20 20 20  |#4].CX.   MOV   |
00009ec0  72 31 31 2c 23 30 0d 43  62 1c 20 20 20 41 44 44  |r11,#0.Cb.   ADD|
00009ed0  20 20 20 72 31 30 2c 77  73 2c 72 30 2c 4c 53 4c  |   r10,ws,r0,LSL|
00009ee0  23 35 0d 43 6c 18 20 20  20 41 44 44 20 20 20 72  |#5.Cl.   ADD   r|
00009ef0  31 30 2c 72 31 30 2c 23  33 32 0d 43 76 13 20 20  |10,r10,#32.Cv.  |
00009f00  20 4d 4f 56 20 20 20 72  31 2c 72 31 30 0d 43 80  | MOV   r1,r10.C.|
00009f10  3c 20 20 20 53 54 52 20  20 20 72 31 31 2c 5b 72  |<   STR   r11,[r|
00009f20  31 30 5d 2c 23 34 20 20  20 20 20 20 20 20 20 20  |10],#4          |
00009f30  20 20 20 20 20 3b 20 63  6c 65 61 72 20 6d 65 6d  |     ; clear mem|
00009f40  6f 72 79 20 62 6c 6f 63  6b 0d 43 8a 19 20 20 20  |ory block.C..   |
00009f50  53 54 52 20 20 20 72 31  31 2c 5b 72 31 30 5d 2c  |STR   r11,[r10],|
00009f60  23 34 0d 43 94 19 20 20  20 53 54 52 20 20 20 72  |#4.C..   STR   r|
00009f70  31 31 2c 5b 72 31 30 5d  2c 23 34 0d 43 9e 19 20  |11,[r10],#4.C.. |
00009f80  20 20 53 54 52 20 20 20  72 31 31 2c 5b 72 31 30  |  STR   r11,[r10|
00009f90  5d 2c 23 34 0d 43 a8 19  20 20 20 53 54 52 20 20  |],#4.C..   STR  |
00009fa0  20 72 31 31 2c 5b 72 31  30 5d 2c 23 34 0d 43 b2  | r11,[r10],#4.C.|
00009fb0  19 20 20 20 53 54 52 20  20 20 72 31 31 2c 5b 72  |.   STR   r11,[r|
00009fc0  31 30 5d 2c 23 34 0d 43  bc 19 20 20 20 53 54 52  |10],#4.C..   STR|
00009fd0  20 20 20 72 31 31 2c 5b  72 31 30 5d 2c 23 34 0d  |   r11,[r10],#4.|
00009fe0  43 c6 19 20 20 20 53 54  52 20 20 20 72 31 31 2c  |C..   STR   r11,|
00009ff0  5b 72 31 30 5d 2c 23 34  0d 43 d0 14 20 20 20 42  |[r10],#4.C..   B|
0000a000  20 20 20 20 20 65 78 69  74 73 77 69 0d 43 da 05  |     exitswi.C..|
0000a010  3b 0d 43 e4 11 2e 74 6f  6f 6d 61 6e 79 74 61 73  |;.C...toomanytas|
0000a020  6b 73 0d 43 ee 1f 20 20  20 41 44 52 20 20 20 72  |ks.C..   ADR   r|
0000a030  30 2c 74 6f 6f 6d 61 6e  79 74 61 73 6b 73 73 74  |0,toomanytasksst|
0000a040  72 0d 43 f8 16 20 20 20  42 20 20 20 20 20 6d 61  |r.C..   B     ma|
0000a050  6b 65 65 72 72 6f 72 0d  44 02 05 3b 0d 44 0c 14  |keerror.D..;.D..|
0000a060  2e 74 6f 6f 6d 61 6e 79  74 61 73 6b 73 73 74 72  |.toomanytasksstr|
0000a070  0d 44 16 16 45 51 55 44  20 20 45 72 72 6f 72 42  |.D..EQUD  ErrorB|
0000a080  61 73 65 2b 31 33 0d 44  20 44 45 51 55 53 20 20  |ase+13.D DEQUS  |
0000a090  22 54 6f 6f 20 6d 61 6e  79 20 74 61 73 6b 73 21  |"Too many tasks!|
0000a0a0  20 20 54 68 69 73 20 6d  6f 64 75 6c 65 20 63 61  |  This module ca|
0000a0b0  6e 20 6f 6e 6c 79 20 72  65 67 69 73 74 65 72 20  |n only register |
0000a0c0  33 31 20 74 61 73 6b 73  2e 22 0d 44 2a 0b 45 51  |31 tasks.".D*.EQ|
0000a0d0  55 42 20 20 30 0d 44 34  09 41 4c 49 47 4e 0d 44  |UB  0.D4.ALIGN.D|
0000a0e0  3e 05 3b 0d 44 48 12 3b  20 72 30 20 3d 20 74 61  |>.;.DH.; r0 = ta|
0000a0f0  73 6b 20 69 64 0d 44 52  05 3b 0d 44 5c 0f 2e 64  |sk id.DR.;.D\..d|
0000a100  65 72 65 67 69 73 74 65  72 0d 44 66 12 20 20 20  |eregister.Df.   |
0000a110  4d 4f 56 20 20 20 72 38  2c 23 31 0d 44 70 19 20  |MOV   r8,#1.Dp. |
0000a120  20 20 4d 4f 56 20 20 20  72 39 2c 72 38 2c 4c 53  |  MOV   r9,r8,LS|
0000a130  4c 20 72 30 0d 44 7a 18  20 20 20 4c 44 52 20 20  |L r0.Dz.   LDR  |
0000a140  20 72 31 30 2c 5b 77 73  2c 23 34 5d 0d 44 84 3d  | r10,[ws,#4].D.=|
0000a150  20 20 20 54 53 54 20 20  20 72 31 30 2c 72 39 20  |   TST   r10,r9 |
0000a160  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 63 68  |            ; ch|
0000a170  65 63 6b 20 74 61 73 6b  20 62 69 74 20 69 6e 20  |eck task bit in |
0000a180  66 6c 61 67 20 77 6f 72  64 0d 44 8e 33 20 20 20  |flag word.D.3   |
0000a190  42 45 51 20 20 20 62 61  64 74 61 73 6b 69 64 20  |BEQ   badtaskid |
0000a1a0  20 20 20 20 20 20 20 20  20 3b 20 69 66 20 6e 6f  |         ; if no|
0000a1b0  74 20 73 65 74 20 62 61  64 20 69 64 0d 44 98 12  |t set bad id.D..|
0000a1c0  20 20 20 4d 56 4e 20 20  20 72 39 2c 72 39 0d 44  |   MVN   r9,r9.D|
0000a1d0  a2 15 20 20 20 80 20 20  20 72 31 30 2c 72 31 30  |..   .   r10,r10|
0000a1e0  2c 72 39 0d 44 ac 33 20  20 20 53 54 52 20 20 20  |,r9.D.3   STR   |
0000a1f0  72 31 30 2c 5b 77 73 2c  23 34 5d 20 20 20 20 20  |r10,[ws,#4]     |
0000a200  20 20 20 3b 20 63 6c 65  61 72 20 62 69 74 20 69  |   ; clear bit i|
0000a210  6e 20 77 6f 72 64 0d 44  b6 15 20 20 20 4c 44 52  |n word.D..   LDR|
0000a220  20 20 20 72 31 30 2c 5b  77 73 5d 0d 44 c0 13 20  |   r10,[ws].D.. |
0000a230  20 20 54 45 51 20 20 20  72 31 30 2c 23 30 0d 44  |  TEQ   r10,#0.D|
0000a240  ca 3a 20 20 20 53 55 42  4e 45 20 72 31 30 2c 72  |.:   SUBNE r10,r|
0000a250  31 30 2c 23 31 20 20 20  20 20 20 20 20 20 3b 20  |10,#1         ; |
0000a260  72 65 64 75 63 65 20 61  63 74 69 76 65 20 74 61  |reduce active ta|
0000a270  73 6b 73 20 62 79 20 31  0d 44 d4 15 20 20 20 53  |sks by 1.D..   S|
0000a280  54 52 20 20 20 72 31 30  2c 5b 77 73 5d 0d 44 de  |TR   r10,[ws].D.|
0000a290  3b 20 20 20 41 44 44 20  20 20 72 38 2c 77 73 2c  |;   ADD   r8,ws,|
0000a2a0  72 30 2c 4c 53 4c 20 23  35 20 20 20 20 3b 20 67  |r0,LSL #5    ; g|
0000a2b0  65 74 20 61 64 64 72 65  73 73 20 6f 66 20 74 61  |et address of ta|
0000a2c0  73 6b 20 62 6c 6f 63 6b  0d 44 e8 16 20 20 20 41  |sk block.D..   A|
0000a2d0  44 44 20 20 20 72 38 2c  72 38 2c 23 33 32 0d 44  |DD   r8,r8,#32.D|
0000a2e0  f2 12 20 20 20 4d 4f 56  20 20 20 72 39 2c 23 30  |..   MOV   r9,#0|
0000a2f0  0d 44 fc 12 20 20 20 4d  4f 56 20 20 20 72 30 2c  |.D..   MOV   r0,|
0000a300  23 37 0d 45 06 10 2e 64  65 72 65 67 69 73 74 65  |#7.E...deregiste|
0000a310  72 31 0d 45 10 17 20 20  20 4c 44 52 20 20 20 72  |r1.E..   LDR   r|
0000a320  32 2c 5b 72 38 2c 72 39  5d 0d 45 1a 12 20 20 20  |2,[r8,r9].E..   |
0000a330  54 45 51 20 20 20 72 32  2c 23 30 0d 45 24 19 20  |TEQ   r2,#0.E$. |
0000a340  20 20 53 57 49 4e 45 20  22 58 4f 53 5f 4d 6f 64  |  SWINE "XOS_Mod|
0000a350  75 6c 65 22 0d 45 2e 18  20 20 20 42 56 53 20 20  |ule".E..   BVS  |
0000a360  20 64 65 72 65 67 69 73  74 65 72 32 0d 45 38 15  | deregister2.E8.|
0000a370  20 20 20 41 44 44 20 20  20 72 39 2c 72 39 2c 23  |   ADD   r9,r9,#|
0000a380  34 0d 45 42 13 20 20 20  43 4d 50 20 20 20 72 39  |4.EB.   CMP   r9|
0000a390  2c 23 33 32 0d 45 4c 18  20 20 20 42 4c 54 20 20  |,#32.EL.   BLT  |
0000a3a0  20 64 65 72 65 67 69 73  74 65 72 31 0d 45 56 10  | deregister1.EV.|
0000a3b0  2e 64 65 72 65 67 69 73  74 65 72 32 0d 45 60 14  |.deregister2.E`.|
0000a3c0  20 20 20 42 20 20 20 20  20 65 78 69 74 73 77 69  |   B     exitswi|
0000a3d0  0d 45 6a 05 3b 0d 45 74  0e 2e 62 61 64 74 61 73  |.Ej.;.Et..badtas|
0000a3e0  6b 69 64 0d 45 7e 1c 20  20 20 41 44 52 20 20 20  |kid.E~.   ADR   |
0000a3f0  72 30 2c 62 61 64 74 61  73 6b 69 64 73 74 72 0d  |r0,badtaskidstr.|
0000a400  45 88 16 20 20 20 42 20  20 20 20 20 6d 61 6b 65  |E..   B     make|
0000a410  65 72 72 6f 72 0d 45 92  05 3b 0d 45 9c 11 2e 62  |error.E..;.E...b|
0000a420  61 64 74 61 73 6b 69 64  73 74 72 0d 45 a6 16 45  |adtaskidstr.E..E|
0000a430  51 55 44 20 20 45 72 72  6f 72 42 61 73 65 2b 31  |QUD  ErrorBase+1|
0000a440  34 0d 45 b0 18 45 51 55  53 20 20 22 42 61 64 20  |4.E..EQUS  "Bad |
0000a450  74 61 73 6b 20 69 64 21  22 0d 45 ba 0a 45 51 55  |task id!".E..EQU|
0000a460  42 20 30 0d 45 c4 09 41  4c 49 47 4e 0d 45 ce 05  |B 0.E..ALIGN.E..|
0000a470  3b 0d 45 d8 12 3b 20 72  30 20 3d 20 74 61 73 6b  |;.E..; r0 = task|
0000a480  20 69 64 0d 45 e2 13 3b  20 72 31 20 3d 20 66 69  | id.E..; r1 = fi|
0000a490  6c 65 6e 61 6d 65 0d 45  ec 0d 3b 20 72 65 74 75  |lename.E..; retu|
0000a4a0  72 6e 73 0d 45 f6 16 3b  20 72 31 20 3d 20 73 70  |rns.E..; r1 = sp|
0000a4b0  72 69 74 65 62 6c 6f 63  6b 0d 46 00 05 3b 0d 46  |riteblock.F..;.F|
0000a4c0  0a 10 2e 6c 6f 61 64 73  70 72 69 74 65 73 0d 46  |...loadsprites.F|
0000a4d0  14 1a 20 20 20 53 54 4d  46 44 20 28 73 70 29 21  |..   STMFD (sp)!|
0000a4e0  2c 7b 72 32 2d 72 34 7d  0d 46 1e 12 20 20 20 4d  |,{r2-r4}.F..   M|
0000a4f0  4f 56 20 20 20 72 38 2c  23 31 0d 46 28 19 20 20  |OV   r8,#1.F(.  |
0000a500  20 4d 4f 56 20 20 20 72  39 2c 72 38 2c 4c 53 4c  | MOV   r9,r8,LSL|
0000a510  20 72 30 0d 46 32 18 20  20 20 4c 44 52 20 20 20  | r0.F2.   LDR   |
0000a520  72 31 30 2c 5b 77 73 2c  23 34 5d 0d 46 3c 13 20  |r10,[ws,#4].F<. |
0000a530  20 20 54 53 54 20 20 20  72 31 30 2c 72 39 0d 46  |  TST   r10,r9.F|
0000a540  46 1d 20 20 20 4c 44 4d  45 51 46 44 20 20 28 73  |F.   LDMEQFD  (s|
0000a550  70 29 21 2c 7b 72 32 2d  72 34 7d 0d 46 50 16 20  |p)!,{r2-r4}.FP. |
0000a560  20 20 42 45 51 20 20 20  62 61 64 74 61 73 6b 69  |  BEQ   badtaski|
0000a570  64 0d 46 5a 1c 20 20 20  41 44 44 20 20 20 72 38  |d.FZ.   ADD   r8|
0000a580  2c 77 73 2c 72 30 2c 4c  53 4c 20 23 35 0d 46 64  |,ws,r0,LSL #5.Fd|
0000a590  16 20 20 20 41 44 44 20  20 20 72 38 2c 72 38 2c  |.   ADD   r8,r8,|
0000a5a0  23 33 32 0d 46 6e 14 20  20 20 4c 44 52 20 20 20  |#32.Fn.   LDR   |
0000a5b0  72 30 2c 5b 72 38 5d 0d  46 78 12 20 20 20 54 45  |r0,[r8].Fx.   TE|
0000a5c0  51 20 20 20 72 30 2c 23  30 0d 46 82 1d 20 20 20  |Q   r0,#0.F..   |
0000a5d0  4c 44 4d 4e 45 46 44 20  20 28 73 70 29 21 2c 7b  |LDMNEFD  (sp)!,{|
0000a5e0  72 32 2d 72 34 7d 0d 46  8c 19 20 20 20 42 4e 45  |r2-r4}.F..   BNE|
0000a5f0  20 20 20 73 70 74 73 70  61 63 65 75 73 65 64 0d  |   sptspaceused.|
0000a600  46 96 12 20 20 20 4d 4f  56 20 20 20 72 30 2c 23  |F..   MOV   r0,#|
0000a610  35 0d 46 a0 17 20 20 20  53 57 49 20 20 20 22 58  |5.F..   SWI   "X|
0000a620  4f 53 5f 46 69 6c 65 22  0d 46 aa 19 20 20 20 42  |OS_File".F..   B|
0000a630  56 53 20 20 20 6c 6f 61  64 73 70 72 69 74 65 73  |VS   loadsprites|
0000a640  31 0d 46 b4 12 20 20 20  54 45 51 20 20 20 72 30  |1.F..   TEQ   r0|
0000a650  2c 23 30 0d 46 be 19 20  20 20 42 45 51 20 20 20  |,#0.F..   BEQ   |
0000a660  6e 6f 73 70 72 69 74 65  66 69 6c 65 0d 46 c8 16  |nospritefile.F..|
0000a670  20 20 20 41 44 44 20 20  20 72 34 2c 72 34 2c 23  |   ADD   r4,r4,#|
0000a680  31 36 0d 46 d2 12 20 20  20 4d 4f 56 20 20 20 72  |16.F..   MOV   r|
0000a690  33 2c 72 34 0d 46 dc 12  20 20 20 4d 4f 56 20 20  |3,r4.F..   MOV  |
0000a6a0  20 72 30 2c 23 36 0d 46  e6 19 20 20 20 53 57 49  | r0,#6.F..   SWI|
0000a6b0  20 20 20 22 58 4f 53 5f  4d 6f 64 75 6c 65 22 0d  |   "XOS_Module".|
0000a6c0  46 f0 19 20 20 20 42 56  53 20 20 20 6c 6f 61 64  |F..   BVS   load|
0000a6d0  73 70 72 69 74 65 73 31  0d 46 fa 14 20 20 20 53  |sprites1.F..   S|
0000a6e0  54 52 20 20 20 72 32 2c  5b 72 38 5d 0d 47 04 14  |TR   r2,[r8].G..|
0000a6f0  20 20 20 53 54 52 20 20  20 72 34 2c 5b 72 32 5d  |   STR   r4,[r2]|
0000a700  0d 47 0e 13 20 20 20 4d  4f 56 20 20 20 72 30 2c  |.G..   MOV   r0,|
0000a710  23 31 36 0d 47 18 17 20  20 20 53 54 52 20 20 20  |#16.G..   STR   |
0000a720  72 30 2c 5b 72 32 2c 23  38 5d 0d 47 22 12 20 20  |r0,[r2,#8].G".  |
0000a730  20 4d 4f 56 20 20 20 72  39 2c 72 32 0d 47 2c 12  | MOV   r9,r2.G,.|
0000a740  20 20 20 4d 4f 56 20 20  20 72 32 2c 72 31 0d 47  |   MOV   r2,r1.G|
0000a750  36 12 20 20 20 4d 4f 56  20 20 20 72 31 2c 72 39  |6.   MOV   r1,r9|
0000a760  0d 47 40 12 20 20 20 4d  4f 56 20 20 20 72 30 2c  |.G@.   MOV   r0,|
0000a770  23 39 0d 47 4a 18 20 20  20 41 44 44 20 20 20 72  |#9.GJ.   ADD   r|
0000a780  30 2c 72 30 2c 23 26 31  30 30 0d 47 54 1b 20 20  |0,r0,#&100.GT.  |
0000a790  20 53 57 49 20 20 20 22  58 4f 53 5f 53 70 72 69  | SWI   "XOS_Spri|
0000a7a0  74 65 4f 70 22 0d 47 5e  19 20 20 20 42 56 53 20  |teOp".G^.   BVS |
0000a7b0  20 20 6c 6f 61 64 73 70  72 69 74 65 73 31 0d 47  |  loadsprites1.G|
0000a7c0  68 13 20 20 20 4d 4f 56  20 20 20 72 30 2c 23 31  |h.   MOV   r0,#1|
0000a7d0  30 0d 47 72 18 20 20 20  41 44 44 20 20 20 72 30  |0.Gr.   ADD   r0|
0000a7e0  2c 72 30 2c 23 26 31 30  30 0d 47 7c 1b 20 20 20  |,r0,#&100.G|.   |
0000a7f0  53 57 49 20 20 20 22 58  4f 53 5f 53 70 72 69 74  |SWI   "XOS_Sprit|
0000a800  65 4f 70 22 0d 47 86 11  2e 6c 6f 61 64 73 70 72  |eOp".G...loadspr|
0000a810  69 74 65 73 31 0d 47 90  1a 20 20 20 4c 44 4d 46  |ites1.G..   LDMF|
0000a820  44 20 28 73 70 29 21 2c  7b 72 32 2d 72 34 7d 0d  |D (sp)!,{r2-r4}.|
0000a830  47 9a 14 20 20 20 42 20  20 20 20 20 65 78 69 74  |G..   B     exit|
0000a840  73 77 69 0d 47 a4 05 3b  0d 47 ae 11 2e 6e 6f 73  |swi.G..;.G...nos|
0000a850  70 72 69 74 65 66 69 6c  65 0d 47 b8 1a 20 20 20  |pritefile.G..   |
0000a860  4c 44 4d 46 44 20 28 73  70 29 21 2c 7b 72 32 2d  |LDMFD (sp)!,{r2-|
0000a870  72 34 7d 0d 47 c2 1c 20  20 20 41 44 52 20 20 20  |r4}.G..   ADR   |
0000a880  72 30 2c 6e 6f 73 70 74  66 69 6c 65 73 74 72 0d  |r0,nosptfilestr.|
0000a890  47 cc 16 20 20 20 42 20  20 20 20 20 6d 61 6b 65  |G..   B     make|
0000a8a0  65 72 72 6f 72 0d 47 d6  11 2e 6e 6f 73 70 74 66  |error.G...nosptf|
0000a8b0  69 6c 65 73 74 72 0d 47  e0 19 20 20 20 45 51 55  |ilestr.G..   EQU|
0000a8c0  44 20 20 45 72 72 6f 72  42 61 73 65 2b 31 34 0d  |D  ErrorBase+14.|
0000a8d0  47 ea 25 20 20 20 45 51  55 53 20 20 22 53 70 72  |G.%   EQUS  "Spr|
0000a8e0  69 74 65 20 66 69 6c 65  20 6e 6f 74 20 66 6f 75  |ite file not fou|
0000a8f0  6e 64 21 22 0d 47 f4 0e  20 20 20 45 51 55 42 20  |nd!".G..   EQUB |
0000a900  20 30 0d 47 fe 0c 20 20  20 41 4c 49 47 4e 0d 48  | 0.G..   ALIGN.H|
0000a910  08 05 3b 0d 48 12 11 2e  73 70 74 73 70 61 63 65  |..;.H...sptspace|
0000a920  75 73 65 64 0d 48 1c 1f  20 20 20 41 44 52 20 20  |used.H..   ADR  |
0000a930  20 72 30 2c 73 70 74 73  70 61 63 65 75 73 65 64  | r0,sptspaceused|
0000a940  73 74 72 0d 48 26 16 20  20 20 42 20 20 20 20 20  |str.H&.   B     |
0000a950  6d 61 6b 65 65 72 72 6f  72 0d 48 30 14 2e 73 70  |makeerror.H0..sp|
0000a960  74 73 70 61 63 65 75 73  65 64 73 74 72 0d 48 3a  |tspaceusedstr.H:|
0000a970  19 20 20 20 45 51 55 44  20 20 45 72 72 6f 72 42  |.   EQUD  ErrorB|
0000a980  61 73 65 2b 31 35 0d 48  44 4a 20 20 20 45 51 55  |ase+15.HDJ   EQU|
0000a990  53 20 20 22 52 4d 41 20  68 61 73 20 62 65 65 6e  |S  "RMA has been|
0000a9a0  20 61 6c 72 65 61 64 79  20 61 6c 6c 6f 63 61 74  | already allocat|
0000a9b0  65 64 20 66 6f 72 20 73  70 72 69 74 65 73 20 66  |ed for sprites f|
0000a9c0  6f 72 20 74 68 69 73 20  6d 6f 64 75 6c 65 21 22  |or this module!"|
0000a9d0  0d 48 4e 0e 20 20 20 45  51 55 42 20 20 30 0d 48  |.HN.   EQUB  0.H|
0000a9e0  58 0c 20 20 20 41 4c 49  47 4e 0d 48 62 05 3b 0d  |X.   ALIGN.Hb.;.|
0000a9f0  48 6c 14 2e 67 65 74 74  65 6d 70 6c 61 74 65 69  |Hl..gettemplatei|
0000aa00  6e 66 6f 0d 48 76 18 20  20 20 42 20 20 6e 6f 74  |nfo.Hv.   B  not|
0000aa10  69 6d 70 6c 65 6d 65 6e  74 65 64 0d 48 80 05 3b  |implemented.H..;|
0000aa20  0d 48 8a 13 2e 6e 6f 74  69 6d 70 6c 65 6d 65 6e  |.H...notimplemen|
0000aa30  74 65 64 0d 48 94 21 20  20 20 41 44 52 20 20 20  |ted.H.!   ADR   |
0000aa40  72 30 2c 6e 6f 74 69 6d  70 6c 65 6d 65 6e 74 65  |r0,notimplemente|
0000aa50  64 73 74 72 0d 48 9e 16  20 20 20 42 20 20 20 20  |dstr.H..   B    |
0000aa60  20 6d 61 6b 65 65 72 72  6f 72 0d 48 a8 05 3b 0d  | makeerror.H..;.|
0000aa70  48 b2 16 2e 6e 6f 74 69  6d 70 6c 65 6d 65 6e 74  |H...notimplement|
0000aa80  65 64 73 74 72 0d 48 bc  16 45 51 55 44 20 20 45  |edstr.H..EQUD  E|
0000aa90  72 72 6f 72 42 61 73 65  2b 31 30 0d 48 c6 bc 45  |rrorBase+10.H..E|
0000aaa0  51 55 53 20 20 22 53 57  49 20 6e 6f 74 20 69 6d  |QUS  "SWI not im|
0000aab0  70 6c 65 6d 65 6e 74 65  64 20 69 6e 20 74 68 69  |plemented in thi|
0000aac0  73 20 76 65 72 73 69 6f  6e 20 6f 66 20 57 69 6d  |s version of Wim|
0000aad0  70 54 6f 6f 6c 73 2e 20  20 50 6c 65 61 73 65 20  |pTools.  Please |
0000aae0  63 6f 6e 74 61 63 74 20  4d 61 74 74 20 4c 65 77  |contact Matt Lew|
0000aaf0  69 73 2c 20 46 69 65 6c  64 20 48 6f 75 73 65 2c  |is, Field House,|
0000ab00  20 50 72 69 6d 72 6f 73  65 20 48 69 6c 6c 2c 20  | Primrose Hill, |
0000ab10  43 6f 77 62 72 69 64 67  65 2c 20 53 6f 75 74 68  |Cowbridge, South|
0000ab20  20 47 6c 61 6d 2c 20 43  46 37 20 37 44 55 2c 20  | Glam, CF7 7DU, |
0000ab30  66 6f 72 20 61 6e 20 75  70 64 61 74 65 64 20 76  |for an updated v|
0000ab40  65 72 73 69 6f 6e 20 6f  66 20 74 68 69 73 20 6d  |ersion of this m|
0000ab50  6f 64 75 6c 65 2e 22 0d  48 d0 0a 45 51 55 42 20  |odule.".H..EQUB |
0000ab60  30 0d 48 da 09 41 4c 49  47 4e 0d 48 e4 05 3b 0d  |0.H..ALIGN.H..;.|
0000ab70  48 ee 4c 3b 20 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |H.L; ***********|
0000ab80  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
0000abb0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 0d 48 f8 4c 3b  |***********.H.L;|
0000abc0  20 2a 20 20 20 20 54 68  65 20 66 6f 6c 6c 6f 77  | *    The follow|
0000abd0  69 6e 67 20 72 6f 75 74  69 6e 65 73 20 61 72 65  |ing routines are|
0000abe0  20 73 74 72 69 6e 67 20  68 61 6e 64 6c 69 6e 67  | string handling|
0000abf0  20 72 6f 75 74 69 6e 65  73 20 73 77 69 20 63 61  | routines swi ca|
0000ac00  6c 6c 73 20 20 20 2a 0d  49 02 4c 3b 20 2a 2a 2a  |lls   *.I.L; ***|
0000ac10  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
0000ac50  2a 2a 2a 0d 49 0c 05 3b  0d 49 16 16 3b 20 72 30  |***.I..;.I..; r0|
0000ac60  20 3d 20 66 75 6c 6c 20  73 74 72 69 6e 67 0d 49  | = full string.I|
0000ac70  20 05 3b 0d 49 2a 0d 3b  20 72 65 74 75 72 6e 73  | .;.I*.; returns|
0000ac80  0d 49 34 05 3b 0d 49 3e  19 3b 20 72 31 20 3d 20  |.I4.;.I>.; r1 = |
0000ac90  6c 65 61 66 20 6f 66 20  73 74 72 69 6e 67 0d 49  |leaf of string.I|
0000aca0  48 05 3b 0d 49 52 0f 2e  73 77 69 67 65 74 6c 65  |H.;.IR..swigetle|
0000acb0  61 66 0d 49 5c 17 20 20  20 53 54 4d 46 44 20 28  |af.I\.   STMFD (|
0000acc0  73 70 29 21 2c 7b 72 30  7d 0d 49 66 12 20 20 20  |sp)!,{r0}.If.   |
0000acd0  4d 4f 56 20 20 20 72 38  2c 72 30 0d 49 70 10 2e  |MOV   r8,r0.Ip..|
0000ace0  73 77 69 67 65 74 6c 65  61 66 31 0d 49 7a 17 20  |swigetleaf1.Iz. |
0000acf0  20 20 4c 44 52 42 20 20  72 39 2c 5b 72 30 5d 2c  |  LDRB  r9,[r0],|
0000ad00  23 31 0d 49 84 15 20 20  20 54 45 51 20 20 20 72  |#1.I..   TEQ   r|
0000ad10  39 2c 23 97 22 2e 22 0d  49 8e 0f 20 20 20 ec 51  |9,#.".".I..   .Q|
0000ad20  20 72 38 2c 72 30 0d 49  98 14 20 20 20 43 4d 50  | r8,r0.I..   CMP|
0000ad30  20 20 20 72 39 2c 23 26  32 30 0d 49 a2 18 20 20  |   r9,#&20.I..  |
0000ad40  20 42 47 54 20 20 20 73  77 69 67 65 74 6c 65 61  | BGT   swigetlea|
0000ad50  66 31 0d 49 ac 12 20 20  20 4d 4f 56 20 20 20 72  |f1.I..   MOV   r|
0000ad60  31 2c 72 38 0d 49 b6 17  20 20 20 4c 44 4d 46 44  |1,r8.I..   LDMFD|
0000ad70  20 28 73 70 29 21 2c 7b  72 30 7d 0d 49 c0 14 20  | (sp)!,{r0}.I.. |
0000ad80  20 20 42 20 20 20 20 20  65 78 69 74 73 77 69 0d  |  B     exitswi.|
0000ad90  49 ca 05 3b 0d 49 d4 4c  3b 20 2a 2a 2a 2a 2a 2a  |I..;.I.L; ******|
0000ada0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
0000ade0  0d 49 de 4c 3b 20 2a 20  20 20 20 54 68 65 20 66  |.I.L; *    The f|
0000adf0  6f 6c 6c 6f 77 69 6e 67  20 72 6f 75 74 69 6e 65  |ollowing routine|
0000ae00  73 20 61 72 65 20 67 65  6e 65 72 61 6c 20 73 74  |s are general st|
0000ae10  72 69 6e 67 20 68 61 6e  64 6c 69 6e 67 20 72 6f  |ring handling ro|
0000ae20  75 74 69 6e 65 73 20 20  20 20 20 2a 0d 49 e8 4c  |utines     *.I.L|
0000ae30  3b 20 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |; **************|
0000ae40  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
0000ae70  2a 2a 2a 2a 2a 2a 2a 2a  0d 49 f2 05 3b 0d 49 fc  |********.I..;.I.|
0000ae80  10 3b 20 43 4f 4d 50 41  52 45 53 54 52 0d 4a 06  |.; COMPARESTR.J.|
0000ae90  10 3b 20 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 0d 4a 10  |.; ----------.J.|
0000aea0  05 3b 0d 4a 1a 43 3b 20  54 68 69 73 20 72 6f 75  |.;.J.C; This rou|
0000aeb0  74 69 6e 65 20 63 6f 6d  70 61 72 65 73 20 74 77  |tine compares tw|
0000aec0  6f 20 73 74 72 69 6e 67  73 20 61 72 65 20 72 65  |o strings are re|
0000aed0  74 75 72 6e 73 20 b9 20  69 66 20 65 71 75 61 6c  |turns . if equal|
0000aee0  20 6f 72 20 a3 0d 4a 24  0c 3b 20 69 66 20 6e 6f  | or ..J$.; if no|
0000aef0  74 0d 4a 2e 05 3b 0d 4a  38 14 3b 20 72 39 20 20  |t.J..;.J8.; r9  |
0000af00  3d 20 73 74 72 69 6e 67  20 31 0d 4a 42 14 3b 20  |= string 1.JB.; |
0000af10  72 31 30 20 3d 20 73 74  72 69 6e 67 20 32 0d 4a  |r10 = string 2.J|
0000af20  4c 05 3b 0d 4a 56 0d 3b  20 72 65 74 75 72 6e 73  |L.;.JV.; returns|
0000af30  0d 4a 60 05 3b 0d 4a 6a  12 3b 20 72 31 31 20 3d  |.J`.;.Jj.; r11 =|
0000af40  20 72 65 73 75 6c 74 0d  4a 74 05 3b 0d 4a 7e 0f  | result.Jt.;.J~.|
0000af50  2e 63 6f 6d 70 61 72 65  73 74 72 0d 4a 88 29 20  |.comparestr.J.) |
0000af60  20 20 53 54 4d 46 44 20  28 73 70 29 21 2c 7b 72  |  STMFD (sp)!,{r|
0000af70  30 2c 72 31 2c 72 32 2c  72 39 2c 72 31 30 2c 6c  |0,r1,r2,r9,r10,l|
0000af80  69 6e 6b 7d 0d 4a 92 13  20 20 20 4d 4f 56 20 20  |ink}.J..   MOV  |
0000af90  20 72 32 2c 23 33 32 0d  4a 9c 10 2e 63 6f 6d 70  | r2,#32.J...comp|
0000afa0  61 72 65 73 74 72 31 0d  4a a6 17 20 20 20 4c 44  |arestr1.J..   LD|
0000afb0  52 42 20 20 72 30 2c 5b  72 39 5d 2c 23 31 0d 4a  |RB  r0,[r9],#1.J|
0000afc0  b0 18 20 20 20 4c 44 52  42 20 20 72 31 2c 5b 72  |..   LDRB  r1,[r|
0000afd0  31 30 5d 2c 23 31 0d 4a  ba 12 20 20 20 43 4d 50  |10],#1.J..   CMP|
0000afe0  20 20 20 72 30 2c 72 32  0d 4a c4 12 20 20 20 43  |   r0,r2.J..   C|
0000aff0  4d 50 4c 54 20 72 31 2c  72 32 0d 4a ce 13 20 20  |MPLT r1,r2.J..  |
0000b000  20 4d 56 4e 4c 54 20 72  31 31 2c 23 30 0d 4a d8  | MVNLT r11,#0.J.|
0000b010  17 20 20 20 42 4c 54 20  20 20 63 6f 6d 70 61 72  |.   BLT   compar|
0000b020  65 6f 75 74 0d 4a e2 12  20 20 20 43 4d 50 20 20  |eout.J..   CMP  |
0000b030  20 72 30 2c 72 31 0d 4a  ec 18 20 20 20 42 45 51  | r0,r1.J..   BEQ|
0000b040  20 20 20 63 6f 6d 70 61  72 65 73 74 72 31 0d 4a  |   comparestr1.J|
0000b050  f6 13 20 20 20 4d 4f 56  20 20 20 72 31 31 2c 23  |..   MOV   r11,#|
0000b060  30 0d 4b 00 0f 2e 63 6f  6d 70 61 72 65 6f 75 74  |0.K...compareout|
0000b070  0d 4b 0a 27 20 20 20 4c  44 4d 46 44 20 28 73 70  |.K.'   LDMFD (sp|
0000b080  29 21 2c 7b 72 30 2c 72  31 2c 72 32 2c 72 39 2c  |)!,{r0,r1,r2,r9,|
0000b090  72 31 30 2c 70 63 7d 0d  4b 14 05 3b 0d 4b 1e 0f  |r10,pc}.K..;.K..|
0000b0a0  3b 20 43 48 45 43 4b 43  48 41 52 0d 4b 28 0f 3b  |; CHECKCHAR.K(.;|
0000b0b0  20 2d 2d 2d 2d 2d 2d 2d  2d 2d 0d 4b 32 05 3b 0d  | ---------.K2.;.|
0000b0c0  4b 3c 48 3b 20 54 68 69  73 20 72 6f 75 74 69 6e  |K<H; This routin|
0000b0d0  65 20 74 65 73 74 73 20  74 6f 20 73 65 65 20 77  |e tests to see w|
0000b0e0  68 65 74 68 65 72 20 61  20 63 65 72 74 61 69 6e  |hether a certain|
0000b0f0  20 63 68 61 72 61 63 74  65 72 20 69 73 20 63 6f  | character is co|
0000b100  6e 74 61 69 6e 65 64 0d  4b 46 17 3b 20 77 69 74  |ntained.KF.; wit|
0000b110  68 69 6e 20 74 68 65 20  73 74 72 69 6e 67 0d 4b  |hin the string.K|
0000b120  50 05 3b 0d 4b 5a 12 3b  20 72 39 20 20 3d 20 73  |P.;.KZ.; r9  = s|
0000b130  74 72 69 6e 67 0d 4b 64  15 3b 20 72 31 31 20 3d  |tring.Kd.; r11 =|
0000b140  20 63 68 61 72 61 63 74  65 72 0d 4b 6e 05 3b 0d  | character.Kn.;.|
0000b150  4b 78 0d 3b 20 72 65 74  75 72 6e 73 0d 4b 82 34  |Kx.; returns.K.4|
0000b160  3b 20 72 31 31 20 3d 20  2d 31 20 69 66 20 73 74  |; r11 = -1 if st|
0000b170  72 69 6e 67 20 63 6f 6e  74 61 69 6e 73 20 63 68  |ring contains ch|
0000b180  61 72 61 63 74 65 72 20  30 20 69 66 20 6e 6f 74  |aracter 0 if not|
0000b190  0d 4b 8c 05 3b 0d 4b 96  0e 2e 63 68 65 63 6b 63  |.K..;.K...checkc|
0000b1a0  68 61 72 0d 4b a0 22 20  20 20 53 54 4d 46 44 20  |har.K."   STMFD |
0000b1b0  28 73 70 29 21 2c 7b 72  30 2c 72 31 2c 72 39 2c  |(sp)!,{r0,r1,r9,|
0000b1c0  6c 69 6e 6b 7d 0d 4b aa  13 20 20 20 4d 4f 56 20  |link}.K..   MOV |
0000b1d0  20 20 72 31 2c 72 31 31  0d 4b b4 13 20 20 20 4d  |  r1,r11.K..   M|
0000b1e0  56 4e 20 20 20 72 31 31  2c 23 30 0d 4b be 0f 2e  |VN   r11,#0.K...|
0000b1f0  63 68 65 63 6b 63 68 61  72 31 0d 4b c8 17 20 20  |checkchar1.K..  |
0000b200  20 4c 44 52 42 20 20 72  30 2c 5b 72 39 5d 2c 23  | LDRB  r0,[r9],#|
0000b210  31 0d 4b d2 12 20 20 20  54 45 51 20 20 20 72 30  |1.K..   TEQ   r0|
0000b220  2c 72 31 0d 4b dc 10 20  20 20 ec 51 20 72 31 31  |,r1.K..   .Q r11|
0000b230  2c 23 30 0d 4b e6 13 20  20 20 43 4d 50 20 20 20  |,#0.K..   CMP   |
0000b240  72 30 2c 23 33 32 0d 4b  f0 17 20 20 20 42 47 45  |r0,#32.K..   BGE|
0000b250  20 20 20 63 68 65 63 6b  63 68 61 72 31 0d 4b fa  |   checkchar1.K.|
0000b260  20 20 20 20 4c 44 4d 46  44 20 28 73 70 29 21 2c  |    LDMFD (sp)!,|
0000b270  7b 72 30 2c 72 31 2c 72  39 2c 70 63 7d 0d 4c 04  |{r0,r1,r9,pc}.L.|
0000b280  05 3b 0d 4c 0e 0b 3b 20  a5 4c 45 41 46 0d 4c 18  |.;.L..; .LEAF.L.|
0000b290  0d 3b 20 2d 2d 2d 2d 2d  2d 2d 0d 4c 22 05 3b 0d  |.; -------.L".;.|
0000b2a0  4c 2c 4b 3b 20 54 68 69  73 20 72 6f 75 74 69 6e  |L,K; This routin|
0000b2b0  65 20 72 65 74 75 72 6e  73 20 72 39 20 70 6f 69  |e returns r9 poi|
0000b2c0  6e 74 69 6e 67 20 74 6f  20 74 68 65 20 6c 65 61  |nting to the lea|
0000b2d0  66 20 6f 66 20 74 68 65  20 73 74 72 69 6e 67 20  |f of the string |
0000b2e0  70 6f 69 6e 74 65 64 20  74 6f 0d 4c 36 0b 3b 20  |pointed to.L6.; |
0000b2f0  62 79 20 72 39 0d 4c 40  05 3b 0d 4c 4a 12 3b 20  |by r9.L@.;.LJ.; |
0000b300  72 39 20 20 3d 20 73 74  72 69 6e 67 0d 4c 54 05  |r9  = string.LT.|
0000b310  3b 0d 4c 5e 0d 3b 20 72  65 74 75 72 6e 73 0d 4c  |;.L^.; returns.L|
0000b320  68 1a 3b 20 72 39 20 20  3d 20 6c 65 61 66 20 6f  |h.; r9  = leaf o|
0000b330  66 20 73 74 72 69 6e 67  0d 4c 72 05 3b 0d 4c 7c  |f string.Lr.;.L||
0000b340  0c 2e 67 65 74 6c 65 61  66 0d 4c 86 1f 20 20 20  |..getleaf.L..   |
0000b350  53 54 4d 46 44 20 28 73  70 29 21 2c 7b 72 30 2c  |STMFD (sp)!,{r0,|
0000b360  72 31 2c 6c 69 6e 6b 7d  0d 4c 90 48 20 20 20 4d  |r1,link}.L.H   M|
0000b370  4f 56 20 20 20 72 31 2c  72 39 20 20 20 20 20 20  |OV   r1,r9      |
0000b380  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000b390  20 20 20 3b 20 73 74 6f  72 65 20 73 74 61 72 74  |   ; store start|
0000b3a0  20 6f 66 20 73 63 72 65  65 6e 20 69 6e 20 72 31  | of screen in r1|
0000b3b0  0d 4c 9a 0d 2e 67 65 74  6c 65 61 66 31 0d 4c a4  |.L...getleaf1.L.|
0000b3c0  48 20 20 20 4c 44 52 42  20 20 72 30 2c 5b 72 39  |H   LDRB  r0,[r9|
0000b3d0  5d 2c 23 31 20 20 20 20  20 20 20 20 20 20 20 20  |],#1            |
0000b3e0  20 20 20 20 20 20 20 20  3b 20 67 65 74 20 61 20  |        ; get a |
0000b3f0  63 68 61 72 61 63 74 65  72 20 61 6e 64 20 72 39  |character and r9|
0000b400  3d 72 39 2b 31 0d 4c ae  34 20 20 20 54 45 51 20  |=r9+1.L.4   TEQ |
0000b410  20 20 72 30 2c 23 97 22  2e 22 20 20 20 20 20 20  |  r0,#."."      |
0000b420  20 20 20 20 20 20 20 20  20 20 20 20 20 20 3b 20  |              ; |
0000b430  69 73 20 69 74 20 61 20  2e 0d 4c b8 48 20 20 20  |is it a ..L.H   |
0000b440  ec 51 20 72 31 2c 72 39  20 20 20 20 20 20 20 20  |.Q r1,r9        |
0000b450  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000b460  20 3b 20 70 75 74 20 72  31 3d 72 39 20 28 63 68  | ; put r1=r9 (ch|
0000b470  61 72 61 63 74 65 72 20  61 66 74 65 72 20 2e 20  |aracter after . |
0000b480  29 0d 4c c2 3b 20 20 20  43 4d 50 20 20 20 72 30  |).L.;   CMP   r0|
0000b490  2c 23 33 32 20 20 20 20  20 20 20 20 20 20 20 20  |,#32            |
0000b4a0  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 65 6e  |            ; en|
0000b4b0  64 20 6f 66 20 73 74 72  69 6e 67 3f 0d 4c cc 45  |d of string?.L.E|
0000b4c0  20 20 20 42 47 45 20 20  20 67 65 74 6c 65 61 66  |   BGE   getleaf|
0000b4d0  31 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |1               |
0000b4e0  20 20 20 20 20 20 20 3b  20 6e 6f 20 20 2d 20 67  |       ; no  - g|
0000b4f0  65 74 20 6e 65 78 74 20  63 68 61 72 61 63 74 65  |et next characte|
0000b500  72 0d 4c d6 4d 20 20 20  4d 4f 56 20 20 20 72 39  |r.L.M   MOV   r9|
0000b510  2c 72 31 20 20 20 20 20  20 20 20 20 20 20 20 20  |,r1             |
0000b520  20 20 20 20 20 20 20 20  20 20 20 20 3b 20 79 65  |            ; ye|
0000b530  73 20 2d 20 70 75 74 20  72 39 3d 72 31 20 3c 65  |s - put r9=r1 <e|
0000b540  69 74 68 65 72 20 73 74  61 72 74 20 6f 66 0d 4c  |ither start of.L|
0000b550  e0 4a 20 20 20 4c 44 4d  46 44 20 28 73 70 29 21  |.J   LDMFD (sp)!|
0000b560  2c 7b 72 30 2c 72 31 2c  70 63 7d 20 20 20 20 20  |,{r0,r1,pc}     |
0000b570  20 20 20 20 20 20 20 20  20 3b 20 73 74 72 69 6e  |         ; strin|
0000b580  67 20 6f 72 20 73 74 61  72 74 20 6f 66 20 6c 65  |g or start of le|
0000b590  61 66 20 6e 61 6d 65 3e  0d 4c ea 05 3b 0d 4c f4  |af name>.L..;.L.|
0000b5a0  12 3b 20 43 4f 55 4e 54  53 50 45 43 49 41 4c 0d  |.; COUNTSPECIAL.|
0000b5b0  4c fe 12 3b 20 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |L..; -----------|
0000b5c0  2d 0d 4d 08 05 3b 0d 4d  12 4d 3b 20 43 6f 75 6e  |-.M..;.M.M; Coun|
0000b5d0  74 73 20 74 68 65 20 63  68 61 72 61 63 74 65 72  |ts the character|
0000b5e0  73 20 69 6e 20 61 20 73  74 72 69 6e 67 20 75 70  |s in a string up|
0000b5f0  20 74 6f 20 62 75 74 20  6e 6f 74 20 69 6e 63 6c  | to but not incl|
0000b600  75 64 69 6e 67 20 74 68  65 20 63 68 61 72 61 63  |uding the charac|
0000b610  74 65 72 0d 4d 1c 0c 3b  20 69 6e 20 72 31 30 0d  |ter.M..; in r10.|
0000b620  4d 26 05 3b 0d 4d 30 19  3b 20 72 39 20 20 3d 20  |M&.;.M0.; r9  = |
0000b630  73 6f 75 72 63 65 20 73  74 72 69 6e 67 0d 4d 3a  |source string.M:|
0000b640  21 3b 20 72 31 30 20 3d  20 63 68 61 72 61 63 74  |!; r10 = charact|
0000b650  65 72 20 74 6f 20 63 6f  75 6e 74 20 74 6f 0d 4d  |er to count to.M|
0000b660  44 28 3b 20 72 31 31 20  3d 20 6e 75 6d 62 65 72  |D(; r11 = number|
0000b670  20 6f 66 20 63 68 61 72  61 63 74 65 72 73 20 63  | of characters c|
0000b680  6f 75 6e 74 65 64 0d 4d  4e 05 3b 0d 4d 58 11 2e  |ounted.MN.;.MX..|
0000b690  63 6f 75 6e 74 73 70 65  63 69 61 6c 0d 4d 62 1c  |countspecial.Mb.|
0000b6a0  20 20 20 53 54 4d 46 44  20 28 73 70 29 21 2c 7b  |   STMFD (sp)!,{|
0000b6b0  72 30 2c 6c 69 6e 6b 7d  0d 4d 6c 13 20 20 20 4d  |r0,link}.Ml.   M|
0000b6c0  4f 56 20 20 20 72 31 31  2c 23 30 0d 4d 76 0c 2e  |OV   r11,#0.Mv..|
0000b6d0  63 6f 75 6e 74 73 31 0d  4d 80 17 20 20 20 4c 44  |counts1.M..   LD|
0000b6e0  52 42 20 20 72 30 2c 5b  72 39 5d 2c 23 31 0d 4d  |RB  r0,[r9],#1.M|
0000b6f0  8a 13 20 20 20 43 4d 50  20 20 20 72 30 2c 23 33  |..   CMP   r0,#3|
0000b700  32 0d 4d 94 19 20 20 20  84 52 4c 54 20 72 31 31  |2.M..   .RLT r11|
0000b710  2c 72 31 31 2c 23 26 31  30 30 0d 4d 9e 16 20 20  |,r11,#&100.M..  |
0000b720  20 42 4c 54 20 20 20 63  6f 75 6e 74 73 6f 75 74  | BLT   countsout|
0000b730  0d 4d a8 13 20 20 20 54  45 51 20 20 20 72 30 2c  |.M..   TEQ   r0,|
0000b740  72 31 30 0d 4d b2 17 20  20 20 41 44 44 4e 45 20  |r10.M..   ADDNE |
0000b750  72 31 31 2c 72 31 31 2c  23 31 0d 4d bc 14 20 20  |r11,r11,#1.M..  |
0000b760  20 42 4e 45 20 20 20 63  6f 75 6e 74 73 31 0d 4d  | BNE   counts1.M|
0000b770  c6 0e 2e 63 6f 75 6e 74  73 6f 75 74 0d 4d d0 1a  |...countsout.M..|
0000b780  20 20 20 4c 44 4d 46 44  20 28 73 70 29 21 2c 7b  |   LDMFD (sp)!,{|
0000b790  72 30 2c 70 63 7d 0d 4d  da 05 3b 0d 4d e4 0f 3b  |r0,pc}.M..;.M..;|
0000b7a0  20 43 4f 50 59 43 48 41  52 53 0d 4d ee 0f 3b 20  | COPYCHARS.M..; |
0000b7b0  2d 2d 2d 2d 2d 2d 2d 2d  2d 0d 4d f8 05 3b 0d 4e  |---------.M..;.N|
0000b7c0  02 49 3b 20 43 6f 70 69  65 73 20 72 31 31 20 63  |.I; Copies r11 c|
0000b7d0  68 61 72 61 63 74 65 72  73 20 66 72 6f 6d 20 74  |haracters from t|
0000b7e0  68 65 20 73 74 72 69 6e  67 20 70 6f 69 6e 74 65  |he string pointe|
0000b7f0  64 20 74 6f 20 62 79 20  72 39 20 74 6f 20 74 68  |d to by r9 to th|
0000b800  65 20 62 6c 6f 63 6b 0d  4e 0c 44 3b 20 70 6f 69  |e block.N.D; poi|
0000b810  6e 74 65 64 20 74 6f 20  62 79 20 72 31 30 20 65  |nted to by r10 e|
0000b820  6e 64 69 6e 67 20 74 68  65 20 73 74 72 69 6e 67  |nding the string|
0000b830  20 77 69 74 68 20 61 20  4e 55 4c 4c 20 63 68 61  | with a NULL cha|
0000b840  72 61 63 74 65 72 20 28  bd 30 29 0d 4e 16 05 3b  |racter (.0).N..;|
0000b850  0d 4e 20 19 3b 20 72 39  20 20 3d 20 73 6f 75 72  |.N .; r9  = sour|
0000b860  63 65 20 73 74 72 69 6e  67 0d 4e 2a 1e 3b 20 72  |ce string.N*.; r|
0000b870  31 30 20 3d 20 64 65 73  74 69 6e 61 74 69 6f 6e  |10 = destination|
0000b880  20 73 74 72 69 6e 67 0d  4e 34 28 3b 20 72 31 31  | string.N4(; r11|
0000b890  20 3d 20 6e 75 6d 62 65  72 20 6f 66 20 63 68 61  | = number of cha|
0000b8a0  72 61 63 74 65 72 73 20  74 6f 20 63 6f 70 79 0d  |racters to copy.|
0000b8b0  4e 3e 05 3b 0d 4e 48 0e  2e 63 6f 70 79 63 68 61  |N>.;.NH..copycha|
0000b8c0  72 73 0d 4e 52 1c 20 20  20 53 54 4d 46 44 20 28  |rs.NR.   STMFD (|
0000b8d0  73 70 29 21 2c 7b 72 30  2c 6c 69 6e 6b 7d 0d 4e  |sp)!,{r0,link}.N|
0000b8e0  5c 0e 2e 63 6f 70 79 63  68 61 72 31 0d 4e 66 17  |\..copychar1.Nf.|
0000b8f0  20 20 20 4c 44 52 42 20  20 72 30 2c 5b 72 39 5d  |   LDRB  r0,[r9]|
0000b900  2c 23 31 0d 4e 70 18 20  20 20 53 54 52 42 20 20  |,#1.Np.   STRB  |
0000b910  72 30 2c 5b 72 31 30 5d  2c 23 31 0d 4e 7a 17 20  |r0,[r10],#1.Nz. |
0000b920  20 20 53 55 42 53 20 20  72 31 31 2c 72 31 31 2c  |  SUBS  r11,r11,|
0000b930  23 31 0d 4e 84 16 20 20  20 42 4e 45 20 20 20 63  |#1.N..   BNE   c|
0000b940  6f 70 79 63 68 61 72 31  0d 4e 8e 19 20 20 20 53  |opychar1.N..   S|
0000b950  54 52 42 20 20 72 31 31  2c 5b 72 31 30 2c 23 30  |TRB  r11,[r10,#0|
0000b960  5d 0d 4e 98 1a 20 20 20  4c 44 4d 46 44 20 28 73  |].N..   LDMFD (s|
0000b970  70 29 21 2c 7b 72 30 2c  70 63 7d 0d 4e a2 05 3b  |p)!,{r0,pc}.N..;|
0000b980  0d 4e ac 10 3b 20 43 4f  50 59 53 54 52 49 4e 47  |.N..; COPYSTRING|
0000b990  0d 4e b6 10 3b 20 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.N..; ----------|
0000b9a0  0d 4e c0 05 3b 0d 4e ca  4d 3b 20 43 6f 70 69 65  |.N..;.N.M; Copie|
0000b9b0  73 20 74 68 65 20 73 74  72 69 6e 67 20 70 6f 69  |s the string poi|
0000b9c0  6e 74 65 64 20 74 6f 20  62 79 20 72 39 20 74 6f  |nted to by r9 to|
0000b9d0  20 74 68 65 20 62 6c 6f  63 6b 20 70 6f 69 6e 74  | the block point|
0000b9e0  65 64 20 74 6f 20 62 79  20 72 31 30 2e 20 20 54  |ed to by r10.  T|
0000b9f0  68 65 0d 4e d4 4d 3b 20  6d 61 78 69 6d 75 6d 20  |he.N.M; maximum |
0000ba00  73 69 7a 65 20 6f 66 20  74 68 65 20 73 74 72 69  |size of the stri|
0000ba10  6e 67 20 69 73 20 68 65  6c 64 20 69 6e 20 72 31  |ng is held in r1|
0000ba20  31 2e 20 20 49 66 20 74  68 65 20 73 74 72 69 6e  |1.  If the strin|
0000ba30  67 20 61 74 20 72 39 20  65 78 63 65 65 64 73 0d  |g at r9 exceeds.|
0000ba40  4e de 2f 3b 20 74 68 69  73 20 74 68 65 6e 20 6f  |N./; this then o|
0000ba50  6e 6c 79 20 72 31 31 20  63 68 61 72 61 63 74 65  |nly r11 characte|
0000ba60  72 73 20 61 72 65 20 63  6f 70 69 65 64 2e 0d 4e  |rs are copied..N|
0000ba70  e8 05 3b 0d 4e f2 4d 3b  20 72 39 20 20 3d 20 73  |..;.N.M; r9  = s|
0000ba80  6f 75 72 63 65 20 73 74  72 69 6e 67 20 65 6e 64  |ource string end|
0000ba90  69 6e 67 20 69 6e 20 61  20 63 68 61 72 61 63 74  |ing in a charact|
0000baa0  65 72 20 76 61 6c 75 65  20 6f 66 20 3c 20 33 32  |er value of < 32|
0000bab0  20 69 65 20 63 6f 6e 74  72 6f 6c 20 63 68 61 72  | ie control char|
0000bac0  0d 4e fc 47 3b 20 72 31  30 20 3d 20 64 65 73 74  |.N.G; r10 = dest|
0000bad0  69 6e 61 74 69 6f 6e 20  62 6c 6f 63 6b 2e 20 20  |ination block.  |
0000bae0  49 74 20 65 6e 64 73 20  73 74 72 69 6e 67 20 69  |It ends string i|
0000baf0  6e 20 61 20 4e 55 4c 4c  20 28 bd 30 29 20 63 68  |n a NULL (.0) ch|
0000bb00  61 72 61 63 74 65 72 0d  4f 06 21 3b 20 72 31 31  |aracter.O.!; r11|
0000bb10  20 3d 20 6d 61 78 69 6d  75 6d 20 73 74 72 69 6e  | = maximum strin|
0000bb20  67 20 6c 65 6e 67 74 68  0d 4f 10 05 3b 0d 4f 1a  |g length.O..;.O.|
0000bb30  26 3b 20 72 65 74 75 72  6e 73 20 74 68 65 20 66  |&; returns the f|
0000bb40  6f 6c 6c 6f 77 69 6e 67  20 70 61 72 61 6d 65 74  |ollowing paramet|
0000bb50  65 72 73 0d 4f 24 30 3b  20 72 31 30 20 3d 20 62  |ers.O$0; r10 = b|
0000bb60  79 74 65 20 61 66 74 65  72 20 65 6e 64 20 6f 66  |yte after end of|
0000bb70  20 64 65 73 74 69 6e 61  74 69 6f 6e 20 73 74 72  | destination str|
0000bb80  69 6e 67 0d 4f 2e 23 3b  20 72 31 31 20 3d 20 6c  |ing.O.#; r11 = l|
0000bb90  65 6e 67 74 68 20 6f 66  20 73 74 72 69 6e 67 20  |ength of string |
0000bba0  63 6f 70 69 65 64 0d 4f  38 05 3b 0d 4f 42 0f 2e  |copied.O8.;.OB..|
0000bbb0  63 6f 70 79 73 74 72 69  6e 67 0d 4f 4c 1f 20 20  |copystring.OL.  |
0000bbc0  20 53 54 4d 46 44 20 28  73 70 29 21 2c 7b 72 30  | STMFD (sp)!,{r0|
0000bbd0  2c 72 31 2c 6c 69 6e 6b  7d 0d 4f 56 12 20 20 20  |,r1,link}.OV.   |
0000bbe0  4d 4f 56 20 20 20 72 30  2c 23 30 0d 4f 60 0d 2e  |MOV   r0,#0.O`..|
0000bbf0  63 6f 70 79 73 74 72 31  0d 4f 6a 17 20 20 20 4c  |copystr1.Oj.   L|
0000bc00  44 52 42 20 20 72 31 2c  5b 72 39 2c 72 30 5d 0d  |DRB  r1,[r9,r0].|
0000bc10  4f 74 18 20 20 20 53 54  52 42 20 20 72 31 2c 5b  |Ot.   STRB  r1,[|
0000bc20  72 31 30 2c 72 30 5d 0d  4f 7e 15 20 20 20 41 44  |r10,r0].O~.   AD|
0000bc30  44 20 20 20 72 30 2c 72  30 2c 23 31 0d 4f 88 13  |D   r0,r0,#1.O..|
0000bc40  20 20 20 43 4d 50 20 20  20 72 30 2c 72 31 31 0d  |   CMP   r0,r11.|
0000bc50  4f 92 15 20 20 20 42 47  45 20 20 20 63 6f 70 79  |O..   BGE   copy|
0000bc60  73 74 72 32 0d 4f 9c 13  20 20 20 43 4d 50 20 20  |str2.O..   CMP  |
0000bc70  20 72 31 2c 23 33 32 0d  4f a6 15 20 20 20 42 47  | r1,#32.O..   BG|
0000bc80  45 20 20 20 63 6f 70 79  73 74 72 31 0d 4f b0 0d  |E   copystr1.O..|
0000bc90  2e 63 6f 70 79 73 74 72  32 0d 4f ba 12 20 20 20  |.copystr2.O..   |
0000bca0  4d 4f 56 20 20 20 72 31  2c 23 30 0d 4f c4 18 20  |MOV   r1,#0.O.. |
0000bcb0  20 20 53 54 52 42 20 20  72 31 2c 5b 72 31 30 2c  |  STRB  r1,[r10,|
0000bcc0  72 30 5d 0d 4f ce 16 20  20 20 41 44 44 20 20 20  |r0].O..   ADD   |
0000bcd0  72 31 31 2c 72 30 2c 23  31 0d 4f d8 18 20 20 20  |r11,r0,#1.O..   |
0000bce0  41 44 44 20 20 20 72 31  30 2c 72 31 30 2c 72 31  |ADD   r10,r10,r1|
0000bcf0  31 0d 4f e2 1d 20 20 20  4c 44 4d 46 44 20 28 73  |1.O..   LDMFD (s|
0000bd00  70 29 21 2c 7b 72 30 2c  72 31 2c 70 63 7d 0d 4f  |p)!,{r0,r1,pc}.O|
0000bd10  ec 05 3b 0d 4f f6 10 3b  20 43 4f 55 4e 54 43 48  |..;.O..; COUNTCH|
0000bd20  41 52 53 0d 50 00 10 3b  20 2d 2d 2d 2d 2d 2d 2d  |ARS.P..; -------|
0000bd30  2d 2d 2d 0d 50 0a 05 3b  0d 50 14 4a 3b 20 54 68  |---.P..;.P.J; Th|
0000bd40  65 20 72 6f 75 74 69 6e  65 20 63 6f 75 6e 74 73  |e routine counts|
0000bd50  20 74 68 65 20 6e 75 6d  62 65 72 20 6f 66 20 63  | the number of c|
0000bd60  68 61 72 61 63 74 65 72  73 20 69 6e 20 74 68 65  |haracters in the|
0000bd70  20 73 74 72 69 6e 67 20  61 74 20 52 39 2e 20 20  | string at R9.  |
0000bd80  49 74 0d 50 1e 4f 3b 20  63 6f 75 6e 74 73 20 61  |It.P.O; counts a|
0000bd90  6c 6c 20 63 68 61 72 61  63 74 65 72 73 20 75 70  |ll characters up|
0000bda0  20 74 6f 20 62 75 74 20  6e 6f 74 20 69 6e 63 6c  | to but not incl|
0000bdb0  75 64 69 6e 67 20 74 68  65 20 66 69 72 73 74 20  |uding the first |
0000bdc0  63 6f 6e 74 72 6f 6c 20  63 68 61 72 61 63 74 65  |control characte|
0000bdd0  72 0d 50 28 17 3b 20 69  65 20 63 68 61 72 61 63  |r.P(.; ie charac|
0000bde0  74 65 72 20 3c 20 33 32  0d 50 32 05 3b 0d 50 3c  |ter < 32.P2.;.P<|
0000bdf0  19 3b 20 72 39 20 20 3d  20 73 6f 75 72 63 65 20  |.; r9  = source |
0000be00  73 74 72 69 6e 67 0d 50  46 05 3b 0d 50 50 0d 3b  |string.PF.;.PP.;|
0000be10  20 72 65 74 75 72 6e 73  0d 50 5a 1c 3b 20 72 31  | returns.PZ.; r1|
0000be20  31 20 3d 20 6c 65 6e 67  74 68 20 6f 66 20 73 74  |1 = length of st|
0000be30  72 69 6e 67 0d 50 64 05  3b 0d 50 6e 0f 2e 63 6f  |ring.Pd.;.Pn..co|
0000be40  75 6e 74 63 68 61 72 73  0d 50 78 1c 20 20 20 53  |untchars.Px.   S|
0000be50  54 4d 46 44 20 28 73 70  29 21 2c 7b 72 30 2c 6c  |TMFD (sp)!,{r0,l|
0000be60  69 6e 6b 7d 0d 50 82 13  20 20 20 4d 4f 56 20 20  |ink}.P..   MOV  |
0000be70  20 72 31 31 2c 23 30 0d  50 8c 0b 2e 63 6f 75 6e  | r11,#0.P...coun|
0000be80  74 31 0d 50 96 18 20 20  20 4c 44 52 42 20 20 72  |t1.P..   LDRB  r|
0000be90  30 2c 5b 72 39 2c 72 31  31 5d 0d 50 a0 13 20 20  |0,[r9,r11].P..  |
0000bea0  20 43 4d 50 20 20 20 72  30 2c 23 33 32 0d 50 aa  | CMP   r0,#32.P.|
0000beb0  13 20 20 20 42 4c 54 20  20 20 63 6f 75 6e 74 32  |.   BLT   count2|
0000bec0  0d 50 b4 17 20 20 20 41  44 44 20 20 20 72 31 31  |.P..   ADD   r11|
0000bed0  2c 72 31 31 2c 23 31 0d  50 be 15 20 20 20 43 4d  |,r11,#1.P..   CM|
0000bee0  50 20 20 20 72 31 31 2c  23 32 35 35 0d 50 c8 13  |P   r11,#255.P..|
0000bef0  20 20 20 42 4c 54 20 20  20 63 6f 75 6e 74 31 0d  |   BLT   count1.|
0000bf00  50 d2 1c 20 20 20 4c 44  4d 46 44 20 28 73 70 29  |P..   LDMFD (sp)|
0000bf10  21 2c 7b 72 30 2c 6c 69  6e 6b 7d 0d 50 dc 17 20  |!,{r0,link}.P.. |
0000bf20  20 20 41 44 52 20 20 20  72 30 2c 74 6f 6f 6c 6f  |  ADR   r0,toolo|
0000bf30  6e 67 0d 50 e6 1c 20 20  20 84 52 20 20 20 6c 69  |ng.P..   .R   li|
0000bf40  6e 6b 2c 6c 69 6e 6b 2c  23 31 3c 3c 32 38 0d 50  |nk,link,#1<<28.P|
0000bf50  f0 14 20 20 20 4d 4f 56  53 20 20 70 63 2c 6c 69  |..   MOVS  pc,li|
0000bf60  6e 6b 0d 50 fa 0b 2e 63  6f 75 6e 74 32 0d 51 04  |nk.P...count2.Q.|
0000bf70  1a 20 20 20 4c 44 4d 46  44 20 28 73 70 29 21 2c  |.   LDMFD (sp)!,|
0000bf80  7b 72 30 2c 70 63 7d 0d  51 0e 05 3b 0d 51 18 0c  |{r0,pc}.Q..;.Q..|
0000bf90  2e 74 6f 6f 6c 6f 6e 67  0d 51 22 14 45 51 55 44  |.toolong.Q".EQUD|
0000bfa0  20 45 72 72 6f 72 42 61  73 65 2b 32 0d 51 2c 2e  | ErrorBase+2.Q,.|
0000bfb0  45 51 55 53 20 22 54 65  78 74 20 73 74 72 69 6e  |EQUS "Text strin|
0000bfc0  67 20 69 73 20 74 6f 6f  20 6c 6f 6e 67 20 66 6f  |g is too long fo|
0000bfd0  72 20 57 69 6d 70 4c 69  62 22 0d 51 36 0a 45 51  |r WimpLib".Q6.EQ|
0000bfe0  55 42 20 30 0d 51 40 09  41 4c 49 47 4e 0d 51 4a  |UB 0.Q@.ALIGN.QJ|
0000bff0  05 3b 0d 51 54 0b 2e 74  6f 6f 66 61 72 0d 51 5e  |.;.QT..toofar.Q^|
0000c000  18 20 20 20 53 57 49 20  20 20 22 4f 53 5f 57 72  |.   SWI   "OS_Wr|
0000c010  69 74 65 53 22 0d 51 68  32 45 51 55 53 20 22 4a  |iteS".Qh2EQUS "J|
0000c020  75 6d 70 27 73 20 67 6f  6e 65 20 74 6f 6f 20 66  |ump's gone too f|
0000c030  61 72 21 21 21 21 21 21  21 21 21 21 21 21 21 21  |ar!!!!!!!!!!!!!!|
0000c040  21 21 21 21 21 21 22 0d  51 72 0a 45 51 55 42 20  |!!!!!!".Qr.EQUB |
0000c050  30 0d 51 7c 09 41 4c 49  47 4e 0d 51 86 17 20 20  |0.Q|.ALIGN.Q..  |
0000c060  20 4c 44 4d 46 44 20 28  73 70 29 21 2c 7b 70 63  | LDMFD (sp)!,{pc|
0000c070  7d 0d 51 90 05 3b 0d 51  9a 05 5d 0d 51 a4 0b ed  |}.Q..;.Q..].Q...|
0000c080  20 70 61 73 73 25 0d 51  ae 29 ff 20 22 53 61 76  | pass%.Q.). "Sav|
0000c090  65 20 57 69 6d 70 54 6f  6f 6c 73 20 22 2b c3 7e  |e WimpTools "+.~|
0000c0a0  73 74 6f 72 65 25 2b 22  20 22 2b c3 7e 4f 25 0d  |store%+" "+.~O%.|
0000c0b0  51 b8 1d 2a 53 45 54 54  59 50 45 20 57 69 6d 70  |Q..*SETTYPE Wimp|
0000c0c0  54 6f 6f 6c 73 20 6d 6f  64 75 6c 65 0d 51 c2 05  |Tools module.Q..|
0000c0d0  e0 0d ff                                          |...|
0000c0d3